query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
72b11683e80bf58765f462ba0539a628
function when DEL button is pressed to go back one number
[ { "docid": "92000ea8b2576ccff65149ae2d6798d8", "score": "0.0", "text": "function backspace(){\n var b = a.value;\n var bLength = b.length-1;\n a.value = b.substring(0,bLength); \n}", "title": "" } ]
[ { "docid": "acbb8256adc0806ce70fcb3c66e80532", "score": "0.68252367", "text": "deleteNumber () {\n const newValue = this.data.currentValue.slice(0, -1);\n if (newValue === '') {\n this.blinkDisplay();\n this.clearCurrentValue();\n } else {\n this.data.currentValue = newValue;\n this.updateDisplay();\n }\n }", "title": "" }, { "docid": "8f688f2fba4f8329c6d634ef6d0a0f8c", "score": "0.6762522", "text": "function back() {\n (currentValue.length === 1) ? currentValue = \"0\": currentValue = currentValue.slice(0, -1);\n operation = \"\";\n updateDisplay();\n}", "title": "" }, { "docid": "290dc6f3399acdc59682ac9bad2142e5", "score": "0.67453176", "text": "deleteNumber() {\n const length = this.bcNumberModel.length;\n\n // If at least one number exists\n if (length > 0) {\n this.bcNumberModel = this.bcNumberModel.substring(0, length - 1);\n } else {\n // TODO: Expose something via two-way binding rather than using $emit\n this.$rootScope.$emit('KeypadGoBack');\n }\n }", "title": "" }, { "docid": "1df0c6efd1042f35bae6f9045cfaaf07", "score": "0.6719401", "text": "function deleteNum() {\n if (screen.textContent != \"0\")\n screen.textContent = screen.textContent.toString().slice(0, -1);\n}", "title": "" }, { "docid": "ee3672508838ab957e03cae6f3c01a8c", "score": "0.6592291", "text": "function Back() {\n var len = Display.value.length;\n var result = ((keep > 0 && len > 1) || (keep < 0 && len > 2)) ?\n Display.value.substring(0, len - 1) : 0;\n\n Update(result);\n}", "title": "" }, { "docid": "3342e81ff1f5c2fb6bd49f1ed7e6d1d4", "score": "0.65392345", "text": "function handleBack(e) {\n // If the user is not typing, do not delete anything\n if (!hasUserTyped) {\n return;\n }\n\n // Slice off the last input\n if (userInput.toString().length === 1) {\n // We do not delete everything - if the last input is deleted, display 0\n userInput = 0;\n } else {\n // Otherwise slice the last input off\n userInput = userInput.toString().slice(0, userInput.toString().length - 1);\n }\n \n updateScreen(Number(userInput));\n}", "title": "" }, { "docid": "23b7b8344311dbc7f39b775774c46680", "score": "0.65271", "text": "function deleteCurrentNumber(){\n $('#number').text('0');\n $('#sign').text('');\n}", "title": "" }, { "docid": "b677136d2c35bb793c812f22402cda0b", "score": "0.6499031", "text": "function backspace() {\n\tvar number = meow.value;\n\tvar len = number.length-1;\n\tvar newNumber = number.substring(0, len);\n\tmeow.value=newNumber;\n}", "title": "" }, { "docid": "67df910c1d78ecf87010e83734c4a60d", "score": "0.6425647", "text": "function getBack(){\r\n\t\r\n\t\tnumberBack = keepNumber1.split(\"\");//convertimos el número escrito en un array\r\n\t\tif(numberBack.length>1){\r\n\t\t\tnumberBack.splice(numberBack.length-1,1);//eliminamos el último elemento del número\r\n\t\t\tbackNumber = numberBack.join(\"\");//volvemos a convertir el array en string\r\n\t\t\tpantalla.innerHTML = backNumber;//Lo mostramos en pantalla\r\n\t\t\tkeepNumber1 = backNumber;// Guardamos el número resultante en la variable inicial\r\n\t\t}else{// Si sólo queda un número por borrar, pon la calculadora a cero.\r\n\t\t\treset();\r\n\t\t}\r\n\r\n\t\r\n}", "title": "" }, { "docid": "01b0c081fdbc724e7691d1724d9e6e60", "score": "0.6375806", "text": "function backSpace(){\r\n\tvar numpad = document.forms[0].numpad;\r\n\tnumpad.value = numpad.value.substring(0, numpad.value.length - 1);\r\n}", "title": "" }, { "docid": "1b5718252440bd506facd31b693f7f8b", "score": "0.6375095", "text": "function del() {\n\n // defining the calculator's current input for reference\n var currentInput = document.getElementById('numberInput').value;\n \n\n // re-defining current input without the last character:\n document.getElementById('numberInput').value = currentInput.substring(0, currentInput.length - 1);\n\n}", "title": "" }, { "docid": "c761e0910d56322226d99e510dfe3373", "score": "0.6331437", "text": "function decrement() {\n incrementBy(-1);\n }", "title": "" }, { "docid": "e9d4a58a0dbafe3ddcdf10f8f1ec987e", "score": "0.6323722", "text": "function backSpace(){\n num.pop();\n let value = document.getElementById(\"inputDisplay\").value;\n document.getElementById(\"inputDisplay\").value = value.substr(0, value.length - 1);\n}", "title": "" }, { "docid": "fbe1b128e6d8c2375fe1767867aa7678", "score": "0.6300687", "text": "function decrement() {\n if($index === 0)\n $index = getLastIndex();\n else\n $index--;\n }", "title": "" }, { "docid": "a631ae6c22b913f94d9d3d3917728156", "score": "0.62630594", "text": "function back(number) {\n $('#instruction-' + (number + 1)).hide();\n $('#instruction-' + number).show();\n}", "title": "" }, { "docid": "082a86dd2e5126301b7f9fa9e29c2919", "score": "0.61973786", "text": "function del(){\n if(deleteButton.value == \"AC\")\n {\n input.value = \"0\";\n dot_added = false;\n operator_added = false;\n deleteButton.value = \"CE\";\n }\n else\n {\n // increment the errors when we press the CE button\n // but only when we actually have something to delete\n if(input.value != \"0\")\n {\n incrementErrors();\n }\n\n var last_char = input.value.charAt(input.value.length-1);\n if(last_char == \".\") dot_added = false;\n else if(operators.indexOf(last_char) > -1) operator_added = false;\n\n input.value = input.value.substr(0, input.value.length-1);\n last_char = input.value.charAt(input.value.length-1);\n\n if(last_char == \".\") dot_added = true;\n else if(operators.indexOf(last_char) > -1) operator_added = true;\n\n if(input.value.length == 0) input.value = \"0\";\n }\n}", "title": "" }, { "docid": "e0ce347178d27d652ca32dbfa574ad3d", "score": "0.61734825", "text": "function cDelete() {\n displayValue = displayValue.slice(0,-1);\n updateDisplay(displayValue);\n}", "title": "" }, { "docid": "f7a9241a600a7a052d9b6b10a28923ce", "score": "0.6172357", "text": "function dec_contador(contador){\n\t\t\t /* !!!!!!!!!!!!!!!!!!!!!! CODIGO !!!!!!!!!!!!!!!!!!!! */\t\n contador.innerHTML = +contador.innerHTML - 1;\n /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */\t\n\t\t\t}", "title": "" }, { "docid": "72baf3ae7e7f400041eba0c75297031a", "score": "0.6161512", "text": "back() {\n var steps = this.get('steps');\n var step = this.get('step');\n var i = steps.findIndex((e) => e === step);\n\n if (i > 0) {\n this.set('step', steps[i-1]);\n }\n }", "title": "" }, { "docid": "0a088afb281c0408eb5bbc3bb5cc8c37", "score": "0.6149272", "text": "function clickBackSpace(){\n //takes actual expression\n var acum = document.getElementById('aritmeticExpression').getElementsByTagName('div')[0].innerHTML;\n var len = acum.length;\n //eliminates the last number\n if (len > 1){\n document.getElementById('aritmeticExpression').getElementsByTagName('div')[0].innerHTML = acum.slice(0, -1);\n }\n else{\n document.getElementById('aritmeticExpression').getElementsByTagName('div')[0].innerHTML = \"0\";\n }\n}", "title": "" }, { "docid": "05490b61a07d7d1b7e2211b472a3c74b", "score": "0.6143601", "text": "function removeLastPressed() {\r\n if (pressed.length > 0) {\r\n pressed = pressed.substring(0, pressed.length - 100); // forget the last pressed button\r\n }\r\n\r\n}", "title": "" }, { "docid": "6969e63bf95a77f8661cf0906e0bc7ec", "score": "0.61268", "text": "function decrementValue()\r\n {\r\n var value = parseInt(document.getElementById(\"number\").value, 10);\r\n value = isNaN(value) ? 0 : value;\r\n //This lets it know to subtract\r\n value--;\r\n document.getElementById(\"number\").value = value;\r\n }", "title": "" }, { "docid": "f3b90b8910fda1464150ab9f60d8e909", "score": "0.6112945", "text": "function deleteLastNo() {\n let displayedNo = $display.textContent;\n let displayLength = displayedNo.length;\n let deleteLastNo;\n if(displayLength > 1) {\n deleteLastNo = displayedNo.slice(0, -1);\n replaceHtmlText($display, deleteLastNo);\n } else {\n resetCalculator($calcContainer, $clearButton, \"AC\", $display);\n }\n}", "title": "" }, { "docid": "db4dd72b7ee7d0fe15ea1a5253529d42", "score": "0.60958004", "text": "function del() {\n value = $(\".calc-display\").val();\n $(\".calc-display\").val(value.substring(0, value.length - 1));\n}", "title": "" }, { "docid": "3483d4d4d90c72d224ac884f090fc868", "score": "0.6077583", "text": "function deleteCurrentAmount(){\n\t\tvar length_ = current_amount.toString().length;\n\n\t\tfor(var i = 0; i < length_; i++){\n\t\t \tsimulateKeyboard('keydown', 8);\n\t\t}\n\t}", "title": "" }, { "docid": "fb3fb04e7e334375a236e687fa949e63", "score": "0.604719", "text": "function decrement() {\n \n number--;\n \n $(\"#show-number\").html(\"<h2> Time: \" + number + \"</h2>\");\n \n if (number === 0) {\n \n stop();\n \n // alert(\"Time Up!\");\n calculate();\n }\n }", "title": "" }, { "docid": "2c56988b24e02d436e005b3b6f119f92", "score": "0.60347134", "text": "delete(){\n this.currentOperand = this.currentOperand.slice(0, -1);\n this.updateDisplay();\n }", "title": "" }, { "docid": "23e38fbaf7ee2d927d61f06cf74dc3f9", "score": "0.60124624", "text": "function back() {\r\n vm.tab = 0;\r\n }", "title": "" }, { "docid": "9132a7935652dd3e47b501ddba9afab9", "score": "0.6009475", "text": "function decrementValue()\n{\n var value = parseInt(document.getElementById('number').value, 10);\n value = isNaN(value) ? 0 : value;\n if(value>1){\n value--;\n document.getElementById('number').value = value;\n }\n\n}", "title": "" }, { "docid": "99781c491a51d3153bf54ebb5a360ca3", "score": "0.6004613", "text": "function editNumber() {\n $(mover).text(theCount);\n theCount--;\n\n}", "title": "" }, { "docid": "97fed9f0c9f0c9cc3f4a9c1cf3198440", "score": "0.5997268", "text": "function back()\r\n{\r\n var exp=document.getElementById(\"input\").value;\r\n document.getElementById(\"input\").value=exp.substring(0,exp.length-1);\r\n}", "title": "" }, { "docid": "54818b1c82bbb5425d6b94015114fd2c", "score": "0.59902555", "text": "function removeFromIndex() {\n if (data.length > 1) {\n if (indexNo === 0) {\n \t\tindexNo = data.length - 1;\n \tloopThroughData(true, false, data[indexNo]);\n \t} else {\n \t\t\tindexNo--;\n \t\t\tloopThroughData(true, false, data[indexNo]);\n \t}\n } else {\n console.log(\"Cannot go back\");\n }\n pagin.innerText = `${indexNo+1}/${overAll}`;\n}", "title": "" }, { "docid": "aecc041faca003c8c2c84e0e6d3b7f6e", "score": "0.5989365", "text": "function prev(){\n\tif(this.pos > 0){\n\t\t--this.pos;\n\t}\n}", "title": "" }, { "docid": "a6be55e97a353d3a67827ed54ef2c4ce", "score": "0.59877497", "text": "function backSpace() {\n if (display.textContent == \"error\" || display.textContent == dummyValue + a) {\n return;\n } //This line (whitout the dummy[this prevents the user to delete the result unless they press CE]) is repited through all the script its function is to stop the user input when there is an error in the calculator display\n else if (display.textContent.length > 1) {\n let eraseThis = display.textContent.split(\"\").slice(0, -1).join(\"\");\n display.textContent = eraseThis;\n } else {\n display.textContent = 0;\n }\n}", "title": "" }, { "docid": "838d92e9a703dbca4460470703355da5", "score": "0.59863216", "text": "function cancelPrev(){\n if ($total.text() === '0') return;\n $list.children('li:last').remove();\n ary.pop();\n console.log('after cancel: ' + ary);\n $total.text(ary.length - doneNum);\n $waiting.text(++waiting);\n if ($total.text() === '0'){\n $cancel.addClass('na');\n $next.addClass('na');\n }\n }", "title": "" }, { "docid": "5c0c75449312daa57b52d4e9ecf4afbc", "score": "0.59823483", "text": "function onKeyDownHandler(e) {\n console.log(e.keyCode);\n switch (e.keyCode) {\n case 46: // delete\n console.log(\"delete\");\n var activeObject = canvas.getActiveObject();\n if (activeObject) {\n canvas.remove(activeObject);\n }\n window.sync();\n return;\n case 27:\n console.log(\"go back\");\n window.currentAction = drawComponents.selectButton;\n window.canvas.isDrawingMode = false;\n window.canvas.deactivateAll().renderAll();\n window.sync();\n return;\n }\n}", "title": "" }, { "docid": "ee917af5fdb962ae9c2213613e689a45", "score": "0.5963241", "text": "function backButtonHandler() { \n if (formIndex === 3) { //backbutton handler for first 3 \n let removelastelement = questionnaire.slice(0, questionnaire.length - 3)\n setQuestionnaire(removelastelement)\n setFormIndex(1)\n setProgessValue(progessValue-1)\n } else if (formIndex > 0 ) { //backbutton handler for rest and check if index lessthan zero \n let removelastelement = questionnaire.slice(0, questionnaire.length - 1)\n setQuestionnaire(removelastelement)\n setFormIndex(formIndex - 1)\n setProgessValue(progessValue-1)\n }\n setFormCurrentValue([])\n }", "title": "" }, { "docid": "ae343d45404f93fbd7f5e17bbf580a4e", "score": "0.59581876", "text": "down() {\n if(this.current < this.suggestions.length - 1)\n this.current++;\n }", "title": "" }, { "docid": "2911ada73e2f9e685ccbd1f5d518d431", "score": "0.5950383", "text": "function backBtnClick(){\n var Btn = document.getElementById('backBtn');\n\tif (Btn.disabled == false) {\n \t\tstepNum = stepNum - 1;\n \t\tshowStep();\n \t}\n }", "title": "" }, { "docid": "8c5ac29fd101ca0015ee2d34684c946d", "score": "0.59470457", "text": "function eraseNumber(val) {\n\tif(display.textContent.length == 1 || display.textContent.length == 0) {\n\t\tdisplay.textContent = 0;\n\t\tvar1 = '';\n\t}\n\telse {\n\t\tdisplay.textContent = display.textContent.slice(0,-1);\n\t}\n\toperator = '';\t\n}", "title": "" }, { "docid": "1b7e6460de9f6ebe73e965a125d7afd6", "score": "0.5946966", "text": "function removeButton(){ \n fila.pop();//1\n fila.print();//2\n}", "title": "" }, { "docid": "44fe2a24f2d688341a3002646d849798", "score": "0.59463865", "text": "function decrement() {\n // Decrease number by one.\n number--\n\n // Show the number in the #timer tag.\n $(\"#timer\").html(\"<h2>\" + \"Timer: \" + number + \"</h2>\")\n\n // Once number hits zero or you get through the game...\n if (number === 0 || numClicks === 3) {\n // ...run the stop function.\n console.log(answersRight + \"<---Number of Right Answers\")\n $(\"#game-screen\").empty()\n\n //Display Score\n $(\"#right-answers\").html(\"Correct Answers: \" + answersRight)\n $(\"#wrong-answers\").html(\n \"Wrong Answers: \" + (theQuestions.length - answersRight)\n )\n resetGame()\n }\n }", "title": "" }, { "docid": "54dd386a900bcbdb5916603849da3dee", "score": "0.59447443", "text": "function BackPage() {\n textCount = textCount - 1\n}", "title": "" }, { "docid": "2f4e8ff0b98b757c96316e5bb5a788d3", "score": "0.59429747", "text": "function backspace() {\n if(result.length == 1) { setResult('0'); }\n else { setResult(result.substring(0,result.length - 1)); }\n setOperation(\"\");\n }", "title": "" }, { "docid": "6fc09d7dfefa1195c4f0a13391313de2", "score": "0.5938309", "text": "function backspace(){\n var temp1 = \"\";\n var temp2 = \"\";\n\n if(equalTo === true){\n clearButton();\n }\n\n if(flag === false){\n temp1 = num1.substring(0, num1.length - 1);\n num1 = temp1;\n display.innerHTML = num1;\n }\n\n else if(flag === true){\n display.innerHTML = num1;\n flag = false;\n }\n\n if(num2 !== \"\"){\n temp2 = num2.substring(0, num2.length - 1);\n num2 = temp2;\n flag = true;\n display.innerHTML = num1 + opString + num2;\n }\n}", "title": "" }, { "docid": "0306f83d630305107d1bf57a2569506a", "score": "0.5924836", "text": "function buttonBack(){\n\t$('#message')[0].innerHTML = 'Back! Back I say!';\n\tif(intervalID >= 0)\n\t\tbuttonPlay();\n\tif(ROW >= 0)\n\t\tstepBack();\n}", "title": "" }, { "docid": "2a91ae2d2e28c2586ee82fcf8ff5beae", "score": "0.5921885", "text": "function buttonPrevious() {\n if (book.id > 7) {\n return book.id - 1;\n } else {\n return book.id;\n }\n }", "title": "" }, { "docid": "7e7c185e95b3c7ab9b09293b7ea2fbb8", "score": "0.5920965", "text": "function onBackKeyDown() {\n // Boton atras bloqueado\n}", "title": "" }, { "docid": "7e7c185e95b3c7ab9b09293b7ea2fbb8", "score": "0.5920965", "text": "function onBackKeyDown() {\n // Boton atras bloqueado\n}", "title": "" }, { "docid": "a1cb6d6d8aae9019d5a8a8dac0bb9325", "score": "0.59146166", "text": "function prev() {\n if(this.pos > 0) {\n this.pos -= 1;\n }\n}", "title": "" }, { "docid": "8b4183ee4126902ee15a4cba2b19ece0", "score": "0.5913994", "text": "function undo() {\n if (history.length < 1) return;\n let last = history.pop();\n controls = last.controls;\n rndr();\n}", "title": "" }, { "docid": "33d700baff70596890d0fc2b61f2d031", "score": "0.59073406", "text": "function handleClickDecrement() {\n if (counter === 0) {\n checkCounter();\n } else {\n setCounter(counter - 1);\n }\n }", "title": "" }, { "docid": "ca916a9f2271627846cdf79f7a7da83c", "score": "0.59071565", "text": "function getNum(){\n button2.removeEventListener('click', getNum);\n cDown = input.value;\n countDown()\n clearInterval(int);\n}", "title": "" }, { "docid": "6bcb44f9217c146ef4ba0b9c67ece908", "score": "0.5904282", "text": "function handleClearEntry() {\n addToScreen('');\n currentNum = '';\n}", "title": "" }, { "docid": "1c06ae5a4688f067c65d21866b4ed52e", "score": "0.59038603", "text": "undoTransaction() {\n this.num.setNum(this.intNum);\n }", "title": "" }, { "docid": "5cf14047c6f72b6c70fb459c39eb09a6", "score": "0.59016865", "text": "function deselectNumber() {\n var id = \"#button\" + selectedNumber;\n $(id).removeClass(\"NumberSelected\");\n selectedNumber = -1;\n}", "title": "" }, { "docid": "e97be9d722e148d4b64a30c772fb9a02", "score": "0.590044", "text": "function decrement(){\n number--;\n $(\".consTime\").html(\"OO:0\"+number);\n\n \n //when time runs out. wrong answer ++, move on to next question \n if (number === 0) {\n\n counter++;\n stop();\n wrongAnswer++\n $(\".wrongCount\").html(wrongAnswer);\n usedAnswer = constel.splice(indexRoundAnswer, 1);\n possibleAnswer = [0, 1, 2, 3];\n number = 10;\n gameStart ();\n if(counter === 7){\n alert(\"good job! you got \"+rightAnswer+\" points!!!\")\n alert(\"Let's Play Again\")\n window.location.reload();\n };\n \n \n };\n }", "title": "" }, { "docid": "795f9b7f17a91ad339a50517792eee3a", "score": "0.5894234", "text": "function backButtonClick() {\n\tcount--;\n\tshowTheQuestion(count);\n}", "title": "" }, { "docid": "9edd7f267511d5aa355506761b0c7597", "score": "0.58848566", "text": "prevButton() {\n this.setNewIndexWithStep(-1)\n }", "title": "" }, { "docid": "72c1d9bc36bd19ea5fc333d9185afed9", "score": "0.58775204", "text": "prev() {\n if (this.pos > 0) {\n --this.pos;\n }\n }", "title": "" }, { "docid": "7b74783949d371dd375e79cc46b65673", "score": "0.58696926", "text": "function buttonMinus(){\n\tif(matchday > 0){\n\t\tmatchday--;\n\t\tbuttonPushed = 1;\n\t\t$( \"#dayslider\" ).slider( \"option\", \"value\", matchday );\n\t}\n\tconsole.log(\"Pressed -\");\n}", "title": "" }, { "docid": "c5dafd76c846698753a3f3e86ef2f611", "score": "0.5869507", "text": "prev() {\n this.goTo(this.potentialIndex - 1);\n }", "title": "" }, { "docid": "96fc41e7ab8ed4e7bcbf45e25793ee60", "score": "0.5864074", "text": "function decrement() {\n number--;\n $(\"#timeLeft\").html(\"<h1>\" + number + \"</h1>\");\n if (number === 0) {\n alert(\"Time Up!\");\n stop();\n audio.pause();\n }\n }", "title": "" }, { "docid": "919be65774ce41905922d730771d3594", "score": "0.5856435", "text": "function goBack() {\n var fun = history.pop();\n fun();\n clearInterval(interval);\n }", "title": "" }, { "docid": "e5fe8a89064e352dcdbed4fb51501889", "score": "0.58486086", "text": "function decrement() {\n //decreases by one\n number--;\n //Show the number in the #show-number tag.\n $(\"#show-number\").html(\"<h2>\" + number + \"</h2>\");\n\n //the number will hit zero\n if (number ===0) {\n //..stops from going into the negative\n stop();\n alert(\"Dun Dun Dun Times Up\")\n\n\n }\n\n}", "title": "" }, { "docid": "d0d466f987ab298125a28579659e41f4", "score": "0.58484465", "text": "function backspace() {\n if (stack.length>0) {\n stack.pop()\n updateDisplay()\n }\n}", "title": "" }, { "docid": "8e4bfc3852cc4d837fd02534991bd119", "score": "0.5846709", "text": "function gotoPrev() {\n showStep(vm.currentStep - 1);\n }", "title": "" }, { "docid": "da9420d67a1fca8ab82dc75e0cbdf700", "score": "0.5845073", "text": "function decrementNum(){\n document.getElementById(\"Math9\").innerHTML= int1--;\n }", "title": "" }, { "docid": "212e3c83b91e886696ea2056a5751164", "score": "0.58415776", "text": "function backSpace(){\n const displayValue = document.getElementById('display').value;\n document.getElementById('display').value = displayValue.slice(0,displayValue.length-1);\n}", "title": "" }, { "docid": "85642d50a361aa0235e1bcafb4981243", "score": "0.5841167", "text": "function keyPressed() {\n Palline.pop();\n}", "title": "" }, { "docid": "4c296cab324766d71891714e4061bb35", "score": "0.5833249", "text": "function removeNumber(){\n display.value = display.value.slice(0,-1);\n}", "title": "" }, { "docid": "752ae9805f4346c103dc87c60f9a9796", "score": "0.58307236", "text": "function historyDown() {\n\tkeyInputShortCut.pos++;\n\tif(keyInputShortCut.pos>keyInputShortCut.buff.length-1) keyInputShortCut.pos=keyInputShortCut.buff.length-1;\n\tconsoleIn.setValue(keyInputShortCut.buff[keyInputShortCut.pos]);\n\t$(\"#inputMode\").val(keyInputShortCut.mode[keyInputShortCut.pos]);\n}", "title": "" }, { "docid": "d677af30abec2454cd8f4b2070906fd5", "score": "0.58283585", "text": "function backspace(){\r\n display.value = display.value.slice(0, display.value.length -1)\r\n}", "title": "" }, { "docid": "5a704826ad207f4e5f8f0db9c85d259b", "score": "0.5827772", "text": "decrement () {\n this.value = this._clampValue(this.value - this.step)\n }", "title": "" }, { "docid": "13633de241bc3c5afab93acba64332c0", "score": "0.58270943", "text": "function decrement (number1) {\n\treturn number1 - 1\n}", "title": "" }, { "docid": "8564d12ec429796fefc4fe695ebd5973", "score": "0.58182937", "text": "function del()\r\n{\r\n var value = document.getElementById(\"calc__display\").value;\r\n document.getElementById(\"calc__display\").value = value.substr(0, value.length - 1);\r\n x = x.substr(0, x.length - 1);\r\n console.log(x);\r\n}", "title": "" }, { "docid": "759d582131cfafb6c85c42496e5fab2e", "score": "0.58157134", "text": "function down(idx) {\n let item = this.comodos[currentComodo][idx];\n if (item.amount > 0) {\n item.amount = Number((item.amount - 1).toFixed(1));\n }\n this.change(idx);\n}", "title": "" }, { "docid": "ce4acacbba90aad8770631309bb90f1b", "score": "0.58076245", "text": "prev () {\n this.current--;\n if (this.current == -1) {\n this.current = this.count-this.inline;\n }\n this.scroll();\n this.prev_button.blur();\n }", "title": "" }, { "docid": "7473d6ef4267296df514ffc88ddd71c1", "score": "0.5792402", "text": "function decrement1() {\n data = data - 1;\n document.getElementById(\"counter\").innerText = data;\n}", "title": "" }, { "docid": "44069baf1e428382dd33367cf49abd33", "score": "0.57841605", "text": "function backSpace() {\n if (operand === false) {\n let disp = displayCell.innerHTML;\n if (disp.length > 1) {\n disp = disp.slice(0, disp.length - 1);\n displayCell.innerHTML = disp;\n } else {\n displayCell.innerHTML = 0;\n }\n }\n}", "title": "" }, { "docid": "0260d059faebb8cbcf601ee185a2ce0d", "score": "0.57793075", "text": "moveBack() {\r\n if (this.cur.hasPrevious()) {\r\n this.cur = this.cur.getPrevious();\r\n }\r\n else {\r\n console.log(\"you cannot go back!\");\r\n }\r\n }", "title": "" }, { "docid": "f063ce3d7a21d98097daf383a10ec3ff", "score": "0.5775553", "text": "function keyPress()\n {\n var keyPress = event.key;\n document.getElementById(\"p.guessnumber\").innerHTML = guessesRemaining;\n guessesRemaining = guessesRemaining - 1;\n }", "title": "" }, { "docid": "9da0f5f4fc25bd16f65d1bba5687035a", "score": "0.5773099", "text": "function decrementIndex() {\n currentIndex = currentIndex ? currentIndex - 1 : dataShapes.length - 1;\n resetDisplay();\n }", "title": "" }, { "docid": "364004460b3b09ef1dc30cd18266704e", "score": "0.5772905", "text": "_decrement(e) {\n\t\t\n\t}", "title": "" }, { "docid": "b8114f8f6d9a4ce421f648be4b5c1644", "score": "0.5772121", "text": "back() {\n this.index = this._cueIndex - 1;\n }", "title": "" }, { "docid": "297010949735c153f9088c850c659614", "score": "0.5769977", "text": "prev() {\n this._historyIndex -= 1;\n this._selectItem(this._historyIndex);\n }", "title": "" }, { "docid": "6023a827c73356c25b71edadafd36c99", "score": "0.57685214", "text": "function backspace(){\r\n var value = output.value;\r\n output.value = value.substr(0, value.length - 1);\r\n\r\n }", "title": "" }, { "docid": "25946b99785021be4bd2c606fb2a39c9", "score": "0.5764581", "text": "function removeNumber(cellIndex) {\n selectedNumber = 0;\n inputNumber(cellIndex);\n}", "title": "" }, { "docid": "f642e7af4a92c58943bddd2fc21e1690", "score": "0.57634944", "text": "function backspaceDeleteKeyEvent (key) {\n if (key.which === 8) {\n deleteSingle();\n } else if (key.which === 46) {\n clearDisplay(key)\n }\n}", "title": "" }, { "docid": "2b862c08d79125ecf251cbfe82237f5d", "score": "0.575649", "text": "function goBack()\n{\n\t$j('#twoColumn').removeClass('');\n\t$j('#step2').hide();\n\t$j('#step1').show();\t\n}", "title": "" }, { "docid": "7eae14b9872541f809c86e3babc09d86", "score": "0.57563794", "text": "function previousButton(e){\n e.preventDefault()\n cells.forEach(cell => {\n cell.style.animation = 'none'\n })\n currentMove--;\n if (currentMove <= 0) {\n currentMove = 0;\n }\n checkHistory(moveHistory[currentMove]);\n}", "title": "" }, { "docid": "8951caaf769bcb9736a62ad6bdd65022", "score": "0.57558", "text": "up() {\n if(this.current > 0)\n this.current--;\n }", "title": "" }, { "docid": "685e71efca4b0868a964d2e6a31711bc", "score": "0.5754275", "text": "function decrement() {\n\n number--;\n\n $(\"#show-number\").html(\"<h2> Time Remaining: \" + number + \" Seconds </h2>\");\n\n if (number <= 0) {\n // timer has been down to 0\n stop();\n hideQuestion();\n showAllDone();\n alert(\"Time Up!\");\n }\n }", "title": "" }, { "docid": "a81eb2f8ae07dc5c8da03f766ec06ff7", "score": "0.5737574", "text": "function previous() {\n setStartIndex(startIndex - settings.itemNumber);\n setEndIndex(endIndex - settings.itemNumber);\n // window.location.reload();\n }", "title": "" }, { "docid": "4eea7e0a127a461eb7ec6b9bf965a6ef", "score": "0.5735497", "text": "function endKeys(e){\r\n \r\n \r\n\r\n if (e.detail == 1) {\r\n $(\"#helper\").hide()\r\n handleInput(\"remove\",\"endKeys\")\r\n \r\n newTurn()\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "f1d560331f534dda6a33ac61e871c6ce", "score": "0.5734928", "text": "function onPreviousClick() {\n stopTimer();\n decrementIndex();\n repaint();\n startTimer();\n}", "title": "" }, { "docid": "c539c81d438c91ed98461897d191712c", "score": "0.5730319", "text": "function decrementValue(){\n var value = parseInt(document.getElementById('one').value, 10);\t\n value = isNaN(value) ? 0 : value;\n\tvalue--;\n\tif (value <= 0){\n\t\tvalue = 0;\n\t\tchangeCartText(txt=\"Cart Empty\", itemscount = 0);\n\t}\n\telse{\n\t\tchangeCartText(txt=\"Cart Value\", itemscount = value);\n\t}\n document.getElementById('one').value = value;\t\n}", "title": "" }, { "docid": "cdf7c96be015cb35ff89648e37307960", "score": "0.57274556", "text": "function prevQuestion() {\r\n currentIndex--;\r\n}", "title": "" }, { "docid": "a01f74e8676b81a48e7e48a9859a5a47", "score": "0.5727398", "text": "delete(){\n this.answer = this.answer.toString().slice(0, -1); \n }", "title": "" }, { "docid": "af70e11f813df28c9f854dd1740786f7", "score": "0.57260746", "text": "function goPrev() {\n window.history.back();\n}", "title": "" }, { "docid": "f217bbcf7da638dc644e829d5cd4ad1b", "score": "0.5725558", "text": "function deleteNumbers() {\n let enteredText = document.querySelector(\".text1\").innerText;\n enteredTextSubStr = document.querySelector(\".text1\").innerText = enteredText.substring(0, (enteredText.length)-1);\n if (enteredText.length == 1) {\n document.querySelector(\".text1\").innerText = \"0\";\n }\n return enteredTextSubStr;\n }", "title": "" } ]
00057ec89ebc9e6d1c6c06002c43e254
Submit feedback to database
[ { "docid": "1ab9d4285c6e5d26972d9cbc548f50ab", "score": "0.6419733", "text": "function submitFeedback(){\n \n var feedbackVal = document.getElementById(\"feedbackInput\").value;\n \n db.collection(\"feedback\").doc().set({\n Feedback: feedbackVal,\n CharName: character,\n Email: email_id\n })\n .then(function() {\n \n window.alert(\"Feedback submitted. Thank you!\");\n document.getElementById(\"user_div\").style.display = \"block\";\n document.getElementById(\"feedbackForm\").style.display = \"none\";\n \n \n })\n .catch(function(error) {\n \n console.error(\"Error writing document: \", error);\n \n });\n \n}", "title": "" } ]
[ { "docid": "6a73ad9d15158ff481b0d471ba4f0b56", "score": "0.7202978", "text": "function myLoansSubmitFeedback() {\n \n // TO DO\n // submit the current feedback to the db\n \n // for now I will just go back to the menu\n clearNonMenu();\n \n}", "title": "" }, { "docid": "81f40141cb976994b6d20d737ba5f2f5", "score": "0.7180997", "text": "function handleSubmit() {\n let timePin = null;\n if (!generalFeedback) {\n timePin = currentTime;\n }\n\n const FeedbackRecord = {\n submissionID,\n studentID,\n authorID: Firebase.auth().currentUser.uid,\n createdAt: Firestore.Timestamp.now(),\n updatedAt: Firestore.Timestamp.now(),\n body: content,\n time: timePin,\n };\n\n Firestore().collection('feedback')\n .add(FeedbackRecord);\n }", "title": "" }, { "docid": "b5344257eed60394cf95d1450f367199", "score": "0.6907193", "text": "function otherLoansSubmitFeedback() {\n \n // TO DO\n // submit the current feedback to the db\n \n // for now I will just go back to the menu\n clearNonMenu();\n \n}", "title": "" }, { "docid": "aaca57f17c9fc98d8fd82a25e257e2df", "score": "0.66374236", "text": "function submitScore() {\n submitToDb();\n}", "title": "" }, { "docid": "9cd374a72e742950c42cd19e66165d16", "score": "0.65793306", "text": "function handleSubmit(){\n\n props.dbAddSentance({\n 'text': localSentence, \n 'postition': props.postition, \n 'username': props.player.name,\n })\n props.handleSubmitOrTimeout();\n }", "title": "" }, { "docid": "9b92911139383202b28d004084bfb0d6", "score": "0.6481045", "text": "function doPost(e) {\n var update = tg.doPost(e);\n if(update){\n prosesFeedback(update)\n }\n}", "title": "" }, { "docid": "2c4a62d9fcb90e918740903bac93e355", "score": "0.64702326", "text": "async submitFeedback(title, body, user) {\n const data = { title, body, user, new: true };\n await db.collection(\"feedback\").add(data);\n console.log(\"feedback submitted\");\n }", "title": "" }, { "docid": "cbf9cfd88227514d97703f5aab9f3f76", "score": "0.62548935", "text": "function submitForm() {\n let answers = recordAnswers();\n sendPreSurvey(answers)\n}", "title": "" }, { "docid": "f35992136cb907acf8f8203fc5939769", "score": "0.6245754", "text": "function addFeedbackToDB(kb, translations, language) {\n let apicall = \"createExtendedFeedbackRecord\";\n let url = kb.server.dtu_ip + kb.server.dtu_api_base_url + apicall;\n let thermal_mode = kb.user.adaptation.mode;\n let user_data = {\n \"user_id\": deviceID(),\n \"question_combo_id\": 1, // will be changed when more sophisticated solution is implemented\n \"rating1\": kb.feedback.question1.rating,\n \"rating2\": kb.feedback.question2.rating,\n \"rating3\": kb.feedback.question3.rating,\n \"txt\": kb.feedback.comment === \"\" ? \"_\" : kb.feedback.comment,\n \"predicted\": kb.user.adaptation[thermal_mode].predicted,\n \"perceived\": kb.user.adaptation[thermal_mode].perceived,\n \"diff\": kb.user.adaptation[thermal_mode].diff[0],\n \"mode\": thermal_mode\n }\n $.post(url, user_data).done(function (data, status, xhr) {\n if (status === \"success\") {\n console.log(\"Database update, feedback: \" + data);\n showShortToast(translations.toasts.feedback_submitted[language]);\n }\n });\n}", "title": "" }, { "docid": "8c6a837d2ea89db399cc3790dfb0fc2c", "score": "0.62092113", "text": "submit(data, formRef) {\n const { game, comment } = data;\n const owner = Meteor.user().username;\n\tconst time = Date().toLocaleString();\n\tconsole.log(\"getting here?\")\n Forums.insert({ game, time, comment, owner },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Item added successfully', 'success');\n formRef.reset();\n }\n });\n }", "title": "" }, { "docid": "571b6294c351530d0836f2f0bef25a62", "score": "0.62028", "text": "function handleSave() {\n const now = new Date;\n alert(\"Ticket \" + id +\" Saved at \"+now.toLocaleTimeString());\n //TODO: fix database logic (almost working)\n let database = firebase.database();\n database.ref(`${quarter}/${exercis}/tickets/${id}`).update({\n message: title,\n student: {\n id: netID,\n name: name,\n },\n status: status,\n //date: submitDate,\n textBlocks: blocks,\n });\n handleSubmit();\n //window.location.href = \"/queue/\";\n }", "title": "" }, { "docid": "ef4babccb4454aff6e0617a8244120c8", "score": "0.6187035", "text": "function callback(){\r\n console.info(\"Success: record inserted successfully\");\r\n alert(\"New Feedback Added\");\r\n }", "title": "" }, { "docid": "de0e52a037f101b348acbb615c9ab145", "score": "0.61072206", "text": "function submit()\n{\n\tvar data;\n\n\tif (vm.isFormSubmissible)\n\t{\n\t\t// Organize the data that will need to be sent over the wire\n\t\tdata =\n\t\t{\n\t\t\tname: vm.name,\n\t\t\torderId: vm.orderId,\n\t\t\temail: vm.email,\n\t\t\tareaCode: vm.areaCode,\n\t\t\tphoneOne: vm.phoneOne,\n\t\t\tphoneTwo: vm.phoneTwo,\n\t\t\tcomments: vm.comments\n\t\t};\n\n\t\t// Save the data\n\t\taxios.post(SEND_REQUEST_URL, data, true).then(() =>\n\t\t{\n\t\t\t// Prevent the button from being clicked again\n\t\t\t_submitButton.disabled = true;\n\n\t\t\t// Show a message indicating that a request has been sent to us\n\t\t\tnotifier.showSuccessMessage(SUCCESS_MESSAGE);\n\n\t\t\t// If successful, put up a success banner and let's take the user back to the home page after\n\t\t\t// about 5 seconds\n\t\t\twindow.setTimeout(() =>\n\t\t\t{\n\t\t\t\twindow.location.href = HOME_URL;\n\t\t\t}, 7500);\n\n\t\t}, () =>\n\t\t{\n\t\t\tnotifier.showGenericServerError();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "c39f914490d9006a0f86baedaa24fdab", "score": "0.60987335", "text": "function updateFeedback() {\n\n\t// check to make sure there isn't an update happening already\n\tif(updating == false) {\n\t\t// continue with the update\n\t\tupdating = true;\n\t\t\n\t\t// check to see if there is an item to use in building the url\n\t\tvar url;\n\t\tif(item != null) {\n\t\t\turl = FEEDBACK_BASE_URL + \"performance=\" + performance + \"&task=update&lastid=\" + item.id;\n\t\t} else {\n\t\t\turl = FEEDBACK_BASE_URL + \"performance=\" + performance + \"&task=update&lastid=0\";\n\t\t}\n\t\t\n\t\t// get the new batch of data\n\t\t$.get(url, function(data, textStatus, XMLHttpRequest) {\n\t\t\n\t\t\t// \"age\" any existing new feedback\n\t\t\t$('td').removeClass(\"feedback_messages_new\");\n\t\t\n\t\t\t// process the batch of data\n\t\t\tif(data.length != 0 || typeof(data) != \"undefined\") {\n\t\t\t\t\n\t\t\t\t// add the list of feedback\n\t\t\t\tfor(var i = 0; i < data.length; i++) {\n\t\t\t\t\titem = data[i];\t\t\t\t\t\n\t\t\t\t\t$(\"#table_anchor\").after('<tr><td class=\"feedback_messages_left feedback_messages_new\">' + feedback_count + '</td><td class=\"feedback_messages_middle feedback_messages_new\">' + item.content + '</td><td class=\"feedback_messages_right feedback_messages_new\">' + item.type + '</td></tr>');\n\t\t\t\t\tfeedback_count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// set the updating flag\n\t\t\tupdating = false;\n\t\t\t\n\t\t\t// set an interval for the next update\n\t\t\tsetTimeout(\"updateFeedback()\", UPDATE_DELAY);\n\t\t});\t\t\n\t}\n}", "title": "" }, { "docid": "447f2cf258ece645b4f3f118f90da454", "score": "0.60823804", "text": "function onSuccess() {\n alerts.show('Feedback Sent! Thank you!', alerts.type.VALID);\n _commentInput.value = '';\n updateFeedbackForm();\n _instance.dispatchEvent(_events.SUCCESS, { target: _instance });\n }", "title": "" }, { "docid": "40970dc58d837fa7fa0cac6494ec2b88", "score": "0.6075261", "text": "submitForm(){\n this.setState({submitError: false})\n\t\t//checks if all requirements for saving were met\n\t\tif ( this.canSave() ) {\n let body = {\n title:this.state.title,\n description: this.state.descriptionEditor.getEditorState(),\n }\n database.collection('help-tasks').doc(this.props.id).update(body).then((res)=>{\n this.props.inputChanged(false,this.canSave());\n });\n\t\t}else{\n this.setState({submitError:true})\n }\n\t\t//as a tags we send titles not ids\n }", "title": "" }, { "docid": "5b7c6ed21e28a76aa0de16e4c3f808d7", "score": "0.6072995", "text": "function submitAnswer(){\n\tfindSelectedAnswer();\n\tfindCorrectAnswer();\n\tcompareCorrectAndSelected(selectedAnswer, correctAnswer);\n\tafterSubmitButtonDisplay();\n}", "title": "" }, { "docid": "298e498224fc46824039f07194f2e349", "score": "0.6036942", "text": "function submitClick(){\n\tvar textField = $.header.value;\n\tvar textArea = $.textArea.value;\n\t\n\t//save the form data in a review object \n\tvar review = new Object();\n\treview.header = textField;\n\treview.description = textArea;\n\t\n\t//clear the form fields\n\t$.header.setValue(null);\n\t$.textArea.setValue(null);\n\t\n\t//save new review to the database\n\tdb.insertReview(review.header, review.description);\n\t\n\tshowToastMessage(\"Review added\", Ti.UI.NOTIFICATION_DURATION_SHORT);\n\t\n}", "title": "" }, { "docid": "c230510dd726dd495689efa461c5937c", "score": "0.60285014", "text": "function BABtnSave_click() {\n BAaddFeedback();\n}", "title": "" }, { "docid": "2c45807463a4114f9d3b57991ad67bca", "score": "0.5979221", "text": "function savefeedback() {\n // get the input\n var id = \"&id=\"+block_id+trial_id;\n\n if (document.querySelector('input[name = \"Ethnicity\"]:checked') == null\n || document.querySelector('input[name = \"Language\"]:checked') == null\n || (document.querySelector('input[name = \"Ethnicity\"]:checked').value == \"Other\" &&\n document.querySelector('input[name = \"OtherEthnicity\"]').textContent == null)\n || (document.querySelector('input[name = \"Language\"]:checked').value == \"Other\" &&\n document.querySelector('input[name = \"OtherLanguage\"]').textContent == null)) {\n alert(\"Please answer all the questions\");\n } else {\n var ethnicity = document.querySelector('input[name = \"Ethnicity\"]:checked').value;\n var otherethnicity = document.querySelector('input[name = \"OtherEthnicity\"]').value;\n var language = document.querySelector('input[name = \"Language\"]:checked').value;\n var otherlanguage = document.querySelector('input[name = \"OtherLanguage\"]').value;\n\n var data = 'data='+ethnicity+\",\"+otherethnicity+\",\"+language+\",\"+otherlanguage+\",\";\n data = data+id;\n console.log(data);\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\",\"/Feedback.php\",true);\n //Must add this request header to XMLHttpRequest request for POST\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(data);\n\n window.location = \"/Conclusion.html\";\n }\n}", "title": "" }, { "docid": "3a6a4cc48420147a4b71d728075cd587", "score": "0.5977246", "text": "function submitToDb() {\n getUserRecord();\n let httpXml = new XMLHttpRequest();\n\n let reqBody = {\n name: document.getElementById(inputBox).value,\n score: finalScore\n };\n\n httpXml.responseType = jsonType;\n httpXml.open(postMethod, insertScoreExt); \n httpXml.setRequestHeader(contentType, appJson);\n\n httpXml.onreadystatechange = () => {\n if (httpXml.readyState === 4 && httpXml.status === 200) {\n let id = httpXml.response.insertId;\n sessionStorage.setItem(cUserId, id);\n window.location.href = leaderboardPage;\n }\n };\n httpXml.send(JSON.stringify(reqBody));\n}", "title": "" }, { "docid": "e62c17490ab1b2ae7a9fcb58e0b8a95a", "score": "0.5975093", "text": "function submitForm(event){\n event.preventDefault();\n var date = new Date();\n var gettimestamp = date.getTime();\n // get values\n var items = getInputVal(\"items\");\n var needbydate = getInputVal(\"needbydate\");\n var message = getInputVal(\"message\");\n var timestamp = gettimestamp;\n var postrequester_uid = currentUser;\n var status = \"pending\";\n\n //save request post\n savePost(items, needbydate, message, timestamp, postrequester_uid, status);\n }", "title": "" }, { "docid": "d8726a2279699e2a5125c4e2436804a4", "score": "0.597184", "text": "function submit() {\n\t\tvar name = document.getElementById('title').value;\n\t\tvar comment = document.getElementById('comment').value;\n\t\tvar category = document.getElementById('category').value;\n\t\tconst data = {};\n\t\tdata[\"title\"] = name;\n\t\tdata[\"post\"] = comment;\n\t\tdata[\"category\"] = category;\n\n\t\tconst fetchOptions = {\n\t\tmethod : 'POST',\n\t\theaders : {\n\t\t\t'Accept': 'application/json',\n\t\t\t'Content-Type' : 'application/json'\n\t\t},\n\t\tbody : JSON.stringify(data)\n\t\t};\n\t\tvar url = \"http://localhost:3000\";\n\n\n\t\t// This fetch redirects the use to the view.html page \n\t\t// which conatins all the anonymous comments \n\t\tfetch(url, fetchOptions)\n\t\t\t.then(checkStatus)\n\t\t\t.then(function(responseText) {\n\t\t\t\tconsole.log(responseText);\n\t\t\t\tdocument.getElementById(\"success\").innerHTML += \"Comment posted successfully\";\n\t\t\t\twindow.location.href = \"view.html\"\t\t\t\t\n\t\t\t})\n\t\t\t.catch(function(error) {\n\t\t\t\tconsole.log(error);\n \t\t});\n\t}", "title": "" }, { "docid": "2ef892e42dd6954138f753bd1310248d", "score": "0.5971473", "text": "function commentSubmitted(results){\n //console.log(\"Comment made!\");\n}", "title": "" }, { "docid": "53d948fa3ab521571dd6ae7a23f7e7c9", "score": "0.59552264", "text": "function submitTask(tID){\n // Task Submission\n // Submission ID [Primary Key]\n // Event ID\n // Task ID\n // Image\n // Description\n\n // Generate Submission ID\n // EventID-TeamID-TaskID\n // Pull Event ID\n\n // Pull Task ID\n\n // Image\n\n // Descripton\n var comment = document.getElementById(\"taskComment\").value;\n console.log(comment);\n // Package Together into Schema\n\n // Push to Server\n\n}", "title": "" }, { "docid": "165b9a9a0e80a5970425d3d3622a9d1c", "score": "0.5897633", "text": "sendFeedback(e) {\r\n e.preventDefault();\r\n\r\n let isFormValid = isValidForm(this.feedbackSchema, this.refs);\r\n if (!isFormValid) {\r\n if (!this.state.isClicked)\r\n this.stateSet({ isClicked: true });\r\n this.props.notifyToaster(NOTIFY_ERROR, { message: this.refs.feedback.state.error });\r\n return false;\r\n }\r\n let obj = getForm(this.feedbackSchema, this.refs);\r\n var _this = this;\r\n let { strings } = this.props;\r\n sendFeedbackEmail(this.state.contact.Email, obj.feedback).then(function (res) {\r\n if (res.success) {\r\n this.props.notifyToaster(NOTIFY_SUCCESS, { message: strings.SUCCESS });\r\n _this.stateSet({ key: Math.random(), isClicked: false });\r\n }\r\n else if (res.badRequest) {\r\n this.props.notifyToaster(NOTIFY_ERROR, { message: res.error, strings: strings });\r\n }\r\n }).catch(function (err) {\r\n this.props.notifyToaster(NOTIFY_ERROR);\r\n });\r\n }", "title": "" }, { "docid": "f086a851564399a420882cd094de6656", "score": "0.58916605", "text": "function submitAnswer() {\n let answer = app.form.convertToData('#survey-form');\n answer.answerer = loggedInUser.email;\n answer.survey_id = openSurvey.id;\n if (!answered(openSurvey.id)) {\n newAnswer(answer);\n } else {\n updateAnswer(answer);\n }\n}", "title": "" }, { "docid": "abcc9418c8579e49ada1a2b1270cea4f", "score": "0.58857566", "text": "@api\n submitFeedback() {\n this.dataMap = {'feedbackRating' : this.feedbackRating,\n 'feedbackComments' : this.feedbackComments,\n 'seatNumber': this.seatNumber,\n 'bookingId': this.bookingId,\n 'employeeNumber': this.employeeNumber}; \n var dataMap = this.dataMap;\n submitFeedback({dataMap})\n .then(result => {\n this.status = result;\n })\n .catch(error => {\n this.error = error;\n });\n }", "title": "" }, { "docid": "fef3a9842aa160619780bd9e148695a2", "score": "0.58744663", "text": "async submitHandler(e) {\r\n if (e.target.getAttribute('btn-id') === 'load-more') {\r\n this.reviewsLimit = this.reviewsLimit + this.stepCount;\r\n await this.loadFeedBack();\r\n }\r\n if (e.target.getAttribute('btn-id') === 'cancel') {\r\n this.clearFeedbackForm();\r\n }\r\n if (e.target.getAttribute('btn-id') === 'submit') {\r\n if (this.loadMoreElement) {\r\n this.loadMoreElement.style.display = 'none';\r\n }\r\n if (this.itemContainerDisplay) {\r\n this.itemContainerDisplay.innerHTML = '';\r\n }\r\n const bodyData = {\r\n appId: this.appId,\r\n contentId: this.contentId,\r\n ratings: this.feedbackListArray,\r\n feedback: this.textareaValue,\r\n createdBy: this.getUserName()\r\n };\r\n const dataQueryString = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'appId': this.appId,\r\n 'contentId': this.contentId\r\n },\r\n body: JSON.stringify(bodyData)\r\n };\r\n this.textareaValue = '';\r\n if (this.apiUrl) {\r\n const addFeedbackResponse = await this.apiService(this.apiUrl, dataQueryString);\r\n if (addFeedbackResponse) {\r\n await this.loadFeedBack();\r\n this.clearFeedbackForm();\r\n }\r\n }\r\n else {\r\n if (bodyData.ratings[0]) {\r\n Number.isInteger(bodyData.ratings[0]['ratingValue']) ?\r\n this.feedbackListDisplay.unshift({\r\n displayUserName: bodyData.createdBy,\r\n starCount: Number(bodyData.ratings[0]['ratingValue']),\r\n timeStamp: dxp.moment(new Date()).fromNow(),\r\n feedbackAdditionalText: bodyData.feedback\r\n }) : this.feedbackListDisplay.unshift({\r\n displayUserName: bodyData.createdBy,\r\n feedbackValue: bodyData.ratings[0]['ratingValue'],\r\n timeStamp: dxp.moment(new Date()).fromNow(),\r\n feedbackAdditionalText: bodyData.feedback\r\n });\r\n }\r\n await this.loadFeedBack();\r\n this.clearFeedbackForm();\r\n }\r\n }\r\n this.isSubmitDisabled = true;\r\n }", "title": "" }, { "docid": "30af288b3e112756f52e250a7799d9f3", "score": "0.5842472", "text": "function saveFeedback() {\n return $mmaModAssignFeedbackDelegate.getFeedbackDataToDraft($scope.plugin, getInputData()).then(function(pluginData) {\n if (!pluginData) {\n // Nothing something to save.\n return;\n }\n\n var assignId = $scope.assign.id;\n\n return $mmaModAssignFeedbackDelegate.saveFeedbackDraft(assignId, $scope.userId, $scope.plugin, pluginData)\n .then(function() {\n // Feedback saved, trigger event.\n var params = {\n assignmentId: assignId,\n userId: $scope.userId,\n pluginType: $scope.plugin.type,\n siteId: $mmSite.getId()\n };\n $mmEvents.trigger(mmaModAssignFeedbackSavedEvent, params);\n });\n }).catch(function(message) {\n $mmUtil.showErrorModalDefault(message, 'Error saving feedback.');\n return $q.reject();\n });\n }", "title": "" }, { "docid": "8716336c646ac4ac49b867df05314e8a", "score": "0.5829076", "text": "function handleSubmission() {\n\n //display loader\n $('#loader-fallback').show();\n\n //submit data\n submitData().then((data) => {\n\n /**\n * response data\n 0: How much you pay now\t$11,850\n 1: How much you'd pay with SP\t$8,269\n 2: Current OOP spending no LTC\t$750\n 3: Current OOP with LTC\t$750\n 4: Premium paid by employer\t$7,500\n 5: Premium paid by family\t$3,600\n 6: Savings\t$3,581\n 7: OOP with medical crisis\t$4,000\n 8: Savings with medical crisis\t$6,831\n\n You pay now = OOP with LTC + PP emp + PP family //In case of medical crisi consider OOP with medical crisis\n 11,850 = 750 + 7500 + 3600\n\n Saving = Pay now - SP\n 3581 = 11850 - 8269\n */\n\n\n //disable loader\n $('#loader-fallback').hide();\n\n //hide questions section\n $('.calc-holder').hide();\n \n //show results section\n $('.results-holder').show();\n\n //print results\n printResults(data);\n\n //construct graph\n generateGraphs(data);\n\n syncConciseOuputAndPrint();\n \n }).catch((err) => {\n //disable loader\n $('#loader-fallback').hide();\n\n console.log('Something went wrong! Please try again.')\n });\n\n }", "title": "" }, { "docid": "211dab9181205f2b4556cf6f7309fd84", "score": "0.5824322", "text": "function handleVisualFeedback(outcome) {\n\t\t\n\t\tif (outcome === 'pass'){ //Success\n\t\t\trequestButton.innerHTML = \"Submit\";\n\t\t} \n\t\telse if (outcome === 'fail') { //Error\n\t\t\tuserInputCity.value = \"Error Fetching Weather Data ... TRY AGAIN\";\n\t\t\trequestButton.innerHTML = \"TRY AGAIN\";\n\t\t} \n\t\telse if (outcome === 'exception') { //Exception\n\t\t\tuserInputCity.value = \"Exception Thrown ... Please Try Again...\";\n\t\t\trequestButton.innerHTML = \"TRY AGAIN\";\n\t\t\talert(\"Exception Raised creating the API requests, \" +\n\t\t\t\"Page may not display as intended ... See Console for details\");\n\t\t} \n\t}", "title": "" }, { "docid": "9dea46f16a27659f315a496154e432cf", "score": "0.580962", "text": "function dyAddFeedback(){\n //1. check validation\n if (dyValidate_AddForm()){\n //2. if validation is ok\n console.info(\"Form is valid\");\n // a) fetch info from form\n var businessName = $(\"#dyName\").val();\n var typeId = $(\"#dyLocation\").val();\n var reviewerEmail = $(\"#dyFormEmail\").val();\n var reviewerComments = $(\"#dyComments\").val();\n var reviewDate = $(\"#dyDate\").val();\n var hasRating = $(\"#dyChkRating\").val();\n var rating1 = $(\"#dyQuality\").val();\n var rating2 = $(\"#dyService\").val();\n var rating3 = $(\"#dyValue\").val();\n\n // b) call DAL function to insert\n\n options = [businessName, typeId, reviewerEmail, reviewerComments,\n reviewDate, hasRating, rating1, rating2, rating3];\n\n function callback() {\n console.info(\"Success: Inserting records successfully\");\n }\n Review.dyinsert(options,callback);\n alert(\"New Feedback Added\");\n //refresh the page\n window.location.reload();\n dyupdateTypesDropdown();\n\n } //3. if not valid show errors\n else {\n console.info(\"Form is invalid\");\n }\n}", "title": "" }, { "docid": "70f794cba13269e218042cf711ad9d3a", "score": "0.5792978", "text": "function save(){\n EWD.sockets.sendMessage({\n type: \"saveLabOrder\",\n params: {\n id: \"1\",\n comment: document.getElementById(\"comment\").value,\n selectedTest: document.getElementById(\"testList\").value,\n collectionType: document.getElementById(\"collectionType\").value ,\n howOften: document.getElementById(\"howOften\").value,\n collectionDate: document.getElementById(\"collectionDate\").value,\n collectionSample: document.getElementById(\"collectionSample\").value,\n specimen: document.getElementById(\"specimen\").value,\n urgency: document.getElementById(\"urgency\").value,\n notifyProviders: document.getElementById(\"selectProvHidden\").value, \n howLong: document.getElementById(\"howLong\").value,\n sender: 'ELOM',\n date: new Date().toUTCString() \n }\n });\n }", "title": "" }, { "docid": "eb6ed10320149d8cf4e29a1d232d5fd2", "score": "0.5789849", "text": "function submitForm() {\n try {\n if (!vm.application._id) {\n // insert new application \n if (!modelSvc.chcekdDuplicate(vm.application, vm.serverDataList)) {\n dataSvc.saveOrUpdateEntity(vm.application).then(function (result) {\n _afterSave(result.data);\n });\n } else {\n showDuplicateMsg(); // show duplicate message found \n }\n } else {\n // update application\n if (!modelSvc.chcekdDuplicate(vm.application, vm.serverDataList, vm.tempApplication)) {\n dataSvc.saveOrUpdateEntity(vm.application).then(function (result) {\n _afterUpdate(result.data);\n });\n } else {\n showDuplicateMsg(); // show duplicate message found \n }\n }\n } catch (e) {\n showErrorMsg(e);\n }\n }", "title": "" }, { "docid": "6b0292b6331a7bbfa1d0c382c3976ecb", "score": "0.57686913", "text": "function SubmitForm(e){\r\n event.preventDefault();\r\n // GetValues\r\n var name=document.getElementById('name').value;\r\n var track =document.getElementById(\"track\").value;\r\n var email=document.getElementById('email').value;\r\n var number=document.getElementById(\"number\").value;\r\n saveMessage(name,track,email,number); //sending to our database)\r\n }", "title": "" }, { "docid": "18a64269344fec76f7fa3aeea9f94481", "score": "0.57681596", "text": "submitComment(){\n\t\tconst comment = {input: this.state.textValue};\n\t\tUtilities.submitComment(\n\t\t\tthis.props.quizId, \n\t\t\tthis.props.questionId, \n\t\t\tcomment\n\t\t).then(question => this.setValuesAfterSubmit(question))\n\t\t.catch(error => this.handleError(error));\n\t}", "title": "" }, { "docid": "ce62681816ce847b4c47048ff304ec8a", "score": "0.5766741", "text": "function submitFeedback() {\n $(\".js-feedback\").on(\"click\", \".js-feedback-submit\", () => {\n ifMaxQuestionIsReached();\n });\n}", "title": "" }, { "docid": "14ffb2a9a7792091c5a855c5b9cfc191", "score": "0.5763828", "text": "function handleFeedbackSubmit() {\n $('#content').on('click', '.feedbackButton', function (event){\n event.preventDefault();\n if(questionNumber < QUESTION.length) {\n //increment question questionNumber\n questionNumber++;\n $('.questionNumber').text(questionNumber+1);\n }\n renderQuestion();\n });\n }", "title": "" }, { "docid": "1f1b64677c5cc4184a00e0ba5ea56c4e", "score": "0.5759565", "text": "function dyupdateFeedback(){\n\n //1. check validation\n if (dyValidate_EditForm()){\n //2. if validation is ok\n console.info(\"Form is valid\");\n // a) fetch info from form\n var id = localStorage.getItem(\"id\");\n var businessName = $(\"#dyEditName\").val();\n var typeId = $(\"#dyEditLocation\").val();\n var reviewerEmail = $(\"#dyEditEmail\").val();\n var reviewerComments = $(\"#dyEditComments\").val();\n var reviewDate = $(\"#dyEditDate\").val();\n var hasRating = $(\"#dyEditChkRating\").val();\n var rating1 =\"\";\n var rating2 =\"\";\n var rating3 =\"\";\n\n if (hasRating == 'true')\n {\n $(\"#dyEditChkRating\").prop(\"checked\",true);\n $(\"#dyEditRatingQuestions\").show();\n rating1 = $(\"#dyEditQuality\").val();\n rating2 = $(\"#dyEditService\").val();\n rating3 = $(\"#dyEditValue\").val();\n }\n else {\n $(\"#dyEditChkRating\").prop(\"checked\",false);\n $(\"#dyEditRatingQuestions\").hide();\n rating1 = \"0\";\n rating2 = \"0\";\n rating3 = \"0\";\n }\n $(\"#dyEditForm :checkbox\").checkboxradio(\"refresh\");\n // b) call DAL function to insert\n var options = [businessName, typeId, reviewerEmail, reviewerComments,\n reviewDate, hasRating, rating1, rating2, rating3,id];\n\n function callback() {\n console.info(\"Success: Updating records successfully\");\n $(location).prop('href', \"#dyViewFeedbackPage\");\n }\n Review.dyupdate(options, callback);\n alert(\"Feedback updated successfully\");\n\n\n }//3. if not valid show errors\n else {\n console.info(\"Form is invalid\");\n }\n}", "title": "" }, { "docid": "7da6abba701f5e81879088b4a1d2f335", "score": "0.57397443", "text": "function addFeedback() {\n\n\t// Cancel the form submit\n\tevent.preventDefault();\n\n\t// Set up an asynchronous AJAX POST request\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('POST', postFeedbackUrl, true);\n\t// xhr.setRequestHeader('Content-type', 'multipart/form-data');\n\n\t// Prepare the data to be POSTed by URLEncoding each field's contents\n\tvar isPublic = \"1\";\n\tvar anony = $('input[name=\"anonymous\"]:checked').length > 0;\n\n\tif (anony) {\n\t\tisPublic = 0;\n\t}\n\tvar type = document.querySelector('input[name = \"feedbacktype\"]:checked').value;\n\tvar email = document.getElementById('email').value;\n\tvar doi = document.getElementById('doi').value;\n\tvar message = document.getElementById('message').value;\n\tvar url = document.getElementById('url').value;\n\tvar owner = document.getElementById('owner').value;\n\tvar title = document.getElementById('title').value;\n\tvar formdata = new FormData();\n\tformdata.append(\"type\", type);\n\tformdata.append(\"email\", email);\n\tformdata.append(\"doi\", doi);\n\tformdata.append(\"message\", message);\n\tformdata.append(\"url\", url);\n\tformdata.append(\"owner\", owner);\n\tformdata.append(\"title\", title);\n\tformdata.append(\"ispublic\", isPublic);\n\n\tvar files = document.getElementById('attachFiles').files;\n\tfor (i = 0, j = files.length; i < j; i++) {\n\t\tformdata.append('files' + i, files[i]);\n\t}\n\n\t// Handle request state change events\n\txhr.onreadystatechange = function() {\n\t\t// If the request completed\n\t\tif (xhr.readyState == 4) {\n\t\t\tstatusDisplay.innerHTML = '';\n\t\t\tif (xhr.status == 200 || xhr.status == 201) {\n\t\t\t\t// If it was a success, close the popup after a short delay\n\t\t\t\tstatusDisplay.innerHTML = 'Saved!';\n\t\t\t\t// window.setTimeout(window.close, 1000);\n\t\t\t\tdocument.getElementById(\"file-display\").innerHTML = \"\";\n\t\t\t\tdocument.getElementById(\"feedback\").reset();\n\t\t\t} else {\n\t\t\t\t// Show what went wrong\n\t\t\t\tstatusDisplay.innerHTML = 'Error saving: ' + xhr.statusText;\n\t\t\t}\n\t\t\thideDiv(\"status-display\", 1500)\n\t\t}\n\t};\n\n\t// Send the request and set status\n\txhr.send(formdata);\n\tstatusDisplay.innerHTML = 'Saving...';\n}", "title": "" }, { "docid": "350301b3be0c6b4ba394058f5be536ac", "score": "0.57375026", "text": "function postData(){\n stage.removeAllChildren()\n stage.update();\n finalData = {subject_id: localStorage.LEAP_subject_id, data: dataSet}\n socket.emit('writeSPRShortData', finalData, function(responded){\n console.log(\"Data Saved\");\n })\n stage.removeChild(text);\n text = new createjs.Text(\"Thank you for your time, this reading task is complete. Please return to the task selection screen to finish any remaining tasks.\",fontInfo)\n text.x = 10\n text.y = ypos\n stage.addChild(text);\n stage.update();\n}", "title": "" }, { "docid": "a3a443f6c2578c5a5893f9f754712cfe", "score": "0.57374567", "text": "function saveFeedback(timestamp, feedback){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n timestamp: timestamp,\n feedback:feedback\n });\n}", "title": "" }, { "docid": "0a9fa5aaab5964c1f2bf6532f750bf3c", "score": "0.573346", "text": "function record()\n {\n var stringifiedQuestionBank;\n \n // Updating the learner response\n setQuestionBank({\n attemptsTaken : attemptsTaken,\n description : description,\n id : id,\n template : template,\n testID : thisTestID,\n value : value\n });\n \n stringifiedQuestionBank = JSON.stringify(cleanQuestionBank());\n \n // Save question bank to CMI DB\n// app.scorm.scormProcessSetValue('cmi.interactions.0.id', 0);\n// app.scorm.scormProcessSetValue('cmi.interactions.0.type', 'long-fill-in');\n// app.scorm.scormProcessSetValue('cmi.interactions.0.learner_response', stringifiedQuestionBank);\n app.scorm.scormProcessSetValue('cmi.suspend_data', stringifiedQuestionBank);\n }", "title": "" }, { "docid": "f6f1cca300642c0d0f64333e8176b823", "score": "0.57328117", "text": "submitFeedback(title){\n\t\tvar response;\n\n\t\t$.ajax({\n\t\t\turl: \"backend/ServerFeedbackCollection.php\",\n\t\t\tmethod: \"POST\",\n\t\t\tdata: {'Action': 'SUBMIT_FEEDBACK' },\n\t\t\tdataType: 'json',\n\t\t\tasync: false,\n\t\t\tsuccess:function(data,response)\n\t\t\t{\n\t\t\t\tconsole.log(data);\n\t\t\t\tsubmitFeedback = data;\n\t\t\t\tresponse = data;\n\t\t\t},\n\t\t\terror:function(jqXHR, text, errorThrown)\n\t\t\t{\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(text);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t}\n\t\t});\n\n\t\treturn response;\n }", "title": "" }, { "docid": "3956bea6dffd6d3541f324f5682d7217", "score": "0.57317835", "text": "function commit_user_data (req, res, next) {\n // letting this throw when easy_feedback doesn't exist. It would be an\n // internal error in that case\n var to_send = req.easy_feedback.user_data;\n storage.user.data_commit(req.session, to_send, function (err, status) {\n if (err) {\n throw err;\n }\n next();\n });\n}", "title": "" }, { "docid": "f0f38d993c57ec234b8fa7362e5cc555", "score": "0.5729169", "text": "function submitForm(e) {\n e.preventDefault();\n\n var name = getInputVal('name')\n var ingredients = getInputVal('ingredients')\n var instructions = getInputVal('instructions')\n\n saveMessage(name, ingredients, instructions);\n}", "title": "" }, { "docid": "7c028865d6ce4d9ea7e7aa3a4854f7c0", "score": "0.5725556", "text": "function renderFeedback(response) {\n $(\".js-question\").hide();\n $(\".js-feedback\")\n .show()\n .html(response);\n increaseDbCount();\n}", "title": "" }, { "docid": "6ccc577f57335135f1dca682c2a3ed57", "score": "0.57171255", "text": "saveQuestion1(){\n // collects all of the data that was entered in the input fields and sets them as values in a hash of keys with the same names.\n var params = {\n author: this.get('author'),\n body: this.get('body'),\n notes: this.get('notes'),\n };\n this.set('addNewQuestion', false); //hide form again after each field's value is collected\n this.sendAction('saveQuestion2', params); //emits the action saveQuestion2 sending with it the params hash that we just made\n }", "title": "" }, { "docid": "a4f83cbd42db854f8c0be00391e228ca", "score": "0.57132196", "text": "handleFeedback () {\r\n var acc_yes = this.refs.satisfied_acc_yes.checked\r\n var acc_no = this.refs.satisfied_acc_no.checked\r\n var id = this.props.data.AIModels[0].ID\r\n if (acc_yes || acc_no) {\r\n var params = {}\r\n params.aiModelID = id\r\n params.accFeedback = acc_yes\r\n\r\n if (this.props.data.Prediction !== null && this.props.data.MakePrediction) {\r\n var predict_yes = this.refs.satisfied_predict_yes.checked\r\n var predict_no = this.refs.satisfied_predict_no.checked\r\n if (predict_yes || predict_no) {\r\n params.prdFeedback = predict_yes\r\n } else {\r\n Alert('Missng prediction feedback', 'danger', 4 * 1000)\r\n return\r\n }\r\n } else {\r\n params.prdFeedback = null\r\n }\r\n\r\n api.giveFeedback(params)\r\n .then((msg) => {\r\n Alert(msg, 'success', 4 * 1000)\r\n this.props.collapsibleTableCloseAll()\r\n api.fetchGlobalData()\r\n .catch((err) => {\r\n Alert(err, 'danger', 4 * 1000)\r\n })\r\n })\r\n .catch((err) => {\r\n Alert(err, 'danger', 4 * 1000)\r\n })\r\n }\r\n }", "title": "" }, { "docid": "30dfb26f184859bac2d8abe7479f50fd", "score": "0.57077837", "text": "function submit_record(record) {\n Controller.local_persist(record);\n Controller.flush();\n}", "title": "" }, { "docid": "ed1a8fa1948f4eab4207c3523ad7d012", "score": "0.5687671", "text": "function Submit(){\n\t\tprogressBar();\n\t\tgraficasCumplimiento();\n\t\tgraficasEjecucion();\n\t\ttablaHorarios();\n\t}", "title": "" }, { "docid": "39c5eefa1578e85c0c04b31e5f29c7cb", "score": "0.5686984", "text": "function writeFeedback(pageName, chapNum, numQuestions) {\r\n\tvar user_name = parent.sessionUserName;\r\n\tvar status;\r\n\tvar textFeedback = '<br /><span style=\"color: #fff;\">N/A</span>';\r\n\r\n\t// isComplete() will return 1 if complete, 0 if incomplete, and -1 if unattempted\r\n\tvar completion_var = isComplete(pageName, chapNum, user_name, numQuestions);\r\n\tswitch(completion_var) {\r\n\t\tcase 1:\r\n\t\t\tstatus = \"complete\";\r\n\t\t\t// If the activity has no online activity associated with it, simply print out \"Done\"\r\n\t\t\t// Otherwise, calculate a score for the activity\r\n\t\t\tif(numQuestions <= 0) {\r\n\t\t\t\ttextFeedback = \t'<br /><p class=\"scoreFeedback\">Done</p>';\r\n\t\t\t} else textFeedback = '<br /><p class=\"scoreFeedback\">'+ calculateScore(pageName, chapNum, user_name, numQuestions) +'</p>';\r\n\t\t\tbreak;\r\n\t\tcase 0:\r\n\t\t\tstatus = \"incomplete\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tstatus = \"unattempted\";\r\n\t\t\tbreak;\r\n\t}\r\n\tdocument.writeln('<img src=\"../images/'+ status +'.gif\" alt=\"'+ status +'\" title=\"'+ status +'\" class=\"completionFeedback\" />' + textFeedback);\r\n}", "title": "" }, { "docid": "e18043d26151547285148a39f066873e", "score": "0.5686343", "text": "onSubmit(value) {\n this.status = 'answered';\n\n // Rerender prompt\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(value);\n }", "title": "" }, { "docid": "e18043d26151547285148a39f066873e", "score": "0.5686343", "text": "onSubmit(value) {\n this.status = 'answered';\n\n // Rerender prompt\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(value);\n }", "title": "" }, { "docid": "34463e59f9ca1eaeaa0eef6390f29a10", "score": "0.56861216", "text": "function submitFeedback() {\n\tvar radios = iframe.contentWindow.document.getElementsByName('listDetail');\n\tvar checktrue = false;\n\tfor (var i = 0, length = radios.length; i < length; i++) {\n\t\tif (radios[i].checked) {\n\t\t\tchecktrue = true;\n\t\t\tbreak;\n\t\t} else {\n\t\t\tchecktrue = false;\n\t\t}\n\t}\n\tif (checktrue) {\n\t\tiframe.contentWindow.document.getElementById('feedbackAlert').innerText = '';\n\t\tvar feedbackText = iframe.contentWindow.document.getElementById('feedbackText').value;\n\t\tfeedbackText = feedbackText.replace(/^\\s+/g, '');\n\t\tif (!feedbackText) {\n\t\t\tiframe.contentWindow.document.getElementById('feedbackAlert').innerText = 'Please provide your feedback.';\n\t\t\tiframe.contentWindow.document.getElementById('feedbackText').style.borderColor = \"#e4b9a3\";\n\t\t} else {\n\t\t\tvar feedbackEmailText = iframe.contentWindow.document.getElementById('feedbackEmail').value;\n\t\t\tvar feedbackEmail = \"\";\n\t\t\tif (feedbackEmailText != \"\") {\n\t\t\t\tfeedbackEmail = ValidateEmail(feedbackEmailText);\n\t\t\t}\n\t\t\tvar feedOption = radios[i].value;\n\t\t\tCurrHost = CurrHost.replace(\"www.\", \"\");\n\t\t\tif ((feedbackEmailText == \"\") || (feedbackEmail == true)) {\n\t\t\t\tvar feedParams = \"installation_id=\" + InstallObj + \"&store_url=\" + CurrHost + \"&feedback=\" + feedbackText + \"&email=\" + feedbackEmail + \"&reason=\" + feedOption + \"\";\n\t\t\t\tvar feedHttp = new XMLHttpRequest();\n\t\t\t\tfeedHttp.onreadystatechange = function () {\n\t\t\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\t\t\tcloseframe();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tfeedHttp.open(\"POST\", baseApiUrl + \"/submitFeedback\", false);\n\t\t\t\tfeedHttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n\t\t\t\tfeedHttp.setRequestHeader(\"Client-Service\", \"cchief\");\n\t\t\t\tfeedHttp.setRequestHeader(\"Auth-Key\", \"0BC0EAF2470D001FF31370AEE8282EBD\");\n\t\t\t\tfeedHttp.send(feedParams);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tiframe.contentWindow.document.getElementById('OptionAlert').innerText = 'Please select any option.';\n\t}\n}", "title": "" }, { "docid": "ef7fcef680367183ce3a1cb7299f6873", "score": "0.5672504", "text": "enterFeedback(feedback) {\n\n axios({\n method: 'POST',\n url: '/get_feedback',\n data: feedback\n })\n .then((response) => {\n console.log(response);\n })\n .catch((err) => {\n console.warn(err);\n })\n\n }", "title": "" }, { "docid": "62e02425d6e711f329715dc5eb74c326", "score": "0.56721807", "text": "submit() {\r\n this.validate(this._form);\r\n\r\n if (this._valid.length !== this._fields.length) return;\r\n\r\n this.title.value = this._formContainer.querySelector('#title').value;\r\n this.date.value = this._formContainer.querySelector('#date').value;\r\n \r\n this.createTask();\r\n this.createFragment();\r\n this.close();\r\n }", "title": "" }, { "docid": "443f07b1e03f6995e2593b803c497638", "score": "0.5671894", "text": "function savePost(){\n //prevents refresh on submit\n event.preventDefault();\n //sets up table in db\n setDatabaseName('dbUsers', ['UsersObjectStore', 'PostsObjectStore', 'MessagesObjectStore']);\n\tsetCurrObjectStoreName('PostsObjectStore');\n\tstartDB(function () {\n //calls function in the DAO\n savePostData();\n //publishes post\n publish(sessionStorage.getItem(\"userID\"), $(\"#txtPostBody\").val(), new Date().toLocaleString());\n\t}, function () {});\n}", "title": "" }, { "docid": "2bf32c2fb014ab53a349a8e3e65942ea", "score": "0.5664274", "text": "submit(){\n var title = \"Summary\"\n var date = getDate();\n this.state.date = date;\n var product= \"Product: Design: \" + this.state.design + \". Color: \" + this.state.color;\n var mBelovac= \"Belovac: Completed: \" + this.state.belovac + \". Lost: \" + this.state.belovacLost;\n var mGuillotine= \"Guillotine: Completed: \" + this.state.guillotine + \". Lost: \" + this.state.guillotineLost;\n var mRotozip= \"RotoZip: Completed: \" + this.state.rotozip + \". Lost: \" + this.state.rotozipLost;\n var mSanding= \"Sanding: Completed: \" + this.state.sanding + \". Lost: \" + this.state.sandingLost;\n var mVelcro= \"Velcro: Completed: \" + this.state.velcro + \". Lost: \" + this.state.velcroLost;\n var mStickers= \"Stickers: Completed: \" + this.state.stickers + \". Lost: \" + this.state.stickersLost;\n var mPackaing= \"Packaging: Completed: \" + this.state.packaging + \". Lost: \" + this.state.packagingLost;\n var message= title +\"\\n\"+ date + \"\\n\" + product+\"\\n\"+mBelovac+\"\\n\"+mGuillotine+\"\\n\"+mRotozip+\"\\n\"+mSanding+\"\\n\"+mVelcro+\"\\n\"+mStickers+\"\\n\"+mPackaing;\n var show = \"Grill|\" + this.state.design+ \"|\" + this.state.color + \"|Bel:\" + this.state.belovac +\"-\"+this.state.belovacLost+\"|Gui:\"+this.state.guillotine+\"-\"+this.state.guillotineLost+\"|Rto:\"+this.state.rotozip+\"-\"+this.state.rotozipLost+\"|Snd:\"+this.state.sanding+\"-\"+this.state.sandingLost+\"|Vlc:\"+this.state.velcro+\"-\"+this.state.velcroLost+\"|Stk:\"+this.state.stickers+\"-\"+this.statestickersLost+\"|Pac:\"+this.state.packaging+\"-\"+this.state.packagingLost;\n {/*This shows the alert with the summary*/}\n alert(message)\n {/*If click confirm add to database, click deny will not*/}\n {/*Will try to send data to the Output function here when confirm is selected*/}\n confirmAlert({\n title: 'Confirm Add',\n message: 'Do you want to add to inventory',\n buttons: [{label: 'Confim', onClick: () => this.sendToSummary(show)\n },{label: 'Deny'}]\n })\n }", "title": "" }, { "docid": "1ee3e6a344e1a37feb8a276c4d4e7414", "score": "0.56536144", "text": "function sendComment() {\n var commentId;\n comPanelVm.data = Date.now();\n commentId = helpersFactory.generateUniqueId();\n commentFactory.createCommentInDB(commentId, comPanelVm.name, comPanelVm.email, comPanelVm.comment, comPanelVm.data);\n comPanelVm.name = \"\";\n comPanelVm.email = \"\";\n comPanelVm.comment = \"\";\n }", "title": "" }, { "docid": "90d21f78431e1f8b98e79523de109a56", "score": "0.5650053", "text": "function formSubmitTrigger() {\n //Load custom configuration for this client\n Config.load(configurationFileId);\n \n //Obtain new submissions\n var submissions = Submissions();\n \n //Insert new submitted files into the review process\n submissions.processAll();\n}", "title": "" }, { "docid": "e671db7b7ce008b1c73251a08ebe9902", "score": "0.5649849", "text": "function submitContact() {\n name = contactName();\n email = contactEmail();\n message = contactMessage();\n \n data = {\n name: name,\n email: email,\n message: message,\n user: user_uuid()\n };\n \n dataLayer.push({'event': 'submit-contact', 'data': data, 'redirect':\"#\"});\n \n \n window.location.href = \"#\";\n}", "title": "" }, { "docid": "e0fc9d778871584e62f308057c66a042", "score": "0.56491977", "text": "submit(data, formRef) {\n const { userEmail, userImage, toUser, comment, rating } = data;\n const owner = Meteor.user().username;\n const postedAt = new Date();\n Ratings.insert({ userEmail, userImage, toUser, comment, rating, postedAt, owner },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Item added successfully', 'success');\n formRef.reset();\n }\n });\n }", "title": "" }, { "docid": "08ff8b7bbc3cc91cacd4b0303f36fa19", "score": "0.5648512", "text": "handleSubmit() {\n const {\n title,\n description,\n carriedOutBy,\n monitoredBy,\n comments,\n deadline\n } = this.state;\n\n const actionPlan = {\n title,\n description,\n carriedOutBy,\n monitoredBy,\n comments,\n deadline\n };\n createAction(actionPlan, () => {\n console.log(\"Action Plan uploaded\");\n });\n this.props.refreshScreen();\n this.props.closeDisplay();\n }", "title": "" }, { "docid": "c80338e5799af059439ddbdfcf837623", "score": "0.56469923", "text": "function submitGrade(){\n\t// Get form data\n\tvar formData = $('#grade-form').serializeArray();\n\t// Add the gradeQuery\n\tformData.push({name:'gradeQuery', value:'submitGrade'});\n\tformData.push({name:'userid', value: currentStudent.userid});\n\t// Save the form info to update the display via jquery\n\tvar tempGraderComments = $('#grader-comments').val();\n\tvar tempGrade = $('#grade').val();\n\t\n\t$.ajax({\n\t\tasync: true,\n\t\ttype: 'POST',\n\t\turl: \"professor_grading.php\",\n\t\tdata: formData,\n\t\tsuccess: function(result){\n\t\t\t//alert(result);\n\n\t\t\tif(result=='Success'){\n\t\t\t\t// Update the row\n\t\t\t\t$('#'+currentStudent.userid+' td').eq(3).children(\"button\").removeClass('ungraded');\n\t\t\t\t$('#'+currentStudent.userid+' td').eq(3).children(\"button\").addClass('graded');\n\t\t\t\t$('#'+currentStudent.userid+' td').eq(3).children(\"button\").html(\"EDIT\");\n\t\t\t\t$('#'+currentStudent.userid+' td').eq(2).html(tempGrade);\n\t\t\t\t// Update the student gradeData object\n\t\t\t\tcurrentStudent.graderComments = tempGraderComments;\n\t\t\t\tcurrentStudent.grade = tempGrade;\n\n\t\t\t\t// Close the popup\n\t\t\t\t$(\"#custom_container\").hide();\n\t\t\t\t$(\"#popup\").html(\"\");\n\t\t\t\t$(\"#canvas\").show(); \n\t\t\t\t$(\"#dim_div\").hide();\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(\"Grade was not submitted. Please try again.\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "95b04446cc7fc132b1bb7ed49bfeb8b3", "score": "0.56462806", "text": "function handleFeedbackSubmission(eventObject) {\n eventObject.preventDefault();\n\n// store entered values in variables:they are strings\nlet name = eventObject.target.userName.value;\nlet comment = eventObject.target.userComment.value;\n\n// console.log(eventObject.target.userName.value);\n// console.log(eventObject.target.userComment.value);\n\n// calling createComment function \n createComment(name, comment)\n}", "title": "" }, { "docid": "395647234fa0529a99151dbfd123babb", "score": "0.56425047", "text": "async submit(data, formRef) {\n const { Intent, Phrases, Responses } = data;\n Meteor.call(addIntent, data, (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Item added successfully', 'success');\n Intents.collection.insert({ Intent, Phrases, Responses });\n }\n });\n formRef.reset();\n }", "title": "" }, { "docid": "709cdc0f02d77175e3d0ffb625cb3f69", "score": "0.5642377", "text": "function submitQuestion(event){\n\tvar loader = document.getElementById(\"loader\");\n\tloader.classList.add(\"loader\");\n\tevent.preventDefault();\n\t//disabling scrolling\n\tdisableScroll();\n\t//getting all the data needed for submitting a question\n\tvar question_text = document.getElementById(\"question_text\").value;\n\tconsole.log(\"question text: \"+question_text)\n\tvar func_name = document.getElementById(\"func_name\").value;\n\tconsole.log(\"function name: \"+func_name)\n\tvar param_names = document.getElementById(\"param_names\").value;\n\tconsole.log(\"function params: \"+param_names)\n\n\tvar topic_obj = document.getElementById(\"topic\")\n\tvar topic = topic_obj.options[topic_obj.selectedIndex].value;\n\n\tconsole.log(\"topic: \"+topic)\n\n\tvar difficulty_obj = document.getElementById(\"difficulty\")\n\tvar difficulty = difficulty_obj.options[difficulty_obj.selectedIndex].value;\n\n\tconsole.log(\"difficulty: \"+difficulty)\n\n\tvar fields = {\"question_text\":question_text, \"func_name\":func_name, \"param_names\":param_names, \"topic\":topic, \"difficulty\":difficulty}\n\tconsole.log(\"STUFF: \"+JSON.stringify(fields))\n\tajaxCallInsertQuestion(\"insert\", JSON.stringify(fields))\n}", "title": "" }, { "docid": "d2be931d9605b6b0e4eaed8281c21a34", "score": "0.5631466", "text": "submitReport() {\n let report = this.state.feedbackContent.trim();\n if (report !== \"\") {\n //Submit report\n sendFeedback(report);\n this.refs.feedbackInput.blur();\n this.launchModal();\n this.setState({ feedbackContent: \"\" });\n }\n }", "title": "" }, { "docid": "9a5085cb85b42e135659a25dc04443db", "score": "0.5628963", "text": "async cronForFeedbackForm() {\n try {\n const currentTime = moment().format('YYYY-MM-DD HH:mm:ss');\n const gapHour = moment(currentTime)\n .subtract('30', 'minutes')\n .format('YYYY-MM-DD HH:mm:ss');\n\n let bookingData = await Booking.query()\n .with('caregiverDetail')\n .with('client')\n .with('client.user')\n .where('end_time', '>', gapHour)\n .where('end_time', '<', currentTime)\n .whereNull('cancelled_by')\n .where('caregiver_bookings.status', constantMsgs.accepted)\n .fetch();\n\n const results = [];\n bookingData = bookingData.toJSON();\n for (const data of bookingData) {\n const { 0: checkAccepted } = data.caregiverDetail.filter(\n c => c.status === constantMsgs.accepted,\n );\n const caregiver = await Caregiver.find(checkAccepted.caregiver_id);\n caregiver.total_completion_event += 1;\n await caregiver.save();\n const booking = await Booking.find(data.id);\n booking.completion_count = caregiver.total_completion_event;\n await booking.save();\n\n const mailData = {\n clientEmail: data.client.user.email,\n name: data.client.first_name,\n // link: `${Env.get('FEEDBACK_FORM_CLIENT')}?booking=${data.booking_id}`,\n };\n\n const tokenData = {\n booking_id: data.booking_id,\n slug: data.client.slug,\n };\n let encryptedData = CryptoJS.AES.encrypt(\n JSON.stringify(tokenData),\n `${Env.get('APP_KEY', 'D6B13YMGZ8zLKWZb51yh9hC2lXIWZtx8')}`,\n ).toString();\n encryptedData = CryptoJS.enc.Base64.parse(encryptedData);\n encryptedData = encryptedData.toString(CryptoJS.enc.Hex);\n mailData.link = `${Env.get(\n 'FEEDBACK_FORM_CLIENT',\n )}?booking=${encryptedData}`;\n\n if (!data.client.user.is_deleted) {\n // mail for client\n await Mail.send(\n data.client.user.preferred_communication_language ===\n constantMsgs.chinese\n ? 'email.ch.feedback-form-client'\n : 'email.en.feedback-form-client',\n mailData,\n mail => {\n mail\n .to(mailData.clientEmail)\n .from(Env.get('EMAIL_FROM'))\n .subject('用户意見 Feedback Form');\n },\n );\n\n results.push(\n // sending whatsapp message to CLIENT for feedback form\n util.sendWhatsAppMessage(\n data.client.user.mobile_number,\n `啱啱護理員服務好嗎?麻煩你用1分鐘同大家分享你嘅想法!\\n${mailData.link}`,\n ),\n );\n }\n }\n if (results && results.length) {\n await Promise.all(results);\n }\n } catch (error) {\n Logger.info('Service cronForWhatsappMsg Catch %s', error);\n throw error;\n }\n }", "title": "" }, { "docid": "9017cb5336dab7dc89b7849e1d22a51c", "score": "0.5618296", "text": "function send_feedback(plug_param, plug_ID) {\n\tjQuery(\"#wait_feedback\").show();\n\tjQuery(\"#feedback_submit\").remove() ;\n\t\t\n\tvar arguments = {\n\t\taction: 'send_feedback', \n\t\tname : jQuery(\"#feedback_name\").val(), \n\t\tmail : jQuery(\"#feedback_mail\").val(), \n\t\tcomment : jQuery(\"#feedback_comment\").val(), \n\t\tplugin : plug_param,\n\t\tpluginID : plug_ID\n\t} \n\t//POST the data and append the results to the results div\n\tjQuery.post(ajaxurl, arguments, function(response) {\n\t\tjQuery(\"#wait_feedback\").fadeOut();\n\t\tjQuery(\"#form_feedback_info\").html(response);\n\t\twindow.location = String(window.location).replace(/\\#.*$/, \"\") + \"#top_feedback\";\n\t}).error(function(x,e) { \n\t\tif (x.status==0){\n\t\t\t//Offline\n\t\t} else if (x.status==500){\n\t\t\tjQuery(\"#form_feedback_info\").html(\"Error 500: The ajax request is retried\");\n\t\t\tsend_feedback(plug_param, plug_ID) ; \n\t\t} else {\n\t\t\tjQuery(\"#form_feedback_info\").html(\"Error \"+x.status+\": No data retrieved\");\n\t\t}\n\t}); \n}", "title": "" }, { "docid": "77bc3aeb9ba599e74ec345ca49382ad5", "score": "0.5616845", "text": "function goSubmitMr() {\n closeAllchildren();\n saveCurrenData();\n\tif (auditSubmitData()) {\n\t\t$(\"action\").value = \"submit\";\n\t\t//prepare grid for data sending\n\t\tmygrid.parentFormOnSubmit();\n \tdocument.genericForm.submit();\n\t\tshowTransitWin(\"\");\n\t}else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "60c13358aefc0bcbf8c72ea1fab955fd", "score": "0.5612595", "text": "function onSubmit(e) {\n e.preventDefault();\n onSuccess(values, movie.id ? \"UPDATE\" : \"INSERT\");\n }", "title": "" }, { "docid": "73726153796cd739168477789c53ec72", "score": "0.5609438", "text": "function submitQuestion(e) {\r\n e.preventDefault();\r\n $thankyou.fadeIn();\r\n\r\n // hide tool tip launcher and popover\r\n $tooltip.fadeOut();\r\n $module.find('.popover').fadeOut();\r\n }", "title": "" }, { "docid": "d40c9f29370750c97f8ddc19d7186184", "score": "0.5595058", "text": "handleFeedback () {\r\n var acc_yes = this.refs.satisfied_acc_yes.checked\r\n var acc_no = this.refs.satisfied_acc_no.checked\r\n var id = this.props.data.AIModels[0].ID\r\n if (acc_yes || acc_no) {\r\n var params = {}\r\n params.aiModelID = id\r\n params.accFeedback = acc_yes\r\n\r\n if (this.props.data.Prediction !== null && this.props.data.MakePrediction) {\r\n var predict_yes = this.refs.satisfied_predict_yes.checked\r\n var predict_no = this.refs.satisfied_predict_no.checked\r\n if (predict_yes || predict_no) {\r\n params.prdFeedback = predict_yes\r\n } else {\r\n Alert('Missng prediction feedback', 'danger', 4 * 1000)\r\n return\r\n }\r\n } else {\r\n params.prdFeedback = null\r\n }\r\n\r\n api.giveFeedback(params)\r\n .then((msg) => {\r\n Alert(msg, 'success', 4 * 1000)\r\n api.fetchUserData()\r\n .catch((err) => {\r\n Alert(err, 'danger', 4 * 1000)\r\n })\r\n })\r\n .catch((err) => {\r\n Alert(err, 'danger', 4 * 1000)\r\n })\r\n }\r\n }", "title": "" }, { "docid": "dcdf1a9e9a3bbdfc6c0d95185f16b6c6", "score": "0.55803204", "text": "function submitListen(questionBankObject) {\n\t$('.js-button-submit').click(function(event) {\n\n\t\tevent.preventDefault();\n\n\t\tfeedbackPage(questionBankObject);\n\t});\n}", "title": "" }, { "docid": "b6060729aa3695467f64636429dfac45", "score": "0.5579444", "text": "function submitClick(){\n\tvar name = document.getElementById('nameInp').value;\n\tvar email = document.getElementById('emailInp').value;\n\tvar message = document.getElementById('msgInp').value;\n\n\tif (checkValues(name, message)) {\n\t\treturn;\n\t}\n\n\tvar time = Date.parse(new Date())\n\n\tsendNotify(name+\" - \"+email, message);\n writeUserData(name, email, message, time);\n\n\n\t//display alert 'Message has been sent'\n\tdocument.getElementById('formAlert').style.display = 'block';\n\tdocument.getElementById('email_form').style.height = '320px';\n\tsetTimeout(function(){\n\t\tdocument.getElementById('formAlert').style.display = 'none';\n\t\tdocument.getElementById('email_form').style.height = '265px';\n\t}, 3000);\n\n //clear fields\n document.getElementById('form').reset();\n}", "title": "" }, { "docid": "e39cc006289ab865954528fc3bb5bd7f", "score": "0.5577465", "text": "function onClick(){\n addFeedbackItem(newItem);\n history.push('/CompletedSurvey');\n }", "title": "" }, { "docid": "c40166ca81301c53d23a41783b614407", "score": "0.55737174", "text": "handleSubmit() {\n\n if (this.state.goal > this.lift.pr) {\n let newGoal = {\n goalData: this.state.goal,\n name: this.lift.name\n }\n saveNewGoal(newGoal);\n } else {\n alert(\"New goal must be larger than PR.\")\n }\n\n }", "title": "" }, { "docid": "d65ebe4e4157a3f7d090f477e73263b2", "score": "0.55700874", "text": "function feedbackIfCorrect() {\r\n $(\".feedback\").html(`${STORE[questionNumber].questionFeedbackCorrect}`);\r\n incrementScore();\r\n }", "title": "" }, { "docid": "9a40d1f124efb41f2c0a5966009f2b43", "score": "0.5561187", "text": "function getFeedback() {\n $('main').on('click', '.feedback', event => {\n event.preventDefault();\n let slide = store.slides[getIndex()];\n let selection = $('input[name=\"answers\"]:checked').val();\n checkIfAnswered(slide, selection);\n editSubmitButtonClass(slide);\n toggleHasAnswered();\n });\n}", "title": "" }, { "docid": "a3eed9bcfdaf686ed980697ab2920964", "score": "0.5556735", "text": "function msg_SuccessfulSave(){\n new PNotify({\n title: 'Saved',\n text: 'New Record Added.',\n type: 'success'\n });\n }", "title": "" }, { "docid": "1daa1f4670933905e7046c1996e78a50", "score": "0.5555111", "text": "function resSubmited() {\n \n}", "title": "" }, { "docid": "326de50ad580561d473cc354dda6c05f", "score": "0.55429685", "text": "function submitForm(){\n document.getElementById(\"note\").innerHTML = \"ok: \" + i;\n\t\ti++;\n }", "title": "" }, { "docid": "de5455e4d8c3e647a467f71f9fc55fc3", "score": "0.5540427", "text": "function updateScreen() {\n if (responseObject.questionInsertValid == \"true\") {\n insertSuccessText.innerText = \"Question Insert Successful\";\n } else {\n insertSuccessText.innerText = \"Question Insert Unsuccessful\";\n }\n renderQuestions();\n}", "title": "" }, { "docid": "cdb83f30dccec9e86225a7b91f85cd3f", "score": "0.5521746", "text": "function sendDoneQues1(){\n var statement = getxAPIStatement(\n localStorage.getItem('email'),\n localStorage.getItem('name'),\n \"https://w3id.org/xapi/dod-isd/verbs/advanced\",\n \"advanced\",\n \"http://punklearning.com/xapi/advanced_1\",\n \"question 2\",\n \"to question 2\"\n )\n\n ADL.XAPIWrapper.sendStatement(statement);\n}", "title": "" }, { "docid": "e304d0456c4649f2e0e6bdd72c050003", "score": "0.5513356", "text": "function submit(e) {\n e.preventDefault()\n const { controlFormTitle: title, controlFormBody: body, ideas } = ideaState.getState()\n ideaState.setState({\n controlFormTitle: '',\n controlFormBody: '',\n ideas: [{\n id: Date.now(),\n title,\n body,\n quality: ['Good', 'The Best']\n }, ...ideas]\n })\n render()\n}", "title": "" }, { "docid": "b83af23311e992c61fcafe811ed1756f", "score": "0.5512094", "text": "function sendCommentsToDB(e){\n e.preventDefault()\n const memberCommented = sessionStorage.getItem('userData');\n const formdata = new FormData()\n formdata.append('comment', comment)\n formdata.append('articleID', props.articleID)\n formdata.append('memberCommented', memberCommented)\n axios.post(\"http://localhost/ultras/blog_comments/addBlogComments.php\", formdata )\n .then(response => {\n if(response.data === 'comment_added'){\n setComment('');\n setD_noneComnts(true);\n setErrorMsgComnts('');\n }else{\n setErrorMsgComnts(response.data);\n setD_noneComnts(false);\n }\n })\n .catch(error => console.log(error))\n }", "title": "" }, { "docid": "ee6aab668fb81f83aa202981c9ab122f", "score": "0.5499491", "text": "function submitPost() {\n var post = {\n 'title': vm.title,\n 'content': vm.content\n }\n\n PostFactory.sendPost(post)\n .then(function(success) {\n // Materialize.toast('Post submit successfully', 4000)\n $log.log(success.data);\n }, function(err) {\n $log.log(err.data);\n });\n }", "title": "" }, { "docid": "f28861f125a9a046d3f9a342aa221f3e", "score": "0.5498372", "text": "function submitNote(note) {\n success = note.toLowerCase() === currentNoteName[0].toLowerCase(); \n\n changeColor(note, success); \n \n if (success) { \n numSucesses += 1; \n drawRandomNote(); \n }\n else {\n numFailures += 1; \n }\n\n updateStats();\n}", "title": "" }, { "docid": "be623ec6015734f2233bd50f3c04bc22", "score": "0.54971844", "text": "function submit() {\n if (!vm.listItems[0].contents.input1 || !vm.listItems[0].contents.input1.trim()) { // validation\n return $ionicPopup.alert({\n title: 'Inputs Missing',\n template: 'Please fill in inputs.'\n });\n }\n $ionicLoading.show().then(function() {\n var data = vm.listItems.reduce(function(prev, next) {\n prev.responses.push({\n question: next.contents.input1label,\n answer: next.contents.input1,\n });\n prev.responses.push({\n question: next.contents.input2label,\n answer: next.contents.input2,\n });\n return prev;\n }, {\n responses: [],\n userId: currentAuth.uid,\n createdAt: Date.now(),\n });\n vm.prepares.$add(data).then(function() {\n $ionicLoading.hide();\n $state.go('reframe');\n }).catch(function() {\n $ionicLoading.hide();\n $ionicPopup.alert({\n title: 'Submission Failed',\n template: 'Sorry for the inconvinience.'\n });\n });\n });\n }", "title": "" }, { "docid": "6d0c4a709bff0bb44a001d9562f13ed6", "score": "0.5496233", "text": "submitDBupdate() {\n\t\tconst update_url = this.props.source + '/update/' + this.props.data._id;\n\n\t\tlet bp_update = {\n\t\t\timgcode: this.refs.imgcode.value,\n\t\t\tbodypart: document.querySelector('#formControlBodyPartSelect').value,\n\t\t\tmodality: this.refs.modality.value,\n\t\t\tdescription: this.refs.description.value.toUpperCase()\n\t\t};\n\n\t\tlet laterality = document.getElementById('laterality').value;\n\n\t\tif (laterality != '') {\n\t\t\tbp_update.laterality = laterality;\n\t\t}\n\n\t\tconst payload = {\n\t\t\tmethod: 'PUT',\n\t\t\tbody: JSON.stringify(bp_update),\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t}\n\t\t};\n\n\t\tfetch(update_url, payload)\n\t\t\t.then(resp => {\n\t\t\t\tif (resp.ok) {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\teditMode: false,\n\t\t\t\t\t\tsaved: true\n\t\t\t\t\t});\n\t\t\t\t\tbp_update._id = this.props.data._id;\n\t\t\t\t\tthis.props.update(this.props.index, bp_update);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tthis.setState({editMode: false});\n\t\t});\n\t}", "title": "" }, { "docid": "1b277ca100a722945ae98699b0b59189", "score": "0.5492087", "text": "function submitRecord() {\n var name, record, saveResult, redirect, beforeMsg, callbacks, authLink;\n\n //$form.trigger( 'beforesave' );\n if ( !form.isValid() ) {\n gui.alert( t( 'alert.validationerror.msg' ) );\n return;\n }\n redirect = ( typeof settings !== 'undefined' && typeof settings[ 'returnURL' ] !== 'undefined' && settings[ 'returnURL' ] ) ? true : false;\n beforeMsg = ( redirect ) ? t( 'alert.submission.redirectmsg' ) : '';\n authLink = '<a href=\"/login\" target=\"_blank\">' + t( 'here' ) + '</a>';\n\n gui.alert( beforeMsg + '<br />' +\n '<div class=\"loader-animation-small\" style=\"margin: 10px auto 0 auto;\"/>', t( 'alert.submission.msg' ), 'bare' );\n\n callbacks = {\n error: function( jqXHR ) {\n if ( jqXHR.status === 401 ) {\n gui.alert( t( 'alert.submissionerror.authrequiredmsg', {\n here: authLink\n } ), t( 'alert.submissionerror.heading' ) );\n } else {\n gui.alert( t( 'alert.submissionerror.tryagainmsg' ), t( 'alert.submissionerror.heading' ) );\n }\n },\n success: function() {\n $( document ).trigger( 'submissionsuccess' ); // since connection.processOpenRosaResponse is bypassed\n if ( redirect ) {\n // scroll to top to potentially work around an issue where the alert modal is not positioned correctly\n // https://github.com/kobotoolbox/enketo-express/issues/116\n window.scrollTo( 0, 0 );\n gui.alert( t( 'alert.submissionsuccess.redirectmsg' ), t( 'alert.submissionsuccess.heading' ), 'success' );\n setTimeout( function() {\n location.href = settings.returnURL;\n }, 1500 );\n }\n //also use for iframed forms\n else {\n gui.alert( t( 'alert.submissionsuccess.msg' ), t( 'alert.submissionsuccess.heading' ), 'success' );\n resetForm( true );\n }\n },\n complete: function() {}\n };\n\n record = {\n key: 'record',\n data: form.getDataStr( true, true ),\n files: fileManager.getCurrentFiles()\n };\n\n prepareFormDataArray( record ).forEach( function( batch ) {\n connection.uploadRecords( batch, true, callbacks );\n } );\n }", "title": "" }, { "docid": "13b5143881f121f3e6f7093ed75cd9e6", "score": "0.54918784", "text": "addFeedbackListener() {\n $('#user-feedback').submit(async function (e) {\n e.preventDefault();\n\n const feedback_data = {\n feedback: $(this).find('textarea[name=\"feedback\"]').val(),\n email: $(this).find('input[type=\"email\"]').val(),\n };\n try {\n var resp = await axios.post('/v1/feedback', feedback_data);\n } catch (error) {\n Sentry.captureException(error);\n $('.feedback').text('Internal Error. Try again later.');\n return;\n }\n const data = resp.data;\n if (data.error) {\n $('.feedback').html(`<p class=\"txt-${data.color}\">${data.error}</p>`);\n } else if (data.success) {\n $('#user-feedback-modal .feedback').html(\n `<p class=\"txt-${data.color}\">${data.success}</p>`\n );\n $(this).find('textarea[name=\"feedback\"]').val('');\n }\n setTimeout(() => {\n $('#user-feedback-modal').modal('hide');\n $('#user-feedback-modal .feedback').html('');\n }, 3000);\n });\n }", "title": "" }, { "docid": "34d671385aef2c25d61425ef6e0b5354", "score": "0.548906", "text": "function sendDoneQues2(){\n var statement = getxAPIStatement(\n localStorage.getItem('email'),\n localStorage.getItem('name'),\n \"https://w3id.org/xapi/dod-isd/verbs/advanced\",\n \"advanced\",\n \"http://punklearning.com/xapi/advanced_2\",\n \"from question 2\",\n \"from question 2\"\n )\n\n ADL.XAPIWrapper.sendStatement(statement);\n}", "title": "" }, { "docid": "07bd23b280b52e88fd687b46be6040b7", "score": "0.54889226", "text": "async function createFeedback(feedback){\n let error = validateFeedback(feedback);\n if(error.hasErrors)\n return error;\n\n return await Feedback.create(feedback);\n}", "title": "" }, { "docid": "d62add9ad102a73c2bc8d50d292d1f95", "score": "0.5488913", "text": "function saveQuiz(title, qna, category) {\n // Add a new message entry to the database.\n firebase.firestore().collection('quiz').add({\n title: title,\n author: getUserName(),\n qna: qna,\n category: category,\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n })\n .then(function () {\n window.location.replace(\"index.html\");\n })\n .catch(function (error) {\n console.error('Error writing new message to database', error);\n });\n}", "title": "" }, { "docid": "c74335b20cd99e6097f814acfc221e6b", "score": "0.5487547", "text": "function sendfeedback(req,res){\n \n if(!req.body.firstname || !req.body.lastname || !req.body.email || !req.body.message){\n return res.json(Response(402, \"failed\", constantsObj.validationMessages.requiredFieldsMissing));;\n }else{\n var userMailData = { email: req.body.email, firstname: req.body.firstname, lastname: req.body.lastname, message: req.body.message};\n utility.readTemplateSendFeedback(req.body.email, constantsObj.emailSubjects.sendFeddback, userMailData, 'feedback', function(err, resp) {});\n return res.json(Response(200, \"Feedback send successfully\"));\n }\n}", "title": "" }, { "docid": "e651a02666e7154928533a2f8a8b58e6", "score": "0.5484604", "text": "function handleSubmit(e) {\n e.preventDefault();\n\n const requestOptions = {\n method : 'POST',\n headers: { 'Content-Type' : 'application/json'},\n body: JSON.stringify({chat})\n }\n\n // Send POST request and then update states in App.js\n fetch('/sentiment', requestOptions)\n .then(res => res.json())\n .then(res => {\n props.setSentiment(res.sentiment);\n props.setVerdict(res.verdict);\n props.setKeywords(res.keywords);\n props.setSentences(res.worstSentence.map((sentence, i) => {\n return [sentence, res.worstScore[i]];\n }).filter((item) => item[0] !== ''));\n });\n }", "title": "" } ]
ad7187815e5462aac697b6e2d3c59f9b
! ========================================================= ordena los comentarios que nos llegan =========================================================
[ { "docid": "7b7132f78ac704c5e5702bef06406450", "score": "0.0", "text": "sortComments(array) {\n var aux = array;\n\n for (let y = 0; y <= array.length - 2; y++) {\n for (let i = 0; i <= array.length - 2; i++) {\n if (array[i].comment_created_at < array[i + 1].comment_created_at) {\n aux = array[i];\n array[i] = array[i + 1];\n array[i + 1] = aux;\n }\n }\n }\n return array;\n }", "title": "" } ]
[ { "docid": "c1e001e8a19ecaecf64f13136789b749", "score": "0.64724916", "text": "function preencheDados() {\n\n}", "title": "" }, { "docid": "7e49b2e18d6a39ca4b5db9af3ba2dfef", "score": "0.6465671", "text": "function continuarColas() {\n colasMultinivel = [] // vacia el array de colas para no guardar colas repetidas (si el usuario cliquea siguiente varias veces)\n var tablaColas = document.getElementById(\"tabla-colas\").tBodies.item(0); // variable que apunta a la tabla de colas\n if (objetivo1 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos nuevos\");\n return;\n }\n if (objetivo2 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos que salen de la entrada\");\n return;\n }\n if (objetivo3 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos que salen de la salida\");\n return;\n }\n if (objetivo4 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos desalojados de la CPU\");\n return;\n }\n for (var i = 0; i < tablaColas.rows.length; i++) { // itera para cada fila de la tabla\n var colaMultinivel = { // crea un objeto con una cola y le agrega sus datos\n idCola: Number(tablaColas.rows[i].cells[0].innerHTML),\n algoritmo: tablaColas.rows[i].cells[1].children[0].children[0].value,\n procesos: [],\n }\n colasMultinivel.push(colaMultinivel); // agrega la cola al array de colas\n }\n if (seGuardaronLasColas) { // si se guardo todo continua a la parte de resultados\n $('a[href=\"#result\"]').trigger(\"click\"); // cambia a la pestaña resultados\n console.log(colasMultinivel);\n }\n if (!seGuardaronLasColas) { // si no se guardo todo avisa al usuario\n $(\"#modalContinuarSinGuardarColas\").modal(); // muestra el modal que avisa que no se guardo\n console.log(colasMultinivel);\n }\n}", "title": "" }, { "docid": "f244e9c503562897eda8ecbe89b8b2d9", "score": "0.63114107", "text": "function comprobar() {\n cant = 0; // En cada comprobación reiniciamos\n comprobarSolicitudes();\n comprobarRespuestas();\n}", "title": "" }, { "docid": "a88496ceb74e548d71124e5750e4b6b6", "score": "0.62017447", "text": "function preEstraPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('preEstraListLayer', 'O');\n\t\tvisibilidad('preEstraListButtonsLayer', 'O');\n\t\tif(get('preEstraFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tpreEstraLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:preEstraViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, preEstraChoiceColumn) + \"</A>\",\n\t\t\ti, preEstraChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tpreEstraList.setDatos(datosTmp.filtrar([0,1,2,3],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tpreEstraTimeStamps = datosTmp.filtrar([4],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tpreEstraMorePagesFlag = true;\n\t\tpreEstraList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tpreEstraMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('preEstraFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('preEstraListLayer', 'V');\n\tvisibilidad('preEstraListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('preEstraList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tpreEstraList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(preEstraMorePagesFlag){\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(preEstraPageCount > 1){\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('preEstraPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "b0edd2c8ad3d5d3f06342068a868fec8", "score": "0.61521816", "text": "function irComputadores() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de Coputadores en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceComputadores, 'activo');\n añadirClaseActivoEnlaces(atajoComputadores, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionComputadores();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "1d0d8369ee49c7a691b9ca0b6273487b", "score": "0.6139965", "text": "function continuarColasSinGuardar() { // falta implementar similar para agregarColas y continuarColas...\n var tablaColas = document.getElementById(\"tabla-colas\").tBodies.item(0); // variable que apunta a la tabla de colas\n for (var i = 0; i < tablaColas.rows.length; i++) { // itera para cada fila de la tabla\n var algoritmo = tablaColas.rows[i].cells[1].children[0].children[0].value;\n if (algoritmo == \"Round Robin\") {\n validarQuantum();\n if (quantumValido == false) {\n return;\n }\n } \n }\n\t$('a[href=\"#result\"]').trigger(\"click\"); // cambia a la pestaña resultados\n}", "title": "" }, { "docid": "1c4cfc2bfeac88c399719dc15fbb8945", "score": "0.61179155", "text": "function compruebaCampos(){\n\tvar args = compruebaCampos.arguments.length;\n\tvar i;\n\tvar campo,opcion,formato;\n\tvar str = \"\";\n\tvar obj;\n\tvar valor;\n\tvar error;\n\tfor (i=0;i<args;i+=3){\n\t\tcampo = compruebaCampos.arguments[i];\n\t\topcion = compruebaCampos.arguments[i+1];\n\t\tformato = compruebaCampos.arguments[i+2];\n\t\t//AGM88X 10-10-2005: funcion especial de validacion. Formato V\n\t\tif (formato.substr(0,1)==\"V\"){\n\t\t\tstr = str + compruebaValidacion(campo,opcion,formato);\n\t\t} else {\n\t\t\t//prosigo con el tratamiento normal de campos\n\t\t\tobj = document.all[campo];\n\t\t\tif (obj) {\n\t\t\t\t//determino el valor del objeto en sus diversas maneras\n\t\t\t\tif (obj.length){\n\t\t\t\t\t//AGM88X 28-4-2006: arreglo 'definitivamente' el valor para los select\n\t\t\t\t\tif (obj.selectedIndex!=null && obj.selectedIndex>=0) valor = obj.options[obj.selectedIndex].text;\n\t\t\t\t\telse{\n\t\t\t\t\t\t//el nombre esta repetido creo un string y recooro el array\n\t\t\t\t\t\tvalor = \"\";\n\t\t\t\t\t\tfor(j=0;j<obj.length;j++){\n\t\t\t\t\t\t\t//obtengo el valor de cada objeto individual\n\t\t\t\t\t\t\tvar objAct = obj[j];\n\t\t\t\t\t\t\tvar valorAct = \"\";\n\t\t\t\t\t\t\tif (objAct.selectedIndex!=null && objAct.selectedIndex>=0) valorAct = objAct.options[objAct.selectedIndex].text;\n\t\t\t\t\t\t\telse valorAct = objAct.value;\n\n\t\t\t\t\t\t\t//y lo inserto en el valor final separado por /n\n\t\t\t\t\t\t\tif (valor==\"\") valor = valorAct;\n\t\t\t\t\t\t\telse valor = valor + String.fromCharCode(13,10)+ valorAct;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else{\n\t\t\t\t\tif (obj.selectedIndex!=null && obj.selectedIndex>=0) valor = obj.options[obj.selectedIndex].text;\n\t\t\t\t\telse valor = obj.value;\n\t\t\t\t}\n\t\t\t\tstr = str + compruebaCampo(campo,valor,opcion,formato);\n\t\t\t} else str = str + \"Falta campo: \"+campo+\"\\n \"+formato;\n\t\t}\n\t}\n\tif (str!=\"\") {\n\t\talert(\"Errores en compruebaCampos:\\n\"+str);\n\t\treturn true;\n\t} else return false;\n}", "title": "" }, { "docid": "4171b4bf65dcc90600d765cae273748b", "score": "0.61018205", "text": "function ciclos(resultado){\n\tvar ContadorP1 = 0, ContadorP2 = 0,ContadorP3 = 0;contadorSegmentos = 1;\n\tvar ArrayContadorP1= [],ArrayContadorP2=[],ArrayContadorP3=[];ArrayContadorSegmenetos=[]; \n\tfor(var r=0;r<resultado.length;r++){\n\t\tif(resultado[r].prioridad==\"1\"){\n\t\t\tArrayContadorP1[ContadorP1] = r;\n\t\t\t//console.log(r);\n\t\t\tContadorP1=ContadorP1+1;\n\t\t}else{\n\t\t\tif(resultado[r].prioridad==\"2\"){\n\t\t\tArrayContadorP2[ContadorP2] = r;\n\t\t\t\tContadorP2=ContadorP2+1;\n\t\t\t}\n\t\t\tif(resultado[r].prioridad==\"3\"){\n\t\t\tArrayContadorP3[ContadorP3] = r;\n\t\t\t\tContadorP3=ContadorP3+1;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar Prioridad_1 = \"\";\n\tvar Prioridad_2 = \"\";\n\tvar avanzarP2 = \"\";\n\tvar avanzarP3 = \"\";\n\tvar nCiclos = 0;\n\tvar nSegmentos = 0;\n\tvar nSeg = 0;\n\tvar eS = 0;\n\tvar hDD = 0;\n\tvar SSsegmento=0;\n\tvar SSCiclos=0;\n\tvar cant = $(\"#ciclos\").val();//valor de la caja de texto (cantidad de ciclos)\n\n\t(function ciclo(i) {//esta hace que los ciclos sea lentos para poder ver los cambios\n\t setTimeout(function() {\n\n\n\t if (nCiclos == 5) {//contador de ciclos y segmentos\n\t \t\tnCiclos = 1;\n\t \t\tnSegmentos = parseInt(nSegmentos)+1;\n\t \t}else{\n\t \t\t nCiclos = parseInt(nCiclos)+1; \n\t \t}\n\t \t\n\t \t //muestra los ciclos en pantalla \n\t\t$(\"#mostrarCiclos\").html(\"Ciclo:\"+parseInt(nCiclos)+\" \"+\"Segmento:\"+parseInt(nSegmentos));\n\n\t for (var j = 0; j < resultado.length; j++) {\n\t\t\t\n\n\t \tif (resultado[j].estado==2) {//este if simula la ejecucion de las instrucciones\n\t\t\t\t//se restan 5 instrucciones por ciclo al total de instrucciones de cada proceso;\n\t\t\t\tresultado[j].cantidad = parseInt(resultado[j].cantidad)-1;\n\t\t\t\tif (resultado[j].cantidad<1) {\n\t\t\t\t\tresultado[j].cantidad = 0;//quedan cero instrucciones del total\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (resultado[j].estado==3) {//conteo de ciclos mientras el proceso esta boqueado\n\t\t\t\tif (eS < 13) {//para evento E/S el proceso se bloquea durante 13 ciclos\n\t\t\t\t\teS = parseInt(eS)+1;\n\t\t\t\t}\n\t\t\t\tif (hDD < 27) {//para evento HDD el proceso se bloquea durante 27 ciclos\n\t\t\t\t\thDD = parseInt(hDD)+1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//console.log(eS+\" \"+hDD)\n\t\t\t}\n\t\t\t/*este if permite que los procesos con prioridad 2 vancen al estado listo cuando los procesos con\n\t\t\tprioridad 1 estan en estado ejecutandose*/\n\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 2 ||resultado[j].estado == \"2\")){\n\t\t\t\t\tvar CCP2 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP1;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP1[m]].estado==2||resultado[ArrayContadorP1[m]].estado==\"2\"){\n\t\t\t\t\t\t\tif(ContadorP1==CCP2){\n\t\t\t\t\t\t\t\tavanzarP2 = \"listo\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCCP2= CCP2+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t/*este if permite que los procesos con prioridad 3 vancen al estado listo cuando los procesos con\n\t\t\tprioridad 2 estan en estado ejecutandose*/\n\t\t\tif((resultado[j].prioridad == 2 || resultado[j].prioridad == \"2\") && (resultado[j].estado == 2 ||resultado[j].estado == \"2\")){\n\t\t\t\tvar CCP3 = 1;\n\t\t\t\tfor(var m =0;m<ContadorP2;m++ ){\n\t\t\t\t\tif(resultado[ArrayContadorP2[m]].estado==2||resultado[ArrayContadorP2[m]].estado==\"2\"){\n\t\t\t\t\t\tif(ContadorP2==CCP3){\n\t\t\t\t\t\t\tavanzarP3 = \"listo\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCCP3= CCP3+1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t \n\t\t\t/*este if comprueba que todos los procesos de prioridad 1 estan terminado para comenzar a trabajar \n\t\t\ten los procesos de prioridad 2*/\n\t\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP1 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP1;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP1[m]].estado==4||resultado[ArrayContadorP1[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP1==CompararContP1){\n\t\t\t\t\t\t\t\tPrioridad_1 = \"YA\";\n\t\t\t\t\t\t\t\tavanzarP2 = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP1= CompararContP1+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*este if comprueba que todos los procesos de prioridad 2 estan terminado para comenzar a trabajar \n\t\t\t\ten los procesos de prioridad 3*/\n\t\t\t\tif((resultado[j].prioridad == 2 || resultado[j].prioridad == \"2\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP2 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP2;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP2[m]].estado==4||resultado[ArrayContadorP2[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP2==CompararContP2){\n\t\t\t\t\t\t\t\tPrioridad_2 = \"YA\";\n\t\t\t\t\t\t\t\tavanzarP3 = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP2= CompararContP2+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*este if comprueba que todos los procesos de prioridad 3 estan terminados para para mostrar una \n\t\t\t\tnotificacion de que todos los procesos se completaron*/\n\t\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP3 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP3;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP3[m]].estado==4||resultado[ArrayContadorP3[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP3==CompararContP3){\n\t\t\t\t\t\t\t\t//alert(\"Fin De Todos Los Procesos\");\n\t\t\t\t\t\t\t\tif(SSsegmento==0 && SSCiclos==0){\n\t\t\t\t\t\t\t\t\tSSsegmento = nSegmentos;\n\t\t\t\t\t\t\t\t\tSSCiclos = nCiclos;\n\t\t\t\t\t\t\t\t$(\"#ProcesoCompleto\").html(`<h5 style=\" text-align: center; color: white; font-size: x-large; \">Fin De Todos Los Procesos</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 style=\" font-size: large; color: white; text-align: center;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCiclos requeridos: <span>${(nSegmentos)*5+nCiclos}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP3= CompararContP3+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*se encarga de que el estado se 4 como maximo y cambia los estados*/\n\t\t\t\tif (resultado[j].estado<=3 && nCiclos==5) {\n\t\t\t\t\tif (resultado[j].estado==2) {//cambia el estado de un proceso en ejecucion (bloqueado o terminado)\n\n\t\t\t\t\t\tnSeg = parseInt(nSeg)+1;//contador de segmentos\n\n\t\t\t\t\t\tif (resultado[j].cantidad < 1){//si cantidad de instrcciones es cero = proceso terminado (estado = 4)\n\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+2;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//bloqueo por esperar un evento E/S o HDD\n\t\t\t\t\t\t\tif ((resultado[j].cantidad == resultado[j].bloqueo) && resultado[j].evento != 4) {\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t/*este if reduce la prioridad de un proceso si se ejecuta durante 3 segmentos seguidos*/\n\t\t\t\t\t\t\t\tif (nSeg == 3) {\n\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)+1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tnSeg = 1;\n\t\t\t\t\t\t\t\t\tPrioridad_1 = \"reducida\";\n\t\t\t\t\t\t\t\t\tPrioridad_2 = \"reducida\"\n\t\t\t\t\t\t\t\t\tavanzarP2 = \"\";\n\t\t\t\t\t\t\t\t\tavanzarP3 = \"\";\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\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (resultado[j].estado==3) {//eventos para desbloquear procesos\n\t\t\t\t\t\t\tif (resultado[j].evento == 3 && eS == 13) {//evento E/S y trancurridos 13 ciclos\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\tes = 0;//reinicia el contador de ciclos de bloqueo de E/S\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (resultado[j].evento == 5 && hDD == 27) {//evento HDD y trancurridos 27 ciclos\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\thDD = 0;//reinicia el contador de ciclos de bloqueo de HDD\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}else{//prioridades para cambiar de estado\n\n\t\t\t\t\t\t\tif(resultado[j].prioridad == 1 && resultado[j].estado < 4){\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif((Prioridad_1!=\"\")){\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 2||resultado[j].prioridad == \"2\")) {\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)-1;\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif((Prioridad_2!=\"\")){\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 3||resultado[j].prioridad == \"3\")) {\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\t\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)-1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (avanzarP2 == \"listo\") {\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 2||resultado[j].prioridad == \"2\")) {\n\t\t\t\t\t\t\t\t\t\tresultado[j].estado = 1;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (avanzarP3 == \"listo\") {\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 3||resultado[j].prioridad == \"3\")) {\n\t\t\t\t\t\t\t\t\t\tresultado[j].estado = 1;\t\n\t\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}\n\n\n\t\t$(\"#procesos\").html(\"\");//se vacia la tabla principal \n\n\t\t\tfor(k in resultado) {//se actualizan los estados de la tabla principal\n\t\t\t\t\t\n\t\t\t\t$(\"#procesos\").append('<tr><td>'+\n\t\t\t\t\tresultado[k].id+'</td><td>'+\n\t\t\t\t\tresultado[k].estado+'</td><td>'+\n\t\t\t\t\tresultado[k].prioridad+'</td><td>'+\n\t\t\t\t\tresultado[k].cantidad+'</td><td>'+\n\t\t\t\t\tresultado[k].bloqueo+'</td><td>'+\n\t\t\t\t\tresultado[k].evento+'</td></tr>');\n\n\t\t\t\t//estos llamasdos a funciones actualizan los estados de las tablas pequeñas\n\t\t\t\tnuevo(resultado);\n\t\t\t\tlisto(resultado);\t\t\t\t\t\n\t\t\t\tejecutandose(resultado);\n\t\t\t\tbloqueado(resultado);\n\t\t\t\tterminado(resultado);\n\t\t\t}\n\t\t\t \n\t if (--i) ciclo(i); \n\t }, 200)//duracion de cada ciclo en milisegundos 1000ms = 1s\n\t})(cant); \n}", "title": "" }, { "docid": "d62e419be25b7086f897731cf726f716", "score": "0.6089457", "text": "function verificar(){\n\n var contCopia=0;\n\n\n\n for(var i in primero){\n var claseActual=primero[i].nombre;\n for(var k in segundo){\n if(segundo[k].nombre==claseActual){\n for(var m in primero[i].metodos){\n var retornoActual=primero[i].metodos[m].retorno;\n\n for(var p in segundo[k].metodos){\n\n var primBandera=primero[i].metodos[m].copia;\n var secBandera=segundo[k].metodos[p].copia;\n\n if(segundo[k].metodos[p].retorno==retornoActual&&!primBandera&&!secBandera){\n \n var primParam=primero[i].metodos[m].parametros;\n var secParam=segundo[k].metodos[p].parametros;\n if(primParam.length==secParam.length){\n\n var seguir=true;\n for(var j in primParam){\n if(primParam[j].tipo!=secParam[j].tipo){\n seguir=false;\n break;\n }\n }\n if(seguir){\n//------------------------------------ \n for(var r in primero[i].metodos[m].variables){\n\n var tipoActual=primero[i].metodos[m].variables[r].tipo;\n var variableActual=primero[i].metodos[m].variables[r].nombre;\n\n for(var s in segundo[k].metodos[p].variables){\n var tempTipo=segundo[k].metodos[p].variables[s].tipo\n var tempVariable=segundo[k].metodos[p].variables[s].nombre\n if(tipoActual==tempTipo&&variableActual==tempVariable){\n variablesCopia.push({\n clase: segundo[k].nombre,\n funcion: segundo[k].metodos[p].nombre,\n nombre: variableActual,\n tipo: tipoActual\n\n })\n }\n }\n }\n\n//-----------------------------------\n segundo[k].metodos[p].copia=true;\n primero[i].metodos[m].copia=true;\n var temp=[]\n for(var aux in secParam){\n temp.push({\n tipo: secParam[aux].tipo,\n nombre: secParam[aux].nombre\n })\n }\n funcionCopia.push({\n clase: segundo[k].nombre,\n retorno: retornoActual,\n nombre: segundo[k].metodos[p].nombre,\n parametros: temp\n })\n \n contCopia++;\n\n }\n\n }\n }\n }\n \n }\n \n if(primero[i].metodos.length==contCopia){\n console.log(\"yeees!\")\n segundo[k].copia=true;\n claseCopia.push({\n nombre: segundo[k].nombre,\n cantidadFunciones: contCopia\n })\n }\n contCopia=0;\n break;\n }\n }\n\n }\n\n\n}", "title": "" }, { "docid": "0d6a07ed85d9f7aed1dd9719638f32f9", "score": "0.6027799", "text": "function compruebaCruces() { \n var periodos = listado1.datos; \n var indexFechaFin = 6; \n var indexFechaInicio = 5; \n var indexPeriodoCruce = 9; \n var fechaFinActual; \n var fechaInicioSiguiente; \n var fechaFinActualMilis; \n var fechaInicioSiguienteMilis; \n var si = GestionarMensaje(84); \n var no = GestionarMensaje(86); \n \n //chequeo desde el primero con el segundo hasta el anteultimo con el ultimo \n for (var i=0; i < (periodos.length - 1); i++) { \n fechaFinActual = periodos[i][indexFechaFin]; \n fechaInicioSiguiente = periodos[i+1][indexFechaInicio]; \n fechaFinActualMilis = dameMilis(fechaFinActual); \n fechaInicioSiguienteMilis = dameMilis(fechaInicioSiguiente); \n //alert(\"fechaFinActualMilis \" + fechaFinActualMilis); \n //alert(\"fechaInicioSiguienteMilis \" + fechaInicioSiguienteMilis); \n \n if (fechaFinActualMilis >= fechaInicioSiguienteMilis) { \n //periodo con cruce \n periodos[i][indexPeriodoCruce] = si; \n } else { \n //periodo sin cruce \n periodos[i][indexPeriodoCruce] = no; \n } \n } \n //ademas el ultimo es periodo sin cruce \n if (periodos.length != 0) { \n periodos[periodos.length-1][indexPeriodoCruce] = no; \n } \n \n //setamos la lista actualizada \n listado1.datos = periodos; \n \n //actualizo el listado de periodos. \n listado1.save(); \n listado1.repintaDat(); \n }", "title": "" }, { "docid": "59ccb154dde6198dbd086c63429adbf8", "score": "0.60134465", "text": "function dh_cursos_evaluacion_temas() {\n var comentarios = $(\"#comentarios_calificacion\").val() === \"\" ? \" \" : $(\"#comentarios_calificacion\").val();\n\n conexion_ajax(\"/servicios/dh_cursos.asmx/dh_cursos_evaluacion_temas\", {\n id_curso: ID_CURSO\n , id_usuario: id_usuario\n , puntuacion: $(\".brillar\").length\n , descrpcion: comentarios\n })\n }", "title": "" }, { "docid": "1f0e1ef496af63dbfab37266452fa068", "score": "0.5977921", "text": "quitarLosEstilos() {\n let inputs = document.getElementsByClassName('zelda-input');\n while (this.Seleccionados.length > 0) {\n inputs[this.Seleccionados[0]].classList.remove('selected');\n this.Seleccionados.shift();\n }\n while (this.NoSeleccionados.length > 0) {\n inputs[this.NoSeleccionados[0]].classList.remove('unselected');\n this.NoSeleccionados.shift();\n }\n }", "title": "" }, { "docid": "a789f3e90a5eb4cfa1acbcc34a607102", "score": "0.59724396", "text": "function msgEstrelas() {\n if (premio === 0) {\n contEstrelas = contEstrelas.text('. E não ganhou estrelas.');\n } else if (premio === 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrela.');\n } else if (premio > 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrelas.');\n };\n }", "title": "" }, { "docid": "49cab46c51e61abb4c22ddeb9aa1e91d", "score": "0.5957806", "text": "function commessa(tipoOperazione){\r\n\tif(tipoOperazione == \"inserisci\"){\r\n\t\t\r\n\t\tvar inserisci = \"\";\r\n\t\t\r\n\t\t//verifico quale select è stata valorizzata con l'attributo \"Nuova Commessa\"\r\n\t\t\r\n\t\tif(document.inserisciTrattative.trattattivaSingola_esito.value == \"nuova commessa\"){\r\n\t\t\tinserisci = document.inserisciTrattative.trattattivaSingola_esito.value;\r\n\t\t\tinserimentoCommessaTrattativa = true;\r\n\t\t}else if(document.inserisciTrattative.esito.value == \"nuova commessa\"){\r\n\t\t\tinserisci = document.inserisciTrattative.esito.value;\r\n\t\t\tinserimentoCommessaTrattativa = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(inserisci == \"nuova commessa\"){\r\n\t\t\tdocument.getElementById(\"creazioneCommessa\").style.display = \"block\";\r\n\t\t}else{\r\n\t\t\tdocument.getElementById(\"creazioneCommessa\").style.display = \"none\";\r\n\t\t\tinserimentoCommessaTrattativa = false;\r\n\t\t}\r\n\t}else{\r\n\t\tvar modifica = \"\";\r\n\t\t//verifico quale select è stata valorizzata con l'attributo \"Nuova Commessa\"\r\n\t\t\r\n\t\tif(document.modificaTrattativa.trattattivaSingola_esito != null){\r\n\t\t\tif(document.modificaTrattativa.trattattivaSingola_esito.value == \"nuova commessa\"){\r\n\t\t\t\tmodifica = document.modificaTrattativa.trattattivaSingola_esito.value;\r\n\t\t\t\tinserimentoCommessaTrattativa = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.modificaTrattativa.esito != null){\r\n\t\t\tif(document.modificaTrattativa.esito.value == \"nuova commessa\"){\r\n\t\t\t\tmodifica = document.modificaTrattativa.esito.value;\r\n\t\t\t\tinserimentoCommessaTrattativa = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(modifica == \"nuova commessa\"){\r\n\t\t\tdocument.getElementById(\"creazioneCommessa\").style.display = \"block\";\r\n\t\t}else{\r\n\t\t\tdocument.getElementById(\"creazioneCommessa\").style.display = \"none\";\r\n\t\t\tinserimentoCommessaTrattativa = false;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "37ceb2689126e3bdf5e569de50817d16", "score": "0.59468037", "text": "function limpiarTodo() {\r\n\tlimpiarRecurso(Recursos.menuPrincipal);\r\n\tlimpiarRecurso(Recursos.menuCuadros);\r\n\t\r\n\tvar i;\r\n\tfor (i = 0 ; i < 6 ; i++) {\r\n\t\tlimpiarRecurso(Recursos.morro[i]);\r\n\t\tlimpiarRecurso(Recursos.belalcazar[i]);\r\n\t\tlimpiarRecurso(Recursos.parque[i]);\r\n\t\tlimpiarRecurso(Recursos.puente[i]);\r\n\t\tlimpiarRecurso(Recursos.valencia[i]);\r\n\t}\r\n}", "title": "" }, { "docid": "287077a018c51bf39b98a76c654ce800", "score": "0.5934833", "text": "function comprobarSearchTitulacion() {\n\n var codTitulacion; /*variable que representa el elemento codTitulacion del formulario add */\n var codCentro; /*variable que representa el elemento codCentro del formulario add */\n var nombreTitulacion; /*variable que representa el elemento nombreTitulacion del formulario add */\n var responsableTitulacion; /*variable que representa el elemento responsableTitulacion del formulario add */\n\n\n codTitulacion = document.forms['ADD'].elements[0];\n codCentro = document.forms['ADD'].elements[1];\n nombreTitulacion = document.forms['ADD'].elements[2];\n responsableTitulacion = document.forms['ADD'].elements[3];\n\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codTitulacion.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codTitulacion, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio\n \n //Comprobamos que no hay espacio s intermedios\n if (!/[\\s]/.test(codCentro.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codCentro, 10)) {\n return false;\n }//comprobar texto \t\t\t\n }//comprobar espacio\n\n /*Comprueba si tiene carácteres no alfanuméricos, si es así, retorna false */\n if (!comprobarAlfabetico(nombreTitulacion, 50)) {\n return false;\n } //fin comprobar alfabetico\n\n /*Comprueba si tiene carácteres no alfanuméricos, si es así, retorna false */\n if (!comprobarAlfabetico(responsableTitulacion, 60)) {\n return false;\n } //fin comprobacion alfabetico\n return true;\n } //fin search titulacion", "title": "" }, { "docid": "97397f606ce0b886a17d2f7957e78ea8", "score": "0.5927706", "text": "function acompanhar(Vetor, Busca, Adicionar, Local){\n let Funcao = 'acompanhar'\n /*Erro*/ if(Vetor[0] == undefined) return Notificar('Warn', Funcao, 'Vetor', 'Vetor', Vetor)\n /*Erro*/ if(Busca == undefined) return Notificar('Warn', Funcao, `Necessário citar o valor a ser pesquisado`, 'Busca', Busca)\n /*Erro*/ if(Adicionar == undefined) return Notificar('Warn', Funcao, `Necessário citar o valor a adicionar`, 'Adicionar', Adicionar)\n /*Aviso*/ if(Local = undefined) Notificar('Info', Funcao, `Local padronizado a 'depois'`)\n /*Erro*/ if(Local != undefined && (Local.toLowerCase() == 'antes' || Local.toLowerCase() == 'depois')) return Notificar('Warn', Funcao, `Não existe saída para valor citado em Local`, 'Local', Local)\n\n let VetorTam = Vetor.length\n let Fim = []\n let Achou = 0\n \n let Lugar = 'depois'\n if(Local) Local = Local.toLowerCase()\n if(Local == 'antes') Lugar = 'antes'\n \n\n for(i=0; i<VetorTam; i++){\n if(Vetor[i] == Busca){\n if(Lugar == 'depois'){\n Fim.push(Vetor[i])\n Fim.push(Adicionar)\n Achou++\n }\n if(Lugar == 'antes'){\n Fim.push(Adicionar)\n Fim.push(Vetor[i])\n }\n } else{\n Fim.push(Vetor[i])\n }\n }\n\n /*Conclusao*/\n let Acao = Achou\n if(Acao >= -1 && Acao <= 1) {Notificar('Conc', Funcao, `Foi adicionado ${Acao} elemento`)}\n else {Notificar('Conc', Funcao, `Foram adicionados ${Acao} elementos`)}\n return Fim\n }", "title": "" }, { "docid": "01f753c67498bdde4e69f3af87b09b51", "score": "0.5926841", "text": "function generarCompras(){\r\n\tvar comprasJugador =[];\r\n\r\n\tif(!isEmptyListGenerated){\r\n\t\tgenerateEmptyBuyList(compras);\r\n\t\tisEmptyListGenerated = true;\r\n\t\tconsole.log(\"listaCompras: \"+listaCompras);\r\n\t\tconsole.log(\"listavacia: \"+compras);\r\n\t}\r\n\tconsole.log(\"Dinero: \"+total_compra);\r\n\r\n\t//obtenemos todos las id de todos los radio chequeados\r\n\tcomprasJugador = obtenerCompras();\r\n\r\n\t//eliminamos valor extra de los id parseando la cadena\r\n\tcomprasJugador = parsearlistaCompras(comprasJugador);\r\n\r\n\t//procedemos a la validacion de los objetos\r\n\t//comprados contra los requeridos\r\n\r\n\tif(isMoneyLeft(comprasJugador)){\r\n\t\trealizarCompras(comprasJugador);\r\n\t\tvar isObjective = isObjectiveComplete(compras);\r\n\t\tif(isObjective){\r\n\t\t\t//alert(\"GANASTE\");\r\n\t\t\t$( \"#successfulDialog\" ).dialog( \"open\" );\r\n\t\t\tclose_shop();\r\n\t\t\tcargarNivel(2);\r\n\t\t}\r\n\t}else{\r\n\t\talert(\"Perdiste el juego ya no puedes comprar :'( \");\r\n\t}\r\n\tconsole.log(\"compras: \"+compras);\r\n\tclearOptions(comprasJugador);\r\n}", "title": "" }, { "docid": "b5e8e8dd76c0e375d55463be0c5fb342", "score": "0.59158057", "text": "function CorrigePericias() {\n for (var chave in tabelas_pericias) {\n var achou = false;\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var entrada_pericia = gEntradas.pericias[i];\n if (entrada_pericia.chave == chave) {\n achou = true;\n break;\n }\n }\n if (!achou) {\n gEntradas.pericias.push({ 'chave': chave, pontos: 0 });\n }\n }\n}", "title": "" }, { "docid": "3488780030916e4f1eae549af136beab", "score": "0.5904944", "text": "function comportamentQuantsSou()\n{\n\t//ADULTS\n\t$(\"#selectorComensals\").change(function(){\n\t\tADULTS=$(\"input[name='selectorComensals']:checked\").val();\n\t\t$(\"input[name='adults']\").val(ADULTS)\n\t\ttotalPersones();\n\t\t//$(\"#selectorComensals\").buttonset(\"destroy\");\n\t\t//$(\"#selectorComensals\").buttonset();\n\n\t\tif ($(\".fr-seccio-dia\").is(\":hidden\")) \n\t\t{\n\t\t\tmonta_calendari(\"#calendari\");\n\t\t\t$(\".fr-seccio-dia\").show();\n\t\t\tseccio(\"fr-seccio-dia\");\n\t\t\tupdateCalendari();\n\t\t}\n\t\t//return false;\n\t});\n\t\n\t//JUNIORS\n\t$(\"input[name=selectorJuniors]\").change(function(){\n\t\tJUNIORS=$(\"input[name='selectorJuniors']:checked\").val();\n\t\t$(\"input[name='nens10_14']\").val(JUNIORS)\n\t\ttotalPersones();\n\t\t//return false;\n\t});\n\t\n\t//NENS\n\t$(\"input[name=selectorNens]\").change(function(){\n\t\tNENS=$(\"input[name='selectorNens']:checked\").val();\n\t\t$(\"input[name='nens4_9']\").val(NENS)\n\t\ttotalPersones();\n\t\t//return false;\n\t});\n\t\n\t//COTXETS\n\t$(\"input[name=selectorCotxets]\").change(function(){\n\t\tCOTXETS=$(\"input[name='selectorCotxets']:checked\").val();\n\t\ttimer_help(l(\"NENS_COTXETS\"));//BARREJA NENS COTXETS!!\n\t\ttotalPersones();\n\t\t//return false;\n\t});\t\n}", "title": "" }, { "docid": "c11bc59d29d43fd84246097cbebca990", "score": "0.5894221", "text": "function procesar() {\n var listaVAlidos = [];\n\n var listadoLineas = separarEnLineas();// Separa el parrafo en los saltos de linea para dejar lineas de texto\n\n for (var i = 0; i < listadoLineas.length; i++) {\n var listadoPalabras = separarEnPalabras(listadoLineas[i]);// Cada linea la separa en palabras \n for (var j = 0; j < listadoPalabras.length; j++) {\n var resultado = analizar(listadoPalabras[j]);\n if (resultado === \"okIdentificador\" || resultado === \"okNumero\" || resultado === \"okAgrupacion\" ||\n resultado === \"okAritmetico\" || resultado === \"okPuntuacion\") {\n\n var texto2 = document.getElementById(\"segundoTextArea\").value;\n document.getElementById(\"segundoTextArea\").textContent = texto2 + listadoPalabras[j] + \" =====> VALIDO \\n\";\n\n } else if (resultado === \"error\") {\n\n var texto2 = document.getElementById(\"segundoTextArea\").value;\n document.getElementById(\"segundoTextArea\").textContent = texto2 + listadoPalabras[j] + \" =====> NO VALIDO \\n\";\n\n } else {\n\n var texto2 = document.getElementById(\"segundoTextArea\").value;\n document.getElementById(\"segundoTextArea\").textContent = texto2 + listadoPalabras[j] + \" =====> SALTO \\n\";\n\n }\n }\n }\n return listaVAlidos;\n}", "title": "" }, { "docid": "423a0ed66c4a5d7c6456954172cf3af9", "score": "0.58806485", "text": "function jugar(opcionLetra){\n if( seguirJugando ) { \n\n letra=opcionLetra;\n\n\n if ( probarLetra() ){\n palabraOculta= insertarLetra();\n pintarLetra();\n\n } else {\n fallos++;\n pintarAhorcado();\n }\n comprovarSiAcaba();\n\n } \n\n\n}", "title": "" }, { "docid": "eb1e0eca932df87567151de4b17d8aa1", "score": "0.58800095", "text": "function jogar (escolha) { \n jogadorEscolha = escolha;\n selecionar('jogador', jogadorEscolha);\n //sortear a jogada do computador\n computadorEscolha = sortear(1, 3);\n selecionar('computador', computadorEscolha);\n\n var ganhador = calcularEscolha (jogadorEscolha, computadorEscolha);\n\n if (ganhador ==0 ) {\n mensagem ('Empate');\n }\n else if (ganhador == 1) {\n mensagem ('Ponto para ' + jogadorNome);\n somarPontoJogador();\n }\n \n else if (ganhador == 2) {\n mensagem ('Ponto para Computador')\n somarPontoComputador();\n }\n \n setTimeout (function () {\n deselecionar ('jogador', jogadorEscolha)\n deselecionar ('computador', computadorEscolha)\n mensagem( jogadorNome +' escolha uma opção acima...');\n\n }, 1500);\n\n }", "title": "" }, { "docid": "032be4be2476560b7298eeda316f067d", "score": "0.5868618", "text": "function comprar(objeto) {\n\n //comrpar con dinero suficiente\n if (galletas >= precioProducto[objeto]) {\n inventario[objeto]++;\n galletas -= precioProducto[producto];\n\n } else {\n console.log(\"No tienes suficiente dinero\");\n }\n\n}", "title": "" }, { "docid": "0a907a046bc75bad89920e55955f6926", "score": "0.5860155", "text": "compararEstoque() {\n const itemsCarrinho = this.carrinho.filter( ({id}) => id === this.produto.id )\n this.produto.estoque -= itemsCarrinho.length\n }", "title": "" }, { "docid": "3d0084131b2594ddff8581061225a1ce", "score": "0.58453155", "text": "function Conferir(){\n var inserido = true;\n for (var i=last_btn-4; i<last_btn; i++){\n if (document.getElementById(\"botao-\"+i).className == \"botao cor-btn m-btn\"){\n alert(\"Por favor adicione cores a todos os botões\");\n inserido = false;\n break;\n }\n\n if(cores_escolhidas[i%4] == objetivo[i%4]){\n document.getElementById(\"conf-\"+i).className = \"ver cor-l-certo\";\n $(\"#conf-\"+i).attr({\n \"data-balloon\" : \"A cor está no lugar certo\",\n \"data-balloon-pos\" : \"up\"\n })\n acertos +=1\n }\n else if($.inArray(cores_escolhidas[i%4],objetivo)!=-1){\n document.getElementById(\"conf-\"+i).className = \"ver cor-certa\";\n $(\"#conf-\"+i).attr({\n \"data-balloon\" : \"A cor está certa, mas no lugar errado\",\n \"data-balloon-pos\" : \"up\"\n })\n }\n }\n //verifica se o jogador ganhou\n if (acertos==4){\n Modal(1,\"modal_ganhou\");\n var temp_end = new Date();\n var diferenca = temp_end.getTime() - temp_inicio.getTime();\n var segundos = Math.floor( ( diferenca % ( 60 * 1000 ) ) / 1000 );\n var minutos = Math.floor( ( diferenca % (1000 * 60 * 60) ) / ( 1000 * 60 ) );\n \n //Adicionar o 0 a mais nos minytos e nos segundos\n if (segundos<10){\n segundos = \"0\" + segundos\n }\n if(minutos<10){\n minutos = \"0\" + minutos \n }\n \n document.getElementById(\"rod\").innerHTML = \"Rodadas: \" + round;\n document.getElementById(\"temp\").innerHTML = \"Tempo Levado (mm:ss) : \" + minutos + \":\" + segundos;\n return;\n }\n\n if (inserido==true){\n round +=1;\n if(round>10){\n Modal(2,\"modal_perdeu\");\n return;\n }\n $(`<div class=\"row\">\n <div class=\"bloco\">\n <div class=\"round\" data-balloon=\"Rodada\" data-balloon-pos=\"left\">`+round+`</div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+last_btn+`\" onclick=\"MudaCor(`+last_btn+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+1)+`\" onclick=\"MudaCor(`+(last_btn+1)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+2)+`\" onclick=\"MudaCor(`+(last_btn+2)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+3)+`\" onclick=\"MudaCor(`+(last_btn+3)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"ver cor-btn\" id=\"conf-`+last_btn+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+1)+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+2)+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+3)+`\"></div>\n </div>\n </div>\n `).appendTo($(\"#jogo\"));\n last_btn +=4;\n acertos=0;\n }\n}", "title": "" }, { "docid": "3f81de22d46979eb939ceb3418e18415", "score": "0.58368397", "text": "function comandos(event){\r\n switch (event.keyCode) {\r\n \r\n case 37: //esquerda\r\n \r\n if ( sentidoX != 1 && gambiarra) { //muda de direcao, se o sentido atual não \r\n sentidoX = -1; //for o oposto ao da mudança e a flag for true \r\n sentidoY = 0;\r\n gambiarra = false; \r\n }\r\n break;\r\n case 38://cima\r\n \r\n if(sentidoY != 1 && gambiarra){\r\n sentidoX = 0;\r\n sentidoY = -1;\r\n gambiarra = false; \r\n }\r\n break;\r\n case 39://direita\r\n if (sentidoX != -1 && gambiarra){\r\n sentidoX = 1;\r\n sentidoY = 0;\r\n gambiarra = false; \r\n }\r\n break;\r\n \r\n case 40://baixo\r\n if (sentidoY != -1 && gambiarra){\r\n sentidoX = 0; \r\n sentidoY = 1;\r\n gambiarra = false; \r\n }\r\n break;\r\n \r\n case 80://pausa (P)\r\n \r\n alert(' Jogo pausado, OK para desbloquear ');\r\n // função \"pause\" para quem tem TOC e programa o jogo enquanto o mesmo roda em outra tela \r\n break;\r\n }\r\n }", "title": "" }, { "docid": "02e04a942323dd6b71927d2f21b8b99f", "score": "0.58257496", "text": "function Cargando(){\n\t\tPonerRecetasBusqueda('',pagina,'#recetas',false);\n\t\t//No tenemos que sacar cosas de los votos ni redirigir\n\t\tMostrarDatosSesion(false,0);\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c79415b3d8572cf1620cd720986d3031", "score": "0.5824803", "text": "function alfabetica(Vetor, Ordem, Acompanhamento){\n let Funcao = 'alfabetica'\n /*Erro*/ if(Vetor[0] == undefined) return Notificar('Warn', Funcao, 'Vetor', 'Vetor', Vetor)\n /*Erro*/ if(Acompanhamento != undefined && Acompanhamento[0]) return Notificar('Warn', Funcao, `Vetor`, 'Acompanhamento', Acompanhamento)\n /*Aviso*/ if(Ordem != undefined && Ordem != 'decrescente') Notificar('Info', Funcao, `Ordem reajustada para 'crescente'`)\n\n let Tamanhos = []\n let Cortes = []\n let Atual = []\n let Corte = []\n let All = []\n let Fim = []\n let VetorTam = Vetor.length\n let Acomp = undefined\n if(Acompanhamento) Acomp = Acompanhamento\n\t\tlet AcompTam = false\n if(Acompanhamento) AcompTam = Acomp.length\n let Acompanha = true\n let MaiorLetras = 0\n Ordem = Ordem.toLowerCase()\n\n if(!AcompTam) Acompanha = false\n if(!Ordem || Ordem != 'decrescente') Ordem == 'crescente'\n \n for(i=0; i<VetorTam; i++){\n let Agora = Vetor[i]\n let Tam = Agora.length\n let Name = Agora.split(\"\")\n \n Tamanhos.push(Tam)\n Cortes.push(Name)\n }\n \n MaiorLetras = decrescente(Tamanhos, 1)\n \n for(j=0; j<Cortes.length; j++){\n Atual = Cortes[j]\n let AtualTam = Atual.length\n \n for(k=0; k<AtualTam; k++){\n Atual[k] = Atual[k].toLowerCase()\n \n Atual[k] = Atual[k].normalize(\"NFD\").replace(/[^a-zA-Zs]/g, \"\")\n \n if(Atual[k] == 'a') Atual[k] = 1\n if(Atual[k] == 'b') Atual[k] = 2\n if(Atual[k] == 'c') Atual[k] = 3\n if(Atual[k] == 'd') Atual[k] = 4\n if(Atual[k] == 'e') Atual[k] = 5\n if(Atual[k] == 'f') Atual[k] = 6\n if(Atual[k] == 'g') Atual[k] = 7\n if(Atual[k] == 'h') Atual[k] = 8\n if(Atual[k] == 'i') Atual[k] = 9\n if(Atual[k] == 'j') Atual[k] = 10\n if(Atual[k] == 'k') Atual[k] = 11\n if(Atual[k] == 'l') Atual[k] = 12\n if(Atual[k] == 'm') Atual[k] = 13\n if(Atual[k] == 'n') Atual[k] = 14\n if(Atual[k] == 'o') Atual[k] = 15\n if(Atual[k] == 'p') Atual[k] = 16\n if(Atual[k] == 'q') Atual[k] = 17\n if(Atual[k] == 'r') Atual[k] = 18\n if(Atual[k] == 's') Atual[k] = 19\n if(Atual[k] == 't') Atual[k] = 20\n if(Atual[k] == 'u') Atual[k] = 21\n if(Atual[k] == 'v') Atual[k] = 22\n if(Atual[k] == 'w') Atual[k] = 23\n if(Atual[k] == 'x') Atual[k] = 24\n if(Atual[k] == 'y') Atual[k] = 25\n if(Atual[k] == 'z') Atual[k] = 26\n if(!Number(Atual[k])) Atual[k] = 0\n }\n Corte.push(Atual)\n \n let Atu = []\n Atu.push(Vetor[j])\n Atu.push(Corte[j])\n if(Acompanha) Atu.push(Acomp[j])\n \n All.push(Atu)\n }\n \n for(m=0; m<VetorTam; m++){\n let Ver = All[m]\n let Vet1 = Ver[0]\n let Vet2 = Ver[1]\n let VetTam = Vet2.length\n let Value = ''\n \n for(n=0; n<MaiorLetras; n++){\n if(!Vet2[n]){Value = Value+'00'}\n else{\n if(Vet2[n] < 10) Value = Value+'0'\n let agr = Vet2[n].toString()\n Value = Value+agr\n }\n }\n let Terceiro = undefined\n if(Acompanha) Terceiro = Acomp[m]\n Fim.push([Vetor[m], Value, Terceiro])\n }\n\n let Final = undefined\n let Nomes = []\n let Valores = []\n let Acompanhar = []\n for(o=0; o<VetorTam; o++){\n let agr = Fim[o]\n Nomes.push(agr[0])\n Valores.push(agr[1])\n if(Acompanhar) Acompanhar.push(agr[2])\n }\n \n if(Ordem == 'crescente'){\n Final = organizar(Valores, 'crescente', Nomes)\n if(Acompanha) Final2 = organizar(Valores, 'crescente', Acompanhar)\n }\n \n if(Ordem == 'decrescente'){\n Final = organizar(Valores, 'decrescente', Nomes)\n if(Acompanha) Final2 = organizar(Valores, 'decrescente', Acompanhar)\n }\n\n /*Conclusao*/\n let Acao = Vetor.length\n if(Acao >= -1 && Acao <= 1) {Notificar('Conc', Funcao, `Foi organizado ${Acao} elemento`)}\n else {Notificar('Conc', Funcao, `Foram organizados ${Acao} elementos`)}\n if(!Acomp) return Final[1]\n if( Acomp) return [Final[1], Final2[1]]\n }", "title": "" }, { "docid": "101f6420d8c899d0bbf1d20df592a3a0", "score": "0.58191955", "text": "function accion(boton){\n var selfPregunta;\n var selfRespuesta;\n var selfValor;\n\n for (var j = 0; j < encuesta.preguntas.length; j++) {\n if ($(boton).attr(\"data-idQuestion\") == encuesta.preguntas[j].id) {\n selfPregunta = encuesta.preguntas[j];\n for (var i = 0; i < selfPregunta.respuestas.length; i++) {\n if ($(boton).attr(\"data-idResponse\") == selfPregunta.respuestas[i].id) {\n selfRespuesta = selfPregunta.respuestas[i];\n }\n }\n }\n }\n selfValor = selfRespuesta.value;\n setPuntuacion(selfValor);\n limpiarSalida();\n // si el numero de preguntas impresas es igual al total de preguntas de esa encuesta, sacamos el resultado\n if (this.printed == encuesta.preguntas.length){\n imprimirSolucion(this.pos);\n } else {\n imprimirPreguntas(getEPos(), this.pos, getPPos());\n }\n}", "title": "" }, { "docid": "7dd80cf00ebd4a9637348f979d4f3aa4", "score": "0.5818642", "text": "function controlloInserisciCommessa(tipologia){\r\n\t\r\n\tvar espressione = /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)\\d\\d$/;\r\n\tvar controlloLettere = /^([a-zA-Z '])+$/;\r\n\t\r\n\tif(tipologia == \"1\"){\r\n\t\t\r\n\t\t/*\r\n\t\t * commessa esterna singola\r\n\t\t * \r\n\t\t * commessaEsternaSingola_codice\r\n\t\t * commessaEsternaSingola_idRisorsa\r\n\t\t * commessaEsternaSingola_dataOfferta\r\n\t\t * commessaEsternaSingola_oggettoOfferta\r\n\t\t * commessaEsternaSingola_descrizione\r\n\t\t * commessaEsternaSingola_dataInizio\r\n\t\t * commessaEsternaSingola_dataFine\r\n\t\t * commessaEsternaSingola_importo\r\n\t\t * commessaEsternaSingola_ore\r\n\t\t*/\r\n\t\t\r\n\t\tvar codice_CommessaSingola = \"\";\r\n\t\tvar risorsa_CommessaSingola = \"\";\r\n\t\tvar dataOfferta_CommessaSingola = \"\";\r\n\t\tvar oggettoOfferta_CommessaSingola = \"\";\r\n\t\tvar descrizione_CommessaSingola = \"\";\r\n\t\tvar dataInizio_CommessaSingola = \"\";\r\n\t\tvar dataFine_CommessaSingola = \"\";\r\n\t\tvar importo_CommessaSingola = \"\";\r\n\t\tvar ore_CommessaSingola = \"\";\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_codice != undefined){\r\n\t\t\tcodice_CommessaSingola = document.commessa.commessaEsternaSingola_codice.value;\r\n\t\t\tif(codice_CommessaSingola == null || codice_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Cliente\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_idRisorsa != undefined){\r\n\t\t\trisorsa_CommessaSingola = document.commessa.commessaEsternaSingola_idRisorsa.value;\r\n\t\t\tif(risorsa_CommessaSingola == null || risorsa_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Risorsa\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataOfferta != undefined){\r\n\t\t\tdataOfferta_CommessaSingola = document.commessa.commessaEsternaSingola_dataOfferta.value;\r\n\t\t\tif(dataOfferta_CommessaSingola == null || dataOfferta_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataOfferta_CommessaSingola.length < 10 || dataOfferta_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataOfferta_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_oggettoOfferta != undefined){\r\n\t\t\toggettoOfferta_CommessaSingola = document.commessa.commessaEsternaSingola_oggettoOfferta.value;\r\n\t\t\tif(oggettoOfferta_CommessaSingola == null || oggettoOfferta_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_descrizione != undefined){\r\n\t\t\tdescrizione_CommessaSingola = document.commessa.commessaEsternaSingola_descrizione.value;\r\n\t\t\tif(descrizione_CommessaSingola == null || descrizione_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataInizio != undefined){\r\n\t\t\tdataInizio_CommessaSingola = document.commessa.commessaEsternaSingola_dataInizio.value;\r\n\t\t\tif(dataInizio_CommessaSingola == null || dataInizio_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataInizio_CommessaSingola.length < 10 || dataInizio_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataInizio_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataFine != undefined){\r\n\t\t\tdataFine_CommessaSingola = document.commessa.commessaEsternaSingola_dataFine.value;\r\n\t\t\tif(dataFine_CommessaSingola == null || dataFine_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataFine_CommessaSingola.length < 10 || dataFine_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataFine_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tvar split_DataInizio_CommessaSingola = dataInizio_CommessaSingola.split(\"-\");\r\n\t\tvar split_DataFine_CommessaSingola = dataFine_CommessaSingola.split(\"-\");\r\n\r\n\t\tvar dateInizio_CommessaSingola = new Date(split_DataInizio_CommessaSingola[2],split_DataInizio_CommessaSingola[1],split_DataInizio_CommessaSingola[0]).getTime();\r\n\t\tvar dateFine_CommessaSingola = new Date(split_DataFine_CommessaSingola[2],split_DataFine_CommessaSingola[1],split_DataFine_CommessaSingola[0]).getTime();\r\n\t\t\r\n\t\tif(dateInizio_CommessaSingola > dateFine_CommessaSingola){\r\n\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_importo != undefined){\r\n\t\t\timporto_CommessaSingola = document.commessa.commessaEsternaSingola_importo.value;\r\n\t\t\tif(importo_CommessaSingola == null || importo_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tfor(var x = 0; x < importo_CommessaSingola.length; x++){\r\n\t\t\t\t\tvar singleChar = importo_CommessaSingola.substring(x,(x+1));\r\n\t\t\t\t\tif(controlloLettere.test(singleChar)){\r\n\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\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\t\r\n\t\t\t\tvar num = importo_CommessaSingola.split(\".\");\r\n\t\t\t\tif(num.length > 2){\r\n\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(importo_CommessaSingola.indexOf(\",\") != -1){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo_CommessaSingola.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\tif((importo_CommessaSingola.length-1) - importo_CommessaSingola.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_ore != undefined){\r\n\t\t\tore_CommessaSingola = document.commessa.commessaEsternaSingola_ore.value;\r\n\t\t\tif(isNaN(ore_CommessaSingola)){\r\n\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}else if(tipologia == \"2\"){\r\n\t\r\n\t\t/*\r\n\t\t * commessa esterna multipla\r\n\t\t * \r\n\t\t * codice\r\n\t\t * dataOfferta\r\n\t\t * Offerta\r\n\t\t * dataInizio\r\n\t\t * dataFine\r\n\t\t * importo\r\n\t\t * ore\r\n\t\t*/\r\n\t\t\r\n\t\tvar codice = \"\";\r\n\t\tvar dataOfferta = \"\";\r\n\t\tvar oggettoOfferta = \"\";\r\n\t\tvar descrizione = \"\";\r\n\t\tvar dataInizio = \"\";\r\n\t\tvar dataFine = \"\";\r\n\t\tvar importo = \"\";\r\n\t\tvar ore = \"\";\r\n\t\t\r\n\t\tif(document.commessa.codice != undefined){\r\n\t\t\tcodice = document.commessa.codice.value;\r\n\t\t\tif(codice == null || codice == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Cliente\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataOfferta != undefined){\r\n\t\t\tdataOfferta = document.commessa.dataOfferta.value;\r\n\t\t\tif(dataOfferta == null || dataOfferta == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataOfferta.length < 10 || dataOfferta.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataOfferta))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.oggettoOfferta != undefined){\r\n\t\t\toggettoOfferta = document.commessa.oggettoOfferta.value;\r\n\t\t\tif(oggettoOfferta == null || oggettoOfferta == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.descrizione != undefined){\r\n\t\t\tdescrizione = document.commessa.descrizione.value;\r\n\t\t\tif(descrizione == null || descrizione == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataInizio != undefined){\r\n\t\t\tdataInizio = document.commessa.dataInizio.value;\r\n\t\t\tif(dataInizio == null || dataInizio == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataInizio.length < 10 || dataInizio.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataInizio))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataFine != undefined){\r\n\t\t\tdataFine = document.commessa.dataFine.value;\r\n\t\t\tif(dataFine == null || dataFine == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataFine.length < 10 || dataFine.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataFine))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t}\r\n\t\t\r\n\t\tvar split_DataInizio = dataInizio.split(\"-\");\r\n\t\tvar split_DataFine = dataFine.split(\"-\");\r\n\r\n\t\tvar dateInizio = new Date(split_DataInizio[2],split_DataInizio[1],split_DataInizio[0]).getTime();\r\n\t\tvar dateFine = new Date(split_DataFine[2],split_DataFine[1],split_DataFine[0]).getTime();\r\n\t\t\r\n\t\tif(dateInizio > dateFine){\r\n\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(document.commessa.importo != undefined){\r\n\t\t\timporto = document.commessa.importo.value;\r\n\t\t\tif(importo == null || importo == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(controlloLettere.test(importo)){\r\n\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var y = 0; y < importo.length; y++){\r\n\t\t\t\t\t\tvar char = importo.substring(y,(y+1));\r\n\t\t\t\t\t\tif(controlloLettere.test(char)){\r\n\t\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\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\t\r\n\t\t\t\t\tvar num1 = importo.split(\".\");\r\n\t\t\t\t\tif(num1.length > 2){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo.indexOf(\",\") != -1){\r\n\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(importo.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\t\tif((importo.length-1) - importo.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.ore != undefined){\r\n\t\t\tore = document.commessa.ore.value;\r\n\t\t\tif(isNaN(ore)){\r\n\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}else if(tipologia == \"3\"){\r\n\t\t\r\n\t\t\t/*\r\n\t\t\t * * commessa interna\r\n\t\t\t * \r\n\t\t\t * commessaInterna_dataOfferta\r\n\t\t\t * commessaInterna_oggettoOfferta\r\n\t\t\t * commessaInterna_dataInizio\r\n\t\t\t * commessaInterna_dataFine\r\n\t\t\t * commessaInterna_importo\r\n\t\t\t * commessaInterna_ore\r\n\t\t\t */\r\n\t\t\t\r\n\t\t\tvar dataOfferta_CommessaInterna = \"\";\r\n\t\t\tvar oggettoOfferta_CommessaInterna = \"\";\r\n\t\t\tvar descrizione_CommessaInterna = \"\";\r\n\t\t\tvar dataInizio_CommessaInterna = \"\";\r\n\t\t\tvar dataFine_CommessaInterna = \"\";\r\n\t\t\tvar importo_CommessaInterna = \"\";\r\n\t\t\tvar ore_CommessaInterna = \"\";\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_dataOfferta != undefined){\r\n\t\t\t\tdataOfferta_CommessaInterna = document.commessa.commessaInterna_dataOfferta.value;\r\n\t\t\t\tif(dataOfferta_CommessaInterna == null || dataOfferta_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataOfferta_CommessaInterna.length < 10 || dataOfferta_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataOfferta_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_oggettoOfferta != undefined){\r\n\t\t\t\toggettoOfferta_CommessaInterna = document.commessa.commessaInterna_oggettoOfferta.value;\r\n\t\t\t\tif(oggettoOfferta_CommessaInterna == null || oggettoOfferta_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_descrizione != undefined){\r\n\t\t\t\tdescrizione_CommessaInterna = document.commessa.commessaInterna_descrizione.value;\r\n\t\t\t\tif(descrizione_CommessaInterna == null || descrizione_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_dataInizio != undefined){\r\n\t\t\t\tdataInizio_CommessaInterna = document.commessa.commessaInterna_dataInizio.value;\r\n\t\t\t\tif(dataInizio_CommessaInterna == null || dataInizio_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataInizio_CommessaInterna.length < 10 || dataInizio_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!espressione.test(dataInizio_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_dataFine != undefined){\r\n\t\t\t\tdataFine_CommessaInterna = document.commessa.commessaInterna_dataFine.value;\r\n\t\t\t\tif(dataFine_CommessaInterna == null || dataFine_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataFine_CommessaInterna.length < 10 || dataFine_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataFine_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\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}\r\n\t\t\t\r\n\t\t\tvar split_DataInizio_CommessaInterna = dataInizio_CommessaInterna.split(\"-\");\r\n\t\t\tvar split_DataFine_CommessaInterna = dataFine_CommessaInterna.split(\"-\");\r\n\r\n\t\t\tvar dateInizio_CommessaInterna = new Date(split_DataInizio_CommessaInterna[2],split_DataInizio_CommessaInterna[1],split_DataInizio_CommessaInterna[0]).getTime();\r\n\t\t\tvar dateFine_CommessaInterna = new Date(split_DataFine_CommessaInterna[2],split_DataFine_CommessaInterna[1],split_DataFine_CommessaInterna[0]).getTime();\r\n\t\t\t\r\n\t\t\tif(dateInizio_CommessaInterna > dateFine_CommessaInterna){\r\n\t\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_importo != undefined){\r\n\t\t\t\timporto_CommessaInterna = document.commessa.commessaInterna_importo.value;\r\n\t\t\t\tif(importo_CommessaInterna == null || importo_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var z = 0; z < importo_CommessaInterna.length; z++){\r\n\t\t\t\t\t\tvar singoloChar = importo_CommessaInterna.substring(z,(z+1));\r\n\t\t\t\t\t\tif(controlloLettere.test(singoloChar)){\r\n\t\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\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\t\r\n\t\t\t\t\tvar num2 = importo_CommessaInterna.split(\".\");\r\n\t\t\t\t\tif(num2.length > 2){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo_CommessaInterna.indexOf(\",\") != -1){\r\n\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(importo_CommessaInterna.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\t\tif((importo_CommessaInterna.length-1) - importo_CommessaInterna.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_ore != undefined){\r\n\t\t\t\tore_CommessaInterna = document.commessa.commessaInterna_ore.value;\r\n\t\t\t\tif(isNaN(ore_CommessaInterna)){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t}else if(tipologia == 4){\r\n\t\t\r\n\t\t/*\r\n\t\t * altro\r\n\t\t * \r\n\t\t * altro_descrizione\r\n\t\t */\r\n\t if(document.commessa.altro_descrizione.value == \"\"){\r\n\t\t alert(\"Valorizzare la descrizione della commessa\");\r\n\t\t return false;\r\n\t }\r\n\t \r\n\t if(!(document.commessa.ferie.checked) && !(document.commessa.permessi.checked) &&\r\n\t\t !(document.commessa.mutua.checked) && !(document.commessa.ferieNonRetribuite.checked) &&\r\n\t\t !(document.commessa.permessiNonRetribuiti.checked) && !(document.commessa.mutuaNonRetribuiti.checked)){\r\n\t\t \talert(\"Selezionare una \\\"Tipologia Commessa\\\"\");\r\n\t\t \treturn false;\r\n\t }\r\n\t \r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "d8533c9e20b588d14e4e36aa8a1caff4", "score": "0.58176637", "text": "cargandoArbolLista(nodo){\n if(nodo!= null){\n if(nodo.nodohijo == true && nodo.dato != -1){\n recarga.push(nodo.dato)\n }\n this.cargandoArbolLista(nodo.izquierda)\n this.cargandoArbolLista(nodo.derecha)\n }\n }", "title": "" }, { "docid": "88f98bb35539ea39629e1d7a9f7cc8c8", "score": "0.5806313", "text": "function consultarOrdenCompra(id_orden_compra, id_categoria_programatica){\n\tdocument.getElementById('id_orden_compra').value = id_orden_compra;\n\tvar resultado = consultarTipoCarga(id_orden_compra);\n\tsetTimeout(\"actualizarDatosBasicos('consultar', \"+id_orden_compra+\")\",500);\n\tdocument.getElementById('tablaMaterialesPartidas').style.display='block';\n\tdocument.getElementById('tablaSNC').style.display='block';\n\tdocument.getElementById('tablaPartidas').style.display='block';\n\tdocument.getElementById('tablaContabilidad').style.display='block';\n\tconsultarMateriales(id_orden_compra);\n\tactualizarListaDeTotales(id_orden_compra);\n\tactualizarTotalesPartidas(id_orden_compra);\n\tactualizarBotones(id_orden_compra, document.getElementById(\"idestado\").value);\n\tmostrarPartidas(id_orden_compra, id_categoria_programatica);\n\tsetTimeout(\"validarTipoListaMostrar(\"+resultado+\",\"+id_orden_compra+\")\", 1000);\n\tsetTimeout(\"esconderListaSolicitudes()\", 1500);\n\testado = document.getElementById('idestado').value;\n\tif (estado == 'elaboracion'){\n\t\tdocument.getElementById('divTablaProveedores').style.display='block';\n\t\tdocument.getElementById('proceso').style.display='block';\n\t\tdocument.getElementById('solicitudesSeleccionada').style.display='block';\n\t\tdocument.getElementById('formularioMateriales').style.display='block';\n\t}else{\n\t\tdocument.getElementById('divTablaProveedores').style.display='block';\n\t\tdocument.getElementById('proceso').style.display='none';\n\t\tdocument.getElementById('solicitudesSeleccionada').style.display='block';\n\t\tdocument.getElementById('formularioMateriales').style.display='none';\n\t}\n\tmostrarCuentasContables(id_orden_compra);\n}", "title": "" }, { "docid": "a60b79f464cf88fd97245cf443d85c4e", "score": "0.5803647", "text": "function compilarSintaxis() {\n\tvar letra;\n\tvar estadoActual = 0;\n\talfabetoAutomata = [];\n\tnumeroTransiciones = 0;\n\ttopePilas = [];\n\tapilamiento = [];\n\talfabetoPila = [];\n\testadosAutomata = [];\n\testadosInicialesTransicion = [];\n\testadosFinalesTransicion = [];\n\testadoInicial = \"\";\n\testadosFinales = [];\n\tfuncionDeltaPila = [];\n \tvar asigno = false;\n\tvar incorrect = false;\n\t lineaCodigo = editorCode.getValue();\n\tvar linea = lineaCodigo.split(/\\r\\n|\\r|\\n|\\n\\r/);\n\tvar l = 0;\n\t contLineas = 1;\n\t var nuevoEstado = -1;\n\t\testadoActual = 0;\n\t\tvar i = 0;\n\t\tvar cont = 0;\n\t\tif (lineaCodigo != '' ) {\n\t\t\tvar str = \"\";\n\t\t\tvar transicion = \"\";\n\t\t\tfor (j = 0; j < lineaCodigo.length ; j++) {\n\t\t\t\t\n\t\t\t\t\tvar letraNueva = lineaCodigo.charAt(j);\n\t\t\t\t\tvar h = get_indice(letraNueva);\n\t\t\t\t\tif( h == 5){\n\n\t\t\t\t\t\tcontLineas++;\n\t\t\t\t\t}\n\t\t\t\t\tif (h !== -1) {\n\t\t\t\t\t\tnuevoEstado = funcionDelta[h][estadoActual];\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(estadoActual+\" \"+nuevoEstado+\" \"+letraNueva);\n\t\t\t\t\t//Guardar nombre de automata \n\t\t\t\t\tif (nuevoEstado == 5 && estadoActual == 4) {\n\t\t\t\t\t\t//console.log(true);\n\t\t\t\t\t\tstr = letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (nuevoEstado == 5 && estadoActual ==5 && h != 5) {\n\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 5 && nuevoEstado != 5) {\n\t\t\t\t\t\tnameAutomata = str;\n\t\t\t\t\t}\n\t\t\t\t\t//guardar estado inicial\n\t\t\t\t\tif (nuevoEstado == 12 && estadoActual == 11) {\n\t\t\t\t\t\tstr = letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (nuevoEstado == 12 && estadoActual == 12 && h != 5 ) {\n\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 12 && nuevoEstado != 12) {\n\t\t\t\t\t\testadoInicial = str;\n\t\t\t\t\t\testadosAutomata.push(estadoInicial);\n\t\t\t\t\t}\n\t\t\t\t\t//estadosFinales\n\t\t\t\t\tif (nuevoEstado == 19 && estadoActual == 18) {\n\t\t\t\t\t\tstr = letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (nuevoEstado == 19 && estadoActual == 19 && h != 5) {\n\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 19 && nuevoEstado != 19) {\n\t\t\t\t\t\testadosFinales.push(str);\n\t\t\t\t\t\tif (isNotExitsEstadoAutomata(str)) {\n\t\t\t\t\t\t\testadosAutomata.push(str);\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//guardar alfabeto Pila\n\t\t\t\t\tif (estadoActual == 25 && nuevoEstado == 26) {\n\t\t\t\t\t\talfabetoPila.push(letraNueva);\n\t\t\t\t\t}\n\t\t\t\t\t//guardar tope inicial de pila\n\t\t\t\t\tif (estadoActual == 31 && nuevoEstado == 32) {\n\t\t\t\t\t\ttopeInicialPila = letraNueva;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//guardar estados de automata con pila\n\t\t\t\t\tif (estadoActual == 35 && nuevoEstado == 36) {\n\t\t\t\t\t\tasigno = false;\n\t\t\t\t\t\ttransicion = \"\";\n\t\t\t\t\t\tstr = letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 36 && nuevoEstado == 36 && h != 5) {\n\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 36 && (nuevoEstado == 37 || nuevoEstado == 38)) {\n\t\t\t\t\t\tif (str == estadoInicial) {\n\t\t\t\t\t\t\tisUseEstIncial = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttransicion += str+\",\";\n\t\t\t\t\t\testadosInicialesTransicion.push(str);\n\t\t\t\t\t\tif (isNotExitsEstadoAutomata(str)) {\n\t\t\t\t\t\t\testadosAutomata.push(str);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//guardar alfabeto Automata\n\t\t\t\t\tif (estadoActual == 38 && nuevoEstado == 39) {\n\t\t\t\t\t\ttransicion += letraNueva+\",\";\n\t\t\t\t\t\tif (posAlfabetoAutomata(letraNueva) == -1) {\n\t\t\t\t\t\t\talfabetoAutomata.push(letraNueva);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//guardar estados de automata con pila 2\n\t\t\t\t\tif (estadoActual == 40 && nuevoEstado == 43) {\n\t\t\t\t\t\tstr = letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 43 && nuevoEstado == 43 && h != 5) {\n\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 43 && (nuevoEstado == 44 || nuevoEstado == 45)) {\n\t\t\t\t\t\ttransicion += str+\",\";\n\t\t\t\t\t\testadosFinalesTransicion.push(str);\n\t\t\t\t\t\tif (isNotExitsEstadoAutomata(str)) {\n\t\t\t\t\t\t\testadosAutomata.push(str);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (estadoActual == 45 && nuevoEstado == 46) {\n\t\t\t\t\t\ttransicion += letraNueva+\",\";\n\t\t\t\t\t\tif (esta_Definido(letraNueva)){\n\t\t\t\t\t\t\ttopePilas.push(letraNueva);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tconsole.log('No esta definido');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (estadoActual == 47 && nuevoEstado == 48) {\n\t\t\t\t\t\tif (esta_Definido(letraNueva) || letraNueva == '_') {\n\t\t\t\t\t\t\tstr = letraNueva\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tconsole.log('No esta definido');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 48 && nuevoEstado == 48) {\n\t\t\t\t\t\tif (esta_Definido(letraNueva)) {\n\t\t\t\t\t\t\tstr += letraNueva;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tconsole.log('No esta definido');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 48 && nuevoEstado == 35 && !asigno) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\tasigno = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 48 && nuevoEstado == 33 && !asigno) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\tasigno = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 48 && nuevoEstado == 49 && !asigno) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\tasigno = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (estadoActual == 47 && nuevoEstado == 48 && j == lineaCodigo.length-1) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\tasigno = true;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tif ((isLetter(letra) || isLetter(letraNueva) || letraNueva == '_') && estadoActual == 48 && (nuevoEstado == 33 || nuevoEstado == 35 || nuevoEstado == 49)) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t}else if ((isLetter(letra) || isLetter(letraNueva) || letraNueva == '_') && (estadoActual == 47 || estadoActual == 48) && nuevoEstado == 48) {\n\t\t\t\t\t\ttransicion += str;\n\t\t\t\t\t\tapilamiento.push(str);\n\t\t\t\t\t\thashTransiciones.set(numeroTransiciones,transicion);\n\t\t\t\t\t\tnumeroTransiciones++;\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t\t\t//estado Aceptaciòn\n\t\t\t\t\testadoActual = nuevoEstado;\n\t\t\t\t\tletra = letraNueva;\n\t\t\t}\n\t\t}\n\t\tif (estadoActual == 48 || estadoActual == 49 || estadoActual == 34 || estadoActual == 33 || estadoActual == 35) {\n\t\t\treturn incorrect;\n\t\t}else{\n\t\t\tincorrect = true;\n\t\t}\n\treturn incorrect; \n}", "title": "" }, { "docid": "790485f503782558a088c1aca415fe59", "score": "0.5802819", "text": "function action_controlesObligatoire(){\n\t\tvar cadre = eval(regleArray['cibleFenetre'] + (regleArray['cibleCadre'] != '' ? '.' + regleArray['cibleCadre'] : ''));\n\t\tvar controlesArray = regleArray['cibleObjet'].replace(/\\r|\\n/g,'').split(',');\n\t\tcadre.formulaire.controlesObligatoire(controlesArray,eval(regleArray['condition']));\n\t}//end function\t", "title": "" }, { "docid": "ec33cb39483386a8ff31303087d76561", "score": "0.57955074", "text": "function cargaLista(){\n\t var arr = new Array();\n\n\t\tarr[arr.length] = new Array(\"oid\", get(\"frmInsertarCartera.oid\")+\"\");\n\t\tarr[arr.length] = new Array(\"oidPais\", get(\"frmInsertarCartera.hPais\")+\"\");\n\t\tarr[arr.length] = new Array(\"oidIdioma\", get(\"frmInsertarCartera.hIdioma\")+\"\");\n \n\t configurarPaginado(mipgndo,\"CARBuscarAsignacionesCodigoConf\",\"ConectorBuscarAsignacionesCodigoConf\",\n\t\t\"es.indra.sicc.util.DTOOID\",arr); \n\n /*var asignaciones = get('frmInsertarCartera.hidAsignaciones');\n var arra = asignaciones.split('|');\n\n for (var i=0;i<arra.length-1 ;i++) {\n var asign = arra[i].split('@');\n var newRow = new Array();\n\n oidAsignacion = asign[0];\n strCodConf = asign[1];\n strNivelRiesgo = asign[2];\n strGrupoSolicitud = asign[3];\n strMarca = asign[4];\n strCanal = asign[5];\n strSubgerenciasVentas = asign[6];\n strRegion = asign[7];\n strZona = asign[8];\n strLinCreIni = asign[9];\n strNiveRiesIni = asign[10];\n oidCodConf = asign[11];\n oidNieRies = asign[12];\n oidGrupoSolicitud = asign[13];\n oidMarca = asign[14];\n oidCanal = asign[15];\n oidSGV = asign[16];\n oidRegion = asign[17];\n oidZona = asign[18];\n oidNiveRiesIni = asign[19];\n \n newRow[newRow.length] = oidAsignacion;\n agregarALlistado(newRow);\n }*/ \n }", "title": "" }, { "docid": "a7e7e2d4fbb54e11fada5ed8a69c9861", "score": "0.57930195", "text": "function dibujar(){\r\n let coorX=INICIO_ALTO_LIENZO\r\n let coorY=INICIO_ANCHO_LIENZO\r\n for(let i=0;i<ALTO_CUADRICULA;++i){\r\n for(let x=0;x<ANCHO_CUADRICULA;x++){\r\n if(cuadricula[i][x]!==0){\r\n //la herramienta fillRect permite dibujar un rectángulo:\r\n CONTEXTO.fillRect(coorX+DISTANCIA,coorY+DISTANCIA,ANCHO_ALTO_CUADRADO,ANCHO_ALTO_CUADRADO)\r\n }\r\n if(cuadricula[i][x]===0){\r\n //la herramienta clearRect permite borrar un rectángulo:\r\n CONTEXTO.clearRect(coorX+DISTANCIA,coorY+DISTANCIA,ANCHO_ALTO_CUADRADO,ANCHO_ALTO_CUADRADO)\r\n }\r\n coorX+=ANCHO_ALTO_CUADRADO+DISTANCIA\r\n }\r\n coorX=INICIO_ALTO_LIENZO\r\n coorY+=ANCHO_ALTO_CUADRADO+DISTANCIA\r\n }\r\n}", "title": "" }, { "docid": "4c826a11cf65c597aa2d3cf760576489", "score": "0.5790812", "text": "function pedImpueGenerPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('pedImpueGenerListLayer', 'O');\n\t\tvisibilidad('pedImpueGenerListButtonsLayer', 'O');\n\t\tif(get('pedImpueGenerFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tpedImpueGenerLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:pedImpueGenerViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, pedImpueGenerChoiceColumn) + \"</A>\",\n\t\t\ti, pedImpueGenerChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tpedImpueGenerList.setDatos(datosTmp.filtrar([0,1,2,3,4],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tpedImpueGenerTimeStamps = datosTmp.filtrar([5],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tpedImpueGenerMorePagesFlag = true;\n\t\tpedImpueGenerList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tpedImpueGenerMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('pedImpueGenerFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('pedImpueGenerListLayer', 'V');\n\tvisibilidad('pedImpueGenerListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('pedImpueGenerList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tpedImpueGenerList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(pedImpueGenerMorePagesFlag){\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(pedImpueGenerPageCount > 1){\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "654792c37538bbfa32d591f2b0328357", "score": "0.57735544", "text": "async function botCheckNovosComprovantes() {\n checkNovosComprovantes(token).then((ret)=>{\n if(ret.rowsAffected>0){\n novosComprovantes++\n sendLog('AVISO',`Solicitado comprovantes na (Easydocs/AgileProcess) - (${ret.rowsAffected})`)\n }\n x_botCheckNovosComprovantes += ret.rowsAffected\n }) \n ++checks\n setTimeout(botCheckNovosComprovantes,time_evidencias) // (1800000) = A cada 30 minutos\n}", "title": "" }, { "docid": "a825fadb4cea6f26bc4a68aef8b3446d", "score": "0.575639", "text": "function bloques(bloque){ //funcion para mostrar y ocultar componentes html dinamicamente\n var arr = ['div_agregar', 'div_modificar', 'div_eliminar', 'div_buscar', 'div_consultar'];\n for (var i = 0; i < arr.length; i++) {\n\n if (arr[i] == bloque) {\n mostrar(bloque)\n if (arr[i] == 'div_consultar') {\n consultar('tableID');\n }\n }else { ocultar(arr[i]) }\n }\n}", "title": "" }, { "docid": "f421ccd79e023e922006b998249371cd", "score": "0.5749016", "text": "function organizar(Vetor, Ordem, Acompanhamento){\n let Funcao = 'organizar'\n /*Erro*/ if(Vetor[0] == undefined) return Notificar('Warn', Funcao, 'Vetor', 'Vetor', Vetor)\n /*Erro*/ if(Acompanhamento[0] == undefined) return Notificar('Warn', Funcao, `Vetor`, 'Acompanhamento', Acompanhamento)\n\n let Acomp = true\n let VetorTam = Vetor.length\n let Limitador = 1/VetorTam\n let VetorBase\n let VetorBase2\n let VetorA = []\n let VetorB = []\n Ordem = Ordem.toLowerCase()\n\n if(!Acompanhamento) Acomp = true\n\n if(Ordem == 'crescente') VetorBase = desrepetir(Vetor, Limitador, 'cima' )\n if(Ordem == 'decrescente') VetorBase = desrepetir(Vetor, Limitador, 'baixo')\n console.log(VetorBase)\n if(Ordem == 'crescente' ) VetorBase2 = crescente(VetorBase)\n if(Ordem == 'decrescente') VetorBase2 = decrescente(VetorBase)\n\n\n for(e=0; e<VetorTam; e++){\n let Lugar = VetorBase.indexOf(VetorBase2[e])\n\n VetorA.push(Vetor[Lugar])\n if(Acomp) VetorB.push(Acompanhamento[Lugar])\n }\n\n /*Conclusao*/\n let Acao = Acompanhamento.length\n if(Acao >= -1 && Acao <= 1) {Notificar('Conc', Funcao, `Foi organizado ${Acao} elemento`)}\n else {Notificar('Conc', Funcao, `Foram organizados ${Acao} elementos`)}\n if(!Acomp) return VetorA\n if( Acomp) return [VetorA, VetorB]\n }", "title": "" }, { "docid": "7e5da8b67529444f2cccde590dbfe863", "score": "0.574774", "text": "function preArgumVentaPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('preArgumVentaListLayer', 'O');\n\t\tvisibilidad('preArgumVentaListButtonsLayer', 'O');\n\t\tif(get('preArgumVentaFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tpreArgumVentaLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:preArgumVentaViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, preArgumVentaChoiceColumn) + \"</A>\",\n\t\t\ti, preArgumVentaChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tpreArgumVentaList.setDatos(datosTmp.filtrar([0,1,2,3,4],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tpreArgumVentaTimeStamps = datosTmp.filtrar([5],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tpreArgumVentaMorePagesFlag = true;\n\t\tpreArgumVentaList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tpreArgumVentaMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('preArgumVentaFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('preArgumVentaListLayer', 'V');\n\tvisibilidad('preArgumVentaListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('preArgumVentaList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tpreArgumVentaList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(preArgumVentaMorePagesFlag){\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(preArgumVentaPageCount > 1){\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('preArgumVentaPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "94024a66dbcb276054888d353bd8774f", "score": "0.5745495", "text": "function buscarPesos() {\n var active = database.result;\n var data = active.transaction([\"pesoCliente\"], \"readonly\");\n var object = data.objectStore(\"pesoCliente\");\n var elements = [];\n var emailABuscar = document.getElementById(\"correo\").value;\n var fechaI = document.getElementById(\"fechaI\").value;\n var fechaF = document.getElementById(\"fechaF\").value;\n\n object.openCursor().onsuccess = function (e) {\n var result = e.target.result;\n if (result === null) {\n return;\n }\n elements.push(result.value);\n result.continue();\n };\n data.oncomplete = function () {\n var outerHTML = ''; \n for (var key in elements) { \n //Si el correo coincide y si está entre las fechas\n if(emailABuscar===elements[key].idUsuario && fechaI < elements[key].fecha < fechaF){\n //Incorporarle una FECHA Y ACTIVIDAD\n outerHTML += '\\n\\\n <tr>\\n\\\n <td>' + elements[key].fecha + '</td>\\n\\\n <td>' + elements[key].pesa + '</td>\\n\\\n </tr>';\n }\n }\n elements = [];\n document.querySelector('#elementsList').innerHTML = outerHTML;\n };\n}", "title": "" }, { "docid": "7df64338fe326f6422b825dc0446202b", "score": "0.5743664", "text": "listarPendienteCompletadas( completadas = true ){\n \n let num;\n let msg;\n // console.log(this.listadoArr)\n this.listadoArr.forEach( ({desc , id, completadoEn}, i) => {\n\n if(completadas){\n if(completadoEn !== null){\n msg = 'Completado'.green;\n num = `${++i}.`.green;\n console.log(`${num.toString().green} ${desc} :: ${msg} :: ${completadoEn.green}`)\n }\n }else{\n msg = 'Pendiente'.green;\n num = `${++i}.`.green;\n console.log(`${num.toString().green} ${desc} :: ${msg}`)\n }\n\n \n\n });\n }", "title": "" }, { "docid": "7bf210a2e9098c26ab26b0cff2bd5fe0", "score": "0.5736921", "text": "function numeroConDecimales() {\n\t// Elimino todo menos lo numeros y las comas\n\tthis.value = this.value.replace(/[^0-9\\,]/g,'');\n\n\t// Separo por comas\n\tvar comas = this.value.split(\",\");\n\t// Si hay mas de 2 bloques, entonces son 2 comas\n\tif (comas.length > 2) {\n\t\t// Dejo todo lo q esta a la izquierda de la segunda coma\n\t\tthis.value = comas[0] + \",\" + comas[1];\n\t}\t\n}", "title": "" }, { "docid": "8f538eb69bd8df29f909e3167be658e0", "score": "0.573064", "text": "function fEncuentraOficDepto(iCveOficina,iCveDepto){\n frm.hdOpinionEntidad.value = \"\";\n for(var i = 0; i < aResDesplegar.length; i++)\n if(iCveOficina == aResDesplegar[i][1] && iCveDepto == aResDesplegar[i][2]){\n lExisteOficDep = true;\n if(frm.hdOpinionEntidad.value == \"\")\n frm.hdOpinionEntidad.value = aResDesplegar[i][7];\n else\n frm.hdOpinionEntidad.value += \",\"+aResDesplegar[i][7];\n\n frm.hdCveSegtoEntidad.value = aResDesplegar[i][0];\n }\n\n if(!lExisteOficDep)\n fCargaDeptoPadre();\n else\n fNavega();\n}", "title": "" }, { "docid": "45241b4140d0cbe81bb47580c915f31d", "score": "0.572469", "text": "function enviarOpciones(consulta, nombreCompetencia) {\r\n\r\n conexionBaseDeDatos.query(consulta, function (err, resul, fields) {\r\n if (err) {\r\n console.log(\"Error en la consulta\", err.message);\r\n return res.status(500).send(\"Hubo un error al cargar las peliculas. Verificar los parametros ingresados +\");\r\n }\r\n else {\r\n var opciones = {\r\n competencia: nombreCompetencia,\r\n peliculas: resul,\r\n }\r\n\r\n //condicional para asegurar que no devuelva en las opciones dos veces a la misma pelicula.\r\n if (opciones.peliculas[0].id != opciones.peliculas[1].id) {\r\n res.send(opciones);\r\n } else {\r\n enviarOpciones(consulta, nombreCompetencia)\r\n };\r\n }\r\n })\r\n }", "title": "" }, { "docid": "0d93111ce5fcd32e9eb92f72d98e2cbe", "score": "0.5715766", "text": "function comprobarSearchCentro() {\n var codCentro; /*variable que representa el elemento codEdificio del formulario add */\n var codEdificio; /*variable que representa el elemento nombreEdificio del formulario add */\n var nombreCentro; /*variable que representa el elemento direccionEdificio del formulario add */\n var direccionCentro; /*variable que representa el elemento campuesEdificio del formulario add */\n var responsableCentro; //variable que represneta repsonsablecentro del formulario add\n\n codCentro = document.forms['ADD'].elements[0];\n codEdificio = document.forms['ADD'].elements[1];\n nombreCentro = document.forms['ADD'].elements[2];\n direccionCentro = document.forms['ADD'].elements[3];\n responsableCentro = document.forms['ADD'].elements[4];\t\n\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codEdificio.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codEdificio, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio \t\n\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codCentro.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codCentro, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio\t\t\n\n /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarAlfabetico(nombreCentro,50)) {\n return false;\n }//fin comprobar alfabetico\n\n /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarTexto(direccionCentro,150)) {\n return false;\n }//fin comprobar texto\n\n \t /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarAlfabetico(responsableCentro,60)){\n return false;\n } //fin comprobacion alfabetico \n return true;\n } //fin comprobar add centro", "title": "" }, { "docid": "0785df8a737416b4394266c42b65ce24", "score": "0.57147926", "text": "function mostarAgricultor(idClicado){\n window.spinnerplugin.show();\n var envio = {\n metodo: \"BUSCA_POR_ID_AGRICULTOR\",\n idpessoa: idClicado\n };\n\n //chama a requisicao do servidor, o resultado é listado em uma tabela\n requisicao(\"agricultor/buscar\", envio, function(dadosRetorno) {\n// $('#listaDeMembros').empty();\n if(dadosRetorno.sucesso){\n\n //chama a funcao que mostra a pagina amostragem\n abrirPageAmostragem('Agricultor', dadosRetorno.data.nome+' '+dadosRetorno.data.sobrenome+'<i class=\"fa fa-user button-icon-right\" data-position=\"top\"></i>', '<div class=\"col single-col\" data-uib=\"layout/col\" data-ver=\"0\"><div class=\"widget-container content-area vertical-col\"><div class=\"tarea widget d-margins\" data-uib=\"media/text\" data-ver=\"0\" ><div class=\"widget-container left-receptacle\"></div><div class=\"widget-container right-receptacle\"></div><div class=\"text-container\"> <p class=\"backgroundBranco\" >CPF: '+dadosRetorno.data.cpf+'</p><p class=\"backgroundCinza\">RG: '+dadosRetorno.data.rg+'</p><p class=\"backgroundBranco\" >Apelido: '+dadosRetorno.data.apelido+'</p><p class=\"backgroundCinza\">Data nascimento: '+dadosRetorno.data.datanascimento+'</p><p class=\"backgroundBranco\" >Sexo: '+dadosRetorno.data.sexo+'</p><p class=\"backgroundCinza\">Telefone1: '+dadosRetorno.data.telefone1+'</p><p class=\"backgroundBranco\" >Telefone2: '+dadosRetorno.data.telefone2+'</p><p class=\"backgroundCinza\">Email: '+dadosRetorno.data.email+'</p><p class=\"backgroundBranco\" >Estado civíl: '+dadosRetorno.data.estadocivil+'</p><p class=\"backgroundCinza\">Escolaridade: '+dadosRetorno.data.escolaridade+'</p><p class=\"backgroundBranco\" >Qtd integrante(s) na família: '+dadosRetorno.data.qtdintegrantes+'</p><p class=\"backgroundCinza\">Qtd crianças: '+dadosRetorno.data.qtdcriancas+'</p><p class=\"backgroundBranco\" >Qtd grávidas: '+dadosRetorno.data.qtdgravidas+'</p><hr> <div class=\"text-container\" id=\"MostrarPropriedadesAgricultor\" value=\"'+dadosRetorno.data.idpessoa+'\"><div class=\"panelPropriedades\">Propriedades<i class=\"amarelo glyphicon glyphicon-chevron-up button-icon-right\" data-position=\"top\"></i></div></div><div id=\"propriedadesDoAgricultor\" hidden=\"\"></div> </div></div><span class=\"uib_shim\"></span></div></div>');\n\n\n\n window.spinnerplugin.hide();\n }else{\n //retira o painel loading\n window.spinnerplugin.hide();\n navigator.notification.alert(dadosRetorno.mensagem, function(){\n iniciarGerenciador();\n },\"Aviso!\", \"Sair\");\n\n }\n\n });\n}", "title": "" }, { "docid": "07570d9f83d564ff3e8912485a9f4c3a", "score": "0.57032794", "text": "function entregarBilletesMejorCombinacion(mejorCombinacion) {\n for (const datos of mejorCombinacion) {\n for (const billete of caja) {\n if (datos.cantidad != 0 && billete.valor == datos.denominacion) {\n dineroRetiro = billete.entregarBilletes(dineroRetiro);\n }\n }\n }\n}", "title": "" }, { "docid": "b8bbedc6df03995816b4c8121cd3b2f5", "score": "0.56984735", "text": "function agregar_recuadros(cinta){\n var cinta_completa = \"\";\n for(var i = 0; i<cinta.length; i++){\n cinta_completa = cinta_completa + agregar_a_cinta(posicion);\n posicion = posicion + 50;\n }\n padre.html(cinta_inicial + cinta_completa);\n\n}", "title": "" }, { "docid": "aa3d255b337debbe50e5d2e15b50bc80", "score": "0.56973684", "text": "function continuarJugando(){\n\n\t// variable para identificar cuantos personajes quedan de cada uno\n\tlet contCanibalesDerecha = 0;\n\tlet contMisionerosDerecha = 0;\n\tlet contCanibalesIzquierda = 0;\n\tlet contMisionerosIzquierda = 0;\n\tlet numAzar = 0;\n\t\n\t// verificando el lugar en donde se encuentra la barca para contar los canibales que esta contiene\n\n\t\tcontCanibalesDerecha = $('#fragmentoTierraDer').find(\".canibales\").length;\n\t\tcontMisionerosDerecha = $('#fragmentoTierraDer').find(\".misioneros\").length;\n\t\tcontCanibalesIzquierda = $('#fragmentoTierraIzq').find(\".canibales\").length;\n\t\tcontMisionerosIzquierda = $('#fragmentoTierraIzq').find(\".misioneros\").length;\n\t\n\t\n\n\t//tambien hay que sumar los canibales de la barca\n\tif(ladoBarca == DERECHA){\n\t\tcontCanibalesDerecha += $('#barca').find(\".canibales\").length;\n\t\tcontMisionerosDerecha += $('#barca').find(\".misioneros\").length;\n\t}else{\n\t\tcontCanibalesIzquierda += $('#barca').find(\".canibales\").length;\n\t\tcontMisionerosIzquierda += $('#barca').find(\".misioneros\").length;\n\t}\n\t\tconsole.log(contCanibalesDerecha);\n\tconsole.log(contMisionerosDerecha);\n\tconsole.log(contCanibalesIzquierda);\n\tconsole.log(contMisionerosIzquierda);\n\t// verificando si hay mas canibales que misioneros del lado de la barca\n\tif(contCanibalesDerecha > contMisionerosDerecha && contMisionerosDerecha > 0 ){\n\n\t\t// obteniendo un numero al azar para obtener uno de los modals del perdedor\n\t\tnumAzar = Math.round(Math.random())+1;\n\n\t\t// mostrando el modal y reproduciendo el audio\n\t\t$('#modalPerdedor'+numAzar).css('display', 'block');\n\t\t$('#modalPerdedor'+numAzar).find('audio')[0].play();\n\t\t\n\t\treturn false;\n\t}else if(contCanibalesIzquierda > contMisionerosIzquierda && contMisionerosIzquierda > 0){\n\t\t\n\n\t\tnumAzar = Math.round(Math.random())+1;\n\n\t\t$('#modalPerdedor'+numAzar).css('display', 'block');\n\t\t$('#modalPerdedor'+numAzar).find('audio')[0].play();\n\t\t\n\t\treturn false;\n\n\t}else{\n\t\treturn true;\n\n\t}\n\n}", "title": "" }, { "docid": "a54dbcb9a13320b773ae611747478430", "score": "0.5697308", "text": "function imprimirTodos() {\n var mensaje = \"\";\n if (cohetesArray.length === 0) {\n alert(\"Aún no se ha creado ningún cohete!\");\n }\n else {\n for (var _i = 0, cohetesArray_1 = cohetesArray; _i < cohetesArray_1.length; _i++) {\n var item = cohetesArray_1[_i];\n mensaje +=\n \"C\\u00F3digo del cohete = \" + item.codigo +\n \"<br>\" +\n (\"Potencia Actual del cohete = \" + item.potenciaActual) +\n \"<br>\" +\n \"Potencias máximas de los propulsores: \";\n var mensaje1 = [];\n for (var _a = 0, _b = item.propulsoresArray; _a < _b.length; _a++) {\n var elemento = _b[_a];\n mensaje1.push(elemento.potenciaMaximaPropulsor);\n }\n mensaje += mensaje1.toString() + \".<br><br>\";\n }\n document.getElementById(\"resultado\").innerHTML = mensaje;\n }\n}", "title": "" }, { "docid": "49efbd4e0ea21bd81039e725d6ddbc53", "score": "0.5696546", "text": "function verReservas() {\n var superheroes = document.getElementsByClassName(\"superheroes\"); //Esto lo usamos para recoger los datos de los checkBox\n var texto = document.getElementById(\"texto\"); //Para escribir en el texto los resultados\n var pintarMisiones = \"\";\n var contadorNoSeleccionados = 0; //El contadorNoSeleccionados lo usamos cuando el usuario no ha seleccionado ese superheroe\n texto.innerHTML = \"\";\n\n for (var i = 0; i < superheroes.length; i++) {\n if (superheroes[i].checked) { //Cuando un superheroe esta marcado\n var superheroe = superheroePorID(superheroes[i].value); //Por el valor del checkBox (elegimos su id). Buscamos al superheroe por una llamada a la API\n var listMisiones = listadoMisionesSuperheroe(superheroes[i].value); //Tambien usamos el mismo valor para buscar las misiones asociadas\n\n if (listMisiones.length == 0) { //Si no tiene misiones le ponemos el texto de no tiene misiones\n texto.innerHTML = texto.innerHTML + \" <h3> \" + superheroe.NombreSuperheroe + \" </h3> \" + \"<br/> No hay misiones asociadas a este superheroe <hr>\";\n }\n\n else {\n for (var cont = 0; cont < listMisiones.length; cont++) { //Si las tiene\n pintarMisiones = pintarMisiones + listMisiones[cont].TituloMision + \" <br/> \"; //Escribimos el titulo de las misiones\n }\n texto.innerHTML = texto.innerHTML + \" <h3> \" + superheroe.NombreSuperheroe + \" </h3> \" + \"<br/>\" + pintarMisiones + \"<hr>\";\n }\n contadorNoSeleccionados = 0; //Aqui en el caso de que haya un superheroe seleccionado volvemos la cuenta a 0\n }\n else {\n contadorNoSeleccionados++ //Si no se han seleccionado sumamos 1 a la cuenta\n if (contadorNoSeleccionados == superheroes.length) { //En el caso de que la cuenta y el tamaño de superheroes sea el mismo\n alert(\"Tienes que seleccionar algun superheroe\"); //No se ha seleccionado ningun superheroe\n contadorNoSeleccionados = 0; //Reset de la cuenta\n }\n }\n\n }\n \n}", "title": "" }, { "docid": "c3a935e6c87ea257377f62c665ffa910", "score": "0.5691526", "text": "function barrebouilles(){\n\t\t// fonction generique appliquee aux classes CSS :\n\t\t// inserer_barre_forum, inserer_barre_edition, inserer_previsualisation\n\t\t$('.formulaire_spip textarea.inserer_barre_forum').barre_outils('forum');\n\t\t$('.formulaire_spip textarea.inserer_barre_edition').barre_outils('edition');\n\t\t$('.formulaire_spip textarea.inserer_previsualisation').barre_previsualisation();\n\t\t// fonction specifique aux formulaires de SPIP :\n\t\t// barre de forum\n\t\t$('textarea.textarea_forum').barre_outils('forum');\n\t\t \n\t\t$('.formulaire_forum textarea[name=texte]').barre_outils('forum');\n\t\t// barre d'edition et onglets de previsualisation\n\t\t$('.formulaire_spip textarea[name=texte]')\n\t\t\t.barre_outils('edition').end()\n\t\t\t.barre_previsualisation();\n\t}", "title": "" }, { "docid": "c42d24e7156de31f63c2ac7f258e10ec", "score": "0.56907606", "text": "function fColaboradorF10(opc,codCol,foco,topo,objeto){\r\n let clsStr = new concatStr();\r\n clsStr.concat(\"SELECT A.PEI_CODFVR AS CODIGO\");\r\n clsStr.concat(\" ,A.PEI_CODPE AS PE\");\r\n clsStr.concat(\" ,DES.FVR_NOME AS COLABORADOR\");\r\n clsStr.concat(\" ,CASE WHEN A.PEI_STATUS='BOM' THEN CAST('BOM' AS VARCHAR(3))\");\r\n clsStr.concat(\" WHEN A.PEI_STATUS='OTI' THEN CAST('OTIMO' AS VARCHAR(5))\"); \r\n clsStr.concat(\" WHEN A.PEI_STATUS='RAZ' THEN CAST('RAZOAVEL' AS VARCHAR(8))\");\r\n clsStr.concat(\" WHEN A.PEI_STATUS='RUI' THEN CAST('RUIM' AS VARCHAR(4))\");\r\n clsStr.concat(\" WHEN A.PEI_STATUS='NSA' THEN CAST('...' AS VARCHAR(3)) END AS STATUS\");\r\n clsStr.concat(\" ,DES.FVR_FONE AS FONE\");\r\n clsStr.concat(\" ,(dbo.fun_CalcDistancia(ORI.CNTE_LATITUDE,ORI.CNTE_LONGITUDE,DES.FVR_LATITUDE,DES.FVR_LONGITUDE)/1000) AS DISTANCIA\");\r\n clsStr.concat(\" ,DES.FVR_APELIDO AS APELIDO\"); \r\n clsStr.concat(\" FROM PONTOESTOQUEIND A\");\r\n clsStr.concat(\" LEFT OUTER JOIN CONTRATOENDERECO ORI ON ORI.CNTE_CODIGO=[codins]\");\r\n clsStr.concat(\" LEFT OUTER JOIN FAVORECIDO DES ON A.PEI_CODFVR=DES.FVR_CODIGO\");\r\n clsStr.concat(\" WHERE A.PEI_CODPE IN('CRD','INS','TRC','CLN','FVR')\");\r\n clsStr.concat(\" AND A.PEI_ATIVO='S'\");\r\n //clsStr.concat(\" ORDER BY 5\");\r\n let tblCol = \"tblCol\";\r\n let divWidth = \"54em\";\r\n let tblWidth = \"52em\";\r\n let codins = \"\";\r\n if( typeof objeto === 'object' ){\r\n for (var key in objeto) {\r\n switch( key ){\r\n case \"codins\": \r\n codins=objeto[key];\r\n break;\r\n case \"divWidth\": \r\n divWidth=objeto[key];\r\n break;\r\n case \"tbl\": \r\n tblCol=objeto[key];\r\n break; \r\n case \"tblWidth\": \r\n tblWidth=objeto[key];\r\n break;\r\n case \"where\" : \r\n clsStr.concat( objeto[key],true);\r\n tblCol = \"tblCol2\"; \r\n break; \r\n }; \r\n }; \r\n };\r\n sql=clsStr.fim();\r\n sql=sql.replaceAll(\"[codins]\",codins);\r\n // console.log(sql);\r\n // \r\n if( opc == 0 ){ \r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdCol=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdCol.Assoc=false;\r\n bdCol.select( sql );\r\n if( bdCol.retorno=='OK'){\r\n var jsColF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,{\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"5em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"}\r\n ,{\"id\":2 ,\"labelCol\":\"PE\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"10em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"}\r\n ,{\"id\":3 ,\"labelCol\":\"COLABORADOR\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"33em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":4 ,\"labelCol\":\"STATUS\" \r\n ,\"funcCor\": \"switch (objCell.innerHTML) { case 'OTIMO':objCell.classList.add('corVerde');break; case 'BOM':objCell.classList.add('corAzul');break; case 'RAZOAVEL':objCell.classList.add('corTitulo');break; case 'RUIM':objCell.classList.add('corAlterado');break; default:objCell.classList.remove('corAlterado');break;};\"\r\n ,\"tipo\":\"edt\" \r\n ,\"tamGrd\":\"8em\" \r\n ,\"fieldType\":\"str\"\r\n ,\"ordenaColuna\":\"N\"} \r\n ,{\"id\":5 ,\"labelCol\":\"FONE\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"0em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"}\r\n ,{\"id\":6 ,\"labelCol\":\"DISTANCIA\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"int\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":7 ,\"labelCol\":\"APELIDO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"0em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"} \r\n ]\r\n ,\"registros\" : bdCol.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblCol // Nome da table\r\n ,\"div\" : \"col\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"prefixo\" : \"col\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"nChecks\" : true // Se permite multiplos registros na grade checados\r\n ,\"qtos\" : 10 //\r\n ,\"tabelaBD\" : \"PRODUTOESTOQUEIND\" // Nome da tabela no banco de dados \r\n ,\"width\" : tblWidth // Tamanho da table\r\n ,\"height\" : \"39em\" // Altura da table\r\n ,\"indiceTable\" : \"*\" // Indice inicial da table\r\n ,\"tamBotao\" : \"20\"\r\n };\r\n if( objColF10 === undefined ){ \r\n objColF10 = new clsTable2017(\"objColF10\");\r\n objColF10.tblF10 = true;\r\n if( (foco != undefined) && (foco != \"null\") ){\r\n objColF10.focoF10=foco; \r\n };\r\n }; \r\n var html = objColF10.montarHtmlCE2017(jsColF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',topo);\r\n ajudaF10.divHeight= '410px'; /* Altura container geral*/\r\n ajudaF10.divWidth = divWidth;\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaCol');\r\n document.getElementById(tblCol).rows[0].cells[6].click();\r\n //delete(ajudaF10);\r\n //delete(objColF10);\r\n };\r\n }; \r\n if( opc == 1 ){\r\n var bdCol=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdCol.Assoc=true;\r\n bdCol.select( sql );\r\n return bdCol.dados;\r\n }; \r\n}", "title": "" }, { "docid": "c596816acaab6bb689142691005264ed", "score": "0.5689707", "text": "function mostarAgricultor(idClicado){\n var envio = {\n metodo: \"GET_POR_ID\",\n idpessoa: idClicado\n };\n\n //chama a requisicao do servidor, o resultado é listado em uma tabela\n requisicao(\"agricultor/buscar\", envio, function(dadosRetorno) {\n// $('#listaDeMembros').empty();\n if(dadosRetorno.sucesso){\n\n\n //chama a funcao que mostra a pagina amostragem\n abrirPageAmostragem('Agricultor', dadosRetorno.data.nome+' '+dadosRetorno.data.sobrenome+'<i class=\"fa fa-user button-icon-right\" data-position=\"top\"></i>', '<div class=\"col single-col\" data-uib=\"layout/col\" data-ver=\"0\"><div class=\"widget-container content-area vertical-col\"><div class=\"tarea widget d-margins\" data-uib=\"media/text\" data-ver=\"0\" ><div class=\"widget-container left-receptacle\"></div><div class=\"widget-container right-receptacle\"></div><div class=\"text-container\"> <p>CPF: '+dadosRetorno.data.cpf+'</p><p class=\"cinza\">RG: '+dadosRetorno.data.rg+'</p><p>Apelido: '+dadosRetorno.data.apelido+'</p><p class=\"cinza\">Data nascimento: '+dadosRetorno.data.datanascimento+'</p><p>Sexo: '+dadosRetorno.data.sexo+'</p><p class=\"cinza\">Telefone1: '+dadosRetorno.data.telefone1+'</p><p>Telefone2: '+dadosRetorno.data.telefone2+'</p><p class=\"cinza\">Email: '+dadosRetorno.data.email+'</p><p>Estado civíl: '+dadosRetorno.data.estadocivil+'</p><p class=\"cinza\">Escolaridade: '+dadosRetorno.data.escolaridade+'</p><p>Qtd integrante(s) na família: '+dadosRetorno.data.qtdintegrantes+'</p><p class=\"cinza\">Qtd crianças: '+dadosRetorno.data.qtdcriancas+'</p><p>Qtd grávidas: '+dadosRetorno.data.qtdgravidas+'</p><hr> </div></div><span class=\"uib_shim\"></span></div></div>');\n\n }else{\n //retira o painel loading\n window.spinnerplugin.hide();\n navigator.notification.alert(dadosRetorno.mensagem, function(){\n iniciarGerenciador();\n },\"Erro!\", \"Sair\");\n\n }\n\n });\n}", "title": "" }, { "docid": "7580963adfc7401a5d9e5280851a8dc3", "score": "0.5688641", "text": "function resultado() {\n console.log(`Se eliminarion todos los nulls de ${contador} entidades.`);\n}", "title": "" }, { "docid": "3092d1f5bbb1156b5882ecaaf12bf8d8", "score": "0.56757605", "text": "function comprobar(){\n\n\tvar check_checkbox=false;\n\tvar check_checkbox2=false;\n\tvar check_radio=false;\n\tvar check_radio2=false;\n\n\tfor (i = 0; i < 4 ; i++) { //\"color\" es el nombre asignado a todos los checkbox\n\t\tif (document.getElementById(\"color_\"+i).checked == true) {\n\t\t\tcheck_checkbox=true;\n\t\t}\t\n\t}\n\tfor (i = 0; i < 4 ; i++) { //\"rad\" es el nombre asignado a todos los radio\n\t\tif (document.getElementById(\"rad_\"+i).checked == true) {\n\t\t\tcheck_radio=true;\n\t\t}\t\n\t}\n\tfor (i = 0; i < 4 ; i++) { \n\t\tif (document.getElementById(\"color2_\"+i).checked == true) {\n\t\t\tcheck_checkbox2=true;\n\t\t}\t\n\t}\n\tfor (i = 0; i < 4 ; i++) { \n\t\tif (document.getElementById(\"rad2_\"+i).checked == true) {\n\t\t\tcheck_radio2=true;\n\t\t}\t\n\t}\n\n\tfunction comprobar_input(nombre_input) {\n\t\tvar valor\n\t\tvar n_pregunta;\n\t\tif (document.getElementById(nombre_input).value ==\"\") { \n\t\t\t\n\t\t\tif (nombre_input==\"num\") {\n\t\t\t\tvalor= \"número\";\n\t\t\t\tn_pregunta = 1;\n\t\t\t}\n\t\t\tif (nombre_input==\"text\") {\n\t\t\t\tvalor= \"texto\";\n\t\t\t\tn_pregunta = 5;\n\t\t\t}\n\t\t\tif (nombre_input==\"num2\") {\n\t\t\t\tvalor= \"número\";\n\t\t\t\tn_pregunta = 6;\n\t\t\t}\n\n\t\t\tif (nombre_input==\"text2\") {\n\t\t\t\tvalor= \"texto\";\n\t\t\t\tn_pregunta = 10;\n\t\t\t}\n\t\t\talert(\"Escribe un \"+valor+\" en la pregunta \"+n_pregunta);\n\t\t\tdocument.getElementById(nombre_input).focus();\n\t\t\treturn false;\n\t\t}\n\t}\n \tif (comprobar_input(\"num\") == false || comprobar_input(\"text\") == false || comprobar_input(\"num2\") == false || comprobar_input(\"text2\") == false ) {\n\t\t\n\t\treturn false;\n\t}\n\telse if (document.getElementById(\"sel\").selectedIndex==0) {\n \t\t\n\t\talert(\"Selecciona una opción de la pregunta 2\"); \n\t\tdocument.getElementById(\"sel\").focus(); \n\t}\n\telse if (document.getElementById(\"sel2\").selectedIndex==0) {\n\n \t\talert(\"Selecciona una opción de la pregunta 7\");\n\t\tdocument.getElementById(\"sel2\").focus();\n \n\t}\n\telse if ( check_checkbox == false){\n\t\talert(\"Selecciona una opción de la pregunta 3\");\n\t\tdocument.getElementById(\"color_0\").focus();\n\t\n\t} \n\telse if ( check_radio == false){\n\t\talert(\"Selecciona una opción de la pregunta 4\");\n\t\tdocument.getElementById(\"rad_0\").focus();\n\t\n\t}\t\n\telse if ( check_checkbox2 == false){\n\t\talert(\"Selecciona una opción de la pregunta 8\");\n\t\tdocument.getElementById(\"color2_0\").focus();\n\t\n\t}\n\telse if ( check_radio2 == false){\n\t\talert(\"Selecciona una opción de la pregunta 9\");\n\t\tdocument.getElementById(\"rad2_0\").focus();\n\t\n\t} else {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "a5b4996e47b98c85d68fc3ba0b27b508", "score": "0.56747735", "text": "function CantidadesMonetarias(){\n\t//VERIFICA SI SE HA INTRODUCIDO UN CARACTER DISTINTO A UN NUMERO\n\tif (event.keyCode != 190 && (event.keyCode < 48 || event.keyCode > 57)){\n\t\t//alert(event.keyCode);\n\t\t//VERIFICA SI SE HA INTRODUCIDO UN CARACTER DISTINTO A UN NUMERO\n\t\tif (event.keyCode < 96 || event.keyCode > 105){\n\t\t\n\t\t\t//TECLA DE BORRADO Y SUPRIMIR\n\t\t\tif (event.keyCode == 8 || event.keyCode == 46){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//TECLAS DE CURSOR IZQUIERDO Y DERECHO\n\t\t\tif (event.keyCode == 37 || event.keyCode == 39){\n\t\t\t\treturn;\n\t\t\t}\t\t\t\n\t\t\t//TECLA TABULADOR\n\t\t\tif (event.keyCode == 9){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//TECLA SHIFT Y ALT\n\t\t\tif (event.keyCode == 16|| event.keyCode == 18){\n\t\t\t\talert(\"TECLA NO PERMITIDA\");\n\t\t\t\tevent.returnValue = false;\n\t\t\t}\n\t\t\t//CUALQUIER OTRA TECLA NO ES PERMITIDA\n\t\t\tevent.returnValue = false;\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "a51e08ab2ace362ce2ec58cd481610df", "score": "0.5674724", "text": "function consultarColaboradores(){\n\n }", "title": "" }, { "docid": "26f86812b9320a581f58bb117c1f7b61", "score": "0.5673035", "text": "function habilitaCamposTipoCancer(miCampo){\n\n\n//el dato no es vacio y está dentro del rango de 1 y 3\n //HABILITAMOS Y DESHABILITAMOS CAMPOS SEGÚN SIVIGILA ESCRITORIO\n\n //variables cáncer cuello uterino\n var miFecTomaE = document.getElementById('FEC_TOMA_E');\n var miFecResEx = document.getElementById('FEC_RES_EX');\n var miBiopExoce = document.getElementById('BIOP_EXOCE');\n var miResBExoc = document.getElementById('RES_B_EXOC');\n var miGradoHist = document.getElementById('GRADO_HIST');\n var miBiopEndoc = document.getElementById('BIOP_ENDOC');\n var miResBAden = document.getElementById('RES_B_ADEN');\n var miResBHist = document.getElementById('RES_B_HIST');\n\n\n\n//variables cáncer de mama\n var miFecProCo = document.getElementById('FEC_PRO_CO');\n var miFecResBi = document.getElementById('FEC_RES_BI');\n var miResBiops9 = document.getElementById('RES_BIOPS9');\n var miGradHisto = document.getElementById('GRAD_HISTO');\n\n //validamos el tipo de cancer para inhabilitar los demás controles\n if(miCampo.value ==1){\n //deshabilitamos campos de cancer de cuello uterino\n miFecTomaE.disabled=true;\n miFecResEx.disabled=true;\n miBiopExoce.disabled=true;\n miResBExoc.disabled=true;\n miGradoHist.disabled=true;\n miBiopEndoc.disabled=true;\n miResBAden.disabled=true;\n miResBHist.disabled=true;\n\n //limpiamos los campos de cancer de cuello uterino\n miFecTomaE.value=\"\";\n miFecResEx.value=\"\";\n miBiopExoce.value=\"\";\n miResBExoc.value=\"\";\n miGradoHist.value=\"\";\n miBiopEndoc.value=\"\";\n miResBAden.value=\"\";\n miResBHist.value=\"\";\n\n\n\n //habilitamos campos de cáncer de mama\n miFecProCo.disabled=false;\n miFecResBi.disabled=false;\n miResBiops9.disabled=false;\n miGradHisto.disabled=false;\n\n\n }\n else if(miCampo.value ==2){\n //deshabilitamos campos de cancer de mama\n miFecProCo.disabled=true;\n miFecResBi.disabled=true;\n miResBiops9.disabled=true;\n miGradHisto.disabled=true;\n\n //limpiamos campos de cancer de mama\n miFecProCo.value=\"\";\n miFecResBi.value=\"\";\n miResBiops9.value=\"\";\n miGradHisto.value=\"\";\n\n //habilitamos campos de cancer de cuello uterino\n miFecTomaE.disabled=false;\n miFecResEx.disabled=false;\n miBiopExoce.disabled=false;\n miResBExoc.disabled=false;\n miGradoHist.disabled=false;\n miBiopEndoc.disabled=false;\n miResBAden.disabled=false;\n miResBHist.disabled=false; \n\n }\n else if(miCampo.value ==3){\n\n //habilitamos campos de cáncer de mama\n miFecProCo.disabled=false;\n miFecResBi.disabled=false;\n miResBiops9.disabled=false;\n miGradHisto.disabled=false;\n //habilitamos campos de cancer de cuello uterino\n miFecTomaE.disabled=false;\n miFecResEx.disabled=false;\n miBiopExoce.disabled=false;\n miResBExoc.disabled=false;\n miGradoHist.disabled=false;\n miBiopEndoc.disabled=false;\n miResBAden.disabled=false;\n miResBHist.disabled=false; \n\n }\n\n\n}", "title": "" }, { "docid": "fe55cdab7c2d85f4a52c4f8470e17018", "score": "0.5671196", "text": "function leerDatosDelCuros(curso){\n// console.log(curso);\n const infoCurso={\n imagen:curso.querySelector('img').src,\n titulo:curso.querySelector('h4').textContent,\n precio:curso.querySelector('span').textContent,\n id:curso.querySelector('a').getAttribute('data-id'),\n cantidad:1\n }\n\n const existe=articuloCarrito.some(curso=>curso.id===infoCurso.id);//recorre el array y compara el id con el id que le estamos pasando\n //si existe dara true, caso contrario falase\n if(existe){\n //actualizar cantidad\n const curso=articuloCarrito.map(curso=>{\n if(curso.id===infoCurso.id){\n curso.cantidad++;\n return curso;//retorna el carrito actualizado\n }else{\n return curso; //retorna el carrito sin actualizar datos\n }\n //siempre debe retornar con map\n });\n\n articuloCarrito=[...curso];\n\n }else{\n //agregar al carrito de forma normal\n articuloCarrito=[...articuloCarrito, infoCurso];//agregamos el curso al array para mostrar en el carrito\n }\n\n // console.log(articuloCarrito)\n carritoHTML(articuloCarrito);\n}", "title": "" }, { "docid": "2926f616d4e4c50e1f7d4e8b60a79679", "score": "0.56652176", "text": "function compruebaCamposExtendido(campos,opciones,formatos){\n\tvar error = false;\n\tvar parametros = \"\";\n\n\t//AGM88X 11-10-2005 Añado el nuevo formato de lista de campos con \"~\"\n\tif ((typeof campos==\"object\") && (campos[0])){\n\t\t//caso de la nueva implementacion en arrays\n\t\tvar lc = campos;\n\t\tvar lo = opciones;\n\t\tvar lf = formatos;\n\t\tfor (var i=0;i<lc.length;i++) {\n\t\t\tif (parametros!=\"\") parametros = parametros+\",\";\n\t\t\tparametros = parametros+\"'\"+lc[i]+\"','\"+lo[i]+\"','\"+lf[i]+\"'\";\n\t\t}\n\t\terror = eval(\"compruebaCampos(\"+parametros+\")\");\n\t\treturn error;\n\t} else {\n\t\t//resto de casos implementados en strings con dos separadores distintos\n\t\tif (campos.indexOf(\"~\")>0){\n\t\t\t//caso de separador con ~\n\t\t\tvar lc = campos.split(\"~\");\n\t\t\tvar lo = opciones.split(\"~\");\n\t\t\tvar lf = formatos.split(\"~\");\n\t\t\tfor (var i=0;i<lc.length;i++) {\n\t\t\t\tif (parametros!=\"\") parametros = parametros+\",\";\n\t\t\t\tparametros = parametros+\"'\"+lc[i]+\"','\"+lo[i]+\"','\"+lf[i]+\"'\";\n\t\t\t}\n\t\n\t\t\terror = eval(\"compruebaCampos(\"+parametros+\")\");\n\t\t\treturn error;\n\t\t} else {\n\t\t\t//sigo con la version antigua: separador con retorno de carro\n\t\t\tvar str = \"\";\n\t\t\tvar str2 = \"\";\n\t\t\tvar str3 = \"\";\n\t\t\n\t\t\tvar sizeCampos = campos.length;\n\t\t\tvar sizeOpciones = opciones.length;\n\t\t\tvar sizeFormatos = formatos.length;\n\t\n\t\t\tvar j = 0;\n\t\t\tvar k=0;\n\t\t\tvar j2 = 0;\n\t\t\tvar k2 = 0;\n\t\t\tvar j3 = 0;\n\t\t\tvar k3 = 0;\n\n\t\t\twhile (k!=-1){\n\t\t\t\tk = campos.indexOf(String.fromCharCode(13,10),j);\n\t\t\t\tk2 = opciones.indexOf(String.fromCharCode(13,10),j2);\n\t\t\t\tk3 = formatos.indexOf(String.fromCharCode(13,10),j3);\n\t\t\t\tif (k!=-1){\n\t\t\t\t\tstr = campos.substr(j,k-j);\n\t\t\t\t\tj=k+2;\n\t\t\t\t} else if (j<sizeCampos){\n\t\t\t\t\tstr = campos.substr(j);\n\t\t\t\t}\n\t\t\n\t\t\t\tif (k2!=-1){\n\t\t\t\t\tstr2 = opciones.substr(j2,k2-j2);\n\t\t\t\t\tj2=k2+2;\n\t\t\t\t} else if (j2<sizeOpciones){\n\t\t\t\t\tstr2 = opciones.substr(j2);\n\t\t\t\t}\n\t\t\n\t\t\t\tif (k3!=-1){\n\t\t\t\t\tstr3 = formatos.substr(j3,k3-j3);\n\t\t\t\t\tj3=k3+2;\n\t\t\t\t} else if (j3<sizeFormatos){\n\t\t\t\t\tstr3 = formatos.substr(j3);\n\t\t\t\t}\n\t\t\n\t\t\t\tif (parametros==\"\") parametros = parametros+\"'\"+str+\"','\"+str2+\"','\"+str3+\"'\";\n\t\t\t\telse parametros = parametros+\",'\"+str+\"','\"+str2+\"','\"+str3+\"'\";\n\t\t\t}\n\t\n\t\t\terror = eval(\"compruebaCampos(\"+parametros+\")\");\n\t\t\treturn error;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cea514d972020e39a617379df9456685", "score": "0.56616443", "text": "function CompruebaJugada(tablero, ficha) \n{\n var x, y\n //comprueba filas\n for(x = 0; x < 9; x += 3) \n {\n if ((tablero.elements[x].value == ficha) && (tablero.elements[x + 1].value == ficha))\n if (tablero.elements[x + 2].value == \"\")\n return (x + 2)\n if ((tablero.elements[x].value == ficha) && (tablero.elements[x + 2].value == ficha))\n if (tablero.elements[x + 1].value == \"\")\n return (x + 1)\n if ((tablero.elements[x + 1].value == ficha) && (tablero.elements[x + 2].value == ficha))\n if (tablero.elements[x].value == \"\")\n return (x)\n }\n //comprueba columnas\n for(x = 0; x < 3; x++) \n {\n if ((tablero.elements[x].value == ficha) && (tablero.elements[x + 3].value == ficha))\n if (tablero.elements[x + 6].value == \"\")\n return (x + 6)\n if ((tablero.elements[x].value == ficha) && (tablero.elements[x + 6].value == ficha))\n if (tablero.elements[x + 3].value == \"\")\n return (x + 3)\n if ((tablero.elements[x + 3].value == ficha) && (tablero.elements[x + 6].value == ficha))\n if (tablero.elements[x].value == \"\")\n return (x)\n }\n //comprueba las diagonales\n if ((tablero.elements[2].value == ficha) && (tablero.elements[4].value == ficha) && (tablero.elements[6].value == \"\"))\n return (6)\n if ((tablero.elements[2].value == ficha) && (tablero.elements[4].value == \"\") && (tablero.elements[6].value == ficha))\n return (4)\n if ((tablero.elements[2].value == \"\") && (tablero.elements[4].value == ficha) && (tablero.elements[6].value == ficha))\n return (2)\n if ((tablero.elements[0].value == ficha) && (tablero.elements[4].value == ficha) && (tablero.elements[8].value == \"\"))\n return (8)\n if ((tablero.elements[0].value == ficha) && (tablero.elements[4].value == \"\") && (tablero.elements[8].value == ficha))\n return (4)\n if ((tablero.elements[0].value == \"\") && (tablero.elements[4].value == ficha) && (tablero.elements[8].value == ficha))\n return (0)\n return -1\n}", "title": "" }, { "docid": "7f8aa46cc31f6cedcb2a2166d83169c8", "score": "0.56609493", "text": "function leerDatosCurso(curso) {\r\n //console.log(curso);\r\n //crear objeto con el contenido del seleccionado\r\n\r\n const infoCurso = {\r\n imagen: curso.querySelector('img').src,\r\n /*** como ya tengo seleccionado el boton pulsado genero un obj con sus datos para despues cargarlos */\r\n titulo: curso.querySelector('h4').textContent,\r\n /***para leer el contenido de una etiqueta html */\r\n precio: curso.querySelector('.precio span').textContent,\r\n /***se puede seleccionar asi que es adentro la clase precio una etiqueta span o directamente la clase u-pull-right */\r\n id: curso.querySelector('a').getAttribute('data-id'),\r\n cantidad: 1\r\n\r\n }\r\n //revisa si un elemento ya exista\r\n //.some itera sobre un array de objeto y verifica si un elemento existe\r\n const existe = articulosCarrito.some(curso => curso.id === infoCurso.id)\r\n if (existe) {\r\n const cursos = articulosCarrito.map(curso => {\r\n if (curso.id === infoCurso.id) {\r\n curso.cantidad++;\r\n return curso;\r\n } else {\r\n return curso;\r\n }\r\n\r\n }) /***.map crea un nuevo array a partir de otro */\r\n articulosCarrito = [...cursos];\r\n } else {\r\n //agrega elementos al arreglo\r\n articulosCarrito = [...articulosCarrito, infoCurso]; ////hago una copia del obj articulos con ...art y despues le voy agregando infocurso tambien se puede hacer con push\r\n\r\n }\r\n\r\n mostrarHTML();\r\n}", "title": "" }, { "docid": "79c1f4d4abbe762bba1faeb9912eed1b", "score": "0.5658718", "text": "function comprobarAddTitulacion() {\n\n var codTitulacion; /*variable que representa el elemento codTitulacion del formulario add */\n var codCentro; /*variable que representa el elemento codCentro del formulario add */\n var nombreTitulacion; /*variable que representa el elemento nombreTitulacion del formulario add */\n var responsableTitulacion; /*variable que representa el elemento responsableTitulacion del formulario add */\n\n\n codTitulacion = document.forms['ADD'].elements[0];\n codCentro = document.forms['ADD'].elements[1];\n nombreTitulacion = document.forms['ADD'].elements[2];\n responsableTitulacion = document.forms['ADD'].elements[3];\n\n /*Comprueba si codTitulacion es vacio, retorna false*/\n if (!comprobarVacio(codTitulacion)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codTitulacion.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codTitulacion, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio\n }//fin comprobar vacio \t\n \n /*Comprueba si codCentro es vacio, retorna false*/\n if (!comprobarVacio(codCentro)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n //Comprobamos que no hay espacio s intermedios\n if (!/[\\s]/.test(codCentro.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codCentro, 10)) {\n return false;\n }//comprobar texto \t\t\t\n }//comprobar espacio\n }//comprobar vacio\n\n /*Comprueba si nombreTitulacion es vacio, retorna false*/\n if (!comprobarVacio(nombreTitulacion)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene carácteres no alfanuméricos, si es así, retorna false */\n if (!comprobarAlfabetico(nombreTitulacion, 50)) {\n return false;\n } //fin comprobar alfabetico\n }//fin comprobar vacio\n\n /*Comprueba si responsableTitulacion es vacio, retorna false*/\n if (!comprobarVacio(responsableTitulacion)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene carácteres no alfanuméricos, si es así, retorna false */\n if (!comprobarAlfabetico(responsableTitulacion, 60)) {\n return false;\n } //fin comprobacion alfabetico\n } //fin comprobacion vacio\n return true;\n } //fin add titulacion", "title": "" }, { "docid": "94e2a01886caaac93ca63dee496c5b14", "score": "0.5651117", "text": "function agregaComentario(comentario, user_name, user_id){\n\tvar l2 = '';\n\tvar l1 = '';\n\tvar l8 = '';\n\n\n// Validamos si el usuario acaba de agregar el comentario o estamos leyendo todos\nif (user_name != undefined){\n\tnombre = user_name\n\t// Como el usuario conectado acaba de crear el comentario entonces el lo puede eliminar\n\tl2 = \t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"mandaEliminarComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Elimina tu comentario\">'+\n\t\t\t\t'<span class=\"text-danger glyphicon glyphicon-trash\"></span></button>';\n}\nelse{\n\tnombre = comentario._creador.name\n\t// Valido que el usario conectado haya creado el comentario xD\n\tif (user_id == comentario._creador._id){\n\t\tl2 = \t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"mandaEliminarComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Elimina tu comentario\">'+\n\t\t\t\t\t'<span class=\"text-danger glyphicon glyphicon-trash\"></span></button>';\n\t}\t\n}\n// Comprobamos que el que creo el articulo es que esta comentando o sea que el vendedor comente su articulo xD\nif (comentario._articulo._creador == comentario._creador._id){\n\tl1 = '<div id=\"'+comentario._id+'\" class=\"panel panel-default comentarioVendedor\"><div class=\"panel-body\">'+\n\t\t\t\t'<div class=\"col-lg-2\">'+\n\t\t\t\t\t'<p class=\"text-primary\">';\n}else{\n\tl1 = '<div id=\"'+comentario._id+'\" class=\"panel panel-default\"><div class=\"panel-body\">'+\n\t\t\t'<div class=\"col-lg-2\">'+\n\t\t\t\t'<p class=\"text-primary\">';\n}\nvar positivos = 0;\nvar negativos = 0;\nvar yaCalifico = false;\n$.each(comentario.calificacion, function(index, calificacion){\n\tif (calificacion.calificacion == true)\n\t\tpositivos++;\n\telse\n\t\tnegativos++;\n\tif (calificacion.usuario == user_id)\n\t\tyaCalifico = true\n\n});\n\n\nif (yaCalifico == true){\n\t\tl8 =\t'<button id=\"'+comentario._id+'btn-negativos\" class=\"pull-right btn btn-default btn-xs\" disabled rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota negativo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'negativos\" class=\"text-danger glyphicon glyphicon-minus\">'+negativos+'</span></button>'+\n\t\t\t\t'<button id=\"'+comentario._id+'btn-positivos\" class=\"pull-right btn btn-default btn-xs\" disabled rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota positivo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'positivos\" class=\"text-success glyphicon glyphicon-ok\">'+positivos+'</span></button>';\n}else{\n\t\tl8 =\t'<button id=\"'+comentario._id+'btn-negativos\" class=\"pull-right btn btn-default btn-xs\" onclick=\"calificaComentario(\\''+comentario._id+'\\', false)\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota negativo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'negativos\" class=\"text-danger glyphicon glyphicon-minus\">'+negativos+'</span></button>'+\n\t\t\t\t'<button id=\"'+comentario._id+'btn-positivos\" class=\"pull-right btn btn-default btn-xs\" onclick=\"calificaComentario(\\''+comentario._id+'\\', true)\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota positivo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'positivos\" class=\"text-success glyphicon glyphicon-ok\">'+positivos+'</span></button>';\n}\n\n\nfecha = new Date(comentario.fecha_creacion);\n\tl1 = l1\n\tl2 = l2\nvar l3 =\t\t\t'<strong>'+nombre+':</strong><br>';\nvar l4 =\t\t\t'<small class=\"text-muted\">'+fecha.toLocaleString()+'</small>';\nvar l5 =\t\t'</p>';\nvar l6 =\t'</div>';\nvar l7 =\t'<div class=\"col-lg-10\">';\n\tl8 = l8\nvar l9 = \t\t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"respondeComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Responde a este comentario\">'+\n\t\t\t\t\t'<span class=\"text-primary glyphicon glyphicon-comment\"></span></button>';\nvar l10 =\t\t'<small id=\"wordwrap\">'+comentario.comentario+' </small>';\nvar l11 =\t'</div>';\nvar l12 = '</div></div><div id=\"'+comentario._id+'respuestas\" class=\"col-lg-offset-1\"></div>';\n\nvar comentarioHTML = l1+l2+l3+l4+l5+l6+l7+l8+l9+l10+l11+l12;\nif (comentario.respuesta != undefined){\n\tif ( $('#'+comentario.respuesta+'respuestas').length ) {\n\t\t$('#'+comentario.respuesta+'respuestas').append(comentarioHTML);\n\t}else{\n\t\t$('#mostrarComentarios').prepend(comentarioHTML);\n\t}\n}else{\n\t$('#mostrarComentarios').prepend(comentarioHTML);\n}\n\n\n}", "title": "" }, { "docid": "fcc9be1dc6a0b5d14d708a6ffa09c5ab", "score": "0.56508964", "text": "function limpiar(){\n\tx = \"0\";\t\t\t\t\t\t\t//\twe update to 0 value and will be shown in the screen\n\tcoma = 0;\t\t\t\t\t\t\t//\tthe coma state is restarted\n\tni = 0;\t\t\t\t\t\t\t\t//\tthe hidden number or the first saved number is deleted\n\top = \"no\";\t\t\t\t\t\t\t//\tthe current operation is deleted\n\tdisplay.value = x;\t\t\t\t\t//\tthe 0 value is displayed in the screen\n\t\n\t//\tAll operation buttons will turn to initial background color\n\tsuma.style.backgroundColor = '#000000';\n\tresta.style.backgroundColor = '#000000';\n\tproducto.style.backgroundColor = '#000000';\n\tcociente.style.backgroundColor = '#000000';\n\t\n\t//\tAll value fields will become empty and the submit button will be disabled\n\tvalor_a.value = \"\";\n\tvalor_b.value = \"\";\n\toperacion.value = \"\";\n\tresult.value = \"\";\n\tsubmit.disabled = true;\n}", "title": "" }, { "docid": "f45eed09dda1cfd4d44728cc4baee120", "score": "0.5649342", "text": "function mostrar()\n{\n\tlet cantidad;\n\tlet fabricante;\n\tlet marca;\n\tlet precio;\n\tlet tipo;\n\tlet acumuladorAlcohol = 0;\n\tlet acumuladorBarbijo = 0;\n\tlet acumuladorJabon = 0;\n\tlet cantidadAlcoholBarato;\n\tlet contBarbijo = 0;\n\tlet contAlcohol = 0;\n\tlet contJabon = 0;\n\tlet fabricanteAlcohoBarato;\n\tlet mayorTipo;\n\tlet precioAlcoholBarato;\n\tlet promedioCompra;\n\tlet flagAlcohol = 0;\n\tlet mensajeAlcohol = \"No se compraron alcoholes\";\n\tlet mensajeB;\n\tlet mensajeJ;\n\n\tfor(let i = 0; i < 5; i++){\n\n\t\ttipo = prompt('Ingrese tipo \"barbijo, \"jabon\" o \"alcohol: \"');\n\t\twhile(tipo != \"barbijo\" && tipo != \"jabon\" && tipo != \"alcohol\"){\n\t\t\ttipo = prompt('Tipo inválido. Ingrese tipo \"barbijo, \"jabon\" o \"alcohol: \"');\n\t\t}\n\t\tprecio = parseFloat(prompt(\"Ingrese precio $(100-300)\"));\n\t\twhile(precio < 100 || precio > 300 || isNaN(precio)){\n\t\t\tprecio = parseFloat(prompt(\"Precio inválido. Ingrese precio $(100-300)\"));\n\t\t}\n\t\tcantidad = parseInt(prompt(\"Ingrese cantidad. Máximo 1000\"));\n\t\twhile(!(cantidad > 0 || cantidad <= 1000)){\n\t\t\tcantidad = parseFloat(prompt(\"Cantidad inválida. Ingrese cantidad. Máximo 1000\"));\n\t\t}\n\t\tmarca = prompt(\"Ingrese marca: \");\n\t\tfabricante = prompt(\"Ingrese fabricante\");\n\t\t\n\t\tswitch(tipo){\n\t\t\tcase \"alcohol\":\n\t\t\t\tacumuladorAlcohol += cantidad;\n\t\t\t\tcontAlcohol++;\n\n\t\t\t\tif(flagAlcohol == 0 || precioAlcoholBarato > precio){\n\t\t\t\t\tprecioAlcoholBarato = precio;\n\t\t\t\t\tcantidadAlcoholBarato = cantidad;\n\t\t\t\t\tfabricanteAlcohoBarato = fabricante;\n\t\t\t\t\tflagAlcohol = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"barbijo\":\n\t\t\t\tacumuladorBarbijo += cantidad;\n\t\t\t\tcontBarbijo++;\n\t\t\t\tbreak;\n\t\t\tcase \"jabon\":\n\t\t\t\tacumuladorJabon += cantidad;\n\t\t\t\tcontJabon++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(acumuladorAlcohol > acumuladorBarbijo && acumuladorAlcohol > acumuladorJabon){\n\t\tmayorTipo = \"Alcohol\";\n\t\tpromedioCompra = acumuladorAlcohol / contAlcohol;\n\t}\n\telse if(acumuladorBarbijo >= acumuladorAlcohol && acumuladorBarbijo > acumuladorJabon){\n\t\tmayorTipo = \"Barbijo\";\n\t\tpromedioCompra = acumuladorBarbijo / contBarbijo;\n\t}\n\telse{\n\t\tmayorTipo = \"Jabon\";\n\t\tpromedioCompra = acumuladorJabon / contJabon;\n\t}\n\n\tif(flagAlcohol == 1){\n\t\tmensajeAlcohol = \"Fabricante alcohol barato: \" + fabricanteAlcohoBarato + \n\t\t\"\\nCantidad: \" + cantidadAlcoholBarato + \n\t\t\"\\nPrecio: \" + precioAlcoholBarato;\n\t}\n\tmensajeB = \"B- Tipo con más unidades: \" + mayorTipo + \" Promedio\" + promedioCompra;\n\tmensajeJ = C- \"Unidades de jabon: \" + acumuladorJabon;\n\n\talert(mensajeAlcohol + \"\\n\" + mensajeB + \"\\n\" + mensajeJ);\n}", "title": "" }, { "docid": "6bb70431f432805729e426991aee741d", "score": "0.5645729", "text": "cargaArbolLista(){\n if(this.raiz ==null){\n console.log(\"No existe arbol\")\n return\n }\n let nodo = this.raiz\n this.cargandoArbolLista(nodo)\n }", "title": "" }, { "docid": "73ef24f6e79b636973a8909e6bdc2b24", "score": "0.564515", "text": "compterNoeud(){\n let noeud = this.racine\n var compte=0;\n if(noeud==null){return 0}\n else{\n compte++\n const compterFils = function(noeud){\n if(noeud.gauche!=null || noeud.droite!=null){\n return compterFils(noeud.gauche)+compterFils(noeud.droite)\n }\n return compte;\n }\n return compterFils(noeud)\n }\n }", "title": "" }, { "docid": "6e89ab2a370df6cf4c526cac2db1faf7", "score": "0.56427675", "text": "function pendu(mot) {\r\n let motPendu = [];\r\n let vide = [];\r\n let lettresTentees = [];\r\n let nombreVies = 6;\r\n let joueurs = [];\r\n let nombreJoueurs = +prompt(\"combien de joueurs ?\"); // Nombre des joueurs\r\n let joueurActuel;\r\n\r\n for (let i = 0; i <= nombreJoueurs; i++) {\r\n joueurs.push(i);\r\n }\r\n joueurActuel = joueurs[1]; // introduire dans une variable le joueur actuel\r\n\r\n for (let i = 0; i < mot.length; i++) {\r\n motPendu.push(mot[i]);\r\n vide.push(\"_\");\r\n }\r\n\r\n confirm(\"joueur \" + joueurActuel + \" c'est parti !\");\r\n\r\n while (String(vide) != String(motPendu)) {\r\n //a défaut d'avoir un autre moyen de comparer les listes\r\n\r\n let lettre = prompt(\r\n `le mot a trouver est: ${vide} \\n entrez, vous avez déja essayé: ${lettresTentees} \\n nombre de vies : ${nombreVies}`\r\n ).toLowerCase();\r\n\r\n if (lettre == null) {\r\n confirm(\"Vous avez arrêter la partie\");\r\n break;\r\n }\r\n\r\n let trouve = false;\r\n\r\n if (verifie(lettre)) {\r\n lettresTentees.push(lettre);\r\n for (let i = 0; i < motPendu.length; i++) {\r\n if (lettre == motPendu[i]) {\r\n vide[i] = motPendu[i];\r\n trouve = true;\r\n }\r\n }\r\n if (trouve == false) {\r\n nombreVies -= 1;\r\n joueurActuel += 1; // Quand le joueur se trompe, c'est le tour du suivant\r\n if (joueurActuel === joueurs.length) {\r\n joueurActuel = joueurs[1];\r\n }\r\n\r\n if (nombreVies == 0) {\r\n alert(`perdu, le mot a trouver etait: ${mot}`);\r\n break;\r\n }\r\n\r\n confirm(\"Joueur \" + joueurActuel + \" c'est à toi !\");\r\n }\r\n\r\n trouve = false;\r\n if (String(vide) == String(motPendu)) {\r\n alert(\r\n \"Bravo! Joueur \" + joueurActuel + ` le mot a trouver etait: ${mot}`\r\n );\r\n break;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "401c14724d565fc174dab5226dd9f1ce", "score": "0.56416565", "text": "function dibujarConexiones(){\n var nod = 0;\n var l = figs.length; //Obtenemos la cantidad de objetos que hay en el canvas\n var aux = l-1;\n //Verificamos en la cola cuales tienen conexion\n for(aux = l-1; aux >= 0; aux--){\n if(figs[aux].arriba != -1&&figs[aux].nombre != \"Condicional\"){\n //Si tiene conexion arriba hacia alguna figura\n mySel = aux; //Asignamos la seleccion\n CoodenadasRedimSelectConexiones(); //Sacamos sus cuadros auxiliares\n mySel2 = mySel; //Lo pasamos al segundo objeto\n //Ponemos las coordenadas de los cuadros auxiliares del primera seleccion\n coorCuadritoAntesX = cuadrosX1[1];\n coorCuadritoAntesY = cuadrosY1[1];\n mySelCuadro = figs[aux].arribaRef; //Obtenemos al nodo que esta referenciado\n mySel = figs[aux].arriba; //Obtenemos la figura\n mySelCuadro2 = 1; //Sabemos que el nodo es el de arriba del primer seleccionado\n esSegundo = true; //Habilitamos la bandera para poder obtener los cuadros auxiliares del segundo objeto\n CoodenadasRedimSelectConexiones(); //Obtenemos las coordenadas\n //Dibujamos la flecha dependiendo del nodo 2\n switch(figs[aux].arribaRef){\n case 1:\n dibujarFlecha(\"abajo\");\n break;\n case 4:\n dibujarFlecha(\"izquierda\");\n break;\n case 3:\n dibujarFlecha(\"derecha\");\n break;\n case 6:\n dibujarFlecha(\"arriba\");\n break;\n default:\n break;\n }\n }\n if(figs[aux].der != -1){\n //Si tiene conexion hacia la derecha alguna figura\n mySel = aux; //Asignamos la seleccion\n CoodenadasRedimSelectConexiones(); //Sacamos sus cuadros auxiliares\n mySel2 = mySel; //Lo pasamos al segundo objeto\n //Ponemos las coordenadas de los cuadros auxiliares del primera seleccion\n coorCuadritoAntesX = cuadrosX1[4];\n coorCuadritoAntesY = cuadrosY1[4];\n mySelCuadro = figs[aux].derRef; //Obtenemos al nodo que esta referenciado\n mySel = figs[aux].der; //Obtenemos la figura\n mySelCuadro2 = 4; //Sabemos que el nodo es el de la derecha del primer seleccionado\n esSegundo = true; //Habilitamos la bandera para poder obtener los cuadros auxiliares del segundo objeto\n CoodenadasRedimSelectConexiones(); //Obtenemos las coordenadas\n //Dibujamos la flecha dependiendo del nodo 2\n switch(figs[aux].derRef){\n case 1:\n dibujarFlecha(\"abajo\");\n break;\n case 4:\n dibujarFlecha(\"izquierda\");\n break;\n case 3:\n dibujarFlecha(\"derecha\");\n break;\n case 6:\n dibujarFlecha(\"arriba\");\n break;\n default:\n break;\n }\n }\n if(figs[aux].abajo != -1){\n //Si tiene conexion hacia abajo alguna figura\n mySel = aux; //Asignamos la seleccion\n CoodenadasRedimSelectConexiones(); //Sacamos sus cuadros auxiliares\n mySel2 = mySel; //Lo pasamos al segundo objeto\n //Ponemos las coordenadas de los cuadros auxiliares del primera seleccion\n coorCuadritoAntesX = cuadrosX1[6];\n coorCuadritoAntesY = cuadrosY1[6];\n mySelCuadro = figs[aux].abajoRef; //Obtenemos al nodo que esta referenciado\n mySel = figs[aux].abajo; //Obtenemos la figura\n mySelCuadro2 = 6; //Sabemos que el nodo es el de abajo del primer seleccionado\n esSegundo = true; //Habilitamos la bandera para poder obtener los cuadros auxiliares del segundo objeto\n CoodenadasRedimSelectConexiones(); //Obtenemos las coordenadas\n //Dibujamos la flecha dependiendo del nodo 2\n switch(figs[aux].abajoRef){\n case 1:\n dibujarFlecha(\"abajo\");\n break;\n case 4:\n dibujarFlecha(\"izquierda\");\n break;\n case 3:\n dibujarFlecha(\"derecha\");\n break;\n case 6:\n dibujarFlecha(\"arriba\");\n break;\n default:\n break;\n }\n }\n if(figs[aux].izq != -1&&figs[aux].nombre != \"Condicional\"){\n //Si tiene conexion hacia la izquierda alguna figura\n mySel = aux; //Asignamos la seleccion\n CoodenadasRedimSelectConexiones(); //Sacamos sus cuadros auxiliares\n mySel2 = mySel; //Lo pasamos al segundo objeto\n //Ponemos las coordenadas de los cuadros auxiliares del primera seleccion\n coorCuadritoAntesX = cuadrosX1[3];\n coorCuadritoAntesY = cuadrosY1[3];\n mySelCuadro = figs[aux].izqRef; //Obtenemos al nodo que esta referenciado\n mySel = figs[aux].izq; //Obtenemos la figura\n mySelCuadro2 = 3; //Sabemos que el nodo es el de abajo del primer seleccionado\n esSegundo = true; //Habilitamos la bandera para poder obtener los cuadros auxiliares del segundo objeto\n CoodenadasRedimSelectConexiones(); //Obtenemos las coordenadas\n //Dibujamos la flecha dependiendo del nodo 2\n switch(figs[aux].izqRef){\n case 1:\n dibujarFlecha(\"abajo\");\n break;\n case 4:\n dibujarFlecha(\"izquierda\");\n break;\n case 3:\n dibujarFlecha(\"derecha\");\n break;\n case 6:\n dibujarFlecha(\"arriba\");\n break;\n default:\n break;\n }\n }\n }\n esSeleccionado2 = false;\n esSeleccionado = false;\n mySel = -1;\n mySel2 = -1;\n mySelCuadro = -1;\n mySelCuadro2 = -1;\n}", "title": "" }, { "docid": "cf13b4c65a37ed9a01950e7d1925b74c", "score": "0.5641473", "text": "function buscarDatosContrato() {\n if (contrato != '') {\n var dataEnviar = {\n \"tipe\": 3,\n \"contrato\": contrato,\n \"tipoContrato\": tipoContrato,\n \"estatus\": estatus\n };\n $.ajax({\n type: \"POST\",\n url: '../../../com.Mexicash/Controlador/Desempeno/busquedaDesempeno.php',\n data: dataEnviar,\n dataType: \"json\",\n success: function (datos) {\n $(\"#idContratoBusqueda\").val(contrato);\n for (i = 0; i < datos.length; i++) {\n var FechaEmp = datos[i].FechaEmp;\n var FechaVenConvert = datos[i].FechaVenConvert;\n var FechaVenc = datos[i].FechaVenc;\n var FechaEmpConvert = datos[i].FechaEmpConvert;\n var FechaAlm = datos[i].FechaAlm;\n var PlazoDesc = datos[i].PlazoDesc;\n var TasaDesc = datos[i].TasaDesc;\n var AlmacDesc = datos[i].AlmacDesc;\n var SeguDesc = datos[i].SeguDesc;\n var IvaDesc = datos[i].IvaDesc;\n var DiasContrato = datos[i].Dias;\n var TotalPrestamo = datos[i].TotalPrestamo;\n var TotalInteresPrestamo = datos[i].TotalInteresPrestamo;\n var Abono = datos[i].Abono;\n var Descuento = datos[i].Descuento;\n var FechaAbono = datos[i].FechaAbono;\n var DiasAlmoneda = datos[i].DiasAlmoneda;\n var PolizaSeguro = datos[i].PolizaSeguro;\n var GPS = datos[i].GPS;\n var Pension = datos[i].Pension;\n var fechaHoy = new Date();\n var diasForInteres = 0;\n\n //SE obtienen los intereses en porcentajes\n IvaDesc = \"0.\" + IvaDesc;\n TasaDesc = parseFloat(TasaDesc);\n AlmacDesc = parseFloat(AlmacDesc);\n SeguDesc = parseFloat(SeguDesc);\n IvaDesc = parseFloat(IvaDesc);\n DiasContrato = parseInt(DiasContrato);\n TotalPrestamo = parseFloat(TotalPrestamo);\n TotalInteresPrestamo = parseFloat(TotalInteresPrestamo);\n var FechaVencFormat = formatStringToDate(FechaVenConvert);\n var FechaEmpFormat = formatStringToDate(FechaEmpConvert);\n var fechaHoyText = fechaFormato();\n var diasMoratorios = 0;\n var diasInteresMor = 0;\n\n // Dias trasncurridos\n if (Abono == null) {\n if (FechaEmpConvert == fechaHoyText) {\n //Si la fecha es igual el dia de interes generado es 1\n diasForInteres = 1;\n } else {\n //Si la fecha es menor que hoy el dia de interes generado es el total -1\n var diasdif = fechaHoy.getTime() - FechaEmpFormat.getTime();\n diasForInteres = Math.round(diasdif / (1000 * 60 * 60 * 24));\n }\n } else {\n var FechaAbonoFormat = formatStringToDate(FechaAbono);\n if (FechaAbono == fechaHoyText) {\n //Si la fecha es igual el dia de interes generado es 1\n diasForInteres = 1;\n } else {\n var diasdif = fechaHoy.getTime() - FechaAbonoFormat.getTime();\n diasForInteres = Math.round(diasdif / (1000 * 60 * 60 * 24));\n }\n }\n\n // Dias trasncurridos con dias moratorios\n if (FechaVencFormat < fechaHoy) {\n diasMoratorios = diasForInteres - DiasContrato;\n diasForInteres = diasForInteres - diasMoratorios;\n }\n\n //Plazo\n if (DiasContrato == 30) {\n PlazoDesc = PlazoDesc + \" Mensual\";\n } else if (DiasContrato == 1) {\n PlazoDesc = PlazoDesc + \" Diario\";\n }\n\n\n if (Abono == '' || Abono == null) {\n Abono = 0.00;\n }\n if (Descuento == '' || Descuento == null) {\n Descuento = 0.00;\n }\n $(\"#idDescuentoAnterior\").val(Descuento);\n var nuevaFechaVencimiento = sumarDias(DiasContrato);\n var nuevaFechaAlm = calcularDiasAlmoneda(DiasContrato, DiasAlmoneda)\n $(\"#idNuevaFechaVenc\").val(nuevaFechaVencimiento);\n $(\"#idNuevaFechaAlm\").val(nuevaFechaAlm);\n //INTERES DIARIO\n //Se saca los porcentajes mensuales\n var calculaInteres = Math.floor(TotalPrestamo * TasaDesc) / 100;\n var calculaALm = Math.floor(TotalPrestamo * AlmacDesc) / 100;\n var calculaSeg = Math.floor(TotalPrestamo * SeguDesc) / 100;\n var calculaIva = Math.floor(TotalPrestamo * IvaDesc) / 100;\n\n var totalInteres = calculaInteres + calculaALm + calculaSeg + calculaIva;\n //interes por dia\n var interesDia = totalInteres / DiasContrato;\n //TASA:\n var tasaIvaTotal = TasaDesc + AlmacDesc + SeguDesc + IvaDesc;\n\n\n //Porcentajes por dia\n var diaInteres = calculaInteres / DiasContrato;\n var diaAlm = calculaALm / DiasContrato;\n var diaSeg = calculaSeg / DiasContrato;\n var diaIva = calculaIva / DiasContrato;\n //INTERES:\n var totalVencInteres = diaInteres * diasForInteres;\n\n //ALMACENAJE\n var totalVencAlm = diaAlm * diasForInteres;\n\n //SEGURO\n var totalVencSeg = diaSeg * diasForInteres;\n\n //MORATORIOS\n diasInteresMor = diasMoratorios * interesDia;\n //IVA\n var totalVencIVA = diaIva * diasForInteres;\n\n var gpsSumarAInteres = 0.00;\n var pensionSumarAInteres = 0.00;\n var polizaSumarAInteres = 0.00;\n //Si es auto\n if (tipeFormulario == 2 || tipeFormulario == 4) {\n if (PolizaSeguro == '' || PolizaSeguro == null) {\n PolizaSeguro = 0.00;\n }\n if (GPS == '' || GPS == null) {\n GPS = 0.00;\n }\n if (Pension == '' || Pension == null) {\n Pension = 0.00;\n }\n var gpsDiario = GPS / DiasContrato;\n var pensionDiario = Pension / DiasContrato;\n var polizaDiario = PolizaSeguro / DiasContrato;\n\n var gpsInteresDiario = gpsDiario * diasForInteres;\n var pensionInteresDiario = pensionDiario * diasForInteres;\n var polizaInteresDiario = polizaDiario * diasForInteres;\n\n var gpsInteresMoratorio = gpsDiario * diasMoratorios;\n var pensionInteresMoratorio = pensionDiario * diasMoratorios;\n var polizaInteresMoratorio = polizaDiario * diasMoratorios;\n\n var gpsInteresFinal = gpsInteresDiario + gpsInteresMoratorio;\n var pensionInteresFinal = pensionInteresDiario + pensionInteresMoratorio;\n var polizaInteresFinal = polizaInteresDiario + polizaInteresMoratorio;\n\n gpsSumarAInteres = gpsInteresFinal;\n pensionSumarAInteres = pensionInteresFinal;\n polizaSumarAInteres = polizaInteresFinal;\n\n GPS = formatoMoneda(GPS);\n Pension = formatoMoneda(Pension);\n PolizaSeguro = formatoMoneda(PolizaSeguro);\n document.getElementById('idGPSTDDes').innerHTML = GPS;\n document.getElementById('idPensionTDDes').innerHTML = Pension;\n document.getElementById('idPolizaTDDes').innerHTML = PolizaSeguro;\n $(\"#idGPSNota\").val(formatoMoneda(gpsInteresFinal));\n $(\"#idPolizaNota\").val(formatoMoneda(pensionInteresFinal));\n $(\"#idPensionNota\").val(formatoMoneda(polizaInteresFinal));\n }\n\n //INTERES TABLA\n var interesGenerado = totalVencInteres + totalVencAlm + totalVencSeg + diasInteresMor + totalVencIVA\n //Mas auto\n + gpsSumarAInteres + pensionSumarAInteres + polizaSumarAInteres;\n\n\n interesGenerado = Math.round(interesGenerado * 100) / 100;\n TotalPrestamo = Math.round(TotalPrestamo * 100) / 100;\n diasInteresMor = Math.round(diasInteresMor * 100) / 100;\n var TotalFinal = TotalPrestamo + interesGenerado;\n $(\"#idInteresAbono\").val(interesGenerado);\n $(\"#idPrestamoAbono\").val(TotalPrestamo);\n $(\"#idTotalInput\").val(TotalFinal);\n totalFinal = TotalFinal;\n $(\"#idTotalFinalInput\").val(TotalFinal);\n $(\"#idInteresPendiente\").val(interesGenerado);\n\n\n interesDia = formatoMoneda(interesDia);\n totalVencInteres = formatoMoneda(totalVencInteres);\n totalVencAlm = formatoMoneda(totalVencAlm);\n totalVencSeg = formatoMoneda(totalVencSeg);\n diasInteresMor = formatoMoneda(diasInteresMor);\n totalVencIVA = formatoMoneda(totalVencIVA);\n interesGenerado = formatoMoneda(interesGenerado);\n TotalFinal = formatoMoneda(TotalFinal);\n TotalPrestamo = formatoMoneda(TotalPrestamo);\n $(\"#idAbonoAnteriorInput\").val(Abono)\n Abono = formatoMoneda(Abono);\n\n\n //Valida si esta en almoneda\n var FechaAlmFormat = formatStringToDate(FechaAlm);\n if (FechaAlmFormat < fechaHoy) {\n $(\"#trAlmoneda\").show();\n }\n $(\"#idTblFechaEmpeno\").val(FechaEmp);\n $(\"#idTblFechaVenc\").val(FechaVenConvert);\n $(\"#idTblFechaComer\").val(FechaAlm);\n $(\"#idTblDiasTransc\").val(diasForInteres);\n $(\"#idTblDiasTransInt\").val(diasMoratorios);\n $(\"#idTblPlazo\").val(PlazoDesc);\n $(\"#idTblTasa\").val(tasaIvaTotal);\n $(\"#idTblInteresDiario\").val(interesDia);\n $(\"#idTblInteres\").val(totalVencInteres);\n $(\"#idTblAlmacenaje\").val(totalVencAlm);\n $(\"#idTblSeguro\").val(totalVencSeg);\n $(\"#idTblMoratorios\").val(diasInteresMor);\n $(\"#idTblIva\").val(totalVencIVA);\n\n document.getElementById('idConTDDes').innerHTML = contrato;\n document.getElementById('idPresTDDes').innerHTML = TotalPrestamo;\n document.getElementById('idInteresTDDes').innerHTML = interesGenerado;\n document.getElementById('idAbonoTDDes').innerHTML = Abono;\n\n /*\n document.getElementById('totalAPagarTD').innerHTML = TotalFinal;*/\n //NOTA Entrega\n $(\"#idPrestamoNota\").val(TotalPrestamo);\n $(\"#idInteresNota\").val(interesGenerado);\n $(\"#idMoratoriosNota\").val(diasInteresMor);\n $(\"#idTotalPrestamoNota\").val(TotalFinal);\n $(\"#idTotalFinalNota\").val(TotalFinal);\n $(\"#idSaldoPendiente\").val(TotalFinal);\n $(\"#idInteresPendienteNota\").val(interesGenerado);\n $(\"#btnGenerar\").prop('disabled', false);\n $(\"#btnAbono\").prop('disabled', false);\n $(\"#idAbono\").prop('disabled', false);\n\n }\n }\n });\n }\n}", "title": "" }, { "docid": "0c6d95e0ac06f35414af3e5d9b7639c7", "score": "0.56401294", "text": "function procesarParaValidos() {\n\n var listaValidos = [];\n\n var listadoLineas = separarEnLineas();// Separa el parrafo en los saltos de linea para dejar lineas de texto\n\n for (var i = 0; i < listadoLineas.length; i++) {\n var listadoPalabras = separarEnPalabras(listadoLineas[i]);// Cada linea la separa en palabras \n for (var j = 0; j < listadoPalabras.length; j++) {\n\n var resultado = analizar(listadoPalabras[j]);\n\n if (resultado === \"okIdentificador\") {\n\n var validoNuevo = new valido(\"Identificador\", listadoPalabras[j], (i + 1), (j + 1));\n listaValidos.push(validoNuevo);\n\n } else if (resultado === \"okNumero\") {\n\n var validoNuevo = new valido(\"Numero\", listadoPalabras[j], (i + 1), (j + 1));\n listaValidos.push(validoNuevo);\n\n } else if (resultado === \"okAgrupacion\") {\n\n var validoNuevo = new valido(\"Agrupacion\", listadoPalabras[j], (i + 1), (j + 1));\n listaValidos.push(validoNuevo);\n\n } else if (resultado === \"okAritmetico\") {\n\n var validoNuevo = new valido(\"Aritmetico\", listadoPalabras[j], (i + 1), (j + 1));\n listaValidos.push(validoNuevo);\n\n } else if (resultado === \"okPuntuacion\") {\n\n var validoNuevo = new valido(\"Puntuacion\", listadoPalabras[j], (i + 1), (j + 1));\n listaValidos.push(validoNuevo);\n\n } else if (resultado === \"error\") {\n\n //No hacer nada\n\n } else {\n\n //No hacer nada\n\n }\n }\n }\n return listaValidos;\n}", "title": "" }, { "docid": "31be9738c45c640c5e836e9c8abaf348", "score": "0.563886", "text": "function irTransferencias() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de transferencias generales en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceTransferencias, 'activo');\n añadirClaseActivoEnlaces(atajoTransferencias, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionTransferencias();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "594befe838374730b29be84ce7d0f86e", "score": "0.56344163", "text": "function colorearCajas() {\n if (contador == 0) {\n //Cajas Azules a Rojas\n cajaAzul1.classList.add('rojo');\n cajaAzul2.classList.add('rojo');\n cajaAzul3.classList.add('rojo');\n cajaAzul4.classList.add('rojo');\n cajaAzul5.classList.add('rojo');\n\n //Cajas Rojas a Azules\n cajaRojo1.classList.add('azul');\n cajaRojo2.classList.add('azul');\n cajaRojo3.classList.add('azul');\n contador = 1;\n\n } else {\n //Cajas rojas a Azules\n cajaAzul1.classList.remove('rojo');\n cajaAzul2.classList.remove('rojo');\n cajaAzul3.classList.remove('rojo');\n cajaAzul4.classList.remove('rojo');\n cajaAzul5.classList.remove('rojo');\n //Cajas Azules a rojas\n cajaRojo1.classList.remove('azul');\n cajaRojo2.classList.remove('azul');\n cajaRojo3.classList.remove('azul');\n contador = 0;\n }\n }", "title": "" }, { "docid": "30a489f620878de2ac0ee37ff40fe472", "score": "0.56324345", "text": "ligarDesligarSomBotao(primeiroAcesso = false){\n\n //variavel para obter o atual historico existente na calculador para concatenar com ativaçao/desativacao do som\n let historicoAtual = this.displayHistorico;\n\n\n //Verificando se a calculadora esta ligada, caso contrario o som nao deve ser executado.\n if (this.getStatusCalculadora() == true){\n\n //Verificando se o audio da calculadora esta desligado, se sim ativa o audio.\n if (this.getStatusAudioBotoes() == false) {\n\n this.setStatusAudioBotoes(); //setando status do audio como true/ligado\n this.displayHistorico = historicoAtual + \"<br/>\" + this.dataAtual.toLocaleDateString() + \" - Som Ativado.\";\n this.executaSomBotao();\n this.alteraStatusSomBotoesDisplay();\n\n } else {\n\n this.setStatusAudioBotoes(); //setando status do audio como false/desligado\n //validando se a calculadora esta sendo ligada agora (primeiroAcesso) se sim não va exibir a mensagem de som destaivado.\n if (!primeiroAcesso) {\n this.displayHistorico = historicoAtual + \"<br/>\" + this.dataAtual.toLocaleDateString() + \" - Som Desativado.\";\n }\n this.alteraStatusSomBotoesDisplay();\n\n }\n }\n }", "title": "" }, { "docid": "979308a3eaf07f4dce84cec50b15f905", "score": "0.5632128", "text": "function dibujarDialogo(){\n\n\nif(conversacionActual.getNodoActual().getQuienLinea() == 1){\ntexturaActual1 = conversacionActual.getTexturaPj1();\ntexturaActual2 = conversacionActual.getTexturaPj2Sombreada();\n}\nelse if (conversacionActual.getNodoActual().getQuienLinea() == 2){\ntexturaActual1 = conversacionActual.getTexturaPj1Sombreada();\ntexturaActual2 = conversacionActual.getTexturaPj2();\n}\n\ntextoActivo = conversacionActual.getNodoActual().getTextoLinea();\n\n\n\n}", "title": "" }, { "docid": "f5fbedbb4cc60b26ccf997fb65df12eb", "score": "0.56314844", "text": "async function botGeraOcorrenciasIniciais() {\n geraOcorrenciasIniciais().then((ret)=>{\n if(ret.rowsAffected>0){\n ocorrenciasIniciaisIncluidas++\n sendLog('AVISO',`Ocorrências Iniciais - Incluidas (${ret.rowsAffected})`)\n }\n x_botGeraOcorrenciasIniciais += ret.rowsAffected\n }) \n ++checks\n setTimeout(botGeraOcorrenciasIniciais,(check_time*3)) // (10000*3) = A cada 30 segundos\n}", "title": "" }, { "docid": "b2f090f62a1c4fe9e2b900b27a71549e", "score": "0.56307006", "text": "marcarRespuestas() {\n let inputs = document.getElementsByClassName('zelda-input');\n for (var i = 0; i < this.Seleccionados.length; i++) {\n inputs[this.Seleccionados[i]].classList.add('selected');\n }\n for (var i = 0; i < this.NoSeleccionados.length; i++) {\n inputs[this.NoSeleccionados[i]].classList.add('unselected');\n }\n }", "title": "" }, { "docid": "89fe2a69f4726b93eaf9ee74d2e7647e", "score": "0.56280446", "text": "function comprobarAddProf_Titulacion() {\n\n var dni; /*variable que representa el elemento dni del formulario add */\n var codTitulacion; /*variable que representa el elemento codTitulacion del formulario add */\n var anhoAcademico; /*variable que representa el elemento anhoAcademico del formulario add */\n\n dni = document.forms['ADD'].elements[0];\n codTitulacion = document.forms['ADD'].elements[1];\n anhoAcademico = document.forms['ADD'].elements[2];\n\n /*Comprueba si codTitulacion es vacio, retorna false*/\n if (!comprobarVacio(codTitulacion)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codTitulacion.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codTitulacion, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio\n }//fin comprobar vacio \t\n \n /*Comprueba si codCentro es vacio, retorna false*/\n if (!comprobarVacio(dni)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarDni(dni)) {\n return false;\n }//comprobar dni \t\t\t\n }//comprobar vacio\n\n /*Comprueba si nombreTitulacion es vacio, retorna false*/\n if (!comprobarVacio(anhoAcademico)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarEntero(anhoAcademico,1,999999999)) {\n return false;\n }//fin comprobar entero\n }//fin comprobar vacio\n return true;\n } //fin add prof_titulacion", "title": "" }, { "docid": "50d0b30f3ef78231848d7f902e21e110", "score": "0.5627132", "text": "function azzeramentoCampoEsito(){\r\n\tif(document.inserisciTrattative.trattattivaSingola_esito.value == \"aperta\" \r\n\t\t|| document.inserisciTrattative.trattattivaSingola_esito.value == \"persa\" \r\n\t\t&& document.inserisciTrattative.esito.value == \"nuova Commessa\"){\r\n\t\tdocument.inserisciTrattative.esito.value = \"aperta\";\r\n\t\tinserimentoCommessaTrattativa = false;\r\n\t}\r\n\tif(document.inserisciTrattative.esito.value == \"aperta\" \r\n\t\t|| document.inserisciTrattative.esito.value == \"persa\" \r\n\t\t&& document.inserisciTrattative.trattattivaSingola_esito.value == \"nuova Commessa\"){\r\n\t\tdocument.inserisciTrattative.trattattivaSingola_esito.value = \"aperta\";\r\n\t\tinserimentoCommessaTrattativa = false;\r\n\t}\r\n}", "title": "" }, { "docid": "128c593db425adc9edb7d3f6b5e158fc", "score": "0.5624564", "text": "adicionaPonto(){\n //Verificando qual a ultima operação\n let ultimaOperacao = this.getUltimaOperacao();\n\n //Verificando se a operação ja existe e se é um string e se dentro dessa string tem um ponto\n // Se tiver ponto faz return e para execucao, caso contrario continua.\n if (typeof ultimaOperacao === 'string' && ultimaOperacao.split('').indexOf('.') > -1 ) return;\n\n //existem 3 possibilidades\n //1 - Se o usuario digitar . logo como primeiro botao o nosso Array de operação será undefined\n //2 - Se o usuario digitou um numero e depois o ponto, a ultima operação será o numero digitado antes do ponto\n //3 - Se o usuario digitou um operador (ex.: +) a ultima operação será +\n //Temos que tratar essas tres situações.\n //Se for undefined ou operador, temos que adicionar 0, e mais o que a pessoa ainda vai digitar.\n\n if (this.isOperador(ultimaOperacao) || !ultimaOperacao) {\n this.pushOperacao('0.'); //adicionando 0 ponto ao display/array\n\n } else {\n //sobrescreve a ultima operacao sem perder o ultimo numero\n this.setUltimaOperacao(ultimaOperacao.toString() + '.');\n\n }\n\n this.setUltimoNumeroNoDisplay();\n }", "title": "" }, { "docid": "601513e759a4e5c767f9ef6d8be824ca", "score": "0.5623211", "text": "function seleccionarConsola(opcion){\n\n let consolas={\n nombres:Array(\"XBOX Serie X\",\"Nintendo Switch\",\"PS5\"),\n precios:Array(750,700,409),\n pesos:Array(14.2,13.1,4.75),\n fotos:Array(\"img/carrucel1.jpg\",\"img/carucel2.jpg\",\"img/carrucel3.jpg\")\n \n }\n\n if(opcion==1){\n\n nombreConsola=consolas.nombres[0];\n precioConsola=consolas.precios[0];\n pesoConsola=consolas.pesos[0];\n fotoConsola=consolas.fotos[0];\n\n }\n else if(opcion==2){\n\n nombreConsola=consolas.nombres[1];\n precioConsola=consolas.precios[1];\n pesoConsola=consolas.pesos[1];\n fotoConsola=consolas.fotos[1];\n\n }\n else if(opcion==3){\n\n nombreConsola=consolas.nombres[2];\n precioConsola=consolas.precios[2];\n pesoConsola=consolas.pesos[2];\n fotoConsola=consolas.fotos[2];\n\n }\n else{\n\n nombreConsola=null;\n precioConsola=null;\n pesoConsola=null;\n fotoConsola=null;\n\n }\n}", "title": "" }, { "docid": "06e5bc43d34a7b3f226f7275e7dc46a8", "score": "0.56211287", "text": "function leerRolOpciones() {\n\n // En el primer espacio va el nombre de la opcion y en el segundo la ruta\n\n // Estas son las opciones comunes por rol\n let opcionSede = ['Sedes', '#'];\n let opcionCarreras = ['Carreras', '../../html/dashboard/dashboard_carrera.html'];\n let opcionCursos = ['Cursos', '#'];\n let opcionGrupos = ['Grupos', '#'];\n let opcionLaboratorios = ['Laboratorios', '#'];\n let opcionUsuarios = ['Usuarios', '#'];\n let opcionPeriodos = ['Períodos', '#'];\n let opcionBitacora = ['Bitácora', '../../html/dashboard/dashboard_bitacora.html'];\n let opcionSolicitud = ['Solicitud', '#'];\n\n let opcionesAdministrador = [];\n opcionesAdministrador.push(opcionSede, opcionCarreras, opcionCursos, opcionGrupos, opcionLaboratorios, opcionUsuarios, opcionPeriodos, opcionBitacora, opcionSolicitud);\n\n let opcionesRectoria = [];\n opcionesRectoria.push(opcionSede, opcionCarreras, opcionCursos, opcionGrupos, opcionLaboratorios, opcionUsuarios, opcionPeriodos, opcionBitacora);\n let opcionesDecanatura = [];\n opcionesDecanatura.push(opcionSede, opcionCarreras, opcionCursos, opcionGrupos, opcionLaboratorios, opcionUsuarios, opcionPeriodos, opcionBitacora)\n let opcionesAsistenteDecanatura = [];\n opcionesAsistenteDecanatura.push(opcionSede, opcionCarreras, opcionCursos, opcionGrupos, opcionLaboratorios, opcionUsuarios, opcionPeriodos, opcionSolicitud)\n let opcionesProfesor = [];\n opcionesProfesor.push(opcionBitacora, opcionSolicitud);\n\n // Estas son las opciones por rol de reportes\n let opcionGraficoComparativo = ['Gráfico de horas comparativo contra promedio de horas de asistencia', '#'];\n let opcionReporteCursos = ['Reporte de cursos', '#'];\n let opcionGraficoCostos = ['Gráfico de costos de asistencias', '#'];\n let opcionGraficoHorasAsistencia = ['Gráfico cantidad de horas de asistencia', '#'];\n let opcionGraficoTotalHoras = ['Gráfico del total de horas de asistencia', '#'];\n\n let opRepSuperior = [];\n opRepSuperior.push(opcionGraficoCostos, opcionReporteCursos);\n let opRepProfesor = [];\n opRepProfesor.push(opcionGraficoHorasAsistencia, opcionGraficoTotalHoras, opcionGraficoComparativo);\n let opRepAsistente = [];\n opRepAsistente.push(opcionGraficoHorasAsistencia, opcionGraficoTotalHoras);\n\n let opcionPorcentajeBeca = ['Porcentaje de actual','#'];\n let opcionInformacionBeca = ['Información de beca', '#'];\n let opcionModificarBeca = ['Modificar información de beca','#'];\n\n let opBecaSuperior = [];\n opBecaSuperior.push(opcionInformacionBeca,opcionModificarBeca);\n let opBecaDecAsist = [];\n opBecaDecAsist.push(opcionInformacionBeca);\n let opBecAsist = [];\n opBecAsist.push(opcionPorcentajeBeca);\n\n switch (rolActual) {\n case 'Administrador':\n imprimirOpciones(opcionesAdministrador);\n imprimirOpcionesBeca(opBecaSuperior);\n imprimirOpcionesReportes(opRepSuperior);\n break;\n case 'Rector':\n imprimirOpciones(opcionesRectoria);\n imprimirOpcionesBeca(opBecaSuperior);\n imprimirOpcionesReportes(opRepSuperior);\n break;\n case 'Decanatura':\n imprimirOpciones(opcionesDecanatura);\n imprimirOpcionesBeca(opBecaSuperior);\n imprimirOpcionesReportes(opRepSuperior);\n break;\n case 'Asistente de decanatura':\n imprimirOpciones(opcionesAsistenteDecanatura);\n imprimirOpcionesBeca(opBecaDecAsist);\n imprimirOpcionesReportes(opRepSuperior);\n break;\n case 'Profesor':\n imprimirOpciones(opcionesProfesor);\n imprimirOpcionesBeca(opBecaDecAsist);\n imprimirOpcionesReportes(opRepProfesor);\n break;\n case 'Asistente':\n quitarBotonOpciones();\n imprimirOpcionesBeca(opBecAsist);\n imprimirOpcionesReportes(opRepAsistente);\n break;\n }\n}", "title": "" }, { "docid": "3280e14002da1897f5d860e86890cfd7", "score": "0.56207883", "text": "function comprobarSearchEdificio() {\n var codEdificio; /*variable que representa el elemento codEdificio del formulario add */\n var nombreEdificio; /*variable que representa el elemento nombreEdificio del formulario add */\n var direccionEdificio; /*variable que representa el elemento direccionEdificio del formulario add */\n var campusEdificio; /*variable que representa el elemento campuesEdificio del formulario add */\n\n codEdificio = document.forms['ADD'].elements[0];\n nombreEdificio = document.forms['ADD'].elements[1];\n direccionEdificio = document.forms['ADD'].elements[2];\n campusEdificio = document.forms['ADD'].elements[3];\t\n\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codEdificio.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codEdificio, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio \t\t\n\n /*Comprueba si area \n /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarAlfabetico(nombreEdificio,50)) {\n return false;\n }//fin comprobar alfabetico\n\n /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarTexto(direccionEdificio,150)) {\n return false;\n }//fin comprobar texto\n\n /*Comprueba su longitud, si es mayor que 30, retorna false*/\n if (!comprobarAlfabetico(campusEdificio,10)){\n return false;\n } //fin comprobacion alfabetico\n return true;\n } //fin comprobar search Edificio", "title": "" }, { "docid": "ef5ce7bc671771d82454310ce29e767f", "score": "0.56202936", "text": "function comparar(){\t\r\n \r\n cartel.innerHTML = \"Buscando jugadores en el 11 ideal\";\r\n \r\n \r\n for(columna=1; columna<nombre.length; columna++)\r\n {\r\n jugadores[columna][0]=0;\r\n for(fila=1; fila<perfecto.length; fila++)\r\n {\r\n for(ro=1; ro<perfecto.length; ro++)\r\n { \r\n // alert(nombre[columna]+\"-\"+jugadores[columna][fila]+\"-\"+perfecto[ro]);\r\n if(jugadores[columna][fila]==perfecto[ro]){\r\n \r\n // alert(nombre[columna]+\" tiene a \"+jugadores[columna][fila]+\" en el 11 ideal\");\r\n \r\n jugadores[columna][0]=jugadores[columna][0]+1;\r\n \r\n } \r\n }\r\n }\r\n \r\n }\r\n \r\n calculo(); \r\n \r\n} //funcion compara ", "title": "" }, { "docid": "21267ef676dc469ac37fc9f5f0533ad4", "score": "0.56198376", "text": "function validarRespuestas(){\n\n\t// Variables\n\tvar opciones_no_null = 0;\n\tvar inputs = document.getElementsByClassName('opciones');\n\n\t// Funcion para comprobar las fechas antes de enviar la consulta\n\tcomprobarfechas();\n\t\n\t// Comprueba si las respuestas si estan vacias, si no lo estan augmentara el contador de las respuestas que enviaras\n\tfor(var numero=0; numero<inputs.length;numero++){\n\t\tif(inputs[numero].value != \"\"){\n\n\t\t\topciones_no_null++;\n\n\t\t}\n\t\t// Si hay respuestas vacias, el borde se volvera rojo\n\t\telse{\n\n\t\t\tvar rojo = document.getElementById(\"i\"+contOpciones);\n\t\t\trojo.setAttribute(\"style\",\"border-color:red;\");\n\t\t}\n\t\t\n\t}\n\n\t// Si hay 2 opciones o mas, o si las opciones no estan vacios podra enviar la consulta\n\tif(contOpciones >= 2 && opciones_no_null == inputs.length && comprobarfechas()){\n\t\tenviarRespuestas();\n\n\t}\n\t// Si no lo cumple no podra enviar y le saldra un mensaje de alerta\n\telse{\n\t\talert(\"Tiene que haber mas de 2 opciones en la respuesta ì las respuestas no pueden estar vacias.\")\n\t}\n\t\n}", "title": "" }, { "docid": "bcb2b610ca92bf8510ac00e7eda15ed2", "score": "0.5619485", "text": "function comprobarEvaBus(){\n\n comentA; //Guarda el valor del comentario del alumno\n comentP; //Guarda el valor del comentario del profesor\n \n var comentA = document.getElementById(\"ComenIncorrectoA\");\n var comentP = document.getElementById(\"ComentIncorrectoP\");\n\n var toret =true;\n\n //Comprueba que si el rtexto sea el requerido y no contenga espacios al principio del campo\n if(!( comprobarTexto(comentA,300) && comprobarstartEspacio(comentA) && comprobarAlfabetico(comentA))){\n toret = false;\n }\n //Comprueba que si el rtexto sea el requerido y no contenga espacios al principio del campo\n if(!( comprobarTexto(comentP,300) && comprobarstartEspacio(comentP) && comprobarAlfabetico(comentP))){\n toret = false;\n }\n \n \n\n return toret;\n}", "title": "" }, { "docid": "71c0ea691633b5612d1d8a33ade6f9bc", "score": "0.56138057", "text": "function mostrarmensaje() {\n document.getElementById(\"excuse\").innerHTML =\n numeroaleatorio(quien) +\n numeroaleatorio(accion) +\n numeroaleatorio(que) +\n numeroaleatorio(cuando);\n }", "title": "" }, { "docid": "077570c5f3d77c4924c557ebd6d9cabf", "score": "0.5612077", "text": "function programmatore() { //def il costruttore programmatore\n\tthis.linguaggiConosciuti = [];\n}", "title": "" }, { "docid": "342cdfde0223d97bd3aa9852e5e0bced", "score": "0.56104916", "text": "function leerContratosPatrimoniales() {}", "title": "" }, { "docid": "72aa93f5f6dc4896fd4c1743d86a2518", "score": "0.56085765", "text": "function recuperar(vars){\n\ttot=total;\n\n\t//vars trae la cadena concatenada\n\trenglones=vars.split(\"|\");\n\tdatos=new Array();\n\tfor(i=0;i<renglones.length;i++){\n\t\tdatos[i]=renglones[i].split(\"-\");\n\t}\n\t//ya tengo n arreglos \"datos\", cada uno con un arreglo de splits\n\t//ahora solo los pinto en donde les toca:\n\tfor(i=0;i<datos.length;i++){\n\t\tgebi(\"desc_\"+i).value=datos[i][3];\n\t\t\n\t\tif(i>=llenos){\n\t\t\tgebi(\"clave_\"+i).value=datos[i][2];\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "d19c0ae6adc597bbadfe70172cb9230d", "score": "0.56064713", "text": "static _andarInimObst() {\n\t\t//andar obstaculos\n\t\tControladorJogo._controladoresObstaculos.forEach(controladorObsts => controladorObsts.andarObstaculos());\n\n\t\t//andar inimigos\n\t\tControladorJogo._controladoresInimigos.forEach(controladorInims => controladorInims.andarInimigos());\n\t}", "title": "" }, { "docid": "4de2b58432c609db9d80812b6ab17ac1", "score": "0.56061393", "text": "function escondeCombos( x )\r\n\t{ \r\n if( x * 1 == 0 )\r\n {\r\n for( i = 0; i < document.forms.length; i++ )\r\n {\r\n for( j = 0; j < document.forms[ i ].elements.length; j++ )\r\n {\r\n if( document.forms[ i ].elements[ j ].type == \"select-one\" )\r\n {\r\n naoEsconde[i+\"\"+j] = document.forms[ i ].elements[ j ].style.visibility;\r\n document.forms[ i ].elements[ j ].style.visibility = \"hidden\";\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for( i = 0; i < document.forms.length; i++ )\r\n {\r\n for( j = 0; j < document.forms[ i ].elements.length; j++ )\r\n {\r\n if( document.forms[ i ].elements[ j ].type == \"select-one\" )\r\n {\r\n if(naoEsconde[i+\"\"+j] != 'hidden' || naoEsconde[i+\"\"+j] != '')\r\n document.forms[ i ].elements[ j ].style.visibility = \"visible\";\r\n }\r\n }\r\n }\r\n }\r\n\t}", "title": "" }, { "docid": "4de2b58432c609db9d80812b6ab17ac1", "score": "0.56061393", "text": "function escondeCombos( x )\r\n\t{ \r\n if( x * 1 == 0 )\r\n {\r\n for( i = 0; i < document.forms.length; i++ )\r\n {\r\n for( j = 0; j < document.forms[ i ].elements.length; j++ )\r\n {\r\n if( document.forms[ i ].elements[ j ].type == \"select-one\" )\r\n {\r\n naoEsconde[i+\"\"+j] = document.forms[ i ].elements[ j ].style.visibility;\r\n document.forms[ i ].elements[ j ].style.visibility = \"hidden\";\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for( i = 0; i < document.forms.length; i++ )\r\n {\r\n for( j = 0; j < document.forms[ i ].elements.length; j++ )\r\n {\r\n if( document.forms[ i ].elements[ j ].type == \"select-one\" )\r\n {\r\n if(naoEsconde[i+\"\"+j] != 'hidden' || naoEsconde[i+\"\"+j] != '')\r\n document.forms[ i ].elements[ j ].style.visibility = \"visible\";\r\n }\r\n }\r\n }\r\n }\r\n\t}", "title": "" }, { "docid": "d685a0e374187414b2a56f7f9c65d486", "score": "0.5604116", "text": "function comenzar (){\n\n\tif (click4.checked === true) {\n \t\tfunction llamadaApi(){\n \t\tvar result = fetch(urlApi + cuatro)\n \t\t\t.then(function(translate){\n \t\t\treturn translate.json();\n \t\t});\n \t\t\treturn result;\n \t }\n\t\tpromesa = llamadaApi();\n\t\n\t} else if (click6.checked === true){\n \tfunction llamadaApi(){\n \t\t\tvar result = fetch(urlApi + seis)\n \t\t\t.then(function(translate){\n \t\t\treturn translate.json();\n \t\t});\n \t\treturn result;\n \t\t}\n \t\tpromesa = llamadaApi();\n\n\t} else if (click8.checked === true){\n \tfunction llamadaApi(){\n \t\t\tvar result = fetch(urlApi + ocho)\n \t\t\t.then(function(translate){\n \t\t\treturn translate.json();\n \t\t});\n \t\treturn result;\n \t}\n\t\tpromesa = llamadaApi();\n\t\tconsole.log(promesa);\n\t}\n\n\t//pintando el HTML\n\tpromesa.then(function(lista_de_cartas){\n\t\tconsole.log(lista_de_cartas);\n\n\t\tfor (let carta of lista_de_cartas){\n\t\t\tvar nuevoLi = document.createElement('li');\n\t\t\tvar imagen1 = document.createElement('img');\n\t\t\tvar imagen2 = document.createElement('img');\n\t\t\timagen1.src = carta.image;\n\t\t\timagen2.src = dorso;\n\t\t\timagen1.classList.add('claseoculta');\n\t\t\timagen1.classList.add('escalado');\n\t\t\tnuevoLi.classList.add('li');\n\t\t\t\t\t\t\n\t\t\tfunction cambiarDorso(){\n\t\t\t\timagen1.classList.toggle('claseoculta');\n\t\t\t\timagen2.classList.toggle('claseoculta');\t\n\t\t\t}\n\t\t\timagen1.addEventListener('click', cambiarDorso);\n\t\t\timagen2.addEventListener('click', cambiarDorso);\n\n\t\t\tnuevoLi.appendChild(imagen1);\n\t\t\tnuevoLi.appendChild(imagen2);\n\t\t\tUL.appendChild(nuevoLi);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "81d2815f530017fcd872d3fa82fc341c", "score": "0.55984956", "text": "function criteriosVentas(){\n\tselects = 2;\n\tcoin = new Coincidencia();\n\tapuntadorParametro = coin;\n\tcoin.getCategorias(selects);\n\tcoin.getMarcas(selects);\n\tcoin.getUsuarioLogged(true);\n\t\n\tconsole.log(\"Ventas preparado\");\n}", "title": "" }, { "docid": "e9c684d752962b0b1d8a8db9ac057f6a", "score": "0.5595485", "text": "function provera() {\n for (i = 0; i < 22; i++) {\n azbuka[i].addEventListener(\"click\", function () {\n for (j = 0; j < x.length; j++) {\n if (this.innerText == x[j]) {\n a[j].innerText = x[j];\n b[j] = this.innerText;\n }\n if (x[j] == \" \") { b[j] = \" \"; }\n }\n b1 = b.join(\"\");\n this.setAttribute(\"disabled\", \"true\");\n if (rec.includes(this.innerText) != true) {\n broj--;\n p1[broj].innerText = this.innerText;\n }\n brojac.innerText = broj;\n if (b1 == rec) {\n giveup.parentNode.removeChild(giveup);\n pomoc.parentNode.removeChild(pomoc);\n nova()\n pobeda();\n }\n if (broj == 0) { resenje(); }\n if (broj < 2) { pomoc.setAttribute(\"disabled\", \"true\"); }\n });\n }\n}", "title": "" } ]
aec0a8afbbe9bbada20df5810c8558f9
Show and Hide the Menu
[ { "docid": "e8fca53d1aed5577371b5e21d1ff44cc", "score": "0.0", "text": "function showhidemenu() {\r\n let mn = document.querySelector('.navbar-nav')\r\n if (mn.style.display === 'flex') {\r\n mn.style.display = 'none';\r\n }\r\n else {\r\n mn.style.display = 'flex';\r\n }\r\n}", "title": "" } ]
[ { "docid": "6149c9a6de77de436e29511fae397bb7", "score": "0.78727525", "text": "function toggleMenu() {\r\n //open menu if closed\r\n if (!showMenu) {\r\n displayMenu();\r\n //close menu if open\r\n } else {\r\n closeMenu();\r\n }\r\n }", "title": "" }, { "docid": "e4ec6c2dd2d33ef8ba989bdffb71686b", "score": "0.78287345", "text": "function menuShow() {\n\t\t$('#list-menu-catalog').show();\n\t}", "title": "" }, { "docid": "dd7fc72c61d142d2a039c8de4a779856", "score": "0.76824373", "text": "function showMenu () {\n $('.menu_ico').toggleClass('menu_ico_close');\n $('.overlay-m').toggleClass('menu_is_visible');\n }", "title": "" }, { "docid": "14d2ec2f4a8dd9e3ca9a17c9a92bd2f0", "score": "0.75966704", "text": "onShowMenu () {\n // Trace.log ('>>>> showMenu <<<<');\n const internalState = this.getInternalState ();\n let isMenuVisible = internalState.get ('isMenuVisible');\n if (isMenuVisible === 'true') {\n isMenuVisible = 'false';\n } else {\n isMenuVisible = 'true';\n }\n internalState.set ('isMenuVisible', isMenuVisible);\n }", "title": "" }, { "docid": "e9704eafb8af44e921910512240fa609", "score": "0.7540389", "text": "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "title": "" }, { "docid": "2c9e998ac1964dd07ef1b57f31bff7d5", "score": "0.7532143", "text": "function ToggleMenu() {\n if (this.offsetParent === null) return;\n (_menu.children[0].style.display === \"block\") ? app.menu.hide() : app.menu.show();\n }", "title": "" }, { "docid": "f16cac03418f72c21fe4d1c5dff2d7b5", "score": "0.7415417", "text": "displayMenu() {\n\t\tdocument.querySelectorAllBEM(\".menu__item\", \"menu\").removeMod(\"hide\");\n\t}", "title": "" }, { "docid": "985ea11496fe34f496e559285fa17344", "score": "0.74152225", "text": "function toggle() {\n if (!showMenu) {\n menuBtn.classList.add('close');\n menu.classList.add('show');\n menuNav.classList.add('show');\n \n navItem.forEach(item => item.classList.add('show'));\n showMenu = true;\n }\n\n\n else {\n menuBtn.classList.remove('close');\n menu.classList.remove('show');\n menuNav.classList.remove('show');\n \n navItem.forEach(item => item.classList.remove('show'));\n showMenu = false;\n }\n }", "title": "" }, { "docid": "2c2d0e450705ff8cb54cc868a0e09b36", "score": "0.73390293", "text": "function hideMenu() {\n setActive(false)\n }", "title": "" }, { "docid": "6d9d880a7fa1126858db109035f370d0", "score": "0.73117757", "text": "function showMenu()\r\n { \r\n var menu = document.getElementById(\"pullOutMenu\"); \r\n if (menu.style.opacity < 1)\r\n {\r\n // Make the Menu Visible\r\n menu.style.opacity = 1; \r\n menu.style.height = '250px';\r\n }\r\n else\r\n {\r\n // Hide the Menu\r\n menu.style.opacity = 0.0; \r\n menu.style.height = '0px';\r\n }\t\t\r\n }", "title": "" }, { "docid": "f7d37e80cf60c75188f906bc57aceb95", "score": "0.7310467", "text": "function botaoMenu() {\n\n var m = document.getElementById(\"menu\")\n if (m.style.display == \"block\") {\n m.style.display = \"none\";\n } else {\n m.style.display = \"block\"\n }\n}", "title": "" }, { "docid": "eebce5d33235663dabacd2e931478238", "score": "0.7301861", "text": "function botaoMenu(){\n\n var m = document.getElementById(\"menu\")\n if(m.style.display == \"block\"){\n m.style.display = \"none\";\n }else{\n m.style.display = \"block\"\n }\n}", "title": "" }, { "docid": "472f170a4a894a7addd044d496a85897", "score": "0.7233326", "text": "function MenuWidget_show() {\n var node = document.getElementById(this.element_id);\n node.style.visibility = 'visible';\n this.visible = 1;\n}", "title": "" }, { "docid": "43bfeeca7bdd6ba2efaebc8d1fd4ba59", "score": "0.7233298", "text": "function toggleMenu() {\n setMenuActive(!menuActive);\n }", "title": "" }, { "docid": "f555c99afec8e692fd29d9fdedf30841", "score": "0.7233286", "text": "function showMenu()\n{\n\t// Clear main area\n\tobjApp.clearMain();\n\n\tsetTimeout(function()\n\t{\n\t\t// show the main menu\n\t\tsetupMainMenu();\n\t\t\n\t\tif(!objApp.objPreferences.enable_tasktypes)\n\t\t{\n\t\t\t$(\"#main #mainMenuTaskTypes\").parent().hide();\n\t\t}\n\t\t\n\t\t// Hide all buttons\n\t\tobjApp.hideAllButtons();\n\t\t\n\t\t$(\"#navFooter\").html(\"<p>BillBot - Time tracking &amp; Billing</p>\");\n\t\t\n\t\t// Make sure only the menu button is highlighted\n\t\t//$(\"#navFooter ul li a\").removeClass(\"selected\");\n\t\t//$(\"#navFooter #navMenu\").addClass(\"selected\");\n\t\t\n\t\t// If the user is using an old low res iphone,\n\t\t// auto scroll to the top of the page (hide the url toolbar)\n\t\t// used to be 500?\n\t\tif(smallScreenMode)\n\t\t{\n\t\t\tsetTimeout('window.scrollTo(0, 1);', 500);\n\t\t}\t\t\n\t}, 250);\n}", "title": "" }, { "docid": "fd1a5e157716b8ec4d51ba3cba6d64eb", "score": "0.72316605", "text": "function minMenuShow() {\n\t\t$('#list-menu-catalog').show();\n\t}", "title": "" }, { "docid": "a79579e8be574322d7152ff91794d2a1", "score": "0.72214895", "text": "function showNav() { \n document.getElementById(\"showNav\").style.display=\"none\";\n document.getElementById(\"hideNav\").style.display=\"block\";\n document.getElementById(\"Menuitems\").style.display=\"block\";\n}", "title": "" }, { "docid": "c2c567643edbfe2a23d725c3ff4e5258", "score": "0.7211468", "text": "function showMenu() {\n\tnavigation.classList.toggle('visible');\n\tburgerMenu.classList.toggle('active');\n}", "title": "" }, { "docid": "d493283ec73e30b09edb38394fe76785", "score": "0.7197828", "text": "function showMenu() {\n modal.style.display = \"block\";\n menu.style.display = \"none\";\n}", "title": "" }, { "docid": "f7330fe97d2db4de1dc5d7abe946a59e", "score": "0.71776026", "text": "function displayMenu(menu) {\n // change its visibility to visible able to see it again \n menu.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "8df78125e36bdcb80dd3b3aee0bf7917", "score": "0.7158686", "text": "function showMenu()\n{\n $(\".simon-game\").fadeOut(\"slow\");\n $(\".rules\").fadeOut(\"slow\");\n $(\".demo\").fadeOut(\"slow\");\n $(\".play\").fadeOut(\"slow\");\n $(\".customize\").fadeOut(\"slow\");\n $(\".history\").fadeOut(\"slow\");\n $(\".menu-select\").fadeIn(\"slow\");\n $(\"#header\").fadeIn(\"slow\");\n}", "title": "" }, { "docid": "8ae551a7700bfcbf52d00305660f65a0", "score": "0.7148833", "text": "function showMenu() {\r\n\tmenuHidden = false;\r\n\tdropDown.style.display = 'initial';\r\n\tdropButtons.classList.remove('fa-bars');\r\n\tdropButtons.classList.add('fa-times');\r\n}", "title": "" }, { "docid": "b10841b2e2eed4cdb05fb64363ad8c98", "score": "0.7133395", "text": "function toggleMenu() {\n if (menu.classList.contains(\"showMenu\")) {\n menu.classList.remove(\"showMenu\");\n cross.style.display = \"none\";\n hamburger.style.display = \"block\";\n } else {\n menu.classList.add(\"showMenu\");\n cross.style.display = \"block\";\n hamburger.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "9351c4dcf142c5b03bcb2042fe170d5d", "score": "0.71305007", "text": "function view_micro_menu(){\n let menu=document.getElementById(\"icon-menu-ul\");\n console.log(\"click\");\n if(menu.style.display==\"none\")\n menu.style.display=\"block\"; \n else\n menu.style.display=\"none\";\n}", "title": "" }, { "docid": "c8cc8cc7a123d63a5b47f2eb44c3b5b9", "score": "0.7110656", "text": "function showMenu(){\n // console.log(\"show menu called\");\n menu.style.display = \"block\";\n menuList.classList.add(\"open\");\n menuList.style.display = \"block\";\n if(menuList.classList.contains(\"open\")){\n menu.removeEventListener(\"click\", showMenu);\n menu.addEventListener(\"click\", hideMenu);\n }\n }", "title": "" }, { "docid": "f6c96430ca449bce8414264325ddcc3f", "score": "0.71026784", "text": "function showMenu() {\n var menuList = [{text: rolesDescription.writer, action: ddSelection, icon: \"&#xE3C9;\", id: \"writer\"},\n {text: rolesDescription.reader, action: ddSelection, icon: \"&#xE8F4;\", id: \"reader\"}]\n\n // Se non sono più proprietario ma solo reader, non posso autoimpostarmi come proprietario.\n // Il proprietario soltanto può impostare un altro proprietario.\n if (amIowner === true) {\n menuList.unshift({text: rolesDescription.owner, action: ddSelection, icon: \"&#xE2C9;\", id: \"owner\"});\n }\n menu = new Menu(menuList, e,\n {yPosition: \"under\", xPosition: \"underLeft\"})\n }", "title": "" }, { "docid": "142a2ca69629ab8b02cc3407a8ea59e2", "score": "0.71014404", "text": "function menuOpen() {\n var x = document.getElementById(\"navLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n }", "title": "" }, { "docid": "f0325c760bcfa1b2ba7d6df98f7e3206", "score": "0.70858", "text": "function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('_md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: '_md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }", "title": "" }, { "docid": "43c528ec83fd2a431231f44d7192b208", "score": "0.70775664", "text": "function myMenu() {\nvar menu = document.getElementById(\"nav-menu\");\nif (menu.style.display === \"block\") {\n menu.style.display = \"none\";\n } else{\n menu.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "d44e58b36083d8b1d37e8eb08f81d7c6", "score": "0.70706964", "text": "function showGameSideNavMenu() {\n sideNavLinkDisplay(\"show\", \"sn-pause-reset\");\n elementDisplay(\"hide\", \"ctrlResumeLink\");\n}", "title": "" }, { "docid": "c5b6a855bdbfb24a39a75c72dfbb7214", "score": "0.7067452", "text": "function hideMenu() {\n document.getElementById('mainMenu').style.display = 'none';\n}", "title": "" }, { "docid": "5155ab5b6f08cd1ab234de23a046cf74", "score": "0.70547307", "text": "function toggleMenu(){\n \n if($menu.is(\":visible\")){\n $downArrow.rotate(0);\n $menu.hide();\n } else {\n $downArrow.rotate(180);\n $menu.show();\n }\n}", "title": "" }, { "docid": "7fa0ad0fa8abc811ed36ee85d5008030", "score": "0.7047439", "text": "function setMenu() {\n\n\t$('.contact-respo').hide();\n\n\t$('#menu').on('click', function() {\n\t\t\t$('.contact-respo').toggle();\n\t\t});\n}", "title": "" }, { "docid": "b980a7bf316447dadfb25d8f91c9f2ae", "score": "0.70469624", "text": "function showMenu(pmenu) {\n if ($(pmenu).css(\"display\") === 'none') {\n $(pmenu).show();\n }\n}", "title": "" }, { "docid": "46ea8075b32ad6b87c2dd14d306b0889", "score": "0.70436645", "text": "function openMenuBar() {\n menuBg.style.display = \"block\";\n menuItems.style.display = \"block\";\n closeButton.style.display = \"block\";\n}", "title": "" }, { "docid": "a510ac7c94f85e8a99794d1beeb934bc", "score": "0.70256495", "text": "function toggleMenu(visible) {\n document.querySelector('.menu').classList.toggle('show', visible);\n}", "title": "" }, { "docid": "8442d3f76bdb3f9b172f3c5be28f45ae", "score": "0.7022629", "text": "function showMenu() {\n\t opts.parent.append(element);\n\t element[0].style.display = '';\n\t\n\t return $q(function(resolve) {\n\t var position = calculateMenuPosition(element, opts);\n\t\n\t element.removeClass('md-leave');\n\t\n\t // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n\t // to normal scale.\n\t $animateCss(element, {\n\t addClass: 'md-active',\n\t from: animator.toCss(position),\n\t to: animator.toCss({transform: ''})\n\t })\n\t .start()\n\t .then(resolve);\n\t\n\t });\n\t }", "title": "" }, { "docid": "3e39d8f432a9e312ecd447d7cfe58e7e", "score": "0.7014777", "text": "function showMenu()\r\n{\r\n cancel();\r\n toggleMultiplayerMenu(false);\r\n}", "title": "" }, { "docid": "58f9dac9434a7d0afce90a7bc1f63ecf", "score": "0.7014346", "text": "function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: 'md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }", "title": "" }, { "docid": "58f9dac9434a7d0afce90a7bc1f63ecf", "score": "0.7014346", "text": "function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: 'md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }", "title": "" }, { "docid": "58f9dac9434a7d0afce90a7bc1f63ecf", "score": "0.7014346", "text": "function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: 'md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }", "title": "" }, { "docid": "58f9dac9434a7d0afce90a7bc1f63ecf", "score": "0.7014346", "text": "function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: 'md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }", "title": "" }, { "docid": "4a4507ee50da99d8349e58599c1897f7", "score": "0.70057", "text": "function displayMenu(menu) {\n console.log(menu);\n menu.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "62ea5082bab8ae95a9b7076b22a9c472", "score": "0.6998606", "text": "function showMenu() {\n var logo = $('.logo a span');\n logo.toggleClass('hover');\n if ($(\".desktop\").is(\":visible\")) {\n $(\".desktop.left\").hide(\"slide\", { direction: \"right\" }, 1000);\n $(\".desktop.right\").hide(\"slide\", { direction: \"left\" }, 1000);\n } else {\n $(\".desktop.left\").show(\"slide\", { direction: \"right\" }, 1000);\n $(\".desktop.right\").show(\"slide\", { direction: \"left\" }, 1000);\n }\n }", "title": "" }, { "docid": "445ff72dd4bcdc9bae8cc99fcd341883", "score": "0.69983", "text": "showMenuList() {\n this.menu.style.display = 'block';\n }", "title": "" }, { "docid": "8771e30b2ca5666dec60c692b6782180", "score": "0.69844955", "text": "function showMenu(){\n var navigation = document.querySelector(\".navigation\");\n var button = document.querySelector(\".menu_btn\");\n\n button.addEventListener(\"click\", function(event){\n if(navigation.className.indexOf(\"hidden_menu\") >=0){\n navigation.classList.remove(\"hidden_menu\");\n }\n else{\n navigation.classList.add(\"hidden_menu\");\n }\n })\n }", "title": "" }, { "docid": "d8215f78f0087f298560fae68cc4646e", "score": "0.69633013", "text": "function showSearchMenu() {\n if ($(\".search-menu\").css(\"display\") == \"none\") {\n $(\".search-menu\").show();\n $(\"#search-menu-button\").blur();\n $(\"#search-menu-button\").text(\"Hide settings\");\n } else {\n $(\".search-menu\").hide();\n $(\"#search-menu-button\").blur();\n $(\"#search-menu-button\").text(\"Search settings\");\n }\n}", "title": "" }, { "docid": "e8b0ff800197ee467ea9aa92d71ef07d", "score": "0.6947825", "text": "function toggleMenu() {\n if (menuWrapper.style.display = \"none\") {\n menuWrapper.style.display = \"table\";\n } else {\n menuWrapper.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "347040654ece0ac7e8bbd5f48d223023", "score": "0.6939826", "text": "function showCollapse(){\n\t\t\t$(menu).children(\"li:not(.showhide)\").hide(0);\n\t\t\t$(menu).children(\"li.showhide\").show(0);\n\t\t\t$(menu).children(\"li.showhide\").bind(\"click\", function(){\n\t\t\t\tif($(menu).children(\"li\").is(\":hidden\")){\n\t\t\t\t\t$(menu).children(\"li\").slideDown(settings.speed);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$(menu).children(\"li:not(.showhide)\").slideUp(settings.speed);\n\t\t\t\t\t$(menu).children(\"li.showhide\").show(0);\n\t\t\t\t\t$(menu).find(\".dropdown, .megamenu\").hide(settings.speed);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "3ea04dbfbda810e1f4eee8399cb76eb3", "score": "0.6938484", "text": "function toggleMenuVisibility() {\n var elems = document.getElementsByClassName('menu');\n for (var i = 0; i < elems.length; ++i) {\n var s = elems[i].style;\n s.display = s.display === 'none' ? 'inline' : 'none';\n }\n}", "title": "" }, { "docid": "15d8c1b0dbe6717c5f774b3307ab52ab", "score": "0.6935601", "text": "function showMenu() {\r\n opts.parent.append(element);\r\n element[0].style.display = '';\r\n\r\n return $q(function(resolve) {\r\n var position = calculateMenuPosition(element, opts);\r\n\r\n element.removeClass('md-leave');\r\n\r\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\r\n // to normal scale.\r\n $animateCss(element, {\r\n addClass: 'md-active',\r\n from: animator.toCss(position),\r\n to: animator.toCss({transform: ''})\r\n })\r\n .start()\r\n .then(resolve);\r\n\r\n });\r\n }", "title": "" }, { "docid": "ce530f63479d8ec5835d201b2a0ca787", "score": "0.6934533", "text": "function showLoggedInMenu(){\n // hide login and sign up from navbar & show logout \n $(\"#login, #sign_up\").hide();\n $(\"#logout\").show();\n }", "title": "" }, { "docid": "0bf6ff9931ffb5362904ea9776922717", "score": "0.69242966", "text": "function _showSubMenu(menu) {\n _.addClass(menu, 'menu-active');\n _.removeClass(menu, 'menu-hidden');\n menu.querySelector('.menu-back').focus();\n }", "title": "" }, { "docid": "cb33b25dc46db423924aa9ee5ded448b", "score": "0.69235665", "text": "function showMenu(){\n\t\t$(\"#menu\").stop(true,true).slideDown();\n\t\t$(\"#barTop\").stop().addClass(\"rotateDown45\").animate({marginRight: \"-6px\"});\n\t\t$(\"#barMiddle\").stop().addClass(\"fade\");\n\t\t$(\"#barBottom\").stop().addClass(\"rotateUp45\").animate({marginRight: \"-6px\"});\n\t}", "title": "" }, { "docid": "04a97348acd7ecf451325d0160d98bea", "score": "0.6921725", "text": "function menuVisibility(){\n if($(window).scrollTop() > headerHeight-1){\n $('#mainMenuFixed').show();\n }else{\n $('#mainMenuFixed').hide();\n }\n }", "title": "" }, { "docid": "3420077c3b071afda1ea79c10086dd5a", "score": "0.6912479", "text": "function showMenu(ptrButton) {\n\t\t\t\t$this = $(ptrButton);\n\t\t\t\t$this.siblings(\"ul\").slideToggle(0);\n\t\t\t\t$this.toggleClass(\"menu-active\");\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "75fcb07572bc777687cce79a87e790bd", "score": "0.69122565", "text": "function home(){\n document.getElementById(\"Home\").style.display = \"inline-block\";\n document.getElementById(\"Menu\").style.display = \"none\";\n }", "title": "" }, { "docid": "335cba74eae70f347d4c0431b242e6c2", "score": "0.6906662", "text": "menuToggle() {\n this.$('.subMenu:first').toggleClass('hidden');\n set(this, 'nodeIsOpen', !get(this, 'nodeIsOpen'));\n }", "title": "" }, { "docid": "b410f9b753d8533c82852d899535df06", "score": "0.689528", "text": "function accessMenu() {\n gameTableRef.style.display = \"none\";\n mainMenuRef.style.display = \"block\";\n menuBtnRef.style.display = \"none\";\n optionsContainerRef.style.display =\"none\";\n responsibleContainerRef.style.display = \"none\";\n rulesContainerRef.style.display = \"none\";\n }", "title": "" }, { "docid": "1ebfef04a84b51a33b5b414873cd8f9b", "score": "0.6880636", "text": "function menuShow(item)\n{ \n // Hide content\n $('.contenido').hide();\n // Show content item\n $('#' + item + '-mostrar').show(); \n}", "title": "" }, { "docid": "c386e89dac0668a1484b5eecf805cc7d", "score": "0.68604887", "text": "function hide() {\n if (isShowing) dropDownMenu.style.visibility = \"hidden\";\n isShowing = false; // done just like on page 268 of Web App Dev book, just modified with my var names...\n } // but moved it above show(id) function, since it's called in that function... seems to make more sense to me... ", "title": "" }, { "docid": "441d28d6f58b382e940a97ab7d88bc0d", "score": "0.68564636", "text": "function nav_menu(id){\n \n \t//show the one\n \tdocument.getElementById(id).style.display = \"block\";\n}", "title": "" }, { "docid": "1403a85c25ee68618608421bc8b76f36", "score": "0.6842666", "text": "toggle(){\n this._menu.classList.toggle('menu-side-show');\n }", "title": "" }, { "docid": "b5ab1647d0f589039a5aa3a9655ebf06", "score": "0.6833525", "text": "function responsibleGamingMenu() {\n mainMenuRef.style.display = \"none\";\n responsibleContainerRef.style.display = \"block\";\n }", "title": "" }, { "docid": "b5701456c0a058c0dded4160fd6f95a5", "score": "0.68277454", "text": "toggleMenu() {\n return this._menuOpen ? this.closeMenu() : this.openMenu();\n }", "title": "" }, { "docid": "b5701456c0a058c0dded4160fd6f95a5", "score": "0.68277454", "text": "toggleMenu() {\n return this._menuOpen ? this.closeMenu() : this.openMenu();\n }", "title": "" }, { "docid": "c819b8c2992b5ce24d3c02a80d53a263", "score": "0.68232554", "text": "function hideNavMenu() {\n\tnavigation_visible = true;\n\ttoggleNav();\n}", "title": "" }, { "docid": "11bbf103aae145f7be7a41b570b7abeb", "score": "0.68197745", "text": "function showMenu(){\n logInForm.classList.add('hide-form'); //hides log in form\n logInForm.classList.remove('show-form'); //removes 'show class' from log in form (hides)\n menuForm.classList.add('show-form'); //shows the menu form\n }", "title": "" }, { "docid": "7ab229355eaa28695177c7e2ca9727fe", "score": "0.6817529", "text": "function _show() {\n _list.style.display = 'block';\n _header.classList.add('is-menuopen');\n\n let prevHeight = _el.offsetHeight;\n _list.style.height = 0;\n setTimeout(function () {\n _list.style.height = prevHeight + 'px';\n }, DELAY_SHOW);\n }", "title": "" }, { "docid": "7fe888adb0d59a241254be50310c6bb2", "score": "0.6816839", "text": "function toggleMenu() {\n if (!showMenu) {\n console.log('Open!');\n menuBtn.classList.add('close');\n menu.classList.add('show');\n menuItems.forEach(item => {\n item.classList.add('show');\n });\n menuLinks.forEach(item => {\n item.classList.add('show');\n });\n showMenu = true;\n } else {\n console.log('Close!');\n menuBtn.classList.remove('close');\n menu.classList.remove('show');\n menuItems.forEach(item => {\n item.classList.remove('show');\n });\n menuLinks.forEach(item => {\n item.classList.remove('show');\n });\n showMenu = false;\n }\n}", "title": "" }, { "docid": "8343e3579ce870fa30e672385c021022", "score": "0.6816377", "text": "function displayMenu() {\n back\n .style('opacity', legendOpen * 0.9)\n .style('display', legendOpen ? 'inline' : 'none');\n g\n .style('opacity', legendOpen)\n .style('display', legendOpen ? 'inline' : 'none');\n link\n .text(legendOpen === 1 ? strings.close : strings.open);\n }", "title": "" }, { "docid": "dff1d36ad0d533c84dbb31d93c52ea50", "score": "0.681625", "text": "function show(type){\r\n\t\t\tswitch(type)\r\n\t\t\t{\r\n\t\t\tcase 'checkbox':\r\n\t\t\t\t$(idHelper(_conf.idMenuCheckbox)).show();\r\n\t\t\t\t$(idHelper(_conf.idMenuRadio)).hide();\r\n\t\t\t\t$(idHelper(_conf.idMenuSelect)).hide();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'radio':\r\n\t\t\t\t$(idHelper(_conf.idMenuCheckbox)).hide();\r\n\t\t\t\t$(idHelper(_conf.idMenuRadio)).show();\r\n\t\t\t\t$(idHelper(_conf.idMenuSelect)).hide();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'select':\r\n\t\t\t\t$(idHelper(_conf.idMenuCheckbox)).hide();\r\n\t\t\t\t$(idHelper(_conf.idMenuRadio)).hide();\r\n\t\t\t\t$(idHelper(_conf.idMenuSelect)).show();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$(idHelper(_conf.idMenuCheckbox)).show();\r\n\t\t\t\t$(idHelper(_conf.idMenuRadio)).hide();\r\n\t\t\t\t$(idHelper(_conf.idMenuSelect)).hide();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "2dc7e3eccaa985442369444677aa2591", "score": "0.680858", "text": "function optionsScreen(){\n qsa(\"main > section\")[0].classList.toggle(\"hidden\");\n qsa(\"main > section\")[1].classList.toggle(\"hidden\");\n }", "title": "" }, { "docid": "882b747559ee0a44423fe38b2f7f4cfb", "score": "0.6806691", "text": "function join() {\r\n\t$('#menu').hide();\r\n\t$('#join-menu').show();\r\n}", "title": "" }, { "docid": "795377894fee84325a03d4bfc7808b3e", "score": "0.68031865", "text": "function showSubMenu(menuId){\n\n\t\t\t\tdocument.getElementById('id_two').style.visibility='visible';\t\n\n\t\t\t\tif (curSubMenu!='') hideSubMenu();\n\n\t\t\t\teval('document.all.id_two').style.visibility='visible';\n\n\t\t\t\tcurSubMenu=menuId;\n\n\t\t}", "title": "" }, { "docid": "a74476d8742b85c5e673665fcb4f2db7", "score": "0.6798478", "text": "function togglemenu() {\r\n let x = document.getElementById(\"navBar\");\r\n if (x.style.display === \"block\") {\r\n x.style.display = \"none\";\r\n } else {\r\n x.style.display = \"block\";\r\n }\r\n}", "title": "" }, { "docid": "7d25df0fa58823cc4d2cb75ac805d5fb", "score": "0.6792646", "text": "function afficherMenu() {\n menu.classList.toggle('visible');\n}", "title": "" }, { "docid": "cadb19b9804d40c23212a79e5aeb2010", "score": "0.6783606", "text": "function user_menu_show(param){\n\tif(param){\n\t\t$('.my-account-links').show();\n\t\t$('#mensajes-box').hide();\n\t\t$('#notifications-box').hide();\n\t\t$('#favorites-box').hide();\n\t}else{\n\t\t$('.my-account-links').hide();\n\t}\n}", "title": "" }, { "docid": "e82ed7dad677bf077c13e6057dcbae43", "score": "0.6782768", "text": "toggleTheMenu() {\n\t\tthis.menuContent.toggleClass (\"site-header__menu-content--is-visible\");\n\t\tthis.siteHeader.toggleClass (\"site-header--is-expanded\");\n\t\tthis.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n\t}", "title": "" }, { "docid": "0ae6fff10a35f7648a6b30232c3fe38f", "score": "0.6777184", "text": "function showMenu(ths){\r\n\tvar target = '#mobile-nav';\r\n\tif( $(target).is(':visible')){\r\n\t\t$(ths).removeClass('active');\r\n\t\t$(target).slideUp('fast');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(ths).addClass('active');\r\n\t\t$(target).slideDown('fast');\r\n\t}\r\n}", "title": "" }, { "docid": "a45504bdbe6abd59f08784128f9844e6", "score": "0.676222", "text": "function openMenu() {\n\t\tmenuOut = true;\n\t\tdocument.getElementById('menumiddle').style.animation = 'fadeOut .2s ease forwards';\n\t\tdocument.getElementById('menubottom').style.animation = 'bottomToArrow .3s ease forwards';\n\t\tdocument.getElementById('menutop').style.animation = 'topToArrow .3s ease forwards';\n\t\tdocument.getElementById('menushade').style.display = 'block';\n\t\tdocument.querySelector('nav').style.animation = 'menuOut .3s ease forwards';\n\t\tdocument.getElementById('menushade').style.animation = 'fadeIn .3s ease forwards';\n\t}", "title": "" }, { "docid": "7117bbbd80a2584602ce72effdea1425", "score": "0.6760125", "text": "function mostrarMenuList() {\n navMenuBtn.classList.add('menu-active');\n navMenuBar.classList.add('hide');\n footersocials.classList.add('hide');\n navMenuList.classList.remove('hide');\n menuActivo = true;\n}", "title": "" }, { "docid": "d6220d12bf68c12708b6855da37408db", "score": "0.6759809", "text": "function toggleMenuListBar() {\n menuActivo ? esconderMenuList() : mostrarMenuList();\n}", "title": "" }, { "docid": "5efd3a7be6b057206bedaecc3902355d", "score": "0.6744265", "text": "function handleToggleMenu() {\r\n if (!toggleMenu) {\r\n setToggleMenu(true);\r\n setToggleString(\"initial\");\r\n // document.getElementById('accordionMenu').foundation('showAll');\r\n } else {\r\n setToggleMenu(false);\r\n setToggleString(\"none\");\r\n // document.getElementById('accordionMenu').foundation('hideAll');\r\n }\r\n }", "title": "" }, { "docid": "4128ac5500e5617b8359523d10d9477a", "score": "0.6743805", "text": "function showMenu(){\n console.log('show');\n //check if the class has not been added then add\n if(navMenu.className !== 'show'){\n //add class\n navMenu.classList.add('show');\n }\n }", "title": "" }, { "docid": "2d04c5c44d5e2db8d66ebf4ceec49f9d", "score": "0.6739824", "text": "function hideOptionsMenu() {\n document.getElementById('sample-menu').style.display = 'none';\n skOptionsMenu.open = false;\n document.body.appendChild(container);\n }", "title": "" }, { "docid": "21fa5d6e4db3109c51bac23234731275", "score": "0.67378867", "text": "hideMenu() {\n\t\tdocument.querySelectorAllBEM(\".menu__item\", \"menu\").addMod(\"hide\");\n\t}", "title": "" }, { "docid": "3c94278a88c8e6ee7209c5ef0875acac", "score": "0.67359895", "text": "function MenuWidget_hide() {\n var node = document.getElementById(this.element_id);\n node.style.visibility = 'hidden';\n this.visible = 0;\n}", "title": "" }, { "docid": "afb1cb8c75ef0150fb3d5325db1a19c4", "score": "0.67341405", "text": "function showLoggedInMenu(){\n // hide login and sign up from navbar & show logout button\n $(\"#login\").hide();\n $(\"#logout, #update_profile, #signup\").show();\n}", "title": "" }, { "docid": "ea06e04c3df283f958f45ab760e9edd7", "score": "0.6729854", "text": "function showMenu(){\n\tvar menues = $(\".menues\");\n\tmenues.fadeIn(\"200\");\n\thideInfos();\n}", "title": "" }, { "docid": "ded6c321b45f32844716940faac314ef", "score": "0.6727763", "text": "function toggleMenuVisibility() {\n 'use strict';\n var menu = $('#nav');\n var html = $('html');\n \n if (smallScreenMenuIsVisible()) { // = menu was already open at click time\n // About to open the menu: make its links NOT tab accessible\n menu.find('a').attr('tabindex', '-1');\n } else {\n // About to open the menu: make its links tab accessible\n menu.find('a').removeAttr('tabindex');\n }\n \n // Toggle the class that triggers the actual opening/closing of the \n // menu.\n html.toggleClass('navigating');\n}", "title": "" }, { "docid": "56ad08b01b1936cc9020e9dbf62ebeea", "score": "0.6726708", "text": "toggleTheMenu() {\n\t\tthis.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n\t\tthis.siteHeader.toggleClass(\"site-header--is-expanded\");\n\t\tthis.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n\t}", "title": "" }, { "docid": "f9060f5539d57cbc8896e7834c6e2961", "score": "0.6715795", "text": "function makeMenuHidden() {\n visible.classList.add(\"nav-visible\");\n visible.classList.toggle(\"nav-hidden\");\n}", "title": "" }, { "docid": "d6878464ed8c55373d8e6795136d5c11", "score": "0.6715571", "text": "function actOpenDICOMExtraMenuToggle(){\n if($('.obj-opendicom-menuextra').is(':visible'))\n $('.obj-opendicom-menuextra').css('display', 'none');\n else\n $('.obj-opendicom-menuextra').css('display', 'flex');\n }", "title": "" }, { "docid": "95c0e4b1af980a1984952e875e073514", "score": "0.6706098", "text": "function showMenu() {\n $(\"#divBtnMenu\").remove();\n if ($(\"#game\") != undefined) {\n $(\"#game\").remove();\n }\n if ($(\"#divImg\") != undefined) {\n $(\"#divImg\").remove();\n }\n if ($(\"#divImg2\") != undefined) {\n $(\"#divImg2\").remove();\n }\n if ($(\"#winner\") != undefined) {\n $(\"#winner\").remove();\n }\n if ($(\"#divFotos\") != undefined) {\n $(\"#divFotos\").remove();\n }\n crearMenu();\n }", "title": "" }, { "docid": "0db2ccce55dc55a1af518ca8e3cea783", "score": "0.6704513", "text": "function hamburgerShowMenu() {\r\n \r\n menu.classList.toggle('nav--active')\r\n hamburger.classList.toggle('hamburger--active')\r\n hideSub()\r\n }", "title": "" }, { "docid": "8b209621f66942b869346b12897439bf", "score": "0.669874", "text": "function showLoggedOutMenu(){\n // show login and sign up from navbar & hide logout button\n $(\"#login, #sign_up\").show();\n $(\"#logout, #calendar\").hide();\n }", "title": "" }, { "docid": "10d77ab0655f0a14f6c95c01318923a0", "score": "0.66957337", "text": "function hideMenu() {\n for (var i = 0; i < startUp.length; i++) {\n startUp[i].style.display = \"none\";\n }\n document.querySelector(\"canvas\").style.display = \"block\";\n}", "title": "" }, { "docid": "79ab253f5b74560608630bdcbef8f333", "score": "0.6690124", "text": "function toggle(target) {\n if(target ==\"Register\"){\n clearReg();\n }\n var menu_var = document.getElementsByClassName('menu_class');\n var targ = document.getElementById(target);\n var isVis = targ.style.display == 'block';\n\n if(!isVis){\n // hide all\n for (var i = 0; i < menu_var.length; i++) {\n menu_var[i].style.display = 'none';\n }\n // toggle current\n targ.style.display = isVis ? 'none' : 'block';\n if(target==\"About\"){\n toggleabout();\n }\n }\n }", "title": "" }, { "docid": "b939f85115e30d95418d55efbf1135ca", "score": "0.66899914", "text": "function toggleMenu() {\n menuOpen = !menuOpen;\n bars[0].classList.toggle(\"rotateDown\");\n bars[1].classList.toggle(\"fadeOut\");\n bars[2].classList.toggle(\"rotateUp\");\n menu.classList.toggle(\"hidden\");\n}", "title": "" }, { "docid": "29c9229e89ffa85757f0a9739ee012c9", "score": "0.66844004", "text": "function showHideShowMenu() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n }", "title": "" } ]
cae4171d98d8271d22f8fd1249793c5d
List of all purchases from the verified receipts.
[ { "docid": "9d34ac2f30f7f82ce4b5307138c6d96f", "score": "0.72560835", "text": "get verifiedPurchases() {\n return CdvPurchase.Internal.VerifiedReceipts.getVerifiedPurchases(this.verifiedReceipts);\n }", "title": "" } ]
[ { "docid": "aa814037bfe6fc4bbdddd8ef4a888bbc", "score": "0.6236899", "text": "getPurchases() {\n return new Promise(resolve => {\n this.log.debug('getPurchases');\n const success = () => {\n this.log.debug('getPurchases success');\n setTimeout(() => resolve(undefined), 0);\n };\n const failure = (message, code) => {\n this.log.warn('getPurchases failed: ' + message + ' (' + code + ')');\n setTimeout(() => resolve(CdvPurchase.storeError(code || CdvPurchase.ErrorCode.UNKNOWN, message)), 0);\n };\n this.bridge.getPurchases(success, failure);\n });\n }", "title": "" }, { "docid": "1dd989ce5f1239f4b10d9a74a6160dfa", "score": "0.6196823", "text": "listPurchases() {\n return this.client.query(\n q.Map(\n q.Paginate(q.Match(q.Index(\"purchases\")), {before : null}),\n (row) => q.Let({row:q.Get(row)},\n q.Let({\n buyer : q.Get(q.Select([\"data\",\"buyer\"], q.Var(\"row\"))),\n seller : q.Get(q.Select([\"data\",\"seller\"], q.Var(\"row\"))),\n price : q.Select([\"data\",\"price\"], q.Var(\"row\")),\n item : q.Get(q.Select([\"data\",\"item\"], q.Var(\"row\")))\n },\n {\n buyer : q.Select([\"data\",\"name\"], q.Var(\"buyer\")),\n seller : q.Select([\"data\",\"name\"], q.Var(\"seller\")),\n price : q.Var(\"price\"),\n label : q.Select([\"data\",\"label\"], q.Var(\"item\")),\n key : q.Select([\"ref\"], q.Var(\"row\"))\n }\n ))\n )\n );\n }", "title": "" }, { "docid": "f376dcbc93838d4d61239c8d083c4639", "score": "0.599685", "text": "get verifiedReceipts() {\n return this._validator.verifiedReceipts;\n }", "title": "" }, { "docid": "9e2c37790738bb56284538b97d195a2b", "score": "0.56654286", "text": "onPurchasesUpdated(purchases) {\n this.log.debug(\"onPurchaseUpdated: \" + purchases.map(p => p.orderId).join(', '));\n // GooglePlay generates one receipt for each purchase\n purchases.forEach(purchase => {\n const existingReceipt = this.receipts.find(r => r.purchaseToken === purchase.purchaseToken);\n if (existingReceipt) {\n existingReceipt.refreshPurchase(purchase);\n this.context.listener.receiptsUpdated(CdvPurchase.Platform.GOOGLE_PLAY, [existingReceipt]);\n }\n else {\n const newReceipt = new Receipt(purchase, this.context.apiDecorators);\n this.receipts.push(newReceipt);\n this.context.listener.receiptsUpdated(CdvPurchase.Platform.GOOGLE_PLAY, [newReceipt]);\n }\n });\n }", "title": "" }, { "docid": "8b13cdae2b18a32ec8f70d0fb81ea96e", "score": "0.55111456", "text": "get localReceipts() {\n // concatenate products all all active platforms\n return [].concat(...this.adapters.list.map(a => a.receipts));\n }", "title": "" }, { "docid": "24850b944574e4c8b65c0a39f3f97bd1", "score": "0.5462358", "text": "function ownedProducts(){\n // Initialize the billing plugin\n log(\"ownedProducts\");\n inappbilling.getPurchases(successHandler, errorHandler);\n}", "title": "" }, { "docid": "593d35148fb649dd50ab69ecd4e39003", "score": "0.53904414", "text": "function getPurchaseItems(transaction){\n return transaction.items.reduce(transactionTotal, 0);\n}", "title": "" }, { "docid": "c8edc6236192464e97ba2c3f2f96c660", "score": "0.52929604", "text": "onSetPurchases(purchases) {\n this.log.debug(\"onSetPurchases: \" + JSON.stringify(purchases));\n this.onPurchasesUpdated(purchases);\n this.context.listener.receiptsReady(CdvPurchase.Platform.GOOGLE_PLAY);\n }", "title": "" }, { "docid": "3168623249f25ea6e211f675c4e34e32", "score": "0.52395695", "text": "async restorePurchases() {\n for (const adapter of this.adapters.list) {\n if (adapter.ready)\n await adapter.restorePurchases();\n }\n // store.triggerError(storeError(ErrorCode.UNKNOWN, 'restorePurchases() is not implemented yet'));\n }", "title": "" }, { "docid": "7794e54bba1c5c03fdeeb4ac5ed3e264", "score": "0.5219324", "text": "function clearPurchases() {\n var board = document.getElementById('purchases');\n var purchases = document.getElementsByClassName('purchase');\n purchases = Array.from(purchases);\n purchases.map(function(purchase) {\n board.removeChild(purchase);\n });\n }", "title": "" }, { "docid": "65a07259c1c4d117736790b10e911804", "score": "0.51998585", "text": "function showReceipts(){\n if ( __specification_receipts__.length === 0){\n showTitle(\"NO RECEIPTS\");\n return false;\n }\n\n var table = new Table({\n head: ['Registered' , 'Label', 'System type' , 'System' , 'Parameters' ]\n });\n\n __specification_receipts__.forEach(function(receipt){\n var specification = new mplane.Specification(receipt._specification);\n var params_values = [];\n var registered = receipt['_eventTime'] ;\n // For each result of each defined specification, push the values and param specification in the value/param array.\n _.forEach(_.keys(specification[\"_params\"]) , function(parmName,pos){ params_values.push(parmName+\" : \" + specification[\"_params\"][parmName]['_value'] ) });\n table.push(\n [ registered || \"Unknown\", receipt._label || \"Unknown\", receipt[\"_metadata\"]['System_type'] || \"Unknown\", receipt[\"_metadata\"]['System_ID'] || \"Unknown\", params_values.join(\"\\n\") ]\n );\n });\n showTitle(\"Pending RECEIPTS\");\n console.log(table.toString());\n console.log();\n return true;\n}", "title": "" }, { "docid": "78df9016e38bbeec1b4ec75f2af90dc7", "score": "0.5159582", "text": "processPurchase (purchases, orderId, userId) {\n return client.post(\"/checkout/payment/complete\", {\n purchases: JSON.stringify(purchases),\n orderId: orderId,\n userId: userId\n }).then(response => response.data);\n }", "title": "" }, { "docid": "3c95928e30923308f870e401a885c8d4", "score": "0.5117018", "text": "get localTransactions() {\n const ret = [];\n for (const receipt of this.localReceipts) {\n ret.push(...receipt.transactions);\n }\n return ret;\n }", "title": "" }, { "docid": "cee3303d6e949e7fb2e85641244881ea", "score": "0.5096484", "text": "function getAllPaymentList() {\n var filterObject = getFilterObjectforList(vm.filters, vm.sortBy);\n paymentDataLayer.getPaymentList(filterObject)\n .then(function (response) {\n var data = response.data;\n vm.paymentList = data.data;\n vm.totalPayments = data.count;\n //convert to date time : dd/mm/yyyy HH:mm a\n _.forEach(vm.paymentList, function (data) {\n data.transaction_date = getUtcMoment(data.transaction_date)\n });\n }, function (error) {\n notificationService.error('' + error.data);\n });\n }", "title": "" }, { "docid": "0b4867e59a42e561924e428886a93675", "score": "0.5071257", "text": "function showAll(){\n\tconnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"\\n Available products \");\n\t\tconsole.log(\"\\n--------------------------------------------------------------------------\");\n\t\tfor(i=0;i<res.length;i++){\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" || Name: \" + res[i].product_name + \" || Price: \" + \"$\" + res[i].price + \" || Stock: \" + res[i].stock_quantity + \" ||\" +\n\t\t\t\"\\n----------------------------------------------------------------------------\");\n\t\t}\n\t\tpurchaseProduct();\n\t});\n}", "title": "" }, { "docid": "a2e5184151eab5d975e7ec5c60e540b0", "score": "0.50215477", "text": "get paymentsIn() {\n return new Transactions(\n this.get('paymentAddressTransactions')\n .filter(payment => (payment.get('value') > 0)),\n { paymentCoin: this.paymentCoin }\n );\n }", "title": "" }, { "docid": "df7a7e5302a9b7d2f479da716d5cbad8", "score": "0.4987809", "text": "static isOwned(verifiedReceipts, product) {\n if (!product)\n return false;\n const purchase = VerifiedReceipts.find(verifiedReceipts, product);\n if (!purchase)\n return false;\n if (purchase === null || purchase === void 0 ? void 0 : purchase.isExpired)\n return false;\n if (purchase === null || purchase === void 0 ? void 0 : purchase.expiryDate) {\n return (purchase.expiryDate > +new Date());\n }\n return true;\n }", "title": "" }, { "docid": "15de1df783556e0d5a0a700242e5d6c0", "score": "0.49773154", "text": "function renderReceipts() {\n var allOrders = orderUtils.getItem(\"orders\", []),\n info = \"\",\n totalValue = 0,\n receiptHolder = document.querySelector(\".js-receiptHolder\"),\n totalPrice = document.querySelector(\".js-totalPrice\"),\n orderNameData = \"\";\n\n receiptHolder.innerHTML = \"\";\n // render all receipts\n [].forEach.call(allOrders, function(item) {\n info = item.split(\"&\");\n if (info.length > 1) {\n //split name into sting and number\n orderNameData = splitOrderName(info[0]);\n receiptHolder.innerHTML += '<p class=\"js-listItem js-orderInfo\" data-id=\"' +\n info[0] + '\"><span class=\"orderText\" data-text=\"Porudzbina\">' + languageObject[language][\"Porudzbina\"] + \"</span>\" + orderNameData[1] + \"<span>\" + info[1] + \"/\" + info[2] + \"</span></p>\";\n totalValue = totalValue + Number(info[2]);\n }\n });\n // render tatal price\n totalPrice.value = totalValue;\n // add event listeners to evry order item\n orderUtils.eventHandler(\".js-orderInfo\", \"click\", showDetails);\n if(totalValue > 0){\n billValue = totalValue\n document.querySelector(\".js-splitModal\").removeAttribute(\"disabled\");\n createSplitModal()\n }\n }", "title": "" }, { "docid": "4ffdb63208bfb1c939aea3bfe1535f15", "score": "0.49768353", "text": "function getPurchases(transaction) {\n return transaction.type == 'purchase';\n}", "title": "" }, { "docid": "0ddc77521cbc3021d709c1a1ed2b3ff0", "score": "0.49535877", "text": "get rawPaymentsIn() {\n return this.rawResponse\n .paymentAddressTransactions\n .filter(payment => payment.value > 0);\n }", "title": "" }, { "docid": "a45b9a08e7a4a57006c3684428f0e7aa", "score": "0.49513668", "text": "function loadOwnReceipts() {\n let userId = sessionStorage.getItem('userId');\n\n receiptService.getOwnReceipts(userId)\n .then((myOwnReceipts) => {\n //console.log(myOwnReceipts);\n displayMyOwnReceipts(myOwnReceipts);\n showView('all-receipt-view')\n }).catch(handleError);\n }", "title": "" }, { "docid": "55a4d845b4a1367e00a5f93dad594796", "score": "0.49334717", "text": "async getAllPayments() {\n return this.connection.query('SELECT * from payments WHERE user = ?', [this.user]);\n }", "title": "" }, { "docid": "e005655227f0966c5784aa6d1f4f35b3", "score": "0.49212706", "text": "function getAllAccount() {\n let rows = db.prepare(`SELECT * FROM ${table.account} WHERE purged <> 1;`).all();\n return rows;\n }", "title": "" }, { "docid": "e488aa32e955b393e479cab8e1f7dd97", "score": "0.48617566", "text": "function listSubscriptions() {\n const optionalArgs = {\n maxResults: 10\n };\n try {\n const response = AdminReseller.Subscriptions.list(optionalArgs);\n const subscriptions = response.subscriptions;\n if (!subscriptions || subscriptions.length === 0) {\n console.log('No subscriptions found.');\n return;\n }\n console.log('Subscriptions:');\n for (const subscription of subscriptions) {\n console.log('%s (%s, %s)', subscription.customerId, subscription.skuId,\n subscription.plan.planName);\n }\n } catch (err) {\n // TODO (developer)- Handle exception from the Reseller API\n console.log('Failed with error %s', err.message);\n }\n}", "title": "" }, { "docid": "ca917cfc4919576a876287a8173b371e", "score": "0.48602244", "text": "function getPayments() {\n return initializeRPCClient()\n .then(({lightning}) => promiseify(lightning, lightning.ListPayments, {}, 'get payments'));\n}", "title": "" }, { "docid": "0e97c064175408a6be2b978f20adfb3a", "score": "0.48550895", "text": "function getpaymentList() {\n var filterObject = getFilterObjectforList(vm.filters, vm.sortBy, vm.pageSize);\n paymentDataLayer.getPaymentList(filterObject)\n .then(function (response) {\n var data = response.data;\n vm.paymentList = data.data;\n vm.totalPayments = data.count;\n //convert to date time : dd/mm/yyyy HH:mm a\n _.forEach(vm.paymentList, function (data) {\n data.transaction_date = getUtcMoment(data.transaction_date);\n });\n }, function (error) {\n notificationService.error('' + error.data);\n });\n }", "title": "" }, { "docid": "b8fb8b09f05945aaedaef4745e97f688", "score": "0.4734653", "text": "function restorePurchases()\n\t{\n\t\tshowLoading();\n\t\tStorekit.restoreCompletedTransactions();\n\t}", "title": "" }, { "docid": "d80dd97a30f3f5d4b45d0e7d62a287e9", "score": "0.46893966", "text": "function purchaseItem(snack, quantity) {\n for(i = 0; i < items.length; i++){\n if(snack == items[i]){\n\n //If we can afford it, do the following code block:\n if((cost[i] * quantity) <= cash){\n let cashRemaining = cash - cost[i] * quantity;\n\n console.log(\"Thank you for your purchase\");\n console.log(\"You have $\", cashRemaining,\"remaining\");\n\n for(let j = 0; j < quantity; j++){\n itemsPurchased.push(snack);\n }\n console.log('\\n');\n console.log(\"These are the items in your bag:\")\n console.log(itemsPurchased);\n \n }\n else{\n console.log(\"Sorry but you can't afford this\");\n }\n }\n\n }\n\n}", "title": "" }, { "docid": "82935b7f48ce35be3c7c47c9122bebb0", "score": "0.46857694", "text": "function productsPurchased(orders, products) {\n return orders.reduce((accum, orderObj) => {\n products.forEach(productObj => {\n if (!accum.includes(productObj.name) && orderObj.productId === productObj.id) {\n accum.push(productObj.name);\n }\n })\n return accum;\n }, [])\n}", "title": "" }, { "docid": "c8865c372a94bd9b2a8e484ecae6f08a", "score": "0.46772787", "text": "async index () {\n const billsToPay = BillsToPay.all()\n \n return billsToPay\n }", "title": "" }, { "docid": "4ae2ccefd6d941c77b77835cfb055cef", "score": "0.4674642", "text": "function getPaymentLedger(){\n ccPackageService.getPaymentRecords()\n .then(function(response){\n vm.allPaymentRecords = response.data;\n console.log(vm.allPaymentRecords);\n });\n }", "title": "" }, { "docid": "e4762acc05f3cb911a396bc3054ca52f", "score": "0.46715233", "text": "function getPurchases( userId, callback) {\n $http.get( baseUrl + 'getPurchases/' + userId)\n .success(function( response, status) {\n console.log(response);\n callback(response);\n })\n .error(function( error, status ) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "a9ae308c583b5678877e299d6b871abe", "score": "0.46517083", "text": "function newRec() {\n let minPrice = 10, maxPrice = 100,\n minCount = 1, maxCount = 10;\n\n arrReceipt = [];\n for (let i = 0; i < purchName.length; i++) {\n let purch = {};\n purch.name = purchName[i];\n purch.count = getRandom(maxCount, minCount);\n purch.price = getRandom(maxPrice, minPrice, true);\n arrReceipt.push(purch);\n }\n console.log(arrReceipt);\n}", "title": "" }, { "docid": "321e5617d81e584222926ac2ff9cf7fd", "score": "0.46490648", "text": "function checkout() {\r\n\r\n // TODO - make private\r\n this.items = new Array();\r\n this.discounts = new Array();\r\n\r\n this.total = function total() {\r\n\r\n if (this.items.length === 0) {\r\n return 0;\r\n }\r\n\r\n // Apply discounts\r\n for (var i = 0; i < this.discounts.length; i++) {\r\n // TODO - type check?\r\n this.discounts[i].apply(this);\r\n }\r\n\r\n // Calculate the total\r\n var runningTotal = 0;\r\n for (var i = 0; i < this.items.length; i++) {\r\n // TODO - type check?\r\n runningTotal = runningTotal + this.items[i].cost;\r\n }\r\n\r\n return runningTotal;\r\n };\r\n\r\n this.addItem = function addItem(item) {\r\n\r\n // TODO - better way to add to an array?\r\n this.items[this.items.length] = item;\r\n }\r\n\r\n this.addDiscount = function addDiscount(discount) {\r\n\r\n this.discounts[this.discounts.length] = discount;\r\n }\r\n \r\n }", "title": "" }, { "docid": "45161b2213b62899d44778dc620a62dc", "score": "0.46310776", "text": "_receiptsUpdated() {\n if (this._receipt) {\n this.context.listener.receiptsUpdated(CdvPurchase.Platform.APPLE_APPSTORE, [this._receipt, this.pseudoReceipt]);\n this.context.listener.receiptsReady(CdvPurchase.Platform.APPLE_APPSTORE);\n }\n else {\n this.context.listener.receiptsUpdated(CdvPurchase.Platform.APPLE_APPSTORE, [this.pseudoReceipt]);\n }\n }", "title": "" }, { "docid": "aca9e24756a7ee365c9967725526980e", "score": "0.4620412", "text": "function getCreditPurchases(transaction) {\n return transaction.type == 'purchase' && transaction.paymentMethod == 'credit';\n}", "title": "" }, { "docid": "5dd4731b366df206f41593bdbf597e7e", "score": "0.46117306", "text": "static async fetch ({ currencies }) {\n let recipients = await Recipients.fetchAll();\n let filteredRecipients = recipients.filter(item => {\n for (let currency of currencies) {\n if (item.currencies[currency]) return true;\n }\n return false;\n });\n return filteredRecipients;\n }", "title": "" }, { "docid": "a71eb514fbb29ded62f76a3028a05bf6", "score": "0.4611039", "text": "function getInvoices() {\n return initializeRPCClient()\n .then(({lightning}) => promiseify(lightning, lightning.ListInvoices, {}, 'list invoices'));\n}", "title": "" }, { "docid": "80ae31e48d8e42e3790d5e9c2ab118e4", "score": "0.45849982", "text": "function OnPurchases( items )\n{\n\tfor( var i=0; i<items.length; i++ )\n\t{\n\t\tvar prodId = items[i].productId.replace(\".\",\"_\").replace(\".\",\"_\");\n\t\tif( !premium )\n\t\t{\n\t\t\t//Get appropriate button label.\n\t\t\tvar btn = prodId+\"_button\";\n\t\t\tvar label = ((items[i].purchaseState==0) ? \" Install \" : \" Buy \" );\n\t\t\twebPlug.Execute( \"document.getElementById('\"+btn+\"').value='\"+label+\"'\" );\n\t\t}\n\n\t\t//If purchased, check plugin version.\n\t\tif( items[i].purchaseState==0 ) {\n\t\t\tCheckPluginVersion( prodId );\n\t\t}\n\n\t\t//Save purchased items.\n\t\tpurchases[items[i].productId] = (items[i].purchaseState==0);\n\t}\n}", "title": "" }, { "docid": "0b76af2dcbfd09f27f0b77ba11ecb6cd", "score": "0.45848697", "text": "function get_purchase_product() {\n var product_lists = [];\n $(document).find(\".purchase_row\").each(function () {\n let product_id = parseInt($(this).find(\".product-id\").val());\n let product_name = $(this).find(\".td_prduct_name\").text().trim();\n let purchase_unit_cost = parseFloat($(this).find(\".purchase_unit_cost\").val().trim());\n let purchase_product_quantity = parseInt($(this).find(\".purchase_product_quantity\").val().trim());\n let purchase_unit_seleing_price = parseFloat($(this).find(\".purchase_unit_price\").val().trim());\n let product_amount = parseFloat($(this).find(\".product_amount\").text().trim());\n\n let product_o = {\n name: product_name,\n product_id: product_id,\n unit_cost: purchase_unit_cost,\n quantity: purchase_product_quantity,\n unit_seleing_price: purchase_unit_seleing_price,\n total_cost: product_amount\n };\n product_lists.push(product_o);\n });\n return product_lists;\n }", "title": "" }, { "docid": "ebf3fb22585b89d1b44e0c04e1b0b996", "score": "0.45673242", "text": "function itemsForSale(){\n\t// gets all the items in the products table from the database\n\tconnection.query(\"SELECT * FROM products\", function(err, result){\n\t\t// loops through the results from the mySQL database\n\t\tfor (var i = 0; i < result.length; i++){\n\t\t\t// logs the item_id, product_name & price\n\t\t\tconsole.log(\"Item ID: \" + result[i].item_id + \n\t\t\t\t\"\\n Item: \" + result[i].product_name + \n\t\t\t\t\"\\n Price: \" + result[i].price + \n\t\t\t\t\"\\n Stock Qty: \" + result[i].stock_quantity +\n\t\t\t\t\"\\n -------------------------------\");\n\t\t}\n\t// allows the buyer prompt to start after the items are listed\n\tbuyer();\n\t});\n}", "title": "" }, { "docid": "1fbe47bee01b58f34f6491ff38c1d37b", "score": "0.45292208", "text": "static async list(req, res) {\n try {\n const subscriptions = await Subscription.find({\n deleted: false,\n });\n\n return res.success(subscriptions);\n } catch (err) {\n return res.error(err.message);\n }\n }", "title": "" }, { "docid": "7f5d40f05bad4a28b466a7099e23d18a", "score": "0.45255175", "text": "function getItems() {\n var id = $(this).data(\"id\");\n $.get(\"/cart\" + id, function(data) {\n subscriptions = data;\n createItemCard();\n });\n }", "title": "" }, { "docid": "ab45729b0064c80e78b27269de628c79", "score": "0.45241103", "text": "function queryAllItems() {\n connection.query(\"SELECT * FROM bamazon\", function (err, res) {\n if (err) throw err;\n // We can create a table using the cli-table node package\n var productsTable = new bamProTable({\n // Per documentation, we declare the tables categories\n head: [\"ITEM ID\", \"PRODUCT NAME\", \"DEPARTMENT NAME\", \"PRICE\", \"QUANTITY IN STOCK\"],\n // We can also set the widths for the columns\n colWidths: [10, 15, 20, 10, 20]\n });\n // We also need to loop through our items so they can be listed on our table\n for (i = 0; i < res.length; i++) {\n // We then push our items to the newly created table\n productsTable.push(\n [res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(\"================================================================================\");\n console.log(\"<><><><><><><><><><><><><><><> WELCOME TO BAMAZON <><><><><><><><><><><><><><><>\");\n console.log(\"================================================================================\");\n // Finally we can log the completed table\n console.log(productsTable.toString());\n // and call back the inquireToBuy function to run it right after the table appears\n inquireToBuy();\n });\n}", "title": "" }, { "docid": "d6b7fb15fdbffb3151e4d08c6ac531cc", "score": "0.45087078", "text": "function generateItemsList() {\n var orderList = order.getList();\n var productItem;\n vm.items = [];\n\n orderList.forEach(function (elem) {\n var checkoutItem;\n productItem = product.getProduct(elem.id);\n\n if (angular.isObject(productItem)) {\n checkoutItem = angular.copy(productItem);\n checkoutItem['orderInfo'] = elem;\n vm.items.push(checkoutItem);\n }\n });\n }", "title": "" }, { "docid": "0184dcae58a2f5ff4b0448b7550805e4", "score": "0.45082015", "text": "list() {\n return Trans.query().with('item').fetch();\n }", "title": "" }, { "docid": "5a3c219062a64f8f5301c12276a8ae8e", "score": "0.450667", "text": "function queryProducts() {\n connection.query(\"SELECT * FROM products\", function(err, response) {\n if (err) throw err;\n console.log(\"Items On Sale...\")\n console.log(\"----------------------------------------------\" + \"\\n\");\n for (var i = 0; i < response.length; i++) {\n productsArray.push(response[i])\n console.log(\"Item: \" + response[i].product_name);\n console.log(\"Item ID #: \" + response[i].item_id);\n console.log(\"Item Price: $\" + response[i].price);\n console.log(\"===============\" + \"\\n\")\n }\n console.log(\"----------------------------------------------\" + \"\\n\");\n customerPurchase();\n })\n}", "title": "" }, { "docid": "23b2a0bd59262392f60e2be59f65f2bd", "score": "0.45052725", "text": "async getCashWithdrawals(){\n return this.client.findAll({type: CashWithdrawal})\n }", "title": "" }, { "docid": "5309428c7285b39fb81a4ad523cc1ecf", "score": "0.45035413", "text": "async function pullShopifyOrders () {\n return shopify.order\n .list()\n .catch((err) => console.error(err))\n}", "title": "" }, { "docid": "9317a007b51d8c5d4a25a33766b1105a", "score": "0.44999558", "text": "function takeoutItems(order) {\n let total = 0;\n let result = [];\n\n order.forEach(({ itemName, quantity, unitPrice } = orderItem) => {\n // console.log(itemName);\n const price = unitPrice * quantity;\n total += price;\n\n const receipt = {\n Quantity: quantity,\n Name: itemName,\n Total: price.toFixed(2),\n };\n\n result.push(receipt);\n\n console.log(\n `The item I want is ${itemName}. The quantity I need is ${quantity} and it costs £${unitPrice}.);`\n );\n });\n console.log(`Total Price: ${total}`);\n}", "title": "" }, { "docid": "29797124a15e5fd38bda4f56b1f1fe42", "score": "0.44994673", "text": "function buyItems() {\n stripe.redirectToCheckout({\n items: itemsArray,\n successUrl: DOMAIN + \"/success.html?session_id={CHECKOUT_SESSION_ID}\",\n cancelUrl: DOMAIN + \"/canceled.html\",\n shippingAddressCollection: {allowedCountries: ['SE']}\n }).then(handleResult);\n }", "title": "" }, { "docid": "4feec8e3d85dba2bf98a371ffd0816b3", "score": "0.449917", "text": "function transactionsFor(inventoryItem, transactions) {\n let filterTransactions = transactions.filter(\n (transaction) => transaction.id === inventoryItem\n );\n console.log(filterTransactions);\n return filterTransactions;\n}", "title": "" }, { "docid": "fc62c87b688b2cea233cff6f1f3261ac", "score": "0.44953105", "text": "async function getPoAllClose() {\n let customerPo = await CustomerPo.aggregate([\n { \"$match\": { \"status_po\": encryptText(\"PROCESS\") }},\n { '$project': fieldsCustomerPo }\n ]);\n\n let resDec = decryptJSON(customerPo);\n return resDec;\n}", "title": "" }, { "docid": "24a97a86e6c60dabdb70912351734d2c", "score": "0.44936532", "text": "viewCheckoutList(state, getters, rootState) {\n return state.addedcart.map(({id, itemquantity}) => {\n const exist = rootState.product.items.find(p => p.id === id)\n return {\n ...exist,\n itemquantity\n }\n })\n }", "title": "" }, { "docid": "84893ec9bdd23dc5f48bc39472d8b75a", "score": "0.44717565", "text": "function getPayments(){\n axios.get(\"http://localhost:8000/payment/display\").then((res) => {\n setPayments(res.data);\n }\n ).catch((err) => {\n alert(err.message);\n })\n }", "title": "" }, { "docid": "1c8643c1bfb87e0a33cdf40b7f2f7fcf", "score": "0.44600224", "text": "function allItemsBought(buyerID) {\n\n}", "title": "" }, { "docid": "1f13a4750443af0c77df77e508e687cd", "score": "0.44512007", "text": "static find(verifiedReceipts, product) {\n var _a, _b;\n if (!product)\n return undefined;\n let found;\n for (const receipt of verifiedReceipts) {\n if (product.platform && receipt.platform !== product.platform)\n continue;\n for (const purchase of receipt.collection) {\n if (purchase.id === product.id) {\n if (((_a = found === null || found === void 0 ? void 0 : found.purchaseDate) !== null && _a !== void 0 ? _a : 0) < ((_b = purchase.purchaseDate) !== null && _b !== void 0 ? _b : 1))\n found = purchase;\n }\n }\n }\n return found;\n }", "title": "" }, { "docid": "4c78f287a101191bc74ac1db9d139261", "score": "0.4442005", "text": "function getUnclaimedOrders(){\n\t\tdbOperations.unclaimedOrders(\"getUnclaimedOrders\",\"\").then(function(res) {\n\t\t\t// console.log(res);\n\t \t\t$scope.orders = res;\n\t \t});\n\t}", "title": "" }, { "docid": "7bdac0fa744c080a4cf3522b12674947", "score": "0.44353583", "text": "getLicenceNumbers () {\n return this.invoiceLicences.flatMap(invoiceLicence => {\n return invoiceLicence.licence.licenceNumber\n })\n }", "title": "" }, { "docid": "981e00d447ca95ae6b5fc9cea7e0bb59", "score": "0.44306934", "text": "getNeededItems(){\n return _groceryList.filter( groceryItem => groceryItem.isCompleted === false );\n }", "title": "" }, { "docid": "868d97add598f8ad7abc9ed55256cc8a", "score": "0.4425585", "text": "decryptAll(keyphrase) {\n const results = [];\n this.accounts.map((acct, i) => {\n results.push(this.decrypt(i, keyphrase));\n });\n log.info(`decryptAll for Wallet ${this.name}: ${results.reduce((c, p) => {\n return p + (c ? \"1\" : \"0\");\n }, \"\")}`);\n return results;\n }", "title": "" }, { "docid": "e5afb72a17823d2e426680ae0c4cd4c0", "score": "0.44206303", "text": "function getAllItems() {\n\treturn new Promise((resolve, reject) => {\n\t\tStoreItem.find({}, (err, items) => {\n\t\t\tif (err) reject(err);\n\t\t\t\n\t\t\tresolve(items); // all the items\n\t\t});\n\t});\n}", "title": "" }, { "docid": "a56e80da3153795a3e5e5f28fed18cfa", "score": "0.44184577", "text": "function getPayments() {\n\t$(\"#payment-history-table\").empty();\n\n\t$.ajax({\n\t\turl: \"../server/payments/getPayments.php\",\n\t\ttype: \"get\",\n\t\tsuccess: function (res) {\n\t\t\tif (res !== \"No Results\") {\n\t\t\t\tres = JSON.parse(res);\n\n\t\t\t\tres.map(function (value, index) {\n\t\t\t\t\t$(\"#payment-history-table\").append(\n\t\t\t\t\t\t`\n <tr>\n <th scope=\"row\">` +\n\t\t\t\t\t\t\tvalue.id +\n\t\t\t\t\t\t\t`</th>\n <td>\n ` +\n\t\t\t\t\t\t\tvalue.buyerName +\n\t\t\t\t\t\t\t` <br>\n ` +\n\t\t\t\t\t\t\tvalue.buyerContact +\n\t\t\t\t\t\t\t` <br>\n ` +\n\t\t\t\t\t\t\tvalue.buyerEmail +\n\t\t\t\t\t\t\t`\n </td>\n <td>` +\n\t\t\t\t\t\t\tvalue.item +\n\t\t\t\t\t\t\t`</td>\n <td>R` +\n\t\t\t\t\t\t\tvalue.payment +\n\t\t\t\t\t\t\t`</td>\n <td>` +\n\t\t\t\t\t\t\tvalue.paymentDate +\n\t\t\t\t\t\t\t`</td>\n </tr>\n `\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\terror: function () {\n\t\t\tconsole.log(\"Error: Get Payment History\");\n\t\t},\n\t});\n}", "title": "" }, { "docid": "472acdfaffecb7390eee084cd1593b7b", "score": "0.4406648", "text": "function purchaseClicked() {\n let cartItem = document.getElementsByClassName('cart-item')\n let cartTotal = document.getElementsByClassName('cart-total-price')[0].innerText\n // no selected items\n if (cartTotal == 0) {\n Swal.fire(\n 'No items in the cart',\n '',\n 'warning'\n )\n }\n else {\n let cartItems = document.getElementsByClassName('cart-items')[0]\n let date = new Date()\n let qtyFlag = 0\n inventoryRef.once(\"value\").then(function (snapshot) {\n for (let i = 0; i < cartItem.length; i++) {\n let cartItemName = document.getElementsByClassName('cart-item-title')[i].innerText\n let cartItemQuantity = document.getElementsByClassName('cart-quantity-input')[i].value\n snapshot.forEach(function (childSnapshot) {\n if ((childSnapshot.val().ID === cartItemName) && parseInt(childSnapshot.val().Quantity) < cartItemQuantity)\n qtyFlag = 1\n })\n }\n }).then(() => {\n // items exceeding stock\n if (qtyFlag == 1) {\n Swal.fire(\n 'One or more items are exceeding our stock quantity',\n '',\n 'warning'\n )\n }\n else {\n let cart = []\n //generate order id\n let str = firebase.auth().currentUser.uid + date.getTime()\n let hash = Math.abs(str.split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a }, 0))\n // record order in database\n ordersRef.push({\n Customer: firebase.auth().currentUser.uid,\n Total: cartTotal,\n Status: 'Pending',\n payment: 'Cash',\n orderDate: date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate(),\n orderId: hash,\n }).then((snap) => {\n Swal.fire({\n position: 'top',\n icon: 'success',\n title: 'Order Submitted successfully',\n showConfirmButton: false,\n timer: 3000\n })\n const key = snap.key\n for (let i = 0; i < cartItem.length; i++) {\n let cartItemName = document.getElementsByClassName('cart-item-title')[i].innerText\n let cartItemQuantity = document.getElementsByClassName('cart-quantity-input')[i].value\n cart.push({\n id: cartItemName,\n quantity: cartItemQuantity\n })\n ordersRef.child(key + '/Products').update({\n [cartItemName]: cartItemQuantity,\n })\n }\n // generate invoice\n let doc = new jsPDF()\n doc.text('Order invoice', doc.internal.pageSize.getWidth() / 2, 20, 'center')\n doc.setFontSize(12)\n doc.text('Provided by Altum Engineering Group', doc.internal.pageSize.getWidth() / 2, 30, 'center')\n doc.setFontSize(13)\n doc.text('Order ID: ' + hash.toString(), doc.internal.pageSize.getWidth() / 2, 50, 'center')\n doc.autoTable({\n styles: {\n cellPadding: 0.5,\n fontSize: 12\n },\n startY: 60,\n tableLineWidth: 0.5,\n head: [{ id: 'Product ID', quantity: 'Quantity' }],\n headStyles: {\n halign: 'center',\n fontSize: 10,\n cellPadding: 3,\n },\n body: cart,\n bodyStyles: {\n fontSize: 10,\n lineWidth: 0.2,\n halign: 'center',\n cellPadding: 1,\n },\n })\n doc.text('Total value of items : ' + cartTotal, 10, doc.internal.pageSize.getHeight() - 40)\n doc.text('Payment type : Cash', 10, doc.internal.pageSize.getHeight() - 30)\n doc.text('Order Date : ' + date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate(), 10, doc.internal.pageSize.getHeight() - 20)\n doc.output(\"dataurlnewwindow\")\n while (cartItems.hasChildNodes()) {\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n }).catch(function (error) {\n // Handle Errors here.\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: error.message,\n })\n })\n }\n })\n }\n}", "title": "" }, { "docid": "c4758fa5780e67cdd021f159daf9a8af", "score": "0.43997574", "text": "function displayItems() {\n connection.query(\n \"SELECT * FROM products\",\n function (err, results) {\n if (err) {\n console.log(err);\n } else {\n products = results;\n console.table(results);\n promptPurchase();\n } // results contains rows returned by server\n }\n\n );\n}", "title": "" }, { "docid": "733127516b54e8c64c23293f535d8da4", "score": "0.43951243", "text": "function listProducts() {\n console.log(\"Welcome to Bamazon! Items available for purchase:\\n\");\n connection.query(\"SELECT item_id, product_name, price FROM products\", function(err, res){\n if (err) throw err;\n //Trying to get results to display out of raw data project packet\n // var results = JSON.stringify(res); \n console.log(res);\n //call function to begin user selection\n selectItem();\n });\n}", "title": "" }, { "docid": "6d24a1fc84f4457124cffde41b0b83ee", "score": "0.43870917", "text": "items() {\n return this._filter();\n }", "title": "" }, { "docid": "c217af5bc096acdbe26030048fb40ddb", "score": "0.43854797", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM bamazon_db.products;\", function (err, res) {\n if (err) throw err;\n console.log(\"***************\");\n console.log(\"ITEMS FOR SALE!\");\n console.log(\"***************\");\n console.table(res);\n // link to exit app function\n exitApp();\n });\n}", "title": "" }, { "docid": "e1923074ac72aa8bd7dbcc4f89426409", "score": "0.4379055", "text": "getCompletedItems(){\n return _groceryList.filter( groceryItem => groceryItem.isCompleted === true );\n }", "title": "" }, { "docid": "8bb7ffa09bb880f86d324189b91443ae", "score": "0.4378084", "text": "deliveries() {\n return store.deliveries.filter(\n function (delivery) {\n return delivery.customerId === this.id;\n }.bind(this)\n );\n }", "title": "" }, { "docid": "a56167cce92faefcdce78acdcbb0893d", "score": "0.43774402", "text": "findInVerifiedReceipts(product) {\n return CdvPurchase.Internal.VerifiedReceipts.find(this.verifiedReceipts, product);\n }", "title": "" }, { "docid": "41078deb183ea7b92631c1ef5a77cc0b", "score": "0.43769345", "text": "async getCashWallets(){\n return this.client.findAll({type: CashWallet})\n }", "title": "" }, { "docid": "fbdf711a006c0e5f65eca178d43986e3", "score": "0.43724224", "text": "async receiptValidationBody(receipt) {\n var _a;\n const transaction = receipt.transactions[0];\n if (!transaction)\n return;\n const productId = (_a = transaction.products[0]) === null || _a === void 0 ? void 0 : _a.id;\n if (!productId)\n return;\n const product = this._products.getProduct(productId);\n if (!product)\n return;\n const purchase = transaction.nativePurchase;\n return {\n id: productId,\n type: product.type,\n offers: product.offers,\n products: this._products.products,\n transaction: {\n type: CdvPurchase.Platform.GOOGLE_PLAY,\n id: receipt.transactions[0].transactionId,\n purchaseToken: purchase.purchaseToken,\n signature: purchase.signature,\n receipt: purchase.receipt,\n }\n };\n }", "title": "" }, { "docid": "d14c194fac7223edc419b4c2873c4aa7", "score": "0.43693474", "text": "getAll() {\n return this.todoItems.toSetSeq();\n }", "title": "" }, { "docid": "24b0471005743c1d5b4ea976ab00174f", "score": "0.43663383", "text": "getPurchases(username) {\n axios.post('http://localhost:5000/purchaseslength', username)\n .then(response => {\n this.setState({ purchases: response.data });\n })\n }", "title": "" }, { "docid": "17640c3cc03deebbab2a3cfc54c83420", "score": "0.43639374", "text": "componentWillUnmount() {\n this.setState({\n purchases: [],\n purchasedTransactions: []\n })\n }", "title": "" }, { "docid": "2d12dc9597ff26b370cd401ccd7767e2", "score": "0.43617862", "text": "function getAvailable(){\n // Get the products available for purchase.\n log(\"getAvailable\");\n inappbilling.getAvailableProducts(successHandler, errorHandler);\n}", "title": "" }, { "docid": "f34172e486bd39cf4c5dd1565780bce9", "score": "0.4360656", "text": "function Products(){\n connection.query(\"SELECT * from products\", function(err, res){\n if(err) throw err;\n console.log(\"\\nThese are the items Bamazon has for sale\\n\");\n for (let i in res){\n let stuff = res[i];\n\n console.log(\n \"id: \", stuff.id,\n \"Name: \",stuff.product_name,\n \"Prices: \", stuff.price, \n \"Quantity: \", stuff.stock_quantity\n )\n }\n })\n promptUser();\n }", "title": "" }, { "docid": "78ea448e3fc42650476fbdd7221eacbc", "score": "0.43517983", "text": "getAll () {\n var records = [].concat(this.data.journal)\n return {\n accounts: this.data._usedAccounts,\n linkReferences: this.data._linkReferences,\n transactions: records.sort((A, B) => {\n var stampA = A.timestamp\n var stampB = B.timestamp\n return stampA - stampB\n }),\n abis: this.data._abis\n }\n }", "title": "" }, { "docid": "87fdaa695a393bb09cadf7a3c6556599", "score": "0.43490764", "text": "async function getPoAllOpen() {\n let customerPo = await CustomerPo.aggregate([\n { \"$match\": { \"status_po\": encryptText(\"OPEN\") }},\n { '$project': fieldsCustomerPo }\n ]);\n\n let resDec = decryptJSON(customerPo);\n return resDec;\n}", "title": "" }, { "docid": "bda6b600ad5b2b77ffbb2292b1f6b7d6", "score": "0.4344843", "text": "function verifyProducts(showcaseProducts){ \n let rideStylerProducts = [],\n successMessage = \"Your items have been added to the cart.\";\n\n showcaseInstance.app.$store.dispatch('orderdetails/showModal', {\n data: showcaseProducts\n }).then(function(verifiedProducts){\n\n for(const product in verifiedProducts){\n rideStylerProducts.push(verifiedProducts[product]);\n }\n\n Promise.all(rideStylerProducts.map(x => getProductBySku(x))).then(function(wooProducts){\n if(wooProducts[0] !== undefined && errors.length == 0){\n wooProducts.forEach(function(product){\n addProductToCart(product)\n });\n\n if(errors.length == 0){\n uiLibrary.showPrompt(successMessage, goToCart, \"Checkout\");\n } else {\n showErrors();\n }\n } else {\n showErrors();\n }\n });\n });\n }", "title": "" }, { "docid": "e56fabd801d2f66eb0a3224b818a1983", "score": "0.43378627", "text": "function morePurchases() {\n\n inquirer.prompt([{\n type: 'confirm',\n name: 'morePurchases',\n message: 'Do you want to purchase anything else?'\n }]).then(function(answer) {\n \n if (answer.morePurchases === true) {\n displayProducts();\n } else {\n console.log(\"\\nThanks for shopping with Bamazon!\")\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "ff1f77ded8997f1d279e3ae189cb32ce", "score": "0.43359232", "text": "async function getPoAllOpenClose() {\n let customerPo = await CustomerPo.aggregate([\n { '$project': fieldsCustomerPo }\n ]);\n\n let resDec = decryptJSON(customerPo);\n return resDec;\n}", "title": "" }, { "docid": "a0bf7e15cc8570fb2bdd0d86b7d4bfb7", "score": "0.4335778", "text": "function getPurchases() {\n var httpRequest = new XMLHttpRequest();\n\n if (!httpRequest) {\n alert('Giving up :( Cannot create an XMLHTTP instance');\n return false;\n }\n\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n var purchases = JSON.parse(httpRequest.responseText);\n console.log(\"GET /purchases\")\n console.log(purchases);\n var board = document.getElementById('purchases');\n if (board != null) {\n // Format/Append each purchase element to the DOM\n for(i = 0; i < purchases.length; i++) {\n var div = document.createElement('div');\n div.setAttribute('class', 'purchase');\n var purchaseText = document.createTextNode(\"amount: $\" + purchases[i].amount.toFixed(2)\n + \", Spent on: \" + purchases[i].item\n + \", Date: \" + purchases[i].date\n + \", Category: \" + purchases[i].cat);\n var p = document.createElement('p');\n p.setAttribute('class', purchases[i].cat);\n p.appendChild(purchaseText);\n div.appendChild(p);\n board.appendChild(div);\n }\n // Calculate the calculate the total uncategorized purchases\n calculateTotalUncategorized(purchases);\n }\n }\n }\n };\n httpRequest.open(\"GET\", \"/purchases\");\n httpRequest.send();\n}", "title": "" }, { "docid": "92e630bd4eed80a8f23cf0118862dcca", "score": "0.43332866", "text": "function getSaleItems(transaction){\n return transaction.items.reduce(transactionTotal, 0);\n}", "title": "" }, { "docid": "7e2044af5270cf9f967ac36e165d0a42", "score": "0.43280774", "text": "function filterProductByQuantity(listProduct) {\n let result = [];\n let j = 0;\n for (let i = 0; i < listProduct.length; i++) {\n if (!listProduct[i].isDelete && listProduct[i].quantity > 0) {\n result[j++] = listProduct[i];\n }\n }\n return result;\n }", "title": "" }, { "docid": "e4c755f169640f0f7d4a97040b32bdd8", "score": "0.4327954", "text": "function handlePurchases(result) {\n var reductionSum = result ? result.totalReductionAmount : 0;\n var numberOfPurchases = result ? result.numberOfPurchases : 0;\n\n if (numberOfPurchases >= Alloy.CFG.totalPurchasesForDiscount) {\n changeView('reduction', {\n clientId: clientId,\n reductionSum: reductionSum,\n purchases: result\n });\n }\n}", "title": "" }, { "docid": "97461ec2862266d5d72cb172f0ecf660", "score": "0.43220714", "text": "getAll() {\n let sql = 'SELECT * FROM tickets';\n return this.database.executeSql(sql, [])\n .then(response => {\n let tickets = [];\n for (let index = 0; index < response.rows.length; index++) {\n tickets.push(response.rows.item(index));\n }\n return Promise.resolve(tickets);\n })\n .catch(error => Promise.reject(error));\n }", "title": "" }, { "docid": "4f2268ea1224f0c19e2093be3d008cb4", "score": "0.43215922", "text": "function displayData(){\n connection.query(\"SELECT * FROM products\",function(err,res){\n if(err){\n console.log(err);\n }\n else{\n console.log(\"These are following items we have in stock...\");\n for(let i = 0; i < res.length; i++){\n console.log(chalk.hex(\"#719dba\")(\">>>>>>>>>>>>>>\"));\n console.log(\"Item: \"+res[i].product_name+\"\\nPrice: $\"+res[i].price+\n \"\\nStoreID: \"+res[i].item_id);\n }\n //inquirer purchase prompt begins\n purchaseInq();\n }\n });\n}", "title": "" }, { "docid": "842a8e87fd9dd9e2ebe34cc6380284dd", "score": "0.43152896", "text": "function listCart(){\n var cartCopy = [];\n\n for(var i in cart){\n var item = cart[i];\n var itemCopy = {};\n for(var p in item){\n itemCopy[p] = item[p];\n }\n cartCopy.push(itemCopy);\n }\n\n return cartCopy;\n }", "title": "" }, { "docid": "b2f66f1769ba4a9c9db5fb801d265088", "score": "0.43149808", "text": "function prods(){\r\n ProductService.GetProducts().then(function (productlist){\r\n vm.productlist = productlist;\r\n })\r\n }", "title": "" }, { "docid": "dbf08897dccdc8e1ac1f7bbec80fb795", "score": "0.43122792", "text": "getComapreProducts() {\n const itemsStream = new rxjs__WEBPACK_IMPORTED_MODULE_2__[\"Observable\"](observer => {\n observer.next(products);\n observer.complete();\n });\n return itemsStream;\n }", "title": "" }, { "docid": "a7dbf7a53ea501135630e422e9f4e15d", "score": "0.43083864", "text": "function buildBigBuyers2(){\nlet bigBuyers = [];\n customer.forEach(function(item){\n if (item.itemsPurchased.length > 5){\n bigBuyers.push(item);\n console.log(bigBuyers);\n }\n })\n}", "title": "" }, { "docid": "6813c609a0a06d86ac520b27fdedc6a4", "score": "0.429954", "text": "function list() {\n return contacts;\n }", "title": "" }, { "docid": "97443dc2f2f8d44101cca2125642a148", "score": "0.42922243", "text": "function getReceivers(env, callback){\n var docClient = new AWS.DynamoDB.DocumentClient();\n var scanparams = {\n TableName: getTableNames(env)\n };\n\n docClient.scan(scanparams, function(err, data){\n if (err){\n callback(err);\n } else {\n var receivers = [];\n data.Items.forEach(function(item, idx, array){\n receivers.push(item.email)\n });\n callback(null,receivers);\n }\n })\n\n}", "title": "" }, { "docid": "38b273351cd0deeb55e519dfed84c4ba", "score": "0.4290497", "text": "unsubscribeAll() {\n const closingPromises = [];\n for (const contract of this.subscriptions.keys()) {\n closingPromises.push(this.unsubscribeContract(contract));\n }\n return Promise.all(closingPromises).then();\n }", "title": "" }, { "docid": "e43070bed2bb802cd3ef577873299c8a", "score": "0.4284384", "text": "function displayItems() {\n\tconsole.log(\"Welcome to Bamazon! Here are our products available for sale:\\n\");\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\n\t\tfor (var i = 0; i < res.length; i++) {\n\t console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + \"$\" + res[i].price);\n\t }\n\t console.log(\"-------------------------------------------------------------------\");\n\t});\n}", "title": "" }, { "docid": "4261c8ef407dfbbd48850b09a80b0104", "score": "0.4276604", "text": "function getAllTickets() {\n return new Promise((resolve, reject) => {\n try {\n zendesk.tickets.list().then(function (result) {\n resolve(result);\n });\n } catch (err) {\n reject(err);\n }\n });\n}", "title": "" }, { "docid": "5e53d43c88738e3885a63d12315286f7", "score": "0.4264181", "text": "get() {\n return JSON.parse(localStorage.getItem(\"dev.finances:transactions:\")) || []\n }", "title": "" }, { "docid": "b8ddfd0ce028de0446245cf23495d2ab", "score": "0.42613998", "text": "function getPurchasesData(tmpTraderInfo, sessionID) {\n let multiplier = 0.9;\n let data = profile_f.profileServer.getPmcProfile(sessionID);\n let equipment = data.Inventory.equipment;\n let stash = data.Inventory.stash;\n let questRaidItems = data.Inventory.questRaidItems;\n let questStashItems = data.Inventory.questStashItems;\n\n data = data.Inventory.items; // make data as .items array\n\n //do not add this items to the list of soldable\n let notSoldableItems = [\n \"544901bf4bdc2ddf018b456d\", //wad of rubles\n \"5449016a4bdc2d6f028b456f\", // rubles\n \"569668774bdc2da2298b4568\", // euros\n \"5696686a4bdc2da3298b456a\" // dolars\n ];\n\n //start output string here\n let purchaseOutput = '{\"err\": 0,\"errmsg\":null,\"data\":{';\n let outputs = [];\n let memo = {};\n\n for (let item of data) {\n if (item._id !== equipment\n && item._id !== stash\n && item._id !== questRaidItems\n && item._id !== questStashItems\n && !notSoldableItems.includes(item._tpl)) {\n\n let preparePrice = getItemTotalPrice(data, item, memo);\n\n // convert the price using the lastTrader's currency\n preparePrice = itm_hf.fromRUB(preparePrice, itm_hf.getCurrency(trader_f.traderServer.getTrader(tmpTraderInfo, sessionID).data.currency));\n\n // uses profile information to get the level of the dogtag and multiplies\n // the prepare price after conversion with this factor\n if (itm_hf.isDogtag(item._tpl) && item.upd.hasOwnProperty(\"Dogtag\")) {\n preparePrice = preparePrice * item.upd.Dogtag.Level;\n }\n\n preparePrice *= multiplier;\n\n preparePrice = (preparePrice > 0 && preparePrice !== \"NaN\" ? preparePrice : 1);\n outputs.push('\"' + item._id + '\":[[{\"_tpl\": \"' + item._tpl + '\",\"count\": ' + preparePrice.toFixed(0) + '}]]');\n }\n }\n\n purchaseOutput += outputs.join(',') + \"}}\"; // end output string here\n return purchaseOutput;\n}", "title": "" } ]
8a6de32025ba44d2b64249a9214c7dee
Create the Model Class
[ { "docid": "7cf41c5e30166c65453f5c20121ceb01", "score": "0.0", "text": "function ExchangeRates(defaultValues){\n\t\tvar privateState = {};\n\t\t\tprivateState.currency = defaultValues?(defaultValues[\"currency\"]?defaultValues[\"currency\"]:null):null;\n\t\t\tprivateState.errmsg = defaultValues?(defaultValues[\"errmsg\"]?defaultValues[\"errmsg\"]:null):null;\n\t\t\tprivateState.exchangeRate = defaultValues?(defaultValues[\"exchangeRate\"]?defaultValues[\"exchangeRate\"]:null):null;\n\t\t//Using parent contructor to create other properties req. to kony sdk\t\n\t\t\tBaseModel.call(this);\n\n\t\t//Defining Getter/Setters\n\t\t\tObject.defineProperties(this,{\n\t\t\t\t\"currency\" : {\n\t\t\t\t\tget : function(){return privateState.currency},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['currency'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"errmsg\" : {\n\t\t\t\t\tget : function(){return privateState.errmsg},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['errmsg'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"exchangeRate\" : {\n\t\t\t\t\tget : function(){return privateState.exchangeRate},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['exchangeRate'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t});\n\n\t}", "title": "" } ]
[ { "docid": "51c5108f9931bfbfdf6484f70644c74d", "score": "0.7571185", "text": "function Model() {}", "title": "" }, { "docid": "109af4b465b085caa5e951ddfbb787c0", "score": "0.6950639", "text": "createModels() {\n this.Question = this.db.model('Question', require('../../schemas/question').default);\n this.QuestionSet = this.db.model('QuestionSet', require('../../schemas/questionset').default);\n this.Response = this.db.model('Response', require('../../schemas/response').default);\n this.User = this.db.model('User', require('../../schemas/user').default);\n this.Company = this.db.model('Company', require('../../schemas/company').default);\n this.Node = this.db.model('Node', require('../../schemas/node').default);\n this.Token = this.db.model('Token', require('../../schemas/token').default);\n this.Options = this.db.model('Options', require('../../schemas/options').default);\n }", "title": "" }, { "docid": "47560337c819a0aaa44247f002a6df3f", "score": "0.68920255", "text": "create(modelClass = class Default {}) {\n // create an instance\n this.__instance = this.sequelize.define({\n ...this.shape\n }, {\n underscored: this.underscored,\n defaultScopes: this.defaultScopes,\n scopes: this.scopes,\n hooks: this.hooks,\n classMethods: this.classMethods,\n instanceMethods: this.instanceMethods\n });\n\n // runs custom definitions\n this.customs(this.__instance, this);\n\n return this.__instance;\n }", "title": "" }, { "docid": "7487dc6b40e1a98ffd19e6bdc7b7b5c1", "score": "0.6865441", "text": "function Model() {\n //this.data = {}; // serializable data\n }", "title": "" }, { "docid": "bf974d351a6cc882bed93d5c391f5393", "score": "0.68522656", "text": "static createModel(inobj) {\n\t\tconst model = super.createModel(inobj);\n\t\tmodel.creationDate = new Date();\n\t\tmodel.pid = process.pid;\n\t\treturn model;\n\t}", "title": "" }, { "docid": "e6db593127c4942bd760a92a591cf332", "score": "0.67336154", "text": "model() {}", "title": "" }, { "docid": "aeeb9e04412a710e30c58ce7318326ee", "score": "0.6732188", "text": "function Model() {\n this.modelName = \"M3\";\n}", "title": "" }, { "docid": "ea731614172df285fe0fe982748f93c3", "score": "0.66775537", "text": "model (): Class<Model> {\n return Model\n }", "title": "" }, { "docid": "99a0a0332ad916e0879aa0a7eeb14aa1", "score": "0.6613153", "text": "function ModelFactory() {\r\n\r\n\t\tvar classMap = {\r\n\t\t};\r\n\r\n\t\treturn {\r\n\t\t /**\r\n\t\t * Creates instance of a model class\r\n\t\t * @param modelName {string} Name of class to instantiate\r\n\t\t * @returns {object} Instance of the model class\r\n\t\t */\r\n\t\t\tgetInstance: function(modelName) {\r\n \t\treturn new classMap[modelName]();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "764f833de9f39cba132bf2c1ed8effc4", "score": "0.6556546", "text": "function _createModel(_modelObj) {\n var modelObj = {\"modelName\" : _modelObj.name,\n \"defFileName\" : _modelObj.definition,\n \"daoName\" : _modelObj.DAO || MojoOptions.defaultDAO,\n \"className\" : _modelObj.className || MojoOptions.defaultModelClass};\n\n try {\n Mojo.addModel(modelObj);\n TRACE(\"Creating \" + modelObj.className + \" with name: '\" + modelObj.modelName + \"' dao: '\" + modelObj.daoName + \"'\", [Mojo.constants.components.FLOW, _name]);\n }\n catch (ex) {\n _publishError(\"Could not create Model of className: '\" + className + \" . Hint: cannot be namespaced, try passing an alias\");\n }\n }", "title": "" }, { "docid": "311fdae82d65bf41bd6b4cd225a54ad2", "score": "0.6531426", "text": "constructor (model = undefined) {\n this.model = model\n }", "title": "" }, { "docid": "d65f3b1fb88fe0a5176c8840621ac965", "score": "0.64957535", "text": "function CreateModel(){\n SaveModel();\n let inputData = getInput(app.dataSelected);\n activeModel = new ModelClass(app.epochSelected,inputData[0],inputData[1]);\n let layers = [];\n layers.push(tf.layers.conv2d({filters:8, kernelSize:5,padding:'same',activation:'relu',inputShape:[64,64,3]}));\n\tlayers.push(tf.layers.maxPooling2d({poolSize:2}));\n\tlayers.push(tf.layers.conv2d({filters:16, kernelSize:3,padding:'same',activation:'relu'}));\n\tlayers.push(tf.layers.maxPooling2d({poolSize:2}));\n\tlayers.push(tf.layers.flatten());\n\tlayers.push(tf.layers.dense({units:64, activation:'relu'}));\n layers.push(tf.layers.dense({units:Object.keys(dataDict).length, activation:'softmax'}));\n let loss = \"sparseCategoricalCrossentropy\";\n let optimizer = \"adam\";\n let metrics = [\"accuracy\"];\n activeModel.BuildModel(layers,loss,optimizer,metrics);\n TrainModel();\n}", "title": "" }, { "docid": "16103129bc39d90254016509ab2f1441", "score": "0.64823425", "text": "model(attrs, options) {\n return new Model(attrs, options);\n }", "title": "" }, { "docid": "272e06d5a32fdc826c23cd23c9f0c24a", "score": "0.6451815", "text": "function createModel() {\n app.models.create('pets', [\"dog\", \"cat\"]).then(\n (response) => {\n console.log(response);\n },\n (error) => {\n console.error(error);\n }\n );\n}", "title": "" }, { "docid": "fd38c172664e114e7403d233df8fd7ba", "score": "0.6437897", "text": "constructor(model) {\n this.model = model;\n }", "title": "" }, { "docid": "761d2d70b616dc34ea1349c3e760de4b", "score": "0.6437509", "text": "function ModelS () {\n this.model = \"ModelS\";\n}", "title": "" }, { "docid": "e0058cace8ae8ab43abb965067d8b17d", "score": "0.64231086", "text": "constructor() {\n super();\n // sub class should bind the model class\n this._Model = null;\n this._cache = new (require('./cache/Redis'))();\n this._database = new Mysql();\n }", "title": "" }, { "docid": "9db5036c97578977250da82235e7d5d5", "score": "0.6342146", "text": "constructor(model) {\n this.modelName = model;\n this.Model = mongoose.model(model);\n }", "title": "" }, { "docid": "1d7119d836de5e7057ac871d2c641330", "score": "0.63376117", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdEntity);\n }", "title": "" }, { "docid": "7d7682c8a2ce746ede30883644f390b8", "score": "0.6305077", "text": "function LAppModel()\n{\n //L2DBaseModel.apply(this, arguments);\n L2DBaseModel.prototype.constructor.call(this);\n \n this.modelHomeDir = \"\";\n this.modelSetting = null;\n this.tmpMatrix = [];\n}", "title": "" }, { "docid": "e32f020d19597a42021a146d46f95f96", "score": "0.6300768", "text": "function ModelDomain() {\n}", "title": "" }, { "docid": "b6f6ec8928c865b348b3c0992ff4ead4", "score": "0.62900954", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ConcreteEntityType);\n }", "title": "" }, { "docid": "fbcf6f11d877ede68b33dee0dafd645c", "score": "0.62895226", "text": "static newModel(connection, name, schema) {\n const NewModel = class extends BaseModel {\n };\n NewModel.connection(connection, name);\n for (const column_name in schema) {\n const property = schema[column_name];\n NewModel.column(column_name, property);\n }\n return NewModel;\n }", "title": "" }, { "docid": "b74f486b03a0dbf8ca9414fe20a8fe37", "score": "0.62789977", "text": "function create(_modelDataName, _parameter) {\n\t\t// console.log(\"cog1.model.create: \" + _modelDataName + \" \" + typeof _modelDataName);\n\t\t// Try to load a modelData-module with the name _modelDataName.\n\t\tif(_modelDataName === undefined || typeof _modelDataName !== \"string\") {\n\t\t\tconsole.error(\"Error: Parameter for modelData not a String.\");\n\t\t\t//alert(\"Error: Parameter for modelData not a String.\");\n\t\t\treturn;\n\t\t}\n\t\t// Return access object to the model.\n\t\tvar newModelObj = {\n\t\t\t//\n\t\t\t// Fields.\n\t\t\t//\n\t\t\t// Name of the model data module. Used for debug.\n\t\t\tname : _modelDataName,\n\t\t\t// 3D Data Store, containing the mesh, etc.\n\t\t\t// Vertices are blocks of points with X Y Z.\n\t\t\t// Polygons should be closed, i.e. first=last point.\n\t\t\t// Colors are assigned to polygons corresponding to the order in polygonData.\n\t\t\tmodelData : null,\n\t\t\t// 4d (quad4) working copy of the vertices to apply transforms to eye/camera coordinates.\n\t\t\ttransformedVertices : null,\n\t\t\t// 4d (quad4) vertices after transformation and projection in screen coordinates.\n\t\t\tprojectedVertices : null,\n\t\t\t// Needed for ready.\n\t\t\tinitTransformedVertricesDone : false,\n\t\t\tinitProjectedVerticesDone : false,\n\t\t\t// Working copy of the normals to apply transform.\n\t\t\ttransformedVertexNormals : null,\n\t\t\ttransformedPolygonNormals : null,\n\t\t\t// Needed for ready.\n\t\t\tinitTransformedNormalsDone : false,\n\t\t\t// Set true if no texture defined in modelData.\n\t\t\tloadingTextureDone : false,\n\t\t\t// Texture object with image data.\n\t\t\ttexture : null,\n\t\t\t//\n\t\t\t// Public functions.\n\t\t\t//\n\t\t\tisReady : isReady,\n\t\t\tsetData : setData,\n\t\t\tgetData : getData,\n\t\t\tgetTexture : getTexture,\n\t\t\tgetTransformedVertices : getTransformedVertices,\n\t\t\tgetProjectedVertices : getProjectedVertices,\n\t\t\tgetTransformedVertexNormals : getTransformedVertexNormals,\n\t\t\tgetTransformedPolygonNormals : getTransformedPolygonNormals,\n\t\t\t//\n\t\t\tapplyMatrixToVertices : applyMatrixToVertices,\n\t\t\tapplyMatrixToTransformedVertices : applyMatrixToTransformedVertices,\n\t\t\tapplyMatrixToNormals : applyMatrixToNormals,\n\t\t\tprojectTransformedVertices : projectTransformedVertices,\n\t\t\ttoggleTriangulation : toggleTriangulation,\n\t\t\tcleanData : cleanData\n\t\t};\n\n\t\t// Load the modelData of the required 3d model.\n\t\t// The require forks, loads then calls given callback.\n\t\trequire([\"cog1/modelData/\" + _modelDataName], function(_modelData) {\n\t\t\t_requiredModelDataCbk.call(newModelObj, _modelData, _parameter);\n\t\t});\n\t\treturn newModelObj;\n\t}", "title": "" }, { "docid": "a2d3d69c68abbc988da4f7efde93909c", "score": "0.6273665", "text": "function buildModel() {\n var MM = new Model('MetaVisu');\n\n var ClassA = Class.newInstance(\"A\");\n ClassA.addAttribute('wheels', Number);\n ClassA.setReference('next',ClassA,1)\n\n var ClassB = Class.newInstance(\"B\");\n ClassB.setAttribute('name',String)\n ClassB.addAttribute('quality', String);\n ClassB.setReference('wheelQuality',ClassA,-1);\n\n ClassA.setReference('xf',ClassB,1);\n\n var ClassC = Class.newInstance(\"C\");\n ClassC.addAttribute('name', String);\n\n ClassA.setReference('reminder',ClassC,-1);\n\n MM.add([ClassA,ClassB,ClassC])\n\n var smallA = ClassA.newInstance();\n smallA.wheels = 4;\n\n\n var bigA = ClassA.newInstance();\n bigA.wheels = 6;\n bigA.next=smallA\n\n var smallB = ClassB.newInstance();\n smallB.name='TUV'\n smallB.quality = 'good';\n smallB.wheelQuality=[smallA, bigA];\n\n var xA = ClassA.newInstance({wheels: 2});\n\n var xxA = ClassA.newInstance({wheels: 1});\n\n smallA.next=xA;\n xA.next=xxA;\n\n var smallx = ClassB.newInstance({name: 'NordVerif', quality: 'medium'});\n smallx.wheelQuality=[xA,xxA];\n\n var cein = ClassC.newInstance({name: 'Change'});\n smallA.reminder=cein;\n xxA.reminder=cein;\n\n var M = new Model('Testvisu')\n\n M.setReferenceModel(MM);\n\n M.add([smallA, smallB, bigA, cein, xA, xxA, smallx]);\n\n return M;\n}", "title": "" }, { "docid": "a6d8ccafc4957cac62f10a166ea83df3", "score": "0.62689507", "text": "_build() {\n return new this.klass(this.id, this.attributes, this.relationships);\n }", "title": "" }, { "docid": "e3cb1dcfb83fc826947a09a3190a4103", "score": "0.62484163", "text": "_create() {\n return super._create().then((model) => {\n Object.assign(this, model);\n return this;\n });\n }", "title": "" }, { "docid": "e19ac8b4f679e9012a989597adf6c654", "score": "0.62448615", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, Msd);\n }", "title": "" }, { "docid": "72323c78e19693bb0242ddd130224465", "score": "0.62383246", "text": "constructor() { \n \n ModelRecord.initialize(this);\n }", "title": "" }, { "docid": "38df0ecdb921c45ca1ff33d449711871", "score": "0.6227304", "text": "function _ModelMgr() {}", "title": "" }, { "docid": "636b1590598f02742e1ead9078382feb", "score": "0.6211098", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ParameterizedEntityType);\n }", "title": "" }, { "docid": "ab607e1baed8c2e9ddd6024f30cf1720", "score": "0.62087715", "text": "function Model() {\n this._id = _.uniqueId();\n modelInstances[this._id] = this;\n}", "title": "" }, { "docid": "bc7edb027c203cc772b109fc8449b2e8", "score": "0.6184713", "text": "function createModel(filePath) {\n const modelSource = require(filePath);\n if (typeof modelSource === 'function' ) {\n const model = modelSource(Sequelize, sequelize, config);\n models[model.name.slice(0,1).toLocaleUpperCase() + model.name.slice(1)] = model;\n }\n }", "title": "" }, { "docid": "c9a915186a688b1fb97c617edac6b40f", "score": "0.61788356", "text": "function ModelX () {\n this.model = \"ModelX\";\n}", "title": "" }, { "docid": "de0e7f6e0d8f319ff83b8a89b0d77c86", "score": "0.61636084", "text": "function ModelHelper() {\n\t\n}", "title": "" }, { "docid": "a24aea3f651ddee652193c50c6f51c2f", "score": "0.61622196", "text": "function Model(controller) {}", "title": "" }, { "docid": "101c9044d6249d8cf7483432cf1da14c", "score": "0.6143979", "text": "function _initModels() {\n modelClasses = {\n scraping_job: connection.model('scraping_jobs', scrapingJobSchema),\n };\n}", "title": "" }, { "docid": "f6d964ca71985e1ab194ccd8906c63b7", "score": "0.6141522", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, TypeParameter);\n }", "title": "" }, { "docid": "aad277f80ca035f6e738ab5241312a06", "score": "0.6115404", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdMetadata);\n }", "title": "" }, { "docid": "eb8b72a8a78ec16ad141ba7cc7efc980", "score": "0.6105508", "text": "function model(name) {\n return (constructor) => {\n initializeSchema(constructor);\n constructor.schema.name = name;\n };\n}", "title": "" }, { "docid": "d9c414cd9077824187070ef27e430d52", "score": "0.6093785", "text": "constructor() {\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 102;\n this.Technicians = new TechnicianModel_1.TechnicianModel();\n //this.Languages = new LanguageModel();\n this.RegisteredUsers = new RegisteredUserModel_1.RegisteredUserModel();\n //this.Skills =new SkillModel();\n this.Ratings = new RatingModel_1.RatingModel();\n this.Salons = new SalonModel_1.SalonModel();\n this.Clients = new ClientModel_1.ClientModel();\n this.Discounts = new DiscountModel_1.DiscountModel();\n }", "title": "" }, { "docid": "2732317445d5f2bd9d6719ef5879084b", "score": "0.6085931", "text": "function Model(props) {\n return __assign({ Type: 'AWS::SageMaker::Model' }, props);\n }", "title": "" }, { "docid": "ce89f6d17334423a9f48fe35d2ed5e64", "score": "0.60839885", "text": "function createSensimityModel(name, args) {\n switch (name) {\n case \"BeaconLog\":\n return new (require(\"./../models/BeaconLog\").Model)(args);\n case \"BeaconNotified\":\n return new (require(\"./../models/BeaconNotified\").Model)(args);\n case \"BusinessRule\":\n return new (require(\"./../models/BusinessRule\").Model)(args);\n default:\n return new (require(\"./../models/KnownBeacon\").Model)(args);\n }\n}", "title": "" }, { "docid": "39ee08dba2725023411416b234fe1e8e", "score": "0.6072169", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, EntityTypeParameterType);\n }", "title": "" }, { "docid": "5450ab20be23e9debb6d0ed04b4d2650", "score": "0.6030508", "text": "constructor(model) {\n\tsuper();\n this.model = model;\n }", "title": "" }, { "docid": "d59d99d535af0bea4cf881f58c45dfcc", "score": "0.6029051", "text": "create(data) {\n return this.model.create(data, this);\n }", "title": "" }, { "docid": "9c4bc36b58e062dbd7864577ee3feff0", "score": "0.60151976", "text": "function Model() {\n var _this;\n\n _classCallCheck(this, Model);\n\n _this = _super.call(this);\n _this.__floorplan = new _floorplan.Floorplan();\n _this.__roomItems = [];\n return _this;\n }", "title": "" }, { "docid": "3eb3f5b5c37b332b54d9c2c159feea96", "score": "0.60103", "text": "static get type() { return 'dbModel'; }", "title": "" }, { "docid": "c9db2fe20254564c6d887b4f2bc09674", "score": "0.6008349", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdDomainModel);\n }", "title": "" }, { "docid": "32ab83d38da0855a211a4bfb8546b42a", "score": "0.60002214", "text": "function createModel(adapter, type) {\n function Model(data) {\n var self = this;\n data = data || {};\n\n this._adapter = adapter;\n this._type = type;\n\n this._update(data, true);\n\n _.each(adapter._routes[inflection.pluralize(type)], function(val, key) {\n if (Model.prototype[key]) {\n return;\n }\n\n Object.defineProperty(self, key, {\n get: function() {\n if (this === Model.prototype) {\n return true;\n }\n\n var link = self._adapter._getLink(self, key);\n if (!link) {\n return Q.reject(new Error('could not find link for ' + key + ' from ' + self._type));\n }\n\n return self._adapter.get(link, {}, !self.links[key]);\n }\n });\n });\n };\n\n Model.prototype._type = type;\n\n Object.defineProperty(Model.prototype, 'href', {\n get: function() {\n return this._href;\n }\n });\n\n Model.prototype.save = function(cb) {\n var self = this;\n cb = cb ||\n function() {};\n\n return this._adapter.update(this.href, this.toJSON()).then(function(payload) {\n cb(null, self);\n return self;\n }, function(err) {\n cb(err);\n return Q.reject(err);\n });\n };\n\n Model.prototype.get = function(what, _list) {\n var self = this;\n var pre = this._loaded ? Q() : this.refresh();\n\n return pre.then(function() {\n if (self[what]) {\n return Q(self[what]);\n }\n\n var link = self._adapter._getLink(self, what);\n if (!link) {\n return Q.reject(new Error('could not compute link ' + what + ' for ' + obj._type), null);\n }\n\n if (_.isUndefined(_list)) {\n _list = !self.links[what];\n }\n\n return self._adapter.get(link, {}, _list);\n });\n };\n\n // Model.prototype.create = function(what, data) {\n // var self = this;\n //\n // if (typeof what !== 'string') {\n // data = what || {};\n //\n // return this._adapter.create(this.href, data);\n // }\n //\n // var pre = this._loaded ? Q() : this.refresh();\n //\n // return pre.then(function() {\n // var link;\n //\n // what = inflection.pluralize(what);\n //\n // if (!data) {\n // data = {};\n // }\n //\n // if (self.links[what]) {\n // link = self.links[what];\n // } else {\n // link = self._adapter._getLink(self, what);\n // }\n //\n // if (!link) {\n // return Q.reject(new Error('could not find link for ' + what + ' from ' + self._type), null);\n // }\n //\n // return self._adapter.create(link, data);\n // });\n // };\n\n Model.create = function(data) {\n return adapter.create(inflection.pluralize(type), data);\n };\n\n Model.prototype.create = function(what, data) {\n if (!_.isString(what)) {\n data = what || {};\n return this._adapter.create(this.href, data);\n }\n\n var self = this;\n\n var pre = this._loaded ? Q() : this.refresh();\n\n return pre.then(function () {\n var link;\n what = inflection.pluralize(what);\n if (!data) {\n data = {};\n }\n\n if (self.links[what]) {\n link = self.links[what];\n } else {\n link = self._adapter._getLink(self, what);\n }\n\n if (!link) {\n return Q.reject(new Error('could not find link for ' + what + ' from ' + self._type), null);\n }\n\n return self._adapter.create(link, data);\n });\n };\n\n Model.prototype.unstore = Model.prototype.delete = function() {\n return this._adapter.delete(this.href);\n };\n\n Model.prototype.do = function(what, args) {\n var self = this;\n var act = this._adapter._routes[inflection.pluralize(this._type)][what];\n var collect = {};\n\n collect[inflection.pluralize(this._type)] = this;\n\n for (var n in act.fields) {\n var itm = act.fields[n];\n for (var a = 0; a < itm.length; a++) {\n if (typeof args[n] != 'undefined' && (typeof args[n] == itm[a]._type || args[n]._type == itm[a].type)) {\n args[itm[a].name || n] = itm[a].value ? handle_bars(args[n], itm[a].value) : args[n];\n if (itm[a].name && itm[a].name != n) delete args[n];\n break;\n }\n }\n }\n\n var url = handle_bars(collect, act.href);\n return this._adapter._request(act.method, url, args);\n };\n\n Model.prototype._update = function(data, incomplete) {\n // clear the object\n if (!incomplete) {\n for (var n in this) {\n if (this.hasOwnProperty(n) && n !== '_adapter' && n !== '_type') {\n delete this[n];\n }\n }\n }\n\n // same as init in copying over object\n this._href = data.href;\n this._setValues = {};\n this._deferred = data._deferred || false;\n this.links = data.links || {};\n this._rawData = data;\n this._loadTime = new Date();\n this._keys = _.keys(this);\n\n if (!this._href) {\n _.extend(this, data);\n } else {\n _.each(data, function(val, key) {\n if (['href', 'links'].indexOf(key) >= 0 || Model.prototype[key]) {\n return;\n }\n\n Object.defineProperty(Model.prototype, key, {\n enumerable: true,\n get: function() {\n if (this === Model.prototype) {\n return true; // not working on an object\n }\n\n if (this._deferred) {\n return this.get(key);\n }\n\n return this._setValues[key] || this._rawData[key] || val;\n },\n set: function(value) {\n this._setValues[key] = value;\n }\n });\n });\n }\n };\n\n Model.prototype.toJSON = function() {\n var obj = {};\n\n for (var n in this) {\n if (n[0] == '_' || n == 'type') {\n continue;\n }\n\n if (typeof this[n] == 'function') {\n continue;\n }\n\n obj[n] = this[n];\n }\n\n return obj;\n };\n\n Model.prototype._addAction = function(action) {\n if (Model.prototype[action]) {\n return;\n }\n\n Model.prototype[action] = function(args) {\n return this.do(action, args);\n };\n };\n\n Model.prototype.refresh = function() {\n return this._adapter.get(this.href);\n };\n\n Object.defineProperty(Model, 'query', {\n get: function() {\n return adapter.list(type + 's');\n }\n });\n\n return Model;\n}", "title": "" }, { "docid": "0b324f70a1ea01e4a05200f0a153f429", "score": "0.5996746", "text": "function Model (name, price, sizeCategory) {\n this.name = name;\n this.price = price;\n this.sizeCategory = sizeCategory;\n \n this.head = new BodyPart();\n this.torso = new BodyPart();\n this.leftArm = new BodyPart();\n this.rightArm = new BodyPart();\n this.leftLeg = new LeftLeg();\n this.rightLeg = new RightLeg();\n}", "title": "" }, { "docid": "0a55fd2a3beb57fb4aae0ed24e5d7847", "score": "0.5992525", "text": "buildModel() {\n this.model = mat4.create();\n //translates the model by 'translation' found in constructor\n mat4.translate(this.model, this.model, this.translation);\n //scales the model by the 'scale' found in the constructor\n mat4.scale(this.model, this.model, this.scale);\n //multiplies model by rotation and assings this to model \n mat4.mul(this.model, this.model, this.rotation);\n }", "title": "" }, { "docid": "a516b5660d830924e0606811fea540d5", "score": "0.5990059", "text": "function Model() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Model);\n\n this._completed = false;\n this._operands = [];\n this._operations = [];\n this._inputs = null;\n this._outputs = null;\n this._backend = options.backend;\n }", "title": "" }, { "docid": "2a3d95f614129c9d0df3f6d16b8d9add", "score": "0.5984909", "text": "create() {\n \n }", "title": "" }, { "docid": "ef4a91c7b45eff4783e7fd6765a153eb", "score": "0.59812003", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdAttribute);\n }", "title": "" }, { "docid": "690ae184b9b95a50518837b5b7a4031e", "score": "0.59738284", "text": "model(name, schema) {\n var _a;\n Object.keys(schema).forEach((key) => {\n if (![Number, Boolean, Object, Array, Date, String].includes(schema[key]))\n throw new Error(\"Types must be either Number, Boolean, Object, Array, Date, or String.\");\n });\n //@ts-ignore\n schema.createdAt = Date;\n //@ts-ignore\n schema.updatedAt = Date;\n this.models.set(name, schema);\n if (!this.cache[name])\n this.cache[name] = {};\n this.__save__();\n const that = this;\n return _a = class __ extends Schema {\n /**\n * Creates a document.\n * @param data Data to use.\n */\n constructor(data) {\n super();\n const doc = {\n __id__: that.__uuid__(),\n };\n Object.keys(data).forEach((key) => {\n if (!Object.keys(__.schema).includes(key))\n throw new Error(`Mismatched key: '${key}'`);\n if (data[key].constructor !== __.schema[key])\n throw new Error(`Mismatched type`);\n this[key] = doc[key] = data[key] ?? null;\n });\n this.createdAt = new Date();\n this.updatedAt = new Date();\n this.__id__ = doc.__id__;\n that.cache[name][this.__id__] = doc;\n this.__save__();\n }\n /**\n * Creates a document.\n * @param data Data to use.\n */\n static create(data) {\n return new __(data);\n }\n /**\n * Wipes the table.\n */\n static wipe() {\n that.cache[name] = {};\n that.__save__();\n }\n /**\n * Deletes the document.\n */\n __delete__() {\n delete that.cache[name][this.__id__];\n that.__save__();\n }\n /**\n * Saves the changed document.\n */\n __save__() {\n this.updatedAt = new Date();\n Object.keys(__.schema).forEach((key) => {\n if (this[key].constructor !== __.schema[key])\n throw new Error(`Mismatched type`);\n that.cache[name][this.__id__][key] = this[key];\n });\n that.__save__();\n }\n /**\n * Retrieves an item.\n * @param query Query to search for the item.\n */\n static findOne(query) {\n return this.values.find((item) => Object.keys(query).every((key) => item[key] === query[key]));\n }\n /**\n * Retrieves an item by id.\n * @param id Id to get.\n */\n static findById(id) {\n return this.values.find((item) => item.__id__ === id);\n }\n /**\n * Returns all items that satisfy the query.\n * @param query Query to search for.\n */\n static find(query) {\n return this.values.filter((item) => Object.keys(query).every((key) => item[key] === query[key]));\n }\n /**\n * Finds one item and deletes it.\n * @param query Query to search for the item.\n */\n static findOneAndDelete(query) {\n const item = __.findOne(query);\n if (!item)\n throw new Error(`Could not find a document with that query`);\n item.__delete();\n return item;\n }\n /**\n * Finds one item and updates it.\n * @param query Query to search for the item.\n * @param update Data to update.\n */\n static findOneAndUpdate(query, update) {\n const item = __.findOne(query);\n if (!item)\n throw new Error(`Could not find a document with that query`);\n Object.keys(update).forEach((key) => {\n if (typeof item[key] !== \"undefined\")\n item[key] = update[key];\n });\n item.__save__();\n return item;\n }\n /**\n * Updates and inserts if the item does not exist, hence the name, upsert.\n * @param query Query to search for the item.\n * @param data Data to insert.\n */\n static upsert(query, data) {\n const item = __.findOne(query);\n if (!item)\n return __.create(data);\n __.findOneAndUpdate(query, data);\n return item;\n }\n /**\n * All the values in the table.\n */\n static get values() {\n return Object.values(that.cache[name]);\n }\n },\n /**\n * The schema.\n */\n _a.schema = schema,\n /**\n * The name.\n */\n _a.__name__ = name,\n _a;\n }", "title": "" }, { "docid": "e8bccd239cc50d24e043dcac0e26d1dd", "score": "0.5969606", "text": "constructor() {\n\n this.model = new Model();\n this.view = new View(this.model);\n this.controller = new Controller(this.model, this.view);\n this.controller.init();\n\n }", "title": "" }, { "docid": "ae6304c2f138b50c81831d5cdc4b0a73", "score": "0.5966703", "text": "createModel(name, collection, schema) {\n const schemaObj = new Schema(schema, { collection });\n const model = this.conn.model(collection, schemaObj);\n\n return {\n name,\n model\n };\n }", "title": "" }, { "docid": "141b35f2479acde6f386bb744b7e9f4e", "score": "0.59637564", "text": "function Creator(){}", "title": "" }, { "docid": "3ce91be9742d285cb0fd3dded9577f0f", "score": "0.5956831", "text": "static get description() {\n return \"Create New Model\";\n }", "title": "" }, { "docid": "550453736c957d3a90d5ac8652f5558a", "score": "0.59557414", "text": "_createResponseModel() {\n if (!this._currentResponseModel) {\n const ResponseModel = Core.Client.getMessageTypeModelClass('ResponseModel');\n const StatusModel = Core.Client.getMessageTypeModelClass('StatusModel');\n this._currentResponseModel = new ResponseModel({\n displayModel: new StatusModel({}),\n });\n }\n }", "title": "" }, { "docid": "3181f6c2f3389ceb322290291963f07d", "score": "0.5946517", "text": "static init(data) {\n return new YngwieModel(data);\n }", "title": "" }, { "docid": "a43eb2b2b22d25c39d80e2aa69137772", "score": "0.59432775", "text": "function dummyModel() {\n\t\treturn {\n\t\t\ttitle: \"name1\",\n\t\t\tdescription: \"description1\",\n\t\t\towner: null,\n\t\t\tproduct: {\n\t\t\t\tname: \"MarkLogic Server\",\n\t\t\t\tversion: \"4.2-1\"\n\t\t\t},\n\t\t\ttags: [\"security\", \"standards\"]\n\t\t}\n\t}", "title": "" }, { "docid": "252ff1e2b2db13b98621df88f8e8a0e4", "score": "0.5941781", "text": "addNewClassInModel() {\n let model = this.get('selectedValue');\n let modelHash = this.getModelArrayByStereotype(model.data);\n\n if (model.data.get('stereotype') === '«implementation»') {\n modelHash.pushObject({ settings: model, editForms: A(), listForms: A(), parents: A(), bs: null });\n } else {\n modelHash.pushObject(model);\n }\n\n this.get('updateModel')();\n }", "title": "" }, { "docid": "94f330b6adb53a2901c3f273f4acfd5a", "score": "0.5939874", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, StringType);\n }", "title": "" }, { "docid": "f1d434d180c76477352554d76b095873", "score": "0.59227175", "text": "function Model(props) {\n return __assign({ Type: 'AWS::ApiGateway::Model' }, props);\n }", "title": "" }, { "docid": "253c0b8c4489b8f7262d3e96130f2825", "score": "0.59163773", "text": "static async make(dbUrl) {\n let client;\n try {\n //@TODO\n const props = {\n\tvalidator: new Validator(META),\n\t//@TODO other properties\n };\n const model = new Model(props);\n return model;\n }\n catch (err) {\n const msg = `cannot connect to URL \"${dbUrl}\": ${err}`;\n throw [ new ModelError('DB', msg) ];\n }\n }", "title": "" }, { "docid": "a22c7cd612866d4ff8b9bf7fce3d0eb9", "score": "0.58969736", "text": "function Model() {\n return;\n}", "title": "" }, { "docid": "0b0e9f64f9a752444e7ed114f1d95445", "score": "0.5894604", "text": "function Model(client) {\n this.db_ops = new db_ops.DB_ops(client);\n //this.products = new products.Products(db);\n this.secretKey = 'secretkey';\n}", "title": "" }, { "docid": "26db083d1164c801bb0c0dd051647f17", "score": "0.58931863", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdVersion);\n }", "title": "" }, { "docid": "97df7dd951d35fbc17e4831043d422b2", "score": "0.58649117", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ImportMappingParameterType);\n }", "title": "" }, { "docid": "90fdea8907a17b023458f2f76dcaa071", "score": "0.5860281", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, BasicParameterType);\n }", "title": "" }, { "docid": "f7b5f87f94e0fb93eb7180a11c4b28b4", "score": "0.5845275", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, XmlSchemaEntry);\n }", "title": "" }, { "docid": "eec2cb7e28aea31dfee6209fff0cd525", "score": "0.58294004", "text": "constructor(name, model, brand){\r\n this.name = name; \r\n this.model = model;\r\n this.brand = brand; \r\n \r\n }", "title": "" }, { "docid": "26540800d45b5d00669aec8aeabca929", "score": "0.58201164", "text": "function Model(name){\n this.name = name;\n this.color = \"\";\n}", "title": "" }, { "docid": "a70788091effbd6e581e078a08b505ea", "score": "0.58167654", "text": "createBaseModel() {\n const schemaJSON = JSON.parse(fs.readFileSync(this.schemaPath, 'utf8'))\n const { properties, required } = schemaJSON;\n const schema = properties;\n\n forEach(properties, (value, key) => {\n if (includes(required, key)) {\n schema[key].required = true;\n }\n });\n\n return this.createModel('base', 'events', schema);\n }", "title": "" }, { "docid": "f998c36a8c50db665cfad9a72f1e633d", "score": "0.5815096", "text": "function Model() {\n /** The registered sub models. */\n var m_registrations = {};\n /** Number of sub models which are not yet ready. */\n var m_registrationsNotReady = 0;\n\n // --------------------------------------------------------------\n // Methods\n // --------------------------------------------------------------\n /**\n * Registers a sub model.\n * @param name\n * The name of the sub model.\n * @param modelClass\n * The class to instantiate in order to create\n * the sub model.\n */\n var registerModel = function (name, modelClass) {\n // debugPrint(\"regist Model______\" + name);\n try {\n modeljs.createmodel(name);\n } catch (ex) {\n debugE(ex.message);\n }\n modelInstance = new modelClass(this);\n m_registrations[name] = modelInstance;\n this[name] = modelInstance;\n if (!modelInstance.isReady()) {\n log.warn(\"modelInstance not ready\", name);\n m_registrationsNotReady++;\n }\n }.bind(this);\n\n\n /**\n * Initializes the model. This method must be called\n * after registering all event listeners but before\n * accessing the model.\n */\n this.initialize = function () {\n rootInterface.connect();\n }\n\n /**\n * Handles a sub model ready notfication and calls\n * the onModelReady handler if all sub models are ready.\n */\n this.handleSubModelReady = function () {\n m_registrationsNotReady--;\n\n if (m_registrationsNotReady == 0) {\n this.onModelReady && this.onModelReady();\n }\n return true;\n }\n\n /**\n * Returns the modeljs root interface.\n */\n this.getRootInterface = function () {\n return rootInterface;\n }\n\n /** Handler to be called when model is ready. */\n this.onModelReady = null;\n\n // --------------------------------------------------------------\n // Init\n // --------------------------------------------------------------\n\n // Create model root interface\n var rootInterface = modeljs.createRootInterface();\n //rootInterface.addEventListener(\"apiObjectAdded\", handleApiObjectAdded);\n\n // Create sub-models\n\n //registerModel(\"directory\", DirectoryModel);\n// registerModel(\"servicelist\", ServicelistModel);\n// registerModel(\"sound\", SoundModel);\n// //registerModel(\"hisfactory\", His_factoryModel);\n// registerModel(\"tvservice\", TvserviceModel);\n// //registerModel(\"photo\", PhotoModel);\n registerModel(\"language\", LanguageModel);\n registerModel(\"network\", NetworkModel);\n// registerModel(\"channelSearch\", ChannelsearchModel);\n registerModel(\"parentlock\", Parental_lockModel);\n registerModel(\"basicSetting\", Basic_settingsModel);\n registerModel(\"system\", SystemModel);\n// registerModel(\"softupdate\", SoftwareupdateModel);\n// // registerModel(\"cec\", CecModel);\n// registerModel(\"language\", LanguageModel);\n// registerModel(\"appsetting\", App_settingModel);\n// registerModel(\"closedcaption\", ClosedcaptionModel);\n// registerModel(\"timerfunc\", Timer_functionsModel);\n// registerModel(\"source\", SourceModel);\n registerModel(\"video\", VideoModel);\n// registerModel(\"miracast\", MiracastModel);\n registerModel(\"picture\", PictureModel);\n registerModel(\"mpctrl\", MpCtrlModel);\n registerModel(\"usb\", UsbModel);\n registerModel(\"volume\", VolumeModel);\n registerModel(\"directory\", DirectoryModel);\n\n\n}", "title": "" }, { "docid": "b513858486bd73d0f2085b24e61e0080", "score": "0.57967097", "text": "function Model() {\n this.grid = null;\n this.wordList = null;\n\n this.init = function(grid, list) {\n this.grid = grid;\n this.wordList = list;\n }\n\n}", "title": "" }, { "docid": "5a7611190465c04b25f96ff3ef7fef5d", "score": "0.5792451", "text": "async function _create (Model, data, res) {\n const { payload, owner} = data;\n let obj = new Model({\n ...payload,\n owner\n });\n\n await obj.save();\n\n if (!obj) {\n return res.status(code404).send(`Unable to create ${payload} within ${Model.inspect()}`);\n }\n\n return res.status(code201).send(obj);\n }", "title": "" }, { "docid": "d33c43dabbfd0cfe4e1e9647e2993aaa", "score": "0.57657826", "text": "static create() {\n\n }", "title": "" }, { "docid": "bd4615d006e967cc946a2ebada2ab965", "score": "0.57455176", "text": "function construct (model, attrs) {\n\n attrs.toObject = toObject(model);\n\n model.firebase().on('value', function (snapshot) {\n var attrs = snapshot.val();\n if (attrs) {\n model.set(attrs);\n model.model.emit('update', model);\n model.emit('update');\n }\n });\n}", "title": "" }, { "docid": "a6fcda534fdf2a35ab145208fd766392", "score": "0.574379", "text": "constructor(controller) {\n let experiences = [];\n this.controller = controller;\n this.nickname = \"\";\n this.token = \"\";\n console.log(\"Model creat\");\n\n }", "title": "" }, { "docid": "c8c944b5558746308275acf5effeaa46", "score": "0.57419586", "text": "function newModelFromFile(path) {\n const m = new Model();\n m.loadModel(path);\n return m;\n}", "title": "" }, { "docid": "9e447e526bf3fcb91a1d11ecb2393d7e", "score": "0.57370144", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MsdMicroflow);\n }", "title": "" }, { "docid": "c001ef8df3b3954b7f334d0dd36d088d", "score": "0.5736456", "text": "constructor(){\n this.mongoose = db.getMongoose();\n this.Schema = this.mongoose.Schema;\n this.createSchema();\n this.userModel = this.mongoose.model('User', this.userSchema);\n\n }", "title": "" }, { "docid": "3fed204d999131e199e4a466e5da2bc4", "score": "0.57196206", "text": "function Model(record) {\n /**\n * The index ID for the model.\n */\n this.$id = null;\n this.$fill(record);\n }", "title": "" }, { "docid": "b253a97fee37375e5beff4411ce02bb6", "score": "0.57127666", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, DateTimeType);\n }", "title": "" }, { "docid": "29d8116cbbd7e6b6a84ca31b3c81a4c2", "score": "0.5699446", "text": "constructor(name, schema){\n super(); //This function is to inherit from the Model\n this.name = name;\n this.schema = schema;\n this.model = mongoose.model(this.name, this.schema);\n }", "title": "" }, { "docid": "7654201d7f21b3eee647164098e7087d", "score": "0.5695605", "text": "function getModelDatabase() {\n modelDatabase = {\n \"mobilenetv2\": MobileNetv2,\n \"tiny\": TinyModel\n }\n return modelDatabase;\n}", "title": "" }, { "docid": "fb683399b7bc7bdd23d8a385eeeab63d", "score": "0.5689984", "text": "initModel(postParams) {\n this.model = {};\n\n postParams.forEach(({ name }) => {\n Object.defineProperty(this.model, `$${name}`, {\n enumerable: false,\n value: new WatchableModel(\n // User is created with 'landline' phone type but we want to encourage\n // user to choose mobile by setting it by default\n name === 'phoneType' ? 'mobile' : get(this.me, name),\n this.getRules.bind(this),\n MODEL_DEBOUNCE_DELAY,\n ),\n });\n\n Object.defineProperty(this.model, name, {\n enumerable: true,\n get: () => get(this.model, `$${name}.value`),\n set: (newValue) => set(this.model, `$${name}.value`, newValue),\n });\n });\n }", "title": "" }, { "docid": "57aa1edace76d09f36f975f47cb04f9a", "score": "0.56802696", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ImportMappingJavaActionParameterType);\n }", "title": "" }, { "docid": "2fe3d3656dc9dca2f879c89d61c1290c", "score": "0.56771165", "text": "setModel(){\n return {\n user_id : [Model.types.int, Model.properties.notNull, Model.properties.unique],\n access_token : [Model.types.varchar, Model.properties.notNull],\n access_token_expire : [Model.types.varchar, Model.properties.notNull],\n client_id : [Model.types.varchar, Model.properties.notNull],\n scope : [Model.types.varchar],\n }\n }", "title": "" }, { "docid": "2dfbfcd5fbb075855ddd7906e3b906ed", "score": "0.5675726", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, XmlElement);\n }", "title": "" }, { "docid": "6580e9ac5f181d6c79c3bdb8b693c613", "score": "0.56706446", "text": "function createModelModule() {\n var SpaceshipModel = function() {\n\n var sceneGraphModule = createSceneGraphModule();\n\n /*\n * Maintain a list of nodes for iteration when performing hit detection.\n */\n this.nodes = [];\n\n /**\n * Instantiate the scene graph here.\n */\n this.rootNode = new sceneGraphModule.RootNode('scene');\n\n this.spaceshipNode = new sceneGraphModule.SpaceshipNode('spaceship', this.rootNode);\n this.spaceshipNode.translate(400, 300);\n\n this.headNode = new sceneGraphModule.HeadNode('head', this.spaceshipNode);\n this.headNode.translate(0, -80);\n\n //TODO\n\n\n /**\n * Push every node into the the nodes list.\n */\n this.nodes.push(this.headNode);\n this.nodes.push(this.spaceshipNode);\n this.nodes.push(this.rootNode);\n \n //TODO\n };\n\n _.extend(SpaceshipModel.prototype, {\n /**\n * Perform hit detection and return the hit node.\n * @param point: Point in the world view, i.e., from the perspective of the canvas.\n * @return \n * null if no node is hit, otherwise return the hit node.\n */\n performHitDetection: function(point) {\n var result = _.find(this.nodes, function(node) {\n if (node.performHitDetection(point)) {\n return node;\n }\n });\n if (result) {\n return result;\n } \n return null;\n }\n });\n\n return {\n SpaceshipModel: SpaceshipModel\n };\n}", "title": "" }, { "docid": "7373a6ec945b15fefe3bdda204299c34", "score": "0.56695974", "text": "constructor() {\n this.model = new Map();\n }", "title": "" }, { "docid": "e6afe926a7b9c161213eab0e5c3a07e0", "score": "0.5669382", "text": "function Create() { }", "title": "" }, { "docid": "70f924f4511db4fa6d9a1760da60591c", "score": "0.56658745", "text": "model() {\n return {};\n }", "title": "" }, { "docid": "de294151bc1eda5affe539af77d8ebd5", "score": "0.56652343", "text": "static async create(obj) {\n const [recordId] = await knex(this.tableName + 's').insert(obj)\n const [record] = await knex(this.tableName + 's').where({ id: recordId })\n return new this(record);\n }", "title": "" }, { "docid": "8ec72bd2e18dba7fc2d610d03c5ef46a", "score": "0.5626004", "text": "function defineModel(vm, httpService, blockUI) {\n vm.title = \"Excel uploader - Under construction\";\n //vm.httpService = httpService; // http service\n //vm.blockUI = blockUI;\n //vm.productId = \"\";\n //vm.categoryName = \"\";\n //vm.conditionName = \"\";\n //vm.brandName = \"\";\n //vm.modelName = \"\";\n //vm.counted = \"\";\n //vm.stockCount = \"\";\n //vm.tableRecords = null;\n\n //vm.productListId = null;\n return vm;\n }", "title": "" }, { "docid": "6a1a1c38e3b516bddb377d150262f2e3", "score": "0.56236655", "text": "create()\n {\n\n }", "title": "" }, { "docid": "495acd318461e3681953bcea9fb53582", "score": "0.56227493", "text": "function Model(name, schema, opts) {\n if (arguments.length < 1) {\n throw new Error('invalid arguments to construct a model');\n } else if (opts && opts.redis) {\n this.connection = opts.redis;\n }\n EventEmitter.call(this);\n this.name = name;\n this.schema = schema || {};\n this.store = [];\n this.debug = require('debug')('model:' + this.name);\n this.debug('created');\n}", "title": "" } ]
336c43a9c8e53f33c2883d5fb6a6ee51
helper for all partial builder queries sets format and checks field and operator correctness
[ { "docid": "94076305f8e2b8313e8b274e85949eec", "score": "0.6488128", "text": "function buildPartialQuery(field, value, operator) {\n if (/*inObject(con.allFields, field) && */inObject(con.operators, operator)) {\n return field + '+' + operator + '+' + value;\n }\n return \"\";\n}", "title": "" } ]
[ { "docid": "2f6df04ac6bfd781d9e0209788be39cf", "score": "0.63107497", "text": "buildQueryStrings() {\n this.formatDefaultFileQuery();\n this.formatDefaultAnalysisQuery();\n this.formatProcessedQuery();\n this.formatSelectionsQuery();\n }", "title": "" }, { "docid": "b731f2627c829fd1f33aa05c4b86fc41", "score": "0.63088334", "text": "buildQueryStrings() {\n this.formatDefaultFileQuery();\n this.formatAllQuery();\n if (this._datasetType !== 'Annotation') {\n this.formatDefaultAnalysisQuery();\n this.formatProcessedQuery();\n this.formatRawQuery();\n }\n }", "title": "" }, { "docid": "017652d4c987db69878e84bdae3b671f", "score": "0.59405386", "text": "buildQuery_(selector, config = {}) {\n const build = (obj) => {\n const where = Object.entries(obj).reduce((acc, [key, value]) => {\n // Undefined values indicate that they have no significance to the query. \n // If the query is looking for rows where a column is not set it should use null instead of undefined\n if (typeof value === \"undefined\") {\n return acc\n }\n switch (true) {\n case value instanceof FindOperator:\n acc[key] = value\n break\n case Array.isArray(value):\n acc[key] = In([...value])\n break\n case value !== null && typeof value === \"object\":\n const subquery = []\n\n Object.entries(value).map(([modifier, val]) => {\n switch (modifier) {\n case \"lt\":\n subquery.push({ operator: \"<\", value: val })\n break\n case \"gt\":\n subquery.push({ operator: \">\", value: val })\n break\n case \"lte\":\n subquery.push({ operator: \"<=\", value: val })\n break\n case \"gte\":\n subquery.push({ operator: \">=\", value: val })\n break\n }\n })\n\n acc[key] = Raw(\n (a) =>\n subquery\n .map((s, index) => `${a} ${s.operator} :${index}`)\n .join(\" AND \"),\n subquery.map((s) => s.value)\n )\n break\n default:\n acc[key] = value\n break\n }\n\n return acc\n }, {})\n \n return where\n }\n\n const query = {\n where: build(selector),\n }\n \n if (\"deleted_at\" in selector) {\n query.withDeleted = true\n }\n\n if (\"skip\" in config) {\n query.skip = config.skip\n }\n\n if (\"take\" in config) {\n query.take = config.take\n }\n\n if (\"relations\" in config) {\n query.relations = config.relations\n }\n\n if (\"select\" in config) {\n query.select = config.select\n }\n\n if (\"order\" in config) {\n query.order = config.order\n }\n\n return query\n }", "title": "" }, { "docid": "ab12756147b901468c533afb21d72059", "score": "0.59226596", "text": "function setup_query_builder_filter( db, fk_vals ) {\n\n\n // build filter for query builder\n var filters = [];\n for (var field in db) {\n var field_dat = db[field];\n \n if (field_dat.hidden == false) {\n var tmp = {};\n tmp.id = field_dat.comment.name;\n tmp.label = field;\n type = field_dat.type; // varchar, datetime, etc\n is_fk = field_dat.is_fk; // true if field is a foreign key\n\n\n // get field type\n if (type.indexOf('varchar') !== -1) {\n type = 'string';\n } else if (type.indexOf('datetime') !== -1) {\n type = 'datetime';\n } else if (type.indexOf('date') !== -1) {\n type = 'date';\n } else if (type.indexOf('float') !== -1) {\n type = 'double';\n } else if (type.indexOf('int') !== -1) {\n type = 'integer';\n }\n tmp.type = type;\n\n // if field is a FK, set values for dropdown\n if (is_fk) {\n tmp.values = fk_vals[field];\n tmp.input = 'select';\n }\n\n // set operators and options based on type\n if (tmp.type == 'string') {\n tmp.operators = ['equal', 'not_equal', 'in', 'not_in', 'begins_with', 'not_begins_with', 'contains', 'not_contains', 'ends_with', 'not_ends_with', 'is_empty', 'is_not_empty', 'is_null', 'is_not_null'];\n } else if (tmp.type == 'integer' || tmp.type == 'double') {\n tmp.operators = ['equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', 'is_null', 'is_not_null', 'is_empty', 'is_not_empty'];\n /*tmp.plugin = 'slider';\n tmp.plugin_config = {min: 0, max: 100, value: 0};\n tmp.valueSetter = function(rule, value) {\n if (rule.operator.nb_inputs == 1) value = [value];\n rule.$el.find('.rule-value-container input').each(function(i) {\n $(this).slider('setValue', value[i] || 0);\n });\n }\n tmp.valueGetter = function(rule) {\n var value = [];\n rule.$el.find('.rule-value-container input').each(function() {\n value.push($(this).slider('getValue'));\n });\n return rule.operator.nb_inputs == 1 ? value[0] : value;\n }*/\n } else if (tmp.type == 'date' || tmp.type == 'datetime') {\n tmp.operators = ['equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', 'is_null', 'is_not_null', 'is_empty', 'is_not_empty'];\n tmp.validation = {format: 'YYYY-MM-DD'};\n tmp.plugin = 'datetimepicker';\n if (tmp.type == 'date') {\n tmp.plugin_config = {format: 'YYYY-MM-DD'};\n } else {\n tmp.plugin_config = {format: 'YYYY-MM-DD HH:mm:ss'};\n }\n }\n\n filters.push(tmp);\n }\n\n }\n\n return filters;\n}", "title": "" }, { "docid": "bdcc49ff9fe6a5d430dc2ec83288e0c3", "score": "0.56599337", "text": "function custom(field, operator, value) {\n let f, op;\n for (let fKey in con.allFields) {\n if (con.allFields.hasOwnProperty(fKey) && field === fKey) {\n f = con.allFields[fKey];\n }\n }\n for (let opKey in con.operators) {\n if (con.operators.hasOwnProperty(opKey) && operator === opKey) {\n op = con.operators[opKey];\n }\n }\n return general(0, [buildPartialQuery(f, value, op)]);\n}", "title": "" }, { "docid": "887dddadaccbd845a3c1070bf79774f6", "score": "0.5656743", "text": "filterFields(config, fields, leftFieldFullkey, operator) {\n fields = clone(fields);\n const fieldSeparator = config.settings.fieldSeparator;\n const leftFieldConfig = getFieldConfig(leftFieldFullkey, config);\n let expectedType;\n let widget = getWidgetForFieldOp(config, leftFieldFullkey, operator, 'value');\n if (widget) {\n let widgetConfig = config.widgets[widget];\n let widgetType = widgetConfig.type;\n //expectedType = leftFieldConfig.type;\n expectedType = widgetType;\n } else {\n expectedType = leftFieldConfig.type;\n }\n\n function _filter(list, path) {\n for (let rightFieldKey in list) {\n let subfields = list[rightFieldKey].subfields;\n let subpath = (path ? path : []).concat(rightFieldKey);\n let rightFieldFullkey = subpath.join(fieldSeparator);\n let rightFieldConfig = getFieldConfig(rightFieldFullkey, config);\n if (rightFieldConfig.type == \"!struct\") {\n _filter(subfields, subpath);\n } else {\n let canUse = rightFieldConfig.type == expectedType && rightFieldFullkey != leftFieldFullkey;\n let fn = config.settings.canCompareFieldWithField;\n if (fn)\n canUse = canUse && fn(leftFieldFullkey, leftFieldConfig, rightFieldFullkey, rightFieldConfig);\n if (!canUse)\n delete list[rightFieldKey];\n }\n }\n }\n\n _filter(fields, []);\n\n return fields;\n }", "title": "" }, { "docid": "099efc511fb438ec95fbad234893b875", "score": "0.56157357", "text": "buildQuery() {\n\t\tlet baseQuery = this.get(\"baseQuery\") || {};\n let query = Ember.$.extend(baseQuery, this.get(\"query\") || {});\n\n\t\tif (this.get(\"canOrder\")) {\n\t\t\tquery.order = this.get(\"orderField\");\n\t\t}\n\n return query;\n }", "title": "" }, { "docid": "6dc926fc49fd15fab6f846997cb357da", "score": "0.5609743", "text": "qryIsSimple(qry) {\n var simple = true;\n\n if (Array.isArray(qry)) {\n qry.forEach(val => {\n var kosher = this.qryIsSimple(val);\n if (!kosher) {\n simple = false;\n return false;\n }\n });\n } else if (isObject(qry)) {\n for (var key in qry) {\n var val = qry[key];\n // The key is fine if it doesn't begin with $ or is a simple operator\n var kosherKey = key[0] !== '$' || simpleOperators[key];\n\n if (!kosherKey) {\n simple = false;\n break;\n }\n\n var valKosher = this.qryIsSimple(val);\n\n if (!valKosher) {\n simple = false;\n break;\n }\n }\n }\n\n return simple;\n }", "title": "" }, { "docid": "96c794b8d2c43c8e07c92d570686c796", "score": "0.5606014", "text": "validateForm() {\n const errors = this.state.filters.reduce((errors, item, index) => {\n // First case: Check for empty value field\n if (!item.value) {\n return errors.concat([`Filter \"${item.predicate} -> ${item.operator}\" must have a value`]);\n //Second case: Check for empty multi-value fields (between operator)\n } else if (this.getFullOperator(index).multiValue && !Array.isArray(item.value)) {\n return errors.concat([`Filter \"${item.predicate} -> ${item.operator}\" must have multiple values`]);\n // Third case: Pattern matching for operator. Make sure what we send to create the query is in the\n // correct format\n } else {\n // Get valid pattern from operator in Firestore\n const validPatternRegex = new RegExp(this.getFullOperator(index).validPattern);\n if (Array.isArray(item.value)) {\n const multiValueErrors = item.value.reduce((errors, value, index) => {\n if (!validPatternRegex.test(value)) {\n return errors.concat([`Value ${index + 1} (\"${value}\") for filter \"${item.predicate} -> ${item.operator}\" is not valid`]);\n }\n return errors;\n }, []);\n if (item.value.length <= 1) {\n return multiValueErrors.concat([`Filter \"${item.predicate} -> ${item.operator}\" must have all values filled out`]);\n } else {\n return errors.concat(multiValueErrors);\n }\n } else {\n if (!validPatternRegex.test(item.value)) {\n return errors.concat([`Value \"${item.value}\" for filter \"${item.predicate} -> ${item.operator}\" is not valid`]);\n }\n }\n }\n return errors;\n }, []);\n\n this.setState({\n errors,\n });\n\n if (errors.length === 0) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "c109ff35e23d277a8d39d3d17fd1e3c5", "score": "0.55658036", "text": "buildQuery() {\n let query = \"\";\n\n if (this.state.selectedMode === \"proper\") {\n query = \"?proper\";\n } else if (this.state.selectedMode === \"scrabble\") {\n query = \"?scrabble\";\n }\n\n if (this.state.selectedLimit !== \"unlimited\") {\n if (query === \"\") {\n query = \"?limit=\" + this.state.selectedLimit;\n } else {\n query += \"&limit=\" + this.state.selectedLimit;\n }\n }\n return query;\n }", "title": "" }, { "docid": "5d97e3dd25efdb97ed3134c8de713493", "score": "0.55425596", "text": "validateClause(updating_clause, index, changed_values) {\n let column_type = updating_clause[\"column_type\"];\n let operator = updating_clause[\"operator\"];\n\n\n let errors = { ...this.state.errors };\n let index_errors = errors[index] || {};\n\n if (operator === \"between\") {\n let field_name = \"min\";\n\n if (changed_values.hasOwnProperty(field_name)) {\n let min = updating_clause[field_name];\n let field_errors = [];\n field_errors = field_errors.concat(validation.isEmpty(min));\n field_errors = field_errors.concat(validation.isNumber(min));\n index_errors = Object.assign(index_errors, { \"min\": field_errors });\n }\n\n field_name = \"max\";\n if (changed_values.hasOwnProperty(field_name)) {\n let max = updating_clause[field_name];\n let field_errors = [];\n field_errors = field_errors.concat(validation.isEmpty(max));\n field_errors = field_errors.concat(validation.isNumber(max));\n index_errors = Object.assign(index_errors, { \"max\": field_errors });\n }\n\n } else {\n if (changed_values.hasOwnProperty(\"text\")) {\n let field_name = \"text\";\n let text = updating_clause[\"text\"];\n\n if ([\"in_list\", \"in_list_num\"].includes(operator)) {\n let field_errors = [];\n field_errors = field_errors.concat(validation.isEmpty(text));\n field_errors = field_errors.concat(validation.isList(text));\n index_errors = Object.assign(index_errors, { \"text\": field_errors });\n } else {\n // most of everything\n let field_errors = [];\n if (column_type === \"string\") {\n field_errors = field_errors.concat(validation.isEmpty(text));\n field_errors = field_errors.concat(validation.isString(text));\n } else {\n field_errors = field_errors.concat(validation.isEmpty(text));\n field_errors = field_errors.concat(validation.isNumber(text));\n }\n index_errors = Object.assign(index_errors, { \"text\": field_errors });\n }\n }\n }\n errors[index] = index_errors;\n this.setState({ \"errors\": errors });\n }", "title": "" }, { "docid": "30991f8da7b193839cf52845408dfb36", "score": "0.5540559", "text": "build() {\n let accepts = [];\n if (this.ctx.type === \"relation\" || this.ctx.type === \"nested\")\n accepts.push({ arg: 'id', type: 'string', required: true, description: this.ctx.Model.definition.name + ' ID' });\n if (this.ctx.type === \"relation\" && !this.ctx.relation)\n accepts.push({ arg: 'relation', type: 'string', required: true, description: 'Relationship name' });\n if (this.ctx.type === \"nested\")\n accepts.push({ arg: 'nested', type: 'string', required: true, description: 'Nested array property name' });\n accepts.push({ arg: 'range', type: 'string', required: true, description: 'Scale range (daily, weekly, monthly, annual)' });\n accepts.push({ arg: 'where', type: 'object', description: 'Statement to filter ' + (this.ctx.relation || this.ctx.nested) });\n return accepts;\n }", "title": "" }, { "docid": "5fa4ea543fadd708eb597843cdb4a7e2", "score": "0.54759866", "text": "derivedFields(fieldName, value) {\n return {\n [this.queryFieldName(fieldName)]: value ? renderer.render(value).result : null\n };\n }", "title": "" }, { "docid": "ebb945f17cad44b5ff4940dcb56731cb", "score": "0.543659", "text": "function andWhereConverter() {\n\n\t\t\tif(atLeastOneKey) {\n\t\t\t\tmysqlQuery += ' AND ';\n\t\t\t} else {\n\t\t\t\tmysqlQuery += ' WHERE ';\n\t\t\t\tatLeastOneKey = true;\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "dc4d743024026c50a6078b071e8d0852", "score": "0.54115874", "text": "formatWhere(value) {\n let clause = this.clause;\n let allArgs = [];\n if (Array.isArray(value)) {\n value.forEach((val) => {\n if (val === \"null\") {\n allArgs.push(`{clause.left} ${clause.op} ${val}`);\n } else {\n allArgs.push(`${clause.left} ${clause.op} \"${val}\"`);\n }\n });\n return \"(\" + allArgs.join(\" or \") + \")\";\n }\n return `${clause.left} ${clause.op} \"${value}\"`;\n }", "title": "" }, { "docid": "ee4a46f043d2e7f543fcb1d02ab1c23a", "score": "0.5411507", "text": "getWhereSchema() {\n const schema = this.schema.output;\n const columns = Object.keys(schema);\n const operators = ['ILIKE', 'LIKE', '>=', '<=', '<>', '!=', '=', '>', '<'];\n const logicalOperators = ['AND', 'NOT', 'OR'];\n const regex = `^(${columns.join('|')}) *(${operators.join('|')}) *(.+?) *(${logicalOperators.join('|')})?$`;\n\n // Extend Joi to add a custom validator\n const customJoi = Joi.extend((joi) => ({\n base: joi.array(),\n name: 'array',\n language: {\n whereQueryCoerce: 'one or more conditions are improperly formatted',\n whereQueryValidate: 'one or more conditions have invalid values',\n whereQueryLike: 'one or more conditions use the LIKE operator but are not strings'\n },\n\n coerce: function (value, state, options) {\n const conditions = [];\n\n // Always make the where parameter an array\n if (value) {\n if (!Array.isArray(value)) {\n value = [value];\n }\n } else {\n value = [];\n }\n\n // Split each condition into an object with the following keys: column, operator, value and logicalOperator\n for (let i = 0; i < value.length; i++) {\n const matchResult = value[i].match(regex);\n if (!matchResult) {\n return this.createError('array.whereQueryCoerce', {}, state, options);\n }\n\n // Default the logical operator to AND if not specified\n if (!matchResult[4]) matchResult[4] = logicalOperators[0];\n\n // Don't add logical operator for the last condition\n const logicalOperator = (i < value.length - 1) ? matchResult[4] : '';\n\n conditions.push({\n column: matchResult[1],\n operator: matchResult[2],\n value: matchResult[3],\n logicalOperator: logicalOperator\n });\n }\n\n return conditions;\n },\n\n rules: [\n {\n name: 'whereQuery',\n validate: function (params, value, state, options) {\n for (let i = 0; i < value.length; i++) {\n const columnSchema = schema[value[i].column];\n const operator = value[i].operator;\n\n // Check if query contains LIKE/ILIKE operator\n if (operator === 'LIKE' || operator === 'ILIKE') {\n // Check if column uses a string schema. This check is required because we\n // only want to perform LIKE/ILIKE queries on columns explicitly marked as string\n // types since non-string types (such as date) are also passed as strings.\n if (columnSchema._type === 'string') {\n // Check the value is a string\n const result = Joi.validate(value[i].value, Joi.string());\n if (result.error) {\n return this.createError('array.whereQueryLike', {}, state, options);\n }\n\n // Encapsulate value in % signs which means this pattern can match anywhere\n value[i].value = `%${value[i].value}%`;\n } else {\n return this.createError('array.whereQueryLike', {}, state, options);\n }\n } else {\n // Validate the value\n const result = Joi.validate(value[i].value, columnSchema);\n if (result.error) {\n return this.createError('array.whereQueryValidate', {}, state, options);\n }\n }\n }\n return value;\n }\n }\n ]\n }));\n\n const description = 'Conditions to apply to the query. Each condition must be on its own line. ' +\n 'Format each condition as: `column operator value`. Example: `id = 5`. ' +\n 'Supported operators are **ILIKE**, **LIKE**, **>=**, **<=**, **<>**, **!=**, **=**, **>** and **<**. ' +\n 'You can also use the logical operators **AND**, **NOT** and **OR** at the end of each condition ' +\n 'to combine conditions. Defaults to **AND** if not specified.';\n return customJoi.array().whereQuery().description(description);\n }", "title": "" }, { "docid": "80f4b72b303d4ae4a1da1f6257334d67", "score": "0.5396859", "text": "limitFields() {\n if (this.queryString.fields) {\n // Extracting all fields in one string\n const fields = this.queryString.fields.split(',').join(' ');\n\n // Apply only the selected field to the db query\n this.query = this.query.select(fields);\n } else {\n // Default case - the entire doc is being sent without the '__v' field\n this.query = this.query.select('-__v');\n }\n\n return this;\n }", "title": "" }, { "docid": "69be96b061ea5711fbb62773d617dd81", "score": "0.5387596", "text": "function Query(fieldConfig, inputObj) {\n if (!(fieldConfig instanceof FieldConfig)) {\n throw new Error(\"fieldConfig passed to query formatter not of type CollectionFieldConfig.\");\n }\n\n this.conditions = {};\n this.pagination = {};\n this.conditions.search = null;\n this.conditions.query = null;\n this.conditions.mergeQuery = null;\n this.conditions.filters = null;\n this.conditions.range = null;\n this.sort = null;\n this.projection = null;\n this.pagination.limit = 10;\n this.pagination.skip = 0;\n this.pagination.total = 0;\n this.include = {};\n this.errorMessages = {};\n\n // Scan , validate and assign for conditions , sort and pagination parameters in input\n for (var searchParameter in inputObj) {\n if (inputObj.hasOwnProperty(searchParameter) && searchParameter !== 'page' && searchParameter !== 'limit') {\n // Check if the input fields are mentioned in the config file\n var fieldObj = fieldConfig.prepare(searchParameter, inputObj[searchParameter]);\n // Save the fieldObj in necessary fields in Grid.query\n // console.log(\"Field Object returned after preparing --- \", JSON.stringify(fieldObj));\n if (fieldObj.status === true) {\n switch (searchParameter) {\n case \"searchKeyword\":\n this.conditions.search = (fieldObj.value.search);\n this.conditions.query = (fieldObj.value.query);\n break;\n case \"range\":\n this.conditions.range = (fieldObj.value);\n break;\n case \"sort\":\n this.sort = (fieldObj.value);\n break;\n case \"filter\":\n this.conditions.filters = (fieldObj.value);\n break;\n }\n this.include = lodash.assign(this.include, fieldObj.include);\n }\n // If any error messages push the error messages in Grid.errorMessages\n else if (fieldObj.status === false) {\n // console.log(\"Error in preparation --- \", fieldObj);\n for (var field in fieldObj.messages) {\n if (fieldObj.messages.hasOwnProperty(field)) {\n if (!this.errorMessages[field]) {\n this.errorMessages[field] = [];\n }\n this.errorMessages[field] = lodash.concat(this.errorMessages[field], (fieldObj.messages[field]));\n }\n }\n // console.log(\"Error messages ---- \", this.errorMessages);\n }\n }\n }\n\n //Prepare Pagination Limit\n fieldObj = fieldConfig.prepare(\"limit\", inputObj.limit);\n this.pagination.limit = fieldObj.value.limit;\n\n //Prepare Pagination Skip\n fieldObj = fieldConfig.prepare(\"page\", inputObj.page);\n this.pagination.skip = fieldObj.value.skip;\n this.pagination.page = fieldObj.value.page;\n\n //Prepare projection and merge object\n this.projection = fieldConfig.getProjection();\n}", "title": "" }, { "docid": "30e7ffbe97c284a068c03c8dbc8e433a", "score": "0.5378493", "text": "formatAllQuery() {\n const query = new QueryString();\n query\n .addKeyValue('type', this._datasetType)\n .addKeyValue('cart', this._cartPath);\n this._allQueryString = query.format();\n }", "title": "" }, { "docid": "05bebcd37919e04094638bb1aa6973d0", "score": "0.5357665", "text": "function createSingleCondition(obj) {\n var field = obj.field,\n table = obj.table ? obj.table : '',\n aggregation = obj.aggregation ? obj.aggregation : null,\n operator = obj.operator,\n value = obj.value,\n encloseFieldFlag = obj.encloseField;\n if (encloseFieldFlag != undefined && typeof encloseFieldFlag != \"boolean\") {\n encloseFieldFlag = encloseFieldFlag == \"false\" ? false : true;\n }\n var conditiontext = '';\n if (aggregation != null) {\n if (encloseFieldFlag == false) {\n //CBT:this is for nested aggregation if aggregation key contains Array\n if (Object.prototype.toString.call(aggregation).toLowerCase() === \"[object array]\") {\n var aggregationText = \"\";\n aggregation.forEach(function(d) {\n aggregationText = aggregationText + d + \"(\"\n });\n conditiontext = aggregationText + field;\n aggregationText = \"\";\n aggregation.forEach(function(d) {\n aggregationText = aggregationText + \")\"\n });\n conditiontext = conditiontext + aggregationText;\n\n } else {\n conditiontext = aggregation + '(' + field + ')';\n\n }\n } else {\n if (Object.prototype.toString.call(aggregation).toLowerCase() === \"[object array]\") {\n var aggregationText = \"\";\n aggregation.forEach(function(d) {\n aggregationText = aggregationText + d + \"(\"\n });\n conditiontext = aggregationText + encloseField(table) + '.' + encloseField(field);\n aggregationText = \"\";\n aggregation.forEach(function(d) {\n aggregationText = aggregationText + \")\"\n });\n conditiontext = conditiontext + aggregationText;\n\n } else {\n conditiontext = aggregation + '(' + encloseField(table) + '.' + encloseField(field) + ')';\n\n }\n }\n } else {\n conditiontext = field;\n }\n\n if (operator != undefined) {\n if(Array.isArray(value) && value.length ==1)\n {\n const updatedValue = value[0];\n value = updatedValue;\n }\n var sign = operatorSign(operator, value);\n if (sign.indexOf('IN') > -1) {\n //IN condition has different format for Influx\n var tempValue = value.map(d => {\n const filterVal = d != null ? d.toString().replace(/\\'/ig, \"\\\\\\'\") : d\n return `${conditiontext} = '${filterVal}'`\n }).join(\" or \");\n conditiontext = `( ${tempValue} )`;\n } else {\n var tempValue = '';\n if (typeof value === 'undefined' || value == null) {\n tempValue = 'null';\n } else if (typeof value === 'object') {\n sign = operatorSign(operator, '');\n if (value.hasOwnProperty('field')) {\n var rTable = value.table ? value.table : '';\n tempValue = encloseField(rTable) + '.' + encloseField(value.field);\n }\n } else if (typeof value === \"number\") {\n tempValue = replaceSingleQuote(value);\n } else {\n tempValue = '\\'' + replaceSingleQuote(value) + '\\'';\n }\n conditiontext += ' ' + sign + ' ' + tempValue;\n }\n }\n return conditiontext;\n}", "title": "" }, { "docid": "5e1f54d5593c8a96ec5524f12347445a", "score": "0.534093", "text": "customQuery() {}", "title": "" }, { "docid": "009343b29d8933c45254df2ed1e7ccda", "score": "0.53392947", "text": "function setOperandOnLoad() {\n if (!_.isEmpty(scope.query._value)) {\n if (scope.query._value instanceof Object) {\n if (scope.operator === '$in' || scope.operator === \"$not\") {\n scope.operand['regex'] = scope.query._value['$regex'];\n scope.operand['options'] = scope.query._value['$options'];\n } else {\n scope.operand[scope.operator.replace('$', '')] = scope.query._value[scope.operator];\n }\n } else {\n scope.operand['equals'] = scope.query._value;\n }\n }\n }", "title": "" }, { "docid": "009343b29d8933c45254df2ed1e7ccda", "score": "0.53392947", "text": "function setOperandOnLoad() {\n if (!_.isEmpty(scope.query._value)) {\n if (scope.query._value instanceof Object) {\n if (scope.operator === '$in' || scope.operator === \"$not\") {\n scope.operand['regex'] = scope.query._value['$regex'];\n scope.operand['options'] = scope.query._value['$options'];\n } else {\n scope.operand[scope.operator.replace('$', '')] = scope.query._value[scope.operator];\n }\n } else {\n scope.operand['equals'] = scope.query._value;\n }\n }\n }", "title": "" }, { "docid": "f699f7b391454264dc37f6e8ff2e7d8f", "score": "0.53354836", "text": "function fieldDef(encQ, include, replacer) {\n\t if (include === void 0) { include = exports.INCLUDE_ALL; }\n\t if (replacer === void 0) { replacer = exports.REPLACE_NONE; }\n\t if (include.get(property_1$1.Property.AGGREGATE) && encoding_1$2.isDisabledAutoCountQuery(encQ)) {\n\t return '-';\n\t }\n\t var fn = func(encQ, include, replacer);\n\t var props = fieldDefProps(encQ, include, replacer);\n\t var fieldAndParams;\n\t if (encoding_1$2.isFieldQuery(encQ)) {\n\t // field\n\t fieldAndParams = include.get('field') ? value(encQ.field, replacer.get('field')) : '...';\n\t // type\n\t if (include.get(property_1$1.Property.TYPE)) {\n\t if (wildcard_1$1.isWildcard(encQ.type)) {\n\t fieldAndParams += ',' + value(encQ.type, replacer.get(property_1$1.Property.TYPE));\n\t }\n\t else {\n\t var typeShort = ((encQ.type || type_1$1.Type.QUANTITATIVE) + '').substr(0, 1);\n\t fieldAndParams += ',' + value(typeShort, replacer.get(property_1$1.Property.TYPE));\n\t }\n\t }\n\t // encoding properties\n\t fieldAndParams += props.map(function (p) {\n\t var val = p.value instanceof Array ? '[' + p.value + ']' : p.value;\n\t return ',' + p.key + '=' + val;\n\t }).join('');\n\t }\n\t else if (encoding_1$2.isAutoCountQuery(encQ)) {\n\t fieldAndParams = '*,q';\n\t }\n\t if (!fieldAndParams) {\n\t return null;\n\t }\n\t if (fn) {\n\t var fnPrefix = util$6.isString(fn) ? fn : wildcard_1$1.SHORT_WILDCARD +\n\t (util_1$2.keys(fn).length > 0 ? JSON.stringify(fn) : '');\n\t return fnPrefix + '(' + fieldAndParams + ')';\n\t }\n\t return fieldAndParams;\n\t}", "title": "" }, { "docid": "7babaed39337a9e02930133e532f4582", "score": "0.5292528", "text": "get options() {\n let options = _.reduce(['sort', 'fields'], (memo, key) =>\n _.isEmpty(this['_'+key]) ? memo : Query.obj(key, this['_'+key], memo),\n {});\n\n return _.reduce(['skip', 'limit', 'reactive', 'transform'], (memo, key) =>\n this['_'+key] === undefined ? memo : Query.obj(key, this['_'+key], memo),\n options);\n }", "title": "" }, { "docid": "05d3216b77609446117fcf854782cf4d", "score": "0.5287293", "text": "function isValidQuery() {\n\tvar s = getSelections();\n\treturn ((s.displayType === 'day' && s.date !== '') || (s.displayType === 'time' && (s.groupingType === 'faculty' || !_.isEmpty(s.programs))));\n}", "title": "" }, { "docid": "3b7495faf256e49e75546adb849b7115", "score": "0.52782494", "text": "customQuery(record) {\n\t\tlet query = null;\n\t\tif (record && record.length) {\n\t\t\tquery = {\n\t\t\t\tbool: {\n\t\t\t\t\tshould: generateTermQuery(this.props.dataField),\n\t\t\t\t\tminimum_should_match: 1,\n\t\t\t\t\tboost: 1.0\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn query;\n\t\t}\n\t\treturn query;\n\n\t\tfunction generateTermQuery(dataField) {\n\t\t\treturn record.map((singleRecord, index) => ({\n\t\t\t\tterm: {\n\t\t\t\t\t[dataField]: singleRecord.value\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}", "title": "" }, { "docid": "78b5f848d34b801b8ed8ead30ef4f514", "score": "0.52509236", "text": "function build_query (formtitle, fadin) {\n var q_select = 'SELECT ';\n var temp;\n if (select_field.length > 0) {\n for (var i = 0; i < select_field.length; i++) {\n temp = check_aggregate(select_field[i]);\n if (temp !== '') {\n q_select += temp;\n temp = check_rename(select_field[i]);\n q_select += temp + ', ';\n } else {\n temp = check_rename(select_field[i]);\n q_select += select_field[i] + temp + ', ';\n }\n }\n q_select = q_select.substring(0, q_select.length - 2);\n } else {\n q_select += '* ';\n }\n\n q_select += '\\nFROM ' + query_from();\n\n var q_where = query_where();\n if (q_where !== '') {\n q_select += '\\nWHERE ' + q_where;\n }\n\n var q_groupby = query_groupby();\n if (q_groupby !== '') {\n q_select += '\\nGROUP BY ' + q_groupby;\n }\n\n var q_having = query_having();\n if (q_having !== '') {\n q_select += '\\nHAVING ' + q_having;\n }\n\n var q_orderby = query_orderby();\n if (q_orderby !== '') {\n q_select += '\\nORDER BY ' + q_orderby;\n }\n\n /**\n * @var button_options Object containing options\n * for jQueryUI dialog buttons\n */\n var button_options = {};\n button_options[PMA_messages.strClose] = function () {\n $(this).dialog('close');\n };\n button_options[PMA_messages.strSubmit] = function () {\n if (vqb_editor) {\n var $elm = $ajaxDialog.find('textarea');\n vqb_editor.save();\n $elm.val(vqb_editor.getValue());\n }\n $('#vqb_form').submit();\n };\n\n var $ajaxDialog = $('#box').dialog({\n appendTo: '#page_content',\n width: 500,\n buttons: button_options,\n modal: true,\n title: 'SELECT'\n });\n // Attach syntax highlighted editor to query dialog\n /**\n * @var $elm jQuery object containing the reference\n * to the query textarea.\n */\n var $elm = $ajaxDialog.find('textarea');\n if (! vqb_editor) {\n vqb_editor = PMA_getSQLEditor($elm);\n }\n if (vqb_editor) {\n vqb_editor.setValue(q_select);\n vqb_editor.focus();\n } else {\n $elm.val(q_select);\n $elm.focus();\n }\n}", "title": "" }, { "docid": "c72e07e5c16ab083897d860a0d2c16d9", "score": "0.5250212", "text": "getWhere(conditions) {\n var result = '';\n let self = this;\n\n if (conditions.length > 0){\n result += ' where ';\n\n\n var isFirst = true;\n self.fields.forEach(function (val, index) {\n if (conditions[val] !== undefined) {\n if (!isFirst)\n result += ' and ';\n else\n isFirst = false;\n \n switch (typeof self.model[self.prefix + '_' + val]) {\n case 'number':\n result += self.prefix + '_' + val + ' = ' + conditions[val];\n break;\n case 'boolean':\n result += self.prefix + '_' + val + ' = ' + conditions[val];\n break;\n case 'object':\n result += self.prefix + '_' + val + ' >= ' + conditions[val];\n break;\n default:\n result += self.prefix + '_' + val + ' = ' + \"'\" + conditions[val] + \"'\";\n break;\n }\n }\n });\n }\n return result;\n }", "title": "" }, { "docid": "72fbda55895e754cc59247357b89afa0", "score": "0.5246566", "text": "stringifyQuery(root,str = '') {\n // util funcs\n var quote = (s) => {\n const specialChars = [ ':', ' ', '-', '+']\n const found = _.find(specialChars, (c) => {return s.indexOf(c) > -1})\n if (found) {\n return `\"${s}\" `\n }\n return `${s} `\n }\n var isEmptyArray = (t) => {\n return (Array.isArray(t) && t.length === 0)\n }\n\n // process tree\n // simple field\n if (root.field && root.field !== '<implicit>' && !isEmptyArray(root.term) ) {\n str = str.concat(`${root.field}:`)\n }\n // simple term, quote if it has blanks or embedded colon\n if (root.term) {\n if (Array.isArray(root.term) && !isEmptyArray(root.term) ) {\n str = str.concat(['(',\n _.map(root.term, (t) => { return quote(t) }).join(' ')\n , ')'].join(''))\n } else {\n str = str.concat(quote(root.term))\n }\n }\n // explicit operator, surround with parenthesis\n if (root.operator && root.operator !== '<implicit>') {\n str = str.concat(`(`)\n }\n // vector start, surround with parenthesis\n if (root.field && root.field !== '<implicit>' && root.operator && root.left && root.operator === '<implicit>') {\n str = str.concat(`(`)\n }\n // recurse left tree\n if (root.left) {\n str = this.stringifyQuery(root.left,str)\n }\n // explicit operator\n if (root.operator && root.operator !== '<implicit>') {\n str = str.concat(` ${root.operator} `)\n }\n // recurse right tree\n if (root.right) {\n str = this.stringifyQuery(root.right,str);\n }\n // vector end, terminate parenthesis\n if (root.field && root.field !== '<implicit>' && root.operator && root.left && root.operator === '<implicit>') {\n str = str.concat(`)`)\n }\n // explicit operator end, terminate parenthesis\n if (root.operator && root.operator !== '<implicit>') {\n str = str.concat(`)`)\n }\n return str\n }", "title": "" }, { "docid": "65fc4da5eb7f9aa8919f5c86cc4d479b", "score": "0.52274436", "text": "queryFieldName(fieldName) {\n return `${fieldName}_as_text`;\n }", "title": "" }, { "docid": "f4f99123f6fff10654e3cc3b8a963d0c", "score": "0.52017754", "text": "function toQuery(filters, fieldMap, $filter){\n\n //If user create an existing group, we merge rules into unique group\n /*var mergedFilters = {};\n filters.forEach(function(filter){\n console.log('filter',filter);\n if(filter.type == 'group'){\n if(!mergedFilters[filter.subType]){\n mergedFilters[filter.subType] = filter;\n }\n else{\n filter.rules.forEach(function(rule){\n var exists = mergedFilters[filter.subType].rules.find(function(f){\n return angular.equals(f,rule);\n });\n if(!exists) mergedFilters[filter.subType].rules.push(rule);\n });\n\n }\n }\n\n });\n console.log(\"merged filters\",mergedFilters);\n filters = Object.values(mergedFilters);\n console.log(\"merged filters values\",filters);*/\n\n var query = filters.map(parseFilterGroup.bind(filters, fieldMap, $filter)).filter(function(item) {\n return !!item;\n });\n\n var searchNestedField = function(filters){\n var fieldNested = null;\n filters.forEach(function(filter){\n if(!filter.field && filter.rules && filter.rules.length){\n fieldNested = searchNestedField(filter.rules);\n }\n\n if(filter.field && filter.field.nested){ //We have a nested field at least\n fieldNested = filter.field;\n return fieldNested;\n }\n });\n\n return fieldNested;\n };\n\n var obj = {};\n\n query.forEach(function(q){\n Object.keys(q).forEach(function(key){\n obj[key] = q[key];\n });\n });\n\n var fieldNested = searchNestedField(filters);\n\n if(fieldNested){\n obj = {\n nested: {\n path: fieldNested.nestedPath || fieldNested.name,\n query: {bool: obj.bool},\n }\n };\n }\n\n return obj;\n\n }", "title": "" }, { "docid": "b80394ab44a65aeb19a2c97aed1025a4", "score": "0.51921594", "text": "function ini_operators() {\n //init search operators by class name search_op, retrieve corresponding column namee\n angular.forEach(document.getElementsByClassName(\"search_op\"), function (dropdownlist, i) {\n dropdownlist.title = \"comparison operator\";\n // remove all options from dropdown list\n for(var i = dropdownlist.options.length - 1 ; i >= 0 ; i--) { dropdownlist.remove(i); }\n var colName = angular.element(dropdownlist).attr('search_col').split('.').pop(); //fetch last item, which is corresponding column name\n //Sanity check, make sure Search Column specified is valid\n if( ! (colName in self.editEntity)) {\n MessageService.error(\"Column: \"+colName+\" specified in a Dropdown list is not defined in root model.\", \"error\");\n return;\n };\n // add appropriate options to dropdownList according to Column type (String/Date/Number, etc)\n angular.forEach(SearchOperators, function (item, i) {\n var option = document.createElement(\"option\");\n option.value = item.value;\n option.text = item.text; //+\" \"+item.desc;\n option.title = item.desc;\n // if search column's data type is in SearchOperators' applied_to,\n // add this operator to available operators for the specified column\n if (item.applied_to.indexOf(getFieldType(colName)) >= 0) { dropdownlist.add(option); }\n });\n // for String column default dropdownList value to \"Start with\" (\"like\" operation)\n if (getFieldType(colName)==\"String\") dropdownlist.value=\"like\";\n });\n }", "title": "" }, { "docid": "79abe8cc337f79bf261b422896134cf3", "score": "0.51915765", "text": "filter() {\n // Copy the query string to not mutate the original object\n const queryObj = { ...this.queryString };\n\n // Create an array with the queryObj fields that are to be excluded\n // (they're not schema fields and are handled by the other methods)\n const excludeFields = ['page', 'sort', 'limit', 'fields'];\n\n // Remove those field from the queryObj\n excludeFields.forEach(el => delete queryObj[el]);\n\n // Check if querying by category - this will allow querying by multiple category IDs\n if (queryObj.category) {\n // Split to get all category IDs into one array\n const categoryIds = queryObj.category.split(',');\n\n // Assign the category IDs array to the query param so that if queried by multiple\n // category IDs the DB will find them and send response correctly\n queryObj.category = categoryIds;\n }\n\n // Stringify the queryObj into a queryString so that string operations can be performed on it\n let queryStr = JSON.stringify(queryObj);\n\n // Find mongoose operators and add a '$' symbol before each one to make them valid filter operators\n queryStr = queryStr.replace(/\\b(gte|gt|lte|lt)\\b/g, match => `$${match}`);\n\n console.log(queryStr);\n\n // Apply the queryObj to the db query filter\n this.query = this.query.find(JSON.parse(queryStr));\n\n // Allows method chaining\n return this;\n }", "title": "" }, { "docid": "0f62329ebf0591828150ae30658fc3ac", "score": "0.5182808", "text": "function buildQuery(query, vals, required) {\n\tif(vals.table) {\n\t\tif(vals.where) {\n\t\t\tquery += \" WHERE \";\n\t\t\tquery += objToQuery(vals.where, null, true);\n\t\t} else {\n\t\t\tif(required && required.where) {\n\t\t\t\tthrow new Error('No Where values');\n\t\t\t}\n\t\t}\n\n\t\tif(vals.set) {\n\t\t\tquery += \" SET \";\n\t\t\tquery += objToQuery(vals);\n\t\t} else {\n\t\t\tif(required && required.set) {\n\t\t\t\tthrow new Error('No set values');\n\t\t\t}\n\t\t}\n\n\t\tif(vals.orderBy) query += \" ORDER BY \" + vals.orderBy;\n\n\t\tif(vals.offset) query += \" OFFSET \" + vals.offset;\n\n\t\tif(vals.limit) query += \" LIMIT \" + vals.limit;\n\n\t\treturn query;\n\t} else {\n\t\tthrow new Error('No Table Specified');\n\t}\t\n}", "title": "" }, { "docid": "287ad196f4bc5d4a09a023a1e1af3974", "score": "0.51786894", "text": "function query() {\n\tvar emptyFn = function () { };\n\tvar utils = {\n\t\tisArray: function(obj) {\n\t\t\treturn obj && (Object.prototype.toString.call(obj) === '[object Array]' );\n\t\t}\n\t};\n\n\tvar queryObj = {\t\n\t\terrors: [],\n\t\tfilters: [],\n\t\tgroupLambdas: [],\n\t\tgroupFilters: [],\n\t\tprojection : []\n\t};\n\n\tqueryObj.select = function(mapFn) {\n\n\t\tif(queryObj._select) {\n\t\t\tqueryObj.errors.push({ message: 'Duplicate SELECT' });\n\t\t\treturn queryObj;\n\t\t}\n\n\t\tqueryObj._select = function (argument) {\n\t\t\tif(mapFn) {\n\t\t\t\tvar refined = [];\n\t\t\t\tif(queryObj._joinedCollections) {\n\t\t\t\t\tfor(var x= 0; x < queryObj._joinedCollections.length; ++ x) {\n\t\t\t\t\t\trefined.push(mapFn(queryObj._joinedCollections[x]));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor(var x= 0; x < queryObj.projection.length; ++ x) {\n\t\t\t\t\t\trefined.push(mapFn(queryObj.projection[x]));\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tqueryObj.projection = refined;\n\t\t\t}\n\t\t}\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.from = function () {\n\t\tif(queryObj._from) {\n\t\t\tqueryObj.errors.push({ message: 'Duplicate FROM' });\n\t\t\treturn queryObj;\n\t\t}\n\n\t\tvar colsureArgs = arguments;\n\n\t\tqueryObj._from = function () {\n\t\t\tqueryObj._fromCollections = colsureArgs;\n\t\t\tif(colsureArgs) {\n\t\t\t\tswitch(colsureArgs.length) {\n\t\t\t\t\tcase 1:\t\t\t\t\t\n\t\t\t\t\t\tif(utils.isArray(colsureArgs[0])) {\t\t\t\t\t\t\n\t\t\t\t\t\t\tqueryObj.projection = colsureArgs[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2: break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.where = function () {\n\t\tif(arguments.length > 0) { \n\t\t\tqueryObj.filters.push({ filterFunctions : arguments });\n\t\t}\n\n\n\n\t\tif(!queryObj._where) {\n\n\t\t\tqueryObj._checkORConditions = function(lambdaCollection, payload) {\t\t\t\t\n\t\t\t\tfor(var k=0; k< lambdaCollection.length; ++ k) {\n\t\t\t\t\tif(lambdaCollection[k](payload)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tqueryObj._where = function () {\n\t\t\t\t\n\t\t\t\tvar fromCollections = queryObj._fromCollections;\n\t\t\t\tif(fromCollections.length > 1) {\n\t\t\t\t\tvar refinedCollection = [];\n\t\t\t\t\tfor(var i=0; i< fromCollections[0].length; ++ i) {\n\t\t\t\t\t\tfor(var j=0; j< fromCollections[1].length; ++ j) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar join = [fromCollections[0][i], fromCollections[1][j]];\n\t\t\t\t\t\t\tif(queryObj.filters.length > 0) {\n\t\t\t\t\t\t\t\tvar include = true;\n\t\t\t\t\t\t\t\tfor(var f = 0; f < queryObj.filters.length; ++ f) {\n\t\t\t\t\t\t\t\t\tvar evalResult = queryObj._checkORConditions(queryObj.filters[f].filterFunctions, join);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!evalResult) {\n\t\t\t\t\t\t\t\t\t\tinclude = false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(include) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\trefinedCollection.push(join);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trefinedCollection.push(join);\n\t\t\t\t\t\t\t}\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\tqueryObj._joinedCollections = refinedCollection;\n\t\t\t\t} else {\n\t\t\t\t\tvar filteredItems = [];\n\t\t\t\t\tfor(var c = 0; c < queryObj.projection.length; ++ c) {\n\t\t\t\t\t\tvar citem = queryObj.projection[c];\n\t\t\t\t\t\tif(queryObj.filters.length > 0) {\n\t\t\t\t\t\t\tvar include = true;\n\t\t\t\t\t\t\tfor(var f = 0; f < queryObj.filters.length; ++ f) {\n\t\t\t\t\t\t\t\tvar evalResult = queryObj._checkORConditions(queryObj.filters[f].filterFunctions, citem);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!evalResult) {\n\t\t\t\t\t\t\t\t\tinclude = false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(include) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfilteredItems.push(citem);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\t\t\t\t\t\t\n\t\t\t\t\t\t\tfilteredItems.push(citem)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tqueryObj.projection = filteredItems;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.groupBy = function (gpLambda) {\n\t\tif(gpLambda) {\t\t\t\n\t\t\tfor(var x = 0; x < arguments.length; ++ x) {\n\t\t\t\tqueryObj.groupLambdas.push(arguments[x]);\n\t\t\t}\n\t\t}\n\n\t\tif(!queryObj._applyGroupLambda) {\n\t\t\tqueryObj._applyGroupLambda = function(collection, lambda) {\n\t\t\t\tvar refined = [];\n\t\t\t\tfor(var x= 0; x < collection.length; ++ x) {\n\t\t\t\t\tvar item = collection[x], lambdaItem = lambda(item);\n\t\t\t\t\tif(lambdaItem) {\n\t\t\t\t\t\tvar gpObj = null;\n\t\t\t\t\t\tfor(var y = 0; y< refined.length; ++ y) {\n\t\t\t\t\t\t\tif(refined[y][0] === lambdaItem) {\n\t\t\t\t\t\t\t\tgpObj = refined[y];\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\n\t\t\t\t\t\tif(gpObj) {\n\t\t\t\t\t\t\tgpObj[1].push(item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trefined.push([lambdaItem, [item]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn refined;\n\t\t\t}\n\t\t}\n\n\t\tif(!queryObj._groupBy) {\n\t\t\tqueryObj._groupBy = function () {\n\t\t\t\tif(queryObj.groupLambdas.length > 0) {\t\t\t\t\t\n\t\t\t\t\tqueryObj.projection = queryObj._applyGroupLambda(queryObj.projection, queryObj.groupLambdas[0]);\n\t\t\t\t}\n\t\t\t\tif(queryObj.groupLambdas.length > 1) {\n\t\t\t\t\tvar refinedGroups = [];\n\t\t\t\t\tfor(var p = 0; p < queryObj.projection.length; ++ p) {\n\t\t\t\t\t\tvar gpArr = queryObj.projection[p];\n\t\t\t\t\t\tvar gpItems = queryObj._applyGroupLambda(gpArr[1], queryObj.groupLambdas[1]);\n\t\t\t\t\t\trefinedGroups.push([gpArr[0], gpItems]);\n\t\t\t\t\t}\n\t\t\t\t\tqueryObj.projection = refinedGroups;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.having = function(filterFn) {\n\t\tif(filterFn) {\n\t\t\tqueryObj.groupFilters.push(filterFn);\n\t\t}\n\t\tif(!queryObj._having) {\n\t\t\tqueryObj._having = function () {\n\t\t\t\tvar filteredItems = [];\t\t\t\t\n\t\t\t\tfor(var c = 0; c < queryObj.projection.length; ++ c) {\n\t\t\t\t\tvar citem = queryObj.projection[c];\n\t\t\t\t\tif(queryObj.groupFilters.length > 0) {\n\t\t\t\t\t\tvar exclude = false;\t\t\t\t\t\t\n\t\t\t\t\t\tfor(var f = 0; f < queryObj.groupFilters.length; ++ f) {\n\t\t\t\t\t\t\tif(!queryObj.groupFilters[f](citem)) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\texclude = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!exclude) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfilteredItems.push(citem)\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\t\t\t\t\t\t\n\t\t\t\t\t\tfilteredItems.push(citem)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tqueryObj.projection = filteredItems;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.orderBy = function(sortLambda) {\n\t\tif(!queryObj._orderBy) {\n\t\t\tvar closureLambda = sortLambda;\n\t\t\tqueryObj._orderBy = function() {\n\t\t\t\tqueryObj.projection.sort(closureLambda);\n\t\t\t}\n\t\t}\n\t\treturn queryObj;\n\t}\n\n\tqueryObj.execute = function () {\n\t\tif(queryObj.errors.length > 0) {\n\t\t\tthrow new Error(queryObj.errors[0].message);\n\t\t}\n\t\t(queryObj._from || emptyFn)();\n\t\t(queryObj._where || emptyFn)();\t\t\n\t\t(queryObj._groupBy || emptyFn)();\n\t\t(queryObj._having || emptyFn)();\n\t\t(queryObj._select || emptyFn)();\n\t\t(queryObj._orderBy || emptyFn)();\n\t\treturn queryObj.projection;\t\n\t}\n\n\treturn queryObj;\n}", "title": "" }, { "docid": "7863e4373719cc4f4cd4bbd137c19edf", "score": "0.5158697", "text": "constructor(pathsAndTypes){\n // pathsAndTypes = {fieldName1:dataType,fieldName2:dataType,...}\n if(! LAMBDAS.isObject(pathsAndTypes) || Object.keys(pathsAndTypes).length==0){\n throw new Error(\"MonqadeQueryBuilder requires instantiation with list of paths with type\");\n }\n this._pathsAndTypes =pathsAndTypes;\n //this._useStrict = true;\n this._useStrict =false;\n this._init(); \n this._terms = [];\n this._defaultConjunctionOperator = '$and';\n }", "title": "" }, { "docid": "71577ade491b7f5a3b5da12c8d3921c4", "score": "0.5150158", "text": "getRequestQuery(model, query, fields) {\n if (query || (fields && fields.length > 0)) {\n throw new Error(`Query filter and Viewed field doesn't supported.`);\n }\n return '/';\n }", "title": "" }, { "docid": "10e8f55d7c493f1b8c10a2d9235f0f09", "score": "0.51243687", "text": "function formatQueryData(obj) {\n\t\t\tvar queryData = {}\n\t\t\tvar limit = obj.limit\n\t\t\tif (obj.q) {\n\t\t\t\tqueryData.q = obj.q\n\t\t\t} else {\n\t\t\t\tqueryData = obj\n\t\t\t}\n\n\t\t\tqueryData.format = obj.format || format\n\t\t\tqueryData.countrycodes = countryCodes.join(\",\")\n\n\t\t\treturn queryData\n\t\t}", "title": "" }, { "docid": "6f6c29fc346ff29a27e7568fa2d3a6fa", "score": "0.5123861", "text": "generateSelectFieldsPart (fieldsOnly) {\n if (fieldsOnly === 'id') {\n return this.idFieldClause\n }\n\n if (fieldsOnly === 'idAndRelations') {\n return [].concat(\n this.idFieldClause,\n this._generateForeignKeysLines()\n ).join(', ')\n }\n\n if (fieldsOnly) {\n fieldsOnly = castArray(fieldsOnly)\n\n return [].concat(\n includes(fieldsOnly, 'id') ? this.idFieldClause : [],\n intersection(this.columnsNames, fieldsOnly),\n this._generateForeignKeysLines(fieldsOnly)\n ).join(', ')\n }\n\n return [].concat(\n this.idFieldClause,\n this.columnsNames,\n this._generateForeignKeysLines()\n ).join(', ')\n }", "title": "" }, { "docid": "844fc536330efaa4bd39968677e962e9", "score": "0.51174194", "text": "reqFilters(query, schema) {\n const mongoQuery = {};\n \n for ( const key in query ) {\n /**\n * Three checks to make sure that the key:\n * 1. is not a prototype prop of reqQuery \n * 2. exists in the schema\n * 3. value is not null\n * 4. value is not an empty object or array\n */\n if ( !query.hasOwnProperty(key) ) {\n continue;\n }\n if ( !schema.hasOwnProperty(key) ) {\n continue;\n }\n if ( !query[key] ) {\n continue;\n }\n if ( !Object.keys(query[key]).length ) {\n continue;\n }\n\n // extract val w/ key, get val type\n const val = query[key],\n valType = schema[key].type.name;\n\n // array case\n if ( Array.isArray(val) ) {\n // need to check for existance of a range to prevent overwriting\n const parsed = parseArrayValue(key, val, valType),\n queryHasAnd = mongoQuery.hasOwnProperty('$and'),\n valIsRange = parsed.hasOwnProperty('$and');\n if ( queryHasAnd && valIsRange ) {\n parsed.$and.map((i) => mongoQuery.$and.push(i));\n } else {\n Object.assign(mongoQuery, parsed);\n }\n }\n // single term case\n else {\n Object.assign(mongoQuery, parseSingleValue(key, val, valType));\n }\n }\n return {$match: mongoQuery};\n }", "title": "" }, { "docid": "6952e8f5ca8b583a9940308aebcf4a26", "score": "0.5092717", "text": "function constructQueryForm(queryIndex){\n var selectFieldStringHTML = \"\";\n $.each(responseData[\"Type\"][\"Fields\"], function(key,value){\n selectFieldStringHTML += \"<option value='\"+value['Name']+\"'>\"+value['Name']+\"</option>\"\n });\n var selectOperationStringHTML = \"\";\n $.each(VALID_OPERATIONS, function(key,value){\n //alert(\"key==>\"+key+\" value==>\"+value);\n selectOperationStringHTML += \"<option value='\"+key+\"'>\"+key+\"</option>\"\n });\n var queryFormHTML =\n \"<div class='col-md-3' >\" +\n \"\t\t<div class='control-group'>\" +\n \"\t\t<label class='control-label'>Select Field to Query</label>\" +\n \" <select id='queryFormSelectField\"+queryIndex+\"' class='form-control' name='queryFormSelectField\"+queryIndex+\"'>\"+\n \"\t\t\t \"+selectFieldStringHTML+ //\"+((value.isRequired)?'has-error':'')+\"\n \" </select>\"+\n \" </div>\" +\n \"</div>\"\n ;\n queryFormHTML +=\n \"<div class='col-md-2' >\" +\n \"\t\t<div class='control-group'>\" +\n \"\t\t<label class='control-label'>Select Operation</label>\" +\n \" <select id='queryFormSelectOperation\"+queryIndex+\"' class='form-control' name='queryFormSelectField\"+queryIndex+\"'>\"+\n \"\t\t\t \"+selectOperationStringHTML+ //\"+((value.isRequired)?'has-error':'')+\"\n \" </select>\"+\n \" </div>\" +\n \"</div>\"\n ;\n queryFormHTML +=\n \"<div id='readByQueryInputValueDiv\"+queryIndex+\"' class='col-md-4' >\" +\n \"\t\t<div class='control-group'>\" +\n \"\t\t <label class='control-label'>Input Query Value</label>\" +\n \" <input type='text' id='queryValue\"+queryIndex+\"' name='queryValue\"+queryIndex+\"' placeholder='type:integer; maxLength:8' class='form-control'/>\" +\n \" </div>\" +\n \"</div>\"\n ;\n\n\n return queryFormHTML;\n}", "title": "" }, { "docid": "6d4bf10aed28a46c6450371af83e19a8", "score": "0.50738436", "text": "addQueryStrings() {\n this.formatDefaultFileQuery();\n this.formatDefaultAnalysisQuery();\n }", "title": "" }, { "docid": "0468b4d82963979eee8349573ce0fffa", "score": "0.50642765", "text": "function queryBuilder() {\n if (useQueryBuilder) {\n if (commandList[3] == null) {\n query = '';\n } else {\n for (i = 3; i < commandList.length; i++) {\n query = query + ' ' + commandList[i];\n }\n }\n }\n}", "title": "" }, { "docid": "dc9f2e8df6418d9d95644244df4b8894", "score": "0.5063231", "text": "_isSelectQuery() {\n return includes(['pluck', 'first', 'select'], this._method);\n }", "title": "" }, { "docid": "6d75ff5ac44a94747d5e5a3190d1d457", "score": "0.5055865", "text": "function generateQuery(fields, f) {\n if (fields.length == 1) {\n var v1 = fields[0];\n if (f != null)\n return {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n },\n {\n channel: \"?\",\n field: f,\n type: types[f],\n },\n ],\n },\n chooseBy: \"effectiveness\",\n };\n return (spec_query = {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n }, ],\n },\n chooseBy: \"effectiveness\",\n });\n }\n if (fields.length == 2) {\n var v1 = fields[0];\n var v2 = fields[1];\n if (f != null)\n return {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n },\n {\n channel: \"?\",\n field: v2,\n type: types[v2],\n },\n {\n channel: \"?\",\n field: f,\n type: types[f],\n },\n ],\n },\n chooseBy: \"effectiveness\",\n };\n return {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n },\n {\n channel: \"?\",\n field: v2,\n type: types[v2],\n },\n ],\n },\n chooseBy: \"effectiveness\",\n };\n } else {\n var v1 = fields[0];\n var v2 = fields[1];\n var v3 = fields[2];\n if (f != null)\n return {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n },\n {\n channel: \"?\",\n field: v2,\n type: types[v2],\n },\n {\n channel: \"?\",\n field: v3,\n type: types[v3],\n },\n {\n channel: \"?\",\n field: f,\n type: types[f],\n },\n ],\n },\n chooseBy: \"effectiveness\",\n };\n return {\n spec: {\n data: {\n url: dataurl,\n },\n mark: \"?\",\n encodings: [{\n channel: \"?\",\n field: v1,\n type: types[v1],\n },\n {\n channel: \"?\",\n field: v2,\n type: types[v2],\n },\n {\n channel: \"?\",\n field: v3,\n type: types[v3],\n },\n ],\n },\n chooseBy: \"effectiveness\",\n };\n }\n}", "title": "" }, { "docid": "a675e954d47cfbe18409e4ef7e205c56", "score": "0.5041822", "text": "function parse_query() {\n \n const query = get_query();\n \n console.log(`query: ${Object.keys(query).map(key => `${key} = ${query[key]}`).join(' & ')}`);\n\n set_layout(query.layout);\n set_language(query.lang);\n }", "title": "" }, { "docid": "00e9a9c7adffda2794a89a48c9292699", "score": "0.50374985", "text": "function queryish() {\n return {\n execWithin: dummy_2,\n exec: dummy_1,\n get: dummy_1,\n all: dummy_1,\n };\n }", "title": "" }, { "docid": "2e8c361fc336524ef3f1d8336c19c078", "score": "0.5026809", "text": "buildCustomQuery(input) {\n if (typeof input !== 'string') {\n handleError('db10'); return;\n }\n input = sanitizeInput(input);\n this.query += input + ' ';\n return this.query;\n }", "title": "" }, { "docid": "a01c55530fd5ea4bfc3d93f08e922d35", "score": "0.5021335", "text": "async buildQuery() {\n // Find documents\n let query = this.entityInfo.model.find(this.findOptions);\n\n // Projection\n if (this.selectionOptions) query = query.select(this.selectionOptions);\n\n query = this.additionalBuildQuery ? this.additionalBuildQuery(query) : query;\n\n /**\n * These will be expensive in computation, so we execute them in last place\n */\n\n if (this.populationOptions.length > 0)\n // Populate refs\n query = query.populate(\n // Only take populationOptions that are inclused in selectionOptions\n this.populationOptions.filter(\n ({ path }) => Ɂ(this.selectionOptions[path]) || this.selectionOptions[path] === 1\n )\n );\n\n if (this.subPopulationOptions.length > 0)\n // SubPopulate refs\n query = query.subPopulate(\n // Only take subPopulationOptions that are inclused in selectionOptions\n this.subPopulationOptions.filter(\n ({ path }) => Ɂ(this.selectionOptions[path]) || this.selectionOptions[path] === 1\n )\n );\n\n return query;\n }", "title": "" }, { "docid": "14a42c916da2635497fda3aa21ea7eff", "score": "0.50159895", "text": "function default_query_formatter(query)\n{\n\t//replace semicolons(;) with boolean OR (most sites use the word OR)\n\t// also URL escape the query\n\tquery = query.replace(/\\s*\\;\\s*/, \" OR \");\n\tquery = escape(query);\n\t\n\t//return the re-formatted query\n\treturn query;\n}", "title": "" }, { "docid": "dfbb98027d548a88465f92a475c2a8d6", "score": "0.5006543", "text": "setFilterCriteria() {\n console.log('setFilterCriteria');\n // Close Modal\n this.closeModal();\n\n // Example Output from SOQL Query Builder\n // this._query = SELECT Id, Name FROM Account WHERE Name LIKE '%a%' LIMIT 10;\n\n // If query is set\n if (this._query) {\n // If query contains LIMIT Remove everything after LIMIT\n if (this._query.includes('LIMIT')) {\n this._query = this._query.substring(0, this._query.indexOf('LIMIT'));\n }\n\n // If query contains ORDER BY Remove everything after ORDER BY\n if (this._query.includes('ORDER BY')) {\n this._query = this._query.substring(0, this._query.indexOf('ORDER BY'));\n }\n\n // Everything Between SELECT and FROM is the fields to display\n let fieldsToDisplay = this._query.substring(this._query.indexOf('SELECT') + 6, this._query.indexOf('FROM')).trim();\n console.log('fieldsToDisplay: ' + fieldsToDisplay);\n // Example what fieldsToDisplay should look like\n // {\"label\":\"Account Name\",\"name\":\"Name\",\"type\":\"STRING\",\"sublabel\":\"Name\",\"leftIcon\":\"utility:text\",\"hidden\":false}]\n // Go through each field and add the label, name, type, sublabel, leftIcon, and hidden\n let fields = [];\n let fieldArray = fieldsToDisplay.split(',');\n for (let i = 0; i < fieldArray.length; i++) {\n let field = fieldArray[i].trim();\n let fieldLabel = field;\n let fieldName = field;\n let fieldType = 'STRING';\n let fieldSublabel = field;\n let fieldLeftIcon = 'utility:text';\n let fieldHidden = false;\n fields.push({\n label: fieldLabel,\n name: fieldName,\n type: fieldType,\n sublabel: fieldSublabel,\n leftIcon: fieldLeftIcon,\n hidden: fieldHidden\n });\n }\n console.log('fields: ' + JSON.stringify(fields));\n this.inputValues.fieldsToDisplay.value = fields;\n this.dispatchFlowValueChangeEvent('fieldsToDisplay', fields, DATA_TYPE.STRING);\n\n // Everything After WHERE is the filter criteria\n // Check if WHERE is in the query\n if (this._query.includes('WHERE')) {\n let whereClause = this._query.substring(this._query.indexOf('WHERE') + 5).trim();\n console.log('whereClause: ' + whereClause);\n this.inputValues.whereClause.value = whereClause;\n this.dispatchFlowValueChangeEvent('whereClause', whereClause, DATA_TYPE.STRING);\n }\n }\n }", "title": "" }, { "docid": "2817d54dfea52af6918f6a201f20dd32", "score": "0.50017005", "text": "_getParams(field, values) {\n let value;\n\n if (Array.isArray(values)) {\n values = values.slice(0);\n if (values.length > 1) {\n return values;\n }\n value = values[0];\n } else if (this.type(values) === 'object') {\n value = Object.keys(values)\n .map(function (name) {\n const op = this.operators[name];\n if (!op) {\n return null;\n }\n\n const type = this.meta[field].type;\n return convertRangeType(this.cqlFunctions[type], values[name], name);\n }, this)\n .filter(Boolean);\n\n if (value.length) {\n return value;\n }\n } else {\n value = values;\n }\n\n return this.type(value) === 'string' || this.type(value) === 'number' ? value : null;\n }", "title": "" }, { "docid": "4ab5f2b70f35896943f9f03211d2dd38", "score": "0.49999177", "text": "function generateQuery( clean ){\n\n const vs = new peliasQuery.Vars( defaults );\n\n // sources\n if( _.isArray(clean.sources) && !_.isEmpty(clean.sources) ){\n vs.var( 'sources', clean.sources );\n }\n\n // layers\n if (_.isArray(clean.layers) && !_.isEmpty(clean.layers) ){\n vs.var( 'layers', clean.layers);\n }\n\n // boundary country\n if( _.isArray(clean['boundary.country']) && !_.isEmpty(clean['boundary.country']) ){\n vs.set({\n 'multi_match:boundary_country:input': clean['boundary.country'].join(' ')\n });\n }\n\n // pass the input tokens to the views so they can choose which tokens\n // are relevant for their specific function.\n if( _.isArray( clean.tokens ) ){\n vs.var( 'input:name:tokens', clean.tokens );\n vs.var( 'input:name:tokens_complete', clean.tokens_complete );\n vs.var( 'input:name:tokens_incomplete', clean.tokens_incomplete );\n }\n\n // input text\n vs.var( 'input:name', clean.text );\n\n // if the tokenizer has run then we set 'input:name' to as the combination of the\n // 'complete' tokens with the 'incomplete' tokens, the resuting array differs\n // slightly from the 'input:name:tokens' array as some tokens might have been\n // removed in the process; such as single grams which are not present in then\n // ngrams index.\n if( _.isArray( clean.tokens_complete ) && _.isArray( clean.tokens_incomplete ) ){\n var combined = clean.tokens_complete.concat( clean.tokens_incomplete );\n if( combined.length ){\n vs.var( 'input:name', combined.join(' ') );\n }\n }\n\n // focus point\n if( _.isFinite(clean['focus.point.lat']) &&\n _.isFinite(clean['focus.point.lon']) ){\n vs.set({\n 'focus:point:lat': clean['focus.point.lat'],\n 'focus:point:lon': clean['focus.point.lon']\n });\n }\n\n // boundary rect\n if( _.isFinite(clean['boundary.rect.min_lat']) &&\n _.isFinite(clean['boundary.rect.max_lat']) &&\n _.isFinite(clean['boundary.rect.min_lon']) &&\n _.isFinite(clean['boundary.rect.max_lon']) ){\n vs.set({\n 'boundary:rect:top': clean['boundary.rect.max_lat'],\n 'boundary:rect:right': clean['boundary.rect.max_lon'],\n 'boundary:rect:bottom': clean['boundary.rect.min_lat'],\n 'boundary:rect:left': clean['boundary.rect.min_lon']\n });\n }\n\n // boundary circle\n // @todo: change these to the correct request variable names\n if( _.isFinite(clean['boundary.circle.lat']) &&\n _.isFinite(clean['boundary.circle.lon']) ){\n vs.set({\n 'boundary:circle:lat': clean['boundary.circle.lat'],\n 'boundary:circle:lon': clean['boundary.circle.lon']\n });\n\n if( _.isFinite(clean['boundary.circle.radius']) ){\n vs.set({\n 'boundary:circle:radius': Math.round( clean['boundary.circle.radius'] ) + 'km'\n });\n }\n }\n\n // boundary gid\n if( _.isString(clean['boundary.gid']) ){\n vs.set({\n 'boundary:gid': clean['boundary.gid']\n });\n }\n\n // categories\n if (clean.categories && clean.categories.length) {\n vs.var('input:categories', clean.categories);\n }\n\n // size\n if( clean.querySize ) {\n vs.var( 'size', clean.querySize );\n }\n\n // run the address parser\n if( clean.parsed_text ){\n textParser( clean, vs );\n }\n\n // set the 'add_name_to_multimatch' variable only in the case where one\n // or more of the admin variables are set.\n // the value 'enabled' is not relevant, it just needs to be any non-empty\n // value so that the associated field is added to the multimatch query.\n // see code comments above for additional information.\n let isAdminSet = adminFields.some(field => vs.isset('input:' + field));\n if ( isAdminSet ){ vs.var('input:add_name_to_multimatch', 'enabled'); }\n\n // Search in the user lang\n if(clean.lang && _.isString(clean.lang.iso6391)) {\n vs.var('lang', clean.lang.iso6391);\n\n const field = toSingleField(vs.var('admin:add_name_lang_to_multimatch:field').get(), clean.lang.iso6391);\n vs.var('admin:add_name_lang_to_multimatch:field', field);\n }\n\n return {\n type: 'autocomplete',\n body: query.render(vs)\n };\n}", "title": "" }, { "docid": "6fadb05e268b63485aad168d171ad5e1", "score": "0.49823993", "text": "function renderFilterFieldsWithAnswers_savedReports_outPut(divId,filter_data){\nvar tableId = renderFilterFieldsWithOutRows_savedReports_outPut(divId,filter_data);\n\n\t\n\t\n\tjQuery.post(\"dynamicReport_populateAvailableColumns.action\", {}, function(availabeColumns) {\n\t\n\t\tvar filterRowCount = 1;\n\t\t\n\t\tjQuery.each(filter_data, function(index, tableRow_filter) {\n\t\t\t/*console.log(tableRow_filter.fieldName)\n\t\t\tconsole.log(tableRow_filter.expression)\n\t\t\tconsole.log(tableRow_filter.val)\n\t\t\tconsole.log(tableRow_filter.and_or)\n\t\t\tconsole.log(\"------------------------------\")*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\tvar table = document.getElementById(tableId);\n\t\t\t\n\t\t\tvar newRow = table.insertRow(table.rows.length);\n\t\t\tnewRow.id = tableId+\"$\"+((table.rows.length));\n\t\t\t\n\t\t\tvar fieldNameCell = newRow.insertCell(0);\n\t\t\tvar jsonArr = jQuery.parseJSON(availabeColumns);\n\t\t\tvar selectHtmlString = \"<select class='select2' onchange ='populateExpressionDropDown(this.value,$(this).parent().parent());'><option value=''>Select </option>\";\n\t\t\tfor(var i = 0;i<jsonArr.length;i++){\n\t\t\t\t\n\t\t\t\tif(jsonArr[i].columnLabel == tableRow_filter.fieldName){\n\t\t\t\t\tselectHtmlString = selectHtmlString+\"<option value='\" +jsonArr[i].columnName+\"%\"+jsonArr[i].columnType+ \"' selected>\"+ jsonArr[i].columnLabel + \"</option>\"\n\t\t\t\t}else{\n\t\t\t\t\tselectHtmlString = selectHtmlString+\"<option value='\" +jsonArr[i].columnName+\"%\"+jsonArr[i].columnType+ \"'>\"+ jsonArr[i].columnLabel + \"</option>\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tselectHtmlString = selectHtmlString+'</select>';\n\t\t\tfieldNameCell.innerHTML = selectHtmlString;\n\t\t\t\n\t\t\t\n\t\t\tvar conditionCell = newRow.insertCell(1);\n\t\t\tvar conditions = [];\n\t\t\t\n\t\t\tif(tableRow_filter.fieldDataType.includes(\"varchar\")){\n\t\t\t\t conditions = ['Equal to','Not Equal to','Contains','Not Contains','Is empty','Is not empty'];\n\t\t\t}else if(tableRow_filter.fieldDataType.includes(\"date\")){\n\t\t\t\t conditions = ['Equal to','Not Equal to','Greater than','Greater than or equal to','Less than','Less than or equal to','Between','Is empty','Is not empty'];\n\t\t\t}else{\n\t\t\t\t conditions = ['Equal to','Not Equal to','Greater than','Greater than or equal to','Less than','Less than or equal to','Is empty','Is not empty'];\n\t\t\t}\n\t\t\t\n\t\t\tvar select_expression = createDropDown_FilterExpression_withDefaultValue(conditions,tableRow_filter.expression);\n\t\t\tconditionCell.innerHTML = $(select_expression).prop('outerHTML');\n\t\t\tif(tableRow_filter.fieldDataType.includes(\"date\")){\n\t\t\t\tif(tableRow_filter.expression == \"Between\"){\n\t\t\t\t\tvar dateArray = (tableRow_filter.val).split(\"and\");\n\t\t\t\t\tdateArray[0] = dateArray[0].replace('\"', \"\");\n\t\t\t\t\tdateArray[1] = dateArray[1].replace('\"', \"\");\n\t\t\t\t\tdateArray[0] = dateArray[0].replace('\"', \"\");\n\t\t\t\t\tdateArray[1] = dateArray[1].replace('\"', \"\");\n\t\t\t\t\tdateArray[0] = dateArray[0].trim();\n\t\t\t\t\tdateArray[1] = dateArray[1].trim();\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t\tvar textBox1 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : dateArray[0]\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar textBox2 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : dateArray[1]\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalueCell.innerHTML = $(textBox1).prop('outerHTML')+\"&nbsp to &nbsp\"+$(textBox2).prop('outerHTML');\n\t\t\t\t\t\n\t\t\t\t}else if(tableRow_filter.expression == \"Is empty\" || tableRow_filter.expression == \"Is not empty\" ){\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t\tvar textBox1 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : tableRow_filter.val\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvalueCell.innerHTML = $(textBox1).prop('outerHTML');\n\t\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('.datePickerTextBox').datepicker({ \n\t\t\t autoclose: true, \n\t\t\t todayHighlight: true,\n\t\t\t format: 'yyyy/mm/dd',\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}else{\n\n\t\t\tif(tableRow_filter.expression == \"Is empty\" || tableRow_filter.expression == \"Is not empty\" ){\n\t\t\t\t\n\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t \n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\tvar textBox = $('<input/>').attr({\n\t\t\t\t\ttype : 'text',\n\t\t\t\t\tvalue : tableRow_filter.val\n\t\t\t\t});\n\t\t\t\tvalueCell.innerHTML = $(textBox).prop('outerHTML');\n\t\t\t\t \n\t\t\t}\n\t\t\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(filter_data.length > 1){\n\t\t\t\tvar and_or_cell = newRow.insertCell(3);\n\t\t\t\tif( filterRowCount < filter_data.length){\n\t\t\t\t\t\n\t\t\t\t\tvar and_or_value = tableRow_filter.and_or;\n\t\t\t\t\t\n\t\t\t\t\tif(and_or_value == \"AND\"){\n\t\t\t\t\t\tand_or_cell.innerHTML =\t'<select class=\"select2\" ><option value=\"AND\" selected>AND </option><option value=\"OR\">OR </option></select>';\n\t\t\t\t\t}else if(and_or_value == \"OR\"){\n\t\t\t\t\t\tand_or_cell.innerHTML =\t'<select class=\"select2\" ><option value=\"AND\" >AND </option><option value=\"OR\" selected>OR </option></select>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar controlBtn;\n\t\t\tif(filter_data.length > 1){\n\t\t\t\tcontrolBtn = newRow.insertCell(4);\n\t\t\t}else{\n\t\t\t\tcontrolBtn = newRow.insertCell(3);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvar del_btn = $('<button/>').attr({\n\t\t\t\ttype : 'button',\n\t\t\t\tclass : 'btn btn-sts',\n\t\t\t\tonclick : 'deleteRowAndValidateParentRow($(this).parent().parent(),\"filterTable_savedReports_outPut\");',\n\t\t\t\tstyle : 'margin-top:15px',\n\t\t\t});\n\t\t\t$(del_btn).text(\"Delete\");\n\t\t\tcontrolBtn.innerHTML = $(del_btn).prop('outerHTML');\n\t\t\t\n\t\t\t$('.select2').select2();\n\t\t\tfilterRowCount = filterRowCount+1;\n\t\t\n\t\t});\n\t\t});\n}", "title": "" }, { "docid": "5cd6da23268413dc650b3f348dd8d1e9", "score": "0.4981162", "text": "function buildQuery() {\r\n const pickup = req.query.pickup;\r\n const dropoff = req.query.dropoff;\r\n let table = \"badTable\";\r\n\r\n switch (ride)\r\n {\r\n case 'green':\r\n table = 'GreenCab';\r\n break;\r\n case 'yellow':\r\n table = 'YellowCab';\r\n break;\r\n default:\r\n common.error(\"can't build query\", context);\r\n break;\r\n }\r\n return `\r\nselect top 1000 total_amount from ${table}\r\nwhere pickup_location_id =\r\n(select top 1 location_id from Zones where Zones.zone = '${pickup}') AND\r\ndropoff_location_id =\r\n(select top 1 location_id from Zones where Zones.zone = '${dropoff}') `;\r\n }", "title": "" }, { "docid": "f31429179f51aa038b022a73f12d81fe", "score": "0.49744377", "text": "function concatQuery() {\n var query = \"(\";\n query = query + concatValoresSelect('#Anios', 'anio_id=');\n query = query + \") AND (\";\n query = query + concatValoresSelect('#Estados', 'estimacion_volumetrica_cultivo.estado_id=');\n query = query + \") AND (\";\n query = query + concatValoresSelect('#Municipios', 'municipio_id=');\n query = query + \") AND (\";\n query = query + concatValoresSelect('#Ciclos', 'ciclo_id=');\n query = query + \") AND (\";\n query = query + concatValoresSelect('#Cultivos', 'cultivo_id=');\n query = query + \")\";\n return query;\n}", "title": "" }, { "docid": "d93aee5c8f702097a05ecba3eda59754", "score": "0.49706712", "text": "function patchResult(o) {\n var old_func = o.find;\n var m = o.model || o;\n var comps = ['val', 'from', 'to'];\n if (old_func.is_new)\n return;\n /**\n * filter the Date-Type SelectQuery Property corresponding item when call find-like executor ('find', 'get', 'where')\n * @param opt\n */\n function filter_date(opt) {\n for (var k in opt) {\n if (k === 'or')\n opt[k].forEach(filter_date);\n else {\n var p = m.allProperties[k];\n if (p && p.type === 'date') {\n var v = opt[k];\n if (!util.isDate(v)) {\n if (util.isNumber(v) || util.isString(v))\n opt[k] = new Date(v);\n else if (util.isObject(v)) {\n comps.forEach(c => {\n var v1 = v[c];\n if (util.isArray(v1)) {\n v1.forEach((v2, i) => {\n if (!util.isDate(v2))\n v1[i] = new Date(v2);\n });\n }\n else if (v1 !== undefined && !util.isDate(v1)) {\n v[c] = new Date(v1);\n }\n });\n }\n }\n }\n }\n }\n }\n var new_func = function () {\n var opt = arguments[0];\n if (util.isObject(opt) && !util.isFunction(opt)) {\n /** filter opt to make Date-Type SelectQuery Property corresponding item */\n filter_date(opt);\n }\n var rs = old_func.apply(this, Array.prototype.slice.apply(arguments));\n if (rs) {\n patchResult(rs);\n patchSync(rs, [\n \"count\",\n \"first\",\n \"last\",\n 'all',\n 'where',\n 'find',\n 'remove',\n 'run'\n ]);\n }\n return rs;\n };\n new_func.is_new = true;\n o.where = o.all = o.find = new_func;\n}", "title": "" }, { "docid": "a44bbd618453db18f5887a30eb6061ec", "score": "0.49680233", "text": "_getFilters(collection, filterFields)\r\n {\r\n // Some tables will be defined with enumerations.\r\n var enumerations = collection.getEnumerations();\r\n\r\n // Get those columns with data names.\r\n var filters = [];\r\n this._datetimepickerElements = [];\r\n var columns = $(this.el).find(this.options.table + ' thead th').filter(function() { return $(this).attr('data-name'); });\r\n for (var i = 0; i < columns.length; i++)\r\n {\r\n var column = $(columns[i]);\r\n var field = column.attr('data-name');\r\n var datetimeLtFilter = false;\r\n var datetimeGtFilter = false;\r\n if (filterFields[field])\r\n {\r\n // First, check to see if this is an enumeration field (which Django doesn't cover).\r\n // If it is, deal with it as such.\r\n\r\n\r\n for (var j = 0; j < filterFields[field].length; j++)\r\n {\r\n var filter = filterFields[field][j];\r\n switch (filter)\r\n {\r\n case 'icontains':\r\n {\r\n filters.push(this._getFilterText(column.text(), field));\r\n break;\r\n }\r\n\r\n case 'gt':\r\n {\r\n datetimeGtFilter = true;\r\n break;\r\n }\r\n\r\n case 'lt':\r\n {\r\n datetimeLtFilter = true;\r\n break;\r\n }\r\n\r\n case 'exact':\r\n {\r\n break;\r\n }\r\n\r\n default:\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Check for datetime filters.\r\n if (datetimeGtFilter || datetimeLtFilter)\r\n {\r\n if (datetimeGtFilter)\r\n {\r\n var elementId = '#' + field + '__gt';\r\n this._datetimepickerElements.push(elementId);\r\n }\r\n if (datetimeLtFilter)\r\n {\r\n elementId = '#' + field + '__lt';\r\n this._datetimepickerElements.push(elementId);\r\n }\r\n filters.push(this._getFilterDatetime(column.text(), field));\r\n }\r\n }\r\n }\r\n\r\n // Finally, get enumerations.\r\n var templateChoice = _.template($(this.options.templateFilterChoice).html());\r\n var templateInput = _.template($(this.options.templateFilterEnum).html());\r\n for (var [field, enumeration] of enumerations)\r\n {\r\n var htmlChoice = templateChoice({label: enumeration.label, field: field});\r\n var htmlInput = templateInput({label: enumeration.label, field: field, values: enumeration.values});\r\n var filterObject = {collectionItem: htmlChoice, input: htmlInput};\r\n filters.push(filterObject);\r\n }\r\n\r\n return filters;\r\n }", "title": "" }, { "docid": "15b4f43ed9e22ee05365fd1ef402c801", "score": "0.4958025", "text": "function getQueryOptions(eq, entityType) {\n var queryOptions = {};\n\n var $skip = toSkipString();\n if ($skip)\n queryOptions['$skip'] = $skip;\n\n var $top = toTopString();\n if ($top)\n queryOptions['$top'] = $top;\n\n var $inlinecount = toInlineCountString();\n if ($inlinecount)\n queryOptions['$inlinecount'] = $inlinecount;\n\n if (entityType) {\n var $filter = toFilterString();\n if ($filter)\n queryOptions['$filter'] = $filter;\n\n var $orderby = toOrderByString();\n if ($orderby)\n queryOptions['$orderby'] = $orderby;\n\n var $expand = toExpandString();\n if ($expand)\n queryOptions['$expand'] = $expand;\n\n var $select = toSelectString();\n if ($select)\n queryOptions['$select'] = $select;\n }\n\n queryOptions = _.extend(queryOptions, eq.parameters);\n\n // remove undefined fields from the result object, they throw exceptions if\n // sent empty to the server\n return queryOptions;\n\n function toInlineCountString() {\n return eq['inlineCountEnabled'] ? \"allpages\" : \"none\";\n }\n\n function toSkipString() {\n var count = eq.skipCount;\n if (!count)\n return;\n return count.toString();\n }\n\n function toTopString() {\n var count = eq.takeCount;\n if (count === null)\n return;\n return count.toString();\n }\n\n function toFilterString() {\n var clause = eq.wherePredicate;\n if (!clause)\n return;\n clause.validate(entityType);\n return clause['toODataFragment'](entityType);\n }\n\n function toOrderByString() {\n var clause = eq['orderByClause'];\n if (!clause)\n return;\n return clause['toODataFragment'](entityType);\n }\n\n function toSelectString() {\n var clause = eq['selectClause'];\n if (!clause)\n return;\n clause.validate(entityType);\n return clause['toODataFragment'](entityType);\n }\n\n function toExpandString() {\n var clause = eq['expandClause'];\n if (!clause)\n return;\n return clause['toODataFragment'](entityType);\n }\n }", "title": "" }, { "docid": "137e8cdb8f877549277b0e1558ebcfc3", "score": "0.49511716", "text": "if (!maybeGroup.derivedFields.filterText) {\n return { focusType, objectPath: `${objectPath}.expanded`, newValue: false };\n }", "title": "" }, { "docid": "375e571221bac4d66ddeb76a0eaa63a0", "score": "0.49471655", "text": "function buildFindParameters(ctxt, env, app, scope, setting, query_builder) {\n\n if(query_builder == null) {\n query_builder = buildQueryWithDateRestriction;\n }\n\n var discriminator = buildDiscriminatorSettingsObject(env, app, scope, setting);\n var query = query_builder(ctxt, env, app, scope, setting);\n\n return {\n 'requested_environment' : env,\n 'query' : query,\n 'fields' : discriminator.fields,\n 'distinct' : discriminator.distinct };\n}", "title": "" }, { "docid": "4060b15cdb42ebcf3018dbce4c76e856", "score": "0.4939676", "text": "fullQuery(append) {\n let val = [];\n if (append) {\n val.push(this.pathVal + append);\n }\n else {\n val.push(this.pathVal);\n }\n if (this.proplistVal)\n val.push(this.proplistVal);\n val = val.concat(this.queryVal).slice();\n if (!/(print|getall)$/.test(val[0])) {\n for (let index = 0; index < val.length; index++) {\n val[index] = val[index].replace(/^\\?/, \"=\");\n }\n }\n return val;\n }", "title": "" }, { "docid": "960e0fdd2d41ccbe9a39073f77723617", "score": "0.49375817", "text": "function IQueryStructuralQuery() {}", "title": "" }, { "docid": "385d4b5f8f73ab62444b50e7bb3b7866", "score": "0.4916181", "text": "function validateQueries(queries, location=null) {\n // If there aren't any keys in the queries object then we don't have to do anything, \n // so check that here.\n //\n // If it does find keys, try to match the key names to one of the 3 appropriate filters\n // and if the key matches, save the key-value pair to the filters object.\n //\n // If the key does not match either of the 3 appropriate keys, it is an invalid key name\n // so we throw a BadRequestError.\n //\n // (Also makes sure the values passed into either min/max Employees is a number and not anything else.)\n const filters = {};\n \n if (Object.keys(queries).length > 0) {\n // First check to see if filter is coming from a request to /companies or /jobs\n if (location == \"companies\") {\n if (queries.name) {\n filters.name = queries.name;\n delete queries.name;\n }\n if (queries.minEmployees) {\n filters.minEmployees = parseInt(queries.minEmployees);\n if (!filters.minEmployees) {\n throw new BadRequestError(\"Min Employees query must be a number\")\n }\n delete queries.minEmployees;\n }\n if (queries.maxEmployees) {\n filters.maxEmployees = parseInt(queries.maxEmployees);\n if (!filters.maxEmployees) {\n throw new BadRequestError(\"Max Employees query must be a number\")\n }\n delete queries.maxEmployees;\n }\n // If there are queries remaining (therefore invalid queries)\n if (Object.keys(queries).length > 0) {\n throw new BadRequestError(\n `Invalid filter(s): ${Object.keys(queries)}`)\n }\n // The if logic for the request being to /jobs\n } else {\n if (queries.title) {\n filters.title = queries.title;\n delete queries.title;\n }\n if (queries.minSalary) {\n filters.minSalary = queries.minSalary;\n delete queries.minSalary;\n }\n if (Object.keys(queries).includes(\"hasEquity\")) {\n if (queries.hasEquity == \"true\") {\n filters.hasEquity = \"> 0\";\n } else {\n filters.hasEquity = \"= 0\";\n }\n delete queries.hasEquity;\n }\n\n }\n } else {\n // Branches to this if there are no keys at all.\n return false;\n }\n \n // If we have both a minEmployees key and maxEmployees key, we have to make sure\n // that minEmployees is not greater than maxEmployees\n if (filters.minEmployees && filters.maxEmployees && filters.minEmployees > filters.maxEmployees) {\n throw new BadRequestError(\"Minimum employees cannot exceed maximum employees\");\n }\n\n return filters;\n}", "title": "" }, { "docid": "e1599c5df112a0d4542ce06fecc6cb7e", "score": "0.49082786", "text": "function renderComparison(method,input,flags)\n {\n if(input === null || input=== undefined || input === '' ||method === undefined || method === null){\n $scope.compare = null;\n renderLangCompare();\n return;\n }\n $scope.compare = $scope.allowedStringComparisons[method].f.replace(/%input%/,input).replace(/%flags%/,flags);\n renderLangCompare();\n }", "title": "" }, { "docid": "f02d6374ad849abb539c3d233ec6defc", "score": "0.49059793", "text": "static checkUpdateData(update, type) {\n unsupportedUpdateOperator.forEach((v) => {\n if (Object.prototype.hasOwnProperty.call(update, v)) {\n throw new Error(`${v} is not a supported operator in mongo-mongo right now\n for this needs previous value for checking whether it can or cannot pass schema defination\n you can use updateOneNative with the risk of updated value breaking schema defination`);\n }\n });\n if (Object.keys(update).some(ele => deprecatedUpdateOperator.indexOf(ele) > -1)) {\n throw new Error('deprecated update operator $pushAll, use the $push operator with $each instead.');\n }\n if (Object.keys(update).some(ele => supportedUpdateOperator.indexOf(ele) > -1)) {\n const updateObj = {};\n const reg = /\\./;\n Object.keys(update).forEach((e) => {\n if (e === '$set') {\n if (Object.keys(update[e]).some(k => reg.test(k))) {\n throw new Error('mongo-mongo\\'s updateOne doesn\\'t support nested obj, consider updateOneNative please');\n }\n Object.keys(update[e]).forEach((k) => {\n if ((type === 'many') && this.prototype.__unique.indexOf(k) > -1) {\n throw new Error(`${k} is set to be unique in schema, you can't $set it in updateMany`);\n }\n updateObj[k] = update[e][k];\n });\n }\n if (e === '$unset') {\n if (Object.keys(update[e]).some(k => reg.test(k))) {\n throw new Error('mongo-mongo\\'s updateOne doesn\\'t support nested obj, consider updateOneNative please');\n }\n // check if $unset object's key is in __required array, if so throw error\n if (Object.keys(update[e]).some(k => this.prototype.__required.indexOf(k) > -1)) {\n throw new Error('some or one keys in $unset operator is set to be requred, you can\\'t remove them/it');\n }\n }\n // mongodb js doesn't support $setOnInsert operator on updateOne and updateMany\n // if (e === '$setOnInsert') {\n // if (Object.keys(update[e]).some(k => reg.test(k))) {\n // throw new Error('mongo-mongo\\'s updateOne doesn\\'t support nested obj, consider updateOneNative please');\n // }\n // Object.keys(update[e]).forEach((k) => {\n // if ((type === 'many') && this.prototype.__unique.indexOf(k) > -1) {\n // throw new Error(`${k} is set to be unique in schema, you can't $setOnInsert it in updateMany`);\n // }\n // updateObj[k] = update[e][k];\n // });\n // }\n if (e === '$currentDate') {\n if (Object.keys(update[e]).some(k => reg.test(k))) {\n throw new Error('mongo-mongo\\'s updateOne doesn\\'t support nested obj, consider updateOneNative please');\n }\n Object.keys(update[e]).forEach((k) => {\n if ((type === 'many') && this.prototype.__unique.indexOf(k) > -1) {\n throw new Error(`${k} is set to be unique in schema, you can't $currentDate it in updateMany`);\n }\n updateObj[k] = new Date();\n });\n }\n if (e === '$push') {\n if (Object.keys(update[e]).some(k => reg.test(k))) {\n throw new Error('mongo-mongo\\'s updateOne doesn\\'t support nested obj, consider updateOneNative please');\n }\n Object.keys(update[e]).forEach((k) => {\n if (Object.prototype.hasOwnProperty.call(update[e][k], '$each')) {\n updateObj[k] = update[e][k].$each;\n } else {\n updateObj[k] = [update[e][k]];\n }\n });\n }\n });\n this.checkData(updateObj);\n } else {\n this.checkData(update);\n }\n }", "title": "" }, { "docid": "288a06b833e0dfda26c7b96b3b3863f8", "score": "0.49039054", "text": "function displayOperatorType() {\n \n // At first, decide whether the field has any value map\n // if so, display drop down menu\n \n var previousValueInputIsAValueMap = currentValueInputIsAValueMap;\n \n if (FieldInput.options.length == 0)\n return;\n \n if (getQualifierValueArray(connectionOn,FieldInput.options(FieldInput.selectedIndex).value, \"Values\") != null) {\n \n ValueInputDiv.innerHTML = prepareDropDownMenuForValueMap();\n valueInput.selectedIndex = -1;\n currentValueInputIsAValueMap = true;\n } else {\n if(previousValueInputIsAValueMap == true)\n ValueInputDiv.innerHTML = nonValueMapValueInputStr;\n currentValueInputIsAValueMap = false; \n }\n \n var fieldType = FieldInput.options(FieldInput.selectedIndex).className;\n\n if ((previousFielDInputType == fieldType) && (previousValueInputIsAValueMap == currentValueInputIsAValueMap)) \n return false;\n \n if (previousFielDInputType == \"datetime\") \n dateValueFocussed();\n \n \n valueInput.title = \"\";\n \n for (i = OperatorType.options.length; i != -1; i--) {\n \n OperatorType.options.remove(OperatorType.options(i));\n }\n \n if (currentValueInputIsAValueMap == true){\n OperatorType.options.add(createOption(\"Equals\",L_Equals_TEXT)); \n OperatorType.options.add(createOption(\"NotEquals\",L_NotEquals_TEXT));\n } else if (fieldType == \"string\") {\n OperatorType.options.add(createOption(\"Equals\",L_Equals_TEXT)); \n OperatorType.options.add(createOption(\"NotEquals\",L_NotEquals_TEXT));\n OperatorType.options.add(createOption(\"Contains\",L_Contains_TEXT));\n OperatorType.options.add(createOption(\"NotContains\",L_NotContains_TEXT));\n OperatorType.options.add(createOption(\"StartsWith\",L_StartsWith_TEXT));\n } else if (fieldType == \"datetime\") {\n \n OperatorType.options.add(createOption(\"DatedAfter\",L_DatedAfter_TEXT));\n OperatorType.options.add(createOption(\"DatedBefore\",L_DatedBefore_TEXT));\n OperatorType.options.add(createOption(\"DatedOn\",L_DatedOn_TEXT));\n \n valueInput.title = L_ValueInputTitle_TEXT;\n \n setValueInputValue(L_DDMMYY_TEXT);\n valueInput.style.color='gray';\n valueInput.attachEvent('onfocus', dateValueFocussed);\n } else if (fieldType == \"integer\"){\n OperatorType.options.add(createOption(\"Equals\",L_Equals_TEXT)); \n OperatorType.options.add(createOption(\"NotEquals\",L_NotEquals_TEXT));\n OperatorType.options.add(createOption(\"GreaterThan\",L_GreaterThan_TEXT)); \n OperatorType.options.add(createOption(\"LessThan\",L_LesserThan_TEXT));\n } \n \n previousFielDInputType = fieldType;\n \n return true;\n \n}", "title": "" }, { "docid": "a887ba9ad62829f637e99f7e940c0ea2", "score": "0.49034485", "text": "function parseQuery(obj) {\n return function (r) {\n\n\n var reQuery;\n var theKeys = Object.keys(obj);\n for (var index = 0; index < theKeys.length; index++) {\n var subQuery;\n // The queryObject's key: 'name'\n var qField = theKeys[index];\n // The queryObject's value: 'Alice'\n var qValue = obj[qField];\n // If the qValue is an object, it will have special params in it.\n if (typeof qValue === \"object\") {\n switch (Object.keys(obj[qField])[0]) {\n /**\n * name: { $in: ['Alice', 'Bob'] }\n * becomes\n * r.expr(['Alice', 'Bob']).contains(doc['name'])\n */\n case \"$in\":\n subQuery = r._r.expr(qValue.$in).contains(r(qField));\n break;\n case \"$nin\":\n subQuery = r._r.expr(qValue.$nin).contains(r(qField)).not();\n break;\n case \"$lt\":\n subQuery = r(qField).lt(obj[qField].$lt);\n break;\n case \"$lte\":\n subQuery = r(qField).le(obj[qField].$lte);\n break;\n case \"$gt\":\n subQuery = r(qField).gt(obj[qField].$gt);\n break;\n case \"$gte\":\n subQuery = r(qField).ge(obj[qField].$gte);\n break;\n case \"$ne\":\n subQuery = r(qField).ne(obj[qField].$ne);\n break;\n case \"$eq\":\n subQuery = r(qField).eq(obj[qField].$eq);\n break;\n }\n } else {\n subQuery = r(qField).eq(qValue);\n }\n\n // At the end of the current set of attributes, determine placement.\n if (index === 0) {\n reQuery = subQuery;\n } else {\n reQuery = reQuery.and(subQuery);\n }\n }\n \n return reQuery || {};\n };\n}", "title": "" }, { "docid": "64c06b6db1495dd37e2faada964d23d6", "score": "0.49008697", "text": "function initQueryBuilder() {\n\n $(\"input[type='radio'], input[type='checkbox']\").ionCheckRadio();\n obj = {\n sort_mode: \"Default Sorting\",\n price_mode: \"\",\n color_mode: [],\n discount_mode: \"\",\n page: 1,\n category_id: $(\"#category_id\").val()\n }\n\n localStorage[\"query_builder\"] = JSON.stringify(obj);\n return obj\n }", "title": "" }, { "docid": "d7709c0a8facb90265efe81d78b51009", "score": "0.48983097", "text": "function _buildTableQuery(sort_struct, filter_struct, filter_date_struct, query, sort_by, exact_match_properties) {\n\n // apply sorts\n if(!_.isUndefined(sort_struct) && Object.keys(sort_struct).length > 0) {\n _.each(_.keys(sort_struct), function(key) {\n sort_by[key] = (sort_struct[key] == '0' ? 1 : -1);\n });\n }\n\n // apply filters\n var filters = filter_struct ? filter_struct : {};\n if(Object.keys(filters).length > 0) {\n _.each(_.keys(filters), function(key) {\n if(key != '__proto__') {\n var property_value = filters[key];\n\n if(_.isUndefined(exact_match_properties) || exact_match_properties.indexOf(key) == -1) {\n query[key] = {$regex : \".*\" + property_value + \".*\", $options: 'i'};\n } else {\n query[key] = property_value;\n }\n }\n });\n }\n\n // apply date-specific filters (TODO: still requires time property to be called \"timestamp\"\n var date_filters = filter_date_struct ? filter_date_struct : {};\n if(Object.keys(date_filters).length > 0) {\n _.each(_.keys(date_filters), function(key) {\n var property_value = date_filters[key];\n\n var query_component;\n if(key == 'from') {\n query_component = {$gte: new Date(property_value)};\n } else if(key == 'to') {\n query_component = {$lte: new Date(property_value)};\n }\n if(query['timestamp']) {\n query['timestamp'] = _.extend(query['timestamp'], query_component);\n } else {\n query['timestamp'] = query_component;\n }\n });\n }\n}", "title": "" }, { "docid": "f1c5ad4e3cdef308560aa3f55e194405", "score": "0.4897432", "text": "function createQueryRender() {\n\tquery1Div = document.getElementById( 'query1' );\n\tquery1Div.innerHTML = jsMultilineTextToHtmlText( _queryCSAllNamed );\n\n\tquery1Div = document.getElementById( 'query2' );\n\tquery1Div.innerHTML = jsMultilineTextToHtmlText( _queryCSUnnamed );\n\n\tquery1Div = document.getElementById( 'query3' );\n\tquery1Div.innerHTML = jsMultilineTextToHtmlText( _querySupported_SizeFilteredAndUnknownSize );\n}", "title": "" }, { "docid": "5f92139d40802fe7ebbb20c28ed556b0", "score": "0.48971075", "text": "function _collectQueryOptions(qform) {\n\n\tselectedCollections = _getCollection(qform);\n\t\n//\tvar colls = \"\";\n\n//\tfor (var m=0; m< selectedCollections.length; m++) {\n//\t\tcolls += selectedCollections[m] + \" \";\n//\t}\n\n\tlastQuery = _getQuery(qform);\n\tmaxHits = _getMaxHits(qform);\n\tresultLayout = _getResultLayout(qform);\n\thighlightOn = _getShowHighlighted(qform);\n\t\n}", "title": "" }, { "docid": "a9812ccd1d0cd3d73d390750c8786dd9", "score": "0.48857275", "text": "function checkSetQuery(e) {\n e.target.value == \"\" || e.target.value == null?\n setQuery(null): (setQuery(e.target.value), setCount(1))\n }", "title": "" }, { "docid": "1c117123850efc4eaf638af30b7ab661", "score": "0.48774713", "text": "function fieldDef(encQ, include, replacer) {\n if (include === void 0) { include = exports.INCLUDE_ALL; }\n if (replacer === void 0) { replacer = {}; }\n var fn = null, fnEnumIndex = null;\n /** Encoding properties e.g., Scale, Axis, Legend */\n var props = [];\n if (include[property_1.Property.AGGREGATE] && encQ.autoCount === false) {\n return '-';\n }\n else if (include[property_1.Property.AGGREGATE] && encQ.aggregate && !enumspec_1.isEnumSpec(encQ.aggregate)) {\n fn = replace(encQ.aggregate, replacer[property_1.Property.AGGREGATE]);\n }\n else if (include[property_1.Property.AGGREGATE] && encQ.autoCount && !enumspec_1.isEnumSpec(encQ.autoCount)) {\n fn = replace('count', replacer[property_1.Property.AGGREGATE]);\n ;\n }\n else if (include[property_1.Property.TIMEUNIT] && encQ.timeUnit && !enumspec_1.isEnumSpec(encQ.timeUnit)) {\n fn = replace(encQ.timeUnit, replacer[property_1.Property.TIMEUNIT]);\n }\n else if (include[property_1.Property.BIN] && encQ.bin && !enumspec_1.isEnumSpec(encQ.bin)) {\n fn = 'bin';\n // TODO(https://github.com/uwdata/compassql/issues/97):\n // extract this as a method that support other bin properties\n if (include[property_1.Property.BIN_MAXBINS] && encQ.bin['maxbins']) {\n props.push({\n key: 'maxbins',\n value: value(encQ.bin['maxbins'], replacer[property_1.Property.BIN_MAXBINS])\n });\n }\n }\n else {\n for (var _i = 0, _a = [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN]; _i < _a.length; _i++) {\n var prop = _a[_i];\n if (include[prop] && encQ[prop] && enumspec_1.isEnumSpec(encQ[prop])) {\n fn = enumspec_1.SHORT_ENUM_SPEC + '';\n // assign fnEnumIndex[prop] = array of enum values or just \"?\" if it is SHORT_ENUM_SPEC\n fnEnumIndex = fnEnumIndex || {};\n fnEnumIndex[prop] = encQ[prop].enum || encQ[prop];\n if (prop === property_1.Property.BIN) {\n // TODO(https://github.com/uwdata/compassql/issues/97):\n // extract this as a method that support other bin properties\n if (include[property_1.Property.BIN_MAXBINS] && encQ.bin['maxbins']) {\n props.push({\n key: 'maxbins',\n value: value(encQ.bin['maxbins'], replacer[property_1.Property.BIN_MAXBINS])\n });\n }\n }\n }\n }\n if (fnEnumIndex && encQ.hasFn) {\n fnEnumIndex.hasFn = true;\n }\n }\n var _loop_1 = function(nestedPropParent) {\n if (!enumspec_1.isEnumSpec(encQ.channel) && !exports.PROPERTY_SUPPORTED_CHANNELS[nestedPropParent][encQ.channel]) {\n return \"continue\";\n }\n if (include[nestedPropParent]) {\n if (encQ[nestedPropParent] && !enumspec_1.isEnumSpec(encQ[nestedPropParent])) {\n // `sort` can be a string (ascending/descending).\n if (util_1.isString(encQ[nestedPropParent])) {\n props.push({\n key: nestedPropParent + '',\n value: JSON.stringify(encQ[nestedPropParent])\n });\n }\n else {\n var nestedProps = property_1.getNestedEncodingPropertyChildren(nestedPropParent);\n var nestedPropChildren = nestedProps.reduce(function (p, nestedProp) {\n if (include[nestedProp.property] && encQ[nestedPropParent][nestedProp.child] !== undefined) {\n p[nestedProp.child] = replace(encQ[nestedPropParent][nestedProp.child], replacer[nestedProp.property]);\n }\n return p;\n }, {});\n if (util_2.keys(nestedPropChildren).length > 0) {\n props.push({\n key: nestedPropParent + '',\n value: JSON.stringify(nestedPropChildren)\n });\n }\n }\n }\n else if (encQ[nestedPropParent] === false || encQ[nestedPropParent] === null) {\n // `scale`, `axis`, `legend` can be false/null.\n props.push({\n key: nestedPropParent + '',\n value: false\n });\n }\n }\n };\n for (var _b = 0, _c = [property_1.Property.SCALE, property_1.Property.SORT, property_1.Property.AXIS, property_1.Property.LEGEND]; _b < _c.length; _b++) {\n var nestedPropParent = _c[_b];\n var state_1 = _loop_1(nestedPropParent);\n if (state_1 === \"continue\") continue;\n }\n // field\n var fieldAndParams = include[property_1.Property.FIELD] ? value(encQ.field || '*', replacer[property_1.Property.FIELD]) : '...';\n // type\n if (include[property_1.Property.TYPE]) {\n if (enumspec_1.isEnumSpec(encQ.type)) {\n fieldAndParams += ',' + value(encQ.type, replacer[property_1.Property.TYPE]);\n }\n else {\n var typeShort = ((encQ.type || type_1.Type.QUANTITATIVE) + '').substr(0, 1);\n fieldAndParams += ',' + value(typeShort, replacer[property_1.Property.TYPE]);\n }\n }\n // encoding properties\n fieldAndParams += props.map(function (p) { return ',' + p.key + '=' + p.value; }).join('');\n if (fn) {\n return fn + (fnEnumIndex ? JSON.stringify(fnEnumIndex) : '') + '(' + fieldAndParams + ')';\n }\n return fieldAndParams;\n}", "title": "" }, { "docid": "90dcc379f48820973f742135eced72ff", "score": "0.48773488", "text": "query()\n\t{\n\t\tvar _fields_as_array;\n\t var _query = {\n\t query: {}\n\t };\n\t //checks if we have a match_all query.\n\t if(this._$elasticObjects.match_all)\n\t {\n\t _query.query = {match_all: {}};\n\t }\n\t //checks if it is a match (any)\n\t if(this._$elasticObjects.match)\n\t {\n\t var _type_of_match = 'query_string';\n\t if(this._$elasticObjects.match.multi_match)\n\t {\n\t _type_of_match = 'multi_match';\n\t }\n\n\t _query.query[_type_of_match] = {\n query: this._$elasticObjects.match.query,\n default_operator: this._$elasticObjects.match.operator\n };\n\n //has any fields?\n if(this._$elasticObjects.match.fields)\n {\n _fields_as_array = this._$elasticObjects.match.fields;\n if(!Array.isArray(_fields_as_array))\n {\n _fields_as_array = [_fields_as_array];\n }\n _query.query[_type_of_match].fields = _fields_as_array;\n }\n\t }\n\n\t //checks if it is a match exact\n\t if(this._$elasticObjects.match_pharse)\n\t {\n\t _query.query.multi_match = {\n query: this._$elasticObjects.match_pharse.query,\n default_operator: 'AND'\n };\n\n //has any fields?\n if(this._$elasticObjects.match_pharse.fields)\n {\n _fields_as_array = this._$elasticObjects.match_pharse.fields;\n if(!Array.isArray(_fields_as_array))\n {\n _fields_as_array = [_fields_as_array];\n }\n _query.query.multi_match.fields = _fields_as_array;\n }\n\t }\n\n\t //checks if sort\n\t if(this._$elasticObjects.sort)\n\t {\n\t var _sort_array = this._$elasticObjects.sort;\n\t if(!Array.isArray(_sort_array))\n\t {\n\t _sort_array = [_sort_array];\n\t }\n\n\t _query.sort = _sort_array;\n\t }\n\n\t //checks if from\n\t if(this._$elasticObjects.from)\n\t {\n\t _query.from = this._$elasticObjects.from;\n\t }\n\n\t //checks if size\n\t if(this._$elasticObjects.size)\n\t {\n\t _query.size = this._$elasticObjects.size;\n\t }\n\n\t return _query;\n\t}", "title": "" }, { "docid": "c74cc5a1b31b7ae53790fa47f4a585b6", "score": "0.487506", "text": "formatRawQuery() {\n const query = this.buildBasicQuery()\n .addKeyValue(`${this._fileQueryKey}.output_category`, 'raw data');\n this._rawQueryString = query.format();\n }", "title": "" }, { "docid": "c658659ddb818127da92bdb2d7d528a5", "score": "0.48732886", "text": "function Operations() {\n this.ifNotExistsSet = {};\n this.SET = {};\n this.ADD = {};\n this.REMOVE = {};\n\n this.addIfNotExistsSet = function(name, item) {\n this.ifNotExistsSet[name] = item;\n };\n\n this.addSet = function(name, item) {\n if(schema.hashKey.name !== name && (schema.rangeKey || {}).name !== name) {\n this.SET[name] = item;\n }\n };\n\n this.addAdd = function(name, item) {\n if(schema.hashKey.name !== name && (schema.rangeKey || {}).name !== name) {\n this.ADD[name] = item;\n }\n };\n\n this.addRemove = function(name, item) {\n if(schema.hashKey.name !== name && (schema.rangeKey || {}).name !== name) {\n this.REMOVE[name] = item;\n }\n };\n\n this.getUpdateExpression = function(updateReq) {\n var attrCount = 0;\n var updateExpression = '';\n\n var attrName;\n var valName;\n var name;\n var item;\n\n var setExpressions = [];\n for (name in this.ifNotExistsSet) {\n item = this.ifNotExistsSet[name];\n\n attrName = '#_n' + attrCount;\n valName = ':_p' + attrCount;\n\n updateReq.ExpressionAttributeNames[attrName] = name;\n updateReq.ExpressionAttributeValues[valName] = item;\n\n setExpressions.push(attrName + ' = if_not_exists(' + attrName + ', ' + valName + ')');\n\n attrCount += 1;\n }\n\n for (name in this.SET) {\n item = this.SET[name];\n\n attrName = '#_n' + attrCount;\n valName = ':_p' + attrCount;\n\n updateReq.ExpressionAttributeNames[attrName] = name;\n updateReq.ExpressionAttributeValues[valName] = item;\n\n setExpressions.push(attrName + ' = ' + valName);\n\n attrCount += 1;\n }\n if (setExpressions.length > 0) {\n updateExpression += 'SET ' + setExpressions.join(',') + ' ';\n }\n\n var addExpressions = [];\n for (name in this.ADD) {\n item = this.ADD[name];\n\n attrName = '#_n' + attrCount;\n valName = ':_p' + attrCount;\n\n updateReq.ExpressionAttributeNames[attrName] = name;\n updateReq.ExpressionAttributeValues[valName] = item;\n\n addExpressions.push(attrName + ' ' + valName);\n\n attrCount += 1;\n }\n if (addExpressions.length > 0) {\n updateExpression += 'ADD ' + addExpressions.join(',') + ' ';\n }\n\n var removeExpressions = [];\n for (name in this.REMOVE) {\n item = this.REMOVE[name];\n\n attrName = '#_n' + attrCount;\n\n updateReq.ExpressionAttributeNames[attrName] = name;\n\n removeExpressions.push(attrName);\n\n attrCount += 1;\n }\n if (removeExpressions.length > 0) {\n updateExpression += 'REMOVE ' + removeExpressions.join(',');\n }\n\n updateReq.UpdateExpression = updateExpression;\n };\n }", "title": "" }, { "docid": "c818ad60f838ce4f0ce73ce743c2b59e", "score": "0.48635417", "text": "function buildQuery(obj) {\n var qString = '';\n for (key in obj) {\n if ( key != 'county' ) {\n if ( qString == '' || key == 'age' ) {\n qString += obj[key]; }\n else if (key.substr(0,4) != ' AND' ) {\n \tqString += ' ' + obj[key];\n }\n else {\n qString += ' AND ' + obj[key];\n }\n }\n }\n return qString;\n }", "title": "" }, { "docid": "63ab3670973b5d58d9d6ff68273f6bb5", "score": "0.48617554", "text": "buildStr (queryBuilder) {\n return '';\n }", "title": "" }, { "docid": "da23e63572c974b420d30cc9186db093", "score": "0.4861269", "text": "clone(options) {\n const qb = new QueryBuilder(this.connection, options ? options.queryRunner : undefined);\n if (options && options.ignoreParentTablesJoins)\n qb.ignoreParentTablesJoins = options.ignoreParentTablesJoins;\n switch (this.type) {\n case \"select\":\n qb.select(this.selects);\n break;\n case \"update\":\n qb.update(this.updateQuerySet);\n break;\n case \"delete\":\n qb.delete();\n break;\n }\n if (this.fromEntity && this.fromEntity.alias && this.fromEntity.alias.target) {\n qb.from(this.fromEntity.alias.target, this.fromEntity.alias.name);\n }\n else if (this.fromTableName) {\n qb.from(this.fromTableName, this.fromTableAlias);\n }\n this.joins.forEach(join => {\n const property = join.tableName || join.alias.target || (join.alias.parentAliasName + \".\" + join.alias.parentPropertyName);\n qb.join(join.type, property, join.alias.name, join.conditionType, join.condition || \"\", undefined, join.mapToProperty, join.isMappingMany);\n });\n this.groupBys.forEach(groupBy => qb.addGroupBy(groupBy));\n this.wheres.forEach(where => {\n switch (where.type) {\n case \"simple\":\n qb.where(where.condition);\n break;\n case \"and\":\n qb.andWhere(where.condition);\n break;\n case \"or\":\n qb.orWhere(where.condition);\n break;\n }\n });\n this.havings.forEach(having => {\n switch (having.type) {\n case \"simple\":\n qb.having(having.condition);\n break;\n case \"and\":\n qb.andHaving(having.condition);\n break;\n case \"or\":\n qb.orHaving(having.condition);\n break;\n }\n });\n if (!options || !options.skipOrderBys)\n Object.keys(this.orderBys).forEach(columnName => qb.addOrderBy(columnName, this.orderBys[columnName]));\n Object.keys(this.parameters).forEach(key => qb.setParameter(key, this.parameters[key]));\n if (!options || !options.skipLimit)\n qb.setLimit(this.limit);\n if (!options || !options.skipOffset)\n qb.setOffset(this.offset);\n qb.setFirstResult(this.firstResult)\n .setMaxResults(this.maxResults);\n return qb;\n }", "title": "" }, { "docid": "91ac95c7a64290016c5c24b9d81eb4ce", "score": "0.4861235", "text": "function normFilter(model, filter, fieldName) {\n if (!filter) return null;\n\n let result = {},\n fields = model.def.fields;\n for (const key in filter) {\n if (key === '$and' || key === '$or') { // {$and:[]}, {$or: []}\n const subfilters = [];\n for (const j in filter[key]) {\n const sub = normFilter(model, filter[key][j]);\n if (!sub) continue;\n subfilters.push(sub);\n }\n if (subfilters.length > 0) result[key] = subfilters;\n continue;\n }\n if (key.charAt(0) === '$') { // key is an operator, {op: value}\n if (!fieldName) {\n throw new QueryError(model.name, 'no field for operator %s in filter', key);\n }\n if (!fields[fieldName]) {\n throw new QueryError(model.name, 'nonexistent field %s in filter', fieldName);\n }\n result[key] = fields[fieldName].normalize(filter[key], { query: true });\n continue;\n }\n\n // key is a field, {field: value}, {field: {op: value, ...}}\n fieldName = key;\n const field = fields[key];\n if (!field) throw new QueryError(model.name, 'nonexistent field %s in filter', key);\n if (field.props.filterRedirect) {\n const proxyFields = field.props.filterRedirect.replace(/\\s+/g, '').split(',');\n const proxyFilter = { $or: [] };\n for (const pi in proxyFields) {\n const proxyFieldName = proxyFields[pi];\n const fieldProxyFilter = {};\n fieldProxyFilter[proxyFieldName] = filter[key];\n proxyFilter.$or.push(fieldProxyFilter);\n }\n Object.assign(result, normFilter(model, proxyFilter));\n continue;\n }\n\n // {field: {op: value, ...}}\n if (util.isPlainObject(filter[key])) {\n result[fieldName] = normFilter(model, filter[key], fieldName);\n continue;\n }\n\n // {field: value}, value is not string\n let value = filter[key];\n if (typeof value !== 'string') { // array, date, int, float, bool, etc\n result[fieldName] = field.normalize(value, { query: true });\n continue;\n }\n\n // {field: value}, value is a plain string\n value = value.trim();\n if (!(value.substring(0, 1) === '{' && value.substr(-1) === '}')) {\n result[fieldName] = field.normalize(value, { query: true });\n continue;\n }\n\n // {field: value}, value is string and may contain a json object which is a query filter too\n const jsonExpr = null;\n try {\n eval('jsonExpr = '+value);//eslint-disable-line\r\n } catch (e) {}// eslint-disable-line no-empty\n if (!jsonExpr) { // parse fails, treat as plain string\n result[fieldName] = field.normalize(value, { query: true });\n } else {\n const jsonFilter = {};\n for (const jk in jsonExpr) {\n if (jk.charAt(0) === '$') { // expand {op:val} to {field:{op: val}}\n jsonFilter[fieldName] = {};\n jsonFilter[fieldName][jk] = jsonExpr[jk];\n } else { // {field: value}\n jsonFilter[jk] = jsonExpr[jk];\n }\n }\n result = Object.assign(result, normFilter(model, jsonFilter, fieldName));\n }\n }\n\n if (util.isEmptyObject(result)) return null;\n return result;\n}", "title": "" }, { "docid": "7afc1e6d4df5f841c82a2e37947c5fb3", "score": "0.48543885", "text": "static addCriterion(query, field, values) {\n const lhsExpression = {\n type: 'field',\n id: field.id,\n schemaId: _.get(query, 'payload.source.schemaId'),\n mappingPath: _.get(query, 'payload.source.id'),\n mappingId: _.get(query, 'payload.source.mappingId'),\n fieldId: field.fieldId,\n linkRef: '',\n dataType: field.dataType,\n rawType: field.rawType,\n data: field.data\n };\n const divisionLeaf = {\n type: 'leaf',\n expression: {\n comparisonPredicate: {\n lhsExpression: lhsExpression,\n operator: {\n id: 'EXACTLY_MATCHES',\n comparison: '='\n },\n rhsExpression: {\n dataType: 'keyword_text',\n rawType: 'CHAR',\n type: 'valueList',\n value: values\n },\n limiter: 'any',\n ignoreCase: false\n }\n }\n };\n const notEmptyLeaf = {\n type: 'leaf',\n expression: {\n emptyPredicate: {\n lhsExpression: lhsExpression,\n limiter: 'any',\n operator: {\n id: 'IS_NOT_EMPTY',\n comparison: '=',\n negated: true\n }\n }\n }\n };\n\n const newConjunction = {\n type: 'group',\n junction: 'and',\n children: [divisionLeaf, notEmptyLeaf]\n };\n const existingCriteria = _.get(query, ['payload', 'criteria'], null);\n _.set(query, ['payload', 'criteria'], newConjunction);\n if (existingCriteria) {\n query.payload.criteria.children.push(existingCriteria);\n }\n log.debug('Query payload: %s', JSON.stringify(query.payload));\n }", "title": "" }, { "docid": "6441915a548343e306c6ce0081700c05", "score": "0.48500615", "text": "assemble() {\n const filters = keys(this.filter).reduce((vegaFilters, field) => {\n const fieldDef = this.filter[field];\n const ref = vgField(fieldDef, {\n expr: 'datum'\n });\n if (fieldDef !== null) {\n if (fieldDef.type === 'temporal') {\n vegaFilters.push(`(isDate(${ref}) || (isValid(${ref}) && isFinite(+${ref})))`);\n } else if (fieldDef.type === 'quantitative') {\n vegaFilters.push(`isValid(${ref})`);\n vegaFilters.push(`isFinite(+${ref})`);\n }\n }\n return vegaFilters;\n }, []);\n return filters.length > 0 ? {\n type: 'filter',\n expr: filters.join(' && ')\n } : null;\n }", "title": "" }, { "docid": "cbe7fe17841558b5ef309e997132f62d", "score": "0.48436463", "text": "function areAllFieldsFull()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tvar wfc = document.getElementsByClassName('wFilter')\r\n\t\t\tfor (var i = 0; i < wfc.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif ((wfc[i].value.length == 0) && (wfc[i].offsetWidth > 0))\r\n\t\t\t\t{\r\n\t\t\t\t\tsomethingMissing = true;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\tvar nqc = document.getElementsByClassName('noQuotes')\r\n\t\t\tfor (var i = 0; i < nqc.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif ((nqc[i].value.length == 0) && (nqc[i].offsetWidth > 0))\r\n\t\t\t\t{\r\n\t\t\t\t\tsomethingMissing = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar jnc = document.getElementsByClassName('justNums')\r\n\t\t\tfor (var i = 0; i < jnc.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif ((jnc[i].value.length == 0) && (jnc[i].offsetWidth > 0))\r\n\t\t\t\t{\r\n\t\t\t\t\tsomethingMissing = true;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tvar rc = document.getElementsByClassName('required')\r\n\t\t\tfor (var i = 0; i < rc.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif ((rc[i].value.length == 0) && (rc[i].offsetWidth > 0))\r\n\t\t\t\t{\r\n\t\t\t\t\tsomethingMissing = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (somethingMissing == true)\r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById('setVals').disabled = true;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById('setVals').disabled = false;\r\n\t\t\t}\t\t\r\n\t\t\tsomethingMissing = false;\t\t\t\r\n\t\t}", "title": "" }, { "docid": "26a2acb22215bf2209ed1f71a5315f8b", "score": "0.48429707", "text": "function onlyFormToString(query) {\n const applyMap = pathOr({}, ['apply', 'only'], query);\n\n return compose(\n cond([[isEmpty, returnValue('')], [always(true), onlyForm => `\\nonly ${onlyForm}`]]),\n join(', '),\n map(formatOnlyFilters(applyMap)),\n propOr([], 'only')\n )(query);\n}", "title": "" }, { "docid": "49d287c31b932e19731dd5dd497a62af", "score": "0.48411345", "text": "querify(fields, action) {\n\n\t\tvar obj = this,\n\t\t\tret = [],\n\t\t\t_ = require('underscore'),\n\t\t\taction = (action != undefined) ? action : false;\n\n\t\tif (action == 'bind') {\n\n\t\t\t_.each(fields, function(field) {\n\t\t\t\tret.push(Crood.parseQuery(\"%s\", obj[field]));\n\t\t\t});\n\n\t\t} else if (action == 'param') {\n\n\t\t\t_.each(fields, function(field) {\n\n\t\t\t\tif (field == 'modified') {\n\t\t\t\t\tret.push(Crood.parse(\"%s = NOW()\", field));\n\t\t\t\t} else {\n\n\t\t\t\t\tret.push(\n\t\t\t\t\t\tCrood.parse(\"%s = \", field) + Crood.parseQuery(\"%s\", obj[field])\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t} else {\n\t\t\tret = fields;\n\t\t}\n\n\t\treturn ret.join(', ');\n\t}", "title": "" }, { "docid": "53731ee1630215c53e9c0167114a8c92", "score": "0.4838835", "text": "function objToQuery(vals, delimit, first) {\n\tvar query = '';\n\tvar delimeter = ' AND ' ;\n\n\tif(delimit != null) {\n\t\tdelimeter = ' '+delimit.toUpperCase()+' ';\n\t}\n\n\ti=0;\n\n\tfor (var key in vals) {\n\t\tkey = key.toLowerCase();\n\n\t\tlet keyLength = Object.keys(vals).length;\n\n\t\tif(keyLength > 1 && i==0 && !first) {\n\t\t\tquery += '(';\n\t\t}\n\n\t\tif (key == 'and') {\n\t\t\tif(query != '') {\n\t\t\t\tquery += ' AND ';\n\t\t\t}\n\n\t\t\tquery += objToQuery(vals[key], 'and');\n\t\t} else if(key == 'or') {\n\t\t\tif(query != '') {\n\t\t\t\tquery += ' OR ';\n\t\t\t}\n\t\t\tquery += objToQuery(vals[key], 'or');\n\t\t} else if(key == 'like') {\n\t\t\tvar likei = 0;\n\n\t\t\tif(query != '') {\n\t\t\t\tquery += delimeter;\n\t\t\t}\n\n\t\t\tfor (var likeKey in vals[key]) {\n\t\t\t\tlikei++;\n\n\t\t\t\tquery += (likeKey+' LIKE \"'+vals[key][likeKey]+'\"')\n\n\t\t\t\tif(likei < keyLength - 1) {\n\t\t\t\t\tquery += delimeter;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (i > 0 && i <= keyLength) {\n\t\t\t\tquery += delimeter\n\t\t\t}\n\n\t\t\tquery += (key+'='+'\"'+vals[key]+'\"');\n\t\t}\n\t\t\n\t\t// close query\n\t\tif(i == (keyLength - 1)) {\n\t\t\t//if(keyLength >= 1) {\n\t\t\t\tquery += ')';\n\t\t\t\tbreak;\n\t\t\t//cle}\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn query;\n}", "title": "" }, { "docid": "e71b9bcec9079760b61cd3d7a5715eb6", "score": "0.48385683", "text": "formatRawQuery() {\n const query = new QueryString();\n query\n .addKeyValue('type', this._datasetType)\n .addKeyValue('cart', this._cartPath)\n .addKeyValue('files.output_category', 'raw data');\n this._rawQueryString = query.format();\n }", "title": "" }, { "docid": "1c7f797f193503463f50c519f8277506", "score": "0.48265907", "text": "_queryObjectToSql(columnName, queryObj) {\n\n let sql = '';\n let i = 0;\n _.each(queryObj, (value, operator) => {\n if (i++ > 0) {\n sql += ' AND ';\n }\n const cleanQueryOperator = this._cleanQueryOperator(operator, value);\n const cleanedValue = this._cleanValueForOperator(operator, value);\n sql += `\\`${columnName}\\` ${cleanQueryOperator} ${cleanedValue}`;\n });\n\n return sql;\n }", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.48194325", "text": "function LQuery(){}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.48194325", "text": "function LQuery(){}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.48194325", "text": "function LQuery(){}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.48194325", "text": "function LQuery(){}", "title": "" }, { "docid": "891fd053e6e032284f861dccf9ef3077", "score": "0.48173913", "text": "_formatValueAsParam (value) {\n if (_isArray(value)) {\n return value.map((v) => {\n return this._formatValueAsParam(v)\n });\n } else {\n if (value instanceof cls.QueryBuilder && value.isNestable()) {\n value.updateOptions({ \n \"nestedBuilder\": true \n });\n\n return value.toParam();\n }\n else if (value instanceof cls.Expression) {\n return value.toParam();\n }\n else {\n return this._formatCustomValue(value, true);\n }\n }\n }", "title": "" }, { "docid": "4aec31bf0d515ff587af868837e18efe", "score": "0.48122144", "text": "renderTemplate() {\n return `\"query\" : {\n \"expression\" : \"${this.cond.renderCondition()}\",\n \"expressionNames\" : {\n ${this.cond.renderExpressionNames()}\n },\n \"expressionValues\" : {\n ${this.cond.renderExpressionValues()}\n }\n }`;\n }", "title": "" }, { "docid": "3d28df51ee64ef715b70b84fa1be5270", "score": "0.480992", "text": "function buildQuery() {\n var output = '';\n var qbSelectGroups = document.querySelectorAll('.query-builder--selector-group');\n // If we have multiple groups, start parens\n if (qbSelectGroups.length > 1) {\n output += '(';\n }\n for (i = 0; i < qbSelectGroups.length; ++i) {\n // If we have more than one group, \n // Add parens and boolean.\n if (i > 0) {\n var thisGroupBoolean = qbSelectGroups[i].querySelector('[name=\"selector-group-boolean-select\"]').value;\n output += ') ' + thisGroupBoolean + ' (';\n }\n // now find all the selectors within this selector groups\n var selectors = qbSelectGroups[i].querySelectorAll('.selector');\n for (j = 0; j < selectors.length; ++j) {\n // first get the term value\n var termInput = selectors[j].querySelector('input');\n\n if (termInput.value.length > 0) {\n if (j > 0) {\n var booleanSelect = selectors[j].querySelector('.boolean-select');\n output += \" \" + booleanSelect.value + \" \";\n }\n output += termInput.value;\n // Only append field in brackets if one was selected\n var selectedField = selectors[j].querySelector('.search-opts').value;\n if (selectedField) {\n output += '[' + selectedField + ']';\n }\n }\n }\n }\n // If needed, close parens\n if (qbSelectGroups.length > 1) {\n output += \")\";\n }\n searchInput.value = output;\n ToggleSearchButtonState();\n }", "title": "" }, { "docid": "460f4990b94aee7cd4b4bf9aee90d15c", "score": "0.48081595", "text": "__handleWhere(field, operator, value) {\r\n if (value === undefined) {\r\n value = operator;\r\n operator = \"=\";\r\n }\r\n this.__where += this.backquote(field) + \" \" + operator + \" ?\";\r\n this.__bindings.push(value);\r\n return this;\r\n }", "title": "" }, { "docid": "73d82258bbd2bc83b141a0cc1a3bc132", "score": "0.48039478", "text": "function formatQuery (generator, root) {\n return generator.stringify(root)\n}", "title": "" }, { "docid": "8591d23dcd15732f1c0788faee9d868b", "score": "0.4788549", "text": "function onClickEventBehaviorOfGenerateQueryButton(event)\n {\n // Stop it from redirecting anywhere\n event.preventDefault();\n\n // This will contain the finished query expression that we will send to the server.\n let queryExpression = \"?\";\n\n\n // Define a function that will check if every element in an array is blank.\n // This will be used to determine if the user filled out the form.\n function allBlanks(arrayOfValues) \n {\n function isBlank(thisValue) \n {\n // The following will examine one of the elements of the array \n // and return true if blank - otherwise it will return false.\n return thisValue == \"\";\n } \n\n // .every is an array method that will call the function isBlank \n // once for every element in the array selectorElementValues.\n // it will return true if every element is blank.\n return arrayOfValues.every(isBlank);\n } // End of: function allBlanks(arrayOfValues){...} \n // End of: Define a function that will check if every element in an array is blank.\n\n\n // Start of: Begin building a query expression by examining the filter control elements.\n // Only the where and order by clauses matter for the fetch from the server.\n // The select clause controls and records-per-page control can be \n // examined and used after the records have been returned by the fetch.\n\n // 1. Make an array from the where clause elements.\n // Create an empty array to hold the values contained in the where clause select elements.\n\n // Create a handle to address the group wrapper. \n // We can use this to keep the search for control elements limited to the where clause controls.\n let whereClauseGroupWrapper = document.querySelectorAll(\".whereClauseGroupWrapper\")[0];\n\n // Create an empty array to hold the values of the where clause controls elements.\n let whereClauseElementValues = [];\n\n // Store the values of each select element in the new array.\n // .resetElement is just a class that all the elements of interest have in common.\n whereClauseGroupWrapper.querySelectorAll(\".resetElement\").forEach(function(element) \n {\n // Push the values onto the array.\n whereClauseElementValues.push(element.value);\n\n }); \n\n // 2. Ensure all but the last element contains a value or that none of the \n // elements contain values and then generate the query expression.\n // In other words: \n // Make sure the user filled out the filter form(s) completely or not at all.\n // If the filter form(s) is/are completely filled out the create the query expression.\n\n // Find out which element in the array is the first element to contain a blank value.\n // If it's the last one then we know the form has been filled out completely.\n let indexOfFirstWhereClauseBlankSelector = whereClauseElementValues.indexOf(\"\")\n\n // Find out if all the values in the array selectorElementValues are blank.\n // If they are then we know that the form was not filled out at all in \n // which case we should ignore the form.\n\n // If not all the elements are blank then then user has made a filter expression.\n let userHasMadeAFilterExpression = !allBlanks(whereClauseElementValues);\n\n if(userHasMadeAFilterExpression)\n {\n // If the first blank is the very last element in the array then\n // we know that the form has been filled out compelely.\n if(indexOfFirstWhereClauseBlankSelector == whereClauseElementValues.length -1) \n {\n\n queryExpression = queryExpression + \"WHERE\" + \":;\"\n\n // The form has been filled out completely so populate the query expression with data from the controls.\n whereClauseElementValues.forEach(function(element){\n if(element != \"\")\n {\n queryExpression = queryExpression + element + \":;\"\n } \n });\n }\n else // The user did not fill out the form competely so bail out of the process.\n {\n alert('The filter expression must be filled out completely or must be completely blank' + '\\n' + 'Please check your work.')\n return // Stop the process.\n }\n\n } // End of: if(userHasMadeAFilterExpression){...}\n // End of: Begin build a query expression by examining the filter control elements.\n\n\n // Start of: Add any orderby clauses to the query expression.\n // 1. Make an array from the orderby clause elements.\n // Create an empty array to hold the values contained in the orderby clause select elements.\n\n // Create a handle to address the group wrapper. \n // We can use this to keep the search for control elements limited to the orderby clause controls.\n let orderByClauseGroupWrapper = document.querySelectorAll(\".orderByClauseGroupWrapper\")[0];\n\n // Create an empty array to hold the values of the orderby clause controls elements.\n let orderByClauseElementValues = [];\n\n // Store the values of each select element in the new array.\n // .resetElement is just a class that all the elements of interest have in common.\n orderByClauseGroupWrapper.querySelectorAll(\".resetElement\").forEach(function(element) \n {\n // Push the values onto the array.\n orderByClauseElementValues.push(element.value);\n\n }); \n\n // 2. Ensure all but the last element contains a value or that none of the \n // elements contain values and then add to the query expression.\n // In other words: \n // Make sure the user filled out the orderby form(s) completely or not at all.\n // If the orderby form(s) is/are completely filled out then add to the query expression.\n\n // Find out which element in the array is the first element to contain a blank value.\n // If it's the last one then we know the form has been filled out completely.\n let indexOfFirstOrderByClauseBlankSelector = orderByClauseElementValues.indexOf(\"\")\n\n // Find out if all the values in the array selectorElementValues are blank.\n // If they are then we know that the form was not filled out at all in \n // which case we should ignore the form.\n\n // If not all the elements are blank then then user has made an orderby expression.\n let userHasMadeAnOrderByExpression = !allBlanks(orderByClauseElementValues);\n\n if(userHasMadeAnOrderByExpression)\n {\n // If the first blank is the very last element in the array then\n // we know that the form has been filled out compelely.\n if(indexOfFirstOrderByClauseBlankSelector == orderByClauseElementValues.length -1) \n {\n\n queryExpression = queryExpression + \"ORDERBY\" + \":;\"\n\n // The form has been filled out completely so populate the query expression with data from the controls.\n orderByClauseElementValues.forEach(function(element){\n if(element != \"\")\n {\n queryExpression = queryExpression + element + \":;\"\n } \n });\n\n }\n else // The user did not fill out the form competely so bail out of the process.\n {\n alert('The order-by expression must be filled out completely or must be completely blank' + '\\n' + 'Please check your work.')\n return // Stop the process.\n }\n\n } // End of: if(userHasMadeAFilterExpression){...}\n // End of: Add any orderby clauses to the query expression.\n\n // Start of: Replace troublesome symbols in the query expression\n\n // DON'T USE THE FOLLOWING SYMBOLS OR THE %ESCAPES IN THE QUERY EXPRESSION\n // CODE BELOW SWAPS THESE FOR SOMETHING COMPLETELY DIFFERENT.\n // PoundStops the Process-%23\n // Ampersand breaks the expression into two parts-%26\n // Equal stops the process-%3D\n\n // THE FOLLOWING SYMBOLS PRODUCE UNEXPECTED BEHAVIOR:\n // cODE BELOW SWAPS THESE FOR SOMETHING COMPLETELY DIFFERENT. \n // Backslash is escaped with another backslash no matter what-%5C\n // Single Quote inserts Esc automatically and inserts a back slash in the result-%27\n // Plus shows as a space-%2B \n \n // THE FOLLOWING SYMBOLS PRODUCE UNEXPECTED BUT HARMLESS BEHAVIOR:\n // IT'S OK TO LEAVE THESE AS IS. WE WON'T NOTICE THEM IN THE FINAL RESULT.\n // Space inserts the Esc automatically-%20\n // DoubleQInsertsEscAutomatically-%22 \n // LessThanInsertsEscAutomatically-%3C\n // GreaterThanInsertsEscAutomatically-%3E \n\n // THE FOLLOWING SYMBOLS BEHAVE AS EXPECTED: \n // Accent-`\n // Exclaimation-!\n // AtSign-@\n // Dollar-$\n // Percent-%\n // Carrot-^\n // Asterisk-*\n // OpenParen-(\n // CloseParen-)\n // LowDash-_\n // OpenBrace-{\n // CloseBrace-}\n // OpenBracket-[\n // CloseBracket-]\n // Pipe-|\n // Colon-:\n // Semi-;\n // Coma-,\n // Period-.\n // Question-?-\n // ForwardSlash-/-:;\n\n // We are pulling out these troublesome symbols from the queryExpression and replacing \n // them with something different before sending them to the server.\n // We will reverse the process at the server.\n queryExpression = queryExpression.replace(/#/g, \"{[POUND]}\");\n queryExpression = queryExpression.replace(/&/g, \"{[AMPERSAND]}\");\n queryExpression = queryExpression.replace(/=/g, \"{[EQUALS]}\");\n // Escaping the following with a backslash now stops the system from inserting an extra backslash in the result.\n queryExpression = queryExpression.replace(/\\\\/g, \"{[BACK-SLASH]}\"); \n queryExpression = queryExpression.replace(/\\'/g, \"{[SINGLE-QUOTE]}\");\n queryExpression = queryExpression.replace(/\\+/g, \"{[PLUS]}\");\n\n // End of: Replace troublesome symbols in the query expression\n\n document.querySelector(\".queryExpressionTextArea\").value = queryExpression;\n\n // Send the query off with the fetch function below. \n // Commented out because this now has it's own button to run the query.\n // runQuery(queryExpression);\n\n } // End of: function onClickEventBehaviorOfGenerateQueryButton(event)", "title": "" } ]
b89fef2693790b205a90bd631841c869
flow is ready lifecycle method
[ { "docid": "e39b228c9a66d3c7e5547326c8b6c632", "score": "0.58628935", "text": "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires()\n }", "title": "" } ]
[ { "docid": "0b9b64afbc55efee8163443235f43d22", "score": "0.69801646", "text": "whenReady() {\n //\n }", "title": "" }, { "docid": "a8c96fa4aaf9c6589ea8112b3916089a", "score": "0.69204617", "text": "ready() {\n this.performAction('ready');\n }", "title": "" }, { "docid": "7daa5ce03a0c14eaf4a7e0b9ee08368f", "score": "0.6744003", "text": "ready() {\n this._ensureAttributes();\n this._applyListeners();\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.6690688", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.6690688", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "adbe1055e01b57bdc5930411c507a5c3", "score": "0.6684581", "text": "ready(cb, context) {\n this.instance.ready(cb, context);\n }", "title": "" }, { "docid": "a98092c708a6378891822abfd91c68f8", "score": "0.66337043", "text": "ready() {\n\t\t\tthis.refresh = this.refresh.bind(this);\n\t\t\tthis._handleTransitionMsg = this._handleTransitionMsg.bind(this);\n\t\t\tthis._handlePreviewOrProgramReplicantChange = this._handlePreviewOrProgramReplicantChange.bind(this);\n\n\t\t\t// It's important that this come _after_ the bindings above.\n\t\t\tsuper.ready();\n\t\t}", "title": "" }, { "docid": "9c94ad0d8a08ce53777b482b11e2bffc", "score": "0.6633413", "text": "ready() {\n this._ready = true;\n this._private._resolveReady(true);\n }", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6559827", "text": "ready() {}", "title": "" }, { "docid": "220fac101591cf814345cd4a1f53212e", "score": "0.6542812", "text": "ready() {\n this.emit(\"ready\");\n }", "title": "" }, { "docid": "a0d9b3dbdb6e46ba8a164fc9e9c03b65", "score": "0.6532452", "text": "function ready(){this._isAttached=true;this._isReady=true;this._callHook('ready');}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.65235776", "text": "ready() { }", "title": "" }, { "docid": "8a7c1cfe8aa77277e4ff18aaabf7f76f", "score": "0.6522327", "text": "function ready(){this._isAttached=true;this._isReady=true;this._callHook('ready')}", "title": "" }, { "docid": "29cc41e0bb2cb459855db7f80b2c2244", "score": "0.6515494", "text": "onCreated(){\n if(this.config[\"slots\"][this.slotId].enabled) {\n\n this.resolve(\"ready\");\n }\n }", "title": "" }, { "docid": "c8b5af813c9f9b1efbc00afdac1452ec", "score": "0.6495041", "text": "ready(cb, context) {\n const page = this.get('page');\n\n if (page && this.get('rendered')) {\n cb.call(context, page);\n } else {\n this.once('change:rendered', () => cb.call(context, this.get('page')));\n }\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6494145", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6494145", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6494145", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6494145", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "85e158774b4dd1c374a6328277b86b6c", "score": "0.648737", "text": "ready() {\n super.ready();\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "cf7749bcbf95815dd4a0e53db632aece", "score": "0.6454795", "text": "onReady() {\n this.emit('ready');\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.645209", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.645209", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.645209", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.645209", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "dc2257618a4f259c8b7ff22c0f3e1a88", "score": "0.64389735", "text": "onReady() {\n this.emit(events.ready)\n }", "title": "" }, { "docid": "b1d566cbaf7d30d4bbc631191002f9da", "score": "0.63896114", "text": "ready() {\n setReadied(this, true);\n this.act();\n }", "title": "" }, { "docid": "bac794b0a80cedc6016b1e9d02ca4e91", "score": "0.63427", "text": "onLoaded(){\r\n\r\n }", "title": "" }, { "docid": "e20f9243beb898d02315c3954421ae81", "score": "0.6303453", "text": "getHiringFlow(){}", "title": "" }, { "docid": "43095d6b8cc48fb6de9396dd3858450a", "score": "0.6295685", "text": "static onInitCompleted() {\n src_1.MfgDebug.init.log(\"> onInitCompleted\");\n src_4.MfgScene.scene.executeWhenReady(src_4.MfgScene.initSceneCompleted);\n }", "title": "" }, { "docid": "9d36e04fd5709968aadc7323fab683b8", "score": "0.6264698", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "6e9824431af4e91a575d497314178c3a", "score": "0.62635833", "text": "constructor() {\n super();\n this.ready = false;\n }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.6242279", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "cac83b286f4b10276847b38e4e1b252a", "score": "0.62347627", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "cac83b286f4b10276847b38e4e1b252a", "score": "0.62347627", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "54e03d6b5a8ab27ac7b5b9258668b5ac", "score": "0.6224492", "text": "function ready () {\n this._isAttached = true\n this._isReady = true\n this._callHook('ready')\n}", "title": "" }, { "docid": "652f8900dea158ee26e73a9a5eb9be99", "score": "0.62038004", "text": "ready() {\n this.__dataInitialized = true;\n }", "title": "" }, { "docid": "b0fd5bf74c29bb718a85c8d2c68c8bac", "score": "0.62015086", "text": "ready() {\n super.ready();\n\n Polymer.RenderStatus.afterNextRender(this, function () {\n\n });\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.6188562", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "62e1a59b0082804dda3382fecd762db6", "score": "0.6175012", "text": "onReady() { }", "title": "" }, { "docid": "4253d90a0017a691c576e576f2256560", "score": "0.6165806", "text": "function markReady() {\n logger.info('jackalope app instance ready');\n pending.resolve();\n }", "title": "" }, { "docid": "490b538971b324d5b0971d402c75bb05", "score": "0.61585677", "text": "async onReady() {\n this.setState('info.connection', false, true);\n\n await this.initialization();\n await this.create_state();\n this.getInfos();\n }", "title": "" }, { "docid": "8482543ca7001429dcaabc26d7a72113", "score": "0.6156051", "text": "_FBPReady() {\n super._FBPReady();\n //this._FBPTraceWires();\n // check initial overrides\n CheckMetaAndOverrides.UpdateMetaAndConstraints(this);\n }", "title": "" }, { "docid": "f46b34bb92c7542e08d87fdb2bf5926b", "score": "0.61159116", "text": "ready() {\r\n\t\tsuper.ready()\r\n\r\n\t\tstore.dispatch(getDiscussions())\r\n\t\t\r\n\t}", "title": "" }, { "docid": "0fe139d46a3560fe5ca64b136f53e1d3", "score": "0.60994077", "text": "init() {\n this.ready = false;\n this.failed = false;\n }", "title": "" }, { "docid": "e98a6c1aab9fd551c87705c7bfebd3a9", "score": "0.6090804", "text": "ready() {\n this.__dataReady = true;\n // Run normal flush\n this._flushProperties();\n }", "title": "" }, { "docid": "c7d2ca87f9b63abdf592f89b5ee5cf02", "score": "0.6050916", "text": "onReady() {\n this.loading = false;\n }", "title": "" }, { "docid": "9118b756a171003ada10f15a3ca1dcda", "score": "0.6050137", "text": "function ready() {\n ch_ready();\n }", "title": "" }, { "docid": "4b0a60003eccda90577591ecdd93f755", "score": "0.6039616", "text": "load() {\r\n var _this = this;\r\n setTimeout(function () {\r\n _this.stateSet({ ready: true });\r\n }, 500);\r\n }", "title": "" }, { "docid": "b051f409a7f03dd30a73a837c80b8fd1", "score": "0.6007963", "text": "function modelLoaded() {\n console.log('model is ready!');\n}", "title": "" }, { "docid": "f8a7d5d0fd478bbd05da2ccd600dfe26", "score": "0.5997558", "text": "connectedCallback() {\n getOpportunityLayout().then(response => {\n if(response !== null && typeof response !== 'undefined' && Array.isArray(response.sections)) {\n this.sections = response.sections;\n this.ready = true;\n if (this.hasCustomFields()) {\n this.dispatchEvent(new CustomEvent('load', {detail: {hasFields: true}}));\n }\n }\n });\n }", "title": "" }, { "docid": "9b179e4dcc3391afaecb211ae454746d", "score": "0.5995095", "text": "_FBPReady() {\n super._FBPReady();\n //this._FBPTraceWires()\n }", "title": "" }, { "docid": "dab53a3f9fc4207f8002550b9fdbd804", "score": "0.59738433", "text": "init () {\n\n this.readyCount = 0;\n\n}", "title": "" }, { "docid": "b64667ae4c291cbd7ae736bbf13789a2", "score": "0.5972071", "text": "isReady() \n {\n return true;\n }", "title": "" }, { "docid": "45c0c642ecf67a66da126eff02a78a6a", "score": "0.59482175", "text": "ready() {\n return this.screen.ready();\n }", "title": "" }, { "docid": "829443a58c2fa3758ba98b81037f7c5f", "score": "0.592841", "text": "async ensureReady() {\n if (this._isReady) {\n return;\n }\n\n await window.delayedStartupPromise;\n this._ensureEventListenersAdded();\n this.panel.hidden = false;\n this._isReady = true;\n }", "title": "" }, { "docid": "a1c131461a8231fa7b36b6ba97e7ad6b", "score": "0.5924075", "text": "OnBegin( context ) {}", "title": "" }, { "docid": "ed6259f50412194fcbb499ee94b2a3dd", "score": "0.5918437", "text": "modelReady() {\n\t\tconsole.log('model loaded');\n\t}", "title": "" }, { "docid": "f8b9d012dd7f1e59e58158d4b103e03b", "score": "0.59175223", "text": "readyOnce() {}", "title": "" }, { "docid": "34eba9504222a69aa5080709c8957179", "score": "0.5896394", "text": "init() {\n\t this.onInitHandler();\n\t this.emit('onInit');\n\t }", "title": "" }, { "docid": "84b0889fac37a96dc88cad00d28a0b84", "score": "0.58930105", "text": "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires();\n }", "title": "" }, { "docid": "84b0889fac37a96dc88cad00d28a0b84", "score": "0.58930105", "text": "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires();\n }", "title": "" }, { "docid": "84b0889fac37a96dc88cad00d28a0b84", "score": "0.58930105", "text": "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires();\n }", "title": "" }, { "docid": "84b0889fac37a96dc88cad00d28a0b84", "score": "0.58930105", "text": "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires();\n }", "title": "" }, { "docid": "d01ea7238eb4319135133f584cf277b4", "score": "0.5886906", "text": "ready(){\n return this.setStatus(Statable.status.READY);\n }", "title": "" }, { "docid": "20834015f208eb3a9e41b31a1e7288b0", "score": "0.5885172", "text": "onReady() {\n\n }", "title": "" }, { "docid": "bd8bba06f54b8710b51b4c5b2380dc11", "score": "0.5880631", "text": "function onRender() {\n // JB will respond the first time 'ready' is called with 'initActivity'\n connection.trigger('ready');\n connection.trigger('requestTokens');\n connection.trigger('requestEndpoints');\n }", "title": "" }, { "docid": "dae3894c8c7a728f6bc7b7736a3ee7df", "score": "0.58674586", "text": "onInit() {}", "title": "" }, { "docid": "f7c8717f0c8e0fc23622b42aaa8ed93d", "score": "0.5859003", "text": "loaded() { }", "title": "" }, { "docid": "e3916ea2e217c74dc82deea6839231b2", "score": "0.5858285", "text": "onLoadingComplete() {\n common.config = this.getData(\"config\");\n this.setActiveScene(new WorldScene());//create and set an active scene\n this.update();//start update loop running\n }", "title": "" }, { "docid": "a1694fbc65ee82b38923e29871ecf435", "score": "0.585179", "text": "onLoading() {\n this.client.trigger('opening');\n }", "title": "" }, { "docid": "e228c03d9c5dfc3e58b3d2e51e3940f4", "score": "0.5851624", "text": "ready() {\n this.current = new Date();\n this._load()\n }", "title": "" } ]
97e54c7eb59446ad546f0b6f4236b07b
function that null score boards
[ { "docid": "bd118483034277d5d0ec970690ad5d4c", "score": "0.69201183", "text": "function nullScore() {\r\n for (let i = 0; i < scorePlr.length; i++) {\r\n scorePlr[i].textContent = score[i];\r\n }\r\n}", "title": "" } ]
[ { "docid": "5ddfe90c98571e1960e47b2f60b6cfad", "score": "0.67377245", "text": "function scoreReset() {\n \t\tself.game[0].player1Score = 0;\n \t\tself.game[0].player2Score = 0;\n \t\tself.game[0].turn = 0;\n \t\tself.game[0].winner = false;\n \t\tself.game[0].message = \"\";\n \t\tself.game.$save(self.game[0]);\n \t\tfor(var i =0; i<9; i++) {\n \t\t\tself.grid[i].select = \"empty\";\n \t\t\tself.grid.$save(i);\n \t\t}\n\n \t}", "title": "" }, { "docid": "65536a4bcbbc7704488794a3ccd1bd12", "score": "0.6544275", "text": "function noWinner () { \n\tfor(var i=0; i < grid.length; i++){\n\t\tfor\t(var j=0; j < grid[i].length; j++){ \n\t\t\tif (grid[i][j]==EMPTY){\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t}\t\n\talert(\"Strange game. The only move to win is not to play.\")\n\tresetBoard();\n}", "title": "" }, { "docid": "57654147f6194b71e7a25cadec84d8f1", "score": "0.64027745", "text": "function resetBoard() {\n\n board = [[0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0]]\n\n currentScore = 0;\n\n}", "title": "" }, { "docid": "703175bd5d3b762ff506cee3630b26c0", "score": "0.62998575", "text": "function clearBoard() {\r\n \r\n }", "title": "" }, { "docid": "59d5b1b0df8981b38d5cbba3ce347a4b", "score": "0.62735724", "text": "function emptyBoard(){\n\t\t\n\t\tturnCount = 0;\n\t\t\n\t\tfor (i=0; i < squareArray.length; i++){\n\n\t\t\tsquareArray[i].text(\"\");\n\n\t\t\tsquareArray[i].removeClass().addClass(\"square-display\");\n\t\t}\n\n\t}", "title": "" }, { "docid": "8282a6596008852adff9ffcce1a81abc", "score": "0.6269376", "text": "reset() {\n this.score = 0;\n this.grid = Utils.generateEmptyGrid(this.ROWS, this.COLS);\n this._addNumber();\n this._addNumber();\n }", "title": "" }, { "docid": "82cd5baf81dc76c12b01147f28f189ec", "score": "0.6227194", "text": "function playerReset(){\n const pieces='ILJOSZT'\n player.matrix=createTiles(pieces[pieces.length * Math.random() | 0]);\n player.pos.y=0;\n player.pos.x=((arena[0].length /2 | 0) -\n (player.matrix[0].length / 2 | 0)); \n \n if(collision(arena,player)){\n arena.forEach(row => row.fill(0));\n player.score=0;\n updateScore();\n } \n}", "title": "" }, { "docid": "4d7afd2ea030ad30fcd1c2e02005ef49", "score": "0.620291", "text": "function resetScore () {\n iWins = 0;\n iLosses = 0;\n}", "title": "" }, { "docid": "4b79ba477b732b9909fc5197ba394965", "score": "0.6192619", "text": "function resetPlayerScores() {\n player1Score = player2Score = 0;\n\n updateScoreboard(displayP1, player1Score);\n updateScoreboard(displayP2, player2Score);\n\n displayMsg.classList.add(\"d-none\");\n\n gameOver = false;\n}", "title": "" }, { "docid": "cd1e15655605441532a07e4abd11e324", "score": "0.61601955", "text": "resetBoard() {\n this.clearGameOverPlacard();\n this.emptyBoardAddPieces();\n }", "title": "" }, { "docid": "619a6b469caad817e52a0e13d1c880cd", "score": "0.6138447", "text": "function emptyIndexies(board){\n\n return board.filter(s => s != \"O\" && s != \"X\");\n }", "title": "" }, { "docid": "4777bdac6e05756ead8337edbedd34d0", "score": "0.61294544", "text": "function emptyIndexies(board){\n return board.filter(s => s != \"O\" && s != \"X\");\n }", "title": "" }, { "docid": "c9f54635e57ab4772227f7f859d4425a", "score": "0.6120615", "text": "function resetBoard() {\n\t// TO BE DONE\n}", "title": "" }, { "docid": "c74fac2427e2954f240b4b3988dbb2da", "score": "0.61166924", "text": "function clearScore(){\n playerScore = 0;\n computerScore = 0;\n}", "title": "" }, { "docid": "bc5411efa6a04ded1fe468a668dbb0c5", "score": "0.6102718", "text": "function nothing(cards) {\n let ranks = [];\n for (let i = 0; i < 5; i++) {\n ranks.push(cards[i].rank);\n }\n return { type: 'nothing', ranks };\n}", "title": "" }, { "docid": "827a0de94aff326774e254c03088b0c6", "score": "0.609405", "text": "function emptySpots(board) { return board.filter(spot => typeof spot === 'number'); }", "title": "" }, { "docid": "c047b912f728a4ce54528e214ec2ab92", "score": "0.6093705", "text": "function cleanBoard(){\n\n vboard = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"];\n win = false;\n document.getElementById(\"home_score\").parentNode.getElementsByTagName('h3')[0].style.color = \"#aaa\";\n document.getElementById(\"away_score\").parentNode.getElementsByTagName('h3')[0].style.color = \"#aaa\";\n document.getElementById('homewin').style.display = \"none\";\n document.getElementById('awaywin').style.display = \"none\";\n document.getElementById('playagain').style.display = \"none\";\n document.getElementById('graybox').style.display = \"none\";\n\n ticBoard.clean();\n\n // for(i=0;i<ticBoard.boardcells.length;i++)\n // {\n // document.getElementsByClassName(\"cell\")[i].getElementsByTagName(\"p\")[0].innerHTML = \"&nbsp;\";\n // }\n \n}", "title": "" }, { "docid": "82108fb3bb78dbc79eda2620db49a9dc", "score": "0.60932755", "text": "function emptySquares() {\n return origBoard.filter((elm, i) => i===elm);\n}", "title": "" }, { "docid": "67ec23c055c0a01475b6390a4c2ac326", "score": "0.60483295", "text": "function clearBoard() {\n \t\t\tself.game[0].turn = 0\n \t\t\tself.game[0].message = \"\";\n \t\t\tself.game[0].winner = false;\n \t\t\tself.game.$save(self.game[0]);\n \t\tfor(var i =0; i<9; i++) {\n \t\t\tself.grid[i].select = \"empty\";\n \t\t\tself.grid.$save(i);\n\n\t\t}\n \t}", "title": "" }, { "docid": "da081413129cd38182b6141e349cabec", "score": "0.6039907", "text": "function resetScoreBoard() {\n gameRound = 1;\n for(let i=1; i<scoreBoard.rows.length; i++) {\n for(let j=1; j<scoreBoard.rows[i].cells.length; j++)\n scoreBoard.rows[i].cells[j].textContent = '-';\n }\n player1.scores = [];\n player2.scores = [];\n winnerMsg.textContent = '';\n}", "title": "" }, { "docid": "9269a50edf1d15c9b3af8eebb1a935fb", "score": "0.6029344", "text": "function clearScore() {\n level = 1;\n difficultyTier = 0;\n numberOfTrains = 1;\n totalScore = 0;\n myTime.restart();\n}", "title": "" }, { "docid": "0a8bb6b12ffad1e34e1de56f144a7081", "score": "0.60184187", "text": "function resetBoard (board) {\n for (row=0; row<HEIGHT; ++row){\n for (col=0; col<WIDTH; ++col) {\n // Reset cell data\n board.boardData[row][col].mine = 0;\n board.boardData[row][col].neighbors = 0;\n board.boardData[row][col].clicked = 0;\n board.boardData[row][col].flag = 0;\n\n // Reset display\n board.boardDisplay.rows[row].cells.item(col).innerHTML = UNCLICKED;\n board.boardDisplay.rows[row].cells.item(col).style.backgroundColor = \"#b3d1ff\";\n }\n }\n setMines(board);\n}", "title": "" }, { "docid": "44505ac2aecc87750b8d13c91b6e52cf", "score": "0.60168016", "text": "constructor(w, h){\n this.width = w + 2 ;\n this.height = h + 2;\n this.boardArray = [];\n \n for(var j = 0; j < this.height; j++){\n\tfor(var i = 0; i < this.width; i++){\n if(j == 0 || j == this.height - 1 || i == 0 || i == this.width - 1){\n this.boardArray.push(null);\n }\n else{ \n this.boardArray.push(0);\n\t\t}\n }\n }\n }", "title": "" }, { "docid": "d873d30403bcb340642643a9fd7c84be", "score": "0.60028625", "text": "function resetBoards() {\n for (row of playerBoardEls) {\n for (grid of row.children) {\n if (grid.id !== '') {\n grid.style.backgroundColor = game.water;\n grid.style.opacity = '0.6';\n }\n }\n }\n for (row of computerBoardEls) {\n for (grid of row.children) {\n if (grid.textContent === '') {\n grid.style.backgroundColor = game.water;\n grid.style.opacity = '0.6';\n }\n }\n } \n}", "title": "" }, { "docid": "c8c24f3587db6dd60802307aeabffce2", "score": "0.59904754", "text": "function resetScore() {\n \"use strict\";\n \n score = 0;\n}", "title": "" }, { "docid": "13dc35257b19d795ff9b1560510e932c", "score": "0.59844255", "text": "function drawScoreBoard(){\n creElT('div', ['scoreboard', 'stats'], document.getElementsByClassName('statsContain')[0], 'Score: 0');\n creElT('div', ['scoreboard', 'stats', 'highscore'], document.getElementsByClassName('statsContain')[0], 'Highscore: '+highScore);\n }", "title": "" }, { "docid": "f4206428fe2dabcf7036c0d9db092d62", "score": "0.5978404", "text": "function emptySquares() {\n\treturn origBoard.filter(s => typeof s == 'number');\n}", "title": "" }, { "docid": "cb64e875f38d923b34278afa372a7708", "score": "0.59748185", "text": "function gol_drawEmptyBoard(){\n gol_drawBackground();\n gol_drawEmptyLife();\n }", "title": "" }, { "docid": "29b88541109ad0a2f361bdab08936354", "score": "0.5974046", "text": "reset() {\r\n this.board = new Array(9) \r\n this.player = 'o'\r\n this.isWon = false\r\n this.emptyBoxes = 9\r\n this.winConditions = [\r\n [0, 1, 2],\r\n [3, 4, 5],\r\n [6, 7, 8],\r\n [0, 3, 6],\r\n [1, 4, 7],\r\n [2, 5, 8],\r\n [0, 4, 8],\r\n [2, 4, 6],\r\n ];\r\n }", "title": "" }, { "docid": "5815ce092a451623ed8c990c18f58558", "score": "0.5962293", "text": "function emptySquares() {\n\treturn initialBoard.filter(s => typeof s == 'number');\n}", "title": "" }, { "docid": "24df700516fbd6353f04e6e153724213", "score": "0.5962019", "text": "emptyBoard() {\n this.pieces = []\n }", "title": "" }, { "docid": "32a0c1d7ddee5a8e044fce7085651cbb", "score": "0.59605575", "text": "function reset() {\n for (var i = 0; i < 6; i++) {\n for (var j = 0; j < 7; j++) {\n board[i][j] = ' ';\n boardLocation = i.toString() + j.toString();\n var temp = document.getElementById(boardLocation);\n temp.style.background = \"white\";\n }\n\n }\n winner = false;\n currentColor = '';\n boardInput = '';\n boardLocation = '';\n //show there are all open spots in the columns\n col0 = 5;\n col1 = 5;\n col2 = 5;\n col3 = 5;\n col4 = 5;\n col5 = 5;\n col6 = 5;\n getCurrentPlayer();\n}", "title": "" }, { "docid": "57f90133a00d8e800b66bb8cc5c72eb7", "score": "0.5931098", "text": "function resetGames() {\r\n counter = 0;\r\n // Resetting best Games score to 0\r\n if (bestGames) {\r\n bestGames.score = 0;\r\n }\r\n}", "title": "" }, { "docid": "bc39ddfe1356d020482ffda787b3be51", "score": "0.5925033", "text": "function resetBoard() {\n // Clear the board already exist >> createHTMLForCards(shuffledListOfCards), so no new function needed\n shuffledListOfCards = shuffle(listOfAllCards);\n createHTMLForCards(shuffledListOfCards);\n // reset results\n resetMoves(); \n resetStars();\n resetTimeInHTML()\n usedTime = 0;\n // stop counting time\n stopTime();\n // reset first move flag\n firstMove = true;\n //clear the list of compared and matched cards\n clearComparedCardsList();\n clearMatchedCardsList();\n}", "title": "" }, { "docid": "48d53581531deb6b20d4c60d795b1f7a", "score": "0.5923346", "text": "function calculateWinner(squares) {\n return null;\n}", "title": "" }, { "docid": "9f948fc3fbaa591c289e58488f4c7b6f", "score": "0.59224325", "text": "function emptyIndexies(board) {\r\n return board.filter(s => !isNaN(s));\r\n}", "title": "" }, { "docid": "fc12b2a218fa050d947f227f376ac734", "score": "0.59182847", "text": "function reset() {\n // reset the score variables to zero\n p1Score = 0;\n p2Score = 0;\n // also have to 'reset' the scores on display by changing the textContent\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n // remove the green text added via classList\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n // set gameOver back to false to allow game to play\n gameOver = false;\n}", "title": "" }, { "docid": "d38b064e353e76d4417ccfc6ba95e1d1", "score": "0.5916444", "text": "function resetScores(){\n params.currentRound = 0;\n params.playerScore = 0;\n params.computerScore = 0;\n params.winsRequired = 0;\n params.progress = []\n }", "title": "" }, { "docid": "b4f77bde7edc80f5cfd7626ebe031a08", "score": "0.59115106", "text": "function reset(){\n jewel1 = Math.floor((Math.random() * 12) + 1);\n jewel2 = Math.floor((Math.random() * 12) + 1);\n jewel3 = Math.floor((Math.random() * 12) + 1);\n jewel4 = Math.floor((Math.random() * 12) + 1);\n \n score = 0;\n update_score(0);\n rand = Math.floor((Math.random() * 120) + 19);\n $('#rand').html(rand);\n $('#win').html(win);\n $('#loss').html(loss);\n \n \n }", "title": "" }, { "docid": "504af0b8ea0525972d963ef88d303bd0", "score": "0.59054697", "text": "function scoreboard(){\n\t\t$('#timeLeft').empty();\n\t\t$('#message').empty();\n\t\t$('#correctedAnswer').empty();\n\n\n\t\t$('#finalMessage').html(messages.finished);\n\t\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n\t\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n\t\t$('#unanswered').html(\"Unanswered: \" + unanswered);\n\t\t$('#startOverBtn').addClass('reset');\n\t\t$('#startOverBtn').show();\n\t\t$('#startOverBtn').html(\"PLAY AGAIN\");\n\t}", "title": "" }, { "docid": "d18ac75f228829e14887d9080a7cf556", "score": "0.5900842", "text": "function reset() {\n isGameOver = false;\n for(let player of [player1, player2]) {\n player.score = 0;\n player.display.textContent = 0;\n player.display.classList.remove('has-text-success', 'has-text-danger');\n player.button.disabled = false;\n }\n if(gameRound > 3) resetScoreBoard()\n}", "title": "" }, { "docid": "c2ce95063c709f2e81c80d406188dddb", "score": "0.5896702", "text": "function reset() {\n\n //We notify the user of it's victory\n alert(\"Cowabunga! You cleared the board... Generating new game!\");\n\n //We wipe the game board and generate a new game\n document.querySelector('.gameBoard').innerHTML = \"\";\n newGame();\n }", "title": "" }, { "docid": "37542ed5311c315f416776d31391998e", "score": "0.589526", "text": "function resetScores() {\n slotOne=0;\n slotTwo=0;\n slotThree=0;\n final = 0;\n score=0;\n }", "title": "" }, { "docid": "5bc7c5afc819d87e1767725f723e85be", "score": "0.58873516", "text": "function resetGame() {\n\t\tscoreToMeet = 0;\n\t\tscoreNow = 0;\n\t\tplutoNum = 0;\n\t\tmarsNum = 0;\n\t\tmoonNum = 0;\n\t\tsunNum = 0;\n\t\tgivenScore(); // function created row 122\n\t\t\n\t\t//pulled from html row 103 \n\t\t$(\"#gemRow\").show();\n\t\timgPic(); // function created row 66\n\t}", "title": "" }, { "docid": "ace44b617c2c0501ebafcdad14973408", "score": "0.5882626", "text": "function clearBoard(){\n playerScoreEl.innerHTML = '';\n computerScoreEl.innerHTML = '';\n}", "title": "" }, { "docid": "3e88023e578245d97eb97e3e356d8953", "score": "0.5876332", "text": "function emptyIndices(board) {\r\n board = Array.from(squares);\r\n return board.filter(square => square.innerHTML !== \"O\" && square.innerHTML !== \"X\");\r\n}", "title": "" }, { "docid": "c4692f3bcb42b3b5bfe9151304133321", "score": "0.58762383", "text": "function didItTie() {\r\n let null_counter = 0;\r\n for (let i = 0; i < score.length; i++) {\r\n for (let j = 0; j < score.length; j++) {\r\n if (score[i][j] == null) {\r\n null_counter++;\r\n }\r\n }\r\n }\r\n if (null_counter == 0) {\r\n new_message.edit('Boo! It\\'s a tie!')\r\n .then(console.log('Successful tie'))\r\n .catch(console.error);\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "66a73c2e8ef41c9e49cbd90f67c4756b", "score": "0.5869746", "text": "function DummyClickCustomScoreboard() { }", "title": "" }, { "docid": "61567ea04d45dfa7ecfdc592c7dcab0b", "score": "0.5866164", "text": "function resetScores(){\n if(level == \"normal\") UI.lives = 2;\n if(level == \"death\") UI.lives = 0;\n UI.points = 0;\n displayLives();\n displayPoints();\n }", "title": "" }, { "docid": "57fa3dc3953239ede387c33370678e28", "score": "0.58595073", "text": "function resetGame() {\n game.player1.gameScore = 0;\n game.player2.gameScore = 0;\n gameScoreIndex++;\n pointScoreIndex = 0; //for after looking at matchStats\n // gameScoreIndex = 0;\n // game.gameScoreCollection.push(pushArr);\n if (game.startSer === 'player1') {\n swal(game.player2.name + \" serves first\");\n game.startSer = 'player2';\n game.player1.curSer = false;\n game.player2.curSer = true;\n } else if (game.startSer === 'player2') {\n swal(game.player1.name + \" serves first\");\n game.startSer = 'player1';\n game.player1.curSer = true;\n game.player2.curSer = false;\n }\n }", "title": "" }, { "docid": "d00b0e07dc6af18714fc7b2fc8addbc5", "score": "0.58532065", "text": "function resetGame() {\n // Reset everything\n setBars();\n setBullet();\n setBot();\n\n swingX = swingY = firedPointX = firedPointY = firedPointDist = 0;\n relAngleX = relAngleY = 0;\n moveBars = barHit = swingBot = false;\n\n if (currScore > topScore) {\n topScore = currScore;\n }\n ;\n\n currScore = 0;\n }", "title": "" }, { "docid": "4b8c3cb1f27694170c534d581477c262", "score": "0.5853179", "text": "function resetScores() {\n\t\tplayer1.setScore(0);\n\t\tplayer2.setScore(0);\n\t\tupdateScores();\n\t}", "title": "" }, { "docid": "fa36ddb4b094b60a5b1c00c73001b586", "score": "0.58481705", "text": "function gameover(s) {\n for(var i = 0; i < 9; i++) {\n if(s[i] == null) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "c969cf7d1e61f57d150df58140578f9f", "score": "0.58373165", "text": "function resetScores(){\n guessLeft = 9;\n guessSoFar = [];\n}", "title": "" }, { "docid": "399fcef468d82e756bcae6ff0ebac71d", "score": "0.583473", "text": "function emptySquares() {\n return origBoard.filter(s => typeof s == 'number');\n}", "title": "" }, { "docid": "1b13d7e68981a8e89184f4a6879d2e6e", "score": "0.5832838", "text": "function resetScore(){\n playerScore = 0;\n computerScore = 0;\n}", "title": "" }, { "docid": "76dd82d64fdfa3a94919168caef0ae76", "score": "0.5828438", "text": "function clearBoard(){\n for (var i = 0; i < self.boardSquareList.length; i++){\n self.boardSquareList[i].playerClicked = \" \";\n self.winningMessage = \" \";\n self.clickCount = 0;\n }\n }", "title": "" }, { "docid": "77f81c0f29136f42eb04e11320483a81", "score": "0.5827999", "text": "function reset() {\n // first reset the score variables, then update the display to reflect the change\n p1Score = 0;\n p1Display.textContent = p1Score;\n p2Score = 0;\n p2Display.textContent = p2Score;\n // since don't know who's the winner, just remove the winner class from both\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n // set gameOver back to false - reset the whole game\n gameOver = false;\n}", "title": "" }, { "docid": "c555bd3fd231310b52782fcd418ac59e", "score": "0.58247966", "text": "score(): { BLACK: number, WHITE: number } {\n const playerScores = { BLACK: 0, WHITE: 0 };\n // calculate each score based on the number of tiles surrounding the opponents queen\n if (this.queens().WHITE) {\n const location: string = this.queens().WHITE;\n const locationPoint: Point = fromKey(location);\n playerScores.BLACK = directionFunctions.reduce((acc, direction) => {\n const tile = this.topTile(direction(locationPoint));\n if (tile.type !== TileTypes.EMPTY) acc++;\n return acc;\n }, 0);\n }\n\n if (this.queens().BLACK) {\n const location: string = this.queens().BLACK;\n const locationPoint: Point = fromKey(location);\n playerScores.WHITE = directionFunctions.reduce((acc, direction) => {\n const tile = this.topTile(direction(locationPoint));\n if (tile.type !== TileTypes.EMPTY) acc--;\n return acc;\n }, 0);\n }\n return playerScores;\n }\n\n queens(): { BLACK?: string, WHITE?: string } {\n return { BLACK: this.get(\"BLACK_QUEEN\"), WHITE: this.get(\"WHITE_QUEEN\") };\n }\n\n possibleSpotsToPlace(tile) {\n // return List of all possible keys ['0~0', '1~0', ...]\n let moves = List();\n this.filter(\n (v, key) => key !== \"BLACK_QUEEN\" && key !== \"WHITE_QUEEN\"\n ).forEach((v, k) => {\n const point = fromKey(k);\n if (this.isEmptyTile(point))\n moves = moves.push({ tile, board: this.addTile(point, tile) });\n });\n return moves;\n }\n\n /**\n * What is the best score the user could get looking ahead depth?\n */\n bestMove(board, tiles, depth) {\n // All possible board states where the user places a tile\n let spotsToPlace = [];\n tiles.forEach(tile => {\n spotsToPlace = [...spotsToPlace, ...this.possibleSpotsToPlace(tile)];\n });\n\n // All possible board states where the user moves a tile on the board\n const spotsToMove = [];\n\n // Total of all possible board states\n const possibleBoardStates = [...spotsToPlace, ...spotsToMove];\n\n return possibleBoardStates[0];\n }\n}", "title": "" }, { "docid": "dd9e1212991d7ac2fd90ecab9536f8e3", "score": "0.5823234", "text": "function resetBoard() {\n\n //Hide play again button\n togglePlayAgainButton()\n //Show Let'splay message\n lib.displayMessage(\"Let's play!\")\n //Reset board\n resetCells()\n redrawBoard()\n //Add listensers back in\n var boardNode = document.getElementsByClassName('board')[0]\n lib.addListeners(boardNode)\n\n}", "title": "" }, { "docid": "eac55f1978019bd412fc92832a89572d", "score": "0.5816759", "text": "reset(){\n const pieces = 'ILJOTSZ';\n this.matrix = this.createPiece(pieces[pieces.length * Math.random() | 0]);\n this.pos.y = 0;\n this.pos.x = (this.arena.matrix[0].length / 2 | 0) - (this.matrix[0].length / 2 | 0);\n if(this.arena.collide(this)){\n this.arena.clear();\n console.log(\"game over\");\n this.score = 0;\n this.events.emit('score', this.score);\n }\n this.events.emit('pos', this.pos);\n this.events.emit('matrix', this.matrix);\n }", "title": "" }, { "docid": "9ee5720d15d9c6a3a25eb960362916a6", "score": "0.58056754", "text": "function resetBoard() {\n display.gameBoard.forEach((e) => {\n e.innerHTML = \" \";\n e.style.backgroundColor = \"\";\n });\n display.table = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"];\n turn = 1;\n gameWon = false;\n display.winner.innerHTML = \"\";\n }", "title": "" }, { "docid": "a9e59cb4b325d988d1ec39f48e78de25", "score": "0.58034074", "text": "function resetBoard(){\n [checkingCard, disableBoard] [false, false];\n [prevCard] [null];\n }", "title": "" }, { "docid": "fb90decabe7d3c1df026863af2cbdd63", "score": "0.57966393", "text": "function emptyIndexes(board) {\n return board.filter(s => s != 'O' && s != 'X');\n }", "title": "" }, { "docid": "0ae2153dd2fafdc2ce29d70eba9674a5", "score": "0.5795619", "text": "function scoreboard(){\n\t\t\t$('.message').html(' ');\n\t\t\t$('.thisPictureOverHere').html(' ');\n\t\t\t$('.finalMessage').html('You finished the game.');\n\t\t\t$('.right').html('RIGHT: '+ correctAnsw);\n\t\t\t$('.wrong').html('WRONG: '+inCorrectAnsw);\n\t\t\t$('.left').html('N/A: '+unAnsw);\n\t\t\t$('.rightAnswer').html(' ');\n\t\t\t$('.startButton').show().text('lets go again').click(currentQuestion = 0);\t\n\t\t}", "title": "" }, { "docid": "4439dc4fcc4526c7a67144ae47059fe9", "score": "0.57922375", "text": "function initializeBoard() {\n\tlet temp;\n\t//these three lines set the \"scoreboard\"\n\tdocument.getElementById(\"player1\").className = 'currentPlayer';\n\tfor (let i = 0; i < board.length; i++) {\n\t\tboard[i] = [];\n\t\tif (i != 6 && i != 13) { // Don't initialize the two caches.\n\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\ttemp = Math.round(3 * Math.random());\n\t\t\t\tswitch (temp) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tboard[i].push(\"blue\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tboard[i].push(\"green\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tboard[i].push(\"red\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tboard[i].push(\"yellow\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tplaceStones(document.getElementById(i));\n\t\t}\n\t}\n\t//drawBoard();\n\tactivatePits();\n}", "title": "" }, { "docid": "d5c95bbefb04adc65211064f6b500a7a", "score": "0.57867074", "text": "reset()\n {\n this.board = this.createBoard();\n this.currentPlayer = Math.random < 0.5;\n }", "title": "" }, { "docid": "026a09af42db05d3cbd85efdc4b369ff", "score": "0.57849175", "text": "resetScore() {\n this.score = 0;\n }", "title": "" }, { "docid": "4863944b4efb1ba989d5186b8711d17b", "score": "0.57805246", "text": "function checkBoard() {\n// console.log(gamePlaying);\n score[0] = mancalaBoard[6];\n score[1] = mancalaBoard[13];\n console.log(\"Current Score for Player 1 = \", score[0])\n console.log(\"Current Score for Player 2 = \", score[1]);\n let sum1 = 0;\n let sum2 = 0;\n for (let i = 0; i < 6; i++) {\n sum1 += Number(mancalaBoard[i]);\n }\n// console.log(sum1);\n for (let i = 7; i < 13; i++) {\n sum2 += Number(mancalaBoard[i]);\n }\n // console.log(sum2);\n // console.log(\"the sum of side player 1 is - \" + sum1);\n // console.log(\"the sum of side player 2 is - \" + sum2);\n if (sum1 === 0 || sum2 === 0) {\n gamePlaying = false;\n score[0] = mancalaBoard[6] += sum1;\n score[1] = mancalaBoard[13] += sum2;\n mancalaBoard = [0,0,0,0,0,0, score[0],0,0,0,0,0,0,score[1]];\n document.querySelector(\"#\\\\36 \").innerText = score[0];\n document.querySelector(\"#\\\\31 3\").innerText = score[1];\n [...document.querySelector(\"div.row.pit-0\").children].forEach(button => button.setAttribute(\"disabled\", \"true\"));\n [...document.querySelector(\"div.row.pit-0\").children].forEach(button => button.innerText = '0');\n [...document.querySelector(\"div.row.pit-1\").children].forEach(button => button.setAttribute(\"disabled\", \"true\"));\n [...document.querySelector(\"div.row.pit-1\").children].forEach(button => button.innerText = '0');\n // console.log(\"One of the pit sides is empty\");\n // console.log(gamePlaying,\"Player 1 Score - \" + mancalaBoard[6],\"Player 2 Score - \" + mancalaBoard[13]);\n\n if (score[0] > score[1]) {\n gameOver.play();\n // console.log(\"player 1 wins with score \" + score[6]);\n gameOver.addEventListener(\n \"ended\",\n function() {\n p1Wins();\n },\n false\n );\n } else if (score[1] > score[0]){\n // console.log(\"player 2 wins with score \" + score[13]);\n gameOver.play();\n gameOver.addEventListener('ended', function() {\n p2Wins();\n }, false)\n } else if (score[1] === score[0]) {\n gameOver.play();\n tieGame();\n }\n }\n}", "title": "" }, { "docid": "92b56c7cdf7aeaf8da82400bbda03751", "score": "0.57789606", "text": "function resetBoard(){\n //Reset Timer\n $('.see-cognition-score-timer-wrapper').removeClass('see-cognition-timer-active').removeAttr('style');\n\n //Hide the question and answers (for new question)\n $('.see-cognition-question-wrapper').css('transition','none').fadeOut(300, function(){\n\n // Reset answer buttons\n $('.cognition-answer').removeClass('cognition-answer-incorrect cognition-answer-correct cognition-answer-show-correct cognition-answer-bad-selection').removeAttr('style');\n\n });\n\n // Check if we can continue\n if(rounds != maxRounds) {\n\n $('.see-cognition-start').delay(300).fadeIn(300, function () {\n\n //Show loader\n $('.see-cognition-loader').removeClass('see-cognition-loader-reset');\n\n // Start game again\n setTimeout(startGame(4500), 4000);\n });\n\n\n } else { endGame() }\n\n // Clear game timers\n clearTimeout(resetTimer);\n\n }", "title": "" }, { "docid": "a8415006b9706fda5ec3c1ada30c8342", "score": "0.5778296", "text": "function resetBoard() {\n selectedCard = false;\n boardDisabled = false;\n firstClick = null;\n secondClick = null;\n con = \"<tr><td colspan='2'></td></tr><tr><td>Name </td><td>Score </td></tr>\";\n winnerName.value = null;\n}", "title": "" }, { "docid": "697547878d0baee25b643d65dcb53dce", "score": "0.57752985", "text": "board() {}", "title": "" }, { "docid": "30452bd4b80a6ffa1dbf8a15a9e32243", "score": "0.5768788", "text": "function reset_board(board) {\n\t$(`#${board} .energizer_holder`).addClass(\"energizer point\");\n\t$(`#${board} .coin_holder`).addClass(\"point\");\n\t$(`#${board} .pacman`).removeClass(\"pacman\");\n\t$(`#${board} .pacman_holder`).addClass(\"pacman\");\n\t$(`#${board} .pinky`).removeClass(\"pinky\");\n\t$(`#${board} .pinky_holder`).addClass(\"pinky\");\n\t$(`#${board} .clyde`).removeClass(\"clyde\");\n\t$(`#${board} .clyde_holder`).addClass(\"clyde\");\n\t$(`#${board} .blinky`).removeClass(\"blinky\");\n\t$(`#${board} .blinky_holder`).addClass(\"blinky\");\n\t$(`#${board} .inky`).removeClass(\"inky\");\n\t$(`#${board} .inky_holder`).addClass(\"inky\");\n\t$(`#${board} .scared`).removeClass(\"scared\");\t\n}", "title": "" }, { "docid": "eb4e7d02ccd352ac3d704c76e4aa1f2c", "score": "0.5767966", "text": "function emptyIndexies(board){\n return board.filter(s => s != \"O\" && s != \"X\");\n}", "title": "" }, { "docid": "4771590dc2933a467fa3a106cc5d062a", "score": "0.5764829", "text": "function reset() {\n p1Score = 0;\n p2Score = 0;\n p1Congrats.classList.add(\"d-none\");\n p2Congrats.classList.add(\"d-none\");\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n p1Display.classList.remove(\"text-success\");\n p2Display.classList.remove(\"text-success\");\n gameOver = false;\n}", "title": "" }, { "docid": "fa08505b60f26482eba7ee5042b9724e", "score": "0.57558846", "text": "function createScorecard() {\n showScorecard(-1);\n}", "title": "" }, { "docid": "3afee30194987c0610d366ca452a0dc9", "score": "0.5745676", "text": "clearSide(playerId){\n for (let x=0 ; x<10; x++){\n for (let y=(!playerId?0:6) ; y<(!playerId?4:10); y++){\n this.board[y][x] = null;\n }\n }\n console.log(\"Supression terminé\");\n }", "title": "" }, { "docid": "469800f80872cd5b985ca5fd22704ff5", "score": "0.5744626", "text": "function clearBoard() {\n //clears the data from each board square\n $('.board td').data('player', '');\n //clears the class from each board square\n $('.board td').removeClass('player1 player2');\n //clears the text from each board square\n $('.board td').text(\"\");\n //resets the click counter to zero\n clickCount = 0;\n //removes the \"you win!\" message from the screen\n $('.winTag').remove();\n //resets the winner value to false\n winner = false;\n //resets the flashing and color of the button after a win\n $('input').removeClass();\n //shows \"Current Player\"\n $('h2').show();\n}", "title": "" }, { "docid": "8b6a8c67cbd7dae96674041974f7123d", "score": "0.5739414", "text": "function boardReset() {\n boardArray.fill(0);\n xTurn = true;\n winnerFound = false;\n $(\".gameCell\").html(\"<div class='fillX1'></div> <div class='fillX2'></div>\");\n $(\".restart\").toggle();\n }", "title": "" }, { "docid": "6234d83ebd8b5cdf92e14025a6728c74", "score": "0.5734784", "text": "function reset() {\n game.reset();\n globalSum = 0;\n $board.find('.' + squareClass).removeClass('highlight-white');\n $board.find('.' + squareClass).removeClass('highlight-black');\n $board.find('.' + squareClass).removeClass('highlight-hint')\n board.position(game.fen());\n $('#advantageColor').text('Neither side');\n $('#advantageNumber').text(globalSum);\n\n // Kill the Computer vs. Computer callback\n if (timer)\n {\n clearTimeout(timer);\n timer = null;\n }\n}", "title": "" }, { "docid": "3177a246078fb27b7845a8e600a24dc1", "score": "0.57231104", "text": "function board_clear() {\r\n\tboard = [\r\n\t\tBLANK, BLANK, BLANK, BLANK, BLANK, BLANK, BLANK, BLANK, BLANK\r\n\t];\r\n\tclear_board_tiles();\r\n}", "title": "" }, { "docid": "3c7412d37c08b311d691effb437c8833", "score": "0.5715996", "text": "function clearHighScores() {\n // the list is cleared by clearing the two arrays and rendering the list\n highScoresInitials = [];\n highScores = [];\n renderHighScoresList();\n}", "title": "" }, { "docid": "73b4837215dd34900ee59c1980a5fdea", "score": "0.5713702", "text": "function fillBoard() {\r\n\tfor (var i = 0; i < 9; i++)\r\n\t{\r\n\t\tboard[i] = $(\".sq\"+i).text();\r\n\t}\r\n\tflag = checkWinner();\r\n\tif (flag === 1)\r\n\t{\r\n\t\tdocument.querySelector(\".player\"+activePlayer).innerHTML = \"WINNER!\";\r\n\t\t$(\".square\").off(\"click\");\r\n\t}\r\n}", "title": "" }, { "docid": "14b8ff8be21c8f11379ce20bd5abf5d8", "score": "0.5712615", "text": "function resetGame() {\n\n // Set the content of all 9 cells to nothing\n for ( i = 0; i < board.length; i++) {\n board[i].innerHTML = \"\";\n }\n \n // TODO reset player back to X and update it on the page\n player = \"X\";\n\t\n document.getElementById(\"player\").innerHTML = player;\n\n // TODO reset gameOver and # of empty cells\n\tempty = 9;\n\t\n\tgameOver = false;\n\n\t// remove the existing highlighted cell\n\tremoveHighlight();\n\t\n\t// remove winner cells highlight \n\tdocument.querySelectorAll(\".winner\").forEach((win, index, array)=>{\n\t\twin.classList.remove(\"winner\");\n\t});\n}", "title": "" }, { "docid": "b8ded976d6a6b305ef4c50ee32ce8e05", "score": "0.5711895", "text": "clearLine() {\n let rowCount = 0;\n\n outer: for (let y = this.playArea.length - 1; y > 0; y--) {\n for (let x = 0; x < this.playArea[y].length; x++) {\n if (this.playArea[y][x] === 0) {\n continue outer;\n };\n };\n\n const row = this.playArea.splice(y, 1)[0].fill(0);\n this.playArea.unshift(row);\n y++;\n rowCount++;\n };\n\n // return this.scoreCount(rowCount);\n return rowCount;\n }", "title": "" }, { "docid": "17d193daa9f7a48e9c8bc581746f171e", "score": "0.5711064", "text": "function gameOver() {\n gameover = 1;\n removeFs();\n resetDiv();\n createHs();\n createYs();\n yourScoreRefresh();\n\n}", "title": "" }, { "docid": "0221308550d84cfeb8fb406032323f0e", "score": "0.57109576", "text": "function resetGame() {\n board = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n // clears anything in each square\n $('.square').each(function() {\n $(this).empty();\n $(this).removeClass('blue red');\n });\n }", "title": "" }, { "docid": "cfda0fd1c9fbdceec0081f342567dec7", "score": "0.57102007", "text": "function resetGameBoard () {\n\t\tgame.resetGameBoard();\n\t\t$('.cell').children().remove();\n\t\tif(winLine !== undefined) {\n\t\t\twinLine.remove();\n\t\t}\n\t}", "title": "" }, { "docid": "7b2c2943c9d17adbddaac0e8826b74b1", "score": "0.5707568", "text": "function resetScore() {\n score = 0;\n scoreEl.innerText = score + ' points.';\n}", "title": "" }, { "docid": "97562ff6cfde6232932f23a46f02dfcb", "score": "0.5696536", "text": "function resetGameBoard() {\n for (let i = 0; i < getBoardPosition.length; i++) {\n getBoardPosition[i].innerHTML = '';\n }\n resultsArr();\n if (computer) setTimeout(computerLogic, 1000);\n}", "title": "" }, { "docid": "a76d445f0509329f98c6f27d166a76d4", "score": "0.56965244", "text": "clear() {\n let board = this.board;\n for(let r = 0; r<this.height; r++){\n for(let c =0; c<this.width; c++){\n board[r][c]=0;\n }\n }\n }", "title": "" }, { "docid": "29f05e0543b95caeb5e7c3fcea5bde74", "score": "0.56960285", "text": "function cleanBoard() {\n initialize()\n cells.forEach(function (el) {el.style.backgroundColor = ''})\n headline.innerHTML = 'nonogram puzzle';\n}", "title": "" }, { "docid": "deaa850f017dfb42a013d1218c45dad9", "score": "0.5695008", "text": "function reset() {\n\t\tcurrent_score = 0;\n\t\tcurrent_coins = [];\n\t\tsnake_size = [];\n\t\t$(\"#game-board\").html(\"\");\n\t\t$(\"#my-score\").html(\"Current score: \" + current_score);\n\t\t// creates a player\n\t\tmakeElement(start.x, start.y, \"player\", \"blue\", SIZE);\n\t\tsnake_size.push({\n\t\t\tmyX: start.x,\n\t\t\tmyY: start.y\n\t\t})\n\t}", "title": "" }, { "docid": "b9a6bad9843a6ddbf4cd9831803d30c7", "score": "0.5693818", "text": "function reset() {\n\n \twholeGame.newGame();\n // wholeGame.current().newRound();\n \tticBoard.sideLeft.style.display = 'none';\n \tticBoard.sideRight.style.display = 'none';\n ticBoard.sideLeft.style.opacity = '0';\n ticBoard.sideRight.style.opacity = '0';\n winBox.className = \"\";\n \tticBoard.closeIt();\n \n lightboard();\n \n document.getElementById(\"bestofbox\").getElementsByTagName('div')[0].innerHTML = \"\";\n document.getElementById(\"bestofbox\").getElementsByTagName('div')[1].innerHTML = \"\";\n}", "title": "" }, { "docid": "3cf4f5806eb53920da969698e73424d8", "score": "0.569002", "text": "function clearBoard() {\n\t\tlet squares = document.querySelectorAll('.square');\n\t\tfor(let i = 0; i < squares.length; i++) {\n\t\t\tlet square = squares[i];\n\t\t\tsquare.setAttribute('data-value', null);\n\t\t}\n\t}", "title": "" }, { "docid": "b4a53be07c797b59f1cb864b64027d35", "score": "0.56898683", "text": "function resetScore(){\n //to rest the entire score in the UI\n scores[activePlayer] = 0;\n document.getElementById('score-' + activePlayer).textContent = scores[activePlayer] ;\n\n //to make the other player play\n nextPlayer();\n}", "title": "" }, { "docid": "07c0727bdb50bb5ca9d0c6d502e417e8", "score": "0.56876177", "text": "function resetScores()\n{\n\tGOLD = 0;\n\tCLICKDMG = 1;\n\tENDTIME = 0;\n}", "title": "" }, { "docid": "29ebbb1fd6a8e3f334b2434bbb5fb88b", "score": "0.5685165", "text": "resetGame() {\n this.frame = 0;\n this.currentBall = 0;\n this.maxBalls = 2;\n this.score = 0;\n this.pins = 0;\n this.bonusPoints = [];\n this.spare = false;\n this.scores = Array(10).fill(0);\n }", "title": "" }, { "docid": "c9f7812a6db27c9caa074dd119a9766b", "score": "0.5679721", "text": "function getEmptyIndexies(board){\n return board.filter(s => s!==\"X\" && s!==\"O\");\n }//end of getEmptyIndexie func", "title": "" }, { "docid": "51b3c874e9018be224724c9101a66f47", "score": "0.5676707", "text": "function reset() {\n cells = [];\n ++games_played;\n $('.games-played > .value').text(games_played);\n gameOver = false;\n player_1.canUseAbility = true;\n player_2.canUseAbility = true;\n player_1 = null;\n player_2 = null;\n toMatch = 0;\n $('.cell-container').hide();\n $('#pick-board-size').hide();\n $('.kirby-select').parent().show();\n $('.kirby-select').show();\n $('.gameovermodal').hide();\n\n $('.game-stats > img').attr('src', \"images/angrykirby.png\");\n $('.player-turn > span').text('');\n\n\n $('[value=\"ability\"]').removeClass('ability-disabled');\n $('[value=\"ability\"]').addClass('ability-enabled');\n\n\n}", "title": "" } ]
183a95c6d88335bb48959d2e69927241
Maps an error Code from GRPC status code number, like 0, 1, or 14. These are not the same as HTTP status codes.
[ { "docid": "c5ff6065bfbedb1f1fd6c43909a28dbb", "score": "0.7064752", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n __WEBPACK_IMPORTED_MODULE_2__util_log__[\"c\" /* error */]('GRPC error has no .code');\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DATA_LOSS;\n default:\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "title": "" } ]
[ { "docid": "4474e79a126927bab3f89bd00af6d01e", "score": "0.76428276", "text": "function mapCodeFromHttpResponseErrorStatus(status) {\r\n var serverError = status.toLowerCase().replace('_', '-');\r\n return Object.values(Code).indexOf(serverError) >= 0\r\n ? serverError\r\n : Code.UNKNOWN;\r\n}", "title": "" }, { "docid": "dd9d9f4a928567fa1aa01ea0386809b9", "score": "0.7626876", "text": "function mapCodeFromHttpResponseErrorStatus(status) {\n var serverError = status.toLowerCase().replace('_', '-');\n return Object.values(Code).indexOf(serverError) >= 0\n ? serverError\n : Code.UNKNOWN;\n}", "title": "" }, { "docid": "dd9d9f4a928567fa1aa01ea0386809b9", "score": "0.7626876", "text": "function mapCodeFromHttpResponseErrorStatus(status) {\n var serverError = status.toLowerCase().replace('_', '-');\n return Object.values(Code).indexOf(serverError) >= 0\n ? serverError\n : Code.UNKNOWN;\n}", "title": "" }, { "docid": "3ac2a4351d81755be76614742b36737c", "score": "0.7551331", "text": "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "3ac2a4351d81755be76614742b36737c", "score": "0.7551331", "text": "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "3ac2a4351d81755be76614742b36737c", "score": "0.7551331", "text": "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "3ac2a4351d81755be76614742b36737c", "score": "0.7551331", "text": "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "3ac2a4351d81755be76614742b36737c", "score": "0.7551331", "text": "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "c940216c6edaf10de3daab185ef4e737", "score": "0.75386137", "text": "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "6c7e9faf19558f88a9e25878a151e2b7", "score": "0.7414351", "text": "function mapCodeFromHttpStatus(status) {\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n // status codes but the mapping is not bijective. In each case of ambiguity\n // this function chooses a primary error.\n //\n // [1]\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n switch (status) {\n case 200:// OK\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK;\n case 400:// Bad Request\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT;\n // Other possibilities based on the forward mapping\n // return Code.FAILED_PRECONDITION;\n // return Code.OUT_OF_RANGE;\n case 401:// Unauthorized\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED;\n case 403:// Forbidden\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED;\n case 404:// Not Found\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND;\n case 409:// Conflict\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED;\n // Other possibilities:\n // return Code.ALREADY_EXISTS;\n case 416:// Range Not Satisfiable\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE;\n case 429:// Too Many Requests\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED;\n case 499:// Client Closed Request\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED;\n case 500:// Internal Server Error\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n // Other possibilities:\n // return Code.INTERNAL;\n // return Code.DATA_LOSS;\n case 501:// Unimplemented\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED;\n case 503:// Service Unavailable\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE;\n case 504:// Gateway Timeout\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED;\n default:\n if (status >= 200 && status < 300)\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK;\n if (status >= 400 && status < 500)\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION;\n if (status >= 500 && status < 600)\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL;\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n }\n}", "title": "" }, { "docid": "bb4a2a2a3a16f7bdd8aaa6e4e14fa517", "score": "0.7412636", "text": "function mapCodeFromHttpStatus(status) {\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n // status codes but the mapping is not bijective. In each case of ambiguity\n // this function chooses a primary error.\n //\n // [1]\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n switch (status) {\n case 200: // OK\n return Code.OK;\n case 400: // Bad Request\n return Code.INVALID_ARGUMENT;\n // Other possibilities based on the forward mapping\n // return Code.FAILED_PRECONDITION;\n // return Code.OUT_OF_RANGE;\n case 401: // Unauthorized\n return Code.UNAUTHENTICATED;\n case 403: // Forbidden\n return Code.PERMISSION_DENIED;\n case 404: // Not Found\n return Code.NOT_FOUND;\n case 409: // Conflict\n return Code.ABORTED;\n // Other possibilities:\n // return Code.ALREADY_EXISTS;\n case 416: // Range Not Satisfiable\n return Code.OUT_OF_RANGE;\n case 429: // Too Many Requests\n return Code.RESOURCE_EXHAUSTED;\n case 499: // Client Closed Request\n return Code.CANCELLED;\n case 500: // Internal Server Error\n return Code.UNKNOWN;\n // Other possibilities:\n // return Code.INTERNAL;\n // return Code.DATA_LOSS;\n case 501: // Unimplemented\n return Code.UNIMPLEMENTED;\n case 503: // Service Unavailable\n return Code.UNAVAILABLE;\n case 504: // Gateway Timeout\n return Code.DEADLINE_EXCEEDED;\n default:\n if (status >= 200 && status < 300)\n return Code.OK;\n if (status >= 400 && status < 500)\n return Code.FAILED_PRECONDITION;\n if (status >= 500 && status < 600)\n return Code.INTERNAL;\n return Code.UNKNOWN;\n }\n}", "title": "" }, { "docid": "bb4a2a2a3a16f7bdd8aaa6e4e14fa517", "score": "0.7412636", "text": "function mapCodeFromHttpStatus(status) {\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n // status codes but the mapping is not bijective. In each case of ambiguity\n // this function chooses a primary error.\n //\n // [1]\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n switch (status) {\n case 200: // OK\n return Code.OK;\n case 400: // Bad Request\n return Code.INVALID_ARGUMENT;\n // Other possibilities based on the forward mapping\n // return Code.FAILED_PRECONDITION;\n // return Code.OUT_OF_RANGE;\n case 401: // Unauthorized\n return Code.UNAUTHENTICATED;\n case 403: // Forbidden\n return Code.PERMISSION_DENIED;\n case 404: // Not Found\n return Code.NOT_FOUND;\n case 409: // Conflict\n return Code.ABORTED;\n // Other possibilities:\n // return Code.ALREADY_EXISTS;\n case 416: // Range Not Satisfiable\n return Code.OUT_OF_RANGE;\n case 429: // Too Many Requests\n return Code.RESOURCE_EXHAUSTED;\n case 499: // Client Closed Request\n return Code.CANCELLED;\n case 500: // Internal Server Error\n return Code.UNKNOWN;\n // Other possibilities:\n // return Code.INTERNAL;\n // return Code.DATA_LOSS;\n case 501: // Unimplemented\n return Code.UNIMPLEMENTED;\n case 503: // Service Unavailable\n return Code.UNAVAILABLE;\n case 504: // Gateway Timeout\n return Code.DEADLINE_EXCEEDED;\n default:\n if (status >= 200 && status < 300)\n return Code.OK;\n if (status >= 400 && status < 500)\n return Code.FAILED_PRECONDITION;\n if (status >= 500 && status < 600)\n return Code.INTERNAL;\n return Code.UNKNOWN;\n }\n}", "title": "" }, { "docid": "bb4a2a2a3a16f7bdd8aaa6e4e14fa517", "score": "0.7412636", "text": "function mapCodeFromHttpStatus(status) {\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n // status codes but the mapping is not bijective. In each case of ambiguity\n // this function chooses a primary error.\n //\n // [1]\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n switch (status) {\n case 200: // OK\n return Code.OK;\n case 400: // Bad Request\n return Code.INVALID_ARGUMENT;\n // Other possibilities based on the forward mapping\n // return Code.FAILED_PRECONDITION;\n // return Code.OUT_OF_RANGE;\n case 401: // Unauthorized\n return Code.UNAUTHENTICATED;\n case 403: // Forbidden\n return Code.PERMISSION_DENIED;\n case 404: // Not Found\n return Code.NOT_FOUND;\n case 409: // Conflict\n return Code.ABORTED;\n // Other possibilities:\n // return Code.ALREADY_EXISTS;\n case 416: // Range Not Satisfiable\n return Code.OUT_OF_RANGE;\n case 429: // Too Many Requests\n return Code.RESOURCE_EXHAUSTED;\n case 499: // Client Closed Request\n return Code.CANCELLED;\n case 500: // Internal Server Error\n return Code.UNKNOWN;\n // Other possibilities:\n // return Code.INTERNAL;\n // return Code.DATA_LOSS;\n case 501: // Unimplemented\n return Code.UNIMPLEMENTED;\n case 503: // Service Unavailable\n return Code.UNAVAILABLE;\n case 504: // Gateway Timeout\n return Code.DEADLINE_EXCEEDED;\n default:\n if (status >= 200 && status < 300)\n return Code.OK;\n if (status >= 400 && status < 500)\n return Code.FAILED_PRECONDITION;\n if (status >= 500 && status < 600)\n return Code.INTERNAL;\n return Code.UNKNOWN;\n }\n}", "title": "" }, { "docid": "bb4a2a2a3a16f7bdd8aaa6e4e14fa517", "score": "0.7412636", "text": "function mapCodeFromHttpStatus(status) {\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n // status codes but the mapping is not bijective. In each case of ambiguity\n // this function chooses a primary error.\n //\n // [1]\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n switch (status) {\n case 200: // OK\n return Code.OK;\n case 400: // Bad Request\n return Code.INVALID_ARGUMENT;\n // Other possibilities based on the forward mapping\n // return Code.FAILED_PRECONDITION;\n // return Code.OUT_OF_RANGE;\n case 401: // Unauthorized\n return Code.UNAUTHENTICATED;\n case 403: // Forbidden\n return Code.PERMISSION_DENIED;\n case 404: // Not Found\n return Code.NOT_FOUND;\n case 409: // Conflict\n return Code.ABORTED;\n // Other possibilities:\n // return Code.ALREADY_EXISTS;\n case 416: // Range Not Satisfiable\n return Code.OUT_OF_RANGE;\n case 429: // Too Many Requests\n return Code.RESOURCE_EXHAUSTED;\n case 499: // Client Closed Request\n return Code.CANCELLED;\n case 500: // Internal Server Error\n return Code.UNKNOWN;\n // Other possibilities:\n // return Code.INTERNAL;\n // return Code.DATA_LOSS;\n case 501: // Unimplemented\n return Code.UNIMPLEMENTED;\n case 503: // Service Unavailable\n return Code.UNAVAILABLE;\n case 504: // Gateway Timeout\n return Code.DEADLINE_EXCEEDED;\n default:\n if (status >= 200 && status < 300)\n return Code.OK;\n if (status >= 400 && status < 500)\n return Code.FAILED_PRECONDITION;\n if (status >= 500 && status < 600)\n return Code.INTERNAL;\n return Code.UNKNOWN;\n }\n}", "title": "" }, { "docid": "3a037669366662f1f974ef8f19c39d47", "score": "0.73969734", "text": "function mapCodeFromHttpStatus(status) {\r\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\r\n // status codes but the mapping is not bijective. In each case of ambiguity\r\n // this function chooses a primary error.\r\n //\r\n // [1]\r\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n switch (status) {\r\n case 200: // OK\r\n return Code.OK;\r\n case 400: // Bad Request\r\n return Code.INVALID_ARGUMENT;\r\n // Other possibilities based on the forward mapping\r\n // return Code.FAILED_PRECONDITION;\r\n // return Code.OUT_OF_RANGE;\r\n case 401: // Unauthorized\r\n return Code.UNAUTHENTICATED;\r\n case 403: // Forbidden\r\n return Code.PERMISSION_DENIED;\r\n case 404: // Not Found\r\n return Code.NOT_FOUND;\r\n case 409: // Conflict\r\n return Code.ABORTED;\r\n // Other possibilities:\r\n // return Code.ALREADY_EXISTS;\r\n case 416: // Range Not Satisfiable\r\n return Code.OUT_OF_RANGE;\r\n case 429: // Too Many Requests\r\n return Code.RESOURCE_EXHAUSTED;\r\n case 499: // Client Closed Request\r\n return Code.CANCELLED;\r\n case 500: // Internal Server Error\r\n return Code.UNKNOWN;\r\n // Other possibilities:\r\n // return Code.INTERNAL;\r\n // return Code.DATA_LOSS;\r\n case 501: // Unimplemented\r\n return Code.UNIMPLEMENTED;\r\n case 503: // Service Unavailable\r\n return Code.UNAVAILABLE;\r\n case 504: // Gateway Timeout\r\n return Code.DEADLINE_EXCEEDED;\r\n default:\r\n if (status >= 200 && status < 300)\r\n return Code.OK;\r\n if (status >= 400 && status < 500)\r\n return Code.FAILED_PRECONDITION;\r\n if (status >= 500 && status < 600)\r\n return Code.INTERNAL;\r\n return Code.UNKNOWN;\r\n }\r\n}", "title": "" }, { "docid": "3a037669366662f1f974ef8f19c39d47", "score": "0.73969734", "text": "function mapCodeFromHttpStatus(status) {\r\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\r\n // status codes but the mapping is not bijective. In each case of ambiguity\r\n // this function chooses a primary error.\r\n //\r\n // [1]\r\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n switch (status) {\r\n case 200: // OK\r\n return Code.OK;\r\n case 400: // Bad Request\r\n return Code.INVALID_ARGUMENT;\r\n // Other possibilities based on the forward mapping\r\n // return Code.FAILED_PRECONDITION;\r\n // return Code.OUT_OF_RANGE;\r\n case 401: // Unauthorized\r\n return Code.UNAUTHENTICATED;\r\n case 403: // Forbidden\r\n return Code.PERMISSION_DENIED;\r\n case 404: // Not Found\r\n return Code.NOT_FOUND;\r\n case 409: // Conflict\r\n return Code.ABORTED;\r\n // Other possibilities:\r\n // return Code.ALREADY_EXISTS;\r\n case 416: // Range Not Satisfiable\r\n return Code.OUT_OF_RANGE;\r\n case 429: // Too Many Requests\r\n return Code.RESOURCE_EXHAUSTED;\r\n case 499: // Client Closed Request\r\n return Code.CANCELLED;\r\n case 500: // Internal Server Error\r\n return Code.UNKNOWN;\r\n // Other possibilities:\r\n // return Code.INTERNAL;\r\n // return Code.DATA_LOSS;\r\n case 501: // Unimplemented\r\n return Code.UNIMPLEMENTED;\r\n case 503: // Service Unavailable\r\n return Code.UNAVAILABLE;\r\n case 504: // Gateway Timeout\r\n return Code.DEADLINE_EXCEEDED;\r\n default:\r\n if (status >= 200 && status < 300)\r\n return Code.OK;\r\n if (status >= 400 && status < 500)\r\n return Code.FAILED_PRECONDITION;\r\n if (status >= 500 && status < 600)\r\n return Code.INTERNAL;\r\n return Code.UNKNOWN;\r\n }\r\n}", "title": "" }, { "docid": "3a037669366662f1f974ef8f19c39d47", "score": "0.73969734", "text": "function mapCodeFromHttpStatus(status) {\r\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\r\n // status codes but the mapping is not bijective. In each case of ambiguity\r\n // this function chooses a primary error.\r\n //\r\n // [1]\r\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n switch (status) {\r\n case 200: // OK\r\n return Code.OK;\r\n case 400: // Bad Request\r\n return Code.INVALID_ARGUMENT;\r\n // Other possibilities based on the forward mapping\r\n // return Code.FAILED_PRECONDITION;\r\n // return Code.OUT_OF_RANGE;\r\n case 401: // Unauthorized\r\n return Code.UNAUTHENTICATED;\r\n case 403: // Forbidden\r\n return Code.PERMISSION_DENIED;\r\n case 404: // Not Found\r\n return Code.NOT_FOUND;\r\n case 409: // Conflict\r\n return Code.ABORTED;\r\n // Other possibilities:\r\n // return Code.ALREADY_EXISTS;\r\n case 416: // Range Not Satisfiable\r\n return Code.OUT_OF_RANGE;\r\n case 429: // Too Many Requests\r\n return Code.RESOURCE_EXHAUSTED;\r\n case 499: // Client Closed Request\r\n return Code.CANCELLED;\r\n case 500: // Internal Server Error\r\n return Code.UNKNOWN;\r\n // Other possibilities:\r\n // return Code.INTERNAL;\r\n // return Code.DATA_LOSS;\r\n case 501: // Unimplemented\r\n return Code.UNIMPLEMENTED;\r\n case 503: // Service Unavailable\r\n return Code.UNAVAILABLE;\r\n case 504: // Gateway Timeout\r\n return Code.DEADLINE_EXCEEDED;\r\n default:\r\n if (status >= 200 && status < 300)\r\n return Code.OK;\r\n if (status >= 400 && status < 500)\r\n return Code.FAILED_PRECONDITION;\r\n if (status >= 500 && status < 600)\r\n return Code.INTERNAL;\r\n return Code.UNKNOWN;\r\n }\r\n}", "title": "" }, { "docid": "3a037669366662f1f974ef8f19c39d47", "score": "0.73969734", "text": "function mapCodeFromHttpStatus(status) {\r\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\r\n // status codes but the mapping is not bijective. In each case of ambiguity\r\n // this function chooses a primary error.\r\n //\r\n // [1]\r\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n switch (status) {\r\n case 200: // OK\r\n return Code.OK;\r\n case 400: // Bad Request\r\n return Code.INVALID_ARGUMENT;\r\n // Other possibilities based on the forward mapping\r\n // return Code.FAILED_PRECONDITION;\r\n // return Code.OUT_OF_RANGE;\r\n case 401: // Unauthorized\r\n return Code.UNAUTHENTICATED;\r\n case 403: // Forbidden\r\n return Code.PERMISSION_DENIED;\r\n case 404: // Not Found\r\n return Code.NOT_FOUND;\r\n case 409: // Conflict\r\n return Code.ABORTED;\r\n // Other possibilities:\r\n // return Code.ALREADY_EXISTS;\r\n case 416: // Range Not Satisfiable\r\n return Code.OUT_OF_RANGE;\r\n case 429: // Too Many Requests\r\n return Code.RESOURCE_EXHAUSTED;\r\n case 499: // Client Closed Request\r\n return Code.CANCELLED;\r\n case 500: // Internal Server Error\r\n return Code.UNKNOWN;\r\n // Other possibilities:\r\n // return Code.INTERNAL;\r\n // return Code.DATA_LOSS;\r\n case 501: // Unimplemented\r\n return Code.UNIMPLEMENTED;\r\n case 503: // Service Unavailable\r\n return Code.UNAVAILABLE;\r\n case 504: // Gateway Timeout\r\n return Code.DEADLINE_EXCEEDED;\r\n default:\r\n if (status >= 200 && status < 300)\r\n return Code.OK;\r\n if (status >= 400 && status < 500)\r\n return Code.FAILED_PRECONDITION;\r\n if (status >= 500 && status < 600)\r\n return Code.INTERNAL;\r\n return Code.UNKNOWN;\r\n }\r\n}", "title": "" }, { "docid": "e597861fbc7ff868bb8c7ec3fc3e5e4b", "score": "0.72964746", "text": "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "e597861fbc7ff868bb8c7ec3fc3e5e4b", "score": "0.72964746", "text": "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "e597861fbc7ff868bb8c7ec3fc3e5e4b", "score": "0.72964746", "text": "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "e597861fbc7ff868bb8c7ec3fc3e5e4b", "score": "0.72964746", "text": "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "e597861fbc7ff868bb8c7ec3fc3e5e4b", "score": "0.72964746", "text": "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "ddfe6eb02b5fa6cd73a60e65fa8fad66", "score": "0.7274743", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "554b68c9cd30b8fa2abcb5c6d50cc87c", "score": "0.7236448", "text": "function mapError(err,codeError) {\n return err.isDomain\n ? {\n\tcode: codeError,\n\tmessage: err.message\n }\n : {\n\tcode: codeError,\n\tmessage: err.toString().replace(\"NOT_FOUND:\",\"\")\n };\n}", "title": "" }, { "docid": "9f7117193ea2b11d846570e71f0c06f3", "score": "0.70058656", "text": "function createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}", "title": "" }, { "docid": "685266c6e905e3a4178cd0de65e1cca3", "score": "0.6823766", "text": "function mapError(err) {\n console.error(err);\n return err.isDomain\n ? { status: (ERROR_MAP[err.errorCode] || BAD_REQUEST),\n\tcode: err.errorCode,\n\tmessage: err.message\n }\n : { status: SERVER_ERROR,\n\tcode: 'INTERNAL',\n\tmessage: err.toString()\n };\n}", "title": "" }, { "docid": "685266c6e905e3a4178cd0de65e1cca3", "score": "0.6823766", "text": "function mapError(err) {\n console.error(err);\n return err.isDomain\n ? { status: (ERROR_MAP[err.errorCode] || BAD_REQUEST),\n\tcode: err.errorCode,\n\tmessage: err.message\n }\n : { status: SERVER_ERROR,\n\tcode: 'INTERNAL',\n\tmessage: err.toString()\n };\n}", "title": "" }, { "docid": "e5ec8f0d58cd79263493b0d2393b34f9", "score": "0.68123454", "text": "function mapError(err) {\n //console.error(err);\n\n if (err.code === 'NOT_FOUND') {\n return {\n code: 'NOT_FOUND',\n message: err.message\n }\n }\n\n if(err.code === 'BAD_PARAM') {\n return {\n code: 'BAD_PARAM',\n message: err.message\n }\n }\n\n return err.isDomain\n ? { status: (ERROR_MAP[err.errorCode] || BAD_REQUEST),\n code: err.errorCode,\n message: err.message\n }\n : { status: SERVER_ERROR,\n code: 'INTERNAL',\n message: err.toString()\n };\n}", "title": "" }, { "docid": "c0c36d06426ae30ddb6c4c117d993ed2", "score": "0.6794729", "text": "function codeConverter (code) {\n let errorCodes = [\"unknown error\", \"permission denied\", \"position unavailable\", \"timed out\"];\n\n for (let errorCode of errorCodes ){\n if(code === errorCodes.indexOf(errorCode)){\n return errorCodes[errorCodes.indexOf(errorCode)];\n }\n }\n}", "title": "" }, { "docid": "9459612d140e8ff194eb3edb9316e232", "score": "0.6767286", "text": "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK:\n return RpcCode.OK;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED:\n return RpcCode.CANCELLED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN:\n return RpcCode.UNKNOWN;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL:\n return RpcCode.INTERNAL;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED:\n return RpcCode.ABORTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "title": "" }, { "docid": "d13b597acd7cbf0252212adbb2bffbfe", "score": "0.67450666", "text": "function errorFromStatusCode(status) {\n var error = null\n if (status === 0 || (status >= 400 && status < 600)) {\n var message = (typeof body === \"string\" ? body : false) ||\n messages[String(status).charAt(0)]\n error = new Error(message)\n error.statusCode = status\n }\n\n return error\n }", "title": "" }, { "docid": "d13b597acd7cbf0252212adbb2bffbfe", "score": "0.67450666", "text": "function errorFromStatusCode(status) {\n var error = null\n if (status === 0 || (status >= 400 && status < 600)) {\n var message = (typeof body === \"string\" ? body : false) ||\n messages[String(status).charAt(0)]\n error = new Error(message)\n error.statusCode = status\n }\n\n return error\n }", "title": "" }, { "docid": "d13b597acd7cbf0252212adbb2bffbfe", "score": "0.67450666", "text": "function errorFromStatusCode(status) {\n var error = null\n if (status === 0 || (status >= 400 && status < 600)) {\n var message = (typeof body === \"string\" ? body : false) ||\n messages[String(status).charAt(0)]\n error = new Error(message)\n error.statusCode = status\n }\n\n return error\n }", "title": "" }, { "docid": "1d950cd0e8249a573dc518ff8c9e4cb2", "score": "0.6587527", "text": "function r(e){if(\"number\"==typeof e){if(!r[e])throw new Error(\"invalid status code: \"+e);return e}if(\"string\"!=typeof e)throw new TypeError(\"code must be a number or string\");var t=parseInt(e,10);if(!isNaN(t)){if(!r[t])throw new Error(\"invalid status code: \"+t);return t}if(t=r[e.toLowerCase()],!t)throw new Error(\"invalid status message: \\\"\"+e+\"\\\"\");return t}", "title": "" }, { "docid": "367f77de88c2d0aecb6447a63ce755a7", "score": "0.65822595", "text": "function getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}", "title": "" }, { "docid": "2fa173ea29ed006aba146b70223c102d", "score": "0.6511974", "text": "function errorFromStatusCode(status, body) {\n var error = null\n if (status === 0 || (status >= 400 && status < 600)) {\n var message = (typeof body === \"string\" ? body : false) ||\n messages[String(status).charAt(0)]\n error = new Error(message)\n error.statusCode = status\n }\n\n return error\n }", "title": "" }, { "docid": "2fa173ea29ed006aba146b70223c102d", "score": "0.6511974", "text": "function errorFromStatusCode(status, body) {\n var error = null\n if (status === 0 || (status >= 400 && status < 600)) {\n var message = (typeof body === \"string\" ? body : false) ||\n messages[String(status).charAt(0)]\n error = new Error(message)\n error.statusCode = status\n }\n\n return error\n }", "title": "" }, { "docid": "a19c70062385738bcd5b50f7a8f36b2b", "score": "0.6510677", "text": "function createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}", "title": "" }, { "docid": "496fc7297a1ef4a6b47823ae93afff22", "score": "0.6380268", "text": "function mapError(err) {\n const isDomainError = (err instanceof AppError);\n const status =\n isDomainError ? (ERROR_MAP[err.code] || BAD_REQUEST) : SERVER_ERROR;\n const error = \n\tisDomainError\n\t? { code: err.code, message: err.message } \n : { code: 'SERVER_ERROR', message: err.toString() };\n if (!isDomainError) console.error(err);\n return { status, error };\n}", "title": "" }, { "docid": "22bdfc242791972c80a3b995954d580b", "score": "0.6378312", "text": "function readResponseCode(int) {\n const codes = {\n 0: [`Success! Returned results successfully. ${int}`, 200],\n 1: [`No Results! Could not return results. The API doesn't have enough questions for your query. (Ex. Asking for 50 Questions in a Category that only has 20.) ${int}`, 400],\n 2: [`Invalid Parameter! Contains an invalid parameter. Arguments passed in aren't valid. (Ex. Amount = Five) ${int}`, 400],\n 3: [`Token Not Found! Session Token does not exist. ${int}`, 400],\n 4: [`Token Empty Session! Token has returned all possible questions for the specified query. Resetting the Token is necessary. ${int}`, 418], // shouldn't happen.\n }\n const err = codes[int]\n if (int !== 0) throw new ExpressError(...err)\n}", "title": "" }, { "docid": "eda3ec625dff0988ab0455756147f56b", "score": "0.63744277", "text": "getCode() { return 404; }", "title": "" }, { "docid": "0ddcbd79f796211dc5ba5fe1fb3abd04", "score": "0.6353173", "text": "getCode() { return 409; }", "title": "" }, { "docid": "0e7a1191148999422cd42e3764a2152f", "score": "0.6341153", "text": "getCode() { return 400; }", "title": "" }, { "docid": "e4d0a8a7255f6b377a2e671ebe7cd7fd", "score": "0.63343996", "text": "function mapCodeFromRpcStatus(status) {\r\n // lookup by string\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}", "title": "" }, { "docid": "a27f3298c9defb16d8178db55f47fce0", "score": "0.6328063", "text": "function getValidHttpErrorCode (err) {\n var errorCode\n if (err.code && String(err.code).match(/[1-5][0-5][0-9]$/)) {\n errorCode = parseInt(err.code)\n } else {\n errorCode = 500\n }\n return errorCode\n}", "title": "" }, { "docid": "172fcc03f6cd996ee52bbe281aa4ed7d", "score": "0.6298678", "text": "function mapCodeFromRpcStatus(status) {\r\n // tslint:disable-next-line:no-any lookup by string\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}", "title": "" }, { "docid": "172fcc03f6cd996ee52bbe281aa4ed7d", "score": "0.6298678", "text": "function mapCodeFromRpcStatus(status) {\r\n // tslint:disable-next-line:no-any lookup by string\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}", "title": "" }, { "docid": "172fcc03f6cd996ee52bbe281aa4ed7d", "score": "0.6298678", "text": "function mapCodeFromRpcStatus(status) {\r\n // tslint:disable-next-line:no-any lookup by string\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}", "title": "" }, { "docid": "172fcc03f6cd996ee52bbe281aa4ed7d", "score": "0.6298678", "text": "function mapCodeFromRpcStatus(status) {\r\n // tslint:disable-next-line:no-any lookup by string\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}", "title": "" }, { "docid": "70be64a24d7139afa49a09c040442a01", "score": "0.6295676", "text": "function mapCodeFromRpcStatus(status) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "70be64a24d7139afa49a09c040442a01", "score": "0.6295676", "text": "function mapCodeFromRpcStatus(status) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "c8642ff6a4bbc9c02dfa9e66a63fa23b", "score": "0.628884", "text": "function getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}", "title": "" }, { "docid": "de33589a2e616e28906f5d72e8c38fd3", "score": "0.62792015", "text": "function mapCodeFromRpcStatus(status) {\n // tslint:disable-next-line:no-any lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "de33589a2e616e28906f5d72e8c38fd3", "score": "0.62792015", "text": "function mapCodeFromRpcStatus(status) {\n // tslint:disable-next-line:no-any lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "de33589a2e616e28906f5d72e8c38fd3", "score": "0.62792015", "text": "function mapCodeFromRpcStatus(status) {\n // tslint:disable-next-line:no-any lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "de33589a2e616e28906f5d72e8c38fd3", "score": "0.62792015", "text": "function mapCodeFromRpcStatus(status) {\n // tslint:disable-next-line:no-any lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "de33589a2e616e28906f5d72e8c38fd3", "score": "0.62792015", "text": "function mapCodeFromRpcStatus(status) {\n // tslint:disable-next-line:no-any lookup by string\n var code = RpcCode[status];\n if (code === undefined) {\n return undefined;\n }\n return mapCodeFromRpcCode(code);\n}", "title": "" }, { "docid": "4eb15c276d1d4c7688d41ccbfdcaf0b8", "score": "0.6237125", "text": "function get_code(req, res) {\n\t\tif (req._client_event === true && req.body) {\n\t\t\treturn !isNaN(req.body.http_code) ? Number(req.body.http_code) : 500;\n\t\t} else {\n\t\t\treturn t.ot_misc.get_code(res);\t\t\t\t\t\t\t\t// normal requests end up here\n\t\t}\n\t}", "title": "" }, { "docid": "bc7e203f6dd56c1f81099ecb86d76551", "score": "0.6185966", "text": "function translateErrorStatusCodeToString(statusCode){\n // if(statusCode===400){\n // return \"Please fill in all fields.\"\n // } else if(statusCode===401){\n // return \"Unauthorized.\"\n // } else if(statusCode===422){\n // return \"This song already exists.\"\n // } else {\n // return \"Something has gone wrong. Please try again later.\"\n // }\n}", "title": "" }, { "docid": "cafc11917a7f096a932f4aae8f6e5244", "score": "0.6180012", "text": "function status(code) {\n switch(code) {\n case 0:\n return \"Incomplete\";\n break;\n case 1:\n return \"Pending\";\n break;\n case 2:\n return \"Shipped\";\n break;\n case 3:\n return \"Partially_Shipped\";\n break;\n case 4:\n return \"Refunded\";\n break;\n case 5:\n return \"Cancelled\";\n break;\n case 6:\n return \"Declined\";\n break;\n case 7:\n return \"Awaiting_Payment\";\n break;\n case 8:\n return \"Awaiting_Pickup\";\n break;\n case 9:\n return \"Awaiting_Shipment\";\n break;\n case 10:\n return \"Completed\";\n break;\n case 11:\n return \"Awaiting_Fulfillment\";\n break;\n case 12:\n return \"Manual_Verification_Required\";\n break;\n case 13:\n return \"Disputed\";\n break;\n default:\n return \"unknown\";\n }\n}", "title": "" }, { "docid": "666c5e6ec25ff87e17890df39580d783", "score": "0.6171217", "text": "function getErrorNameFromStatusCode(statusCode) {\n statusCode = parseInt(statusCode, 10);\n var status = http.STATUS_CODES[statusCode];\n if (!status) { return false; }\n\n var name = '';\n var words = status.split(/\\s+/);\n words.forEach(function(w) {\n name += w.charAt(0).toUpperCase() + w.slice(1).toLowerCase();\n });\n\n name = name.replace(/\\W+/g, '');\n\n if (!/\\w+Error$/.test(name)) {\n name += 'Error';\n }\n return name;\n}", "title": "" }, { "docid": "706e1ba8bc4caab37085248fb43010c2", "score": "0.6146299", "text": "function createStatusCodeError(statusCode) {\n return Object.assign(new Error(), {\n statusCode\n });\n}", "title": "" }, { "docid": "ce359332b73e82d8d490d8739e38274b", "score": "0.61137235", "text": "function createStatusCodeError(statusCode) {\n return Object.assign(new Error(), {\n statusCode\n });\n}", "title": "" }, { "docid": "ebc58faafd48e2fb90a123eab72d59e2", "score": "0.6099153", "text": "getCode() { return 422; }", "title": "" }, { "docid": "001e24cab1d9c16901788ca3bab77329", "score": "0.6049132", "text": "function mapError(err) {\n console.error(err);\n return (err instanceof Array && err.length > 0 && err[0] instanceof BlogError)\n ? { status: (ERROR_MAP[err[0].code] || BAD_REQUEST),\n\tcode: err[0].code,\n\tmessage: err.map(e => e.message).join('; '),\n }\n : { status: SERVER_ERROR,\n\tcode: 'INTERNAL',\n\tmessage: err.toString()\n };\n}", "title": "" }, { "docid": "9b017cfcafeb450a92a11640a93d0f8e", "score": "0.60359246", "text": "function mapError(err) {\n const isDomainError =\n (err instanceof Array && err.length > 0 && err[0] instanceof ModelError);\n const status =\n isDomainError ? (ERROR_MAP[err[0].code] || BAD_REQUEST) : SERVER_ERROR;\n const errors =\n\tisDomainError\n\t? err.map(e => ({ code: e.code, message: e.message, name: e.name }))\n : [ { code: 'SERVER_ERROR', message: err.toString(), } ];\n if (!isDomainError) console.error(err);\n return { status, errors };\n}", "title": "" }, { "docid": "b553bfba4ebd2cf24ee47aad6db58262", "score": "0.60025537", "text": "function o(e){if('number'==typeof e){if(!o[e])throw new Error('invalid status code: '+e);return e}if('string'!=typeof e)throw new TypeError('code must be a number or string');var t=parseInt(e,10);if(!isNaN(t)){if(!o[t])throw new Error('invalid status code: '+t);return t}if(t=o[e.toLowerCase()],!t)throw new Error('invalid status message: \"'+e+'\"');return t}", "title": "" }, { "docid": "0416e4dde6182a74eb06c299c2452fb8", "score": "0.5984641", "text": "function status (code) {\n this.statusCode = code\n return this\n}", "title": "" }, { "docid": "0416e4dde6182a74eb06c299c2452fb8", "score": "0.5984641", "text": "function status (code) {\n this.statusCode = code\n return this\n}", "title": "" }, { "docid": "22d69e372bf524171775c7eb7ca77e75", "score": "0.5952642", "text": "get statusAsCode() {\n return this._cancerProgression.value.coding[0].code.value;\n }", "title": "" }, { "docid": "c66780611f52a11602c9e23af8291c16", "score": "0.5942797", "text": "constructor(code, message) {\n this.statusCode = code;\n this.description = message;\n }", "title": "" }, { "docid": "76548e15d27b19f5b7d286ec4cc7f2ee", "score": "0.5913069", "text": "function HttpError(code, message) {\n this.code = code || 0\n this.message = message || ''\n}", "title": "" }, { "docid": "c3691c08f926b6c9118fa3b7e4bad1ea", "score": "0.58898056", "text": "function translateErrorStatusCodeToString(statusCode){\n if(statusCode===400){\n return \"Please fill in all fields.\"\n } else if(statusCode===401){\n return \"This combination of username and password don't match.\"\n } else if(statusCode===422){\n return \"This username already exists.\"\n } else {\n return \"Something has gone wrong. Please try again later.\"\n }\n}", "title": "" }, { "docid": "c3691c08f926b6c9118fa3b7e4bad1ea", "score": "0.58898056", "text": "function translateErrorStatusCodeToString(statusCode){\n if(statusCode===400){\n return \"Please fill in all fields.\"\n } else if(statusCode===401){\n return \"This combination of username and password don't match.\"\n } else if(statusCode===422){\n return \"This username already exists.\"\n } else {\n return \"Something has gone wrong. Please try again later.\"\n }\n}", "title": "" }, { "docid": "7da5ca99ec7ae6bd06a74082f2afda1d", "score": "0.5860107", "text": "getStatusCode() {}", "title": "" }, { "docid": "203c7a52ff15cef8b31490da67f7a47b", "score": "0.5839364", "text": "function setErrorStatus(error,status){if(!error.status && !error.statusCode){error.status = status;error.statusCode = status;}}", "title": "" }, { "docid": "e0aed4abb2cea251126a691fdeb7d1dc", "score": "0.58296674", "text": "function getErrorCode (response: Response): number {\n if (response.status === 'fail') {\n return response.errorCode;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "5e88a28df3c69e7c02a3e37cee747aaa", "score": "0.5829336", "text": "get httpCode()\n {\n this._ensureAlive();\n\n var codeString = (this._httpCode < 10 ? '0' : '') +\n (this._httpCode < 100 ? '0' : '') +\n this._httpCode;\n return codeString;\n }", "title": "" }, { "docid": "efad08e9c0190b732bba9b81d56089f2", "score": "0.5826294", "text": "function check_error_code(err, code) {\n return err.code === code || err.Code === code;\n}", "title": "" }, { "docid": "3df1a5cfbb7ba829bfa59fe71fe71197", "score": "0.58163667", "text": "async function testStatusCode(opts, expectedCode, cb) {\n try {\n const result = await server.inject(opts);\n expect(result.statusCode).toBe(expectedCode)\n cb(result);\n } catch (err) {\n cb(null, err);\n }\n}", "title": "" }, { "docid": "224c51813ec7f094020f777509fa9198", "score": "0.58162194", "text": "error(message, code) {\n return {\n error: {\n message: message,\n code: code,\n },\n };\n }", "title": "" }, { "docid": "13d989c99458538b842086b138d81e6a", "score": "0.57893866", "text": "function DisplayStatus(code) {\n switch (code) {\n case 2:\n InvalidStatus(\"Operation Failed\");\n break;\n case 4:\n InvalidStatus(\"IP/Username already exists in the database\");\n break;\n case 10:\n SuccessStatus(\"System updated successfully\");\n break;\n case 11:\n InvalidStatus(\"You have reached the Maximum User Limit\");\n break;\n case 12:\n InvalidStatus(\"You have entered an invalid email to the system\");\n break;\n default:\n return -1;\n }\n}", "title": "" }, { "docid": "3ce8ab19289cf0424e4cdff16bccff1c", "score": "0.57872987", "text": "function getErrorCodeExplanation(code) {\n const explanation = ERROR_EXPLANATIONS[code];\n if (explanation != null) {\n return explanation;\n } else if (code <= 0x00300) {\n return 'RESERVED (PROTOCOL)';\n } else {\n return 'RESERVED (APPLICATION)';\n }\n}", "title": "" }, { "docid": "a4ba245a24717815dd03adcd7950df80", "score": "0.5784789", "text": "getCode() { return 401; }", "title": "" }, { "docid": "e31ee282e636715a9ac4b7ad3aab713b", "score": "0.57746583", "text": "function setResponseError(res, message, code){\n res.statusMessage = message;\n res.status(code);\n}", "title": "" }, { "docid": "0ad2b7cd77dfd5e3cf505b2855bdb3e7", "score": "0.5761216", "text": "function GetErrorCode(code) {\n $.getJSON(url + \"/h5/assets/json/errcode.json\", function (response) {\n $.each(response, function (i, val) {\n if (response[i].code_key == code) {\n layer.msg('<p class=\"i18n\" name=\"' + code + '\">' + response[i].code_value + '</p>');\n execI18n();\n }\n })\n })\n}", "title": "" }, { "docid": "2b89d6d7ee9f696aff8d49dc6208f8b0", "score": "0.57591", "text": "function getErrorCodeExplanation(\n code\n) {\n const explanation = ERROR_EXPLANATIONS[code];\n if (explanation != null) {\n return explanation;\n } else if (code <= 0x00300) {\n return 'RESERVED (PROTOCOL)';\n } else {\n return 'RESERVED (APPLICATION)';\n }\n}", "title": "" }, { "docid": "2b89d6d7ee9f696aff8d49dc6208f8b0", "score": "0.57591", "text": "function getErrorCodeExplanation(\n code\n) {\n const explanation = ERROR_EXPLANATIONS[code];\n if (explanation != null) {\n return explanation;\n } else if (code <= 0x00300) {\n return 'RESERVED (PROTOCOL)';\n } else {\n return 'RESERVED (APPLICATION)';\n }\n}", "title": "" }, { "docid": "81e4b71f739da978b7df20a227eaa615", "score": "0.57485455", "text": "para (código en el mapa) {\n\t\t\t\t\t\t\t\tstatusCode [código] = [statusCode [código], mapa [código]];\n\t\t\t\t\t\t\t}", "title": "" } ]
8911f1d56d0e90443eaa905962a99380
COMPARE 2 TURNS AND CHECK IF THEY ARE THE SAME OR NOT
[ { "docid": "28334c971bac352110966e9599b2d75c", "score": "0.0", "text": "isPrevious(turn) {\n return JSON.stringify(JSON.stringify(Array.from(this.stateAfter))) === JSON.stringify(JSON.stringify(Array.from(turn.stateBefore)))\n }", "title": "" } ]
[ { "docid": "18f998a9f001080399e0cf8f094c834d", "score": "0.6982244", "text": "function Combat_attaquePossible (Territoire1,Territoire2) {\r\n var voisin = Combat_estVoisin(Territoire1,Territoire2) ;\r\n var assezArmees = (Territoire1.army > 1) ;\r\n var voisinsDifferents = (Territoire1.proprietaire != Territoire2.proprietaire);\r\n if (voisin && assezArmees && voisinsDifferents){\r\n return true\r\n }\r\n else {\r\n return false\r\n }\r\n}", "title": "" }, { "docid": "01024ccf52c02eb1374d841630eb2e68", "score": "0.67746496", "text": "static equalTrans(ta, tb) {\n//----------\nreturn ta[0] === tb[0] && ta[1] === tb[1] && ta[2] === tb[2];\n}", "title": "" }, { "docid": "bdb7c9286bafec6c3d9b7ae5dd5caad5", "score": "0.6592846", "text": "function compareT () {\n\n return false\n\n}", "title": "" }, { "docid": "e9976a7b7cc889695d1db4693e95037f", "score": "0.6568913", "text": "function test(t1,t2){\n if (t1 === t2) {\n console.log(true);\n }\n else {\n console.log(false);}\n }", "title": "" }, { "docid": "a6df5563efdb094a8b46e13b37d19f30", "score": "0.6509755", "text": "function notEqual(first, second){\n if(first !== second){\n return 'Opposites do attract.'\n }else{\n return \"Cause it's like you're my mirror.\"\n }\n}", "title": "" }, { "docid": "55447b9f0cecb6c352b9b9100278d612", "score": "0.648137", "text": "function test(t1,t2){\n if (t1===t2) {\n console.log(true);\n }else {console.log(false);}\n}", "title": "" }, { "docid": "4dc8b001edc7fbc9eb3b6195092f8f37", "score": "0.6477343", "text": "function compare() {\n countdown('end');\n //roundDone = true;\n //tick(roundDone);\n var winner = true;\n for (i=0;i<simonSaid.length;i++) {\n if (simonSaid[i] !== playerResponse[i]) {\n winner = false;\n }\n }\n return winner;\n }", "title": "" }, { "docid": "f847da2da1471b500151ac13d50252e7", "score": "0.6431498", "text": "function _compareTriples(t1, t2) {\n // compare subject and object types first as it is the quickest check\n if (!(t1.subject.termType === t2.subject.termType && t1.object.termType === t2.object.termType)) {\n return false;\n }\n // compare values\n if (!(t1.subject.value === t2.subject.value && t1.predicate.value === t2.predicate.value && t1.object.value === t2.object.value)) {\n return false;\n }\n if (t1.object.termType !== TYPE_LITERAL) {\n // no `datatype` or `language` to check\n return true;\n }\n return t1.object.datatype.termType === t2.object.datatype.termType && t1.object.language === t2.object.language && t1.object.datatype.value === t2.object.datatype.value;\n}", "title": "" }, { "docid": "c3751d7d8691756702792c760538c940", "score": "0.63741064", "text": "function same (a, b) {\n\t return a === b || a !== a && b !== b\n\t}", "title": "" }, { "docid": "9102c9cbd6f25c5fe053853f097fb5fd", "score": "0.63014174", "text": "tableauCompatible(card1, card2) {\n let samePolarity = (card1.rank % 2) == (card2.rank % 2);\n let sameColor = this.sameColor(card1, card2);\n //console.log('TC ', card1, card2, samePolarity, sameColor);\n return samePolarity == sameColor;\n }", "title": "" }, { "docid": "32cdb241171d46d2e1ba0190454f5bf3", "score": "0.62943417", "text": "function isEquals() {\n return reponse == nb2;\n}", "title": "" }, { "docid": "119fba4cdc9bb3c5b1d1f300f3823b4e", "score": "0.6291321", "text": "function compra(trab1, trab2) {\n const compraSorvete = trab1 || trab2\n const compraTv = trab1 && trab2\n //const comprarTv32 = !!(trab1 ^ trab2)\n const manterSaudavel = !compraSorvete\n const compraTv32 = trab1 != trab2\n return {\n compraSorvete,\n compraTv,\n compraTv32,\n manterSaudavel\n }\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "b2e3d193dae470d9165c1118d3694fb2", "score": "0.628884", "text": "function same (a, b) {\n return a === b || a !== a && b !== b\n}", "title": "" }, { "docid": "e765fe7d54f3c1c29d7e8125b97fe5b8", "score": "0.6226695", "text": "function _compareRDFTriples(t1, t2) {\n var attrs = ['subject', 'predicate', 'object'];\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) {\n return false;\n }\n }\n if(t1.object.language !== t2.object.language) {\n return false;\n }\n if(t1.object.datatype !== t2.object.datatype) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e765fe7d54f3c1c29d7e8125b97fe5b8", "score": "0.6226695", "text": "function _compareRDFTriples(t1, t2) {\n var attrs = ['subject', 'predicate', 'object'];\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) {\n return false;\n }\n }\n if(t1.object.language !== t2.object.language) {\n return false;\n }\n if(t1.object.datatype !== t2.object.datatype) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e765fe7d54f3c1c29d7e8125b97fe5b8", "score": "0.6226695", "text": "function _compareRDFTriples(t1, t2) {\n var attrs = ['subject', 'predicate', 'object'];\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) {\n return false;\n }\n }\n if(t1.object.language !== t2.object.language) {\n return false;\n }\n if(t1.object.datatype !== t2.object.datatype) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e765fe7d54f3c1c29d7e8125b97fe5b8", "score": "0.6226695", "text": "function _compareRDFTriples(t1, t2) {\n var attrs = ['subject', 'predicate', 'object'];\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) {\n return false;\n }\n }\n if(t1.object.language !== t2.object.language) {\n return false;\n }\n if(t1.object.datatype !== t2.object.datatype) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e765fe7d54f3c1c29d7e8125b97fe5b8", "score": "0.6226695", "text": "function _compareRDFTriples(t1, t2) {\n var attrs = ['subject', 'predicate', 'object'];\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) {\n return false;\n }\n }\n if(t1.object.language !== t2.object.language) {\n return false;\n }\n if(t1.object.datatype !== t2.object.datatype) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "91aaefcdd1b6c10cbda9f76ac3e700f5", "score": "0.6216562", "text": "function same(a, b) {\n return a === b || a !== a && b !== b;\n}", "title": "" }, { "docid": "8a6faa5e7529233dd2218f493375a150", "score": "0.61983573", "text": "function areEqual(inp1, inp2) {\n return inp1 == inp2;\n }", "title": "" }, { "docid": "af9dcb055715b409d971338cebe885fc", "score": "0.61876214", "text": "function same( a, b ) {\n\treturn a === b || ( a !== a && b !== b );\n}", "title": "" }, { "docid": "3fe3ff9a18717a9eda09520a6073e8f4", "score": "0.6181335", "text": "function isEqual(a, b) {\n if (a.Subtype !== b.Subtype || a.Params.CheckSum.toString() !== b.Params.CheckSum.toString() || a.Params.Size !== b.Params.Size || a.Params.CreationDate !== b.Params.CreationDate || a.Params.ModDate !== b.Params.ModDate) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "d94841682c4c29af4351c818d1cd521d", "score": "0.6164122", "text": "function isEqual(first, second){\n if(first === second){\n return 'You look mahvelous!';\n }else{\n return \"I don't know who you are anymore\";\n }\n}", "title": "" }, { "docid": "641064c36368d5b537d63fda9e72721a", "score": "0.61172533", "text": "function assertEqual( checksum1, checksum2 ) {\n if ( checksum1.length !== checksum2.length || checksum1.length !== 4 ) {\n return false;\n }\n for ( var i = 0; i < checksum1.length; ++i ) {\n if ( checksum1[ i ] !== checksum2[ i ] ) return false;\n }\n return true;\n }", "title": "" }, { "docid": "6aca3e0eb3b245d05652853c031ea9d4", "score": "0.61066943", "text": "function checkMatch(a,b,c){\n if (a==b && b==c && a==c){ //all the same\n\t\t\treturn true;\n\t\t}\n\t\telse if (!a==b && !b==c && !a==c){ //all different\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n }", "title": "" }, { "docid": "9f2f1fd93784443cf758c1f6dc0846ad", "score": "0.61047274", "text": "function TileEqual( t1, t2, t3){ \n\tif( t2 == undefined )\n\t\treturn false;\n\tif( t3 == undefined )\n\t\treturn t1.sval() == t2.sval();\n\treturn t1.sval() == t2.sval() && t1.sval() == t3.sval() ;\n}", "title": "" }, { "docid": "0a1a475a0082ae5f06788eecca413a33", "score": "0.6091295", "text": "function areSame(address_1, address_2) {\n return( address_1 === address_2 )\n }", "title": "" }, { "docid": "e3e56b96baf17492b925761496fece97", "score": "0.6087683", "text": "function checkEquality(a, b) {\n return a === b;\n }", "title": "" }, { "docid": "38728887603ea5f8930e9ab5f30e9414", "score": "0.60737664", "text": "function test(n1,n2) {\n\tif (n1[n1.length-1] == n2[0]){return;}\n\tfail();\n}", "title": "" }, { "docid": "d81b860a5cde1e3ea079d60b0f3a3d6d", "score": "0.6068703", "text": "function checkEqual(a,b){\n message1 = \"Values are equal and of same data type\";\n message2 = \"Values are equal but not of same data type\";\n message3 = \"Values don't match\";\n return a === b ? message1 : a==b ? message2 : message3;\n}", "title": "" }, { "docid": "dee66c55e964ddc94989845b3edae363", "score": "0.6063517", "text": "function doubleEntryCheck(input1, input2) {\r\n return input1 === input2;\r\n}", "title": "" }, { "docid": "cfbade181bbd2aa32753b85e1f23ab97", "score": "0.60448617", "text": "function differentNumbers(guess1, guess2) {\n if (guess1 === guess2) {\n console.log(\"SAME GUESS\");\n highOrLow1.innerText = \"There can\";\n highOrLow2.innerText = \"Only be ONE\"\n return true;\n }\n }", "title": "" }, { "docid": "9b2bf75f0f5234d145a871fbebc29c65", "score": "0.6044828", "text": "function areTheseTheSame( thing1, thing2 ){\n if( thing1 == thing2 ){\n console.log( 'the same with ==' );\n }\n else{\n console.log( 'different with ==' );\n }\n if( thing1 === thing2 ){\n console.log( 'the same with ===' );\n }\n else{\n console.log( 'different with ===' );\n }\n} // end isTheTruth", "title": "" }, { "docid": "b686d68933a49e76106dc0ad7bf55c60", "score": "0.60425675", "text": "function compareEquallity(a,b) {\n if(a == b){ // Change this line\n return \"Equal\";\n }\n return \"Not Equal\"\n}", "title": "" }, { "docid": "8571b7a4db2ab3c6ba8cf03a4687dbb3", "score": "0.6041615", "text": "function areYouHere(arr1, arr2) {\n let ticks = 0;\n for (let i = 0; i < arr1.length; i++) {\n ticks++\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n ticks++\n const el2 = arr2[j];\n if (el1 === el2) return true, ticks;\n }\n }\n return false, ticks;\n}", "title": "" }, { "docid": "eb53bbf4b4fc004de1f5d36a99b29d30", "score": "0.6015985", "text": "function both(n1, n2) {\n\tif (Math.sign(n1) == Math.sign(n2)) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "84916873d37d90923abddca1c99f4780", "score": "0.6014882", "text": "function checkCompare() {\n if (cardMatch.length === 2) {\n compareCards();\n onlyTwo();\n }\n}", "title": "" }, { "docid": "d5eccc4a117027fb90634097531875c0", "score": "0.60115933", "text": "isEqual(comp) {\n return this.die1 === comp.die1 && this.die2 === comp.die2;\n }", "title": "" }, { "docid": "55cbc72ab011c01977b4f6f1e2633703", "score": "0.6005158", "text": "function gameEqual(g1, g2) {\n if((g1 == undefined && g2 != undefined) || (g1 != undefined && g2 == undefined)) {\n return false;\n }\n return g1.round == g2.round && g1.tuhtot == g2.tuhtot &&\n g1.ottu == g2.ottu && g1.forfeit == g2.forfeit && g1.team1 == g2.team1 &&\n g1.team2 == g2.team2 && g1.score1 == g2.score1 && g1.score2 == g2.score2 &&\n g1.notes == g2.notes;\n}", "title": "" }, { "docid": "0db2b218108b5704bf2c61c9fdad596b", "score": "0.5997292", "text": "function areCardsEqual()\n{\n if(cards[cards_clicked[FIRST_CARD_CLICKED]] === cards[cards_clicked[LAST_CARD_CLICKED]])\n return YES;\n\n return NO;\n}", "title": "" }, { "docid": "a11a728af984c6acc8e838c502981dc3", "score": "0.59905064", "text": "function compareEquality (a , b) {\r\n if (a === b) {\r\n return \"it's equal\";\r\n }\r\n return \"not equal\";\r\n }", "title": "" }, { "docid": "57667fce1ba0f48c03994ebb79380a2d", "score": "0.59827745", "text": "function bothPlayersHavePicked(){\n if (P1Pick === \"none\" || P2Pick === \"none\"){\n return false\n }\n else{\n return true\n }\n}", "title": "" }, { "docid": "f163b846eed3ce521218c4760183866a", "score": "0.5961871", "text": "function _is_simple_same(question, answer, msg){\n\t_complete(question == answer, msg);\n }", "title": "" }, { "docid": "a4472f8166c4dddfc797e34c5c8754ec", "score": "0.5956731", "text": "function compair_pair2(object1, object2) {\r\n var match = false;\r\n for ( i = 0; i < Object.keys(object1).length; i++) {\r\n if (object1[Object.keys(object1)[i]] === object2[Object.keys(object2)[i]]) {\r\n match = true;\r\n }\r\n }\r\n return match ;\r\n }", "title": "" }, { "docid": "609c69c2ac09cdfbdfab164d7b84c24a", "score": "0.5947845", "text": "function areTrue(a, b) {\n if (a == true) {\n if (b == true) {\n return \"both\";\n }\n else {\n return \"first\";\n }\n }\n else if (b == true) {\n return \"second\";\n }\n else {\n return \"neither\";\n }\n }", "title": "" }, { "docid": "3da31f4ff7ca27179e6a8dc2d9153ad5", "score": "0.5939888", "text": "function compare(pw1, pw2) {\n if (pw1 === pw2)\n return true\n else\n return false\n}", "title": "" }, { "docid": "1455cd12d412a34d7a069935022ed318", "score": "0.59350425", "text": "function areEqual(a, b) { \r\n var r = a - b;\r\n return (r >= 0 && r < .00001) || (r < 0 && r > -.00001); \r\n }", "title": "" }, { "docid": "2e0b0e0cd7ff96ab08d2cfbd87f5e1cd", "score": "0.59321696", "text": "function checkSame(a, b){\n var sameVal = 0;\n for(var i = 0; i < a.length; i++){\n sameVal += Math.abs(a[i] - b[i]);\n }\n return sameVal;\n}", "title": "" }, { "docid": "46c8eecf9b07c68c8526375abbfdcd2b", "score": "0.59229505", "text": "function compareIng(a,b) {\n var Ta = a.cookTime + a.prepTime;\n var Tb = b.cookTime + b.prepTime;\n if (Ta < Tb) {\n return -1;\n }\n if (Ta > Tb) {\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "a99b4b926f039dc0b8eb8387bf19618a", "score": "0.5919054", "text": "function areEqual(addre, addre1){\n \n return addre.street === addre1.street &&\n addre.city === addre1.city && \n addre.zipCode === addre1.zipCode;\n \n \n }", "title": "" }, { "docid": "4b64828b5d7a2df44b396e87ded10b4e", "score": "0.59099203", "text": "function compareStorePrices (storeA,storeB) {\n let storeAIsLower = storeA < storeB;\n // Set a condition and a response\n if (storeAIsLower) {\n console.log(\"Store A has a lower price.\")\n // Alternate condition and response if the previous condition is not met\n } else if (storeB < storeA) {\n console.log(\"Store B has a lower price.\")\n // Default response if no previous conditions are met\n } else {\n console.log(\"Their prices are equal.\")\n }\n}", "title": "" }, { "docid": "0c485c57129f6a6a75acb36ac0129623", "score": "0.59096456", "text": "function areYouHere(arr1, arr2) {\n let ticks = 0, result = false;\n for (let i=0; i<arr1.length; i++) {\n ticks++;\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n ticks++;\n const el2 = arr2[j];\n if (el1 === el2) return result = true;\n }\n }\n return {\n result: result,\n ticks: ticks\n };\n}", "title": "" }, { "docid": "3b85b029372b2c4b4586564186e0901d", "score": "0.5892338", "text": "function areIdentical(inp1, inp2) {\n return inp1 === inp2;\n }", "title": "" }, { "docid": "aa16a664357d43c1c7857e1b6b3818dd", "score": "0.5891612", "text": "function compareEquality(a, b) {\n\tif (a === b) { // Change this line\n\t return \"Equal\";\n\t}\n\treturn \"Not Equal\";\n }", "title": "" }, { "docid": "59e531dfd9cc87210c60210ab10b3162", "score": "0.5890192", "text": "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "title": "" }, { "docid": "f7babdbee35c93b8d140f9202a4c4f9c", "score": "0.58867854", "text": "function Combat_estVoisin(Territoire1,Territoire2){\r\n for(var i =0 ; i < Territoire1.voisins.length ;i++){\r\n if (Territoire1.voisins[i].nom == Territoire2.nom ) {\r\n return true\r\n }\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "c8b5abb2b5bb9804982d91d8f69d9c49", "score": "0.5885136", "text": "function checkReelsMatch(p1,p2,p3){\n\n if (check3theSame(p1,p2,p3)){\n return true\n }\n\n}", "title": "" }, { "docid": "72f488a371abf96c34b2668428e111c7", "score": "0.5882568", "text": "function matchWithTwoParameters(inputOne, inputTwo){\n if(inputOne === inputTwo){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "6b1aba2ddf66ec1d3b1115de61cc96a6", "score": "0.58789754", "text": "function chequearNumeroDeCuenta(numeroCuenta){\n if(numeroCuenta===cuenta1[1]||numeroCuenta===cuenta2[1]){\n console.log(\"validation passed\");\n return true\n }else{\n console.log(\"validation failed\")\n return false\n }\n}", "title": "" }, { "docid": "76641a3c38e1da36373828e1fad981a1", "score": "0.5876801", "text": "function compareTables() {\r\n\r\n for (let i = 0; i < completeTable.length; i++) {\r\n for (let j = 0; j < completeTable.length; j++) {\r\n if (completeTable[i][j] != userTable[i][j]) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "title": "" }, { "docid": "b6a000749db46bafdbc1900196f01fb9", "score": "0.5875131", "text": "function true_tripe_equal() { \r\nA = \"Magnus\";\r\nB = \"Magnus\";\r\ndocument.write(A === B); //true\r\n}", "title": "" }, { "docid": "e74623ae08263a2c404d3f8f350b1344", "score": "0.587238", "text": "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "title": "" }, { "docid": "e74623ae08263a2c404d3f8f350b1344", "score": "0.587238", "text": "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "title": "" }, { "docid": "e74623ae08263a2c404d3f8f350b1344", "score": "0.587238", "text": "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "title": "" }, { "docid": "9a42cd50807c8cef2823888792deb58f", "score": "0.58653796", "text": "function compras(trabalho1, trabalho2){\r\n const comprarsorvete = trabalho1 || trabalho2\r\n const comprartv50 = trabalho1 && trabalho2\r\n const comprartv32 = trabalho1 != trabalho2\r\n const mantersaudavel = !comprarsorvete\r\n return{comprarsorvete, comprartv50, comprartv32, mantersaudavel}\r\n}", "title": "" }, { "docid": "27b9c7afd8a52d79fc78e4b2836e5cd1", "score": "0.58592623", "text": "function areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) {\n //coding and coding..\n return ((yourLeft == friendsLeft) && (yourRight == friendsRight)) || \n ((yourLeft == friendsRight) && (yourRight == friendsLeft)) ;\n \n}", "title": "" }, { "docid": "c4c959e55e7ffeafe5b0fcf28d0ea57e", "score": "0.58591676", "text": "function comparePairs(obj1, obj2){\n\tvar keys1 = Object.keys(obj1);\n\tvar keys2 = Object.keys(obj2);\n\tfor(var i = 0; i < keys1.length; i ++){\n\t\tif (keys1[i] === keys2[i] || obj1[keys1[i]] === obj2[keys2[i]]){\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "c23e4e0fbf0cbeb9a804d5886aa2b4f5", "score": "0.58590263", "text": "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "title": "" }, { "docid": "c23e4e0fbf0cbeb9a804d5886aa2b4f5", "score": "0.58590263", "text": "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "title": "" }, { "docid": "f72cd9cd8a3c30ed31d0b8293f816c3b", "score": "0.5852759", "text": "function areSimilar(a, b) {\n var sortedA = a.slice(0).sort().join('');\n var sortedB = b.slice(0).sort().join('');\n console.log(a,b);\n if(sortedA == sortedB){\n var count = 0;\n for(var i = 0; i<a.length; i++){\n if(a[i] !== b[i]){\n count++;\n }\n }\n return count<=2;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "79a8e7f23516ff965bb9a6f80ca2caae", "score": "0.585085", "text": "function isPair(roll1, roll2){\n return roll1 === roll2;\n}", "title": "" }, { "docid": "97fa95939c7ae26c0f3888296a0c8910", "score": "0.5845499", "text": "function checkEqual (a,b){\n return a==b? true : false ;\n}", "title": "" }, { "docid": "911affadd5ab60618d7b98f499b829c2", "score": "0.58441156", "text": "function match(valOne, valTwo){\n if (valOne === valTwo)\n return true\n else\n return false\n}", "title": "" }, { "docid": "00f5f870a557956edda0f2a6471813dc", "score": "0.5838839", "text": "function c(ok, thing1, thing2, ...args) {\n let res = compare(thing1, thing2, { verboseWhenMismatches: true });\n if (typeof res === \"string\") {\n return ok(false, res);\n }\n return ok(res, ...args);\n}", "title": "" }, { "docid": "a4d483bf3cf17744eb808fe01ee4cb86", "score": "0.5838588", "text": "function areEqual (a, b) {\n const PRECISION = 0.001;\n\n return Math.abs(a - b) <= PRECISION;\n}", "title": "" }, { "docid": "71c4c15428e61bdd77eee522661efed7", "score": "0.5834213", "text": "function isEqual(nbr1, nbr2) {\n\t//je check si les deux nombres sont égaux en valeur et type, et retourne true\n\tif(nbr1 === nbr2){\n\t return true;\n\t}else {\n\t //sinon, je retourne false\n\t return false;\n\t}\n}", "title": "" }, { "docid": "1bfaa1686b489c21758bfeadf013f7e0", "score": "0.5833783", "text": "_checkSameRev(firstRev, secondRev) {\n const normalizeRev = (rev) => {\n const result = {};\n Object.keys(rev).forEach((key) => {\n const value = rev[key];\n // Ignore the tid attribute\n // Ignore all falsy values, as well as an empty array\n if (key === 'tid' || !value || (Array.isArray(value) && !value.length)) {\n return;\n }\n\n if (key === 'timestamp') {\n // 'timestamp' fields need to be parsed because Cassandra\n // returns a ISO8601 ts which includes milliseconds, while\n // the ts returned by MW API does not\n result[key] = Date.parse(value);\n } else {\n result[key] = value;\n }\n });\n return result;\n };\n return stringify(normalizeRev(firstRev)) === stringify(normalizeRev(secondRev));\n }", "title": "" }, { "docid": "20bc62997ad6326d21d760c1764c291a", "score": "0.5830881", "text": "function areEqual(add1, add2) {\n return (add1.street===add2.street && add1.city===add2.city && add1.zipcode===add2.zipcode) ? true : false\n \n}", "title": "" }, { "docid": "4ce86bdbf97f684923ded305b74aec81", "score": "0.58304363", "text": "function areSame(address1, address2) {\n return address1 === address2;\n}", "title": "" }, { "docid": "b058ec5118221203a23c1b61569a0764", "score": "0.58279514", "text": "function sameNotSame(arguments1,arguments2){\n if(arguments1 === arguments2){\n console.log('true');\n }\n }", "title": "" }, { "docid": "dcf2deb9dc0b72db1f7b377d7fe2d6fd", "score": "0.58237976", "text": "function same(p0, p1) {\n return (Math.abs(p0[0] - p1[0]) < 1e-9 && Math.abs(p0[1] - p1[1]) < 1e-9);\n}", "title": "" }, { "docid": "c6f250c3ede5785575ef6af064ce94ec", "score": "0.5822805", "text": "function names_ages(first, second) {\n if ( first.name == second.name || first.age == second.age ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "14431e82f7e9e6a89be0113a9579e927", "score": "0.5822577", "text": "function areTheyEqual() {\n\n // check class list -> to get the value of teh faced down card\n const cardOneValue = cardOneElement.innerHTML.trim();\n const cardTwoValue = cardTwoElement.innerHTML.trim();\n\n // check if both classes are equal and that the item isn't in the list to begin with\n if (!cardsCollected.includes(cardOneValue) && (cardOneValue === cardTwoValue)) { // if they are equal\n equal(cardOneValue, cardTwoValue);\n } else {\n notEqual();\n }\n // increase move count\n moves += 1;\n starSetter();\n updateUI();\n\n // reset the round back to zero\n currentTurn = 0;\n\n // check if all cards flipped open\n if (cardsCollected.length === 16) {\n gameWon = true;\n setTimeout(winMessage, 300);\n }\n}", "title": "" }, { "docid": "8e54a6da010cb5c33916c2bd7375c729", "score": "0.58225256", "text": "function notEqual() {\n // 1. TO DO: add animation UI for wrong match\n wrong(cardOneElement);\n wrong(cardTwoElement);\n // 2. flip the card back down\n setTimeout(function () {\n removeWrong(cardOneElement);\n flipDown(cardOneElement);\n }, 250);\n setTimeout(function () {\n removeWrong(cardTwoElement);\n flipDown(cardTwoElement);\n }, 250);\n // 3. reset element pointers\n setTimeout(resetElementPointer, 300);\n}", "title": "" }, { "docid": "718bf2d4c532f10dab07976dd819c681", "score": "0.5819663", "text": "isEqual(req, schema, one, two) {\n for (const field of schema) {\n const fieldType = self.fieldTypes[field.type];\n if (!fieldType.isEqual) {\n if ((!_.isEqual(one[field.name], two[field.name])) &&\n !((one[field.name] == null) && (two[field.name] == null))) {\n return false;\n }\n } else {\n if (!fieldType.isEqual(req, field, one, two)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "dc44dccb6b497dae981dfc506cab0771", "score": "0.58163244", "text": "function match(a,b) { //creating a function to compare two numbers to see if they match\n if (a == b)\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "034d8bd4e24c7dd989fd512a862d4cfe", "score": "0.58143884", "text": "function equalSlots(slot1, slot2) {\n if (!slot1 || !slot2) {\n return !slot1 && !slot2; //if either is undefined, it's true only if both are\n }\n if (!slot1.offset.eq(slot2.offset)) {\n return false;\n }\n if (slot1.hashPath !== slot2.hashPath) {\n return false;\n }\n if (!equalSlots(slot1.path, slot2.path)) {\n return false;\n }\n //to compare keys, we'll just compare their hex encodings\n //(yes, that leaves some wiggle room, as it could consider different\n //*types* of keys to be equal, but if keys are the only difference then\n //that should determine those types, so it shouldn't be a problem)\n if (!slot1.key || !slot2.key) {\n //first, though, they likely don't *have* keys\n return !slot1.key && !slot2.key;\n }\n //if they do have keys, though...\n return Evm.Utils.equalData(MappingKey.Encode.encodeMappingKey(slot1.key), MappingKey.Encode.encodeMappingKey(slot2.key));\n}", "title": "" }, { "docid": "237f1b1d0070749355f0c59a39924e4b", "score": "0.58137214", "text": "function twoNotTrue(thing1,thing2){\n if(thing1 && thing2){return}\n else if(thing1 || thing2){return}\n else{return \"both are not true\"}\n}", "title": "" }, { "docid": "c93b27aa0824a088924747665ba3b4f2", "score": "0.5812752", "text": "function checkEqual(a, b) {\n return a == b ? \"Equal\" : \"Not Equal\";\n}", "title": "" }, { "docid": "6ceca53d9bd69b06fff232c61cdcdd61", "score": "0.58124816", "text": "function compare(a, b) {\n const dues1 = a.dues;\n const dues2 = b.dues;\n let comparison = 0;\n if(dues1 > dues2){\n comparison = 1;\n } else if (dues2 > dues1) {\n comparison = -1;\n }\n return comparison\n }", "title": "" }, { "docid": "ebf51c64dec80f04f8dbe1811fa723f0", "score": "0.5811336", "text": "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "title": "" } ]
5288e0a659edb54bab1b9b65576cbdd6
A public higherorder component to access the imperative API
[ { "docid": "ceb09c62a01165e6f6a02e9df982d5a0", "score": "0.0", "text": "function withRouter(Component) {\n var displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = Object(__WEBPACK_IMPORTED_MODULE_10__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__[\"a\" /* default */])(props, [\"wrappedComponentRef\"]);\n\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__[\"a\" /* default */])(false, \"You should not use <\" + displayName + \" /> outside a <Router>\") : Object(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__[\"a\" /* default */])(false) : void 0;\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component, Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({}, remainingProps, context, {\n ref: wrappedComponentRef\n }));\n });\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (process.env.NODE_ENV !== \"production\") {\n C.propTypes = {\n wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object])\n };\n }\n\n return Object(__WEBPACK_IMPORTED_MODULE_11_hoist_non_react_statics__[\"default\"])(C, Component);\n}", "title": "" } ]
[ { "docid": "8c9628362acb97d6a620dabd71cf277d", "score": "0.5708796", "text": "function higherOrder ( fn ) {\n fn();\n}", "title": "" }, { "docid": "f18d61c1edaca5552c088646ee5e68c2", "score": "0.5516117", "text": "*[Symbol.iterator]() {\n yield* this.layers[Symbol.iterator]();\n }", "title": "" }, { "docid": "4cdacb214872c0b8de7441b8c86fb6f2", "score": "0.5472085", "text": "function higherOrderFunction() {\n return function() {\n return 8;\n };\n}", "title": "" }, { "docid": "dccca3bc78fa34729cb76fefc178de5f", "score": "0.53915435", "text": "[Symbol.iterator]() {\n // This makes us iterable\n return this;\n }", "title": "" }, { "docid": "dccca3bc78fa34729cb76fefc178de5f", "score": "0.53915435", "text": "[Symbol.iterator]() {\n // This makes us iterable\n return this;\n }", "title": "" }, { "docid": "bb577d26c9bec23e72130a6363cf9d88", "score": "0.5386961", "text": "operation(){ /** todo */ }", "title": "" }, { "docid": "55ecbd0a2b52fa4cc43aa70ed64cdd3d", "score": "0.5338837", "text": "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "title": "" }, { "docid": "d8241a45761c08f270210e967dcdd34f", "score": "0.52398497", "text": "internals() {\n return {\n createHttp: (events, skipStart) => {\n return this.#createHttp(events, skipStart)\n },\n\n createLambda: (lambdas, skipStart) => {\n return this.#createLambda(lambdas, skipStart)\n },\n\n getApiGatewayServer: () => {\n return this.#http.getServer()\n },\n\n getEvents: () => {\n return this.#getEvents()\n },\n\n mergeOptions: () => {\n this.#mergeOptions()\n },\n }\n }", "title": "" }, { "docid": "515713a85fd5c5ab1cef212101b62b44", "score": "0.5233159", "text": "function higherOrderSum() {}", "title": "" }, { "docid": "f6faad4142ef33c8808719a9f001b1b5", "score": "0.51913774", "text": "inorderTraversal(){\n //TODO: implementation here\n }", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.51685065", "text": "function Composition() {}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.51685065", "text": "function Composition() {}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.51685065", "text": "function Composition() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.51637363", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.51637363", "text": "function Wrapper() {}", "title": "" }, { "docid": "6c53659b0521dfbb7382f6809b19bf0e", "score": "0.5156425", "text": "function Ops() {}", "title": "" }, { "docid": "811ed2828ccacec27f86729d47baca2a", "score": "0.5144396", "text": "_wrap(generator) {\n return new Sequence({ [Symbol.iterator]: generator.bind(this) });\n }", "title": "" }, { "docid": "53693dc59ebad5c64e01d1de5a844ffb", "score": "0.5123546", "text": "function Pipe() {\n return (target) => { };\n}", "title": "" }, { "docid": "f6b28708d23f17ee4bd3e12835fd2e94", "score": "0.5108381", "text": "function xP(){return function(J){return J}}", "title": "" }, { "docid": "70d56cbc6555d9f6f1eebc9009b1bde4", "score": "0.510169", "text": "createWrappedFunction(fn) {\n\n\t\t\treturn fn;\n\n\t\t\t// // console.log(\"createWrappedFunction\", fn);\n\t\t\t// let code = fn.toString();\n\t\t\t// //\tI know, it's a bit dirty but it works on maaaany cases\n\t\t\t// //\tI just want to same developer experience as Moleculer\n\t\t\t// const extract = code.slice(code.indexOf(\"{\") + 1, code.lastIndexOf(\"}\"));\n\t\t\t// //\n\t\t\t// const asynchronous = code.indexOf(\"async\") > -1;\n\t\t\t// var AsyncFunction = Object.getPrototypeOf(async function(){}).constructor\n\t\t\t// //\n\t\t\t// if (asynchronous) {\n\t\t\t// \treturn AsyncFunction(\"ctx\", extract).bind(this);\n\t\t\t// }\n\t\t\t// return Function(\"ctx\", extract);\n\t\t}", "title": "" }, { "docid": "bc91b8294f1a34e982cbd54dd0092f58", "score": "0.50829554", "text": "function higherOrderFunction(callback) {\n // when you call a function that is passed as an argument, it is referred to as a callback\n callback();\n}", "title": "" }, { "docid": "cc3c4fae6de9156824c30fe9aeffda54", "score": "0.5078606", "text": "function Op() {\n}", "title": "" }, { "docid": "cc3c4fae6de9156824c30fe9aeffda54", "score": "0.5078606", "text": "function Op() {\n}", "title": "" }, { "docid": "418d8f5cd109749d0056f8dfbe08cac5", "score": "0.50608927", "text": "operation() {}", "title": "" }, { "docid": "87fa3fc69d2b7703fc986ee143a2a799", "score": "0.50275636", "text": "function\nXATS2JS_lazy_cfr(a1x1)\n{\nlet xtmp1;\nlet xtmp3;\n;\nxtmp3 =\nfunction()\n{\nlet xtmp2;\n{\nxtmp2 = a1x1();\n}\n;\nreturn xtmp2;\n} // lam-function\n;\nxtmp1 = XATS2JS_new_lazy(xtmp3);\nreturn xtmp1;\n} // function // XATS2JS_lazy_cfr(0)", "title": "" }, { "docid": "e9d0d6cc23d3dc2ac6b79046d227df3c", "score": "0.50218344", "text": "function intermediate() { }", "title": "" }, { "docid": "0af83f9373185515e95c5161c9adcb48", "score": "0.50154436", "text": "function e(e){return (0, F[e.operation])(...e.parameters)}", "title": "" }, { "docid": "0af83f9373185515e95c5161c9adcb48", "score": "0.50154436", "text": "function e(e){return (0, F[e.operation])(...e.parameters)}", "title": "" }, { "docid": "c4ad70c14db161a8249749d3fe6828bc", "score": "0.49989927", "text": "next(){ /** todo */ }", "title": "" }, { "docid": "f1816c59f5d196604142d68ab557d68c", "score": "0.49945518", "text": "[Symbol.iterator]()\n {\n return new MatrixIterator(this);\n }", "title": "" }, { "docid": "77ca3d62c6e0f6c3f30c0e1e39627408", "score": "0.49864268", "text": "invoke () {\n\n }", "title": "" }, { "docid": "18f6f4453a7aa80fc66709d355d185b7", "score": "0.4983141", "text": "function traversalPromiseWrap(op) {\n return function () {\n var argPair = this.gremlin.extractArguments(Array.prototype.slice.call(arguments));\n dlog('traversalPromiseWrap(%s)', op, argPair);\n return Q.npost(this.traversal, op, argPair.args).nodeify(argPair.callback);\n };\n}", "title": "" }, { "docid": "9b4e2f3f0e72d2d3ff69fb611b5d24f8", "score": "0.49815226", "text": "function\nXATS2JS_lazy_vt_cfr(a1x1)\n{\nlet xtmp10;\nlet xtmp12;\nlet xtmp13;\n;\nxtmp12 =\nfunction()\n{\nlet xtmp11;\n{\nxtmp11 = a1x1();\n}\n;\nreturn xtmp11;\n} // lam-function\n;\nxtmp13 =\nfunction()\n{\nlet xtmp11;\n} // lam-function\n;\nxtmp10 = XATS2JS_new_llazy(xtmp12,xtmp13);\nreturn xtmp10;\n} // function // XATS2JS_lazy_vt_cfr(2)", "title": "" }, { "docid": "e41fc14c7e1fe98c371885de98db882d", "score": "0.49801925", "text": "preorderTraversal(){\n //TODO: implementation here\n }", "title": "" }, { "docid": "12717503f2c08c44697d8cc2d3d58922", "score": "0.497964", "text": "function fP(){return function(R){return R}}", "title": "" }, { "docid": "dadab68b31c5eb97ddc11cc23f931106", "score": "0.49789384", "text": "_getExperimentalApi() {\n return new Proxy({\n /**\n * Determines if MetaMask is unlocked by the user.\n *\n * @returns Promise resolving to true if MetaMask is currently unlocked\n */\n isUnlocked: async () => {\n if (!this._state.initialized) {\n await new Promise((resolve) => {\n this.on('_initialized', () => resolve());\n });\n }\n return this._state.isUnlocked;\n },\n /**\n * Make a batch RPC request.\n */\n requestBatch: async (requests) => {\n if (!Array.isArray(requests)) {\n throw eth_rpc_errors_1.ethErrors.rpc.invalidRequest({\n message: 'Batch requests must be made with an array of request objects.',\n data: requests,\n });\n }\n return new Promise((resolve, reject) => {\n this._rpcRequest(requests, utils_1.getRpcPromiseCallback(resolve, reject));\n });\n },\n }, {\n get: (obj, prop, ...args) => {\n if (!this._sentWarnings.experimentalMethods) {\n this._log.warn(messages_1.default.warnings.experimentalMethods);\n this._sentWarnings.experimentalMethods = true;\n }\n return Reflect.get(obj, prop, ...args);\n },\n });\n }", "title": "" }, { "docid": "4fbc3e18a12dd5d7bdce49e238747f17", "score": "0.4966509", "text": "*[Symbol.iterator](){\n let curr = this.head;\n while (curr) {\n yield curr;\n curr = curr.next;\n }\n }", "title": "" }, { "docid": "fabba0332c75f75eee9af918c7f417c2", "score": "0.495059", "text": "function h(a){[\"next\",\"throw\",\"return\"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}", "title": "" }, { "docid": "7e887da0eaba31df00c38e867c4b5f34", "score": "0.4942391", "text": "function myHigherOrderFun() {\n return function() {\n return \"Do something\";\n }\n }", "title": "" }, { "docid": "2ffcde6b92f8892abaa4824591573031", "score": "0.49377275", "text": "_next(){ /** todo */ }", "title": "" }, { "docid": "7c0a172919e952e50c07837fb5952b99", "score": "0.49364012", "text": "function modifierWrapper(prev, next) {\n let mod;\n\n //if (typeof next === 'function') {\n if (prev) {\n mod = function (str) {\n return prev(next(str));\n }\n } else {\n mod = next;\n }\n //} else {\n // mod = slice.call(arguments, 1).reduce(function (prev, next) {\n // if (prev) {\n // return function (str) {\n // return prev(next(str));\n // };\n // } else {\n // return next;\n // }\n // }, prev);\n //}\n\n mod.previous = prev;\n\n return mod;\n}", "title": "" }, { "docid": "f0e1b9cb5fb8337ec275ed0bf8870f18", "score": "0.49183828", "text": "function Component() {\n return (target) => { };\n}", "title": "" }, { "docid": "bc33bc416ba55a33816fc6976a7609eb", "score": "0.49145818", "text": "function Within_Functioal_Component(){\nreturn(\n <div>\n <hr />\n <p>Functional Component within Functional Component </p>\n <h1>Hello bruHammed!</h1>\n <hr/>\n </div>\n)\n }", "title": "" }, { "docid": "634cc6fababf58ce7b00aa1a225535f6", "score": "0.49075133", "text": "[Symbol.iterator]() {\n return this;\n }", "title": "" }, { "docid": "4ce2e3ec2203d13211b9aed7a37e4786", "score": "0.49045452", "text": "[Symbol.asyncIterator]() { return this; }", "title": "" }, { "docid": "e60ffb833a5fd40ac1b73fed34158489", "score": "0.49001464", "text": "call() {\n throw new Error('Interactor requires call to be implemented');\n }", "title": "" }, { "docid": "d0fffb23cee090a9fd84db9c1115e7b2", "score": "0.48895434", "text": "fmap () {\n throw new Error(\"You had to implement fmap method\");\n }", "title": "" }, { "docid": "74d7e33358e2d750596a68f30112dc41", "score": "0.48863107", "text": "function $_return(a){\n return new Fay$$Monad(a);\n}", "title": "" }, { "docid": "3ed87b807f2b0f777f27ab717f8b5fa3", "score": "0.48855588", "text": "function curry(fn, ...args){\n return(..._args)=>{\n return fn(...args, ..._args)\n }\n}", "title": "" }, { "docid": "bc270d5ddd26d235399907acd02cc723", "score": "0.4885228", "text": "function higherOrderGreet() {}", "title": "" }, { "docid": "ef81943cc9e4f03c4abb36ef801b9a45", "score": "0.48779976", "text": "*[Symbol.iterator]() {\n let next;\n while ((next = this.next()) !== false) {\n yield next.payload;\n }\n }", "title": "" }, { "docid": "d66020b361ebf8ecc6d00a7ecef925d4", "score": "0.48713037", "text": "function FunctionIterable(fn){\n this.fn = fn\n}", "title": "" }, { "docid": "c89d06b2c73c14726cc1d5eb5c90a721", "score": "0.48675585", "text": "function compose () {\n //code here\n}", "title": "" }, { "docid": "030aca92e6676d8e7f45b166e2205f4e", "score": "0.48647553", "text": "function noisy(fuc){\n// ...args rest operator\n return (...args) => {\n console.log(\"calling with\", args);\n let result = fuc(...args);\n console.log(\"called with\", args, \", return\", result);\n return result;\n }\n}", "title": "" }, { "docid": "236800619a6593d6b69b79844b38cc5c", "score": "0.48634765", "text": "*[Symbol.iterator]() {\n let i = 0;\n let c = this.head;\n do {\n yield [c, i++];\n } while(c && (c = c.next));\n }", "title": "" }, { "docid": "dcaf970950c5b284eded13f489c3dcc7", "score": "0.48628706", "text": "[Symbol.iterator]() {return this;}", "title": "" }, { "docid": "ae3fd7c8c59f4d23443573b0da47d01c", "score": "0.48595873", "text": "[Symbol.iterator]() {\n let nextIndex = 0;\n return {\n // cannot refer to this of wrapping scope in regular function!\n\n // next: function() {\n // if (nextIndex < this.content.length) {\n // return { value: content[nextIndex++], done: false };\n // }\n // return { done: true };\n // }\n\n next: () => nextIndex < this.content.length ? \n { value: this.content[nextIndex++], done: false } : { done: true }\n }\n }", "title": "" }, { "docid": "22e74870b7da454e904b11486ef2f8ad", "score": "0.48585126", "text": "_pipe(f, g) {\n return (...args) => g(f(...args));\n }", "title": "" }, { "docid": "714fbaaee80902df6aa48500bd681eed", "score": "0.48474592", "text": "function i() {\n return _i.apply(this, arguments);\n }", "title": "" }, { "docid": "005c9629f43491467493914b33301159", "score": "0.4844239", "text": "function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zp.apply(this,arguments)}", "title": "" }, { "docid": "682b9f8247c67bf4570d6e43b305fffd", "score": "0.48415408", "text": "function highOrderFunc() {\n return function () {\n alert('hello');\n };\n}", "title": "" }, { "docid": "85af3fe4e60793e56a78929e01dba4ee", "score": "0.4836764", "text": "*[Symbol.iterator]() {\n let i = 0;\n while (i < this._items.length) {\n yield this._items[i++];\n }\n }", "title": "" }, { "docid": "3759552432c9517d54b5ebb8394f35d6", "score": "0.48334178", "text": "function o(e){return i.bind(this,e)}", "title": "" }, { "docid": "777448d064c58a952408ddf7cb2c490d", "score": "0.48323226", "text": "function install() {\n return function (next) {\n return function (reducer, initialState, enhancer) {\n var currentEffect = (0, _effects.none)();\n\n var _liftState = (0, _loop.liftState)(initialState);\n\n var _liftState2 = (0, _slicedToArray3['default'])(_liftState, 2);\n\n var initialModel = _liftState2[0];\n var initialEffect = _liftState2[1];\n\n\n var liftReducer = function liftReducer(reducer) {\n return function (state, action) {\n var result = reducer(state, action);\n\n var _liftState3 = (0, _loop.liftState)(result);\n\n var _liftState4 = (0, _slicedToArray3['default'])(_liftState3, 2);\n\n var model = _liftState4[0];\n var effect = _liftState4[1];\n\n if ((0, _effects.isNone)(currentEffect)) {\n currentEffect = effect;\n } else {\n currentEffect = (0, _effects.batch)([currentEffect, effect]);\n }\n return model;\n };\n };\n\n var store = next(liftReducer(reducer), initialModel, enhancer);\n\n var runEffect = function runEffect(originalAction, effect) {\n return (0, _effects.effectToPromise)(effect).then(function (actions) {\n return _promise2['default'].all(actions.map(dispatch));\n })['catch'](function (error) {\n console.error((0, _errors.loopPromiseCaughtError)(originalAction.type));\n throw error;\n });\n };\n\n var dispatch = function dispatch(action) {\n store.dispatch(action);\n var effectToRun = currentEffect;\n currentEffect = (0, _effects.none)();\n return runEffect(action, effectToRun);\n };\n\n var replaceReducer = function replaceReducer(reducer) {\n return store.replaceReducer(liftReducer(reducer));\n };\n\n runEffect({ type: '@@ReduxLoop/INIT' }, initialEffect);\n\n return (0, _extends3['default'])({}, store, {\n dispatch: dispatch,\n replaceReducer: replaceReducer\n });\n };\n };\n}", "title": "" }, { "docid": "af0ac5cf29f0e981b9c1cca8b1a3b7b7", "score": "0.48254323", "text": "function makeOpComposition () {\n \n var ops = []; \n var domain = makeEmptyMap(); \n var gen = 0; \n \n var func = function (s) {\n return function (i) {\n return evaluate(domain.has(i) ? (ops.length-1) - (gen-domain.get(i)) : -1, i)(i);\n }\n \n // determine selection state of i but only access the elements \n // of ops (staring from ind) that have i in their domain\n function evaluate(ind, i) {\n if (ind < 0) return s; // i defined in the base selection mapping s\n else {\n var op = ops[ind];\n return op(function (j) { return evaluate(ind - op.domain.get(i), j)(i); });\n // the call to evaluate is wrapped to a lambda to make the call lazy.\n // op will only call the lambda if op.f.constant is false\n }\n }\n }\n \n func.domain = domain;\n \n // member functions of func\n func.push = function (op) {\n ops.push(op);\n ++gen\n op.domain.forEach(function(_, i) {\n op.domain.set(i, domain.has(i) ? gen - domain.get(i) : ops.length);\n domain.set(i, gen); \n });\n }\n func.pop = function () {\n var n = ops.length;\n var op = ops.pop();\n --gen;\n // domain updated for those elements that are in op.domain\n op.domain.forEach(function (_, i) {\n if (op.domain.get(i) >= n) domain.delete(i); // no op defines i\n else domain.set(i, domain.get(i) - op.domain.get(i)); \n });\n return op;\n }\n func.top = function () { return ops[ops.length - 1]; }\n func.top2 = function () { return ops[ops.length - 2]; }\n func.shift = function (bmap) {\n var op = ops.shift();\n op.domain.forEach(function(_, i) {\n if (domain.get(i) - gen === ops.length) { domain.delete(i); }\n // if lastOp the only op that defines i, remove i from domain\n });\n return op;\n }\n func.size = function () { return ops.length; }\n func.removeIndex = function (i) {\n if (!domain.has(i)) return;\n \n // find the first op in ops that defines i\n var j = (ops.length - 1) - (gen - domain.get(i));\n \n while (j >= 0) {\n var d = ops[j].domain.get(i);\n ops[j].domain.delete(i);\n j -= d;\n }\n domain.delete(i);\n }\n \n return func;\n }", "title": "" }, { "docid": "65a164a2e70ab113e60578c90db1ae51", "score": "0.4817586", "text": "function add(x){\n return (y) => {\n return x + y \n }\n}", "title": "" }, { "docid": "450a8086d1253d632058539b118790c2", "score": "0.48036027", "text": "function Identity$prototype$traverse(typeRep, f) {\n return Z.map (Identity, f (this.value));\n }", "title": "" }, { "docid": "dd7b112dbf0091c3ffd8452535ab6d8b", "score": "0.48034126", "text": "function\nXATS2JS_llazy_cfr(a1x1)\n{\nlet xtmp5;\nlet xtmp7;\nlet xtmp8;\n;\nxtmp7 =\nfunction()\n{\nlet xtmp6;\n{\nxtmp6 = a1x1();\n}\n;\nreturn xtmp6;\n} // lam-function\n;\nxtmp8 =\nfunction()\n{\nlet xtmp6;\n} // lam-function\n;\nxtmp5 = XATS2JS_new_llazy(xtmp7,xtmp8);\nreturn xtmp5;\n} // function // XATS2JS_llazy_cfr(1)", "title": "" }, { "docid": "826538659214852ee6ecb4584b774669", "score": "0.4801424", "text": "function b() {\n return ()=>{\n console.log(this);\n }\n}", "title": "" }, { "docid": "59bf628f57272f46584e3a769dcef6a4", "score": "0.47997576", "text": "exec() {\n this.fns[0].call(this, this.next.bind(this));\n }", "title": "" }, { "docid": "af03a8917206f96641dbdb83a4ac133c", "score": "0.47865462", "text": "[Symbol.iterator]() {\n return makeInOrderIterator(this.rootNode);\n }", "title": "" }, { "docid": "c9ee0f657ec8aaedf3af870af9f2ad44", "score": "0.47856602", "text": "function restOperator(...args){\n console.log(args);\n}", "title": "" }, { "docid": "4fbb583600e7f431aaaf76b8cd2cffa6", "score": "0.47815645", "text": "* xs() {\n throw new Error(\"Calling an abstract method.\");\n }", "title": "" }, { "docid": "9e26c71b8111eebce708e84801c5e09d", "score": "0.47751462", "text": "postorderTraversal(){\n //TODO: implementation here\n }", "title": "" }, { "docid": "3576bdceb1de0a1cc0062d45c553e04c", "score": "0.4754002", "text": "function IamFunctional(props){\n\tconsole.log(props)\n\treturn(\n\t\t<div>\n\t\t\t<h2>i am functinal Component</h2>\n\t\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere soluta laudantium laborum vel et, nulla aliquid deserunt rerum officiis tempora.</p>\n\t\t</div>\n\t)\n}", "title": "" }, { "docid": "7e04d1cf5ae8502eefb26860d95d0d35", "score": "0.4746824", "text": "function Decorator() { }", "title": "" }, { "docid": "19fce5a5415b063da882c5c24b145ec6", "score": "0.47382337", "text": "function iA(){cr()(this,{$layersCollection:{enumerable:!0,get:this.getLayersCollection}})}", "title": "" }, { "docid": "a522f77c097824e645c81b4188b2fa32", "score": "0.47381404", "text": "function resultWrapper(func, processor) {\n var t = this;\n\n return getResult.call(t, func.call(t), undefined, processor);\n}", "title": "" }, { "docid": "7554d82a2ef48e548b989d13e490d6bc", "score": "0.4737981", "text": "[Symbol.iterator]() {\n const { lefts, rights, size } = getPrivates(this);\n\n const finalIndex = size - 1;\n let index = 0;\n\n return {\n next: () => {\n if (index > finalIndex) return { done: true };\n\n const result = {\n value: [lefts[index], rights[index]]\n };\n\n index += 1;\n\n return result;\n }\n };\n }", "title": "" }, { "docid": "24ffc5c9b1eee1153290e0122269a7ed", "score": "0.47372854", "text": "function higherOderFunction(params, callback) {\n return callback(params);\n}", "title": "" }, { "docid": "48fc8af4291de074a488efa393ad4d64", "score": "0.47370598", "text": "function o$1P(o,e,t){let a,c;return void 0===e||Array.isArray(e)?(c=o,t=e,a=[void 0]):(c=e,a=Array.isArray(o)?o:[o]),(o,e)=>{const d=o.constructor.prototype;a.forEach((a=>{const s=y$1F(o,a,c);s.read&&\"object\"==typeof s.read||(s.read={}),s.read.reader=d[e],t&&(s.read.source=(s.read.source||[]).concat(t));}));}}", "title": "" }, { "docid": "5e68ff109acd42e83423cd98c719c26e", "score": "0.47310004", "text": "fuse() {\n const that = this;\n function ret() {\n return __asyncGenerator(this, arguments, function* ret_24() {\n var e_18, _a;\n try {\n for (var that_8 = __asyncValues(that), that_8_1; that_8_1 = yield __await(that_8.next()), !that_8_1.done;) {\n const elem = that_8_1.value;\n yield yield __await(elem);\n }\n }\n catch (e_18_1) { e_18 = { error: e_18_1 }; }\n finally {\n try {\n if (that_8_1 && !that_8_1.done && (_a = that_8.return)) yield __await(_a.call(that_8));\n }\n finally { if (e_18) throw e_18.error; }\n }\n });\n }\n return new AsyncIterPlus(ret());\n }", "title": "" }, { "docid": "1226bccfb9553b375fc0362f444496bc", "score": "0.47302496", "text": "function PipeDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "3571d5fce463a7771bc5373c13f82596", "score": "0.47268718", "text": "function Xc(e){return(Xc=\"function\"==typeof Symbol&&\"symbol\"==_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_5___default()(Symbol.iterator)?function(e){return _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_5___default()(e)}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_5___default()(e)})(e)}", "title": "" }, { "docid": "63aea1ae4f458745765c10dbe3add8dc", "score": "0.47177958", "text": "calculateProduct(...rest) {\n console.log('Please use the multiply method instead')\n return this.multiply(...rest);\n }", "title": "" }, { "docid": "b42c302609cf4f8584e1c72af9973bdd", "score": "0.4717254", "text": "function tu(t) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, function () {\n var e;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, function (n) {\n return [2\n /*return*/\n , $i((e = C(t)).localStore).then(function (t) {\n return Js(e, t);\n })];\n });\n });\n}", "title": "" }, { "docid": "72a95c1e1243c1ac36e4ecb79e0b79f0", "score": "0.47069058", "text": "*[Symbol.iterator]() {\n let node = this.head; \n while (node) {\n yield node; \n node = node.nextNode; \n }\n }", "title": "" }, { "docid": "4db20c29ba1d7890e55eb374f87531bb", "score": "0.47058862", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while(node) {\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "70d17e95aca848dc11bdd1a3b7544c2d", "score": "0.47042295", "text": "__iii() { }", "title": "" }, { "docid": "51045d3e513753b1480b8c107997dfc2", "score": "0.47018108", "text": "function CmpDef(f, proto) { //U: definir un componente de UI que se puede usar como los otros de pReact+Semantic ej. Button, le pasa una variable \"my\" como parametro a \"f\" ej. para hacer \"my.render= ...\"\r\n\tproto= proto || Component;\r\n\tf= f || function () {};\r\n\r\n\tvar myComponentDef= function (...args) {\r\n\t\tvar my= this; \r\n\t\tproto.apply(my,args); //A: initialize with parent\r\n\t\tmy.state= my.state || {}; //A: siempre hay state\r\n\r\n\t\tmy.withValue= function (k, xfrm, dst, xfrmShow, onRef) { \r\n\t\t\tif (k[0]!='{') k='{state{'+k; //A: set y get_p requieren que empiece con sep\r\n\t\t\tdst= dst || my;\r\n\t\t\txfrmShow= asFun(xfrmShow);\r\n\t\t\tonRef= asFun(onRef);\r\n\r\n\t\t\tvar v= get_p(dst,k);\r\n\t\t\tvar vs= xfrmShow(v);\r\n\t\t\tvar r= { //U: conectar un input a estado usando { ... my.withValue('/pepe') }\r\n\t\t\t\tonChange: fSetValue(k,dst,xfrm),\r\n\t\t\t\tvalue: vs,\r\n\t\t\t\tref: el => { onRef(el,vs)},\r\n\t\t\t};\r\n\t\t\tlogm(\"DBG\",3,\"Value Get\",{k,v,r});\t\r\n\t\t\treturn r;\t\r\n\t\t};\r\n\r\n\t\tmy.setValue= function (k, xfrm, dst, cmp) { \r\n\t\t\tif (k[0]!='{') k='{state{'+k; //A: set y get_p requieren que empiece con sep\r\n\t\t\txfrm= xfrm==null ? true : xfrm; //DFLT\r\n\t\t\tdst= dst || my;\r\n\t\t\tvar v= get_p(dst,k);\r\n\t\t\treturn { //U: conectar un input a estado usando { ... my.withValue('/pepe') }\r\n\t\t\t\tonClick: fSetValue(k,dst,xfrm),\r\n\t\t\t\tvalue: v,\r\n\t\t\t\tactive: cmp && cmp.toggle && (v==xfrm),\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tmy.forValue= function (k,cmp,xfrm,xfrmShow,onRef) { \r\n\t\t\tif (cmp && cmp.cmp=='Checkbox') { //A: necesita adaptacion :P\r\n\t\t\t\tvar xfrm0= asFun(xfrm);\r\n\t\t\t\txfrm= (_,vp) => (!vp); //A: toggle, lo contrario de lo que estaba\r\n\t\t\t\tvar onRef0= asFun(onRef0);\r\n\t\t\t\tonRef= (e,v) => { e && e.setState({checked: v}); }; //A: hay que sincronizarlo a mano\r\n\t\t\t}\r\n\t\t\treturn Object.assign({cmp: 'Form.Input', placeholder: k, ... my.withValue(k,xfrm,null,xfrmShow, onRef)}, cmp); \r\n\t\t}\r\n\r\n\t\tmy.toSet= function(k,xfrm,cmp) { return Object.assign({cmp: 'Button', children: k, ... my.setValue(k,xfrm,my,cmp)}, cmp);}\r\n \r\n\t\tf.apply(my,[my].concat(args));\r\n\t\t//A: llamamos la funcion que define el componente con la instancia\r\n\t\tmy.renderImpl= my.render;\r\n\t\tmy.render= function (props, state) {\r\n\t\t\tvar x= my.renderImpl.apply(this,[props,state]);\r\n\t\t\tif (typeof(x)=='object') { \r\n\t\t\t\tif (x.$$typeof) { return x; } //A: es pReact\r\n\t\t\t\telse { return cmp(x); }\r\n\t\t\t}\r\n\t\t\telse { return h('div',{},x); };\r\n\t\t}\r\n\t}\r\n\r\n\tvar p= myComponentDef.prototype= new proto(); \r\n\r\n\tp.toProp= function (name) {\t//U: para usar con onChange u onInput\r\n\t\treturn (e) => { this[name]= e.target.value; } \r\n\t}\r\n\tp.refresh= function (kv) { this.setState(kv || {}); } //U: redibujar \r\n\r\n\treturn myComponentDef;\r\n}", "title": "" }, { "docid": "16f61948543754a8d0c23a92197e7e52", "score": "0.46913934", "text": "[Symbol.iterator]() {\n return this.data[Symbol.iterator]();\n }", "title": "" }, { "docid": "6ed9802b2d33ca9efba6617f72a2868a", "score": "0.46861178", "text": "function ap(that) {\n return ReaderT(x => Z.ap(that, runWith(x)))\n }", "title": "" }, { "docid": "e9195f82fc9eb267795d4a783e5d4606", "score": "0.46786648", "text": "*[Symbol.iterator](){\n let node = this.head;\n while(node){\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "602bbbd6f89445a279ea2cd1e56c4f05", "score": "0.46710044", "text": "ap(promise) {\n return this.map(func => {\n return promise.map(func);\n });\n }", "title": "" }, { "docid": "4ba97b30748d3b3404f36c517677ece8", "score": "0.46683243", "text": "_decorateStorageCall(creator, decorateMethod) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return decorateMethod((...args) => {\n return this.hasSubscriptions\n ? this._rpcCore.state.subscribeStorage([validate_1.extractStorageArgs(creator, args)]).pipe(operators_78.map(([data]) => data) // extract first/only result from list\n )\n : this._rpcCore.state.getStorage(validate_1.extractStorageArgs(creator, args));\n }, {\n methodName: creator.method,\n overrideNoSub: (...args) => this._rpcCore.state.getStorage(validate_1.extractStorageArgs(creator, args))\n });\n }", "title": "" }, { "docid": "ae31bf401a18665bef8e6f9f9f726bcd", "score": "0.46620145", "text": "[Symbol.iterator]() {\n\t\treturn this;\n\t}", "title": "" }, { "docid": "3c6718b7213ca5e35f952ec8540ff83c", "score": "0.46582928", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "a6469c1df031f51ade040f700f2f5c49", "score": "0.4647771", "text": "[Symbol.asyncIterator]() {\n return this;\n }", "title": "" }, { "docid": "9250da408b3c13014eece57c7c5e0044", "score": "0.46409652", "text": "[Symbol.asyncIterator]() {\n return this;\n }", "title": "" }, { "docid": "d1e64561aff4b0f48cba49ca49b2cdc9", "score": "0.46408054", "text": "*[Symbol.iterator]() {\n yield* this.#value;\n }", "title": "" }, { "docid": "7035c25cb644fbb70f6072e7f62d94bb", "score": "0.4638544", "text": "function MutableWrapper(mutable) {\n var wrapper = {\n \n // This calls the function defined as module.exports.mutate in the mutation file\n // Create mutations like exports.mutate = function($, mutable) { ... }\n mutate: function mutate(mutation) {\n var dir = path.dirname(mutable.___module.filename);\n mutation = path.join(dir, 'mutations', mutation);\n \n console.log('[Mutable] Applying mutation: ' + mutation);\n \n require(mutation).mutate(mutable, mutable.___module.mutable);\n \n return wrapper;\n },\n \n // This gets the exports as previously set, and combines them in an object\n instance: function getMutableInstance() {\n var x = mutable.___exports;\n \n // If exportAs was used, return that export only\n if(x.only) {\n \n // Execute it first if requested\n if(x.onlyExec && typeof mutable[x.only] === 'function')\n return mutable[x.only].apply(mutable.___module, arguments);\n else\n return mutable[x.only];\n } else {\n \n // Assemble all exports\n var obj = {};\n for(var i = 0; i < x.length; i++)\n obj[x[i]] = mutable[x[i]];\n return obj;\n }\n }\n };\n return wrapper;\n}", "title": "" } ]
8030f80377b8bbea9d33ec1b0958be96
Gets the name of the current station and saves it as a preset. Called when the 'Save' button is pressed.
[ { "docid": "971cafbdbdb8e1f599371cebc9788788", "score": "0.7121461", "text": "function savePreset() {\n var freq = getFrequency();\n var preset = presets.get(freq);\n var name = preset ? preset['name'] : '';\n var display = band.toDisplayName(freq, true);\n AuxWindows.savePreset(freq, display, name, band.getName(), band.getMode());\n }", "title": "" } ]
[ { "docid": "e0d0025a78892bc1f30453328f00a59c", "score": "0.7114521", "text": "function saveCurrentStation() {\n if (band) {\n selectedStations['currentBand'] = band.getName();\n selectedStations['bands'][band.getName()] = getFrequency();\n chrome.storage.local.set({'currentStation': selectedStations});\n }\n }", "title": "" }, { "docid": "59184bd66e2b173fee7dd03e13f3bf21", "score": "0.67368513", "text": "function saveCurrentStation() {\n chrome.storage.local.set({'currentStation': fmRadio.getFrequency()});\n }", "title": "" }, { "docid": "c1061bdf7f7ef94aa4de8621f9a637a0", "score": "0.65061367", "text": "function savePreset() {\n chrome.app.window.create('savedialog.html', {\n 'bounds': {\n 'width': 400,\n 'height': 100\n },\n 'resizable': false\n }, function(win) {\n var frequency = getFrequencyMHz();\n win.contentWindow['opener'] = window;\n var stationData = {\n 'frequency': frequency\n };\n if (frequency in presets) {\n stationData['name'] = presets[frequency];\n }\n win.contentWindow['station'] = stationData;\n });\n }", "title": "" }, { "docid": "80b6b8e73bd3c143427e1e3f4241a08d", "score": "0.6367672", "text": "function Save() {\n\t\twin.name = JSON.stringify(store);\n\t}", "title": "" }, { "docid": "42c44f49f4e475e54f2898ff92d5f972", "score": "0.6330222", "text": "function Save() {\r\n win.name = JSON.stringify(store);\r\n }", "title": "" }, { "docid": "dcb367b89e784dffbdc159b51d5c8e98", "score": "0.6264751", "text": "save() {\n // clone existing preset then update clone with latest settings\n const source = this.scope['preset'];\n const preset = this.clone(source);\n\n // get PresetService(s) that support uodate()\n this.getService(OsLayerPreset.PresetServiceAction.UPDATE).then(\n (service) => {\n service.update(preset).then(\n this.saveSuccess.bind(this),\n this.onServiceFailure.bind(this, 'Could not save Preset'));\n },\n (msg) => {\n GoogLog.error(LOGGER, '' + msg);\n }\n );\n }", "title": "" }, { "docid": "2f7f663bbd4fc2709f1ef1dd09e42c8c", "score": "0.61336076", "text": "function setStation(newStation) {\n player.station = newStation;\n player.stationNumber = newStation.stationNumber;\n player.genreNumber = newStation.genreNumber;\n $(\"#station-text\").text(newStation.info);\n $(\"#genre-text\").text(newStation.genre);\n}", "title": "" }, { "docid": "c5bbc086a655751fb57cd95fe0db6bf4", "score": "0.6086692", "text": "function globalSave(name) {\n\n const scene = $('#jsonscene').val();\n\n // console.log(txt);\n localStorage.setItem(name, scene);\n}", "title": "" }, { "docid": "3c106267103e88121c5ac9fcf29eb009", "score": "0.5960097", "text": "function loadCurrentStation() {\n chrome.storage.local.get('currentStation', function(cfg) {\n if ('number' === typeof cfg['currentStation']) {\n selectedStations = {\n 'currentBand': 'FM',\n 'bands': {\n 'FM': cfg['currentStation']\n }\n };\n } else if (cfg['currentStation']) {\n selectedStations = cfg['currentStation'];\n }\n selectBand(Bands[settings.region][selectedStations['currentBand']]);\n var newFreq = selectedStations['bands'][band.getName()];\n if (newFreq) {\n setFrequency(newFreq, false);\n }\n });\n }", "title": "" }, { "docid": "62e1c1742b0f9d01d9a3cd9a7888f1de", "score": "0.5957105", "text": "function saveCurrentSet() {\n if (!currentSet.name) {\n const inputValue = $headerElem.querySelector('.new-set-name').value;\n \n if (!validateSetNameInput(inputValue) || currentSet.ids.length === 0) {\n return;\n }\n\n currentSet.name = inputValue;\n }\n\n allSets[currentSet.name] = currentSet.ids;\n chrome.storage.sync.set({[setsStorageKey]: allSets}, () => {\n closeSetEditor();\n });\n }", "title": "" }, { "docid": "7f9d0b9b12825bc45eac04b20ec9a4fe", "score": "0.5904912", "text": "function playerName() {\r\n var player = document.getElementById(\"player\").value;\r\n localStorage.setItem(\"playerName\", player);\r\n}", "title": "" }, { "docid": "568facd840b5ac91ef3d34431ac474d8", "score": "0.58476925", "text": "function setNewSave () {\n localStorage.setItem('champion', JSON.stringify(atualChampion))\n }", "title": "" }, { "docid": "a9c5bee47897017e11a5bbeb8130d0b9", "score": "0.5812699", "text": "function saveCurrentState(nameInput) {\n if (!gridIsEmpty()) {\n var currentState = {\n name: nameInput,\n setup: copyDrumsList(allDrums),\n tempo: bpm,\n };\n savedStates.push(currentState);\n generateSavedStateBox(currentState, document.getElementById('saves'));\n try {\n localStorage.savedStates = JSON.stringify(savedStates);\n } catch (error) {\n console.error('Unable to save to localStorage:', error);\n }\n }\n}", "title": "" }, { "docid": "d29f223b7c9c1af8786ad6e162e8699c", "score": "0.5810574", "text": "updateStation(ev) {\n this.setState({\n\t\t\tstationName: event.target.value\n\t\t});\n\t\twindow.localStorage.setItem('stationName', (event.target.value) || \"\");\n }", "title": "" }, { "docid": "5d017dcd7b681f2f4165937adf67ef00", "score": "0.5773016", "text": "function savePattern() {\n // TODO: better place to set the title?\n let title = Utilities.getStringFromInputID(names.pattern_name);\n State.getCurrentState().displayPattern.title = title;\n writeDebug(title, \"Input title:\");\n let fileString = JSON.stringify(State.getCurrentState().displayPattern);\n // TODO: if not input, default title\n // TODO: test that there is always a title\n window.localStorage.setItem(title, fileString);\n}", "title": "" }, { "docid": "3f2bc77b0831099e6486fc64fdc8938e", "score": "0.57725453", "text": "function loadCurrentStation() {\n chrome.storage.local.get('currentStation', function(cfg) {\n setFrequency(cfg['currentStation'], false);\n });\n }", "title": "" }, { "docid": "e25c7f1b60b1f808a51a72ef83efa3d1", "score": "0.5749336", "text": "saveArt(){\n this.name = prompt('Enter File Name', this.name);\n if(this.name)\n {\n localStorage.setItem(`art_${this.name}`, JSON.stringify(app.art));\n }\n }", "title": "" }, { "docid": "27b4587f0bf26aa8227ee397647a71e1", "score": "0.56902367", "text": "function saveSettings(){\n localStorage[\"pweGameServerStatus\"] = gameselection;\n //console.log('saved: ' + gameselection);\n}", "title": "" }, { "docid": "3c1a69d64a1ae010cd9f66038277968f", "score": "0.56773734", "text": "function launchSave() {\n\tif (!(currentProgram == null || saveNameInput.value == \"\")) {\n\t\tvar name = saveNameInput.value;\n\t\tsave(name, currentProgram);\n\t\tsaveLevel.style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "6b310f2876e4befae11e6ca83b6d6240", "score": "0.5544368", "text": "function displayStationName(station) {\n document.getElementById(idName).innerText = station.name;\n}", "title": "" }, { "docid": "9f1419ecc6143e8d1106c471c88cd19a", "score": "0.5516417", "text": "function saveLocalStorage() {\n var apptDeets = $(this).siblings('textarea').val();\n var apptTime = $(this).parent().attr('id');\n localStorage.setItem(apptTime, apptDeets);\n console.log(apptDeets);\n console.log(apptTime);\n}", "title": "" }, { "docid": "4aa13650de3b7d8fe077b9b69972ffd6", "score": "0.5500738", "text": "function savePlayerNames() {\n let namesArr = playersNamesFromUi();\n let index = 0;\n namesArr.forEach(function (name) {\n Glob.playerNames[index] = name;\n index++;\n });\n saveLocal('Glob.playerNames', Glob.playerNames);\n}", "title": "" }, { "docid": "f97dd670b5835fbb0aaa447ad78d344e", "score": "0.54878074", "text": "#save() {\n\t\tsetOptions(this.#name, this.#config);\n\t}", "title": "" }, { "docid": "9efba43c2169d0a234b3fcf8e2667f0f", "score": "0.54683435", "text": "function saveToolRemember(toolname) {\n //var tool = getTool();\n //Number(sizemodifier.querySelector(\"[data-selected]\").id.replace(\"size\",\"\"));\n globals.toolRemember[toolname] = {\n \"sizemodifier\" : document.getElementById(\"sizemodifier\").querySelector(\"[data-selected]\").id,\n \"sizetext\" : document.getElementById(\"sizetext\").value, \n \"patternselect\" : document.getElementById(\"patternselect\").value\n };\n console.log(`Saved tool ${toolname}: `, globals.toolRemember[toolname]);\n}", "title": "" }, { "docid": "a312c54c4c6d6be96c2f041cce50f125", "score": "0.54679614", "text": "function saveAppt() {\n let button = $(this);\n let textArea = button.prev();\n let id = textArea.attr(\"id\");\n let appt = textArea.val();\n localStorage.setItem(id, appt);\n \n}", "title": "" }, { "docid": "812e12f43fd98952f48004f1ab3cddd4", "score": "0.5458099", "text": "function saveData() {\n if (init == true) {\n var toSave = { player: player };\n localStorage.setItem(\"IncRPG_Save\",JSON.stringify(toSave));\n console.log(\"Game saved!\");\n };\n}", "title": "" }, { "docid": "97c18a2b939621b8b6738ae32cf6dac6", "score": "0.54419893", "text": "function getName(){\n if(localStorage.getItem('player-name') === null){\n playerName.textContent = 'Player1';\n }\n else{\n playerName.textContent = localStorage.getItem('player-name');\n }\n}", "title": "" }, { "docid": "6b7d4f7684220b5002f6f70d084e9ff4", "score": "0.54394054", "text": "function save() {\n \n const content = JSON.stringify(ENGINE, (key, value) => {\n if(['F_FPS', 'save', 'update'].indexOf(key) !== -1) return undefined;\n return value;\n }, 2);\n \n fs.writeFile(`${local}/Platform/Settings/engine.json`, content, (err) => {\n if(err) console.error('alert error')\n })\n}", "title": "" }, { "docid": "fec2f2fb6ac57e3d38febf7e0ec7ae81", "score": "0.54336107", "text": "setCurrentStation(station) {\n if ((station === undefined) || (station === this.currentStation))\n return;\n else if (this.currentStation) // there is a current station\n this.currentStation.classList.remove(\"highlight\");\n\n station.classList.add(\"highlight\");\n this.currentStation = station;\n\n const mainName = document.querySelector('.infos-main-title .name');\n const mainCity = document.querySelector('.infos-main-title .city');\n mainName.textContent = station.dataset.name;\n mainCity.textContent = station.dataset.city;\n\n for (let info of document.querySelectorAll('.info')) {\n const prop = info.dataset.property;\n info.querySelector('.info-value').textContent = station.dataset[prop];\n }\n }", "title": "" }, { "docid": "6a636e40ee212a3ae226a26f58439986", "score": "0.54272544", "text": "function saveOptions() {\n var list = document.getElementById(\"IDWeatherRegion\");\n var index = list.selectedIndex;\n window.localStorage[\"region\"] = list.options[index].value;\n\n toggleSaveButtonStatus(true);\n}", "title": "" }, { "docid": "1e26992a0703067acb505e8d9f8696e6", "score": "0.54227847", "text": "function save_name() {\n\tvar name = $('#cue_name').val();\n\tupdate_cue_name(event_obj.cue_list, cue_id, name);\n}", "title": "" }, { "docid": "4ca7413e8d62f231acb5d37d983d3d64", "score": "0.5384259", "text": "function save() {\n STORAGE.writeJSON('qmsched.json', settings);\n eval(STORAGE.read('qmsched.boot.js')); // apply new schedules right away\n}", "title": "" }, { "docid": "67a87fdde83025e961edd253b568a314", "score": "0.5354654", "text": "function SaveSet(type) {\n var Sparams;\n if (type === \"Single\") {\n VarUpdate();\n SingleName = document.getElementById(\"Slot\").value;\n SingleSlot = document.getElementById(\"Slot\").value;\n Sparams = SingleName + \"&\" + BetSize + \"&\" + x + \"&\" + Odd + \"&\" + HighLow + \"&\" + Change + \"&\" + RepeatWin + \"&\" + RepeatLosse + \"&\" + BetPat + \"&\" + BetWin + \"&\" + BetX + \"&\" + FinalBetStop + \"&\" + AutoWithdraw + \"&\" + AW100 + \"&\" + MultiSwitch + \"&\" + T2C + \"&\" + Crypto;\n localStorage.setItem(SingleSlot, Sparams);\n messageMe(\"Save done: \" + SingleSlot + \".\" + SingleName);\n } else if (type === \"Auto\") {\n ABVarUpdate();\n ABName = document.getElementById(\"SlotName\").value;\n ABSlot = document.getElementById(\"Slot\").value;\n Sparams = ABName + \"&\" + BetSize + \"&\" + x + \"&\" + Odd + \"&\" + HighLow + \"&\" + Change + \"&\" + R2bbCheckWin + \"&\" + R2bbWin + \"&\" + R2bbCheckLosse + \"&\" + R2bbLoss + \"&\" + StopMaxBalance + \"&\" + StopMinBalance + \"&\" + MaxPayIn + \"&\" + ResetBB + \"&\" + StopAfter + \"&\" + MultiMax + \"&\" + Round + \"&\" + BetPat + \"&\" + BetWin + \"&\" + BetX + \"&\" + FinalBetStop + \"&\" + AutoWithdraw + \"&\" + ABAW100 + \"&\" + MultiSwitch + \"&\" + T2C + \"&\" + ReplayProfit + \"&\" + Crypto;\n localStorage.setItem(ABSlot, Sparams);\n messageMe(\"Save done: \" + ABSlot + \".\" + ABName);\n } else if (type === \"System\") {\n SysInjector();\n SysName = document.getElementById(\"SlotName\").value;\n SysSlot = document.getElementById(\"Slot\").value;\n Sparams = SysName + \"&\" + SysChoice + \"&\" + SysLabSwitch + \"&\" + BetSize + \"&\" + x + \"&\" + Odd + \"&\" + HighLow + \"&\" + Change + \"&\" + SysStopWin + \"&\" + SysStopWinAmount + \"&\" + SysStopLosse + \"&\" + SysStopLosseAmount + \"&\" + XMulti + \"&\" + AutoWithdraw + \"&\" + SysAW100 + \"&\" + MultiSwitch + \"&\" + T2C + \"&\" + BetX + \"&\" + Crypto;\n localStorage.setItem(SysSlot, Sparams);\n messageMe(\"Save done: \" + SysSlot + \".\" + SysName);\n } else if (type === \"General\") {\n localStorage.setItem(\"ServerOn\", document.getElementById('ServerOn').checked);\n localStorage.setItem(\"Email\", document.getElementById('Mail').value);\n localStorage.setItem(\"EAddy\", document.getElementById('EAddy').value);\n SetGenSet();\n Sparams = \"GenSlot&\" + AWBtcAmount + \"&\" + AWDogeAmount + \"&\" + AWLtcAmount + \"&\" + audioLosse.volume + \"&\" + audioBreak.volume + \"&\" + audioCover.volume + \"&\" + audioStop.volume + \"&\" + audioErr.volume + \"&\" + BetsSeed + \"&\" + SeedCheck;\n localStorage.setItem(\"GenSlot\", Sparams);\n }\n}", "title": "" }, { "docid": "7adc0951d07cd855f27a6cd19589ed2e", "score": "0.5349203", "text": "function StorePlayerData()\n{\n\n\tvar name = document.forms[0][\"playername\"].value;\n\n\tlocalStorage.setItem(\"playername\", name);\n\n\n\tvar goods = document.forms[0][\"Perk\"].value;\n\n\tlocalStorage.setItem(\"Perk\", goods);\n\n\n}", "title": "" }, { "docid": "2837c1ebc6bb54d66c761da750fe330e", "score": "0.5339007", "text": "function saveToLocal(playerSelection) {\n\tlocalStorage.setItem('charGender', playerSelection[0]);\n\t$('#gender').text(playerSelection[0]);\n\tlocalStorage.setItem('charRace', playerSelection[1]);\n\t$('#race').text(playerSelection[1]);\n\tlocalStorage.setItem('charRange', playerSelection[2]);\n\tlocalStorage.setItem('charStyle', playerSelection[3]);\n\tlocalStorage.setItem('charClass', playerSelection[4]);\n\t$('#class').text(playerSelection[4]);\n}", "title": "" }, { "docid": "48b01c9c1d95a73fee4442b8217ab380", "score": "0.532944", "text": "function chooseStation(event) {\r\n const station = event.target;\r\n const stationSrc = event.target.getAttribute('data-radio-station');\r\n\r\n audio.src = stationSrc;\r\n audio.play();\r\n playButton.disabled = false;\r\n\r\n toggleSelectedStation(station);\r\n togglePlayDisplay();\r\n }", "title": "" }, { "docid": "3ca1fdb0aab9f7377cc565e87e881433", "score": "0.5320189", "text": "function setSelectedIntern(intern) {\r\n\tlocalStorage.setItem(\"selectedIntern\", intern);\r\n}", "title": "" }, { "docid": "9588d5a28b77941b7dce7872250d7965", "score": "0.5316946", "text": "function saveStory() { \n let storyName = document.querySelector(\"#name_input\").value\n let storyHTML = document.querySelector(\"#story_editor\").value\n localStorage.setItem(storyName, storyHTML) // Stores the name and story as key/value pair\n}", "title": "" }, { "docid": "f66ebb316d002fbf61b4c1fba55a5384", "score": "0.5315882", "text": "function saveState() {\n localStorage.setItem(\n 'arp_state',\n JSON.stringify({\n tempo: tempo,\n div: divSelect.value,\n mode: modeSelect.value,\n range: rangeSelect.value,\n gate: gateSelect.value,\n clockMode: clockModeSelect.value,\n inputDevice: inputDeviceSelect.value,\n outputDevice: outputDeviceSelect.value,\n inputChannel: inputChannelSelect.value,\n outputChannel: outputChannelSelect.value\n })\n )\n}", "title": "" }, { "docid": "608d11ac93d2a6747b70d5608a32d276", "score": "0.53090906", "text": "function saveName() {\n\tlocalStorage.setItem('receivedName', userName)\n}", "title": "" }, { "docid": "629073ec11a19d36e065f379274e33c7", "score": "0.5304296", "text": "function createPresetOfCurrent() {\r\n\tvar name = $(\".menuContentGlobal\").find(\"input\").val();\r\n\tvar preset = [];\r\n\tvar isPresetAllowed = true;\r\n\r\n\tif(!name) {\r\n\t\tconsole.log(\"Preset not Allowed: Missing Name\");\r\n\t\tisPresetAllowed = false;\r\n\t}\r\n\tif(activeGraphs.length < 1) {\r\n\t\tconsole.log(\"Preset not Allowed: No Graph\");\r\n\t\tisPresetAllowed = false;\r\n\t}\r\n\r\n\tfor(var i = 0; i < activeGraphs.length; i++) {\r\n\t\tvar graph = {};\r\n\t\tgraph.graphs = activeGraphs[i].graphs;\r\n\t\tgraph.time = activeGraphs[i].time;\r\n\t\tgraph.interpolation = activeGraphs[i].interpolation;\r\n\t\tgraph.keepUpdated = activeGraphs[i].keepUpdated;\r\n\t\tpreset.push(graph);\r\n\r\n\t\tif(activeGraphs[i].graphs.length < 1) {\r\n\t\t\tconsole.log(\"Preset not Allowed: No Station\");\r\n\t\t\tisPresetAllowed = false;\r\n\t\t}\r\n\r\n\t\tif(!activeGraphs[i].time.end && !activeGraphs[i].keepUpdated) {\r\n\t\t\tconsole.log(\"Preset not Allowed: End or Till-Now missing\");\r\n\t\t\tisPresetAllowed = false;\r\n\t\t}\r\n\t\tif(!activeGraphs[i].time.start && !activeGraphs[i].time.span) {\r\n\t\t\tconsole.log(\"Preset not Allowed: Start or Span missing\");\r\n\t\t\tisPresetAllowed = false;\r\n\t\t}\r\n\t}\r\n\tvar preset_json = JSON.stringify(preset);\r\n\r\n\tif(isPresetAllowed) {\r\n\t\t$.ajax({\r\n\t\t\turl:\"../php/savePreset.php\",\r\n\t\t\ttype:\"POST\",\r\n\t\t\tdata: {name: name, preset: preset_json},\r\n\t\t\tsuccess:function(success){\r\n\t\t\t\tconsole.log(success);\r\n\t\t\t\tif(success == \"success\") {\r\n\t\t\t\t\tconsole.log(\"Preset was created!\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.log(\"Error while creating!\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tloadAllPresets(function(json_presets){\r\n\t\t\t\t\t//Delete current presets\r\n\t\t\t\t\tallPresets = [];\r\n\t\t\t\t\t$(\".menuContentGlobal\").find(\"Option\").remove();\r\n\r\n\t\t\t\t\tvar json_presets_decoded = JSON.parse(json_presets);\r\n\t\t\t\t\tconsole.log(json_presets_decoded);\r\n\r\n\t\t\t\t\tfor(var i = 0; i < json_presets_decoded.length; i++) {\r\n\t\t\t\t\t\tvar preset_object = {};\r\n\r\n\t\t\t\t\t\tpreset_object.name = json_presets_decoded[i].Name;\r\n\t\t\t\t\t\tpreset_object.data = JSON.parse(json_presets_decoded[i].Data);\r\n\r\n\t\t\t\t\t\tif(preset_object.data[0].time.start) {\r\n\t\t\t\t\t\t\tpreset_object.data[0].time.start = new Date(preset_object.data[0].time.start);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(preset_object.data[0].time.end) {\r\n\t\t\t\t\t\t\tpreset_object.data[0].time.end = new Date(preset_object.data[0].time.end);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tallPresets.push(preset_object);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar options = \"\";\r\n\t\t\t\t\tfor(var i = 0; i < allPresets.length; i++) {\r\n\t\t\t\t\t\toptions += '<option value=\"'+allPresets[i].name+'\">'+allPresets[i].name+'</optioin>';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$(\".menuContentGlobal\").find(\"Select\").append(options);\r\n\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "65870a6dfee0d9116e3e5854650f8625", "score": "0.52539283", "text": "function setName(element) {\r\n localStorage.setItem(\"wizardName\", element.textContent);\r\n\r\n document.getElementById(\"dropdownWizard\").textContent = element.textContent;\r\n updateTextarea(document.getElementById(\"inputProblem\"));\r\n}", "title": "" }, { "docid": "f29551d3a079759e42530aae95b02536", "score": "0.524878", "text": "function saveIdea() {\n\t\t\t//save the idea\n\t\t\tlocalStorage.setItem('ideaInfo', JSON.stringify(ideaInfo));\n\t\t}", "title": "" }, { "docid": "9d4ebf22450dff64891ff63e88467eb7", "score": "0.52481174", "text": "function setName(e){\n if(e.type === 'keypress'){\n // save the data when they press enter\n if(e.which == 13 || e.keyCode == 13){\n localStorage.setItem('player-name', e.target.innerText);\n\n // prevent the text from going to the next line when pressing enter\n playerName.blur();\n }\n }\n else{\n localStorage.setItem('player-name', e.target.innerText);\n }\n}", "title": "" }, { "docid": "ffb7080bb62872a7e2550ea4cb8094ba", "score": "0.5244922", "text": "function displayPresets() {\n var saved = presets.get();\n var freqs = [];\n for (var freq in saved) {\n freqs.push(freq);\n }\n freqs.sort(function(a,b) { return Number(a) - Number(b) });\n while (presetsBox.options.length > 0) {\n presetsBox.options.remove(0);\n }\n presetsBox.options.add(createOption('', '\\u2014 Saved stations \\u2014'));\n for (var i = 0; i < freqs.length; ++i) {\n var value = freqs[i];\n var preset = saved[value];\n var label = preset['display'] + ' - ' + preset['name'];\n presetsBox.options.add(createOption(value, label));\n }\n selectCurrentPreset();\n }", "title": "" }, { "docid": "b68807bef61e30519c63bfcd5dae92cb", "score": "0.524043", "text": "function saveSettings() {\n localStorage = $(\"#city-name\").val();\n}", "title": "" }, { "docid": "4997fe6240d0d8760bdb7e58cf71e9ba", "score": "0.5233771", "text": "function changeCurrentBGM(theSong){\n\tlocalStorage.setItem(\"CurrentBGM\", theSong);\n}", "title": "" }, { "docid": "02da81e62ffed5e2f28e6d282e3d298f", "score": "0.5219357", "text": "function getsaveStorage(cityName){\n saveStorage.empty();\n let storageArr=JSON.parse(localStorage.getItem(\"save-storage\"));\n for (let i= 0; i < storageArr.length; i++){\n let newCityItem=$(\"<li>\").attr(\"class\", \"savedEntry\");\n newCityItem.text(storageArr[i]);\n saveStorage.prepend(newCityItem);\n }\n}", "title": "" }, { "docid": "b14a3221ed2724f32e3039ece08a4727", "score": "0.5204771", "text": "function saveGame() {\n var file = {\n update: gameData.update,\n beer: gameData.beer,\n beerPerClick: gameData.beerPerClick,\n beerPerClickCost: gameData.beerPerClickCost,\n grain: gameData.grain,\n money: gameData.money,\n moneyPerBeer: gameData.moneyPerBeer,\n grainCapacity: gameData.grainCapacity,\n grainCost: gameData.grainCost,\n grainPerMin: gameData.grainPerMin\n };\n\n localStorage.setItem('saveFile', JSON.stringify(file));\n}", "title": "" }, { "docid": "86c2345a5f49fdf8574810725419f4f6", "score": "0.5201721", "text": "function savePhysAmp () {\r\n currentStats.physAmp = (isNaN(parseInt(physAmpInput.val())) ? 0 : parseInt(physAmpInput.val()));\r\n updateClassSpecificStats(currentStats);\r\n if (classes[currentClass].name == \"Valkyrie\") {\r\n updateCurrentStatsDisplay();\r\n }\r\n}", "title": "" }, { "docid": "d3bcc1799c0d0c09f030f1f8664cf992", "score": "0.5178021", "text": "function saveList(list) {\n chrome.storage.local.set({'stations': list}, function() {\n console.log('stations stored!');\n });\n}", "title": "" }, { "docid": "c4c10bbb5ae82bb34e6f6e421c6a8783", "score": "0.5161318", "text": "function saveGame(objButton){\n var fired_button = objButton.value;\n localStorage.setItem(\"datetime\", fired_button);\n}", "title": "" }, { "docid": "da59dbd774171ba9d9173ac712a50993", "score": "0.51602584", "text": "function saveLocal() {}", "title": "" }, { "docid": "df4ddcdd9b8bf6f1b7ac055d4c8498ea", "score": "0.5155881", "text": "function save(override) {\n\tif (changed) {\n\t\tchanged = false;\n\t\tsaveButton.src = \"/assets/images/savegray.png\";\n\t\tsaveButton.style.cursor = \"initial\";\n\t\tif (filename !== \"\") {\n\t\t\tPOST(\"/api/savefile\", {\"file\": filename, \"content\": editor.getValue()});\n\t\t\tif (filename.match(/^Untitled([0-9]+)?\\.py$/) && !override) {\n\t\t\t\tconsole.log('Filename match');\n\t\t\t\tsaveRename(filename);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2d4432b9e0192208e017cf2f7fb903fe", "score": "0.5154555", "text": "function saved() {\n localStorage.setItem(\"send-email\", sendEmail.checked);\n localStorage.setItem(\"profile-public\", profilePublic.checked);\n localStorage.setItem(\"timezone\", timeZone.value);\n}", "title": "" }, { "docid": "6d8ac824b09fb51cf9a5bc0ac20bc0e1", "score": "0.51521975", "text": "function saveData() {\n let state = JSON.stringify(currentState)\n localStorage.setItem('color-game', state);\n}", "title": "" }, { "docid": "a6b85988b8c222e1fef6ac9040430051", "score": "0.51511437", "text": "function saveCountry(text) {\n localStorage.setItem(selectCountry, text);\n}", "title": "" }, { "docid": "8953859b629fb122a6e40b7c10554927", "score": "0.5151141", "text": "function saveGame() {\n //Aktuelles Inventar wird in die JSON-Datei geschrieben\n textAdventure.jsonConfigData.User.item = textAdventure.inventory;\n //Current Room wird festgelegt\n textAdventure.jsonConfigData.User.currentRoom = textAdventure.currentRoom.name;\n //Aktueller Lebensstand wird in die JSON-Datei geschrieben\n textAdventure.jsonConfigData.User.health = textAdventure.health;\n textAdventure.printOutput(\"<div class='game-Over'><b>Das Spiel wurde gespeichert. Schaue in deinen Downloads.<br/>Zum Weiterspielen starte das Spiel und lade die Datei.</b></div>\");\n save(textAdventure.jsonConfigData, \"gameData\");\n }", "title": "" }, { "docid": "574e5f84cb95542bcc90bbcf7e3948bd", "score": "0.5146665", "text": "function saveWorkspace() {\n var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var xmlText = Blockly.Xml.domToPrettyText(xmlDom);\n\n localStorage.setItem('blockly.xml', xmlText);\n localStorage.setItem('language', document.getElementById('language').value);\n localStorage.setItem('lang1', document.getElementById('lang1').value);\n localStorage.setItem('lang2', document.getElementById('lang2').value);\n}", "title": "" }, { "docid": "6f3a2e3ef41b4cd3746d9508e70f1a85", "score": "0.5143417", "text": "function saveEditName() {\n if (selectedPerformance !== undefined) {\n editingname = false;\n var performance = nameEditingPerformance.data();\n performance.updateName($(\"#performance-name\").val());\n\n loadEditPerformance();\n }\n}", "title": "" }, { "docid": "a3b0891984bbf6443ca40ed80abd17d9", "score": "0.51346666", "text": "function saveName() {\n\t\t\t\n\t\t\tif (nameElement.value === \"\" || nameElement.value === \" \" || nameElement.value === \" \") {\n\t\t\t\t//parag = document.createElement(\"p\");\n\t\t\t\t//n = document.createTextNode(\"Please enter in valid username.\");\n\t\t\t\t//parag.appendChild(n);\n\t\t\t\t//e = document.getElementById(\"beginCanvas\");\n\t\t\t\t//e.appendChild(parag);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//e.removeChild(parag);\n\t\t\t\tcurrentStats.theName = nameElement.value;\n\t\t\t\tplayer.push(currentStats.theName);\t\t\t\n\t\t\t\tconsole.log(player);\n\t\t\t\tpicSelect();\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "724321dc230221cb0897e636c87ac409", "score": "0.5134181", "text": "function save() {\n var data = {};\n data[this.id] = this.value;\n chrome.storage.local.set(data);\n}", "title": "" }, { "docid": "769e437c9a2237d647a6ac9bd42a2b22", "score": "0.5129476", "text": "function saveEvent(event) {\n var btn = $(event.target);\n var i = saveButtonEl.index(btn);\n\n var text = textAreaEl.eq(i);\n var value = text.val();\n var key = text.parent(\"div\").attr(\"data-hour\");\n localStorage.setItem(key, value);\n}", "title": "" }, { "docid": "e17049f6cf7adbb3f2c3e17c0824e263", "score": "0.51244485", "text": "function handleSave(event){\n var eventTarget = event.target;\n if (eventTarget.classList.contains('fa-save')) {\n // filtering out to only handle clicks on btn divs\n let parentDiv = eventTarget.parentElement.parentElement;\n let time = parentDiv.querySelector('.hour').textContent;\n let note = parentDiv.querySelector('textarea').value;\n \n plannerObj[time] = note;\n let data = JSON.stringify(plannerObj);\n localStorage.setItem('calendar', data);\n \n }\n}", "title": "" }, { "docid": "7facec8d129d4d83e2b1d63c025a5004", "score": "0.5122162", "text": "function save() {\r\n this.player1= document.getElementById(\"player1\").value;\r\n this.player2= document.getElementById(\"player2\").value;\r\n \r\n // Muestra los nombres\r\n console.log(\"Jugador uno : \" + this.player1);\r\n console.log(\"Jugador dos : \" + this.player2);\r\n\r\n // Indica quien empieza\r\n console.log(\" - Empieza \" + this.player1);\r\n}", "title": "" }, { "docid": "94cb64e6cf05895fe293c5e57d28122a", "score": "0.5122046", "text": "function store () {\n\tname = textAnswer.value;\n\tplay = textPlay.value;\n\tconsole.log(name + \" \" + play);\n}", "title": "" }, { "docid": "42b818951c6799601e0138e007725692", "score": "0.5111568", "text": "function updatePlayerNameField ( selectedGamed ) {\n nameInput.value = localStorage.key( selectedGamed );\n}", "title": "" }, { "docid": "5c84da8080766b5894fc74d885a92729", "score": "0.5106455", "text": "function updateTrackName()\n{\n\t// This will be null if nothing is playing.\n\tvar playerTrackInfo = player.track;\n\t\n\t// set the current track on the server and save\n\tJukeBoxRoomFromParse.set(\"currentTrack\", playerTrackInfo.uri);\n\tJukeBoxRoomFromParse.save();\n\t\n\t$('#now_playing').empty();\n\tif (playerTrackInfo == null) {\n\t\t$('#now_playing').append(\"<p>Nothing playing</p>\");\n\t} else {\n\t\tvar track = playerTrackInfo.data;\n\t\t$('#now_playing').append(\"<p> Playing \" + playerTrackInfo.name + \" by \" + playerTrackInfo.album.artist.name + \"</p>\");\n\t}\n}", "title": "" }, { "docid": "64f8f2044854161a5c38fa532d77cf46", "score": "0.50964445", "text": "function saveEvent() {\n var target = $(this);\n var eventName = target.siblings(\"input\").val();\n var selectedTimeSlot = target.siblings(\"h1\").text();\n userEvents[selectedTimeSlot] = eventName;\n\n localStorage.setItem(\"Event\", JSON.stringify(userEvents));\n}", "title": "" }, { "docid": "c92b01adba9a23b11ea44d2087376237", "score": "0.5092419", "text": "function saveEvent(event) {\n event.preventDefault();\n const eventInput = $(event.target).parent().children(\".planner\");\n //save text in the box to local storage\n console.log(eventInput.val());\n const timeSlot = $(event.target).parent().attr(\"id\");\n console.log(timeSlot);\n localStorage.setItem(timeSlot, eventInput.val());\n}", "title": "" }, { "docid": "b47b1f908bed808d5a573fb489b24272", "score": "0.50862986", "text": "function selectPreset() {\n var preset = presets.get(presetsBox.value);\n if (preset) {\n if (preset['band']) {;\n var newBand = Bands[settings.region][preset['band']];\n if (newBand) {\n selectBand(newBand);\n }\n } else if (preset['mode']) {\n setMode(preset['mode']);\n }\n setFrequency(presetsBox.value, false);\n }\n }", "title": "" }, { "docid": "844e1fb49d7e4950573ef714b0bb89c5", "score": "0.5076301", "text": "function saveLocalData() {\n $(\".saveBtn\").on(\"click\", function () { // Click the save button to save that hour's tasks\n // Grab the input value\n var value = $(this).siblings(\".text-area\").val();\n // Grab the input index\n var time = $(this).siblings(\".text-area\").attr(\"id\");\n console.log(value);\n console.log(time);\n // Save both to localStorage\n localStorage.setItem(time, value);\n })\n }", "title": "" }, { "docid": "aad9087969d9a8f6224a5ebe03f0b62c", "score": "0.50679284", "text": "function savePresets() {\n chrome.storage.sync.set({'presets': presets}, displayPresets);\n }", "title": "" }, { "docid": "db5916888602cbc7f70a43bb0c1de4ff", "score": "0.5067401", "text": "function saveSetting() {\n localStorage.setItem(\"config_search_method\", g_search_method);\n localStorage.setItem(\"config_path_to_database_root\", g_path_to_database_root);\n localStorage.setItem(\"config_database_zip_url\", g_database_zip_url);\n localStorage.setItem(\"config_database_root\", g_database_root);\n localStorage.setItem(\"config_data_xml_path\", g_data_xml_path);\n localStorage.setItem(\"config_keep_awake\", g_keep_awake);\n localStorage.setItem(\"config_opc_da_server_url\", g_opc_da_server_url);\n // ons.notification.toast('Settings saved.', { timeout: 300, animation: 'fall' });\n}", "title": "" }, { "docid": "7186a0bc9c6d81fbbef0316c459bc652", "score": "0.5066825", "text": "function save() {\r\n // save function and console log and return output team\r\n for (let i = 0; i < dreamTeam.length; i++) {\r\n console.log(`Check out your Dream-Team!! ${dreamTeam[i].name}.`);\r\n return outputTeam()\r\n };\r\n }", "title": "" }, { "docid": "1ef42690ba689213ba2053f828326b60", "score": "0.50667423", "text": "function setupSave(){\n\n // Explicitly saves the current working file.\n $('#saveFile').on(\"click\", function(){\n if(isDriver && fileSelected){\n show_loader(\"Saving...\");\n saveFile();\n } else if (fileSelected === null) {\n showMessage(\"No file selected.\", true);\n }\n else{\n showMessage(\"Only the driver can save.\", true);\n }\n });\n\n setInterval(autoSave, autoSaveInterval);\n socket.on(\"save_response\", function(data){\n if(!data.errmsg){\n $(\"#loader_img\").hide();\n $(\"#loader_msg\").html(\"Saved.\");\n addConsoleMessage(\"File saved.\");\n }else{\n showMessage(\"An error occurred: \" + data.errmsg.toString(), true);\n }\n hide_loader();\n });\n }", "title": "" }, { "docid": "8eb265e7e1f09f02b309297ac0690244", "score": "0.50616384", "text": "function getStation() {\r\n switch (parseInt(localStorage.station, 10)) {\r\n case 1:\r\n case 4:\r\n return (1);\r\n case 2:\r\n case 5:\r\n return (2);\r\n case 3:\r\n case 6:\r\n return (3);\r\n }\r\n}", "title": "" }, { "docid": "4db9056adb41fdf53fbfb6cea1e08513", "score": "0.50577754", "text": "function storeToLS(tvShow) {\n seriesObj = {\n Id: tvShow.id,\n First_air_date: tvShow.first_air_date,\n Name: tvShow.name,\n Origin_country: tvShow.origin_country,\n Original_language: tvShow.original_language,\n Overview: tvShow.overview,\n Popularity: tvShow.popularity,\n Poster_path: imagePath + tvShow.poster_path\n }\n extras = {\n\n Backdrop_path: imagePath + tvShow.backdrop_path,\n Genre_ids: tvShow.genre_ids\n\n }\n totalSeries = {\n seriesObj,\n extras\n }\n localStorage.setItem(\"series\", JSON.stringify(totalSeries));\n}", "title": "" }, { "docid": "ee18f468f6e37737df67020ee23bd94d", "score": "0.5054175", "text": "function saveNine(){\n localStorage['NineData'] = $(\"#hournine\").val();\n}", "title": "" }, { "docid": "7ec4d4cf92ccce6f11a7e186140f9621", "score": "0.5039214", "text": "function saveName(text) {\n localStorage.setItem(USER_LS, text); // Function \"setItem\" => first argument = second argument\n}", "title": "" }, { "docid": "cda8530fe65c6824b0ebb1f60ad8e74d", "score": "0.5038029", "text": "function saveCountry() {\n const loadedCountry = select.value;\n localStorage.setItem(COUNTRY_LS, loadedCountry);\n}", "title": "" }, { "docid": "2caa7cff006b370f5edd86575f5923f8", "score": "0.5035749", "text": "function showStationData(stationCode,stationName) {\r\n WaterLevel(stationCode, stationName);\r\n}", "title": "" }, { "docid": "6ae4094e4ac0b9fb5770b1e39ba58a60", "score": "0.50311124", "text": "function change_preset(){\n\tvar preset = $('#select-hospital-preset').val()\n}", "title": "" }, { "docid": "77051e7c22e1e2a318c05fbb087a486a", "score": "0.50293124", "text": "function restore_options() {\n var defaultSummoner = localStorage[\"defaultSummonerName\"];\n var defaultSummonerServer = localStorage[\"defaultSummonerServer\"];\n if (!defaultSummoner) {\n return;\n }\n var defaultSummonerInputbox = document.getElementById(\"defaultSummoner\");\n defaultSummonerInputbox.value = defaultSummoner;\n var defaultSummonerServerDropDown = document.getElementById(\"defaultSummonerServer\");\n defaultSummonerServerDropDown.children[defaultSummonerServerDropDown.selectedIndex].text = defaultSummonerServer;\n}", "title": "" }, { "docid": "b360b3abcd1eef400ab241848b45ce9d", "score": "0.502679", "text": "function save() {\n\tvar xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n\t\n\tvar data = Blockly.Xml.domToPrettyText(xml);\n BlocklyDuinoServer.IDEsaveXML(data);\t\n}", "title": "" }, { "docid": "0ca63539e291fe82468a7d1b5d41af0c", "score": "0.502294", "text": "function saveCurrent(dealer) {\n if (dealer) {\n localStorage.setItem('dealer', JSON.stringify(dealer));\n $rootScope.dealer = dealer;\n }\n }", "title": "" }, { "docid": "4510c05543ca23d0e4bc75e09074d9a4", "score": "0.50194544", "text": "onSaveFile() {\n ga('send', 'event', 'file', 'saveFile');\n this.studioState_.saveToFile();\n }", "title": "" }, { "docid": "536dbf028e8cd3079dae86c75ad47bbf", "score": "0.50170463", "text": "function chooseStation() {\n var stationId = window.location.hash.substr(1);\n\n if (!stationId) {\n // this is the default if none selected\n stationId = 'nac_radio';\n }\n\n var station = STATIONS[stationId];\n var streamId = station.streamId;\n var url = station.url;\n var logo = station.logo;\n\n $('.cc_streaminfo').each(function(idx, elem) {\n // add the selected streamId onto .cc_streaminfo element IDs,\n // e.g. cc_strinfo_title => cc_strinfo_title_nundahac\n elem = $(elem);\n elem.attr('id', elem.attr('id') + '_' + streamId);\n });\n $('#radio').attr('src', url);\n $('.radiologo img').attr('src',logo);\n }", "title": "" }, { "docid": "a55ebc3c9b4d2851217206617c0eb190", "score": "0.50154424", "text": "function savePresetValue(presetType, presetOptionID) {\n\tvar map = $(\"body\").data(\"selectedPresets\");\n\tif (map == undefined) {\n\t\tmap = new Map();\n\t}\n\tmap.set(presetType, presetOptionID);\n\t$(\"body\").data(\"selectedPresets\", map);\n}", "title": "" }, { "docid": "57c91e1c0d2b6354cc6a64d5e13f376d", "score": "0.50137776", "text": "function saveToServer() {\n $('.modal').modal('hide'); // close all opened popups\n if (GUISTATE_C.isConfigurationStandard() || GUISTATE_C.isConfigurationAnonymous()) {\n LOG.error('saveToServer may only be called with an explicit config name');\n return;\n }\n var dom = confVis ? confVis.getXml() : Blockly.Xml.workspaceToDom(bricklyWorkspace);\n var xmlText = Blockly.Xml.domToText(dom);\n CONFIGURATION.saveConfigurationToServer(GUISTATE_C.getConfigurationName(), xmlText, function (result) {\n if (result.rc === 'ok') {\n GUISTATE_C.setConfigurationSaved(true);\n LOG.info('save brick configuration ' + GUISTATE_C.getConfigurationName());\n }\n MSG.displayInformation(result, 'MESSAGE_EDIT_SAVE_CONFIGURATION', result.message, GUISTATE_C.getConfigurationName());\n });\n }", "title": "" }, { "docid": "810a6f89577c13ad24a8e0fe3d584045", "score": "0.50129557", "text": "saveGame(name) {\r\n localStorage.setItem(name, JSON.stringify(new Game(\r\n name,\r\n this.activeGame.victoryMode,\r\n 'active',\r\n this.activeGame.turn,\r\n this.activeGame.turnPlayer,\r\n $('#events-list').text(),\r\n this.activeGame.board,\r\n this.activeGame.players,\r\n `${new Date().toLocaleDateString()} - ${new Date().getHours()}:${new Date().getMinutes()}`\r\n )));\r\n }", "title": "" }, { "docid": "1f01d2e096de9064534802046fbebac6", "score": "0.5008069", "text": "saveInitialBoard() {\n this.initialBoard = this.gameboard.toString()\n }", "title": "" }, { "docid": "df28282d30cb94944d58d306aa49ea02", "score": "0.5004897", "text": "function saveMagAmp () {\r\n currentStats.magAmp = (isNaN(parseInt(magAmpInput.val())) ? 0 : parseInt(magAmpInput.val()));\r\n updateClassSpecificStats(currentStats);\r\n \r\n if (classes[currentClass].name == \"Ninja\") {\r\n updateCurrentStatsDisplay();\r\n }\r\n}", "title": "" }, { "docid": "3a6908d33aceb6c0b7ea212d0cdf2690", "score": "0.5003473", "text": "function storeCurrentCity() {\n localStorage.setItem('currentCity', JSON.stringify(cityname));\n}", "title": "" }, { "docid": "c1a523a64eeec9861313e9e0800f08fd", "score": "0.5003102", "text": "function saveWeatherInfo(weatherInfo) {\n localStorage.setItem(\"weather-info\", JSON.stringify(weatherInfo));\n}", "title": "" }, { "docid": "b061274acb1b356455ae0290457f7cea", "score": "0.49853092", "text": "function saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}", "title": "" }, { "docid": "b061274acb1b356455ae0290457f7cea", "score": "0.49853092", "text": "function saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}", "title": "" }, { "docid": "b061274acb1b356455ae0290457f7cea", "score": "0.49853092", "text": "function saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}", "title": "" }, { "docid": "b061274acb1b356455ae0290457f7cea", "score": "0.49853092", "text": "function saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}", "title": "" }, { "docid": "b061274acb1b356455ae0290457f7cea", "score": "0.49853092", "text": "function saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}", "title": "" } ]
c6bdf587b2287215bc045c08ba5235ca
note I assume that the folder will always be lectureNN so we search for that
[ { "docid": "885bf2f4c76e8d78d6d5f68e075d7193", "score": "0.0", "text": "function goHome()\n{\n var url=window.location.href;\n var n = url.indexOf(\"lecture\");\n var home=url.substring(0,n)\n document.location.href=home;\n}", "title": "" } ]
[ { "docid": "1022d3826a42c503e74f4c412aa11175", "score": "0.6220207", "text": "function GetSubFoldersBook(theFolder) { \n var myFileList = theFolder.getFiles(); \n for (var i = 0; i < myFileList.length; i++) { \n var myFile = myFileList[i]; \n \n if(myFile.toString().match('__MACOSX')!=null){}\n else{\n if (myFile instanceof Folder){ \n GetSubFoldersBook(myFile); \n } \n else if (myFile instanceof File && myFile.name.match(/\\.indb$/i) && myFile.name.match(/\\._/gi) == null) { \n if(myFile.name.toString().toLowerCase().match(UnitRegex) != null || myFile.name.toString().toLowerCase().match('unit') != null ){\n unitBookFiles.push(myFile); \n unitBookFileName.push(myFile.name);\n }\n else if(myFile.name.toString().toLowerCase().match('resource') != null || myFile.name.toString().toLowerCase().match('res') != null) {\n additionalResourcesBookFiles.push(myFile); \n additionalResourcesBookFileName.push(myFile.name);\n }\n } \n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match(/\\.indd$/i) && myFile.name.match(/\\._/gi) == null) {\n if(myFile instanceof File && myFile.name.toString().toLowerCase().match('_rr_')) {\n RRInddFiles.push(myFile);\n RRInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fold')) {\n FOLDInddFiles.push(myFile);\n FOLDInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('tabs')) {\n tabsInddFiles.push(myFile);\n tabsInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fc')) {\n fcInddFiles.push(myFile);\n fcInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('_bc')) {\n bcInddFiles.push(myFile);\n bcInddFileName.push(myFile.name);\n }\n else if(myFile instanceof File && myFile.name.toString().toLowerCase().match('fm')) {\n fmInddFiles.push(myFile);\n fmInddFileName.push(myFile.name);\n }\n else {\n otherInddFiles.push(myFile);\n }\n }\n else{}\n }\n } \n}", "title": "" }, { "docid": "fec204a70ea09ef170157eee8958abb5", "score": "0.5987772", "text": "function MP3_List(x){\r\n\tvar pos=NaN;\r\n\tif(x!='/'){\r\n\t\tpos=MP3.folder_name.indexOf(document.getElementById(x).innerText);\r\n\t\tif(pos>=0){\r\n\t\t\tMP3.Findpath+='/'+MP3.folder_name[pos];\r\n\t\t\tloadWholePage('file_explorer.html','screen',End_load);\r\n\t\t}\r\n\t}\r\n \tif(x=='/'){\t\r\n \t\tpos=MP3.Findpath.lastIndexOf('/');\r\n\t\tif(MP3.Findpath!='MP3')MP3.Findpath=MP3.Findpath.substring(0, pos);\r\n\t\tloadWholePage('file_explorer.html','screen',End_load);\r\n\t\t\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "1b41a6d3ffdb80f04f6b3b495637b8b0", "score": "0.5855392", "text": "function list (args, mus, done) {\n var folder\n mus.search.paths.forEach(function (path, index) {\n folder = mus.search.getFolder(path)\n console.log(index + 1 + ' | ' + folder.title)\n })\n done()\n}", "title": "" }, { "docid": "fd51fba9b55dcd89a505bed1cc0df6b7", "score": "0.57677543", "text": "function collegeFiles() {\n console.log(\"collegeFiles\");\n\n for (var i = 0; i < DRIVE_FILES.length; i++) {\n DRIVE_FILES[i].fileType = (DRIVE_FILES[i].fileExtension == null) ? \"folder\" : \"file\";\n\n if (DRIVE_FILES[i].fileType == \"folder\") {\n\t\t\t\tconsole.log(\"DIS FOLDER: \" + college);\n if (DRIVE_FILES[i].title == college) {\n console.log(\"college\");\n\n FOLDER_ID = DRIVE_FILES[i].id;\n console.log(\"folder id College: \" + FOLDER_ID);\n }\n }\n }\n\n var query = \"\";\n\n\t\tquery = \"trashed=false and '\" + FOLDER_ID + \"' in parents\";\n var request = gapi.client.drive.files.list({\n 'maxResults': NO_OF_FILES,\n 'q': query\n });\n\n request.execute(function (resp) {\n if (!resp.error) {\n DRIVE_FILES = resp.items;\n courseFiles();\n }\n else{\n showErrorMessage(\"Error: \" + resp.error.message);\n }\n });\n}", "title": "" }, { "docid": "1da08af2652eb466db636ed584d8cd0a", "score": "0.5605867", "text": "function findMatches(startPath, accession){\n\n if (!fs.existsSync(startPath)){\n console.log(\"no dir \", startPath);\n return;\n }\n\n var files=fs.readdirSync(startPath);\n for(var i=0;i<files.length;i++){\n var filename=path.join(startPath,files[i]);\n var stat = fs.lstatSync(filename);\n if (stat.isDirectory()){\n findMatches(filename,accession); //recurse\n }\n else if (filename.indexOf(accession)>=0) {\n console.log('moving ' + filename)\n fs.rename(filename, `media/${accession}/${path.basename(filename)}`, (err) => {\n if (err) {\n console.log(err)\n }\n else {\n console.log('-- moved: ',filename);\n }\n }) \n };\n };\n}", "title": "" }, { "docid": "47d42836948f2a755afa597310bdcca4", "score": "0.55254906", "text": "function folderFind() {\n \n try {\n deletekeys();\n spreadsheet.toast(\"Folder Index Run. Please Wait...\", \"Started\", -1);\n listFolders();\n spreadsheet.toast(\"Done Indexing.\", \"Success\", -1);\n } catch (e) {\n Browser.msgBox(\"Error\", \"Sorry, Error Occured: \" + e.toString(), Browser.Buttons.OK);\n spreadsheet.toast(\"Error Occurred :( Put at D1.\", \"Oops!\", -1);\n }\n\n}", "title": "" }, { "docid": "1dbe938179a3ee366acfe0db29bd1e77", "score": "0.54499", "text": "function complete_path(folder) {\n var title = document.getElementsByTagName(\"title\")[0].innerHTML;\n var search_path;\n var search_path_css;\n \n search_path_css = folder + '/' + title;\n \n var head = document.getElementsByTagName('head')[0];\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = 'assets/'+search_path_css+'/styles.css';\n head.appendChild(link);\n \n search_path = folder + '/' + title + '/*.txt';\n sendit(search_path);\n \n }", "title": "" }, { "docid": "73f6b2c4c0ec6afe2fb4d631ec69a199", "score": "0.5394361", "text": "function catch_dir_video() {\n let path_tmp = __dirname\n path_tmp = path.join(path_tmp, \"..\")\n path_tmp = path.join(path_tmp, \"bin\")\n path_tmp = path.join(path_tmp, \"recognizerVideo\")\n path_tmp = path.join(path_tmp, \"recognizer\")\n path_tmp = path.join(path_tmp, \"att_faces\")\n path_tmp = path.join(path_tmp, \"orl_faces\")\n return path_tmp;\n}", "title": "" }, { "docid": "ca536f72cfcbabd843dea52f30ae4e79", "score": "0.53620344", "text": "async function findAndCreateFolders() {\n for await (const programme of coreInductionProgrammes) {\n mkdir(`./converted-files/mammoth-saved-md/${programme}`).then(async () => {\n const folders = await readdir(`./${programme}`);\n for await (const folder of removeHiddenFiles(folders)) {\n mkdir(`./converted-files/mammoth-saved-md/${programme}/${folder}`).then(\n async () => {\n await convertAndWriteFilesToMarkdown(programme, folder);\n }\n );\n }\n });\n }\n}", "title": "" }, { "docid": "b3697bc654832cb4667bdc5851638653", "score": "0.534877", "text": "function fileread() {\n pdfURL = testFolder;\n /* console.log(pdfURL.replace(/^.*[\\\\\\/]/, ''));*/\n xhtmlURL = testFolder.replace('.pdf', '.xhtml');\n //dialog.showMessageBox({message:xhtmlURL.toString()});\n if (fs.existsSync(xhtmlURL.toString())) {\n fs.readFile(xhtmlURL, 'utf8', callBackFunction);\n } else {\n dialog.showMessageBox({\n message: 'Mapped xhtml file not found in the selected path'\n });\n }\n}", "title": "" }, { "docid": "9f262bc66ef4dc8456a484ea0334419e", "score": "0.5344739", "text": "function readFiles() {\r\n\r\n}", "title": "" }, { "docid": "934460de853d643ae584775cef0aed23", "score": "0.53333765", "text": "function findFoldersToShow() {\n var current = $scope.currentFolder;\n var folders = _.uniq($scope.user.folders.map(folder => {\n return folder.folder\n }));\n folders = folders.map(folder => {\n\n if (current.search(folder) != -1) {\n return {\n folder: folder,\n show: false\n };\n }\n\n\n if (folder == current) {\n return {\n folder: folder,\n show: false\n };\n } else if (folder.substring(current.length + 1)\n .search('/') != -1) {\n return {\n folder: folder,\n show: false\n }\n }\n\n var rev = folder.split('')\n rev.reverse();\n var revStr = ''\n rev = rev.map(chars => {\n revStr += chars\n });\n revStr = revStr.substring(revStr.search('/'))\n .split('')\n .reverse();\n rev = ''\n revStr.map(chars => {\n rev += chars;\n })\n if (current.substring(rev.length) != '') {\n return {\n folder: folder,\n show: false\n };\n };\n\n\n // console.log(rev.substring(0).split('').reverse().join(''));\n\n\n return {\n folder: folder,\n show: true\n };\n\n })\n\n var foldercount = 0;\n folders.forEach(x => {\n if (x.show == true) {\n foldercount++\n }\n })\n if (foldercount > 0) {\n $scope.hasFolders = true;\n } else {\n $scope.hasFolders = false;\n }\n $scope.currentFolderStructure = $scope.currentFolder.split('/');\n $scope.user.folders = folders;\n\n }", "title": "" }, { "docid": "44013252e504c7ce81e362f32cfa7eab", "score": "0.52904415", "text": "static get DIRECTORY() {\n return /((?:(?!\\sS(?:eason ?)?\\d{1,3})[^\\\\/])*)[\\\\/]S(?:eason ?)?(\\d{1,3})[\\\\/](?:[^\\\\/]+[\\\\/])*.*(?:\\b|[\\sx-])+(?:(?:Ep?(?:isode[ ._])?[ _.]?)?(\\d{1,3}(?:(?:-\\d{1,3})|(?:E\\d{1,3}))?(?:\\.\\d)?)(?:[_ ]?v\\d)?)(?:[^\\\\/]*$)/i;\n }", "title": "" }, { "docid": "1f8a43dce8491d4db970578d4a561691", "score": "0.5271558", "text": "async load() {\n /**@type {string[]} */\n let files;\n try {\n files = fs.readdirSync(this.path);\n } catch (err) {\n fs.mkdirSync(this.path);\n files = [];\n }\n if (files.length > 0) {\n this.no = files.map(Number).sort((a, b) => b - a)[0];\n }\n this.emit('load', this.no);\n }", "title": "" }, { "docid": "f31922018ec2b6042963e13c6fd36cf5", "score": "0.52649444", "text": "function findItem(whereTo) { //returns with a new index number\nif(whereTo <= 0){ //empty string\n console.log('please enter folder to go to');}\nelse{\n if (whereTo == '..') { //going up\n if(fsStorage[currentFolder][2]=='root'){\n console.log('this is the root directory, cant go any higher');}\n else { //if not root directory\n currentFolder=fsStorage[currentFolder][1]; //whoever you are who is your father\n }\n }\n else{ //going down\n for (f = 0; f < fsStorage.length; f++) {\n if(whereTo == fsStorage[f][2] && currentFolder == fsStorage[f][1] && fsStorage[f].length == 3){\n // if(whereTo == fsStorage[f][2] && fsStorage[f].length == 3){\n fileExists = 1;\n currentFolder = fsStorage[f][0];\n break; } } //found you what is your index\n if(fileExists == 0) {\n console.log('Woops... no such folder');\n //whereTo = readlineSync.question('would you like to try again?',answer)\n readMenu();\n }\n }}}", "title": "" }, { "docid": "4b78820de2b38fadd108746b38b20373", "score": "0.5243082", "text": "function fileSearch()\r\n{\r\n //loop through all old games in all files\r\n\r\n loadJSON(\"../gameData/5.11/NORMAL_5X5/NA.json\",'na', true);\r\n loadJSON(\"../gameData/5.14/NORMAL_5X5/NA.json\",'na', false);\r\n //this portion of the code is useless until I can get a better production key\r\n/* loadJSON(\"../gameData/5.11/NORMAL_5X5/NA.json\",'br', true);\r\n loadJSON(\"../gameData/5.11/NORMAL_5X5/BR.json\",'br', true);\r\n loadJSON(\"../gameData/5.11/NORMAL_5X5/BR.json\",'br', true);\r\n loadJSON(\"../gameData/5.11/NORMAL_5X5/BR.json\",'br', true);\r\n loadJSON(\"../gameData/5.11/NORMAL_5X5/BR.json\",'br', true); */ \r\n //loop through every JSON file\r\n // go through each\r\n \r\n}", "title": "" }, { "docid": "28b72eb4e252edd0774cff85aecfb48f", "score": "0.5238725", "text": "function Folder() { }", "title": "" }, { "docid": "364e08079f658d74a6a94e9a7c10dd8a", "score": "0.5233349", "text": "function loadDirectory(filePath){\n\tfs.readdir(filePath,function(err,files){\n\t\tif (err) throw err;\n\t\tvar j = 0; \n\t\tfiles.forEach(function (name) {\n\t\t\tvar fileName = name;\n\t\t\tvar extension = path.extname(fileName); \n\t\t\t//console.log(filename + ' ' + extension); \t\t\t\n\t\t\tvar fullFile = path.join(filePath, fileName); \n\t\t\tvar stat = fs.statSync(fullFile); \n\t\t\tif (stat.isFile()) {\n\t\t\t\tif (fileName.substring(0,3)!='tn_'){\n\t\t\t\t\tif ((extension == '.png') || (extension == '.jpg')){\n\t\t\t\t\t\tj++; \n\t\t\t\t\t\titems[j] = fileName; \n\t\t\t\t\t\tcreateThumbNail(fullFile, filePath, fileName);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}); \n}", "title": "" }, { "docid": "b09ee7ec2e922deecc56ab1c1de5a42d", "score": "0.5223995", "text": "findFolder(folderData, fullpath) {\n let currFolder = folderData;\n\n fullpath = fullpath.replace('\\\\', '/');\n \n let paths = fullpath.split('/');\n let currPath = paths.shift();\n if(fullpath.startsWith('/'))\n {\n currPath = paths.shift();\n }\n\n while (currFolder)\n {\n\n let found = false;\n let obj;\n do \n {\n obj = currFolder.shift();\n if (obj && _.isObject(obj))\n {\n if (obj.n.toLowerCase() === currPath.toLowerCase()) {\n found = true;\n break;\n }\n }\n }\n while (currFolder.length > 0);\n\n if (found)\n {\n currPath = paths.shift();\n if (!currPath)\n {\n return obj;\n }\n else\n {\n currFolder = obj.i;\n }\n }\n else\n return null;\n }\n\n return null;\n }", "title": "" }, { "docid": "e8f4e98bd73fd93ae242d05de9980c19", "score": "0.52050245", "text": "function presentationDir() {\n return '.';\n // return 'slides/' + (new URL(window.location.href)).searchParams.get('slides'); \n}", "title": "" }, { "docid": "88f0d584440b56a64f4cdb6b288dd41e", "score": "0.5197202", "text": "function findFile(dir, path){\n path = dir + \"/\" + path;\n if (exists(path)) return path;\n var base = path.substr(0, path.length - extname(path).length);\n console.log(\"*\", base);\n var exts = [\".md\", \".mdown\", \".markdown\"];\n for (var i = 0; i < exts.length; i++){\n path = base + exts[i];\n if (exists(path)) return path;\n }\n return null;\n}", "title": "" }, { "docid": "b263f12532d22a5727849e1971a3cfb9", "score": "0.5182298", "text": "function seeFolder(name) {\n const absolutePath = path.join(ALPS_DRIVE_ROOT, name);\n const promise = fs.readdir(absolutePath, {withFileTypes: true})\n const promiseTransformed = promise.then((results) => {\n const allFiles = []\n results.forEach((result) => {\n allFiles.push({\n name: result.name,\n isFolder: result.isDirectory(),\n })\n })\n return allFiles\n })\n .catch(() => {\n console.log('Erreur')\n })\n return promiseTransformed\n}", "title": "" }, { "docid": "732bb49cf22aac44a8b13a20a3f5d10e", "score": "0.5171961", "text": "function chequearVideo(dir){\n\n if(dir === undefined)\n return false;\n\n if(dir.indexOf(\"https://www.youtube.com/watch?\") < 0){\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "c7f5367308be3fd272dd052de4658bb4", "score": "0.5170156", "text": "function process_language_source_directory(lang) {\n fs.readdir(read_dir, function(err, files) {\n if (err) throw err;\n files.forEach(function(file) {\n // we need to create the files\n language.render_file(lang, file);\n });\n });\n }", "title": "" }, { "docid": "0c4837873d84d9ebe89b9a83d57ac0ec", "score": "0.5157336", "text": "function isFather(currentFolder) {\n kids.length=0;\n for (x = 0; x < fsStorage.length; x++) {\n if (fsStorage[x][1] == currentFolder) {\n if (fsStorage[x][0]!= 0){\n if (fsStorage[x].length == 4) {\n kids.push('#' + fsStorage[x][2]);\n }\n else {\n kids.push(fsStorage[x][2] + '/');\n }\n }}\n } kids.sort();\n showFileSystem(currentFolder);\n}", "title": "" }, { "docid": "c80d5ad0f1b50ccd1762ec451036b542", "score": "0.5153545", "text": "function info (args, mus, done) {\n var folder = mus.search.getFolderByNum(args[0])\n console.log(folder)\n done()\n}", "title": "" }, { "docid": "26bfd9a009779d2790a5beffdbfb57dd", "score": "0.5151687", "text": "function organizer(src, dest){\n let content = fs.readdirSync(src);\n // console.log( content);\n for(let i = 0; i < content.length; i++){\n let contentAddress = path.join(src, content[i]);\n let isFile = fs.lstatSync(contentAddress).isFile(contentAddress);\n //console.log(isFile);\n if(isFile){\n let categoryOfFile = categorycheck(content[i]);\n console.log(content[i] + \" --> \" + categoryOfFile);\n putFile(contentAddress,dest,categoryOfFile); \n }\n }\n \n}", "title": "" }, { "docid": "6a4fb3566c29ef9a9e5390a66fba4762", "score": "0.5131451", "text": "function searchFolders(dir) { \n var controllers = []\n , views = []\n , has_view = false\n , split = []\n ;\n \n if(dir.split('/').pop() === 'empty'){\n return;\n }\n \n try{\n controllers = fs.readdirSync(path.join(dir, CONTROLLERS_DIR_NAME));\n }catch(err){\n if(err.code === 'ENOENT') {\n console.log(('!!! WARNING No `' + CONTROLLERS_DIR_NAME + '` dir found in [' + dir + ']. Skipping exports...').yellow);\n }else{\n throw(err);\n }\n }\n \n try{\n views = fs.readdirSync(path.join(dir, VIEWS_DIR_NAME));\n }catch(err){\n if(err.code === 'ENOENT') {\n console.log(('!!! WARNING No `' + VIEWS_DIR_NAME + '` dir found in [' + dir + ']. Skipping exports...').yellow);\n }else{\n throw(err);\n }\n }\n\n for(var i = 0; i < views.length; i++) {\n views[i] = extractName(views[i]);\n }\n\n for(var i = 0; i < controllers.length; i++) {\n if(checkName(controllers[i])) {\n //Gets dir/name.controller.js and returns name\n var controller = extractName( controllers[i]\n , {extension: true , suffix: CONTROLLER_SUFFIX}\n );\n\n if(views.indexOf(controller) !== -1) { has_view = true; } else { has_view = false; }\n \n setController(controller, has_view, dir);\n }\n }\n }", "title": "" }, { "docid": "f9d92f7722e8a45a39ec9eff548f5e53", "score": "0.5126448", "text": "function fillDir(playlist, dirPath) {\n \n for (const trackOfPlaylist of playlist.TRACK) {\n \n let track = that.tracks.find( t => t._attributes.TrackID == trackOfPlaylist._attributes.Key)\n \n let sourcePath = track._attributes.Location;\n sourcePath = sourcePath.replace(new RegExp('.+?(?=\\/Users)'), ''); //remove le début\n sourcePath = decodeURIComponent(sourcePath); //special chars from utf8 to chars\n const fileName = sourcePath.replace(new RegExp('.*\\/(.*)'), '$1');\n \n //console.log('hello', count);\n \n if ( isFileExist(sourcePath) ) {\n fs.copyFileSync(sourcePath, `./${dirPath}/${fileName}`, fs.constants.COPYFILE_FICLONE)\n //console.log(count + '/' + total);\n //$progressBar.style.width = `10%`;\n } else {\n console.error('le fichier n\\'existe pas' + sourcePath);\n missingFiles.push(sourcePath);\n }\n \n count++;\n }\n }", "title": "" }, { "docid": "7146880fbdbd29b089e7dcad06c80810", "score": "0.5126334", "text": "function getMobileFolder( pathProject )\n{\t\n var project = studio.Folder( pathProject + \"WebFolder\" );\n var c = null;\n \n project.forEachFolder( function( folder ){\n\n for( var i = 0; i < folder.files.length; i++ ){\t\t\n if( folder.files[i].name === \"index-smartphone.html\" )\n {\n c = folder.name;\n break;\n }\n }\n });\n \n return c;\n}", "title": "" }, { "docid": "a008019bf050b7c0e8b20aeb3985c57b", "score": "0.5125513", "text": "function locate(pid) {\n var files = fs.readdirSync(\".\");\n for (var i = 0; i < files.length; i++) {\n if (files[i].substring(0, 10) == 'NodeReport' && files[i].indexOf(pid) != -1) {\n console.log('autorun.js: located NodeReport: ', files[i]);\n return files[i];\n }\n }\n return;\n}", "title": "" }, { "docid": "f2ffd615047ff91dbbb8d3c74694ec31", "score": "0.51240385", "text": "function schoolSlides() {\n return [\n \"00_intro.md\",\n \"01_speaker.md\",\n \"10_chapter1.md\",\n \"11_layouts.md\",\n \"20_specifics_slides.md\",\n \"30_code_slides.md\",\n \"40_helpers.md\",\n \"50_modes.md\",\n ];\n}", "title": "" }, { "docid": "25ec7579f82299e8e3c262dd901e8be7", "score": "0.5122596", "text": "function loadFiles(docID, path, folderName){\r\n fs.readdir(path, function(err, files){\r\n // 1)check the extention of each element\r\n // 2)if extention == mp3 || mpeg || avi || add a new file-item in #FilesContainer\r\n // 3)attach function to each element\r\n // 4)move #filesContainer into the scene\r\n var ext = '';\r\n var itemsCounter = 0;\r\n var container = $('#FilesContainer .collection');\r\n var catchImage = '';\r\n\r\n if(!err){\r\n container.html('');\r\n\r\n files.map(function (file) {\r\n return Path.join(path, file).replace(/\\\\/g, '\\\\\\\\');\r\n }).filter(function (file) {\r\n return fs.statSync(file).isFile();\r\n }).forEach(function (file) {\r\n //console.log(\"%s (%s)\", file, Path.extname(file));\r\n ext = Path.extname(file);\r\n var fileName = Path.basename(file, ext);\r\n //console.log(ext);\r\n if(ext === '.mp3' || ext === '.avi' || ext === '.mpeg' || ext === '.wmv' || ext === '.mp4'){\r\n container.append('<a href=\"#!\" class=\"collection-item\" data-folderName=\"' + folderName + '\" data-fileName=\"' + fileName + '\" data-path=\"'+ file +'\" data-format=\"' + ext + '\"><span>' +\r\n fileName + '</span><i class=\"fa fa-plus right\"></i> </a>');\r\n itemsCounter++;\r\n }\r\n if(ext === '.jpg' || ext === '.png') catchImage = file;\r\n\r\n });\r\n if(catchImage != '') updateCover(docID, catchImage);\r\n\r\n if(itemsCounter > 0)\r\n $('#FilesContainer').animate({marginLeft: 0}, 300);\r\n else\r\n swal('Actualmente no hay archivos multimedia en la carpeta');\r\n }else\r\n swal('Algo salio mal:/ ' + err);\r\n\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "6786f956308c17b9ef202246af791bb5", "score": "0.51196057", "text": "function getStories (dir) {\r\n var storyFiles = fs.readdirSync(dir);\r\n var stories = [];\r\n for (var storyFileIndex = 0; storyFileIndex < storyFiles.length; storyFileIndex++) {\r\n var story = storyFiles[storyFileIndex];\r\n var filename = dir + '/' + story;\r\n if (!fs.statSync(filename).isDirectory()) {\r\n var contents = fs.readFileSync(filename, 'utf8');\r\n stories.push(parseStory(contents));\r\n }\r\n }\r\n return stories;\r\n}", "title": "" }, { "docid": "35e08bd5585b319c16b39993455b006f", "score": "0.5102236", "text": "function organiseFile(src, des) {\r\n\r\n // 3 identify category of all files present n that directory\r\n let childname = fs.readdirSync(src);\r\n // console.log(childname);\r\n\r\n\r\n // required child address to organise file\r\n for(let i=0;i<childname.length;i++)\r\n {\r\n let childadd = path.join(src,childname[i]); //address le lya\r\nlet isFile = fs.lstatSync(childadd).isFile(); //is it file or folder...only file required for organisation\r\n\r\nif(isFile)\r\n{\r\n // console.log(childname[i]);\r\n let category = getCategory(childname[i]);\r\n \r\n console.log(childname[i],\"belongs to --> \",category);\r\n // 4 copy/cut files to that organsie means jo file jis folder m jana chye usme jae// that category folder\r\n\r\n sendfile(childadd,des,category); //child ka address lya nye wale folder ka destination lya according to their extension and put them in their folder\r\n\r\n}\r\n\r\n }\r\n}", "title": "" }, { "docid": "a6918dceea54f0683d165c149202a49a", "score": "0.50959605", "text": "function folder (args, mus, done) {\n var folder = mus.search.getFolderByNum(args[0])\n var fullPath = escapeFile(path.join(mus.config.root, folder.path))\n console.log('FOLDER', fullPath)\n\n exec('open ' + fullPath, function () {\n console.log('FOLDER', folder.title)\n done('exit')\n })\n}", "title": "" }, { "docid": "142a98122447811f4171ecde9a69ed65", "score": "0.5092667", "text": "function searchId(){\n fileContents.forEach((data,i) => {\n let dName = data.name;\n if(dName.match(searchQ)) {\n matches.push(data)\n console.log(`recent directory searchid ${searchQ}`)\n console.log(colors.green(`heres the path if search matches the name ${data.path}`))\n console.log(`here's an array of the matches ${matches.length}`)\n // return data;\n }\n })\n}", "title": "" }, { "docid": "fd86a48300747f7001f636051cd0c212", "score": "0.50841373", "text": "function getExamples() {\n var path = app.getAppPath();\n var examplesDirectories = fs.readdirSync(path+'/Cracked/Examples/');\n var result = [];\n if(examplesDirectories && examplesDirectories.length) {\n examplesDirectories.map(function(categoryDirectory){\n if(fs.lstatSync(path+'/Cracked/Examples/'+categoryDirectory).isDirectory()) {\n result.push({\n label:categoryDirectory,\n submenu:[]\n });\n var examples = fs.readdirSync(path+'/Cracked/Examples/'+categoryDirectory);\n if(examples && examples.length) {\n examples.map(function(item){\n result[result.length-1].submenu.push({\n label:item,\n click:function(){\n openFile([path+'/Cracked/Examples/'+categoryDirectory+'/'+item]);\n }\n })\n });\n }\n }\n });\n }\n return result;\n }", "title": "" }, { "docid": "dabeed8de273c15b47fc4568e6eeed18", "score": "0.50782835", "text": "function fileSearch(dir, done) {\n // fs.readdir takes 2 arg, directory path and a callback of the list of subdirectories and files in the directory\n fs.readdir(dir, function(error, filesFolders) {\n if (error) return done(error);\n let numberFilesFolders = filesFolders.length; // gets the number of files or folders in the current diretory\n if (numberFilesFolders == 0) return done(null, filesArray);\n filesFolders.forEach(function(fileFolder) {\n fileFolder = path.resolve(dir, fileFolder); //getting the path of the file or directory \n fs.stat(fileFolder, function(err, stat) {\n if (stat && stat.isDirectory()) { // if it is a subdirectory, through recursion, repeat above steps to search for .js files\n fileSearch(fileFolder, function(error, subFilesArray) {\n if (!--numberFilesFolders) done(null, filesArray);\n });\n } else {\n const readStream = fs.createReadStream(fileFolder); // read file through streams so that large files can be handled efficiently\n\n // creates an interface with the input stream(directory given above)\n const r1 = readLine.createInterface({\n input: readStream,\n crlfDelay: Infinity\n });\n\n // returns each line of type string\n r1.on('line', (line) => {\n \n if(line.includes('TODO')) {\n filesArray.push(fileFolder); // all the files in a directory are added to the array\n readStream.destroy(); // stop the line reading process once the string is found in the file \n }\n });\n\n \n if (!--numberFilesFolders) done(null, filesArray);\n }\n });\n });\n });\n }", "title": "" }, { "docid": "a7743406258f0c4eb6202dbc07284b69", "score": "0.5074455", "text": "function folderURL($url) {\n\n var url, pathArray, last, getext, folder;\n\n //var url = 'file:///Users/rtb/Sites/front/marmitefrwk/legal2/index.html';\n url = window.location.pathname;\n console.log(url)\n url = url.replace(/\\/$/, '') // Match a forward slash / at the end of the string ($) \n pathArray = url.split( '/' );\n last = pathArray[pathArray.length-1];\n getext = last.lastIndexOf(\".\");\n if(getext > 0){\n folder = pathArray[pathArray.length-2];\n }\n else{\n folder = pathArray[pathArray.length-1];\n }\n\n //console.log('folder: ', folder);\n\n return folder;\n }", "title": "" }, { "docid": "9d41ee5fbe19c8d4cff9596381964b6d", "score": "0.5068031", "text": "function folderID(ID,counter) {\n// Logger.log(ID); checks the ID value being passed\n \n var currfolder;\n var currfolder = DriveApp.getFolderById(ID);\n var name = currfolder.getName();\n var files = currfolder.getFiles();\n var subFiles;\n var childfolders = currfolder.getFolders();\n\n\n if (counter == 0){\n\n listFilesfromParent(childfolders,files,name,currfolder,subFiles,ID,counter);\n }\n else{\n\n listFiles(childfolders,files,name,currfolder,subFiles,ID);\n }\n\n\n}", "title": "" }, { "docid": "53381e3f901e9c087230a536fd653370", "score": "0.50394267", "text": "function listDirectory(path) {\n if (!fs.existsSync(path)) return;\n const data = fs.readdirSync(path);\n let hasPrinted=false;\n data.forEach((val) => {\n if (val.endsWith(\".desktop\")) {\n if (!hasPrinted) {\n hasPrinted=true;\n console.log(path.blue);\n }\n console.log(\" \", val.replace(\".desktop\", \"\").green);\n }\n });\n}", "title": "" }, { "docid": "84e2a08092ab57bd996a512b2fe0bead", "score": "0.5039201", "text": "function gotFiles(entries) {\n console.log(\"O diretorio de JS tem \"+entries.length+\" arquivos js.\");\n\t\n\tfor (var i=0; i<entries.length; i++) {\n\t\t//console.log(entries[i].name+' dir? '+entries[i].isDirectory);\n\t\tknownfilesjs.push(entries[i].name);\n\t\trenderJavascript(entries[i].fullPath);\n\t\t\n\t}\n\t\n\tif (entries.length > 0) {\n\t\tfpath = entries[0].fullPath\n\t\tfolder = fpath.replace(entries[0].name,'');\n\t\tstorage.folderJS = folder;\n\t\t\n\t\tconsole.log(folder);\n\t}\n}", "title": "" }, { "docid": "51acf23e324bbb361f204810085ffd96", "score": "0.5028319", "text": "function listAllFolders() {\n var folders = DriveApp.getFolders();\n while (folders.hasNext()) {\n var folder = folders.next();\n Logger.log(folder.getName()); \n }\n}", "title": "" }, { "docid": "a2685f46c1f7deecaa444c90ed474040", "score": "0.50209635", "text": "_loadChapterPagesFolder(directory) {\n return new Promise((resolve, reject) => {\n this.fs.readdir(directory, (error, files) => {\n if (error) {\n reject(error);\n } else {\n resolve(files);\n }\n });\n })\n .then(files => {\n let pages = files.map(file => this._makeValidFileURL(directory, file));\n return Promise.resolve(pages);\n });\n }", "title": "" }, { "docid": "b22719f44aec5fff6c4f48656d0a86a1", "score": "0.50168985", "text": "FindByName(name) {\n for (let i = 0; i < this.folderStructure.length; i++) {\n if (this.folderStructure[i].name === name) return this.folderStructure[i];\n }\n }", "title": "" }, { "docid": "8eb4d0e7836a041fedbc866df7a11561", "score": "0.50153613", "text": "function fnGetDir(oSmp,iInt)\n{\n\tvar sDir = \"My Documents\";\t// or \"C:\\\\\" or LOCAL PATH\n\tif (iInt == 0)\n\t{\tsDir=oSmp.ChooseDirectory(sDir, L_ProjFileLoc_HTMLText);\t}\n\telse\n\t{\tsDir=oSmp.ChooseDirectory(sDir, L_ProjFileLoc_HTMLText + L_ProjFileLocCopy_HTMLText);\t}\n\treturn sDir;\n}", "title": "" }, { "docid": "18218e328ee56dce5592776159eb294f", "score": "0.50151634", "text": "_getSearchPathForFolder(aFolder) {\n // Swap the metadata dir for the profile dir prefix in the folder's path\n let folderPath = aFolder.filePath.path;\n let fixedPath = folderPath.replace(\n this._profileDir.path,\n this._metadataDir.path\n );\n let searchPath = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n searchPath.initWithPath(fixedPath);\n return searchPath;\n }", "title": "" }, { "docid": "c28cda7e0074842fdf6324345b30f976", "score": "0.50122756", "text": "async function displayFolders(folders,title,directory) {\n // List of Folders\n var listFolders = document.createElement('ul')\n listFolders.setAttribute('id','music-list')\n // Display Folders in the main content window\n for (let index = 0; index < folders.files.length; index++) {\n // Check if this folder contains music\n if ( folders.files[index].file.search('action=play_song') != -1 ) {\n openNBrowse( directory, title )\n break;\n }\n // Folder Title\n var listItem = document.createElement('li')\n var textnode = document.createTextNode(folders.files[index].label)\n listItem.appendChild(textnode)\n listItem.addEventListener('click',function() {\n nextWindow(folders.files[index].file,folders.files[index].label)\n })\n listFolders.appendChild(listItem)\n }\n // Add the new folders inside main-content-window\n mainContainer.appendChild(listFolders)\n }", "title": "" }, { "docid": "d4de83de9f62f9c325033b43b05b5b3f", "score": "0.5011968", "text": "function getFolderContents(){\r\n\t\r\n\t\tloadingMsg = LocString('Sorting after upload', dndfileStr );\r\n\t\tcurrentSortStr = 'modifydate';\r\n\t\tcurrentSortDir = 'DESC';\r\n\t\tcurrentAction = \"refresh\";\r\n\t\tchangePage(1, pageSize);\r\n\r\n}", "title": "" }, { "docid": "75424d64e61ea6e1db6b07e24a4ab941", "score": "0.5010086", "text": "function findCitations() {\n var files = [];\n db.cypherQuery(\"MATCH n WHERE n:Paper AND n:Core RETURN n\", function(err, result){\n if(err) throw err;\n\n result.data.forEach( function (paper) {\n path = paper.doi.replace('/', '_');\n path = '/Users/christianbattista/braincest/pdfs/vault/' + path + \".pdf\";\n console.log(path);\n references = getCitations(path);\n console.log(references);\n });\n\n\n });\n}", "title": "" }, { "docid": "c74d058b9695ffba9b41d4b78da6a68f", "score": "0.50057685", "text": "function notAlreadyThere(rootDir, page) {\n const files = fs.readdirSync(rootDir);\n const idsFromFiles = files.map(file => fs.readJSONSync(path.join(rootDir, file)).id);\n return function (docs) {\n docs = docs.map(doc => Object.assign(doc, { filename: path.join(rootDir, page + \"_\" + doc['id'] + \".json\") }));\n return docs.filter(doc => idsFromFiles.indexOf(doc['id']) === -1);\n };\n}", "title": "" }, { "docid": "2da225d5afe7e3628bcb1d81a99af05d", "score": "0.50032556", "text": "function find_path(path) {\n\tif(path[0] === \"/\") path = root_name + path;\n\tvar UCNames = (path.indexOf(\"/\") !== -1 ? FullPaths : Paths).map(function(x) { return x.toUpperCase(); });\n\tvar UCPath = path.toUpperCase();\n\tvar w = UCNames.indexOf(UCPath);\n\tif(w === -1) return null;\n\treturn path.indexOf(\"/\") !== -1 ? FileIndex[w] : files[Paths[w]];\n}", "title": "" }, { "docid": "d2dba7dc1c2f9c747be05ffe61d4448f", "score": "0.49986535", "text": "onClick() {\n var desc = this.store.get('$page.desc');\n if (!desc) {\n folders = [];\n this.apiOneDrive();\n } else { \n this.gridData(folders\n .filter(x => x.name.startsWith(desc.trim())));\n }\n }", "title": "" }, { "docid": "4059de3aeb41a50c68cee9664d246b76", "score": "0.49928567", "text": "function display_folder () {\n\n $('.play_list').append('<h3 id=\"folder\">Cathégorie</h3><div class=\"row folder\"></div>'); \n \t\n $.getJSON($('#url_json').attr('url')+'all_file_uploaded_cat.json',{_: new Date().getTime()},function(data) {\n \n $.each(data, function(entryIndex, entry) {\n\n var html = '<div class=\"card-panel col m3 this_folder\" cat=\"'+entry['file_cat']+'\" id=\"'+entry['file_cat']+'\"><span class=\"black-text text-darken-2\"><h4>'+entry['file_cat']+'</h3><center><i class=\"large mdi-file-folder-open\"></i></center></span></div>'\n \n $('.folder').append(html);\n\n $(document).ready(function(){\n\n \t$('.this_folder').unbind('click')\n\n \t$('.this_folder').click(function () {\n \t\t\n \t\t//We hide the play_list \n \t\t$('.play_list').hide();\n\n \t\t//We display this files of this folder \n \t\t$('.list_folder').html('');\n \t\t$('.list_folder').fadeIn();\n \t\t$('.back_list').fadeIn()\n\n \t\tvar this_file_cat = $(this).attr('cat');\n\n $.each(window.playlist, function(entryIndex, entry) {\n \n if(entry['file_cat']==this_file_cat){\n\n \t$('.list_folder').append('<div class=\"col m4\">'+create_card (entry['file_cat'],entry['file_title'],entry['file_hash'])+'</div>');\n \n manage_playlist();\n\n window.crolling = entry['file_cat'];\n }\n })\n\n return false;\n \t})\n })\n })\n })\n }", "title": "" }, { "docid": "705bcf578e133c0bc26487b827526761", "score": "0.49845225", "text": "function getSubFolders(selectedFolder) {\n\t\t\t var allFilesList = selectedFolder.getFiles();\t\n\t\t\t for (var L1 = 0; L1 < allFilesList.length; L1++) {\n\t\t\t\t var myFile = allFilesList[L1];\n\t\t\t\t if (myFile instanceof Folder && myFile.getFiles().length > 0){ // only if folder has files (otherwise the loop stalls)\n\t\t\t\t\t getSubFolders(myFile);\n\t\t\t\t }\n\t\t\t\t if (myFile instanceof File && testFileExtension(myFile) == true && testFilePrefix(myFile) == true) {\n\t\t\t\t\t allFiles.push(myFile.fsName); // PATH EDIT); \n\t\t\t\t }\n\t\t\t }\t\n\t\t}", "title": "" }, { "docid": "af43495ac40093ddd04445390f61c20b", "score": "0.49841222", "text": "goToFolder(name) {\n this.props.getList(name);\n }", "title": "" }, { "docid": "12a49f6c5fc4b156e90e2ec4e48dc263", "score": "0.49789187", "text": "function getRealPaths(startPath) {\n // Check each folder in the wikis folder to see if it has a\n // tiddlywiki.info file\n let realFolders = [];\n try {\n const folderContents = fs.readdirSync(startPath);\n folderContents.forEach(function (item) {\n const fullName = path.join(startPath, item);\n if(fs.statSync(fullName).isDirectory()) {\n if($tw.ServerSide.wikiExists(fullName)) {\n realFolders.push(fullName);\n }\n // Check if there are subfolders that contain wikis and recurse\n const nextPath = path.join(startPath,item)\n if(fs.statSync(nextPath).isDirectory()) {\n realFolders = realFolders.concat(getRealPaths(nextPath));\n }\n }\n })\n } catch (e) {\n const message = {\n alert: 'Error getting wiki paths: ' + e,\n connections: [data.source_connection]\n };\n $tw.ServerSide.sendBrowserAlert(message);\n $tw.Bob.logger.log('Error getting wiki paths', e, {level:1});\n }\n return realFolders;\n }", "title": "" }, { "docid": "fbd7d85ab0c24f40b77e35bd931912a9", "score": "0.49768037", "text": "function listFolder() {\n const promise = fs.readdir(ALPS_DRIVE_ROOT, {withFileTypes: true}); //promesse qui va lire le dossier root, whithFilesTypes true pour retourner des objets (dirent) auxquels on peut appliquer des méthodes\n //création d'une promesse transformée qui va retourner tout le contenu du drive sous forme de tableau d'objets avec des attributs (name, isFolder)\n const promiseTransformed = promise.then((results) => {\n const allFiles = [];\n results.forEach((result) => {\n allFiles.push({\n name: result.name,\n isFolder: result.isDirectory(),\n })\n })\n console.log(allFiles);\n return allFiles;\n })\n .catch(() => {\n console.log('Erreur')\n })\n return promiseTransformed;\n}", "title": "" }, { "docid": "ffaaedaa08a0d06f225ead851b5d704b", "score": "0.49702013", "text": "function organiseFile(src, des) {\r\n\r\n // 3 identify category of all files present n that directory\r\n let childname = fs.readdirSync(src);\r\n // console.log(childname);\r\n\r\n\r\n // required child address to organise file\r\n for (let i = 0; i < childname.length; i++) {\r\n let childadd = path.join(src, childname[i]); //address le lya\r\n let isFile = fs.lstatSync(childadd).isFile(); //is it file or folder...only file required for organisation\r\n\r\n if (isFile) {\r\n // console.log(childname[i]);\r\n let category = getCategory(childname[i]);\r\n\r\n console.log(childname[i], \"belongs to --> \", category);\r\n // 4 copy/cut files to that organsie means jo file jis folder m jana chye usme jae// that category folder\r\n\r\n sendfile(childadd, des, category); //child ka address lya nye wale folder ka destination lya according to their extension and put them in their folder\r\n\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "20c6b4f960c304785068cb497502f893", "score": "0.4966471", "text": "function CFolder() {\r\n}", "title": "" }, { "docid": "295d40294cd43cd4d6caa703ded3f969", "score": "0.49650022", "text": "constructor(folder) {\n this.folder = folder;\n this.folder = folder;\n }", "title": "" }, { "docid": "9b2c63fac6edadf51c8b57d150c4da0c", "score": "0.4964139", "text": "function search(files) {\n\n let root = \"\";\n const pathToFile = getFirstValidFile(root, files);\n\n if (!pathToFile)\n throw new Error('No files!');\n\n return pathToFile.substr(1);\n\n function getFirstValidFile(directory, files) {\n\n for (let fileName of Object.keys(files)) {\n\n const localDirectory = directory + \"/\" + fileName;\n const fileContent = files[fileName];\n\n if (typeof fileContent === 'string')\n return localDirectory;\n\n if ((typeof fileContent === 'object')){\n const pathToFile = getFirstValidFile(localDirectory, fileContent);\n if (pathToFile)\n return pathToFile;\n }\n\n }\n\n return null;\n\n }\n\n}", "title": "" }, { "docid": "e0a28f14753ae5f82afb562335d28821", "score": "0.496213", "text": "function geturl() {\r\n var urllocation = \"http://inside-files.mathworks.com/dev/eps/netint/wordpress/\";\r\n folder = GetQueryStringParams('folder');\r\n var htmlfilename = GetQueryStringParams('urlname');\r\n var title = decodeURIComponent(GetQueryStringParams('title'));\r\n title = title.split(\"+\").join(\" \");\r\n // var posturl = urllocation + folder + '/' + htmlfilename;\r\n var posturl = decodeURIComponent(GetQueryStringParams('location'));\r\n var blogUrl = decodeURIComponent(GetQueryStringParams('blogUrl'));\r\n var login = GetQueryStringParams('login');\r\n doesFileExist(posturl, title, blogUrl, login);\r\n }", "title": "" }, { "docid": "d7f344bb26882614277a37042a730180", "score": "0.4959162", "text": "function find(sPath, iFileIdx, sID, sSFL, oList)\n{\t/* assumes that oList is an UL\t*/\n\tvar aFilePath = sPath.split(\"\\\\\");\n\tvar bDo = true;\n\n\tfor(var j = 0; j<oList.children.length;j++)\n\t{\n\t\tif(oList.children[j].innerText.indexOf(aFilePath[0])==0)\n\t\t{\n\t\t\tiPos = sPath.indexOf(\"\\\\\");\n\n\t\t\t//Note: Added check on .children[j].children[2]\n\t\t\t//to handle case where file occuring earlier in the \n\t\t\t//the file list has the same name as a directory. \n\n\t\t\tif ((iPos!=-1) && (oList.children[j].children[2] != null))\n\t\t\t{\n\t\t\t\tbDo = false;\n\t\t\t\tfind(sPath.substring(iPos+1), iFileIdx, sID, sSFL, oList.children[j].children[2]);\n\t\t\t}\n\t\t}\n\t}\n\tif(bDo){\n\t\tiPos = sPath.indexOf(\"\\\\\");\n\t\tif(iPos!=-1){\n\t\t\tvar oLI = document.createElement(\"LI\");\n\t\t\tvar oLS = document.createElement(\"UL\");\n\t\t\tvar oA = document.createElement(\"A\");\n\t\t\tvar oIMG = document.createElement(\"IMG\");\n\n\t\t\toLS.className = \"clsHidden\";\n\t\t\toA.innerText = aFilePath[0];\n\t\t\toA.title = aFilePath[0];\n\t\t\toA.onClick = \"javascript:void(0);Toc_click()\";\n\t\t\toA.style.cursor = \"hand\";\n\n\t\t\toIMG.onClick = \"javascript:void(0);Toc_click()\";\n\t\t\toIMG.alt = aFilePath[0];\n\t\t\toIMG.className = \"clsHand\";\n\t\t\toIMG.width = 16;\n\t\t\toIMG.height = 16;\n\t\t\toIMG.hspace = 4;\n\t\t\toIMG.src = L_defaultLocation_HTMLText + \"greenfolder.gif\";\n\n\t\t\toLI.className = \"kid\";\n\t\t\tfind(sPath.substring(iPos+1), iFileIdx, sID, sSFL, oLS);\n\t\t\toLI.appendChild(oIMG);\n\t\t\toLI.appendChild(oA);\n\t\t\toLI.appendChild(oLS);\n\t\t\toList.appendChild(oLI);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar oLI = document.createElement(\"LI\");\n\t\t\tvar oA = document.createElement(\"A\");\n\t\t\tvar oIMG = document.createElement(\"IMG\");\n\t\t\tvar iconType = aFilePath[0].substring(aFilePath[0].lastIndexOf(\".\")+1).toLowerCase();\n\n\t\t\toA.innerText = aFilePath[0];\n\t\t\toA.id = L_PopupMenuID1_HTMLText;\n\t\t\toA.title = aFilePath[0];\n\n\t\t\toIMG.alt = aFilePath[0];\n\t\t\toIMG.id = L_PopupMenuID2_HTMLText;\n\t\t\toIMG.width = 16;\n\t\t\toIMG.height = 16;\n\t\t\toIMG.hspace = 4;\n\n\t\t\t//\tFOR ELEMENTS NOT CLICKABLE\n\t\t\tif (iconType == \"fts\" || iconType == \"hlp\" || iconType == \"hpj\" || iconType == \"dib\" || iconType == \"sdl\" || iconType == \"dll\" || iconType == \"licenses\" || iconType == \"projdata\" || iconType == \"doc\" || iconType == \"chm\" || iconType == \"mdb\" || iconType == \"exe\" || iconType == \"msi\" || iconType == \"cur\" || iconType == \"gif\" || iconType == \"png\" || iconType == \"bmp\" || iconType == \"ico\" || iconType == \"jpg\" || iconType == \"rle\" || iconType == \"avi\" || iconType == \"wav\" || iconType == \"wma\" || iconType == \"wmv\")\n\t\t\t{\n\t\t\t\toA.className = \"clsNoView\";\n\t\t\t\toIMG.className = \"clsNoView\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toA.className = L_VisualNote_HTMLText;\t//\toA.href = \"javascript:view(\" + iFileIdx + \",'\"+sID+\"','\"+sSFL+\"','\"+ oA.id+\"');\";\n\t\t\t\toA.href = \"javascript:\";\n\t\t\t\toA.onClick = \"view(\" + iFileIdx + \",'\"+sID+\"','\"+sSFL+\"','\"+ oA.id+\"');\";\n\t\t\t\toIMG.className = \"clsNoHand\";\t\t//\toIMG.onClick = \"javascript:view(\" + iFileIdx + \",'\"+sID+\"','\"+sSFL+\"','\"+ oA.id+\"');\";\n\t\t\t\toIMG.onClick = \"view(\" + iFileIdx + \",'\"+sID+\"','\"+sSFL+\"','\"+ oA.id+\"');\";\n\t\t\t}\n\n\t\t\tif(sIcons.indexOf(iconType.toLowerCase())!=-1)\n\t\t\t{\toIMG.src = L_defaultLocation_HTMLText + iconType + \"-icon.gif\";\t}\n\t\t\telse\n\t\t\t{\toIMG.src = L_defaultLocation_HTMLText + \"bluepage.gif\";\t}\n\n\t\t\toLI.appendChild(oIMG);\n\t\t\toLI.appendChild(oA);\n\n\t\t\tvar bDone = false;\n\t\t\tfor(var k = 0; k<oList.children.length;k++)\n\t\t\t{\n\t\t\t\tif(oList.children[k].className==\"kid\")\n\t\t\t\t{\n\t\t\t\t\toList.children[k].insertAdjacentElement(\"BeforeBegin\",oLI);\n\t\t\t\t\tbDone = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!bDone)\n\t\t\t{\toList.appendChild(oLI);\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2f7a3520a06388e8ed77bf894fc97beb", "score": "0.49587795", "text": "function getFolderTitle(answer) {\n var IDivide = answer.split(\"[\");\n //Logger.log(IDivide[1]);\n var IIDivide = IDivide[1].split('\"');\n //Logger.log(IIDivide[11]);\n return IIDivide[11];\n}", "title": "" }, { "docid": "6e48c8ef470fdf66562667f0b6f92fbc", "score": "0.4953977", "text": "function findBib(){\n \n }", "title": "" }, { "docid": "c0b1b7309eaa8693027c093231a11b09", "score": "0.4953623", "text": "async function nextWindow(directory,title) {\n var head = document.createElement('h1')\n var textnode = document.createTextNode(title)\n head.appendChild(textnode)\n // Clear the previous data inside main-content-window\n mainContainer.textContent = \"\"\n mainContainer.appendChild(head)\n var newfolders = await playFolders(directory)\n displayFolders(newfolders,title,directory)\n }", "title": "" }, { "docid": "390484ddac01c5aed8143b21152dca99", "score": "0.49525508", "text": "function OneDir(_dirInfo)\r\n{\r\n this.dirInfo = _dirInfo\r\n this.Kids = []\r\n this.Filenames = []\r\n \r\n //this.Filenames = new System.Collections.Generic.List<string>()\r\n \r\n print(_dirInfo.FullName)\r\n this.walkDirInfo()\r\n}", "title": "" }, { "docid": "7a607b34687151d85ec308e7d952aa3c", "score": "0.49456698", "text": "listDir(path){\n\t window.resolveLocalFileSystemURL(path,\n\t function (fileSystem) {\n\t var reader = fileSystem.createReader();\n\t reader.readEntries(\n\t function (entries) {\n\t entireMaterialDirectory = entries;\n\t },\n\t function (err) {\n\t //\talert(err)\n\t console.log(err);\n\t }\n\t );\n\t }, function (err) {\n\t //\talert(err)\n\t console.log(err);\n\t }\n\t );\n\t}", "title": "" }, { "docid": "67fa08d6a69afe49459b660f52f2f259", "score": "0.4945503", "text": "function getCurrentFilenames() {\nconsole.log(\"\\nCurrent filenames:\");\nfs.readdirSync(__dirname).forEach(file => {\n\tconsole.log(file);\n});\n}", "title": "" }, { "docid": "97e28bfca02dcac0eca81341ae230cf5", "score": "0.49453306", "text": "function getQuizFiles(file, i, finalCb) {\n /* is the file a quiz? */\n if (/quiz_d2l_\\d*\\.xml/.test(file.name)) {\n /* if yes, sterilize it */\n scanQuiz(file, i, finalCb);\n } else {\n /* these are not the droids you're looking for */\n finalCb(null);\n }\n }", "title": "" }, { "docid": "725d5cc0f38d64ebb1665ce39affd3c7", "score": "0.49376693", "text": "function getFolder(selectedFolder) {\n\t\tvar allFilesList = selectedFolder.getFiles();\n\t\tfor (var L1 = 0; L1 < allFilesList.length; L1++) {\n\t\t\tvar myFile = allFilesList[L1];\n\t\t\t\tif (myFile instanceof File && testFileExtension(myFile) == true && testFilePrefix(myFile) == true) {\n\t\t\t\tallFiles.push(myFile); \n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c2988a7190c461c1e5f8658b5a09d462", "score": "0.49360898", "text": "function addFolder(path, name, category){\r\n newDoc = {};\r\n newDoc.path = path.replace(/\\\\/g,'/');\r\n newDoc.name = name;\r\n newDoc.type = 'Folder';\r\n newDoc.cover = '../app/img/icons/play_background.png';\r\n newDoc.category = category;\r\n newDoc.ranking = 0;\r\n newDoc.since = new Date().toLocaleDateString();\r\n\r\n // CHECK FOR COVER AND ADD IT\r\n setCover(newDoc, function(){insertDoc(newDoc)});\r\n\r\n}", "title": "" }, { "docid": "50326186bf5b43758d53feefb2f6c837", "score": "0.4935335", "text": "function userActionRun() {\n var list = getFilesListFromFolder_('ASDFSDFASFWERTF');\n}", "title": "" }, { "docid": "8c2f927f5bdfacfb5feddd0894e4772a", "score": "0.49342752", "text": "function init(){\n var html = fs.readdirSync('src/nativehtml/').filter(function (filename) {\n return fs.statSync('src/nativehtml/' + filename).isFile();\n })\n html.map(function(e, i, a){\n return getSectionsFromChapter(e.replace('.htm',''))\n })\n}", "title": "" }, { "docid": "24a31d2cd324755639028658cebde5bd", "score": "0.49308646", "text": "function __HideUserActivity_CheckPath() {\n //\n // Regexp for a File-Preview page of a standalone file\n // Please note the \"alternative\" bewteen \"app\" and \"app#\" inside the regexp\n //\n let filesExp = new RegExp('/files/(app|app#)');\n //\n // Regexp for a File-Preview page of a Community file\n //\n let commExp = new RegExp('/communities/service/html/(communitystart|communityview|communityoverview)\\\\?communityUuid=[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}');\n if (filesExp.test(document.location.pathname) || commExp.test(document.location.pathname + document.location.search)) {\n if (filesExp.test(document.location.pathname)) {\n __cBill_logger('__HideUserActivity_CheckPath : This is a FILE : ' + document.location.pathname);\n return 1;\n } else {\n __cBill_logger('__HideUserActivity_CheckPath : This is a Community FILE : ' + document.location.pathname);\n return 2;\n }\n } else {\n __cBill_logger('__HideUserActivity_CheckPath : NOT A VALID PATH : ' + document.location.pathname);\n return 0;\n }\n}", "title": "" }, { "docid": "2563d32865a71abb6effa3d80050d24f", "score": "0.49258032", "text": "static get usage () {\n return [\n '[<folder>]',\n ]\n }", "title": "" }, { "docid": "36aeafee7bcfcf1abce32fbd6819e9cd", "score": "0.49255928", "text": "async function findNidl(directory) {\n const nidlList = [];\n const files = await readDirectory(directory);\n for (const file of files) {\n if (await isDirectory(file) &&\n path.basename(file) !== 'node_modules') {\n nidlList.push(...await findNidl(file)); \n } else if (path.extname(file) === '.nidl') {\n nidlList.push(file);\n }\n }\n return nidlList;\n}", "title": "" }, { "docid": "690f59a34127d52aeb390b0c023ea497", "score": "0.49243754", "text": "function insertProjFolder(id, project_file, snippet, midi_files, sample_files){ }", "title": "" }, { "docid": "406c352ca4246c756f5f5a7f0e834b02", "score": "0.49221042", "text": "function filesFind() {\n \n try {\n deletekeys();\n spreadsheet.toast(\"Files Index Run. Please Wait...\", \"Started\", -1);\n listAll();\n spreadsheet.toast(\"Done Indexing.\", \"Success\", -1);\n } catch (e) {\n Browser.msgBox(\"Error\", \"Sorry, Error Occured: \" + e.toString(), Browser.Buttons.OK);\n spreadsheet.toast(\"Error Occurred :( Put at D1.\", \"Oops!\", -1);\n }\n\n}", "title": "" }, { "docid": "61cd6ca889c23c5dc7443fb49068d235", "score": "0.49199325", "text": "function OrganizeDir(dirpath, x=\"C:\\\\Users\\\\Khushi Chavada\\\\Downloads\\\\organised_files\"){\n\n let isFile = isFileorNot(dirpath) // Returns true/false based on, if it's a file or not\n if(isFile == true){ // if file\n let folderName = getDirectoryName(dirpath); //acc. to the file ext in dirpath,we get the resp. folder name\n \n console.log(path.basename(dirpath), \"-> \",folderName); // ex. text.txt-> docs\n let destFolder = path.join(x,folderName); // destFolder = \"C:\\Users\\\\DELL\\Downloads\\organised_files\" + \"docs\"\n copyFiletoFolder(dirpath,destFolder); \n console.log(\"---------------------------------------------------------------------\");\n }\n else{ // loops through each folder/file and acc. operates through if else.\n let content = getContent(dirpath); // Gets an array of all files & folder in \"dirpath\".\n for(let i=0;i<content.length;i++){\n let childPath = path.join(dirpath,content[i]);\n OrganizeDir(childPath,orgFilePath);\n }\n } \n}", "title": "" }, { "docid": "266a260e61176d7a646f5768233fe7f5", "score": "0.49195728", "text": "function findUserFolder(rowData)\n{\n var root = getRoot();\n var match_folder = root.getFoldersByName(rowData.last + \", \" + rowData.first + \" \" + \"(\" + rowData.odin + \")\");\n \n Logger.log(\"Searching for folder: \" + rowData.odin); \n \n while(match_folder.hasNext())\n {\n var to_find = match_folder.next();\n var name = to_find.getName();\n \n Logger.log(\"Found folder!\"); \n return to_find; \n }\n \n // else - We didn't find a user folder with that odin username!\n Logger.log(\"User folder not found!\");\n return null;\n}", "title": "" }, { "docid": "6f67b5ee47cdf1ab92e47a9f02a56a3e", "score": "0.49151137", "text": "function caml_sys_read_directory(name){\n var root = resolve_fs_device(name);\n var a = root.device.readdir(root.rest);\n var l = new Array(a.length + 1);\n l[0] = 0;\n for(var i=0;i<a.length;i++)\n l[i+1] = caml_new_string(a[i]);\n return l;\n}", "title": "" }, { "docid": "1ac3823335ba8fcfe9f4aca20482e25f", "score": "0.4901816", "text": "function loadFiles() {\n\twalkPath(__dirname + \"/CBA_A3/addons/\", (file) => {\n\t\tfs.readFile(file, (err, data) => {\n\t\t\tif (err) throw err;\n\n\t\t\t// console.log(\"Loaded file\", file);\n\t\t\tif (data) {\n\t\t\t\tparseContents(data.toString());\n\t\t\t\t// console.log(\"Loaded file contents\");\n\t\t\t\tsaveDocs();\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "140262f496abfceab3423dff71110917", "score": "0.48980346", "text": "function getDescription(folderName) {\n fetch(\"http://localhost:3000/?mode=description&title=\"+folderName)\n .then(checkStatus)\n .then(function(responseText) {\n document.getElementById(\"description\").innerHTML=responseText;\n })\n .catch(function(error) {\n });\n }", "title": "" }, { "docid": "d9619b53dd236e62e84256b5e568c734", "score": "0.48973775", "text": "function getAT3Dir()\r\n{\r\n\tvar strAT3Dir = document.location.pathname;\r\n\tstrAT3Dir = strAT3Dir.substr(0, strAT3Dir.lastIndexOf(\"\\\\\"));\r\n\tstrAT3Dir = strAT3Dir.substr(0, strAT3Dir.lastIndexOf(\"\\\\\"));\r\n\tstrAT3Dir = strAT3Dir.substr(0, strAT3Dir.lastIndexOf(\"\\\\\"));\r\n\treturn strAT3Dir;\r\n}", "title": "" }, { "docid": "462acff1558729f72b504d52d51755a5", "score": "0.4892273", "text": "function catch_dir_faces() {\n let path_tmp = __dirname\n path_tmp = path.join(path_tmp, \"..\")\n path_tmp = path.join(path_tmp, \"bin\")\n path_tmp = path.join(path_tmp, \"recognizerVideo\")\n path_tmp = path.join(path_tmp, \"recognizer\")\n path_tmp = path.join(path_tmp, \"att_faces\")\n path_tmp = path.join(path_tmp, \"tmp_faces\")\n return path_tmp;\n}", "title": "" }, { "docid": "864ce7dbb811c762891b3984dd6a0b2e", "score": "0.48882094", "text": "function getfoldername(dir='')\n{\n\tvar splitdir= workingdir.split('\\\\');\n\tvar last=splitdir[splitdir.length-1];\n\treturn last;\n}", "title": "" }, { "docid": "3f66134810d84859111087ee15eb67a0", "score": "0.48874408", "text": "function Setting_Foldername() {\r\n let foldername;\r\n foldername=''; // set folder to empty string to use selected(controlled) tokens instead \r\n foldername='Goblins'; \r\n return foldername; \r\n }", "title": "" }, { "docid": "fee7d6b3481f45d7ae48ad4eb557d816", "score": "0.4882349", "text": "async loadAll() {\n this.storage.clear();\n for (const path of fs_1.readdirSync(this.directory)) {\n const joined = path_1.join(this.directory, path);\n if (fs_1.lstatSync(joined).isDirectory()) {\n const files = fs_1.readdirSync(joined);\n if (files.length > 0) {\n let metadata = {};\n if (files.some(p => p.match(/meta.(?:yml|json)/g))) {\n for await (const file of files) {\n if (!/meta.(?:yml|json)/g.test(file))\n continue;\n metadata = await this.parse(fs_1.readFileSync(path_1.join(joined, file), { encoding: \"utf-8\" }));\n break;\n }\n }\n const language = new Language_1.Language(this, joined, metadata), ns = util_1.Util.walk(joined);\n ns.map((file) => this.load(language, path_1.relative(joined, file).split(path_1.sep)));\n this.storage.set(language.id, language);\n }\n }\n }\n }", "title": "" }, { "docid": "4eb84f485a17c46c241292b853b1ea24", "score": "0.4875301", "text": "function search() {\n const search = $('#search').val(),\n files = $('#files').find('li'),\n label = $('#label');\n let i = 0;\n\n label.text('Searching in path');\n files.each((index, elm) => {\n ($(elm).text().indexOf(search) !== -1) ? ( $(elm).show(), i++) : $(elm).hide()\n });\n if (i === 0) { // if no file found\n label.text('Searching in tree');\n $.get('/explore/search', {search}, (files) => console.log(files))\n }\n if (search === '') label.text('');\n}", "title": "" }, { "docid": "a410f6e3cfc35fe7ef3ca0ff2a25bb38", "score": "0.4868323", "text": "function parentFind() {\n \n try {\n deletekeys();\n spreadsheet.toast(\"Folder Index Run. Please Wait...\", \"Started\", -1);\n listParentFolder();\n spreadsheet.toast(\"Done Indexing.\", \"Success\", -1);\n } catch (e) {\n Browser.msgBox(\"Error\", \"Sorry, Error Occured: \" + e.toString(), Browser.Buttons.OK);\n spreadsheet.toast(\"Error Occurred :( Put at D1.\", \"Oops!\", -1);\n }\n\n}", "title": "" }, { "docid": "269805a04a71b0a269fbf3d2ec20891d", "score": "0.48635608", "text": "function scanFolder(fileList, gameName, progressDb) {\n // Grab the file list\n fileList = JSON.parse(\n fs.readFileSync(`./jak-project/goal_src/${gameName}/build/all_objs.json`),\n );\n for (const fileMeta of fileList) {\n // Skip art files\n if (fileMeta[2] == 3) {\n // Check it's line count\n let filePath = `./jak-project/goal_src/${gameName}/${fileMeta[4]}/${fileMeta[0]}.gc`;\n if (fs.existsSync(filePath)) {\n let fileLines = fs.readFileSync(filePath).toString().split(/\\r?\\n/);\n // Check if the last line is empty\n if (\n fileLines.length > 0 &&\n fileLines[fileLines.length - 1].trim().length === 0\n ) {\n fileLines.pop();\n }\n updateProgressDbEntry(fileMeta, fileLines, progressDb, gameName);\n }\n }\n }\n}", "title": "" }, { "docid": "a3f3e51510b26945513bf87ea48464a9", "score": "0.48573282", "text": "detectTypeFromFolder() {\n\t\tconst webappFolder = this.config.ui5.paths.webapp;\n\t\tconst srcFolder = this.config.ui5.paths.src;\n\t\tconst testFolder = this.config.ui5.paths.test;\n\t\tconst [hasWebapp, hasSrc, hasTest] = this.pathsExist([webappFolder, srcFolder, testFolder]);\n\t\tif (hasWebapp) return \"application\";\n\t\tif (hasSrc && hasTest) return \"library\";\n\t}", "title": "" }, { "docid": "a3f3e51510b26945513bf87ea48464a9", "score": "0.48573282", "text": "detectTypeFromFolder() {\n\t\tconst webappFolder = this.config.ui5.paths.webapp;\n\t\tconst srcFolder = this.config.ui5.paths.src;\n\t\tconst testFolder = this.config.ui5.paths.test;\n\t\tconst [hasWebapp, hasSrc, hasTest] = this.pathsExist([webappFolder, srcFolder, testFolder]);\n\t\tif (hasWebapp) return \"application\";\n\t\tif (hasSrc && hasTest) return \"library\";\n\t}", "title": "" }, { "docid": "753b4953592cff70a91351f7f7930c26", "score": "0.4856358", "text": "function getFileList(dir){\n doesFileExist = false;\n var nextPath = makePath(dir);\n var url = \"http://flashair/command.cgi?op=100&DIR=\" + nextPath;\n\n $.get(url, function(data){\n //Save the current path.\n currentPath = nextPath;\n // Split lines by new line characters.\n wlansd = data.split(/\\n/g);\n // Ignore the first line (title) and last line (blank).\n wlansd.shift();\n wlansd.pop();\n splitFileList(currentPath);\n wlansd.sort(cmptime);\n showFileList(currentPath);\n // Success to get content list.\n doesFileExist = true;\n });\n}", "title": "" }, { "docid": "3ffc198e549074321ce634db5a96d8f6", "score": "0.48535407", "text": "function findFolder(folderName, level, fn){\n\tchrome.bookmarks.getTree(function(tree){\n\t\tvar children = tree[level].children;\n\t\tfor (i =0; i < children.length; i++) {\n\t\t\tif(children[i].title==folderName){\n\t\t\t\tfn(children[i]);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2487f48d27130e08d973909bcfb61ec6", "score": "0.4840767", "text": "function readEntries() \n {\n // file path\n var filePath = document.getElementById('filePath').value,\n // list directory entries\n callback = function(entry) {\n var reader = entry.createReader();\n reader.readEntries(\n function(entries) {\n entries[0].getParent(displayEntry, onFileSystemError);\n },\n onFileSystemError);\n };\n\n // look up file system entry \n window.resolveLocalFileSystemURI(getFileSystemURI(), callback, onFileSystemError);\n }", "title": "" }, { "docid": "9400f083f515abc1f53038f2c6300a5a", "score": "0.48298874", "text": "function getVideo() {\n\n var path = fileList[nextVideoIndex];\n\n nextVideoIndex++;\n if (nextVideoIndex >= fileList.length) {\n nextVideoIndex = 0;\n }\n return path;\n}", "title": "" }, { "docid": "4df4a23c0af6cca537bb926185496619", "score": "0.4827328", "text": "function getFolders(dir){\n return fs.readdirSync(dir)\n .filter(function(file){\n if(file.indexOf('default-partials') > -1) return;\n return fs.statSync(path.join(dir, file)).isDirectory();\n });\n}", "title": "" } ]
71d4aea78ab3d883635f8c2e4838a62b
Adds transition animations for the given element
[ { "docid": "f0bb41ea7e32591bca37bc5c1aff9634", "score": "0.69724554", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n removeClass(element, NO_TRANSITION);\n return css(element, {\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" } ]
[ { "docid": "036403167108f19482309d4e79ef827a", "score": "0.7264857", "text": "function animate(el) {\n // Set transition flag to true\n transition = true;\n\n // animate item on a newly added el\n // browser needs time to make element live\n // so we need a timeout of 100 seconds to make it work.\n setTimeout(()=>\n { el.classList.add('animate');}\n ,100);\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "9469e7daec34db12479613e3fe33c846", "score": "0.70255053", "text": "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "eea607db2e0c8947b3b60b500ecf18de", "score": "0.698394", "text": "function addAnimation(element) {\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "title": "" }, { "docid": "b8f3692d70edbe8c064f98211e8691ea", "score": "0.69708323", "text": "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n element.removeClass(NO_TRANSITION);\r\n return element.css({\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "title": "" }, { "docid": "4d71b76dc0ced7de1a322779e55a656b", "score": "0.6921652", "text": "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n removeClass(element, NO_TRANSITION);\r\n return css(element, {\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "title": "" }, { "docid": "4d71b76dc0ced7de1a322779e55a656b", "score": "0.6921652", "text": "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n removeClass(element, NO_TRANSITION);\r\n return css(element, {\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "title": "" }, { "docid": "a777b515662f99937b00226e6ef2ea04", "score": "0.6757366", "text": "function addAnimation(element){var transition='all '+options.scrollingSpeed+'ms '+options.easingcss3;removeClass(element,NO_TRANSITION);return css(element,{'-webkit-transition':transition,'transition':transition});}", "title": "" }, { "docid": "d4ed972ab5bdd8527e8bf84c027d7a21", "score": "0.671727", "text": "function setTransition(element) {\n\t\tvar el = element.querySelector('.' + options.aClass);\n\t\tel.style.WebkitTransitionDuration = options.duration + 'ms';\n\t\tel.style.transitionDuration = options.duration + 'ms';\n\t}", "title": "" }, { "docid": "7ed7c5030703bb4df31bdb8b706794f1", "score": "0.6565569", "text": "function addCssTransitions() {\n if (!browserSupportsTransitions || !useTransitions) {\n return;\n }\n\n var durationSeconds = (options.animationDuration / 1000),\n transition = 'all ' + durationSeconds + 's';\n\n items.css({\n '-webkit-transition': transition,\n '-moz-transition': transition,\n '-ms-transition': transition,\n '-o-transition': transition\n });\n }", "title": "" }, { "docid": "e8b4d80a0fe60af7ab4f63841952e80a", "score": "0.645543", "text": "animate(elements) {\n Array.isArray(elements)\n ? elements.forEach(element => element === null || element === void 0 ? void 0 : element.classList.add(this.kTransitionClass))\n : elements === null || elements === void 0 ? void 0 : elements.classList.add(this.kTransitionClass);\n }", "title": "" }, { "docid": "51269ccbcf17b03a5d3dc9000c2cae82", "score": "0.63997036", "text": "function animateElement(element, effect, delay, duration){\n const $element = $(element);\n // ES6 default function params are not supported on iOS9 or IE11\n if (!delay) delay = 1;\n if (!duration) duration = 1;\n $element.addClass('wow '+effect)\n .attr({\n \"data-wow-delay\": delay+\"s\",\n \"data-wow-duration\": duration+\"s\"\n })\n }", "title": "" }, { "docid": "097fba097da51c61f68da61a682ef8c1", "score": "0.62357473", "text": "function appendCssTransition(el, transition, prefixedValues)\n {\n for (let prefix of ['', '-webkit-', '-moz-', '-o-', '-ms-'])\n {\n let value = prefixedValues ? prefix + transition : transition;\n let existingValue = el.style.transition;\n if (!existingValue || existingValue === 'all 0s ease 0s')\n {\n el.style.transition = value;\n }\n else if (existingValue.indexOf(value) === -1)\n {\n value = `${existingValue}, ${value}`;\n el.style.transition = value;\n }\n }\n }", "title": "" }, { "docid": "94ba163aecd753f39f3573307c53e453", "score": "0.6223521", "text": "function animateElement(el, timeout = 200) {\n el.classList.add('animate');\n window.setTimeout(() => {\n el.classList.remove('animate');\n }, timeout);\n }", "title": "" }, { "docid": "8b2b2f4748b65748fac0ec7bb83e67f3", "score": "0.61920345", "text": "function Transition() {}", "title": "" }, { "docid": "925a35c66387d5544b8bde4bd2d1561f", "score": "0.6137837", "text": "function setupTransition(element, properties, duration, timing) {\r\n\t if (cssTransitionsSupported) {\r\n\t var style = (element).style;\r\n\t style.webkitTransitionProperty = properties;\r\n\t style.webkitTransitionDuration = duration + 'ms';\r\n\t style.webkitTransitionTimingFunction = timing;\r\n\t }\r\n\t}", "title": "" }, { "docid": "56d5144813151fb1fe760e5f1039d5a1", "score": "0.6117636", "text": "function setupTransitionTransform(element, duration, timing) {\r\n\t if (!timing) {\r\n\t timing = \"ease\";\r\n\t }\r\n\t setupTransition(element, \"-webkit-transform\", duration, timing);\r\n\t}", "title": "" }, { "docid": "284ac1e6b051098d1433fe90eec4c985", "score": "0.60783684", "text": "function FadeInTransition() {}", "title": "" }, { "docid": "7ad51c59b3cc88da40514cbab7eb402b", "score": "0.60479355", "text": "function setAnimate() {\n requestedAnimation = true // Indicate that this function has been called\n for (let i = 0; i < elementsToAnimate.length; i++) {\n if (isVisible(elementsToAnimate[i])) {\n elementsToAnimate[i].classList.add('animate')\n }\n else {\n // Optionally, do something when the element gets out of view.\n // e.g.: reverse the animation.\n // elementsToAnimate[i].classList.remove('animate')\n }\n }\n requestAnimationFrame(setAnimate)\n }", "title": "" }, { "docid": "9623ca4f37bdb79967f0bc0c93cf549a", "score": "0.60218173", "text": "animation(obg_animation, time, after_animation){\n let element_transition = [];\n for(var i in this.element)\n element_transition.push(this.elements[i].style.transition);\n\n setTimeout(function(t){\n t.style('transition', time/1000+'s');\n t.styleMultiple(obg_animation);\n }, 0, this);\n\n setTimeout(function(t){\n t.style('transition', '');\n for(var p in after_animation){\n t.style(p, after_animation[p]);\n }\n\n setTimeout((t)=>{for(var i in this.elements) this.elements[i].style.transition = element_transition.shift();}, time*2, this);\n\n }, time, this);\n }", "title": "" }, { "docid": "4e307d507269324c8df0a13a74b492e5", "score": "0.6011528", "text": "function animate(el) {\n return {\n getCssProperty: function (property) {\n var arr = ['','ms','webkit','Moz','O'];\n var style = window.getComputedStyle(el[0]);\n var r;\n function capitalize(str) {\n return str[0].toUpperCase()+str.substr(1,str.length-1);\n }\n if (style !== null) {\n for (var i=0;i < arr.length;i++) {\n if (arr[i].length < 1) {\n r = property;\n } else {\n r = arr[i]+capitalize(property);\n }\n if (typeof style[r] === 'string') {\n return style[r];\n }\n }\n }\n return false;\n },\n getTime: function () {\n var obj = {\n duration : 0,\n delay : 0\n };\n // For IE 8\n if (typeof window.getComputedStyle === 'function') {\n obj.duration = animate(el).jsTime(animate(el).getCssProperty('transitionDuration'));\n obj.delay = animate(el).jsTime(animate(el).getCssProperty('transitionDelay'));\n\n if (obj.delay === 0 && obj.duration === 0) {\n obj.duration = animate(el).jsTime(animate(el).getCssProperty('animationDuration'));\n obj.delay = animate(el).jsTime(animate(el).getCssProperty('animationDelay'));\n }\n }\n return obj;\n },\n jsTime: function (style) {\n if (style) {\n return parseFloat(style.match(/([0-9]+(\\.[0-9]+|))s/)[1])*1000;\n } else {\n return 0;\n }\n },\n start: function (callback) {\n return animate(el).init('in',callback);\n },\n end: function (callback) {\n return animate(el).init('out',callback);\n },\n custom: function (name,callback) {\n el.addClass(name);\n var time = animate(el).getTime();\n setTimeout(function () {\n el.removeClass(name);\n if (typeof callback === 'function') {\n callback(el);\n }\n },time.duration+time.delay);\n return el;\n },\n toggle: function () {\n if (el.hasClass('_animated-in')) {\n animate(el).end();\n } else {\n animate(el).start();\n }\n },\n classSwitch: function (arr) {\n el.removeClass('_animated-'+arr[1]);\n el.addClass('_animated-'+arr[0]);\n return animate(el);\n },\n ifOut: function (direction,arr,callback) {\n var time = animate(el).getTime();\n setTimeout(function () {\n if (direction === 'out') {\n el.removeClass('_animated-'+arr[0]);\n }\n if (typeof callback === 'function') {\n callback(el);\n }\n },time.duration+time.delay);\n return animate(el);\n },\n init: function (direction,callback) {\n if (typeof el[0] === 'undefined') {\n return false;\n } else {\n var arr = (direction === 'out')?['out','in']:['in','out'];\n function exe() {\n animate(el).classSwitch(arr).ifOut(direction,arr,callback);\n }\n if (direction === 'in') {\n exe();\n } else if (direction === 'out' && el.hasClass('_animated-in')) {\n exe();\n }\n return el;\n }\n },\n scroll: function () {\n var time = 70;\n var pos = (el.offset().top-el.height()/2)-($(window).height()/2);\n var start = window.pageYOffset;\n var i = 0;\n var frames = 20;\n\n function s() {\n i++;\n window.scrollTo(0,(start-((start/frames)*i))+((pos/frames)*i));\n if (i<frames) {\n setTimeout(function () {\n s();\n },(time/frames));\n }\n };\n s();\n }\n }\n}", "title": "" }, { "docid": "2ff65cfd94b35c8cc20a0b8f32ec96d7", "score": "0.6011528", "text": "function animate(el) {\n return {\n getCssProperty: function (property) {\n var arr = ['','ms','webkit','Moz','O'];\n var style = window.getComputedStyle(el[0]);\n var r;\n function capitalize(str) {\n return str[0].toUpperCase()+str.substr(1,str.length-1);\n }\n if (style !== null) {\n for (var i=0;i < arr.length;i++) {\n if (arr[i].length < 1) {\n r = property;\n } else {\n r = arr[i]+capitalize(property);\n }\n if (typeof style[r] === 'string') {\n return style[r];\n }\n }\n }\n return false;\n },\n getTime: function () {\n var obj = {\n duration : 0,\n delay : 0\n };\n // For IE 8\n if (typeof window.getComputedStyle === 'function') {\n obj.duration = animate(el).jsTime(animate(el).getCssProperty('transitionDuration'));\n obj.delay = animate(el).jsTime(animate(el).getCssProperty('transitionDelay'));\n\n if (obj.delay === 0 && obj.duration === 0) {\n obj.duration = animate(el).jsTime(animate(el).getCssProperty('animationDuration'));\n obj.delay = animate(el).jsTime(animate(el).getCssProperty('animationDelay'));\n }\n }\n return obj;\n },\n jsTime: function (style) {\n if (style) {\n return parseFloat(style.match(/([0-9]+(\\.[0-9]+|))s/)[1])*1000;\n } else {\n return 0;\n }\n },\n start: function (callback) {\n return animate(el).init('in',callback);\n },\n end: function (callback) {\n return animate(el).init('out',callback);\n },\n custom: function (name,callback) {\n el.addClass(name);\n var time = animate(el).getTime();\n setTimeout(function () {\n el.removeClass(name);\n if (typeof callback === 'function') {\n callback(el);\n }\n },time.duration+time.delay);\n return el;\n },\n toggle: function () {\n if (el.hasClass('is-animated_in')) {\n animate(el).end();\n } else {\n animate(el).start();\n }\n },\n classSwitch: function (arr) {\n el.removeClass('is-animated_'+arr[1]);\n el.addClass('is-animated_'+arr[0]);\n return animate(el);\n },\n ifOut: function (direction,arr,callback) {\n var time = animate(el).getTime();\n setTimeout(function () {\n if (direction === 'out') {\n el.removeClass('is-animated_'+arr[0]);\n }\n if (typeof callback === 'function') {\n callback(el);\n }\n },time.duration+time.delay);\n return animate(el);\n },\n init: function (direction,callback) {\n if (typeof el[0] === 'undefined') {\n return false;\n } else {\n var arr = (direction === 'out')?['out','in']:['in','out'];\n function exe() {\n animate(el).classSwitch(arr).ifOut(direction,arr,callback);\n }\n if (direction === 'in') {\n exe();\n } else if (direction === 'out' && el.hasClass('is-animated_in')) {\n exe();\n }\n return el;\n }\n },\n scroll: function () {\n var time = 70;\n var pos = (el.offset().top-el.height()/2)-($(window).height()/2);\n var start = window.pageYOffset;\n var i = 0;\n var frames = 20;\n\n function s() {\n i++;\n window.scrollTo(0,(start-((start/frames)*i))+((pos/frames)*i));\n if (i<frames) {\n setTimeout(function () {\n s();\n },(time/frames));\n }\n };\n s();\n }\n }\n}", "title": "" }, { "docid": "fce81d85576f3346707d68a504f19b63", "score": "0.59873134", "text": "function transitions(object, args) {\n object.addAttribute('-webkit-transition', args);\n object.addAttribute('-moz-transition', args);\n object.addAttribute('-ms-transition', args);\n object.addAttribute('-0-transition', args);\n object.addAttribute('transition', args);\n}", "title": "" }, { "docid": "455044685aad64a0affb2aa7911b5525", "score": "0.5951025", "text": "updateAnimation(){\n let headline = document.querySelector(\".intro .container .info .headline\");\n let img = document.querySelector('.intro .container .intro-img img');\n let order = document.querySelector('.intro .container .intro-img .box .order');\n let line = document.querySelector('.intro .container .info .arrow-container .line');\n\n setTimeout(() => {\n headline.classList.add('fadeInSlow');\n }, 300);\n \n setTimeout(() => {\n img.classList.add('fadeIn');\n }, 150);\n\n setTimeout(() => {\n order.classList.add('orderNowSlide');\n }, 150);\n\n setTimeout(() => {\n line.classList.add('lineSlide');\n }, 250);\n }", "title": "" }, { "docid": "279684c793e5bda155eb231f292a2707", "score": "0.593732", "text": "trigger(element) {\n if (element.is('[data-animation-delay]')) {\n setTimeout(() => {\n element.removeClass('invisible').addClass(element.data('animation'));\n }, Number.parseInt($(this).data('animation-delay')));\n } else {\n element.removeClass('invisible').addClass(element.data('animation'));\n }\n }", "title": "" }, { "docid": "3011241133ad7607d0f27da04dc1da8a", "score": "0.59244627", "text": "function animations(element){\n var activeButton=document.querySelector(\".\"+element);\n activeButton.classList.toggle(\"pressed\");\n setTimeout(function(){activeButton.classList.toggle(\"pressed\");},100);\n}", "title": "" }, { "docid": "95a0b980efb4a3de1aee5ef6392b2ed4", "score": "0.58910775", "text": "function ease_in(el) {\n $(el).css({\n transition: \"opacity ease 0.5s, height ease 0.5s, padding ease 0.5s\",\n height: 0,\n padding: 0,\n opacity: 0\n });\n\n setTimeout(function () {\n $(el).css({\n height: \"\",\n padding: \"\",\n opacity: 1\n });\n\n setTimeout(function () {\n $(el).css({\n transition: \"\",\n opacity: \"\"\n });\n }, 500);\n }, 0);\n}", "title": "" }, { "docid": "eb78dc9aed57de55ae5bfad98acf035b", "score": "0.58874637", "text": "function transition(eOut, eIn) {\n eOut.classList.add(\"fade-out\");\n eOut.style.display = \"none\";\n eIn.style.display = \"flex\";\n eIn.classList.remove(\"fade-out\");\n eIn.classList.add(\"fade-in\");\n}", "title": "" }, { "docid": "71ec7f9ec8446121e99be689cb5da124", "score": "0.5835878", "text": "function tweenAnimate() {}", "title": "" }, { "docid": "4d5d1e217a4a1a340b6462e15a30eceb", "score": "0.5822562", "text": "function transitionElems (transitions, timeout, easing, callback) {\n\t\tif (typeof transitions.length !== 'number') {\n\t\t\ttransitions = [ transitions ];\n\t\t}\n\n\t\tvar opacities = transitions.map(function (transition) {\n\t\t\treturn transition.elem.style.opacity;\n\t\t});\n\n\t\tsetInitialStyles(function () {\n\t\t\tanimateElems(function () {\n\t\t\t\trestoreStyles(function () {\n\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tfunction setInitialStyles (callback) {\n\t\t\tforEach(transitions, function (transition) {\n\t\t\t\tif (typeof transition.transitionStart !== 'undefined') {\n\t\t\t\t\tsetTransform(transition.elem, transition.transitionStart);\n\t\t\t\t}\n\t\t\t\tif (typeof transition.opacityStart !== 'undefined') {\n\t\t\t\t\ttransition.elem.style.opacity = transition.opacityStart + '';\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetTimeout(function () {\n\t\t\t\tforEach(transitions, function (transition) {\n\t\t\t\t\tvar e = transition.easing||easing,\n\t\t\t\t\t\ttransitionString = 'transform '+(timeout/1000)+'s '+e+', opacity '+(timeout/1000)+'s '+e;\n\t\t\t\t\tsetTransition(transition.elem, transitionString);\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(callback, 0);\n\t\t\t}, 0);\n\t\t}\n\n\t\tfunction animateElems (callback) {\n\t\t\tforEach(transitions, function (transition) {\n\t\t\t\tif (typeof transition.transitionEnd !== 'undefined') {\n\t\t\t\t\tsetTransform(transition.elem, transition.transitionEnd);\n\t\t\t\t}\n\t\t\t\tif (typeof transition.opacityEnd !== 'undefined') {\n\t\t\t\t\ttransition.elem.style.opacity = transition.opacityEnd + '';\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar lastTransition = transitions[transitions.length-1];\n\t\t\tlastTransition.elem.addEventListener('webkitTransitionEnd' , transitionFinished , false);\n\t\t\tlastTransition.elem.addEventListener('transitionend' , transitionFinished , false);\n\t\t\tlastTransition.elem.addEventListener('onTransitionEnd' , transitionFinished , false);\n\t\t\tlastTransition.elem.addEventListener('ontransitionend' , transitionFinished , false);\n\t\t\tlastTransition.elem.addEventListener('MSTransitionEnd' , transitionFinished , false);\n\t\t\tlastTransition.elem.addEventListener('transitionend' , transitionFinished , false);\n\n\t\t\tvar done = false;\n\n\t\t\tfunction transitionFinished (e) {\n\t\t\t\tif (done || (e.target !== lastTransition.elem)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdone = true;\n\n\t\t\t\tforEach(transitions, function (transition) {\n\t\t\t\t\tlastTransition.elem.removeEventListener('webkitTransitionEnd' , transitionFinished);\n\t\t\t\t\tlastTransition.elem.removeEventListener('transitionend' , transitionFinished);\n\t\t\t\t\tlastTransition.elem.removeEventListener('onTransitionEnd' , transitionFinished);\n\t\t\t\t\tlastTransition.elem.removeEventListener('ontransitionend' , transitionFinished);\n\t\t\t\t\tlastTransition.elem.removeEventListener('MSTransitionEnd' , transitionFinished);\n\t\t\t\t\tlastTransition.elem.removeEventListener('transitionend' , transitionFinished);\n\t\t\t\t});\n\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\n\t\tfunction restoreStyles (callback) {\n\t\t\tforEach(transitions, function (transition) {\n\t\t\t\tsetTransition(transition.elem, '');\n\t\t\t});\n\n\t\t\tsetTimeout(function () {\n\t\t\t\tforEach(transitions, function (transition, i) {\n\t\t\t\t\tsetTransform(transition.elem, '');\n\t\t\t\t\ttransition.elem.style.opacity = opacities[i];\n\t\t\t\t});\n\n\t\t\t\tcallback();\n\t\t\t}, 0);\n\t\t}\n\t}", "title": "" }, { "docid": "efd1121210391b48fba04c17cd710248", "score": "0.5818238", "text": "function slideanimate(elements) {\n\t\tvar animationEndEvents =\n\t\t\t'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\t\telements.each(function () {\n\t\t\tvar $this = $(this);\n\t\t\tvar animationDelay = $this.data('delay');\n\t\t\tvar animationType = 'animated ' + $this.data('animation');\n\t\t\t$this.css({\n\t\t\t\t'animation-delay': animationDelay,\n\t\t\t\t'-webkit-animation-delay': animationDelay,\n\t\t\t});\n\t\t\t$this\n\t\t\t\t.addClass(animationType)\n\t\t\t\t.one(animationEndEvents, function () {\n\t\t\t\t\t$this.removeClass(animationType);\n\t\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "d7237f8363e15937728d1cda3e3aaf4b", "score": "0.58180755", "text": "function setAnimation(elementID) {\n\tvar card = document.getElementById(elementID);\n\t// create class and keyframe animation\n\tvar animationName = createAnimation(elementID);\n\tconsole.log(\"Animation status:\" + animationName);\n\t// add new class\n\tcard.classList.add(animationName);\n}", "title": "" }, { "docid": "f4c7e4a55aefd0bc5e82b0c60a3c5a3b", "score": "0.58166015", "text": "function jumpInAnimation(elementID) {\n //dodao sam parametar elementID u funkciju kako bi kreirao querySelector koji gadja elemente samo pod tim id-em\n\n //smestam u niz sve elemente koje nadje querySelectorAll\n var jumpInElements = document.querySelectorAll(\"#\" + elementID + \" .jumpIn\");\n\n for (var i = 0; i < jumpInElements.length; i++) {\n jumpInElements[i].style.position = \"relative\";\n jumpInElements[i].style.float = \"left\";\n jumpInElements[i].style.visibility = \"visible\";\n jumpInElements[i].style[jumpInElements[i].getAttribute(\"data-direction\")] = \"0\";\n }\n\n}", "title": "" }, { "docid": "d2a40c627d2f7c077ec38629b8b61412", "score": "0.58079636", "text": "function BasicTransition() {}", "title": "" }, { "docid": "72b71056e63f67a8545b296e40a0b851", "score": "0.5800432", "text": "function doAnimation(element) {\n $(element).animate({\n opacity: '0.2'\n });\n $(element).animate({\n opacity: '1'\n });\n }", "title": "" }, { "docid": "623de0efbabc0c2ec13e1f0d2b31b50f", "score": "0.57991153", "text": "function transition(){\r\n document.querySelector('#cover').classList.add('disappear');\r\n document.querySelector('.result-wrapper').classList.add('result-appear');\r\n document.querySelector('#next').classList.add('next-appear');\r\n}", "title": "" }, { "docid": "ab3f268330730688c9cb34d32a8b75e7", "score": "0.5791693", "text": "function addAnimation() {\n\n // If not done already, find the nav element and\n if ( ! navElem ) {\n\n navElem = angular.element( document.querySelector( '#app-navbar--nav' ) );\n\n }\n\n // Add the animation class.\n navElem.addClass( animationClass );\n\n }", "title": "" }, { "docid": "b1350c19a793b6cbfdfe06199dce9d1f", "score": "0.57821363", "text": "function animateRow(){\n var rows = document.getElementsByClassName('resultRow');\n for (var i = 0; i < rows.length; i++){\n rows[i].style =\"transition: left 0.6s linear 0s; transition-delay: \"+ i / 10 +\"s; left: 0%\";\n }\n }", "title": "" }, { "docid": "ea175a192cf33a5c99459bf3beb712d4", "score": "0.5774155", "text": "function generateEnqueuedAnimationObject (element, transitions, css, groupId) {\n var START_VALUE = 0,\n END_VALUE = 1,\n NUM_FRAMES = 2,\n EASING = 3,\n USE_ROUGH = 4;\n\n var trans = extractTransitionsArray (transitions, css, START_VALUE, END_VALUE, NUM_FRAMES, EASING, USE_ROUGH);\n\n // Because the initial value can be \"currentValue\", get a valid css property to initialize the object\n var currentCSSValueStart = trans[START_VALUE] == 'currentValue'? currentCSSValueOf (element, css) : toCalculatedCSSValue (element, css, trans[START_VALUE]),\n currentCSSValueEnd = trans[END_VALUE] == 'currentValue'? currentCSSValueOf (element, css) : toCalculatedCSSValue (element, css, trans[END_VALUE]);\n\n\n var animation = {\n animationName: animName (null, css, groupId),\n startValue: currentCSSValueStart,\n endValue: currentCSSValueEnd,\n interpolator: trans[USE_ROUGH]? false : cssInterpolate,\n numFrames: trans[NUM_FRAMES],\n updater: function (el, cssProperty, s, e, gN, interpolCSSValue) {el.style[cssProperty] = interpolCSSValue},\n\n interpolationTransform: TRANSFORMS[trans[EASING]]? TRANSFORMS[trans[EASING]] : TRANSFORMS.linear,\n\n onAnimationStart: function (el, cssProperty, startValue, e, groupNumber) {\n // Update DPI in case of user zoom or whatnot\n cssUnitCaster.updateDPI ();\n\n if (startValue !== 'currentValue')\n el.style[cssProperty] = startValue;\n\n animator.start ().playAnimation (animName (null, cssProperty, groupNumber));\n },\n\n onAnimationEnd: function (el, cssProperty, s, endValue, groupNumber) {\n // Update DPI in case of user zoom or whatnot\n cssUnitCaster.updateDPI ();\n\n if (endValue !== 'currentValue')\n el.style[cssProperty] = endValue;\n\n animator.start ().pauseAnimation (animName (null, cssProperty, groupNumber));\n\n cssAnimationQueue.pop (groupNumber);\n \n // Update the animator on the new active group\n if (cssAnimationQueue.updateAnimator)\n updateAnimatorOnTheAnimationQueue ();\n },\n\n updateArguments: [element, css, trans[START_VALUE], trans[END_VALUE], groupId]\n };\n\n return animation;\n }", "title": "" }, { "docid": "d21c062e35cfc3a35f49a5eae0cabc21", "score": "0.5772986", "text": "static _executeTransformation(e) {\n e._targetElem.setAttribute(\"style\", e._transformation[e._timelineIndex]);\n e._targetElem.style[\"transition-duration\"] = e._transformationObject[e._timelineIndex].duration + \"s\";\n e._targetElem.style[\"transition-timing-function\"] = e._transformationObject[e._timelineIndex].ease\n }", "title": "" }, { "docid": "15cd450362d54f559d4c5232a27cf51e", "score": "0.57652915", "text": "function executeTransition(element, transitions, done) {\n var longestDurationPlusDelay = 0;\n var longestDurationProperty = '';\n var cssTransitions = [];\n _.each(transitions, function (transition) {\n var property = transition.property;\n var duration = transition.duration;\n var timing = transition.timing === undefined ? 'linear' : transition.timing;\n var delay = transition.delay === undefined ? 0 : transition.delay;\n var from = transition.from;\n if (duration + delay > longestDurationPlusDelay) {\n longestDurationPlusDelay = duration + delay;\n longestDurationProperty = property;\n }\n // Initial state\n element.style[property] = from;\n // Resolve styles. This is a trick to force the browser to refresh the\n // computed styles. Without this, it won't pick up the new \"from\" value\n // that we just set above.\n // tslint:disable-next-line\n getComputedStyle(element).opacity;\n // TODO: Cross-browser equivalent of 'transition' style (e.g. vendor prefixed).\n cssTransitions.push(property + ' ' + duration + 'ms ' + timing + ' ' + delay + 'ms');\n });\n element.style.transition = cssTransitions.join(', ');\n var finish;\n var onTransitionEnd = function (ev) {\n if (ev.target === element && ev.propertyName === longestDurationProperty) {\n finish();\n }\n };\n // TODO: Cross-browser equivalent of 'transitionEnd' event (e.g. vendor prefixed).\n element.addEventListener('webkitTransitionEnd', onTransitionEnd);\n element.addEventListener('transitionEnd', onTransitionEnd);\n var timeoutId = 0;\n var didFinish = false;\n finish = function () {\n if (!didFinish) {\n Timers_1.default.clearTimeout(timeoutId);\n // Only complete the transition if we are ending the same transition it was initially set.\n // There are cases where transitions may be overriden before the transition ends.\n if (element.dataset.transitionId === timeoutId.toString()) {\n // TODO: Cross-browser equivalent of 'transitionEnd' event (e.g. vendor prefixed).\n element.removeEventListener('webkitTransitionEnd', onTransitionEnd);\n element.removeEventListener('transitionEnd', onTransitionEnd);\n delete element.dataset.transitionId;\n element.style.transition = 'none';\n didFinish = true;\n done();\n }\n }\n };\n // Watchdog timeout for cases where transitionEnd event doesn't fire.\n timeoutId = Timers_1.default.setTimeout(function () {\n // If the item was removed from the DOM (which can happen if a\n // rerender occurred), don't bother finishing. We don't want to do\n // this in the transition event finish path because it's expensive\n // and unnecessary in that case because the transition event\n // implies that the element is still in the DOC\n if (document.body.contains(element)) {\n finish();\n }\n }, longestDurationPlusDelay + 10);\n element.dataset.transitionId = timeoutId.toString();\n // Set the \"to\" values.\n _.each(transitions, function (transition) {\n var property = transition.property;\n var to = transition.to;\n element.style[property] = to;\n });\n}", "title": "" }, { "docid": "0dbc4ebd6383005937f1f0ca539732bb", "score": "0.5751254", "text": "function animate() {\n // is element in view?\n if (inView() && !element.classList.contains(\"animate__fadeInUp\")) {\n // element is in view, add class to element\n element.classList.toggle(\"opacity-0\");\n element.classList.toggle(\"animate__fadeInUp\");\n }\n if (inViewTwo() && !midEle3.classList.contains(\"animate__fadeInUp\")) {\n midEle1.classList.toggle(\"opacity-0\");\n midEle1.classList.toggle(\"animate__fadeInUp\");\n midEle2.classList.toggle(\"opacity-0\");\n midEle2.classList.toggle(\"animate__fadeInUp\");\n midEle3.classList.toggle(\"opacity-0\");\n midEle3.classList.toggle(\"animate__fadeInUp\");\n midEle4.classList.toggle(\"opacity-0\");\n midEle4.classList.toggle(\"animate__fadeInUp\");\n }\n if (inViewThree() && !kisaca.classList.contains(\"animate__fadeInUp\")) {\n kisaca.classList.toggle(\"opacity-0\");\n kisaca.classList.toggle(\"animate__fadeInUp\");\n biz.classList.toggle(\"opacity-0\");\n biz.classList.toggle(\"animate__fadeInUp\");\n }\n}", "title": "" }, { "docid": "9779d033be7687f2a7e2b54dabd9144c", "score": "0.57314074", "text": "onAddNewAnimation($event) {\n let newAnim = new Animation({\n id: this.studioState_.getUniqueAnimationId(),\n blocks: [],\n duration: 300\n });\n this.studioState_.deselectItem(this.studioState_.activeAnimation);\n this.studioState_.animations.push(newAnim);\n this.studioState_.activeAnimation = newAnim;\n this.studioState_.animChanged();\n }", "title": "" }, { "docid": "0f7f0d2f0b76229bc8a9b02ed3e5e502", "score": "0.5720868", "text": "function triggerAnimation(element) {\n element.classList.remove('change-animation');\n void element.offsetWidth;\n element.classList.add('change-animation');\n}", "title": "" }, { "docid": "5c7dcdff1ae08c55565d66b7d9a481ae", "score": "0.57098466", "text": "animate(animation) {}", "title": "" }, { "docid": "edee4ffce23ebc95b88fa62f4ff848a6", "score": "0.5707531", "text": "function setAnimation ( _elem, _InOut ) {\n // Store all animationend event name in a string.\n // cf animate.css documentation\n var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\n _elem.each ( function () {\n var $elem = $(this);\n var $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\n\n $elem.addClass($animationType).one(animationEndEvent, function () {\n $elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n });\n });\n }", "title": "" }, { "docid": "a64b1062aebb5c8b5e8427c7dee0c40a", "score": "0.5704202", "text": "function startAnimation(elementClass) {\n\n var fadein_tween = TweenLite.from( elementClass, 2, {autoAlpha:1 , y: 30} );\n\n}", "title": "" }, { "docid": "da3299217da429e90b0d19e57cb2a323", "score": "0.56890535", "text": "function flashElement(element) {\n element.classList.add(\"flash\");\n document.addEventListener(\"transitionend\", function() {\n setTimeout(function() {\n element.classList.remove(\"flash\");\n }, 1000);\n });\n}", "title": "" }, { "docid": "18eeb76deed4ab14275e1b41c896203f", "score": "0.5681959", "text": "function moveElement(element, byX, byY, duration){\n d3.select(\"#\"+element)\n .transition()\n .attr(\"transform\", \"translate(\"+byX+\",\"+byY+\")\")\n .duration(duration);\n}", "title": "" }, { "docid": "ab29e7be3dad2768fe9b01037263fd56", "score": "0.5672277", "text": "transition(active) {\n this.slide.style.transition = active ? \"transform .3s\" : \"\";\n }", "title": "" }, { "docid": "f0403e25d48af7e95c4df16bbc388c03", "score": "0.5671116", "text": "function animate() {\n\t\tbubbleChartGroup.transition()\n\t\t.duration(30000)\n\t\t.ease(d3.easeLinear)\n\t\t.tween(\"year\",tweenYear) /*use tween method to create transition frame by frame*/\n\t}", "title": "" }, { "docid": "16f1291f17c983b8cce4e3af159914d2", "score": "0.5667328", "text": "function applyTransition(element, width){\n \t\telement.css({\n \t\t\t\"transform\":\"translate3d(\"+width+\"px,0,0)\",\n \t\t\t\"-webkit-transform\":\"translate3d(\"+width+\"px,0,0)\",\n \t\t\t\"-moz-transform\":\"translate3d(\"+width+\"px,0,0)\",\n \t\t\t// For IE 10.0\n \t\t\t\"-ms-transform\":\"translate3d(\"+width+\"px,0,0)\",\n \t\t\t// For IE 9.0\n \t\t\t\"-ms-transform\":\"translateX(\"+width+\"px)\",\n \t\t\t\"-o-transform\":\"translate3d(\"+width+\"px,0,0)\"\n \t\t});\n \t}", "title": "" }, { "docid": "b097d67f9056d725160c8ce521ac5b3b", "score": "0.56654835", "text": "updateAnimations() {\n\n }", "title": "" }, { "docid": "15a1e42e030cda962062a395f1f5deaa", "score": "0.5659745", "text": "function setAnimation ( _elem, _InOut ) {\n // Store all animationend event name in a string.\n // cf animate.css documentation\n var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\n _elem.each ( function () {\n var $elem = $(this);\n var $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\n\n $elem.addClass($animationType).one(animationEndEvent, function () {\n $elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n });\n });\n }", "title": "" }, { "docid": "3d7bcdfb91bec8e255898328763761f5", "score": "0.5645674", "text": "function animateCSS(element, animationName, callback) {\r\n const node = document.querySelector(element);\r\n node.classList.add(\"animated\", animationName);\r\n\r\n function handleAnimationEnd() {\r\n node.classList.remove(\"animated\", animationName);\r\n node.removeEventListener(\"animationend\", handleAnimationEnd);\r\n\r\n if (typeof callback === \"function\") callback();\r\n }\r\n\r\n node.addEventListener(\"animationend\", handleAnimationEnd);\r\n}", "title": "" }, { "docid": "b71a5c1a897c1319f46d5a66829066c4", "score": "0.56405014", "text": "function generateAnimationObject (element, transitions, css, animationId) {\n // Index values of the transitions object arrays (see this.animate for more details)\n var START_VALUE = 0,\n END_VALUE = 1,\n NUM_FRAMES = 2,\n EASING = 3,\n USE_ROUGH = 4;\n\n var trans = extractTransitionsArray (transitions, css, START_VALUE, END_VALUE, NUM_FRAMES, EASING, USE_ROUGH);\n\n // Because the initial value can be \"currentValue\", get a valid css property to initialize the object\n var currentCSSValueStart = trans[START_VALUE] == 'currentValue'? currentCSSValueOf (element, css) : toCalculatedCSSValue (element, css, trans[START_VALUE]),\n currentCSSValueEnd = trans[END_VALUE] == 'currentValue'? currentCSSValueOf (element, css) : toCalculatedCSSValue (element, css, trans[END_VALUE]);\n \n\n var animation = {\n animationName: animName (animationId, css),\n startValue: currentCSSValueStart,\n endValue: currentCSSValueEnd,\n interpolator: trans[USE_ROUGH]? false : cssInterpolate,\n numFrames: trans[NUM_FRAMES],\n updater: function (el, cssProperty, s, e, id, interpolCSSValue) {el.style[cssProperty] = interpolCSSValue},\n\n interpolationTransform: TRANSFORMS[trans[EASING]]? TRANSFORMS[trans[EASING]] : TRANSFORMS.linear,\n\n onAnimationStart: function (el, cssProperty, sVal, e, id) {\n // Update screen DPI in case of user zoom or whatnot\n cssUnitCaster.updateDPI ();\n\n if (sVal !== 'currentValue') el.style[cssProperty] = sVal;\n\n // Prevents regular animation calls from overriding enqueued animation calls\n animator.start ().playAnimation (animName (id, cssProperty));\n },\n\n onAnimationEnd: function (el, cssProperty, s, endVal, id) {\n // Update screen DPI in case of user zoom or whatnot\n cssUnitCaster.updateDPI ();\n\n if (endVal !== 'currentValue') el.style[cssProperty] = endVal;\n\n // Prevents regular animation calls from overriding enqueued animation calls\n animator.start ().pauseAnimation (animName (id, cssProperty));\n },\n \n updateArguments: [element, css, trans[START_VALUE], trans[END_VALUE], animationId]\n };\n\n return animation;\n }", "title": "" }, { "docid": "287a43be52feba5f887e4be3dcdcde71", "score": "0.5634635", "text": "function setAnimation ( _elem, _InOut )\n\t\t\t{\n\t\t\t\t// Store all animationend event name in a string.\n\t\t\t\t// cf animate.css documentation\n\t\t\t\tvar animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\n\t\t\t\t_elem.each ( function ()\n\t\t\t\t{\n\t\t\t\t\tvar $elem = $(this);\n\t\t\t\t\tvar $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\n\n\t\t\t\t\t$elem.addClass($animationType).one(animationEndEvent, function ()\n\t\t\t\t\t{\n\t\t\t\t\t\t$elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "268f388167abc84f64e0306acdc5c860", "score": "0.5632369", "text": "static _playTransitionAt(e, delay) {\n\t\t\n e._targetElem.setAttribute(\"style\", e._initialStyle);\n for(const x of Object.keys(e._initialStyleObject))\n e._targetElem.style[x] = getComputedStyle(e._targetElem).getPropertyValue(x);\n \n e._targetElem.setAttribute(\"style\", e._transformation);\n e._targetElem.style[\"transition-duration\"] = \"1s\";\n e._targetElem.style[\"transition-timing-function\"] = e._transitionEase;\n e._targetElem.style[\"transition-delay\"] = -delay + \"ms\";\n\n for(const x of Object.keys(e._transformationObject))\n e._targetElem.style[x] = getComputedStyle(e._targetElem).getPropertyValue(x);\n //e._eventState = __EVENT_STATES__.__RUNNING__;\n\n //e._targetElem.style.removeProperty(\"transition-duration\");\n //e._targetElem.style.removeProperty(\"transition-delay\");\n //e._targetElem.style.removeProperty(\"transition-timing-function\");\n \n }", "title": "" }, { "docid": "fb2bd8542a5dd60a79203fa4e2bc484d", "score": "0.56308424", "text": "function animate(element, animation) {\n $(element).addClass('animated ' + animation);\n var wait = setTimeout(function () {\n $(element).removeClass('animated ' + animation);\n }, 1000);\n }", "title": "" }, { "docid": "1670a27373fb7c040a6dde205269ea6a", "score": "0.561568", "text": "addAnimation(name, from, to) {\n this._animations[name] = {from: from, to: to};\n }", "title": "" }, { "docid": "401f79ce447446232942c6b032db5506", "score": "0.5614914", "text": "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "abd8d8fc16ec41bfbaec1f51a4b9a363", "score": "0.5598942", "text": "function animateCSS(element, animationName, callback) {\n const node = document.querySelector(element);\n node.classList.add('animated', animationName);\n\n function handleAnimationEnd() {\n node.classList.remove('animated', animationName);\n node.removeEventListener('animationend', handleAnimationEnd);\n\n if (typeof callback === 'function') callback()\n }\n\n node.addEventListener('animationend', handleAnimationEnd)\n}", "title": "" }, { "docid": "c602715b09c374e1048adbfd54c1d823", "score": "0.5597421", "text": "function addClassFor ( element, className, duration ){\nif (duration > 0){\naddClass(element, className);\nsetTimeout(function(){\nremoveClass(element, className);\n}, duration);\n}\n}", "title": "" }, { "docid": "61df38b740c29fb5247933522d8d243a", "score": "0.55949485", "text": "function setAnimation ( _elem, _InOut )\r\n\t\t\t{\r\n\t\t\t\t// Store all animationend event name in a string.\r\n\t\t\t\t// cf animate.css documentation\r\n\t\t\t\tvar animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\r\n\r\n\t\t\t\t_elem.each ( function ()\r\n\t\t\t\t{\r\n\t\t\t\t\tvar $elem = $(this);\r\n\t\t\t\t\tvar $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\r\n\r\n\t\t\t\t\t$elem.addClass($animationType).one(animationEndEvent, function ()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$elem.removeClass($animationType); // remove animate.css Class at the end of the animations\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "0a198ca453faee04e2533c6fd0ef81f1", "score": "0.5594033", "text": "animateWithJS(el) {\n const scale = 200;\n const elStyle = el[0].style;\n const xPos = `${parseFloat(elStyle.left) - (scale / 2)}px`;\n const yPos = `${parseFloat(elStyle.top) - (scale / 2)}px`;\n\n el[0].style.opacity = '0.4';\n el.animate({\n opacity: 0,\n left: xPos,\n top: yPos,\n width: scale,\n height: scale\n }, 1000);\n }", "title": "" }, { "docid": "f06dc34eefec66ad0383cf5f892a948b", "score": "0.5593629", "text": "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "f3fa2abc4a045aa5cfe59c0e14bf69d9", "score": "0.55934817", "text": "function transformContainer(element, translate3d, animated) {\r\n element.toggleClass('pp-easing', animated);\r\n\r\n element.css(getTransforms(translate3d));\r\n }", "title": "" }, { "docid": "3ffa655f78ab132d877107ce44fc064f", "score": "0.55893505", "text": "animate(element, animation, speedMode = Animator.NORMAL_SPEED) {\r\n element = $(element);\r\n return new Promise((resolve, reject) => {\r\n let jqueryAnimations = ['fadeIn', 'fadeOut', 'slideDown', 'slideDown', 'hide', 'show'];\r\n\r\n if (jqueryAnimations.includes(animation)) {\r\n element[animation](function () {\r\n resolve();\r\n });\r\n return;\r\n }\r\n\r\n let classes = 'animated ' + animation + ' ' + speedMode;\r\n\r\n element.stop().show().removeClass(classes).addClass(classes).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function (e) {\r\n $(this).removeClass(classes);\r\n resolve();\r\n });\r\n });\r\n }", "title": "" }, { "docid": "a372c80dcf092876b9ecdee562f665dc", "score": "0.5587075", "text": "function transform(element, prop_from, prop_to)\n {\n element.removeClass('active-transition');\n element.removeAttr('style');\n\n element.addClass('init-transition');\n element.css({'transform': prop_from});\n element[0].dataset.transform = prop_to;\n }", "title": "" }, { "docid": "57bbc8a9468d0435628af3a98120c67f", "score": "0.558474", "text": "animate() {}", "title": "" }, { "docid": "753bafa0eb5c840572aef9bc33741e5e", "score": "0.55810755", "text": "function doAnimations( elems ) {\t\n\tvar animEndEv = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\telems.each(function () {\n\t\tvar $this = $(this),\n\t\t$animationType = $this.data('animation');\n\t\t$this.addClass($animationType).one(animEndEv, function () {\n\t\t\t$('.line_item_express').animate({height: 45}, 500);\n\t\t\t$this.removeClass($animationType);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "f893206851a8193f4aa8b53c85158859", "score": "0.5578024", "text": "function animateCSS(element, animationName, callback) {\n\tconst node = document.querySelector(element)\n\tnode.classList.add('animated', animationName)\n\n\tfunction handleAnimationEnd() {\n\t\tnode.classList.remove('animated', animationName)\n\t\tnode.removeEventListener('animationend', handleAnimationEnd)\n\n\t\tif (typeof callback === 'function') callback()\n\t}\n\n\tnode.addEventListener('animationend', handleAnimationEnd)\n}", "title": "" }, { "docid": "6a6d256afc6e008d5e1096ceb1c38f7d", "score": "0.55737865", "text": "function setAnimation(_elem, _InOut) {\n\t\t// Store all animationend event name in a string.\n\t\t// cf animate.css documentation\n\t\tvar animationEndEvent =\n\t\t\t\"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend\";\n\n\t\t_elem.each(function () {\n\t\t\tvar $elem = $(this);\n\t\t\tvar $animationType = \"animated \" + $elem.data(\"animation-\" + _InOut);\n\n\t\t\t$elem.addClass($animationType).one(animationEndEvent, function () {\n\t\t\t\t$elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "fd0564ae242b222c4c70c84d969ce1c7", "score": "0.5573398", "text": "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = \"webkitAnimationEnd animationend\";\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data(\"animation\");\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "a016f364a4cf56bf3fd35e4fb8147ef7", "score": "0.5570635", "text": "function inlineTransitions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // Monitors whenever an element changes an attribute, if the attribute is a\n // valid state name, add this element into the related Set.\n var attributeChanged = function attributeChanged(domNode, name, oldVal, newVal) {\n var map = transitionsMap[name];\n var isFunction = typeof newVal === 'function';\n\n // Abort early if not a valid transition or if the new value exists, but\n // isn't a function.\n if (!map || newVal && !isFunction) {\n return;\n }\n\n // Add or remove based on the value existence and type.\n map[isFunction ? 'set' : 'delete'](domNode, newVal);\n };\n\n var subscribe = function subscribe(_ref) {\n var addTransitionState = _ref.addTransitionState;\n\n addTransitionState('attributeChanged', attributeChanged);\n\n // Add a transition for every type.\n keys(transitionsMap).forEach(function (name) {\n var map = transitionsMap[name];\n\n var handler = function handler(child) {\n for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n // If there are no elements to match here, abort.\n if (!map.size) {\n return;\n }\n\n // If the child element triggered in the transition is the root\n // element, this is an easy lookup for the handler.\n if (map.has(child)) {\n return map.get(child).apply(undefined, [child, child].concat(rest));\n }\n // The last resort is looping through all the registered elements to\n // see if the child is contained within. If so, it aggregates all the\n // valid handlers and if they return Promises return them into a\n // `Promise.all`.\n else {\n var _ret = function () {\n var retVal = [];\n\n // Last resort check for child.\n map.forEach(function (fn, element) {\n if (element.contains(child)) {\n retVal.push(fn.apply(child, [element].concat(child, rest)));\n }\n });\n\n var hasPromise = retVal.some(function (ret) {\n return Boolean(ret && ret.then);\n });\n\n // This is the only time the return value matters.\n if (hasPromise) {\n return {\n v: Promise.all(retVal)\n };\n }\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n };\n\n // Save the handler for later unbinding.\n boundHandlers.push(handler);\n\n // Add the state handler.\n addTransitionState(name, handler);\n });\n };\n\n // This will unbind any internally bound transition states.\n var unsubscribe = function unsubscribe(_ref2) {\n var removeTransitionState = _ref2.removeTransitionState;\n\n // Unbind all the transition states.\n removeTransitionState('attributeChanged', attributeChanged);\n\n // Remove all elements from the internal cache.\n keys(transitionsMap).forEach(function (name) {\n var map = transitionsMap[name];\n\n // Unbind the associated global handler.\n removeTransitionState(name, boundHandlers.shift());\n\n // Empty the associated element set.\n map.clear();\n });\n\n // Empty the bound handlers.\n boundHandlers.length = 0;\n };\n\n return assign(function inlineTransitionsTask() {}, { subscribe: subscribe, unsubscribe: unsubscribe });\n}", "title": "" }, { "docid": "60455a692fd8b3c142e48dbd978702c1", "score": "0.5563749", "text": "function applyAnimations(){\n animateElement('section h2', 'slideInUp', .3);\n animateElement('#skills h3, #about blockquote', 'fadeIn', .3);\n animateChildren('.about-text',aboutParagraphs);\n animateChildren('.tpl-alt-tabs',skillsIcons);\n animateChildren('.ci-parent',contactIcons);\n animateChildren('.footer-social-links',footerIcons);\n // Generic helper function that applies an animation to a DOM element\n function animateElement(element, effect, delay, duration){\n const $element = $(element);\n // ES6 default function params are not supported on iOS9 or IE11\n if (!delay) delay = 1;\n if (!duration) duration = 1;\n $element.addClass('wow '+effect)\n .attr({\n \"data-wow-delay\": delay+\"s\",\n \"data-wow-duration\": duration+\"s\"\n })\n }\n // Generic helper function that applies animations to all children of a DOM element\n function animateChildren(parent, animation){\n const $parent = $(parent);\n $parent.each(function(){\n const $child = $(this).children();\n $child.each(animation)\n })\n }\n // Reference function for all the paragraphs in the About section\n function aboutParagraphs(index){\n animateElement(this, \"fadeIn\", \"0.\"+(index*2-1), .6);\n }\n // Reference function for all the skills icons and their titles\n function skillsIcons(index){\n animateElement(this, \"flipInX\", \"0.\"+(index+2), .4);\n animateElement($(this).find('p'), \"slideInDown\", .8, .6);\n }\n // Reference function for all the contact-info icons\n function contactIcons(){\n animateElement(this, \"rollIn\", .2, 1.2)\n }\n // Reference function for all the footer icons\n function footerIcons(index){\n const duration = .6;\n var delay = (index+1)*duration/2;\n animateElement(this, \"flip\", delay,duration);\n }\n}", "title": "" }, { "docid": "76495bf015f1c73a787596ef5bc2e57b", "score": "0.5563133", "text": "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = \"webkitAnimationEnd animationend\";\n\n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data(\"animation\");\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "43a6b9d5a159baffbe0f8b0e06b87a94", "score": "0.5540682", "text": "checkAnimation() {\n if (this.options.animate) {\n for (const el of this.element) {\n el.classList.add('accordion--animate');\n }\n }\n }", "title": "" }, { "docid": "e9fb9809fc1f872d7374b2c49537947d", "score": "0.55331945", "text": "function animateCSS(element, animationName, speed, callback) {\n const node = document.querySelector(element);\n node.classList.add(\"animated\", animationName, speed);\n\n function handleAnimationEnd() {\n node.classList.remove(\"animated\", animationName);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n if (typeof callback === \"function\") callback();\n }\n\n node.addEventListener(\"animationend\", handleAnimationEnd);\n}", "title": "" }, { "docid": "068fa2bb5db508f358d6b5bc796dd0c6", "score": "0.5533172", "text": "function animation(){\n //gets the number of items/group sizes of all the components being compressed.\n let count = document.getElementsByTagName(\"li\").length+1;\n let groupLength = Math.ceil(count/3);\n let groupNumber = 0;\n document.getElementById(\"navElements\").style.setProperty('--count', count+'');\n //gets an array of all the elements being compressed.\n let elements = document.getElementsByTagName(\"li\");\n let elementArray = [];\n elementArray[0] = document.getElementById(\"navHeader\");\n for (let i = 0; i < elements.length; i++){\n elementArray[i+1] = elements[i];\n }\n //sets what group each element is in.\n let ind = 1;\n elementArray.forEach(function (entry) {\n if ( ind > groupLength ) {\n groupNumber++;\n ind=1;\n }\n entry.setAttribute('data-group', groupNumber);\n ind++;\n });\n //on click function to open and close the navigation menu\n document.getElementById('navButton').onclick = function (e) {\n e.preventDefault();\n elementArray.forEach(function (entry) {\n //sets top location custom variable for each element for transition\n entry.style.setProperty('--top', entry.getBoundingClientRect().top + (entry.getAttribute('data-group')*-15)-20);\n //sets the delay in and out time for each each element\n entry.style.setProperty('--delay-in', elementArray.indexOf(entry)*.05+'s');\n entry.style.setProperty('--delay-out', (count-elementArray.indexOf(entry))*.05+'s');\n });\n //toggles the classList to be closed for css nav class\n document.getElementById('navBar').classList.toggle('closed');\n e.stopPropagation();\n }\n}", "title": "" }, { "docid": "f78c54f1e3d7fb0f7db8730b8178a24d", "score": "0.55328166", "text": "function setAnimation(_elem, _InOut) {\n // Store all animationend event name in a string.\n // cf animate.css documentation\n var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n _elem.each(function () {\n var $elem = $(this);\n var $animationType = 'animated ' + $elem.data('animation-' + _InOut);\n $elem.addClass($animationType).one(animationEndEvent, function () {\n $elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n });\n });\n }", "title": "" }, { "docid": "2c4f563ed80c523cc9dc974b283a45ee", "score": "0.5529716", "text": "function animate(elem, style, unit, from, to, time, prop) {\n if (!elem) return;\n var start = new Date().getTime();\n var timer = setInterval(function() {\n var step = Math.min(1, (new Date().getTime() - start) / time);\n if (prop) {\n elem[style] = (from + step * (to - from)) + unit;\n } else {\n elem.style[style] = (from + step * (to - from)) + unit;\n }\n if (step == 1) clearInterval(timer);\n }, 25);\n elem.style[style] = from + unit;\n}", "title": "" }, { "docid": "535c15995ba64e7153f5d39d15ad5e24", "score": "0.5521308", "text": "function animateSlide1Elements(){\r\n $('.main-logo').addClass(\"fadeIn\");\r\n $('.main-caption').addClass(\"fadeIn\");\r\n $('.btn-explore').addClass(\"fadeIn\");\r\n }", "title": "" }, { "docid": "8650d37c72ad5aa57047ab27dea86cbc", "score": "0.5519658", "text": "function animationClick(element, animation) {\n element = $(element);\n element.click(\n function() {\n element.addClass('animated ' + animation);\n //wait for animation to finish before removing classes\n window.setTimeout(function() {\n element.removeClass('animated ' + animation);\n }, 2000);\n\n });\n}", "title": "" }, { "docid": "e89d38db8054eb58d7a96d519d5d8bf8", "score": "0.5515732", "text": "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = \"webkitAnimationEnd animationend\";\n\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data(\"animation\");\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "8bdee65b106cc6f640387ffdb14cf3be", "score": "0.55108047", "text": "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "title": "" }, { "docid": "2a2c42e3e71821fb35b712311705ad95", "score": "0.5506337", "text": "function animate (selector, attributes, duration) {\n\t//add a default duration as it wasn't specified in the question\n\tduration = typeof duration !== 'undefined' ? duration : 1000;\n\n\twindow.requestAnimationFrame = window.requestAnimationFrame || \n\t\t\t\t\t\t\t\t window.mozRequestAnimationFrame ||\n\t window.webkitRequestAnimationFrame || \n\t window.msRequestAnimationFrame;\n\n\t//we need to determine what the selector is and how it specific it is\n\t//lets chuck this into it's own function\n\tvar elements = parseSelector(selector) //array of all elements to animate\n\t\n\t// next step is to create a new Object (class) for each element to affect.\n\tfor (element in elements) {\n\t\telements[element] = makeAnimEl(elements[element], attributes, duration)\n\t}\n\tlog(elements); //done\n\n\t// quick and dirty code to render the exact example in the question above\n\t// will implement more featured code shortly\n\tvar startTime = null;\n\n\tfunction animateAll(timeNow) {\n\t\tstartTime = startTime === null ? timeNow : startTime;\n\t\tvar targetTime = startTime + duration;\n\n\t\tvar delta = timeNow - startTime;\n\t\tlog('timeNow: ' + timeNow);\n\t\t//log('startTime: ' + startTime);\n\t\t//log('targetTime: ' + targetTime);\n\t\tif (timeNow <= targetTime) { // animation is still running\n\t\t\tfor (element in elements) {\n\t\t\t\telements[element].setElement(delta);\n\t\t\t}\n\t\t\trequestAnimationFrame(animateAll);\n\t\t} else { //we've gone over our animation time\n\t\t\tfor (element in elements) {\n\t\t\t\telements[element].setElement();\n\t\t\t}\n\t\t}\n\t}\n\n\trequestAnimationFrame(animateAll);\n\n}", "title": "" }, { "docid": "40d6bcf1caf73eeecf59ccaa5f2c4dd0", "score": "0.55047584", "text": "function animateElement(css, options) {\n if (!Array.isArray(css) || css.length !== 2) {\n throw new TypeError('animate polyfill requires an array for css with an initial and final state');\n }\n\n if (!options || !options.hasOwnProperty('duration')) {\n throw new TypeError('animate polyfill requires options with a duration');\n }\n\n var duration = options.duration || 0;\n var delay = options.delay || 0;\n var easing = options.easing;\n var initialCss = css[0];\n var finalCss = css[1];\n var allCss = {};\n var playback = { onfinish: null };\n\n Object.keys(initialCss).forEach(function(key) {\n allCss[key] = true;\n element.style[key] = initialCss[key];\n });\n\n // trigger reflow\n element.offsetWidth;\n\n var transitionOptions = ' ' + duration + 'ms';\n if (easing) {\n transitionOptions += ' ' + easing;\n }\n if (delay) {\n transitionOptions += ' ' + delay + 'ms';\n }\n\n element.style.transition = Object.keys(finalCss).map(function(key) {\n return key + transitionOptions\n }).join(', ');\n\n Object.keys(finalCss).forEach(function(key) {\n allCss[key] = true;\n element.style[key] = finalCss[key];\n });\n\n setTimeout(function() {\n Object.keys(allCss).forEach(function(key) {\n element.style[key] = '';\n });\n\n if (playback.onfinish) {\n playback.onfinish();\n }\n }, duration + delay);\n\n return playback;\n}", "title": "" }, { "docid": "79330e2a9ea2a583280678a744e721d7", "score": "0.55045116", "text": "onAnimationAddClick() {\n var model = appManager.getActiveDesignEditor().getModel(),\n tmpName = 'tmp-name-' + (animationId += 1);\n\n model.addAnimationGroup(tmpName);\n this.updateAnimationsList();\n\n this.$el.find('.closet-animations-container div').each((index, element) => {\n if (element.textContent === tmpName) {\n $(element).addClass('selected');\n this._activeElement.show();\n }\n });\n\n model.setActiveAnimationGroup(tmpName);\n this.$el.find('.animation-empty-info').hide();\n // @TODO prepare more effective refresh method, currently whole list is updated, but only one element is added\n this._activeElement.updateList();\n }", "title": "" }, { "docid": "3b4b690397962d492016cf0736730ad7", "score": "0.5492172", "text": "function removeAnimation(element){return addClass(element,NO_TRANSITION);}", "title": "" }, { "docid": "96deed8b1336b88c0707390cb826aa85", "score": "0.5489113", "text": "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n}", "title": "" }, { "docid": "d35898f97056d2a9c98282fd658ec94a", "score": "0.54889345", "text": "function setTransition(elementID) {\n\tconsole.log(\"ID: \" + elementID + \". Time:\" + lateTime);\n\tvar topName = elementID + \"_top\";\n\tvar trans = \"background-color \" + lateTime + \"s;\";\n\tvar obj = document.getElementById(topName);\n\t\n}", "title": "" }, { "docid": "3942642ff2c652023a8b08d514ebe27a", "score": "0.5483755", "text": "function doAnimations(elems) {\r\n //Cache the animationend event in a variable\r\n var animEndEv = 'webkitAnimationEnd animationend';\r\n\r\n elems.each(function () {\r\n var $this = $(this),\r\n $animationType = $this.data('animation');\r\n $this.addClass($animationType).one(animEndEv, function () {\r\n $this.removeClass($animationType);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "2ae680e30d7063937b65046c0e4acf83", "score": "0.5478324", "text": "function doAnimations(elems) {\n\n //Cache the animationend event in a variable\n\n var animEndEv = 'webkitAnimationEnd animationend';\n\n\n\n elems.each(function () {\n\n var $this = $(this),\n\n $animationType = $this.data('animation');\n\n $this.addClass($animationType).one(animEndEv, function () {\n\n $this.removeClass($animationType);\n\n });\n\n });\n\n }", "title": "" }, { "docid": "e794950e74403b2505e8a5f234b4c2f1", "score": "0.5477883", "text": "function addAnimation(desertBlocks) {\n let delay = 0;\n $.each(desertBlocks, function(i, block) {\n let animation = `falling .4s ${delay += .3}s cubic-bezier(0.19, 0.94, 0.77, 1.12) both`;\n $(block).css({'animation': animation});\n $(block).css({'-webkit-animation': animation});\n })\n}", "title": "" } ]
62550405a04b1fa162fda150f60499d2
/ Finds the top empty row given a board and a column to place a piece. / If there is no empty row, returns 1, otherwise returns the index of / the row.
[ { "docid": "82d703472a463292402f137736960c43", "score": "0.8239225", "text": "function findEmptyRow(board, column) {\n let emptyRow = -1;\n for (let row = 0; row < board.length; row++) {\n if (board[row][column] == \"empty\") {\n emptyRow = row;\n }\n }\n return emptyRow;\n}", "title": "" } ]
[ { "docid": "95029ad9a89527ba99512cb23be63a57", "score": "0.755627", "text": "function findEmptySpot(col) {\n for (let row = ROWS - 1; row >= 0; row--) {\n if (!board[row][col]) {\n return row;\n }\n }\n return null;\n }", "title": "" }, { "docid": "692e7ea068398b5f8b2b81fb50e043fe", "score": "0.74723", "text": "function findColumnSpot(column){\n for (let row = hiegth -1; row >= 0; row --){\n if (!board[row][column]) {\n return row;\n }\n }\n return null;\n}", "title": "" }, { "docid": "c78cac9e80a77b26b264f244285e4085", "score": "0.74157536", "text": "function findRow(c){\n for (var r=board.length-1;r>=0;r--){\n\tif (board[r][c] == 0)\n\t return r;\n }\n return -1;\n}", "title": "" }, { "docid": "8454bcfa49b5e12ea255fa2bdd243428", "score": "0.7309525", "text": "function findSpotForCol(column) {\n for(let row = HEIGHT - 1; row >= 0; row--){\n if(board[row][column] === null) {\n return row;\n }\n }\n return null;\n}", "title": "" }, { "docid": "a065880f661295423418b2b04836c2e1", "score": "0.72907436", "text": "function nextEmptyRow(column) {\n let nextRow = 0\n for (i = 0; i < 7; i++) {\n if (board[nextRow][column] === null) {\n nextRow++\n } else {\n return nextRow -= 1\n }\n }\n}", "title": "" }, { "docid": "920529dfad272ba5816f7f75fc18a651", "score": "0.7196266", "text": "function getEmptyRow(board, move) {\n var emptyRow;\n for (var i=0; i<6; i++) {\n if (board[i][move] == 0) {\n emptyRow = i;\n }\n }\n return emptyRow;\n }", "title": "" }, { "docid": "1e5f18636c5e4f8e5dec529bea0dbd0c", "score": "0.690955", "text": "function checkTileAbove(column, row) {\n let tileAbove = row + 1\n if (tileAbove < board.length) {\n return [column, tileAbove]\n }\n}", "title": "" }, { "docid": "e7b2b0020441588196b71fcad7a39a19", "score": "0.6869147", "text": "function findSpotForCol(x) {\n // TODO: Checks every row in the given column (x), searching for a nonzero entry. Once it has found a nonzero entry. It returns the y value of the row above. If the entire column is zero, it returns the y value of the bottom row.\n let emptyColumn = true\n for(i=0;i<=5;i++){\n if(board[i][x]!=0){\n emptyColumn = false\n return i-1\n }\n }\n if (emptyColumn===true) {\n return 5\n }\n }", "title": "" }, { "docid": "0930f5d23b614ab68a2b7bf705109059", "score": "0.6824054", "text": "function findSpotForCol(col) {\n for (let row = board.length - 1; row >= 0; row--) {\n if (!board[row][col]) {\n board[row][col] = currPlayer;\n return row;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "eb938a98bf01c42006a59b87532da732", "score": "0.6801993", "text": "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n //loop through columns backwards or else you would get the top of the column every time\n for (let i = HEIGHT - 1; i >= 0; i--) {\n if (board[i][x] === undefined) {\n return i;\n }\n }// look back at this one. \n return null;\n}", "title": "" }, { "docid": "3725f60d53ae434f618bd1bbdcef0e16", "score": "0.675766", "text": "function getPieceIndex(pieces, row, col) {\n let index = -1;\n for (let i = 0; i < pieces.length; i++) {\n let piece = pieces[i];\n if (piece.row === row && piece.col === col) {\n index = i;\n break;\n }\n }\n return index;\n}", "title": "" }, { "docid": "a585ab6882ba88d9f6e59276908cf3e3", "score": "0.67283326", "text": "function findSpotForCol(x) {\n// Search the x olumn you clicked to find the lowest y cell that is not occupied. Return that y value. \n// If the entire column is filled, return null.\n for (let y=HEIGHT-1; y>=0; y--) {\n if (!board[y][x]) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "6eb2c5e5d8ba8a81d4076c46d61ca1b1", "score": "0.6707104", "text": "function findSpotForCol(w) {\n for (let h = settings.gridHeight - 1; h >= 0; h--) {\n if (board[h][w] === 0) return h;\n }\n return null;\n}", "title": "" }, { "docid": "0374b0016539b57188579617a66e62fb", "score": "0.6683746", "text": "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n if (board[0][x] >= 0) return null;\n for (let i in board) {\n if (board[i][x] >= 0) return i - 1;\n }\n return HEIGHT - 1;\n}", "title": "" }, { "docid": "ca57c83bce1f37b5557d4cf0f969e3e3", "score": "0.66582936", "text": "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n // runs backwards loop on height of columns\n for (let y = HEIGHT - 1; y >= 0; y--) {\n // returns placement of piece on bottom coloumn\n if(!board[y][x]) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "071434a6bb0e83d1e1cd2095af79a794", "score": "0.6583499", "text": "function findSpotForCol(x) {\n for (let y = board.length - 1; y >= 0; y--) {\n let currentRow = board[y];\n if (currentRow[x] === null) return y;\n }\n return null;\n}", "title": "" }, { "docid": "5779051ae45912b80faf9b497b2d824d", "score": "0.6581622", "text": "function findTilePosition(board, tile) {\n\tfor (var i = 0; i < PuzzleSize; i++) {\n\t\tif (board[i] === tile) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1; // Tile not found\n}", "title": "" }, { "docid": "fa1c9e03d4f0133a8e35dada7f33bd37", "score": "0.6578428", "text": "function findSpotForCol(x) {\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (board[y][x] === undefined) return y;\n }\n return null;\n}", "title": "" }, { "docid": "501c415d52f03acb00e767881a054339", "score": "0.6525101", "text": "function findSpotForCol(x) {\n //grab column at x and store as an integer, to be manipulated with bitwise later\n let colBin = +(binString(board).filter((e, i) i % x === 0));\n\n //find first 0 from the right, once found return that row location\n for (let y = 0; y < colBin.length; y++) {\n let mask = 1 << y;\n if ((colBin ^ mask) !== colBin) return (board.length - 1 - y);\n }\n\n return null;\n}", "title": "" }, { "docid": "a4aff6d83d1b8cefab31aa12a054dc66", "score": "0.6507404", "text": "function findSpotForCol(x) {\n //starting at the bottom of the table, loop through each column to find empty square\n for (let i = 5; i >= 0; i--){\n let square = document.getElementById(`${i}-${x}`)\n if (square.childElementCount === 0){ //it is empty + we can use that square\n return i;\n }\n }\n}", "title": "" }, { "docid": "df4e7770c8e53e9e67db4c67eb264c66", "score": "0.6499777", "text": "function findSpotForCol(x) {\n for (let y = 0; y < HEIGHT; y++) {\n if (board[y][x] === null) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "6d5b9c5fd7463377fbdbcb2933d98f04", "score": "0.64958245", "text": "function findSpotForCol(x) {\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (!board[y][x]) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5ff885dd9318f555662fa7c939e4daf7", "score": "0.6489184", "text": "function findSpotForCol(x) {\n // ✓TODO: write the real version of this, rather than always returning 0\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (!board[y][x]) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "fc3911a553f0f98b9a8f8f3c9d07650d", "score": "0.64793074", "text": "function findSpotForCol(x) {\n let columnArray = [];\n for (let i = 0; i < HEIGHT; i++) {\n columnArray.push(board[i][x]);\n }\n let lastUsedIndex = columnArray.findIndex( cell => cell !== null);\n if (lastUsedIndex === -1) {\n return HEIGHT - 1;\n }\n if (lastUsedIndex === 0) {\n return null;\n }\n return lastUsedIndex - 1;\n \n}", "title": "" }, { "docid": "f2e4eed9bfe67bd44a7a29b53e342a5f", "score": "0.6459082", "text": "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (!board[y][x]) {\n return y;\n }\n }\n return null;\n}", "title": "" }, { "docid": "359c3871e2a08c87e5bb1cce9469fd2c", "score": "0.6450561", "text": "function findEmptyCell(board) {\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n if (board[i][j] === \" \") {\n return [i, j];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "6df8e8bb2022ca3fad0f5ddf10ab254d", "score": "0.6424156", "text": "function findSpotForCol(x) {\n\tfor (let y = height - 1; y >= 0; y--) {\n\t\tif (!board[y][x]) {\n\t\t\treturn y;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "2a7ed7c7dab72f20706a3c2f506972f6", "score": "0.6391567", "text": "function findSpotForCol(x) {\n\t// TODO: write the real version of this, rather than always returning 0\n\t// return 0;\n\tfor (let y = HEIGHT - 1; y >= 0; y--) {\n\t\tif (board[y][x] === null) {\n\t\t\treturn y;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "80dd22b444d1b749c2eff16468eb3ba8", "score": "0.6377547", "text": "findSpotForCol(x) {\n for (let y = this.height - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "title": "" }, { "docid": "4e79c409b76d90804dc11e056303151d", "score": "0.6362222", "text": "function getGridIndex(targetBoard, col, row) {\n let index = -1;\n for (let i = 0; i < targetBoard.grids.length; i++) {\n let grid = targetBoard.grids[i];\n if (grid.col === col && grid.row === row) {\n index = i;\n break;\n }\n }\n return index;\n}", "title": "" }, { "docid": "ca87980e0b2224321beab9d02cd2ec17", "score": "0.6355661", "text": "function findSpotForCol(x) {\n\tfor (let y = HEIGHT - 1; y >= 0; y--) {\n\t\tif (!board[y][x]) {\n\t\t\t//had to look at solution for this bit but it makes sense after reviewing\n\t\t\treturn y;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "f15ef2838bbeb269f01a7472951c10ec", "score": "0.6335615", "text": "getNextEmpty() {\n for (let i = 0; i < this.board.length; i++) {\n for (let j = 0; j < this.board[i].length; j++) {\n if (this.board[i][j] === 0) {\n return {\n row: i,\n col: j\n };\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "5993ddebaff132f7b375ca3846945d5b", "score": "0.6290935", "text": "function getTopLim(x, y, board) {\n let topLim;\n for (topLim = x - 1; topLim >= 0; topLim--)\n if (board[topLim][y] !== \"\") break;\n return topLim;\n}", "title": "" }, { "docid": "2ca331a559faedcb8a2aa59ed5482b25", "score": "0.62859815", "text": "findSpotForCol(x) {\n for (let y = this.HEIGHT - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "title": "" }, { "docid": "2ca331a559faedcb8a2aa59ed5482b25", "score": "0.62859815", "text": "findSpotForCol(x) {\n for (let y = this.HEIGHT - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "title": "" }, { "docid": "cc38cb5375bbf66848777ddcde8f8d69", "score": "0.6276887", "text": "findTileAt(row, col) {\n for(let i = 0; i < tiles.length; i ++) {\n if(tiles[i].row == row && tiles[i].col == col) {\n return i;\n }\n }\n \n return -1; //tile at desired row/col could not be found\n }", "title": "" }, { "docid": "0cc2120c3b26bed25e01ff682e69576a", "score": "0.6271672", "text": "function findRow(y)\n {\n var topy = -1, bottomy = -1;\n var lo = -1, hi = nolines;\n while (1 + lo !== hi)\n {\n var mi = lo + ((hi - lo) >> 1);\n\n var val = linemap[mi].y;\n\n if (val > y)\n {\n hi = mi;\n }\n else\n {\n lo = mi;\n }\n }\n if (lo == -1)\n lo = 0;\n else if (lo == nolines)\n lo = nolines-1;\n return lo;\n }", "title": "" }, { "docid": "0269668c7e999af217561202b6fd5ae0", "score": "0.6260112", "text": "function bestSpot(){\n //finds the first empty square\n // use this return for easy tic tac toe\n // return emptySquares()[0]\n // use this return for hard tic tac toe\n return minmax(origBoard, aiPlayer).index\n}", "title": "" }, { "docid": "2cdf352a7cfe1cf1be2f7e8d78fc3816", "score": "0.62511617", "text": "findTile({ x, y }) {\n const row = this.rows[y];\n return row && row.length > x ? row[x] : null;\n }", "title": "" }, { "docid": "3e6182c0d57abbca1f716042a3f4f34a", "score": "0.6219596", "text": "function getgridIndex(row, col) {\n let numSquares = 8;\n let index = row * numSquares + col;\n return index;\n}", "title": "" }, { "docid": "63f49b221caa3655557e5730f5dad4ab", "score": "0.61769325", "text": "function getTile(row, col) {\n\t\tconst element = $('.puzzlepiece').filter(function () {\n\t\t\treturn $(this).css('top') === convertBack(row);\n\t\t})\n\t\t\t.filter(function () {\n\t\t\t\treturn $(this).css('left') === convertBack(col);\n\t\t\t});\n\t\treturn $(element);\n\t}", "title": "" }, { "docid": "aec03d60eec50c4162926ffc387bdfd6", "score": "0.6175906", "text": "pieceAt(column, row) {\n return this.whiteView._boardPosition[column - 1][row - 1]\n }", "title": "" }, { "docid": "fb9a97dc33bec57e1b857f168554c330", "score": "0.6147618", "text": "getCell(row,col) {\n\n if(!this.board[row]){\n return 0;\n }\n if(!this.board[row][col]) {\n return 0;\n }\n return this.board[row][col];\n\n\n }", "title": "" }, { "docid": "3bfc3c1750649d2b5ee9a0d98dbd70f4", "score": "0.61440665", "text": "getRow(y, row) {\n return null\n }", "title": "" }, { "docid": "f2433079d7be41bf9c2b3420238cc94c", "score": "0.6098182", "text": "function findSpotForCol(x) {\n //board.map((row,i) => { row[i].filter((el,ind) => {return el[ind]==undefined})})\n const arr1 = board.map((row) => {\n return row[x]\n }); // console.log(arr1);\n \n const filled = arr1.filter(el => el !== undefined).length;//height of the stacked balls in the column\n if ((HEIGHT - filled) === 0) {\n return null;\n }\n return HEIGHT - filled - 1;\n }", "title": "" }, { "docid": "f8d8aa681536d747eb0e225545a3a01e", "score": "0.6072351", "text": "findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for (let y = this.height - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "title": "" }, { "docid": "5f130b7805e828d1e925e6c2cf17636d", "score": "0.6071688", "text": "function move(player, col) {\r\n\tif (!isColFull(col)) {\r\n\t\tfor (var r = rows - 1; r >= 0; r--) {\r\n\t\t\t//need to find lowest point in column where there is an empty spot to move\r\n\t\t\tif (isSpotEmpty(r, col)) {\r\n\t\t\t\tgame.board[r][col] = player.color; //fill in board array with move\r\n\t\t\t\tplayer.moves.push(col); //add move to player's moveTracker array\r\n\t\t\t\treturn [ r, col ]; //have this return the coordinates??\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tconsole.log('column is full');\r\n\t\treturn null;\r\n\t}\r\n}", "title": "" }, { "docid": "97f84f2382d9e4e531a78df8aebebfec", "score": "0.6068228", "text": "function at(board, r, c) {\n if (r < 0 || nrows <= r) return 0;\n const col = board[r];\n if (c < 0 || cols.length <= c) return 0;\n return col[c];\n}", "title": "" }, { "docid": "37bca1c5ed49396643b70ee6effd3ea3", "score": "0.60655123", "text": "function getRow(tile) {\n\t\treturn (parseInt(tile.parentNode.style.top) / PIX);\n\t}", "title": "" }, { "docid": "eabe66aea372f0e0eecf92a6e32bfd14", "score": "0.6059288", "text": "function getCell(grid, row, col) {\n let empty = null;\n if (row < 0 || col < 0) {\n return empty;\n } else if (row >= grid.length) {\n return empty;\n } else if (col >= grid[row].length) {\n return empty;\n } else {\n return grid[row][col]\n }\n}", "title": "" }, { "docid": "114a702c4c82edee8fcbfd6ed359e747", "score": "0.60354614", "text": "function bottomGreyRow(col){\r\n\tfor(var i = 5; i >=0;i--){\r\n\t\tif (getColor(i,col)=== \"rgb(128, 128, 128)\"){\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "9fbc9ebce9872b1fd499b5e9d6689730", "score": "0.6028821", "text": "findSpotForCol(x) {\n\t\tfor (let y = this.height - 1; y >= 0; y--) {\n\t\t\tif (!this.board[y][x]) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "8f98d8e12628ddd52c4717a9e3cd67be", "score": "0.6025773", "text": "function getGridCell(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCell(row, col))\n {\n return -1;\n }\n var index = (row * gridWidth) + col;\n return grid[index];\n}", "title": "" }, { "docid": "b1784c4c25a9479b6efa00a2682e0ff5", "score": "0.6020666", "text": "function index(column, row) {\n return column + (row * maxColumn);\n}", "title": "" }, { "docid": "c1af8b9d9402737fcf26cc08160c2722", "score": "0.6018549", "text": "function LIFE_getTileAbove(index) {\n\n\tif (index < LIFE_numCols) { return null; }\n\telse { return LIFE_tiles[index - LIFE_numCols]; }\n}", "title": "" }, { "docid": "4c565e9da8e1c658dae321ee63341fdb", "score": "0.60143393", "text": "function getGridCell(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCell(row, col))\n {\n return -1;\n }\n var index = (row * gridWidth) + col;\n return grid[index];\n}", "title": "" }, { "docid": "03420a41831cd2800a1a9bc621249fb3", "score": "0.5997537", "text": "function checkColUpperDiagonalLeft(row, col) {\n while (that.board[row][col] == that.currentPlayerNo) {\n counter3++\n if (row == 0) {\n break;\n } else {\n col--\n row--\n }\n }\n return counter3;\n }", "title": "" }, { "docid": "4fc4db84c90e8cf7b2865c1b05b4c5fb", "score": "0.5993553", "text": "function findSpotForCol(x) {\n // Starting at the bottom of our memory board, find the first coordinate that returns null (falsey).\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if(!board[y][x]) {\n return y;\n }\n }\n // if all cells are played, change the control cell bg color \n allPlayed(x);\n return null;\n}", "title": "" }, { "docid": "807321d4f7d5d43a7785ef0efe43d757", "score": "0.5992917", "text": "function get_underlying_gameboard_cell(element) {\n var rect = element.getBoundingClientRect();\n var piece_x = rect.left;\n var piece_y = rect.top;\n\n // Locate the grid cell underneath the grabbed piece\n // look for the grid piece under the top left corner\n // To do this, quickly hide the grabbed piece and see what's underneath, then unhide it!\n // NOTE: the x and y coordinates need to be relative to the viewport, not the document\n // (i.e. do not compensate for scrolling)\n element.style.visibility = \"hidden\";\n var gameboard_cell = get_underlying_gameboard_cell_by_point(piece_x, piece_y);\n element.style.visibility = \"\";\n\n return gameboard_cell;\n}", "title": "" }, { "docid": "843f3af21587365127c300383292f428", "score": "0.5970648", "text": "function findSpotForCol(xAxis) {\n for (let yAxis = HEIGHT_BOARD - 1; yAxis >= 0; yAxis--) {\n if (board[yAxis][xAxis] === undefined) {\n return yAxis;\n }\n }\n return null;\n}", "title": "" }, { "docid": "9ec825a71726613ddf58699a7223741a", "score": "0.59628874", "text": "function getCellRow(cell){\r\n\r\n\tif(cell >= rowQty*columnQty)\r\n\t\treturn OUTSIDE_MAZE;\r\n\telse if(cell < rowQty)\r\n\t\treturn cell;\r\n\telse{\r\n\t\treturn (cell % rowQty);\t\t\r\n\t\t}\r\n}", "title": "" }, { "docid": "ca8e6d388e09b2b17e3865a9c1e55ee3", "score": "0.5946257", "text": "function checkBottom(colIndex) \n{\n var colorReport = returnColor(5, colIndex);\n for (var row = 5; row > -1; row--)\n {\n colorReport = returnColor(row, colIndex);\n if (colorReport === 'rgb(116, 104, 104)') \n {\n return row\n }\n }\n}", "title": "" }, { "docid": "4d882d7e2bbb7b2a5163e8b3ada85ec2", "score": "0.5942878", "text": "function checkCell(board, x, y) {\n if ((x >= config.height) || (x < 0) || (y >= config.width) || (y < 0)) {\n return 0;\n } else {\n return board[x][y];\n }\n}", "title": "" }, { "docid": "3f775f54a8a5fd16cf5509c87675545e", "score": "0.59245175", "text": "function checkBottom(colIndex) {\n var colorReport = returnColor(5,colIndex);\n for (var row = 5; row > -1; row--) {\n colorReport = returnColor(row,colIndex);\n if (colorReport === 'rgb(128, 128, 128)') {\n return row\n }\n }\n}", "title": "" }, { "docid": "8946407e9ad5ddec2f930437354adf0b", "score": "0.5909124", "text": "findThirdInLine(boardState,boardScores,myToken){\n //Get all lines where player has +2 positive score and an empty space\n let {rows,cols,diags} = this.getPlayableLines(boardState,boardScores,myToken,2);\n //If there are +2 rows look for the empty space and play there\n if(rows)\n for(let row of rows)\n for(let i=0;i<3;i++)\n if(boardState[row][i]==0)return [row,i];\n //If there are +2 columns look for the empty space and play there\n if(cols)\n for(let col of cols)\n for(let i=0;i<3;i++)\n if(boardState[i][col]==0)return [i,col];\n //If there are +2 diagonals look for the empty space and play there\n if(diags){\n for(let diag of diags){\n if(diag ==0){//TopLeft-BottomRight diagonal\n for(let i=0;i<3;i++)\n if(boardState[i][i]==0)return [i,i];\n }else{//TopRight-BottomLeft diagonal\n for(let i=0;i<3;i++)\n if(boardState[2-i][i]==0)return [2-i,i];\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "75efa523ae3d7498ce2db42c5187214a", "score": "0.5900295", "text": "function findSpace(spot) {\n const {column} = spot.dataset;\n let counter = boardSize.rows - 1;\n while (counter) {\n if (!board[column][counter]) break;\n counter--;\n }\n return {column, row: counter};\n}", "title": "" }, { "docid": "08fedfbf12adadbb61eeee117a40b3fc", "score": "0.5892653", "text": "function whatGridIsThis(col, row){\n var returnNum;\n if(row < 3){\n whatGridCol(0);\n }\n else if((row > 3) && (row < 6)){\n whatGridCol(3);\n }\n else{ //must be between 6-8\n whatGridCol(6);\n }\n \n function whatGridCol(rowNumber){ //nested function, takes the rowNumber and increments grid index returned based on its location\n if(col < 3){\n returnNum = rowNumber;\n }\n else if((col > 3) && (col < 6)){\n returnNum = (rowNumber + 1);\n }\n else{ //must be between 6-8\n returnNum = (rowNumber + 2);\n }\n } //end function\n return returnNum; \n}", "title": "" }, { "docid": "a7a47be89acd4acaa365df6a7f6740ae", "score": "0.58924973", "text": "function getCell(row, col) {\n\t\tif (row < 0 || col < 0) return 0;\n\t\tif (row >= minefield.length) return 0;\n\t\tif (col >= minefield[row].length) return 0;\n\n\t\tlet numBombs = 0;\n\t\tif (minefield[row][col] === \"*\") return 1;\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "4150701925fc8532ea238780b2284b7a", "score": "0.5891964", "text": "function getCellIndexFromRC(row, col){\n\treturn row*numCols+col;\n}", "title": "" }, { "docid": "eeb572595db943a60eac4d1ddb858bd0", "score": "0.5891529", "text": "findEmptyCell() {\r\n for (let row = 0; row < 9; row++) {\r\n for (let pos = 0; pos < 9; pos++) {\r\n if (\r\n (this.board[row][pos].noteNumber === 0) &\r\n (row > this.selectedCell.row ||\r\n pos > this.selectedCell.position ||\r\n (row === 0) & (pos === 0)) &\r\n (this.board[row][pos].final === false)\r\n ) {\r\n return this.board[row][pos];\r\n }\r\n }\r\n }\r\n //if there are no empty cells the the board is sovled\r\n return \"completed\";\r\n }", "title": "" }, { "docid": "5da746cacd4e571b8adab4b1d3812e77", "score": "0.58805126", "text": "function checkForWin(board){\n\t//horizontally, first row \n\tvar value = board[0] + board[1] + board[2]; //\"XXX\" or \"YYY\" or \"YX-\"\n\tif (value == (player1 + player1 + player1)){\n\t\treturn player1;\n\t}\n\telse if (value == (player2 + player2 + player2)){\n\t\treturn player2;\n\t}\n\telse {\n\t\treturn pieceTypes.empty;\n\t}\n}", "title": "" }, { "docid": "4cf21f35a13aa815762b6450c1358523", "score": "0.58783245", "text": "function find_a_zero(row, col)\n\t{\n\t\tvar r = 0;\n\t\tvar c;\n\t\tvar done;\n\t\trow = -1;\n\t\tcol = -1;\n\t\tdone = false;\n\t\twhile (!done)\n\t\t{\n\t\t\tc = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (C[r][c] == 0 && RowCover[r] == 0 && ColCover[c] == 0)\n\t\t\t\t{\n\t\t\t\t\trow = r;\n\t\t\t\t\tcol = c;\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t\tc += 1;\n\t\t\t\tif (c >= ncol || done)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tr += 1;\n\t\t\tif (r >= nrow)\n\t\t\t\tdone = true;\n\t\t}\n\t\treturn {row:row,col:col};\n\t}", "title": "" }, { "docid": "95d7e8da88e885b11f1687cb83836733", "score": "0.58632815", "text": "function getKingPosition(player, _board) {\n for (i = 0; i < 8; i++) {\n for (j = 0; j < 8; j++) {\n if (_board[i][j].piece != null) {\n if (_board[i][j].piece.Type == pieceEnum.king) {\n if (_board[i][j].piece.Player == player) {\n //return { row: i, col: j };\n return getId(i, j);\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "f7530d41dfbe50f7c374dd1c7272eb48", "score": "0.5863076", "text": "function checkColRight(row, col) {\n while (that.board[row][col] == that.currentPlayerNo) {\n counter1++\n col++\n }\n return counter1;\n } // Check horizontals part 2", "title": "" }, { "docid": "e382a509c74734056437c04a885d156d", "score": "0.5843393", "text": "function getWinningPlayer(row, col) {\n // check row to see if won\n if (boardXY[row][0] === 'X' &&\n boardXY[row][1] === 'X' &&\n boardXY[row][2] === 'X') {\n return 'X'; // X wins!\n }\n\n if (boardXY[row][0] === 'O' &&\n boardXY[row][1] === 'O' &&\n boardXY[row][2] === 'O') {\n return 'O'; // O wins!\n }\n\n // check column to see if won\n if (boardXY[0][col] === 'X' &&\n boardXY[1][col] === 'X' &&\n boardXY[2][col] === 'X') {\n return 'X'; // X wins!\n }\n\n if (boardXY[0][col] === 'O' &&\n boardXY[1][col] === 'O' &&\n boardXY[2][col] === 'O') {\n return 'O'; // X wins!\n }\n\n // check diagonals\n if (boardXY[0][0] === 'X' &&\n boardXY[1][1] === 'X' &&\n boardXY[2][2] === 'X') {\n return 'X'; // X wins!\n }\n\n if (boardXY[0][0] === 'O' &&\n boardXY[1][1] === 'O' &&\n boardXY[2][2] === 'O') {\n return 'O'; // X wins!\n }\n\n if (boardXY[0][2] === 'X' &&\n boardXY[1][1] === 'X' &&\n boardXY[2][0] === 'X') {\n return 'X'; // X wins!\n }\n\n if (boardXY[0][2] === 'O' &&\n boardXY[1][1] === 'O' &&\n boardXY[2][0] === 'O') {\n return 'O'; // O wins!\n }\n\n // if no winner, the game is still in progress if there are blank squares\n for (let row = 0; row < 3; row++) {\n for (let col = 0; col < 3; col++) {\n if (boardXY[row][col] === ' ') {\n return ' '; // game still going\n }\n }\n }\n\n // no winner, no blank squares, so it's a tie\n return 'tie';\n}", "title": "" }, { "docid": "facb5c38319f8eaf27123bfe3e00393b", "score": "0.5842613", "text": "function checkBottom(colIndex){\r\n var colr = returnColor(5,colIndex);\r\n for (var row = 5; row > -1; row--)\r\n {\r\n colr = returnColor(row,colIndex);\r\n if(colr === 'rgb(128, 128, 128)')\r\n {\r\n return row;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ec56c74aeaf1675b981db41bad60c4db", "score": "0.58410627", "text": "findIndexOfFirstEmptyCell(word)\r\n {\r\n return this.findIndexOfNextEmptyCell(word, this.coordsToIndex(word.x, word.y));\r\n }", "title": "" }, { "docid": "89d22a70f7e76f04c2a870aeb8e51f54", "score": "0.5837406", "text": "rcToIndex(row, col) {\n if (row >= 8 || row < 0 || col >= 8 || col < 0) {\n throw \"Row/Col pair on checkerboard is out of bounds!\";\n }\n return row * 8 + col;\n }", "title": "" }, { "docid": "11971a1d0e91be6eaaded9911e3bd57b", "score": "0.5827987", "text": "function rowColToIndex(row, col) {\n // row-major. 0-based.\n let idx = row * Utils.WS.getWS().workspace_grid.columns + col;\n if (idx >= MAX_WORKSPACES) {\n idx = -1;\n }\n return idx;\n}", "title": "" }, { "docid": "753f668c9b455c888b6c0f1553b84e65", "score": "0.58234423", "text": "function horizontalNInARow(row, player) {\r\n\tvar coords = [];\r\n\tvar counter = 1; //always have 1 in a row\r\n\tfor (var col = 0; col < cols - 1; col++) {\r\n\t\t//loop through columns (cells) in the row\r\n\t\tif (game.board[row][col] === player && game.board[row][col + 1] === player) {\r\n\t\t\t//if current column cell and the next column cell in the row are the same player than increase counter\r\n\t\t\tcounter++;\r\n\t\t\tif (counter >= numInARow) {\r\n\t\t\t\t//if the counter has reached the desired numberInARow (4) then push all of the winning coordinates to coords and then return coords\r\n\t\t\t\tfor (var i = 1; i <= numInARow; i++) {\r\n\t\t\t\t\tcoords.push([ row, col - numInARow + i + 1 ]); //col is currently at the 3rd winning spot so need to add 1 to mimic being at the last spot. then subtract by numInARow and go through a loop for numInARow\r\n\t\t\t\t}\r\n\t\t\t\treturn coords;\r\n\t\t\t}\r\n\t\t\t//if pair of cells doesnt match, then counter is back to 1\r\n\t\t} else counter = 1;\r\n\t}\r\n\treturn coords;\r\n}", "title": "" }, { "docid": "bbf2e8055b8a4314b482dd207ca62fdf", "score": "0.5798452", "text": "function checkBottom(colIndex) {\r\n var colorReport= reportColor(5,colIndex);\r\n for (var row = 5; row >-1; row--) {\r\n colorReport= reportColor(row,colIndex);\r\n if(colorReport==='rgb(128, 128, 128)'){\r\n return row;\r\n } \r\n }\r\n}", "title": "" }, { "docid": "a2dbd5768791d1eed7b9dd7d052ba8f4", "score": "0.5786282", "text": "function CalculateTileToIndex(tileCol, tileRow) {\n return (tileCol + BRICK_COLS*tileRow);\n}", "title": "" }, { "docid": "3c57ccd6ff4616a5136b06c259607677", "score": "0.577889", "text": "function r2aPosition(row, col, mt) {\n let result = col;\n let cnt = -1;\n let colCnt = mt[0].length;\n\n for (let i = 0; i < colCnt; i++) {\n if (mt[row][i] > 0) {\n cnt++;\n }\n if (cnt == col) {\n result = i;\n break;\n }\n }\n return result;\n }", "title": "" }, { "docid": "cfcc758eb6ec78dd767573801c3e972e", "score": "0.5777927", "text": "function rowPopulation(board, rowNum) {\n var count = 0;\n\n for (var col = 0; col < 4; col++) {\n if (board.get({ row: rowNum, col: col }) !== 0) {\n count++;\n }\n }\n\n return count;\n}", "title": "" }, { "docid": "eb074517f9a0564b39677ec5cb800ced", "score": "0.5776008", "text": "function minValueInRow(board, rowNum) {\n var min = 0;\n\n for (var col = 0; col < 4; col++) {\n var val = board.get({ row: rowNum, col: col });\n if (val !== 0 && (min === 0 || val < min)) {\n min = val;\n }\n }\n\n return min;\n}", "title": "" }, { "docid": "f4b8de33dc07cc586abfa6ba02ea6ac1", "score": "0.57727534", "text": "function blankTilePos(ar) { return ar.indexOf(tileCount) }", "title": "" }, { "docid": "dd11a21ddedf9425b4f86932fd57a292", "score": "0.57719815", "text": "function lastRowForColumn(sheet, column){\n // Get the last row with data for the whole sheet.\n var numRows = sheet.getLastRow();\n \n // Get all data for the given column\n var data = sheet.getRange(1, column, numRows).getValues();\n \n // Iterate backwards and find first non empty cell\n for(var i = data.length - 1 ; i >= 0 ; i--){\n if (data[i][0] != null && data[i][0] != \"\"){\n return i + 1;\n }\n }\n}", "title": "" }, { "docid": "46b1a558b76d18c10409dd13a83e7f1a", "score": "0.5769455", "text": "function getEmptyRow(values){\n var i = 0;\n for(i=0;i<values.length;i++){\n if(values[i][0] === \"\"){\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "f4345f8be9d03cfe0489d30cc1303e53", "score": "0.57688195", "text": "function Hor(pos){\n var err = false\n let row = Math.ceil(pos/9)\n // console.log('Row error check, row',row)\n let horCheck = false\n for(let i=0;i<9;i++){\n // console.log('val',sudoku[pos-1],sudoku[i+(row-1)*9],err,i+(row-1)*9)\n if(sudoku[pos-1]===sudoku[i+(row-1)*9])\n if(horCheck===true)\n err=true\n else\n horCheck=!horCheck\n }\n if(err){ \n // console.log('error in Row',row)\n return pos\n }\n else\n return 0\n \n}", "title": "" }, { "docid": "2823cb46c7a57b88bf6c946b37605243", "score": "0.575537", "text": "function checkBoard(board, player, number) {\n winner = 0;\n item = 'ooo';\n if (player == 0) item = 'xxx';\n var row1 = board[0] + board[1] + board[2];\n if (row1 == item) {\n return 1\n }\n var row2 = board[3] + board[4] + board[5];\n if (row2 == item) {\n return 1\n }\n var row3 = board[6] + board[7] + board[8];\n if (row3 == item) {\n return 1\n }\n var col1 = board[0] + board[3] + board[6];\n if (col1 == item) {\n return 1\n }\n var col2 = board[1] + board[4] + board[7];\n if (col2 == item) {\n return 1\n }\n var col3 = board[2] + board[5] + board[8];\n if (col3 == item) {\n return 1\n }\n var diag1 = board[0] + board[4] + board[8];\n if (diag1 == item) {\n return 1\n }\n var diag2 = board[2] + board[4] + board[6];\n if (diag2 == item) {\n return 1\n }\n return number\n}", "title": "" }, { "docid": "b37b24ef7879ca961cc84ccb3c90774b", "score": "0.57521605", "text": "function getTilesMinCol(){\n\t\tvar numCol = 0;\n\t\t\n\t\tvar minHeight = 999999999;\n\t\t\n\t\tfor(col = 0; col < g_vars.numCols; col++){\n\t\t\t\n\t\t\tif(g_vars.colHeights[col] == undefined || g_vars.colHeights[col] == 0)\n\t\t\t\treturn col;\n\t\t\t\n\t\t\tif(g_vars.colHeights[col] < minHeight){\n\t\t\t\tnumCol = col;\n\t\t\t\tminHeight = g_vars.colHeights[col];\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn(numCol);\n\t}", "title": "" }, { "docid": "c0cb163673a3dc9a08f21f33e3ef41c6", "score": "0.57509905", "text": "function horizontalInaRow() {\n var rows;\n for(var i = 0; i < gameProgress.length; i++) {\n if (gameProgress[i][0] !== 0) {\n rows = gameProgress[i];\n if (rows[0] == rows[1] && rows[0] == rows[2]) {\n return \"h\" + i;\n }\n }\n }\n return \"nothing\";\n }", "title": "" }, { "docid": "b2ada78aa116bfc42b3ce31c68b65e58", "score": "0.574796", "text": "function checkColumn(seat) {\n let top = 7;\n let bottom = 0;\n\n seat.split('').forEach(c => {\n if (c == 'L') {\n top = Math.floor((top + bottom) / 2)\n } else {\n bottom = Math.ceil((top + bottom) / 2)\n }\n })\n\n if (seat[2] == 'L') {\n // console.log('bottom');\n // console.log(bottom);\n return bottom\n } else {\n // console.log('top');\n // console.log(top);\n return top\n }\n}", "title": "" }, { "docid": "244a6b44c9695d2c1c0e6e0bbacbc05f", "score": "0.5743641", "text": "function columnNumber(col) {\n var count = 0;\n for (var i = 0; i < hauteur; i++)\n if (grid[col][i] !== 0)\n count++;\n return count;\n }", "title": "" }, { "docid": "a8e84b739ce78070d45ad1c1f80fb56d", "score": "0.5740653", "text": "function emptyInRow(board, row) {\n for (var i = 1; i < (board[row].length - 1); i++){\n if (board[row][i] == 0)\n emptySides[numEmptySides++] = [row, i];\n }\n }", "title": "" }, { "docid": "e8ba623b22aaf97bb3f7334a947fb84f", "score": "0.5738562", "text": "function getRow(cell)\n {\n let result = -1;\n if(cell !== undefined)\n {\n result = cell.dataset.row;\n }\n return result;\n }", "title": "" }, { "docid": "7af1e45fd3e13500fcf483257335c500", "score": "0.57383597", "text": "findEmptyCellIndex() {\n let indexes = []\n this.cells.forEach((val, idx) => {\n if (val === 0) {\n indexes.push(idx)\n }\n })\n let len = indexes.length\n if (len === 0) {\n return -1\n }\n if (len === 1) {\n return indexes[0]\n }\n return indexes[Math.floor(Math.random() * indexes.length)]\n }", "title": "" }, { "docid": "bbd4a2a02758b5cbfb3006a4a739eff5", "score": "0.57345515", "text": "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for (let i = 1; i <= HEIGHT; i++) {\n const btmCell = document.querySelector(`#${CSS.escape(HEIGHT - i)}-${CSS.escape(x)}`);\n if (btmCell.childElementCount === 0) {\n return HEIGHT - i;\n }\n }\n}", "title": "" }, { "docid": "dc411416169de08f57a52b7511d6e761", "score": "0.573286", "text": "function rowOf(containingValue, columnToLookInIndex, sheet) {\n \n var dataRange = sheet.getDataRange();\n var values = dataRange.getValues();\n var outRow;\n\n for (var i = 0; i < values.length; i++)\n {\n if (values[i][columnToLookInIndex] == containingValue)\n {\n outRow = i+1;\n break;\n }\n \n if (i == values.length - 1){\n \n outRow = -1;\n }\n \n }\n\n return outRow;\n}", "title": "" }, { "docid": "81079ac6c1374733a6f56d9b3222ed67", "score": "0.57279587", "text": "function getRowNumWithMarker(sheet, marker){\n var values = sheet.getRange(1, 1, sheet.getLastRow(),1).getValues();\n for (var row = 1; row <= values.length; row++)\n if(values[row-1][0] == marker) return row;\n \n throw new Error(\"Cell with marker '\" + marker + \"' was nor found in column A.\");\n}", "title": "" } ]
4e6c576cf31a243df1bb9842812e006a
The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission.
[ { "docid": "9a1a45e96487f7f50ea80f6bb0b3d4da", "score": "0.71425885", "text": "setSecret(vaultBaseUrl, secretName, value, options) {\n return this.sendOperationRequest({ vaultBaseUrl, secretName, value, options }, setSecretOperationSpec);\n }", "title": "" } ]
[ { "docid": "fe66e1a50e485d267d52a4f7464d5306", "score": "0.70756185", "text": "setSecret(secretName, value, options = {}) {\n let unflattenedOptions = {};\n if (options) {\n const { enabled, notBefore, expiresOn: expires } = options, remainingOptions = tslib.__rest(options, [\"enabled\", \"notBefore\", \"expiresOn\"]);\n unflattenedOptions = Object.assign(Object.assign({}, remainingOptions), { secretAttributes: {\n enabled,\n notBefore,\n expires,\n } });\n }\n return tracingClient.withSpan(\"SecretClient.setSecret\", unflattenedOptions, async (updatedOptions) => {\n const response = await this.client.setSecret(this.vaultUrl, secretName, value, updatedOptions);\n return getSecretFromSecretBundle(response);\n });\n }", "title": "" }, { "docid": "97313e2c2b20d2642f7da667350e874c", "score": "0.63436615", "text": "function setSecret() {\n var newSecret = {secret: uuid.v4(),\n date: null};\n return createSecret(newSecret).then(function(){return findSecrets()})\n .then(function(secrets){\n if (secrets.length > 12){\n for (var i=0;i<secrets.length-12;i++){\n secrets[i].remove();\n }\n secrets = secrets.slice(secrets.length-13);\n }\n return secrets;\n })\n .fail(function(err) {\n });\n}", "title": "" }, { "docid": "df54a09b625a55c8196bf12eaa6023d1", "score": "0.6259165", "text": "function setSecret(newSecret) {\n bot.secret = newSecret;\n rl.close();\n bot.buildBot();\n}", "title": "" }, { "docid": "466c4ee54fea34b9dc3d8fa46440b413", "score": "0.58981687", "text": "function setSecret(secret) {\n command_1.issueCommand(\"add-mask\", {}, secret);\n }", "title": "" }, { "docid": "ed6800c0833d5ca684683220966fb0d6", "score": "0.5883394", "text": "function setSecret(secret) {\n command.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "ed6800c0833d5ca684683220966fb0d6", "score": "0.5883394", "text": "function setSecret(secret) {\n command.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "91c71f3459f11bb0d1aaad7586400e8f", "score": "0.5829627", "text": "function setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}", "title": "" }, { "docid": "6e690910b49b5d15690a06b36908a396", "score": "0.56312436", "text": "async function createAndAccessSecret() {\n // Create the secret with automation replication.\n const [secret] = await client.createSecret({\n parent: parent,\n secret: {\n name: secretId,\n replication: {\n automatic: {},\n },\n },\n secretId,\n });\n\n console.info(`Created secret ${secret.name}`);\n\n // Add a version with a payload onto the secret.\n const [version] = await client.addSecretVersion({\n parent: secret.name,\n payload: {\n data: Buffer.from(payload, 'utf8'),\n },\n });\n\n console.info(`Added secret version ${version.name}`);\n\n // Access the secret.\n const [accessResponse] = await client.accessSecretVersion({\n name: version.name,\n });\n\n const responsePayload = accessResponse.payload.data.toString('utf8');\n console.info(`Payload: ${responsePayload}`);\n }", "title": "" }, { "docid": "514a1c057bae91b81e52a2056f5a1b5a", "score": "0.5559838", "text": "set(target, prop, val) {\r\n if (prop.startsWith(\"_\"))\r\n throw new Error(\"You can't change the value of secret\");\r\n else {\r\n target[prop] = val;\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "dc8c69dcc13a4ccc931949f3c516930f", "score": "0.54923296", "text": "updateSecret(vaultBaseUrl, secretName, secretVersion, options) {\n return this.sendOperationRequest({ vaultBaseUrl, secretName, secretVersion, options }, updateSecretOperationSpec);\n }", "title": "" }, { "docid": "d5b95b975ad3fec72f36edd25f1d29fb", "score": "0.5218759", "text": "backupSecret(secretName, options = {}) {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(this.vaultUrl, secretName, updatedOptions);\n return response.value;\n });\n }", "title": "" }, { "docid": "d5b90aa92bbdba7ac0185e291f9477cc", "score": "0.5196854", "text": "function exportSecret(name, val) {\n exportVariable(name, val);\n // the runner will error with not implemented\n // leaving the function but raising the error earlier\n command_1.issueCommand('set-secret', {}, val);\n throw new Error('Not implemented.');\n}", "title": "" }, { "docid": "2ee906699543206c488e862377de386d", "score": "0.5142548", "text": "function exportSecret(name, val) {\r\n exportVariable(name, val);\r\n // the runner will error with not implemented\r\n // leaving the function but raising the error earlier\r\n command_1.issueCommand('set-secret', {}, val);\r\n throw new Error('Not implemented.');\r\n}", "title": "" }, { "docid": "2ee906699543206c488e862377de386d", "score": "0.5142548", "text": "function exportSecret(name, val) {\r\n exportVariable(name, val);\r\n // the runner will error with not implemented\r\n // leaving the function but raising the error earlier\r\n command_1.issueCommand('set-secret', {}, val);\r\n throw new Error('Not implemented.');\r\n}", "title": "" }, { "docid": "058cc3a32f4df32b59da1b3c5dd3cf72", "score": "0.5062255", "text": "set clientSecret(value) {\n this._clientSecret = value;\n }", "title": "" }, { "docid": "1f9cc8c366b79cd5a5bb3adbc60dda88", "score": "0.50341785", "text": "createSecret() {\n if (!this.secretForm.$valid) return;\n\n /** @type {!backendApi.SecretSpec} */\n let secretSpec = {\n name: this.secretName,\n namespace: this.namespace,\n data: this.data,\n };\n this.tokenPromise.then(\n (token) => {\n /** @type {!angular.Resource} */\n let resource = this.resource_(\n `api/v1/secret/`, {},\n {save: {method: 'POST', headers: {[this.csrfHeaderName_]: token}}});\n\n resource.save(\n secretSpec,\n (savedConfig) => {\n this.log_.info('Successfully created secret:', savedConfig);\n this.mdDialog_.hide(this.secretName);\n },\n (err) => {\n this.mdDialog_.hide();\n this.errorDialog_.open('Error creating secret', err.data);\n this.log_.info('Error creating secret:', err);\n });\n },\n (err) => {\n this.mdDialog_.hide();\n this.errorDialog_.open('Error creating secret', err.data);\n this.log_.info('Error creating secret:', err);\n });\n }", "title": "" }, { "docid": "fd817c71be94001e278e8af64011197c", "score": "0.4978429", "text": "function createSecretHolder(secret) {\n var secretObject = {\n secretValue: secret,\n getSecret: function() {\n return this.secretValue;\n },\n setSecret: function(newSecretValue) {\n this.secretValue = newSecretValue;\n }\n };\n return secretObject;\n}", "title": "" }, { "docid": "2ae4791798ff38777eb49737c890213f", "score": "0.48306122", "text": "set(name, value) {\n if (value === undefined) {\n this.remove(name);\n } else {\n if (this.slots) {\n for (let n = 0; n < this.slots.length; n += 2) {\n if (this.slots[n] === name) {\n this.slots[n + 1] = value;\n return;\n }\n }\n }\n this.add(name, value);\n }\n }", "title": "" }, { "docid": "54f8e1c6437e4d819c0e2034ef074220", "score": "0.48236358", "text": "secretValue() { try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_secretsmanager.SecretStringValueBeta1#secretValue\", \"Use `cdk.SecretValue` instead.\");\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.secretValue);\n }\n throw error;\n } return this._secretValue; }", "title": "" }, { "docid": "bed2d0d5e231d0c4403c81928e17442a", "score": "0.48209727", "text": "set(key, value) {\n const stringValue = typeof value === 'object' ? JSON.stringify(value) : value;\n this.storageMechanism.setItem(key, stringValue);\n }", "title": "" }, { "docid": "f839133af25af43048c6e1b63bf05da3", "score": "0.4818475", "text": "function KeepSecret(secret) {\n this.secret = secret;\n }", "title": "" }, { "docid": "975bc69285134e7cd3a4a6971454b2a8", "score": "0.47872907", "text": "flyRemixSecrets(app) {\n this.flySetSecrets({\n app,\n requiredSecrets: ['SESSION_SECRET', 'INTERNAL_COMMAND_TOKEN'],\n shouldSet: (name) => name === 'SESSION_SECRET' || this.epicStack\n })\n }", "title": "" }, { "docid": "521ce7c83a358b3f69adb42f4c689341", "score": "0.4707022", "text": "function createSecretHolder(secret) {\n let _data = secret;\n\n return {\n getSecret: () => _data,\n setSecret: (arg) => (_data = arg),\n };\n}", "title": "" }, { "docid": "a576167856dfe82159b1251c070ac069", "score": "0.46744126", "text": "function SecretGenerator(manifest, secrets) {\n ApiModule.call(this);\n\n var self = this;\n\n self._manifest = manifest;\n self._secrets = secrets;\n}", "title": "" }, { "docid": "db189db068c51e71cebf8c933eff52d3", "score": "0.46590596", "text": "async addSet(key, value) {\n await this.client.sadd(key, value);\n }", "title": "" }, { "docid": "bd7474bda80ba0a0115f3f5b8ac3feb4", "score": "0.45521864", "text": "static fromSecretName(scope, id, secretName) {\n return new class extends SecretBase {\n constructor() {\n super(...arguments);\n this.encryptionKey = undefined;\n this.secretArn = secretName;\n this.secretName = secretName;\n this.autoCreatePolicy = false;\n }\n get secretFullArn() { return undefined; }\n // Overrides the secretArn for grant* methods, where the secretArn must be in ARN format.\n // Also adds a wildcard to the resource name to support the SecretsManager-provided suffix.\n get arnForPolicies() {\n return core_1.Stack.of(this).formatArn({\n service: 'secretsmanager',\n resource: 'secret',\n resourceName: this.secretName + '*',\n arnFormat: core_1.ArnFormat.COLON_RESOURCE_NAME,\n });\n }\n }(scope, id);\n }", "title": "" }, { "docid": "522456994bbc2cfaaf1ef44179e904dd", "score": "0.453925", "text": "function Secrets(props) {\n var attempt = props.attempt,\n secrets = props.secrets,\n namespace = props.namespace,\n onSave = props.onSave;\n var message = attempt.message,\n isProcessing = attempt.isProcessing,\n isFailed = attempt.isFailed;\n\n var _React$useState = react_default.a.useState(null),\n _React$useState2 = Secrets_slicedToArray(_React$useState, 2),\n secretToEdit = _React$useState2[0],\n setSecretToEdit = _React$useState2[1];\n\n if (isFailed) {\n return /*#__PURE__*/react_default.a.createElement(Alert[\"a\" /* Danger */], null, message, \" \");\n }\n\n if (isProcessing) {\n return /*#__PURE__*/react_default.a.createElement(src[\"l\" /* Flex */], {\n justifyContent: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(Indicator[\"a\" /* default */], null));\n }\n\n return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement(Secrets_SecretList, {\n namespace: namespace,\n items: secrets,\n onEdit: setSecretToEdit\n }), secretToEdit && /*#__PURE__*/react_default.a.createElement(K8s_K8sResourceDialog, {\n readOnly: false,\n namespace: secretToEdit.namespace,\n name: secretToEdit.name,\n resource: secretToEdit.resource,\n onClose: function onClose() {\n return setSecretToEdit(null);\n },\n onSave: onSave\n }));\n}", "title": "" }, { "docid": "9929f6ad097ebbcd173355cc4d4a3a97", "score": "0.45351523", "text": "set (state, idea) {\n Vue.set(state.ideas, idea.key(), idea)\n }", "title": "" }, { "docid": "136aad6586b64cca6b2eae04d0f8fdce", "score": "0.45092592", "text": "setItem(key, value) {\n if (arguments.length < 2) {\n throw new TypeError('Not enough arguments to \\'setItem\\'');\n }\n this._nativeObject._nativeCall('add', {\n key: encode(key),\n value: encode(value)\n });\n }", "title": "" }, { "docid": "d68a9668380b6d726a67dee700f43bf9", "score": "0.45010608", "text": "function setUserPassword(newUserPassword) {\n bot.password = newUserPassword;\n rl.question(''\n + 'Please enter a secret key used to encrypt your credentials.\\n'\n + 'Make sure you remember this secret!\\n'\n , setSecret\n );\n}", "title": "" }, { "docid": "226a1cd545983b314ca376624a630779", "score": "0.44759592", "text": "function set(key, value, callback) {\n\tclient.set(key, value, callback);\n}", "title": "" }, { "docid": "bad4fcd894ddaa31d10e45873dda88bc", "score": "0.445728", "text": "function createSecretHolder(secret) {\n let secr = secret;\n let obj = {\n getSecret: function() {\n return secr;\n },\n setSecret: function(s) {\n secr = s;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "18ef601d8f496185ee0cbf3d68bb4423", "score": "0.4455149", "text": "function set(key, value) {\n self.storage.setItem(key, JSON.stringify(value));\n }", "title": "" }, { "docid": "18ef601d8f496185ee0cbf3d68bb4423", "score": "0.4455149", "text": "function set(key, value) {\n self.storage.setItem(key, JSON.stringify(value));\n }", "title": "" }, { "docid": "b4f0034984f1653d299a1a9a6a5c730d", "score": "0.44436675", "text": "set accessToken(value) {\n if (value === null) {\n this.remove(ACCESS_TOKEN_STORAGE_KEY);\n } else {\n this.set(ACCESS_TOKEN_STORAGE_KEY, value);\n }\n }", "title": "" }, { "docid": "e8fe6d14d8ff40ef1ef780b02909335d", "score": "0.44424996", "text": "function vault_write(key, value) {\n if (value !== undefined) {\n\tif (key && key == \"guid\") {\n\t //my_log(\"APPU DEBUG: vault_write(), key: \" + key + \", \" + value);\n\t localStorage[key] = JSON.stringify(value);\n\t}\n\telse if (key !== undefined) {\n\t var write_key = pii_vault.guid + \":\" + key;\n\t //my_log(\"APPU DEBUG: vault_write(), key: \" + write_key + \", \" + value);\n\t localStorage[write_key] = JSON.stringify(value);\n\t if (key.split(':').length == 2 && key.split(':')[0] === 'current_report') {\n\t\t//This is so that if the reports tab queries for current_report,\n\t\t//we can send it an updated one. There is no need to flush this to disk.\n\t\tpii_vault.current_report.report_updated = true;\n\t }\n\t}\n }\n else {\n\tmy_log(\"Appu Error: vault_write(), Value is empty for key: \" + key, new Error);\n\tprint_appu_error(\"Appu Error: vault_write(), Value is empty for key: \" + key);\n }\n}", "title": "" }, { "docid": "83393b8c4f2a7d346b47a80c0b6c60a9", "score": "0.4430593", "text": "set (key, value) {\n let hashed = hash(key);\n this.buckets[hash % this.buckets.length].push({key : value});\n }", "title": "" }, { "docid": "7a1368cdbcfc548f34e29099b592c39c", "score": "0.44239652", "text": "function makesecret() {\n secret = makerandword(); }", "title": "" }, { "docid": "464adb86ebf36b02e7976797882a076a", "score": "0.4405431", "text": "static fromSecretNameV2(scope, id, secretName) {\n return new class extends SecretBase {\n constructor() {\n super(...arguments);\n this.encryptionKey = undefined;\n this.secretName = secretName;\n this.secretArn = this.partialArn;\n this.autoCreatePolicy = false;\n }\n get secretFullArn() { return undefined; }\n // Creates a \"partial\" ARN from the secret name. The \"full\" ARN would include the SecretsManager-provided suffix.\n get partialArn() {\n return core_1.Stack.of(this).formatArn({\n service: 'secretsmanager',\n resource: 'secret',\n resourceName: secretName,\n arnFormat: core_1.ArnFormat.COLON_RESOURCE_NAME,\n });\n }\n }(scope, id);\n }", "title": "" }, { "docid": "50701ee6c30353e088570016a5f66808", "score": "0.4404849", "text": "function set(context, key, value) {\n var userDefaults = getUserDefaults(context);\n userDefaults.setObject_forKey_(JSON.stringify(value), key);\n userDefaults.synchronize(); // save\n}", "title": "" }, { "docid": "ccba9bea3adebb1441058eb761dec005", "score": "0.43952644", "text": "secretCredentials(secretName) {\n return new Promise((resolve, reject) => {\n SecretsManager.getSecretValue({ SecretId: secretName }, function (err, data) {\n if (err) {\n reject(err);\n }\n else {\n resolve(JSON.parse(data.SecretString));\n }\n });\n });\n }", "title": "" }, { "docid": "7813edf67154a57f0d19c43b0f271664", "score": "0.4391705", "text": "setJsonValue(key, value) {\n this.storageService.secureStorage.setItem(key, value);\n }", "title": "" }, { "docid": "bc945780f3bee1a97476da3f964ed223", "score": "0.43811798", "text": "backupSecret(vaultBaseUrl, secretName, options) {\n return this.sendOperationRequest({ vaultBaseUrl, secretName, options }, backupSecretOperationSpec);\n }", "title": "" }, { "docid": "7d9b7161d9a4942d08a19e7dc0412356", "score": "0.43793744", "text": "flyAdonisJsSecrets(app) {\n this.flySetSecrets({\n app,\n requiredSecrets: ['APP_KEY']\n })\n }", "title": "" }, { "docid": "532e7474522970ad20882e1742378eca", "score": "0.437887", "text": "function lisp_env_put(env, name, value) {\n lisp_assert(lisp_is_instance(env, Lisp_Env));\n lisp_assert(lisp_is_instance(name, Lisp_Symbol));\n lisp_assert(lisp_is_instance(value, Lisp_Object));\n env.lisp_bindings[lisp_symbol_native_string(name)] = value;\n return value;\n}", "title": "" }, { "docid": "2b539e39940e2f79118773dba81fb12a", "score": "0.43701178", "text": "function setEnvironmentVariable(name, value, isSystem) {\n let regKey = (isSystem ? systemEnvRegKey : userEnvRegKey);\n let regLabel = (isSystem ? 'system' : 'user');\n let regValueType = (/path/i.test(name) ? 'REG_EXPAND_SZ' : 'REG_SZ');\n\n let child = childProcess.spawnSync(\n 'reg.exe',\n [ 'ADD', regKey, '/V', name, '/T', regValueType, '/D', value, '/F' ],\n { stdio: 'pipe' });\n if (child.error) {\n throw new Error('Failed to write to ' + regLabel + ' registry.', child.error);\n } else if (child.status) {\n let message = child.stderr.toString().trim().replace(/^ERROR: */, '') ||\n 'Reg.exe exited with code: ' + child.status;\n let code = (/denied/.test(message) ? 'EPERM' : undefined);\n throw new Error('Failed to write to ' + regLabel + ' registry.',\n new Error(message, code));\n }\n\n // Use SETX.EXE to set TEMP to the same value it already has.\n // The desired effect is just the broadcast of the settings-changed\n // message, so that new command windows will pick up the changes.\n // SETX.EXE isn't used to directly set variables because it\n // has an unfortunate 1024-character limit.\n let tempValue = getEnvironmentVariable('TEMP', isSystem);\n child = childProcess.spawnSync(\n 'setx.exe',\n (isSystem ? ['TEMP', tempValue, '/M'] : ['TEMP', tempValue]),\n { stdio: 'ignore' });\n if (child.error) {\n throw new Error('Failed broadcast ' + regLabel + ' environment change.',\n child.error);\n } else if (child.status) {\n throw new Error('Failed broadcast ' + regLabel + ' environment change.',\n new Error('Setx.exe exited with code: ' + child.status));\n }\n}", "title": "" }, { "docid": "987b2a39132a5b0ac47e30017c25b9c5", "score": "0.43583283", "text": "async set(guild, key, val) {\n\t\tlet guildObj = await this.getGuild(guild);\n\n\t\tguildObj.settings[key.toLowerCase()] = val;\n\t\tguildObj.markModified('settings');\n\n\t\tawait guildObj.save();\n\t}", "title": "" }, { "docid": "09240ed48d046098c4da44ec033a27bc", "score": "0.43566263", "text": "function set(key, value) {\n getLocalStorage().setItem(PREFIX + key, value);\n}", "title": "" }, { "docid": "e860cc4db505279b04cc48e772c73763", "score": "0.43225986", "text": "function set(appConfig, value) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var key, db, tx;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(appConfig);\n return [4\n /*yield*/\n , dbPromise];\n\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n tx.objectStore(OBJECT_STORE_NAME).put(value, key);\n return [4\n /*yield*/\n , tx.complete];\n\n case 2:\n _a.sent();\n\n return [2\n /*return*/\n , value];\n }\n });\n });\n}", "title": "" }, { "docid": "11c1a19e054757f1d6c89104e78ea353", "score": "0.4317334", "text": "set() {\n\n let kv = this.getKeyValue();\n let config = this.readSteamerConfig({ isGlobal: this.isGlobal });\n\n config[kv.key] = kv.value;\n\n this.createSteamerConfig(config, {\n isGlobal: this.isGlobal,\n overwrite: true,\n });\n\n }", "title": "" }, { "docid": "0d8292899fb267c3f40df48f9a48aceb", "score": "0.4316288", "text": "set(val) {\n if (!val) return '';\n const hashedPassword = bcrypt.hashSync(val, 10);\n this.setDataValue('password', hashedPassword);\n }", "title": "" }, { "docid": "f38f8147db6513c6549acfa2043af5eb", "score": "0.43137875", "text": "function set(key, value) {\n return db.set(key, value);\n}", "title": "" }, { "docid": "7cbb224002985ac2617f6c306306bbb3", "score": "0.42866686", "text": "function storageSet(key, value) {\n chrome.storage.sync.get([\"zillowHouseHide\"], result => {\n console.log(\"test:\", result.zillowHouseHide);\n chrome.storage.sync.set({\n zillowHouseHide: {\n ...result.zillowHouseHide,\n [key]: value\n }\n });\n });\n}", "title": "" }, { "docid": "4f586d39a5c78b58cbf7c12e6d89e09f", "score": "0.4252858", "text": "async createGame(secret) {\n await this._browser.setValue('input', secret)\n await this._browser.click('button')\n }", "title": "" }, { "docid": "4d6764266a93b4fa375571851be437fb", "score": "0.42488068", "text": "function set(appConfig, value) {\r\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\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).put(value, 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*/, value];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "c236ec896ef91a591428c177d073ba4b", "score": "0.42463407", "text": "getSecret(secretName, options = {}) {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(this.vaultUrl, secretName, options && options.version ? options.version : \"\", updatedOptions);\n return getSecretFromSecretBundle(response);\n });\n }", "title": "" } ]
9b63bb6a315f4aed55aa8b0cf41d9a59
Function to calculate percentage
[ { "docid": "509b0cd20d324d9b07316f79eaafb78c", "score": "0.7866968", "text": "function calculatePercentage( partialValue, totalValue ) {\n return ( 100 * partialValue ) / totalValue;\n}", "title": "" } ]
[ { "docid": "75778df6c3dfcbfbcf5ced200ec32169", "score": "0.7952932", "text": "function calculatePercentage (_value, _percentage){\n let calculation = (_value *_percentage) / 100 \n return console.log('the precentage is '+calculation+ \"%\") \n}", "title": "" }, { "docid": "1281683e255b5f8222df4f1eb9955021", "score": "0.7872316", "text": "function percentOf(num1, num2) {\r // TODO: your code here\r var tmp = num2/num1;\r var ans = 100/tmp;\r return ans;\r}", "title": "" }, { "docid": "7bb55dc69e9a20e09fce58f1072e4948", "score": "0.77828884", "text": "function calcPercent(value, sum) {\r\n return (100 * value / sum);\r\n}", "title": "" }, { "docid": "ec435b3d60fcc9a541b9f7aed94ebb85", "score": "0.77644414", "text": "function percent()\n{\n var perc = Math.round((correct/questions.length)*100);\n return perc;//gets percentage and returns to form\n}", "title": "" }, { "docid": "ec435b3d60fcc9a541b9f7aed94ebb85", "score": "0.77644414", "text": "function percent()\n{\n var perc = Math.round((correct/questions.length)*100);\n return perc;//gets percentage and returns to form\n}", "title": "" }, { "docid": "6650c259b7f64e943016a15d634c2ace", "score": "0.77390605", "text": "function percentage(num, total) {\n return (num / total * 100);\n }", "title": "" }, { "docid": "e3abd717d039e57013992148fd8ad539", "score": "0.77375674", "text": "function percent() // a function which takes the variables and calculates the value of correct and turns in to a percentage\n{\n\tvar perc = Math.round((correct/questions.length)*100);\n\treturn perc;\n}", "title": "" }, { "docid": "ef55ad8b29b39ac4f6b47048bbc6d612", "score": "0.76984644", "text": "function percentOf (num1, num2) {\n const result = (num1 / num2) * 100;\n return result;\n}", "title": "" }, { "docid": "091197059bbf89578ddd619d2f54cefa", "score": "0.7698328", "text": "function calcPercent(value, sum) {\n return (100*value/sum);\n}", "title": "" }, { "docid": "b29c9384f67021605ff49a78041ca936", "score": "0.7647134", "text": "function calculatePercent(dividend, divisor) {\n return (dividend / divisor) * 100\n}", "title": "" }, { "docid": "741d6dd299c28701386388cf4c7af0c8", "score": "0.7613318", "text": "function percentage () {\n\t\tif (!(totalString) && !isSecure((totalString) * -1) && !isSecure(totalString)) {\n\t\t\treturn;\n\t\t}\n\t\ttotalString = \"(\" + eval(totalString) + \")/100\";\n\t\tgetTotal();\n\t}", "title": "" }, { "docid": "96244965daa2361630bc1422c57f3f9a", "score": "0.7564066", "text": "function calculatePercent(part, whole) {\n var percent = Math.floor((part / whole) * 100);\n return percent;\n}", "title": "" }, { "docid": "b284dcdbb0c12f4732ab7bce63955151", "score": "0.7557176", "text": "function _getPercentage( all, current ){\n \n \tif ( all == current ) return 0;\n\t\t\n var q = ( current / ( all / 100 ) );\n\t\t\n return ( 100 - q.toFixed( 0 ) );\n \n }", "title": "" }, { "docid": "588cbdc403e72590672eb6383eccdda5", "score": "0.7517225", "text": "function percent()\r\n{\r\n var value = document.getElementById(\"calc__display\").value;\r\n let p = value/100;\r\n return p;\r\n}", "title": "" }, { "docid": "35b45ae44749eca52fa5c6f10c7d7e0c", "score": "0.7458969", "text": "function percentOf(firstNum, secondNum)\n{\n\treturn ((firstNum/secondNum) * 100);\n}", "title": "" }, { "docid": "4f9f8d2a972dd6dd0e87efd54c17a086", "score": "0.743525", "text": "function to_percent(value, total) {\n return Math.round((value*100) / total);\n}", "title": "" }, { "docid": "4f9f8d2a972dd6dd0e87efd54c17a086", "score": "0.743525", "text": "function to_percent(value, total) {\n return Math.round((value*100) / total);\n}", "title": "" }, { "docid": "ddeca2c965c712a20847c1093c73d004", "score": "0.73903114", "text": "function getPercentage(a, b) {\n return Math.floor((a / b) * 100);\n }", "title": "" }, { "docid": "e71c1bb6e908e218ac9ae0a9e0041677", "score": "0.7383691", "text": "function percentOf(numberOne, numberTwo) {\n\n var percentage = (numberOne/numberTwo) * 100;\n\n console.log(numberOne + \" is \" + percentage + \"% of \" + numberTwo);\n\n return percentage;\n\n}", "title": "" }, { "docid": "c80cfb8bd1aaaaef9854461361b87a7c", "score": "0.7382398", "text": "function percentOf(num1, num2) {\r var x = (num1/num2)*100;\r return(num1+\" is \"+x+\"% of\"+num2 );\r}", "title": "" }, { "docid": "089d5d491155627d319fb8bd826fe63f", "score": "0.73625463", "text": "function convertToPercentage(n){if(n<=1){return Number(n)*100+\"%\";}return n;}", "title": "" }, { "docid": "19c408c026f9c7eb1861b1fa2799e920", "score": "0.73599946", "text": "function percentOf(number, number1) {\n\tpercentage = (number/number1)* 100\n\tconsole.log(number + \" is \" + percentage + \"% of \" + number1);\n\treturn percentage;\n}", "title": "" }, { "docid": "4824f95f3be701a36e62f2ba2e9cd0d5", "score": "0.735461", "text": "function percentage()\n {\n currentInput = currentInput / 100\n displayCurrentInput();\n }", "title": "" }, { "docid": "056d874b7d08f50c0d915ab5b357ef3a", "score": "0.7351405", "text": "getPercentage(index, data) {\n let output = (data.fitArray[index]/data.total)*100;\n return output;\n }", "title": "" }, { "docid": "9ed2a9de52d95ab3d90e54eb11844c02", "score": "0.73277533", "text": "function percent(x) {\n\n return \"\" + (x*100).toFixed(1) + \"%\";\n\n}", "title": "" }, { "docid": "f00ff146752d096dfc104f2d42d804c7", "score": "0.7321905", "text": "function calculatePercent(percent) {\n let perentage = percent / 100;\n let amount = bill.value * perentage;\n tipAmount.innerHTML = \"$\" + amount.toFixed(2);\n let total = parseFloat((totalAmount.innerHTML = amount * numberOfPeople.value));\n let newTotal = total.toFixed(2);\n totalAmount.innerHTML = \"$\" + newTotal;\n checkIfValid();\n}", "title": "" }, { "docid": "6c397e2bb7afd007c7a179090aa36eb4", "score": "0.73035187", "text": "function valueToPercent(value,min,max){return(value-min)*100/(max-min);}", "title": "" }, { "docid": "483f72df6aab73b6386c9ad7c947b80a", "score": "0.7300893", "text": "function makePercentage(input){\n\t\treturn parseFloat(Math.round(input * 100) / 100).toFixed(0);\n\t}", "title": "" }, { "docid": "c35a23051c797ba0f71a909f8dea0023", "score": "0.7280898", "text": "function expensesPercentage(income,expense){\n return (expense/income)*100;\n}", "title": "" }, { "docid": "cd6abcc987990b652229f343d8944ea6", "score": "0.7277709", "text": "_calculatePercentage(value) {\n return ((value || 0) - this.min) / (this.max - this.min);\n }", "title": "" }, { "docid": "cd6abcc987990b652229f343d8944ea6", "score": "0.7277709", "text": "_calculatePercentage(value) {\n return ((value || 0) - this.min) / (this.max - this.min);\n }", "title": "" }, { "docid": "06e499f9e2769f600613991a43812b9d", "score": "0.72428316", "text": "function percent() {\n return function (decimal) {\n return (demical * 100) + '%';\n }\n }", "title": "" }, { "docid": "a5ef8a4bc3d037bb0772933c441b9ee4", "score": "0.72406393", "text": "function toPct ( pct ) {\r\n\t\treturn pct + '%';\r\n\t}", "title": "" }, { "docid": "a5ef8a4bc3d037bb0772933c441b9ee4", "score": "0.72406393", "text": "function toPct ( pct ) {\r\n\t\treturn pct + '%';\r\n\t}", "title": "" }, { "docid": "a5ef8a4bc3d037bb0772933c441b9ee4", "score": "0.72406393", "text": "function toPct ( pct ) {\r\n\t\treturn pct + '%';\r\n\t}", "title": "" }, { "docid": "bf014c95626f1e5ae2db7d11f8052e5f", "score": "0.72352535", "text": "function percent(totaleDati){\n var fatturato = 0; //Variabile vuota pari a 0, dove aggiungero il risulato e riporterò fuori con il return\n for (var i = 0; i < totaleDati.length; i++) {\n var datoSingolo = totaleDati[i];\n var valoreDato = datoSingolo.amount;\n fatturato += parseInt(valoreDato);\n }\n return fatturato;\n}", "title": "" }, { "docid": "df89f7bd255eccc8877f233841080312", "score": "0.7227648", "text": "function percentage() {\n currentInput = currentInput / 100;\n displayCurrentInput();\n}", "title": "" }, { "docid": "2b4702b3c4ccf5e7505babae033ada9f", "score": "0.7200916", "text": "function toPercent(per) {\n strr = '';\n for (i=0; i < per.length; i++) {\n if (per.charAt(i) == '%') {break;}\n strr = strr + per.charAt(i);\n }\n return (strr / 100); \n}", "title": "" }, { "docid": "e69768e15f32af3bdb84d305ae6550a1", "score": "0.71798795", "text": "function allGenderProportion(){\n\tmaleProportion = ((allMale/allData)*100).toFixed(2);\n\tfemaleProportion = ((allFemale/allData)*100).toFixed(2);\n\tdocument.getElementById(\"maleCount\").innerHTML = maleProportion + \"%\";\n\tdocument.getElementById(\"femaleCount\").innerHTML = femaleProportion + \"%\";\n}", "title": "" }, { "docid": "0bdd44e51e5d87c6a93b8e444b9b3dbd", "score": "0.7171934", "text": "function evalPercent(totalStudents,glassesWearers){\n\treturn glassesWearers/totalStudents * 100;\n}", "title": "" }, { "docid": "0bc7f20e8098a5280701ee075b9a6a89", "score": "0.71710384", "text": "function toPct ( pct ) {\n\t\treturn pct + '%';\n\t}", "title": "" }, { "docid": "0bc7f20e8098a5280701ee075b9a6a89", "score": "0.71710384", "text": "function toPct ( pct ) {\n\t\treturn pct + '%';\n\t}", "title": "" }, { "docid": "92cc1a9fd1fb9a32553531551cb87f44", "score": "0.7158265", "text": "function percentOf(num1,num2) {\n const totalPercLong = num1 / num2 * 100;\n const total = totalPercLong.toFixed(2);\n console.log(`${num1} is ${total}% of ${num2}`);\n return total\n}", "title": "" }, { "docid": "80e9711fb2e2e9000db52ea83d3e1897", "score": "0.71577024", "text": "function percentCalc(n1 , n2 ){\n console.log(divider(n1 , n2) * 100 + \"%\");\n}", "title": "" }, { "docid": "68d57c9706ff34b104b77ae6a02144cf", "score": "0.7129165", "text": "calculatePercentages()\n {\n // 1. loop thru each element in array of expenses \n this.data.allItems['exp'].forEach(function(cur) {\n cur.calcPercentage(this.data.totals.inc);\n });\n }", "title": "" }, { "docid": "1096f02043d896d0dd6f1c799929d035", "score": "0.70860136", "text": "function percentDiscount(priceDe, pricePor) {\n var discount = pricePor * 100 / priceDe;\n discount = 100 - discount;\n return parseInt(discount);\n }", "title": "" }, { "docid": "614c58887a393de13203c08c0cdfa15b", "score": "0.70593774", "text": "function percentagefirst(a){\n const studentnumbers=Math.round(a);\n return \"Percentage Students: \" + studentnumbers+\"%\"; }", "title": "" }, { "docid": "8e82eea479650dc2336b6f22daf6e72c", "score": "0.7058507", "text": "function thePercentage(percentage) {\n try {\n percentage = (spanExpenses.textContent / span.textContent) * 100;\n //console.log(percentage);\n if (percentage === Infinity || isNaN(percentage)) {\n percentage = 0;\n //showModal(\"First add incomes\")\n //throw \"First add incomes\";\n }\n } catch (error) {\n alert(`Error ${error}`);\n }\n return percentage;\n}", "title": "" }, { "docid": "e312334995897acf270605fddcae01a7", "score": "0.70548046", "text": "function getPercentResult(userScore, questionAmount) {\n return Math.round(userScore / questionAmount * 100)\n}", "title": "" }, { "docid": "2a1357e05a62c99f8a012afc789e2a3e", "score": "0.7053556", "text": "function DNBHomeperc(HomeOdds100, AwayOdds100) {\r\n dnbHome = (100/HomeOdds100) / ((100/HomeOdds100) + (100/AwayOdds100));\r\n return dnbHome\r\n}", "title": "" }, { "docid": "00908944b8ab2941bbb590823efb13fb", "score": "0.70499814", "text": "function PercentageOf( sLabel, val1, val2, out1 )\n{\n\tif( DebugModeFmOne ) window.alert( \"function PercentageOf \" + sLabel + \"\\n\\tval1 \" + val1 + \"\\n\\tval2 \" + val2 );\n\n\ttry\n\t{\n\t\tif( out1 != null )\n\t\t{\n\t\t\tif( val1 != null && val2 != null )\n\t\t\t{ \n\t\t\t\tout1.setSubmitMode( \"always\" );\n\t\t\t\tout1.setValue( val1 * val2 / 100.0 );\n\t\t\t}\t\n\t\t}\t\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeFmOne ) window.alert( \"function PercentageOf \" + sLabel + \" error code \" + err );\n\t}\n}", "title": "" }, { "docid": "9db4dfd4db19a310945db5d7bf6439f2", "score": "0.70454055", "text": "function calculateAssignmentProgressAsPercent(assignment) {\n if (assignment.due) {\n let totalCompletions = 0;\n for (let exercise of assignment.exerciseList) {\n totalCompletions += exercise.goal\n }\n return 100 * assignment.assignmentProgress / totalCompletions\n }\n return 0\n}", "title": "" }, { "docid": "fabc865f6613abc369af922a75ab601f", "score": "0.7035231", "text": "function CalcPercentageOf( sLabel, val1, val2, out1 )\n{\n\tif( DebugModeFmOne ) window.alert( \"function CalcPercentageOf \" + sLabel + \"\\n\\tval1 \" + val1 + \"\\n\\tval2 \" + val2 );\n\n\ttry\n\t{\n\t\tif( out1 != null )\n\t\t{\n\t\t\tif( val1 != null && val1 != 0.0 && val2 != null )\n\t\t\t{ \n\t\t\t\tout1.setSubmitMode( \"always\" );\n\t\t\t\tout1.setValue( val2 * 100.0 / val1 );\n\t\t\t}\t\n\t\t}\t\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeFmOne ) window.alert( \"function CalcPercentageOff \" + sLabel + \" error code \" + err );\n\t}\n}", "title": "" }, { "docid": "481331260ff59bf1e90d95612c2ea92e", "score": "0.70211476", "text": "function calculatePercent(baseAmount, percent) {\n if (!percent) {\n return; // should probably raise an exception here...\n }\n\n return Number((baseAmount * (percent / 100)).toFixed(2));\n}", "title": "" }, { "docid": "7f33355314e17df948367f3d1ec9ff47", "score": "0.69913656", "text": "function calculatePercentage(elapsedTime, totalTime){\n\treturn (elapsedTime * 100) / +totalTime;\n}", "title": "" }, { "docid": "7f0f5ebf548f45340078ab9cc45b3c5d", "score": "0.69877654", "text": "function toPercent(decimal){\n var percentage = decimal * 100 + '%';\n return percentage;\n}", "title": "" }, { "docid": "b00c281dc6462668de679da78137a1c2", "score": "0.6984116", "text": "percentAchieved(value, target) {\n return (100 * value) / target\n }", "title": "" }, { "docid": "071b6dc2d433d8275f356ac28bcc759c", "score": "0.69745916", "text": "function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); }", "title": "" }, { "docid": "c8df2c0e24b550d240bc2709ad88d6e7", "score": "0.6967963", "text": "get percentage() {\n const _num = 100 / this.size;\n return _num.toFixed(2);\n }", "title": "" }, { "docid": "bb3e167b1f7965fbf6558f3e71ca3738", "score": "0.69487387", "text": "function percentage(population) {\n return Math.ceil((population / worldPopulation) * 100);\n}", "title": "" }, { "docid": "aab3e0d777d30454a84c7620aa8672c5", "score": "0.6935362", "text": "function convertToPercentage (n) {\r\n\t if (n <= 1) {\r\n\t n = n * 100 + '%';\r\n\t }\r\n\r\n\t return n\r\n\t }", "title": "" }, { "docid": "1eeef3d49fc9ecbdb42accc3817f96fc", "score": "0.69295067", "text": "function getLovePerc() {\n return (((love_count)/(love_count + hate_count))*100).toFixed(2);\n}", "title": "" }, { "docid": "b9f83fc1ae3a509cb2398f35d4bec176", "score": "0.6927406", "text": "function pag_calculateWidthPercent(div, maindiv) {\n var fullWidth = pag_getWidth(maindiv);\n var width = pag_getWidth(div);\n return (width * 100) / fullWidth;\n}", "title": "" }, { "docid": "0964812b074b58f764818d234de3f14e", "score": "0.6923871", "text": "function chart_percent(x) {\n\n return \"\" + (x*100).toFixed(1);\n\n}", "title": "" }, { "docid": "9da6734a2aad75ab209daab4714b546f", "score": "0.690801", "text": "function text_percent(x) {\n\n return \"\" + (x*100).toFixed(0);\n\n}", "title": "" }, { "docid": "f9bf2a8054722bd0b8326c49d4bc58f1", "score": "0.69022316", "text": "function calcPercentageMark(answers) {\n return (answers / maxScore) * 100 + 1;\n}", "title": "" }, { "docid": "6477fb65cc94659526fddee455d07da7", "score": "0.68985164", "text": "perc() {\n if (this.current !== \"\") {\n this.input = this.current * this.input / 100;\n } else {\n this.input = this.input / 100;\n }\n }", "title": "" }, { "docid": "58819e43d2eec5193a6282fb448209cc", "score": "0.68964714", "text": "getPercent() {\n let sums = this.getSums();\n for (let elements = 0; elements < Object.keys(this.file).length; elements++) {\n let values = this.file[elements].values;\n for (let value = 0; value < values.length; value++) {\n let total = sums[values[value].name];\n //set calculated percent and total to the corresponding dataset\n this.file[elements].values[value][\"percent\"] = values[value].value / (total / 100);\n this.file[elements].values[value][\"total\"] = total;\n }\n }\n }", "title": "" }, { "docid": "5685b7ba97fb4957e6314428db4e4483", "score": "0.689315", "text": "bookPercentProgress(state) {\n const RATIO = 100;\n\n return Math.floor(\n (state['17 Oct'][0].pages.progress / state['17 Oct'][0].book.pages) *\n RATIO,\n );\n }", "title": "" }, { "docid": "9bafa64d769159b8620dc5983d51dd6c", "score": "0.68886673", "text": "function toPercent(x){\n x = a.value;\n x = eval(x/100);\n a.value = x;\n}", "title": "" }, { "docid": "1a3c81dfb1fd778d1bbd48eb2d19fcb1", "score": "0.6886472", "text": "function getPercent(ratio) {\n\tconst percent = Math.round(ratio * 100);\n\n\treturn percent >= 100 ? '100' : percent.toString().padStart(2, '0') + '%';\n}", "title": "" }, { "docid": "aefc1eb657221c6403da5f22a88abcb6", "score": "0.6883668", "text": "function calculatePerc() {\n if (score < 9) {\n percentage = 0;\n }\n if (score >= 9 && score <= 12) {\n percentage = 1;\n }\n if (score == 13 || score == 14) {\n percentage = 2;\n }\n if (score == 15) {\n percentage = 3;\n }\n if (score == 16) {\n percentage = 4;\n }\n if (score == 17) {\n percentage = 5;\n }\n if (score == 18) {\n percentage = 6;\n }\n if (score == 19) {\n percentage = 8;\n }\n if (score == 20) {\n percentage = 11;\n }\n if (score == 21) {\n percentage = 14;\n }\n if (score == 22) {\n percentage = 17;\n }\n if (score == 23) {\n percentage = 22;\n }\n if (score == 24) {\n percentage = 27;\n }\n if (score >= 25) {\n percentage = 30;\n }\n console.log(\"Percentage is: \" + percentage);\n } // end calculatePerc function", "title": "" }, { "docid": "4e9a31886d512292b827c915b69ffd6c", "score": "0.68783224", "text": "function percent(number) {\n var index = parseInt(number) - 1;\n if (numerators[index].value == '' || denominators[index].value == ''){\n percents[index].innerHTML = \"Error: Empty field.\";\n return;\n }\n var numerator = parseFloat(numerators[index].value);\n var denominator = parseFloat(denominators[index].value);\n if (denominator == 0){\n percents[index].innerHTML = \"Error: Dividing by 0.\";\n return;\n }\n if (denominator < 0 || numerator < 0){\n percents[index].innerHTML = \"Error: Cannot have a negative score.\";\n return;\n }\n var score = ((numerator*100)/denominator).toFixed(2);\n percents[index].innerHTML = score + \"%\";\n}", "title": "" }, { "docid": "f01674e1a68b599adb9431a9c911d99a", "score": "0.6872182", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + \"%\";\n }\n\n return n;\n }", "title": "" }, { "docid": "facd43da28d0db0aada1d18b966377eb", "score": "0.6871591", "text": "function percentageofWorld1(countrys,population) { \n return `${countrys} has ${population} million people, so it's about ${population/7900*100} of the world population`\n}", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.6869793", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.6869793", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "ef9ddb305f6c5897cfdb7f1ec63b92ea", "score": "0.68640715", "text": "function compute_percentage(country) {\n let total_trades_value = story_data.filter(x => x.Year == current_year)\n .filter(x => x.PartnerISO == \"WLD\")[0].Value;\n return country.trade_value / total_trades_value * 100;;\n}", "title": "" }, { "docid": "c60d965120645448cb9b6e25514b341e", "score": "0.68554246", "text": "function DNBAwayperc(HomeOdds100, AwayOdds100) {\r\n dnbAway = (100/AwayOdds100) / ((100/HomeOdds100) + (100/AwayOdds100));\r\n return dnbAway\r\n}", "title": "" }, { "docid": "d7969ac26dc36fdfd5ee4031c8dbbee3", "score": "0.68354386", "text": "function perc(n) {\n return n * 100 + \"%\";\n}", "title": "" }, { "docid": "fcdb421bfb5ea4fb1fc35e0dc103e1ac", "score": "0.6832846", "text": "get percentage() {\n if (this._slider.min >= this._slider.max) {\n return this._slider._isRtl ? 1 : 0;\n }\n return (this.value - this._slider.min) / (this._slider.max - this._slider.min);\n }", "title": "" }, { "docid": "588dda5a7f0cca176879a033b61e9eee", "score": "0.6832807", "text": "get percent() {\n // Calculate percent of file that has been uploaded. If the total bytes is 0 (which can happen when empty), return 100%\n return (this.totalBytes ? this.bytesTransferred / this.totalBytes : 1) * 100;\n }", "title": "" }, { "docid": "7f3165ea24c5afcdc72bd3ef113f9995", "score": "0.6829214", "text": "function updatePercentages(){\n\tcalculatePercentages();\n\tdisplayPercentages();\n}", "title": "" }, { "docid": "dbcf5606001379d1cfaf23f6b42f7c16", "score": "0.6819446", "text": "function calculatePercentage (numberOfStudents, numbersOfMentors){\n let percentageStudents= (numberOfStudents/(numberOfStudents+numbersOfMentors)) * 100;\n let percentageMentors= (numbersOfMentors/(numbersOfMentors+numberOfStudents)) * 100;\n return `Percentage of students is ${Math.round(percentageStudents)}% and percentage of mentors is ${Math.round(percentageMentors)}%.`;\n}", "title": "" }, { "docid": "e8c8181e40ac6dd58978067205e4f65e", "score": "0.6808187", "text": "function calculateTipPercent(billAmt, tipAmt) {\n return Math.round(100 / (billAmt / tipAmt));\n}", "title": "" }, { "docid": "a7df52a5ecf3df92fd0f049461b0cf81", "score": "0.6805228", "text": "function getPercent(d) {\n\treturn ((d - minValue) / (maxValue - minValue)) * 100;\n}", "title": "" }, { "docid": "fdc540d4d909844495b4dca9717581f8", "score": "0.6801357", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n }", "title": "" }, { "docid": "cff279069f2c8cf0298c61c18134b5be", "score": "0.6789598", "text": "function percentDiff(num1, num2) {\n return parseFloat(Math.abs(((num1-num2)/((num1+num2)/2)*100).toFixed(1)));\n}", "title": "" }, { "docid": "a5c6f922bc91a706fd7dcff47d03d2f7", "score": "0.6785853", "text": "static percentage(report, student_id, display_div) {\n\n if (report.subtype === 'class' || report.subtype == 'institutional' ||\n display_div !== undefined) {\n ReportGenerator.percentageCategory(report, student_id, display_div);\n }\n if (report.subtype === 'roster') {\n ReportGenerator.percentageRoster(report);\n }\n }", "title": "" }, { "docid": "8bc2de4c1fea7634bdaaec1375865dfd", "score": "0.67834723", "text": "function convertToPercentage(n) {\n if (n <= 1) n = n * 100 + \"%\";\n return n;\n }", "title": "" }, { "docid": "59bd61adaf51555aaf38c67ba6659339", "score": "0.6778799", "text": "function percentageNumber(number, percent) {\n\treturn (percent / 100) * number\n}", "title": "" }, { "docid": "6ba1f55ff87475cb408b5bf189575893", "score": "0.67696935", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + \"%\";\n }\n\n return n;\n }", "title": "" }, { "docid": "7154d3fa16fcec596ec242f4f7dc2034", "score": "0.676937", "text": "function convertToPercentage(n) {\n\t if (n <= 1) {\n\t n = (n * 100) + \"%\";\n\t }\n\t\n\t return n;\n\t}", "title": "" }, { "docid": "bdd75b60f1421f9b99c10faa1a77ebd6", "score": "0.6769036", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n return `${Number(n) * 100}%`;\n }\n return n;\n}", "title": "" }, { "docid": "951a4d901bdc9295d92bb7610bfccbe3", "score": "0.676073", "text": "function outputRoundedPercentage(numerator, denominator)\n{\n var res = (numerator / denominator) * 100 // percentage\n res = Math.round(res * 100) / 100; // rounded\n res = res.toString() + \"%\";\n return res;\n}", "title": "" }, { "docid": "788c7ea971f67d48d4b49a353febfccc", "score": "0.6759117", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n }", "title": "" }, { "docid": "788c7ea971f67d48d4b49a353febfccc", "score": "0.6759117", "text": "function convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n }", "title": "" }, { "docid": "e18927b2ab37f33db89470597cbe47d1", "score": "0.675357", "text": "function percentageOfWorld1(population) {\n return (population / 7900) * 100\n}", "title": "" }, { "docid": "a5d481bd6c795bd91d4bf4cf7ee8cfd9", "score": "0.67515415", "text": "function calcolaPercentualeYT(){\n\t\tvar q = 0;\n\t\tif(m > 0){\n\t\t\tq = (n/m)*100;\n\t\t}\n\t\telse {\n\t\t\tq = 100;\n\t\t}\t\n\t\tq = q.toFixed(0);\n\t\t$scope.compareUsersDays = q;\n\t\tconsole.log(\"compareUsersDays n, m : \" + x + \" \" + y + \" \" + $scope.compareUsersDays);\n\t}", "title": "" }, { "docid": "7600f670c728ab29e950c0530b4455d7", "score": "0.674763", "text": "function calculateOpponentPercentage(index) {\n var winValue = allUsers[activeUserIndex].opponentsArray[index][1];\n // console.log(winValue);\n var lossValue = allUsers[activeUserIndex].opponentsArray[index][2];\n // console.log(lossValue);\n var percentValue = '';\n if ((lossValue + winValue) > 0) {\n percentValue = parseInt((winValue / (winValue + lossValue)) * 100);\n return percentValue;\n } else {\n return percentValue;\n }\n}", "title": "" } ]
771e25db53794e6ad997f32c680f1bdd
Chapter 9 Library Search for the "Sweet Gwendoline" magazine
[ { "docid": "7c50c318bc61f1bced2b8297eeb19f0e", "score": "0.631865", "text": "function C009_Library_Search_SearchGwendoline() {\n\tif (C009_Library_Search_MagazineConfiscated) {\n\t\tC009_Library_Search_CurrentStage = 32;\n\t\tOverridenIntroText = GetText(\"NoMoreSweetGwendoline\");\n\t}\n}", "title": "" } ]
[ { "docid": "3f7c159084c2f552332d0acfa64fab0f", "score": "0.63814634", "text": "function WordSearch () {}", "title": "" }, { "docid": "8df409919033f37361db8f27f273ffcb", "score": "0.6253952", "text": "function search() {\n // extract all search terms\n getQtermsFromUrlQuery();\n\n /** \n * For each document ID that has some match, contains a bitmap of matched terms and cumulative relevance.\n * @type {Object.<number, {matchBitmap:Array.<number>, relevance:number} >} */\n var candidates = {};\n\n for (let qtermIndex in qterms) {\n /** @type {string} */\n let term = qterms[qtermIndex];\n let onlyWholeWord = false;\n // Read the user setting, whether he wants to always match whole words, even if no quotes around are used.\n // The user can define it in the CSS, e.g. in vsdocman_overrides.css:\n // :root {\n // --searchAlwaysWholeWord: true;\n // }\n onlyWholeWord = getCssCustomProperty(\"--searchAlwaysWholeWord\", \"boolean\");\t\n if (term.length > 2 && term.startsWith(\"\\\"\") && term.endsWith(\"\\\"\")) {\n term = term.substr(1, term.length - 2);\n onlyWholeWord = true;\n }\n\n // index= \"term1\":\"[[docId1, relevance1],.., [docIdN, relevanceN]]\", ..., \"term5\":\"[[docId1, relevance1],.., [docIdN, relevanceN]]\"\"\n\n // whole words\n let termDocs=index[term];\t// serialized string (instead of a direct array) for much faster parsing of search_index.js\n if (termDocs !== undefined) {\n termDocs = JSON.parse(termDocs); // deserialize\n for (let i in termDocs) {\n let docId = termDocs[i][0];\n let relevance = termDocs[i][1];\n if (candidates[docId] === undefined) {\n candidates[docId] = {};\n candidates[docId].matchBitmap = get_bitmap(qtermIndex, qterms.length);\n candidates[docId].relevance = relevance;\n }\n else {\n candidates[docId].matchBitmap[qtermIndex] = 1;\n candidates[docId].relevance += relevance;\n }\n }\n }\n\n // parts of words\n if (!onlyWholeWord) {\n for (let indexedTerm in index) {\n if (indexedTerm.indexOf(term) >= 0) {\n termDocs = index[indexedTerm];\t// serialized string (instead of a direct array) for much faster parsing of search_index.js\n \ttermDocs = JSON.parse(termDocs); // deserialize\n for (let i in termDocs) {\n let docId = termDocs[i][0];\n let relevance = termDocs[i][1];\n if (candidates[docId] === undefined) {\n candidates[docId] = {};\n candidates[docId].matchBitmap = get_bitmap(qtermIndex, qterms.length);\n candidates[docId].relevance = relevance;\n }\n else {\n candidates[docId].matchBitmap[qtermIndex] = 1;\n candidates[docId].relevance += relevance;\n }\n }\n }\n }\n }\n }\n\n let results = [];\n // sort by relevance in descending order\n let sortedDocIds = [];\n for (let key in candidates) sortedDocIds.push(key);\n sortedDocIds.sort(function (a, b) {\n return candidates[b].relevance - candidates[a].relevance;\n });\n for (let i = 0; i < sortedDocIds.length; i++) {\n let docIndex = sortedDocIds[i];\n let on = 1;\n for (let i in qterms) {\n on = on && candidates[docIndex].matchBitmap[i];\n }\n if (on) {\n results.push(docIndex);\n }\n }\n let resultsCount = results.length;\n\n document.getElementById(\"search-results-heading-count\").appendChild(document.createTextNode(resultsCount)); // safe way of setting un-escaped text\n let sPhrase = getQueryParameterByName(\"search\");\n sPhrase = \"\\\"\" + sPhrase + \"\\\"\";\n document.getElementById(\"search-results-heading-phrase\").appendChild(document.createTextNode(sPhrase)); // safe way of setting un-escaped text\n\n var appendPromise = loadAndAppendSearchResultItems(results, 0, paginationSize);\n}", "title": "" }, { "docid": "ed46b6b860e6343d17d376881c4a5a50", "score": "0.60740614", "text": "function search() {\n \n }", "title": "" }, { "docid": "311fcd8c412f785d55f20694cfc3a22b", "score": "0.6008853", "text": "async function GsearchWords() {\n try {\n let searchValue = 'q=' + `${searchWord.value}`\n const response = await fetch(`${GuardianUrl}${searchValue}${GuardianFields}${GuardianApiKey}`)\n const data = await response.json()\n headlinesArray = data.response.results\n console.log(headlinesArray)\n allNewsCreateDOMnodes()\n } catch (error) {\n console.log(error.message) \n }\n}", "title": "" }, { "docid": "bf3983015edd652cf958cef0684584ba", "score": "0.60057694", "text": "function C008_DramaClass_Dressing_Search() {\n\t\n\t// On the first search, we find the costume\n\tC008_DramaClass_Dressing_SearchCount++;\n\tif (C008_DramaClass_Dressing_SearchCount == 1) {\n\t\tOverridenIntroText = GetText(\"FindCostume\");\n\t}\n\t\n\t// On the third search, we find a chastity belt\n\tif (C008_DramaClass_Dressing_SearchCount == 3) {\n\t\tOverridenIntroText = GetText(\"FindBelt\");\n\t\tPlayerAddInventory(\"ChastityBelt\", 1);\n\t}\n\t\n}", "title": "" }, { "docid": "db0f0c8f95ae6791526f2addd8b9bee0", "score": "0.59713286", "text": "search() { }", "title": "" }, { "docid": "2f7c031c31cdebd887611efdeef3e8f4", "score": "0.5970491", "text": "function searchForListings(searchTerm) {\n\n}", "title": "" }, { "docid": "314fd2c9b603c10736afb9f7833d9649", "score": "0.5928868", "text": "function search() {\r\n console.log('Searching...')\r\n var options = {\r\n shouldSort: true,\r\n includeScore: true,\r\n includeMatches: true,\r\n threshold: 0.6,\r\n location: 0,\r\n distance: 100,\r\n maxPatternLength: 32,\r\n minMatchCharLength: 1,\r\n keys: [\r\n \"title\",\r\n \"catalog\"\r\n ]\r\n };\r\n var fuse = new Fuse(books, options);\r\n result = fuse.search(\"sav\"); // Point user search input here!\r\n\r\n}", "title": "" }, { "docid": "493dd083b112fecd638bc4629f4e1d04", "score": "0.5890095", "text": "function search(i, searchText, offset = 0) {\n getBibleResults(searchText, offset).then((data) => {\n // console.log(data);\n let index = Math.floor(random(10));\n let verse = data.verses[index].text;\n let ref = data.verses[index].reference;\n if (TWEETING) tweet(i, ref + \" \" + verse);\n });\n}", "title": "" }, { "docid": "69c470bcfa6d96a2f902c2d6b0ed82e4", "score": "0.587635", "text": "function searchSongs()\n {\n\n }", "title": "" }, { "docid": "c19c83f6a2f4d8a9b2ca804f4356f12f", "score": "0.5769838", "text": "function search() {\n //removes old movies\n let article = qs(\"article\");\n while (article.firstChild) {\n article.firstChild.remove();\n }\n\n let url = BASE_URL + \"?api_key=\" + API_KEY;\n url += \"&query=\" + qs(\"input\").value;\n fetch(url)\n .then(checkStatus)\n .then(JSON.parse)\n .then(createMovieCards)\n .then(updateCount)\n .catch(function(){\n let errorMsg = document.createElement(\"p\");\n errorMsg.innerText = \"OOPS! An error occured when accessing the TMDb API...\";\n qs(\"article\").appendChild(errorMsg);\n });\n }", "title": "" }, { "docid": "7e993f67523a7d8706d3663801eda29e", "score": "0.5768414", "text": "function search() {\n reset();\n findMeaning(); //i had to.\n findRank();\n findCelebs();\n }", "title": "" }, { "docid": "6d0aa29f45a038c47306a1e6ad8b79fe", "score": "0.5752257", "text": "function search($query) {\n\t\n\t// get target corpus\n\tvar corpusName = _para['corpus'];\n\tvar anchorName = _para['aligntype'];\n\tvar mode = _para['mode'];\n\tif (corpusName === 'error' || anchorName === 'error' || mode === 'error') {\n\t\talert(\"[Error] 讀取搜尋設定錯誤。\");\n\t\treturn;\n\t}\n\n\t// pick up the block that contain keyword and show\n\tvar searchResults = searchInCorpus(corpusName, anchorName, mode, $query);\n\tdisplaySearchResult(corpusName, searchResults, $query);\n\tdisplaySearchAnalysis(searchResults, mode, $query);\n}", "title": "" }, { "docid": "b4dee83dcfa8acf443482b9b5d87d5a2", "score": "0.5744704", "text": "async function NYTsearchWords() {\n try { \n const NYsearchValue = `${searchWord.value}`\n const response = await fetch(`${NYTurl}${NYsearchValue}${NYTfields}${NYTapiKey}`)\n const data = await response.json()\n headlinesArray = data.response.docs\n allNewsCreateDOMnodes()\n } catch (error) {\n console.log(error.message)\n }\n}", "title": "" }, { "docid": "3d830ffa16802ff389ba59c8ff387707", "score": "0.5738546", "text": "static async search(search_term){\n if(!search_term) { throw new TypeError(\"Search term cannot be empty\") }\n if(search_term.length < 3) { throw new TypeError(\"Search term must be at least 3 characters\") }\n let requestConfig = MarvelData.requestConfig('/comics', { titleStartsWith: search_term });\n const response = await request(requestConfig)\n return response.data.results\n }", "title": "" }, { "docid": "a83d7cb1f494d12061597e5c469928a0", "score": "0.573358", "text": "static async Search(keywords, returnResults=5) {\n const url = `https://www.wnacg.org/search/?q=${encodeURIComponent(keywords)}&f=_all&s=create_time_DESC&syn=yes`\n const result = await RequestAsync(url)\n const $ = ParseDOM(result)\n const blocks = $('.gallary_item')\n let candidates = []\n\n for(let i = 0; i < blocks.length; ++i) {\n const name = $('.title a', blocks[i]).text()\n const href = 'https://www.wnacg.org/' + $('.title a', blocks[i]).attr('href')\n const thumb = 'https:' + $('img', blocks[i]).attr('src')\n\n candidates.push({title: name, href: href, thumb: thumb})\n }\n\n candidates = candidates.sort((a, b) => { return (CheckMetaContainsChinese(a.title) && !CheckMetaContainsChinese(b.title)) ? -1 : 0 } ).splice(0, returnResults)\n\n return candidates\n }", "title": "" }, { "docid": "521437c6124b05b5333b897cc1938e50", "score": "0.56582266", "text": "function FuseSearch() {\n}", "title": "" }, { "docid": "9e2981ac6b3d9edfcc0593f4d4888d30", "score": "0.5649537", "text": "function searchWikipedia(apiUrl) {\n var json = {};\n $.getJSON(apiUrl, function(json) {\n // extract the wikipedia search data\n for (var i = 0; i < json[1].length; i++) {\n $('.results-box').append(\"<div class='article-item'>\\r\\n<a href='\" + json[3][i] + \"'><h2 class='article-head'>\" + json[1][i] + \"</h2>\\r\\n<p class='article-description'>\" + json[2][i] + \"</p>\\r\\n</a></div>\");\n }\n });\n }", "title": "" }, { "docid": "dbb3d5c9c5ad384cc75b1305d65183fe", "score": "0.5641073", "text": "function findPreprints (pub_id) {\n search(pub_id)\n }", "title": "" }, { "docid": "9fbe649b55097a91735c03a496d17a9e", "score": "0.56401134", "text": "function search() {\n var term = \"Trees\";\n\n // URL for querying the times\n var url = 'https://api.nytimes.com/svc/search/v2/articlesearch.jsonp?' \n + 'callback=svc_search_v2_articlesearch&api-key=41553f34c5234f16b68507c8ab48160a' + '&q=' + term;\n\n // Query the URL, set a callback\n // 'jsonp' is needed for security\n loadJSON(url, gotData, 'jsonp');\n}", "title": "" }, { "docid": "02de92da96542e327483eb84ac1a8b50", "score": "0.56130916", "text": "function searchShowBooks(b) {\n // remove previous search results if any\n while (resultBody.firstChild) {\n resultBody.removeChild(resultBody.firstChild);\n }\n const bookTitle = b.volumeInfo.title;\n const BookAuthor = b.volumeInfo.authors;\n const BookThumb = b.volumeInfo.imageLinks.thumbnail;\n const BookPageCount = b.volumeInfo.pageCount;\n const BookLink = b.volumeInfo.canonicalVolumeLink; \n let subtitle = b.volumeInfo.subtitle;\n let Bookdescription = b.volumeInfo.description;\n if (!subtitle) {\n subtitle = 'No subtitle found for this book.';\n }\n if (!Bookdescription) {\n Bookdescription = 'No description found for this book';\n }\n \n createModalContent(bookTitle, BookThumb, BookAuthor, Bookdescription, BookPageCount, BookLink, subtitle);\n}", "title": "" }, { "docid": "4f01ba51372094e949ab7a0b93ee78e9", "score": "0.5610648", "text": "function runSearch() {\n input = document.getElementById('srchBox').value;\n var term = input;\n // console.log(\"Search term: \" + term);\n\n //Reset page info to replace tables from prior searches (not add to)\n searchData = searchBaseA + term + searchBaseB;\n\n if (term == null || term == undefined || term == \"\") {\n // console.log(\"No search term given, quitting.\");\n return;\n }\n\n //Var to contain the individual elements of the total search term set\n var pieces = [];\n //Var to contain memo content found by search\n var results = [];\n\n //Trim off leading and ending white space if present, set to upperCase\n term.trim();\n term = term.toUpperCase();\n\n //Check to see if multiple words in search term\n //Changed from term.includes because of fucking IE and Safari\n if (term.indexOf(\" \") > -1) {\n var i = 0;\n while (term.indexOf(\" \") > -1) {\n pieces[i] = term.substring(0, term.indexOf(\" \"));\n i++;\n term = term.substring(term.indexOf(\" \") + 1, term.length);\n }\n //Add the last one\n if (term != \"\") {\n pieces[i] = term;\n }\n }\n else {\n pieces[0] = term;\n }\n //Debug loop for evaluating contents of pieces[]\n // for (var i = 0; i < pieces.length; i++) {\n // console.log(\"pieces[\" + i + \"] = \" + pieces[i]);\n // }\n\n //Search through the keywords of the index array\n for (var i = 0; i < pieces.length; i++) {\n for (var j = 0; j < dmIndx.length; j++) {\n //If the entry's keywords include the term\n //Changed from dmIndx[].keywords.includes.includes because of fucking IE and Safari\n if (dmIndx[j].keywords.search(pieces[i]) != -1) {\n var foundEntry = false;\n //Search the results array for an existing entry from dmIndx\n for (var k = 0; k < results.length; k++) {\n //If found, increase results entry rank becasue we found it again with another term\n if (results[k].title == dmIndx[j].title) {\n results[k].rank++;\n foundEntry = true;\n break;\n }\n }\n\n //If not found, then add new entry to the results array\n if (!foundEntry) {\n var tmp = {\n title: dmIndx[j].title,\n num: dmIndx[j].num,\n path: dmIndx[j].path,\n rank: 1,\n };\n results.push(tmp);\n }\n }\n }\n }\n\n results.sort(function(a, b) {\n return b.rank - a.rank;\n });\n //Debug code dump results array to console\n // console.log(results);\n\n var arrCounter = 0;\n var tableRows = Math.floor(results.length / tableCols);\n if (results.length % tableCols != 0)\n tableRows++;\n\n var sNewHeight = 49 * tableRows + 60;\n // console.log(\"#rows = \" + tableRows);\n // console.log(\"sNewHeight = \" + sNewHeight);\n\n searchData += \"<table>\";\n for (var i = 0; i < tableRows; i++) {\n searchData += \"<tr>\";\n for (var j = 0; arrCounter < results.length && j < tableCols; j++) {\n searchData += \"<td><button onclick=\\\"setMemo(\" + results[arrCounter].num + \")\\\">\" + results[arrCounter].title + \"</button></td>\";\n arrCounter ++;\n }\n\n searchData += \"</tr>\";\n }\n searchData += \"</table>\";\n\n //Populate window, expand search section to accommodate all returned results\n searchSubPage.innerHTML = searchData;\n addCSSRule(document.styleSheets[0], \"#searchToggle:checked ~ #searchExpand\", \"height: \" + sNewHeight + \"px;\");\n\n //console.log(\"Exiting runSearch();\")\n}", "title": "" }, { "docid": "d6650e4d77f2a5d4efd856926059f6ef", "score": "0.560037", "text": "function BN_search (BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result) {\r\n if (BN_match(BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch)) {\r\n\ta_result.push(BN);\r\n }\r\n if (BN.type == \"folder\") {\r\n\tlet children = BN.children;\r\n\tif (children != undefined) {\r\n\t let url;\r\n\t for (let i of children) {\r\n\t\tif ((i.type != \"separator\")\r\n\t\t\t&& (((url = i.url) == undefined) || !url.startsWith(\"place:\")) // Ignore special bookmarks\r\n ) {\r\n\t\t BN_search (i, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result)\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n}", "title": "" }, { "docid": "3d3891dd03dba5cb9012e257540bfe6c", "score": "0.5556823", "text": "function searchResults() {\n var $formInput = $('#searchInput'),\n term = $formInput.val().replace(\" \",\"+\"),\n queryUrl = \"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=pageimages%7Cextracts%7Cpageterms&generator=search&redirects=1&formatversion=2&pithumbsize=50&pilimit=10&exsentences=2&exlimit=10&exintro=1&explaintext=1&gsrsearch=\"+term+\"&gsrlimit=10\";\n \n currentSearchTerm = $formInput.val();\n \n $.ajax({\n type: \"POST\",\n url: queryUrl,\n dataType: \"jsonp\",\n headers: { 'Api-User-Agent': 'bot' },\n success: function (data) {\n \n for (var i = 0; i < data.query.pages.length; i++) {\n var page, pageInfo;\n \n page = data.query.pages[i];\n pageInfo = \"No page information to display.\";\n \n // If the search result does not have a description...\n if (!page.terms.description) {\n // Then it is highly unlikely that the page is a 'Wikipedia disambiguation page' and therefore,\n // it is reasonable to display the page.extract as the pageInfo\n pageInfo = page.extract;\n }\n // Else if 'description' includes/contains the string 'Wikipedia disambiguation page' OR 'Wikimedia disambiguation page' ...\n else if (page.terms.description.includes('Wikipedia disambiguation page') || page.terms.description.includes('Wikimedia disambiguation page')) {\n // Then it is a 'disambiguation' page and ...\n // If the extract contains the string \" refer to:\" || \" refers to:\" || other variations of that ...\n if (page.extract.includes(' refer to:') || page.extract.includes(' refers to:') || page.extract.includes(' refer to :') || page.extract.includes(' refers to :') || page.extract.includes(' can be:')) {\n // make pageInfo equal to the page description ('Wikipedia disambiguation page')\n pageInfo = page.terms.description;\n } else {\n // append page extract\n pageInfo = page.extract;\n }\n } else {\n // append page extract\n pageInfo = page.extract;\n }\n \n // append a bootstrap panel that contains page.title, pageInfo, and acts as a link to the matching wikipedia page\n $('.results').append('<a target=\"_blank\" href=\"https://en.wikipedia.org/?curid=' + page.pageid + '\"><div class=\"panel panel-default\"><div class=\"panel-heading\"><h3 class=\"panel-title\">'+page.title+'</h3></div><div class=\"panel-body\">'+pageInfo+'</div></div></a>');\n }\n $('.results').append('<p><a href=\"#\">Back to top</a></p>');\n\n },\n error: function (errorMessage) {\n alert(errorMessage);\n }\n });\n}", "title": "" }, { "docid": "1662dfafa4e6fa94e455359fdb5eb796", "score": "0.5543232", "text": "function searchIsbnByTitle() {\n let apiQuery = {\n query: searchTerm,\n api_key: '768e86dde3174110a0fbfe80aa8bbb75'\n }\n $.getJSON('https://api.themoviedb.org/3/search/movie', apiQuery, function(data) {\n let getData = data.items;\n let getResults = data.total_results;\n if (getResults != 0) {\n let getData = data.results;\n allItems.push(getData);\n renderIsbnResults();\n } else {\n $('.js-danger').fadeIn('slow').delay(1000).fadeOut('slow');\n }\n });\n}", "title": "" }, { "docid": "6af9d9e63fdebda592283f0c16067d1d", "score": "0.5531435", "text": "function allowAny(t) {\r\n var findings = new Array(0);\r\n\r\n nowbook = 0;\r\n nowchapter = 0;\r\n for (i = 0; i < profiles.length; i++) {\r\n var oneline = profiles[i];\r\n var ok = false;\r\n var compareElement = profiles[i].toUpperCase();\r\n if(searchType == SEARCHANY) { var refineElement = compareElement.substring(0,compareElement.indexOf('|HTTP')); }\r\n else { var refineElement = compareElement.substring(compareElement.indexOf('|HTTP'), compareElement.length); }\r\n for (j = 0; j < t.length; j++) {\r\n var compareString = t[j];\r\n var temp = \"\";\r\n\r\n// if (profiles[i].indexOf(document.search.query.value) != -1) {\r\n if (compareElement.indexOf(compareString) != -1) {\r\n \tok = true;\r\n while(chapter_lines[book_chapters[nowbook]+nowchapter+1] < i) {\r\n \t nowchapter++;\r\n if(nowchapter + book_chapters[nowbook] > book_chapters[nowbook+1]) {\r\n \t nowchapter = 0;\r\n \t nowbook++;\r\n }\r\n }\r\n findbook[findings.length] = nowbook;\r\n findchapter[findings.length] = nowchapter;\r\n\r\n while(oneline.indexOf(compareString) != -1) {\r\n temp += oneline.substring(0, oneline.indexOf(compareString)) + \r\n '<font color=\"ff0000\">' + compareString + '</font>';\r\n \r\n oneline = oneline.substring(oneline.indexOf(compareString)+compareString.length, oneline.length);\r\n }\r\n temp += oneline;\r\n oneline = temp;\r\n// findings[findings.length] = profiles[i];\r\n// break;\r\n }\r\n }\r\n if(ok)\r\n findings[findings.length] = oneline;\r\n }\r\n verifyManage(findings);\r\n }", "title": "" }, { "docid": "a1c7154ebb0b12cab346bf95ed599822", "score": "0.55178434", "text": "function searchPhotos(searchKey){\n unsplash.search.photos(searchKey, 1)\n .then(response => response.json())\n .then(json => {\n // Replace the photo here if you can eventually make the unsplash library work...\n //Gives back a list of photos related to that keyword\n //Choose a random one from that to display?\n \n });\n}", "title": "" }, { "docid": "199126073d40daf6e0cb6ee28328a471", "score": "0.5515944", "text": "function search() {\n let term = input.value();\n\n // URL for querying wikipedia\n let url = 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=' +\n '&search=' + term;\n\n // Dealing with CORS problem and Wikipedia\n url = 'https://cors-anywhere.herokuapp.com/' + url;\n\n // Query the URL, set a callback\n fetch(url)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n // Look at article list\n let articles = data[1];\n\n // Make a clickable link for each one\n for (let article of articles) {\n\n // We could also have this example just link to the articles themselves\n // let link = 'http://en.wikipedia.org/w/index.php?title=' + articles[i];\n // let a = createA(link, articles[i]);\n\n // But we are doing something fancier and excuting another query!\n let li = createElement('li', '');\n let a = createA('#', article);\n a.parent(li);\n li.parent('list');\n // Another callback\n setCallback(a, article);\n }\n })\n .catch(error => console.error(error));\n\n}", "title": "" }, { "docid": "9ad9bbbdbf7637322c5b8273ac1810a7", "score": "0.5509345", "text": "function beginSearch(query) {\n var url = 'https://www.googleapis.com/books/v1/volumes?q=title:' +\n encodeURIComponent(query) + '&callback=handleResults';\n var script = document.createElement(\"script\");\n script.src = url;\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n}", "title": "" }, { "docid": "ed86db1e9a85dbf9fb3f1db65c6ab2e4", "score": "0.5503751", "text": "search (text) {\n\n\n }", "title": "" }, { "docid": "b88a13ec8a01e4ca7e13d3b4fb098533", "score": "0.5481423", "text": "function searchKeyword(response) {\n\t\tvar section = document.querySelector('.wiki-app__articles');\n\n\t\twhile (section.firstChild) {\n\t\t\tsection.removeChild(section.firstChild);\n\t\t}\n\t\tif (response[1].length == 0) {\n\t\t\tvar title = add(\"h2\", \"wiki-app__article-title\", \"innerText\", \"Nothing here\");\n\t\t\tsection.appendChild(title);\n\t\t} else {\n\t\t\tfor (var i = 1, len = response[1].length; i < len; i += 1) {\n\t\t\t\t// here all DOM elements for article are created\n\t\t\t\tvar article = add(\"article\", \"wiki-app__article\", \"innerText\", \"\"),\n\t\t\t\t _title = add(\"h2\", \"wiki-app__article-title\", \"innerText\", response[1][i]),\n\t\t\t\t para = add(\"p\", \"wiki-app__snippet\", \"innerText\", response[2][i]),\n\t\t\t\t link = add(\"a\", \"wiki-app__link\", \"innerText\", response[3][i]);\n\n\t\t\t\tlink.setAttribute(\"href\", response[3][i]); //add href attribute to a tag\n\n\t\t\t\t// append all elements to article\n\t\t\t\tarticle.appendChild(_title);\n\t\t\t\tarticle.appendChild(para);\n\t\t\t\tarticle.appendChild(link);\n\n\t\t\t\tsection.appendChild(article);\n\t\t\t}\n\t\t}\n\n\t\tsection.addEventListener('click', function (event) {\n\t\t\tvar target = event.target;\n\t\t\tif (target.classList.contains(\"wiki-app__article\")) {\n\t\t\t\twindow.open(target.querySelector(\".wiki-app__link\").getAttribute(\"href\"), \"_self\");\n\t\t\t} else {\n\t\t\t\twindow.open(target.parentElement.querySelector(\".wiki-app__link\").getAttribute(\"href\"), \"_self\");\n\t\t\t}\n\t\t\t// window.open(event.target.querySelector(\".wiki-app__link\").getAttribute(\"href\", \"_self\"));\n\t\t});\n\t}", "title": "" }, { "docid": "8bd416a8eded280faae8c5e374b402c7", "score": "0.54805344", "text": "function getSearchResult(){\n\tconst songTitle = searchInput.value;\n\tif (songTitle){\n\t\tfetch(`https://api.lyrics.ovh/suggest/${songTitle}`)\n\t\t.then(response => response.json())\n\t\t.then(data =>{\n\t\t\tconst fromApi = data.data;\n\t\t\tconst songs = fromApi.map(collection => collection).slice(0,10);\n\n\t\t\tif(!songs.length){\n\t\t\t\tsearchResult.innerHTML = `<h3 class=\"text-center\">Sorry! no songs found.</h3>`;\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\tsearchResult.innerHTML = \"\";\n\t\t\t\tsongs.map((collection) => {\n\t\t\t\t\tsearchResult.innerHTML += `\n\t\t\t\t\t<!-- single result -->\n\t\t\t\t\t<div class=\"single-result d-flex align-items-center justify-content-between my-3 p-3\">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t<a href=\"${collection.link}\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"${collection.album.cover}\" alt=\"cover of ${collection.album.title}\">\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<h3 class=\"lyrics-name\">\n\t\t\t\t\t\t\t\t<a href=\"${collection.link}\" target=\"_blank\">${collection.title}</a>\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<p class=\"author lead\">${collection.album.title} by <span style=\"font-style: italic;\" >${collection.artist.name}</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"text-md-right text-center\">\n\t\t\t\t\t\t\t<button class=\"btn btn-success\" onclick=\"getLyrics('${collection.artist.name}', '${collection.title}', '${collection.title}', '${collection.artist.name}')\">Get Lyrics </button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<!-- single result -->\n\t\t\t\t\t`\n\t\t\t\t});\n\t\t\t}\n\t\t\tsearchResult.display.style = \"block\";\n\t\t\tsingleLyrics.innerHTML = \"\";\n\t\t});\n\t}\n\telse{\n\t\talert(\"please find the correct song name\");\n\t}\n}", "title": "" }, { "docid": "b6ce2514a4a29b3b746e377702258bbd", "score": "0.5463068", "text": "function fetchResults(searchQuery) { //we are using fetch because it's built into the browser. You won't need additional libraries\n const endpoint = `https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&srlimit=20&srsearch=${searchQuery}`; \n \n fetch(endpoint)\n .then(response => response.json())\n .then(data => {\n const results = data.query.search; //search is an arry of objects nested in query\n displayResults(results);\n })\n .catch(() => console.log('An error ocurred'));\n \n}", "title": "" }, { "docid": "8eb0ac771dc53ce5800a2608394b9bc0", "score": "0.54584485", "text": "function searchLibrary() {\n\t// p.s_x and p.s_y are already adjusted for start position\n\tvar cx = 0,\n\t\tdoc = new ActiveXObject('htmlfile'),\n\t\tf = 0,\n\t\texpand_limit = 350, //Math.min(Math.max(window.GetProperty(\"ADV.Limit Search Results Auto Expand: 10-1000\", 350), 10), 1000),\n\t\ti = 0,\n\t\tlbtn_dn = false,\n\t\tlg = [],\n\t\tlog = [],\n\t\toffset = 0,\n\t\ts = 0,\n\t\tshift = false,\n\t\tshift_x = 0,\n\t\ttxt_w = 0;\n\tvar calc_text = function () {var im = gdi.CreateImage(1, 1), g = im.GetGraphics(); txt_w = g.CalcTextWidth(p.s_txt.substr(offset), ui.font); im.ReleaseGraphics(g); im.Dispose();}\n\tvar drawcursor = function (gr) {\n\t\tif (p.s_search && p.s_cursor && s == f && cx >= offset) {\n\t\t\tvar x1 = p.s_x + get_cursor_x(cx);\n\t\t\tgr.DrawLine(x1, p.s_y + p.s_sp * 0.1, x1, p.s_y + p.s_sp * 0.85, 1, ui.textcol);\n\t\t}\n\t}\n\tvar drawsel = function(gr) {\n\t\tif (s == f) return;\n\t\tvar cursor_y = Math.round(p.s_sp / 2 + ui.y);\n\t\tvar clamp = p.s_x + p.s_w2;\n\t\tvar selcol = col.primary ? col.primary : ui.backcolsel;\n\t\tgr.DrawLine(Math.min(p.s_x + get_cursor_x(s), clamp), cursor_y, Math.min(p.s_x + get_cursor_x(f), clamp), cursor_y, ui.row_h - 3, selcol);\n\t}\n\tvar get_cursor_pos = function (x) {var im = gdi.CreateImage(1, 1), g = im.GetGraphics(), nx = x - p.s_x, pos = 0; for (i = offset; i < p.s_txt.length; i++) {pos += g.CalcTextWidth(p.s_txt.substr(i,1), ui.font); if (pos >= nx + 3) break;} im.ReleaseGraphics(g); im.Dispose(); return i;}\n\tvar get_cursor_x = function (pos) {\n\t\tvar im = gdi.CreateImage(1, 1),\n\t\tg = im.GetGraphics(),\n\t\tx = 0;\n\t\tif (pos >= offset) x = g.CalcTextWidth(p.s_txt.substr(offset, pos - offset), ui.font);\n\t\tim.ReleaseGraphics(g); im.Dispose();\n\t\treturn x;\n\t}\n\tvar get_offset = function (gr) {var t = gr.CalcTextWidth(p.s_txt.substr(offset, cx - offset), ui.font); var j = 0; while (t >= p.s_w2 && j < 500) {j++; offset++; t = gr.CalcTextWidth(p.s_txt.substr(offset, cx - offset), ui.font);}}\n\tvar record = function() {lg.push(p.s_txt); log = []; if (lg.length > 30) lg.shift();}\n\tthis.clear = function() {\n\t\tlib_manager.time.Reset(); library_tree.subCounts.search = {}; offset = s = f = cx = 0; p.s_cursor = false; p.s_search = false; p.s_txt = \"\";\n\t\tp.search_paint(); timer.reset(timer.search_cursor, timer.search_cursori); lib_manager.rootNodes();\n\t\t// if (p.pn_h_auto && p.pn_h == p.pn_h_min && library_tree.tree[0]) library_tree.clear_child(library_tree.tree[0]);\n\t}\n\tthis.on_key_up = function(vkey) {if (!p.s_search) return; if (vkey == v.shift) {shift = false; shift_x = cx;}}\n\tthis.lbtn_up = function(x, y) {if (s != f) timer.reset(timer.search_cursor, timer.search_cursori); lbtn_dn = false;}\n\tthis.move = function(x, y) {if (y > p.s_h || !lbtn_dn) return; var t = get_cursor_pos(x), t_x = get_cursor_x(t); calc_text(); if(t < s) {if (t < f) {if (t_x < p.s_x) if(offset > 0) offset--;} else if (t > f) {if (t_x + p.s_x > p.s_x + p.s_w2) {var l = (txt_w > p.s_w2) ? txt_w - p.s_w2 : 0; if(l > 0) offset++;}} f = t;} else if (t > s) {if(t_x + p.s_x > p.s_x + p.s_w2) {var l = (txt_w > p.s_w2) ? txt_w - p.s_w2 : 0; if(l > 0) offset++;} f = t;} cx = t; p.search_paint();}\n\tthis.rbtn_up = function(x, y) {men.search_menu(x, y, s, f, doc.parentWindow.clipboardData.getData('text') ? true : false)}\n\t// this.search_auto_expand = window.GetProperty(\" Search Results Auto Expand\", false);\n\n\tthis.lbtn_dn = function(x, y) {\n\t\tvar hadFocus = p.s_search;\n\t\tp.search_paint();\n\t\tlbtn_dn = p.s_search = (y < p.s_y + p.s_h && x >= p.s_x && x < p.s_x + p.s_w2);\n\t\tif (!lbtn_dn) {\n\t\t\toffset = s = f = cx = 0;\n\t\t\ttimer.reset(timer.search_cursor, timer.search_cursori);\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (shift) {\n\t\t\t\ts = cx;\n\t\t\t\tf = cx = get_cursor_pos(x);\n\t\t\t} else {\n\t\t\t\tcx = get_cursor_pos(x);\n\t\t\t\ts = f = cx;\n\t\t\t}\n\t\t\tif (!hadFocus) {\n\t\t\t\tthis.searchFocus();\n\t\t\t}\n\t\t\tthis.reset_cursor_timer();\n\t\t}\n\t\tp.search_paint();\n }\n\n this.on_mouse_lbtn_dblclk = function(x, y, m) {\n if (y < p.s_y + p.s_h && x >= p.s_x && x < p.s_x + p.s_w2) {\n\t\t\tthis.on_char(v.selAll, true);\n p.search_paint();\n }\n\t}\n\n\tthis.reset_cursor_timer = function () {\n\t\ttimer.reset(timer.search_cursor, timer.search_cursori);\n\t\tp.s_cursor = true;\n\t\ttimer.search_cursor = window.SetInterval(function() {\n\t\t\tp.s_cursor = !p.s_cursor;\n\t\t\tp.search_paint();\n\t\t}, 530);\n\t}\n\n\tthis.searchFocus = function() {\n\t\tp.search_paint();\n\t\tp.s_search = true;\n\t\tthis.reset_cursor_timer();\n\t\tp.search_paint();\n\t\tp.tree_paint();\n\t}\n\n\tthis.on_char = function(code, force) {\n\t\tvar text = String.fromCharCode(code);\n\t\tif (force) p.s_search = true;\n\t\tif (!p.s_search) return;\n\t\tp.s_cursor = false;\n\t\tp.pos = -1;\n\t\tswitch (code) {\n\t\t\tcase v.enter: if (p.s_txt.length < 3) break; var items = fb.CreateHandleList(); try {items = fb.GetQueryItems(lib_manager.list, p.s_txt)} catch (e) {} library_tree.load(items, false, false, false, library_tree.gen_pl, false); items.Dispose(); break;\n\t\t\tcase v.redo: lg.push(p.s_txt); if (lg.length > 30) lg.shift(); if (log.length > 0) {p.s_txt = log.pop() + \"\"; cx++} break;\n\t\t\tcase v.undo: log.push(p.s_txt); if (log.length > 30) lg.shift(); if (lg.length > 0) p.s_txt = lg.pop() + \"\"; break;\n\t\t\tcase v.selAll:\n\t\t\t\ts = 0; f = p.s_txt.length;\n\t\t\t\tbreak;\n\t\t\tcase v.copy: if (s != f) doc.parentWindow.clipboardData.setData('text', p.s_txt.substring(s, f)); break; case v.cut: if (s != f) doc.parentWindow.clipboardData.setData('text', p.s_txt.substring(s, f));\n\t\t\tcase v.back:\n\t\t\t\trecord();\n\t\t\t\tif (s == f) {if (cx > 0) {p.s_txt = p.s_txt.substr(0, cx - 1) + p.s_txt.substr(cx, p.s_txt.length - cx); if (offset > 0) offset--; cx--;}}\n\t\t\t\telse {if (f - s == p.s_txt.length) {p.s_txt = \"\"; cx = 0;} else {if (s > 0) {var st = s, en = f; s = Math.min(st, en); f = Math.max(st, en); p.s_txt = p.s_txt.substring(0, s) + p.s_txt.substring(f, p.s_txt.length); cx = s;} else {p.s_txt = p.s_txt.substring(f, p.s_txt.length); cx = s;}}}\n\t\t\t\tcalc_text(); offset = offset >= f - s ? offset - f + s : 0; s = cx; f = s; break;\n\t\t\tcase \"delete\":\n\t\t\t\trecord();\n\t\t\t\tif (s == f) {if (cx < p.s_txt.length) {p.s_txt = p.s_txt.substr(0, cx) + p.s_txt.substr(cx + 1, p.s_txt.length - cx - 1);}}\n\t\t\t\telse {if (f - s == p.s_txt.length) {p.s_txt = \"\"; cx = 0;} else {if (s > 0) {var st = s, en = f; s = Math.min(st, en); f = Math.max(st, en); p.s_txt = p.s_txt.substring(0, s) + p.s_txt.substring(f, p.s_txt.length); cx = s;} else {p.s_txt = p.s_txt.substring(f, p.s_txt.length); cx = s;}}}\n\t\t\t\tcalc_text(); offset = offset >= f - s ? offset - f + s : 0; s = cx; f = s; break;\n\t\t\tcase v.paste:\n\t\t\t\ttext = doc.parentWindow.clipboardData.getData('text');\n\t\t\t\t// fall through\n\t\t\tdefault:\n\t\t\t\trecord();\n\t\t\t\tif (s == f) {\n\t\t\t\t\tp.s_txt = p.s_txt.substring(0, cx) + text + p.s_txt.substring(cx); cx += text.length; f = s = cx;\n\t\t\t\t}\n\t\t\t\telse if (f > s) {\n\t\t\t\t\tp.s_txt = p.s_txt.substring(0, s) + text + p.s_txt.substring(f); calc_text(); offset = offset >= f - s ? offset - f + s : 0; cx = s + text.length;\n\t\t\t\t\ts = cx; f = s;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tp.s_txt = p.s_txt.substring(s) + text + p.s_txt.substring(0, f); calc_text(); offset = offset < f - s ? offset - f + s : 0; cx = f + text.length;\n\t\t\t\t\ts = cx; f = s;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tif (code == v.copy || code == v.selAll) return;\n\t\tif (!timer.search_cursor) timer.search_cursor = window.SetInterval(function() {p.s_cursor = !p.s_cursor; p.search_paint();}, 530);\n\t\tp.search_paint(); lib_manager.upd_search = true; timer.reset(timer.search, timer.searchi);\n\t\ttimer.search = window.SetTimeout(function() {\n\t\t\tlib_manager.time.Reset(); library_tree.subCounts.search = {};\n\t\t\tlib_manager.treeState(false, libraryProps.rememberTree);\n\t\t\tlib_manager.rootNodes();\n\t\t\t// p.setHeight(true);\n\t\t\tif (libraryProps.searchAutoExpand) {\n\t\t\t\tif (!library_tree.tree.length) return timer.search = false;\n\t\t\t\tvar count = 0, m = libraryProps.rootNode ? 1 : 0;\n\t\t\t\tfor (m; m < library_tree.tree.length; m++) count += library_tree.tree[m].item.length;\n\t\t\t\tif (count > expand_limit) return timer.search = false; var n = false;\n\t\t\t\tif (libraryProps.rootNode && library_tree.tree.length > 1) n = true;\n\t\t\t\tm = library_tree.tree.length;\n\t\t\t\twhile (m--) {\n\t\t\t\t\tlibrary_tree.expandNodes(library_tree.tree[m], !!libraryProps.rootNode && !m);\n\t\t\t\t\tif (n && m == 1) break;\n\t\t\t\t}\n\t\t\t\tif (libraryProps.rootNode && library_tree.tree.length == 1) library_tree.line_l = 0;\n\t\t\t\tsbar.set_rows(library_tree.tree.length); p.tree_paint(); lib_manager.treeState(false, libraryProps.rememberTree);\n\t\t\t}\n\t\t\ttimer.search = false;\n\t\t}, 160);\n\t}\n\n\tthis.on_key_down = function(vkey) {\n\t\tif (!p.s_search) return;\n\t\tswitch(vkey) {\n\t\t\tcase v.left:\n\t\t\tcase v.right:\n\t\t\t\tif (vkey == v.left) {\n\t\t\t\t\tif (offset > 0) {\n\t\t\t\t\t\tif (cx <= offset) {\n\t\t\t\t\t\t\toffset--;\n\t\t\t\t\t\t\tcx--;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcx--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (cx > 0) {\n\t\t\t\t\t\tcx--;\n\t\t\t\t\t}\n\t\t\t\t\ts = f = cx;\n\t\t\t\t}\n\t\t\t\tif (vkey == v.right && cx < p.s_txt.length)\n\t\t\t\t\tcx++;\n\t\t\t\ts = f = cx;\n\t\t\t\tif (shift) {\n\t\t\t\t\ts = Math.min(cx, shift_x);\n\t\t\t\t\tf = Math.max(cx, shift_x);\n\t\t\t\t}\n\t\t\t\tp.s_cursor = true;\n\t\t\t\ttimer.reset(timer.search_cursor, timer.search_cursori);\n\t\t\t\ttimer.search_cursor = window.SetInterval(function() {\n\t\t\t\t\tp.s_cursor = !p.s_cursor; p.search_paint();\n\t\t\t\t}, 530);\n\t\t\t\tbreak;\n\t\t\tcase v.home:\n\t\t\tcase v.end:\n\t\t\t\tif (vkey == v.home) offset = s = f = cx = 0; else s = f = cx = p.s_txt.length; p.s_cursor = true; timer.reset(timer.search_cursor, timer.search_cursori); timer.search_cursor = window.SetInterval(function() {p.s_cursor = !p.s_cursor; p.search_paint();}, 530);\n\t\t\t\tbreak;\n\t\t\tcase v.shift:\n\t\t\t\tshift = true;\n\t\t\t\tshift_x = cx;\n\t\t\t\tbreak;\n\t\t\tcase v.del:\n\t\t\t\tthis.on_char(\"delete\");\n\t\t\t\tbreak;\n\t\t}\n\t\tp.search_paint();\n\t}\n\n\tthis.draw = function(gr) {\n\t\ttry {\n\t\t\ts = Math.min(Math.max(s, 0), p.s_txt.length);\n\t\t\tf = Math.min(Math.max(f, 0), p.s_txt.length);\n\t\t\tcx = Math.min(Math.max(cx, 0), p.s_txt.length);\n\t\t\tif (ui.fill) gr.FillSolidRect(ui.x, ui.y + 1, ui.w, ui.row_h - 4, 0x60000000);\n\t\t\tif (ui.pen == 1) gr.DrawLine(ui.x + ui.margin, ui.y + p.s_sp, ui.x + p.s_w1, ui.y + p.s_sp, 1, ui.s_linecol);\n\t\t\tif (ui.pen == 2) gr.DrawRoundRect(ui.x, ui.y + 2, ui.w - 1, ui.row_h - 4, 4, 4, 1, ui.pen_c);\n\t\t\tif (p.s_txt) {\n\t\t\t\tf = (f < p.s_txt.length) ? f : p.s_txt.length;\n\t\t\t\tdrawsel(gr);\n\t\t\t\tget_offset(gr);\n\t\t\t\tvar txt_col = ui.searchcol;\n\t\t\t\tif (s === 0 && f === p.s_txt.length) {\n\t\t\t\t\ttxt_col = ui.textselcol;\n\t\t\t\t}\n\t\t\t\tgr.GdiDrawText(p.s_txt.substr(offset), ui.font, txt_col, p.s_x, p.s_y, p.s_w2, p.s_sp, p.l);\n\t\t\t} else {\n\t\t\t\tgr.GdiDrawText('Search', ui.s_font, ui.txt_box, p.s_x, p.s_y, p.s_w2, p.s_sp, p.l);\n\t\t\t}\n\t\t\tdrawcursor(gr);\n\t\t\tif (libraryProps.searchMode > 1) {\n\t\t\t\tvar l_x = p.filter_x1 - 9,\n\t\t\t\t\tl_y = p.s_y;\n\t\t\t\tgr.gdiDrawText(p.filt[p.filter_by].name, p.filter_font, ui.txt_box, p.filter_x1, ui.y, p.f_w[p.filter_by], p.s_sp, p.cc);\n\t\t\t\tgr.FillSolidRect(l_x, l_y, 1, p.s_sp, ui.s_linecol);\n\t\t\t}\n\t\t} catch (e) {}\n\t}\n}", "title": "" }, { "docid": "14fb65ed4afd17ae1e8d9928497c11db", "score": "0.54570335", "text": "function showRelatedKBs(blnIncludeDescription, blnDisplayResults, searchNumber) {\r\n\tvar title = $('input[name=\"Title\"]').val();\r\n\tvar description = $('textarea[name=\"Description\"]').val();\r\n\t\r\n\tif ( title.length < 1 && description.length < 1) {\r\n\t\treturn;\r\n\t}\r\n\tvar srch = title.toLowerCase();\r\n\tif (blnIncludeDescription) { \r\n\t\tsrch = srch + ' ' + description.toLowerCase();\r\n\t}\r\n\tif(srch.length < 2) {\r\n\t\treturn;\r\n\t}\r\n\t//list of common words, anything added to this list will be removed from the title\r\n\tvar common = \"the, of, to, and, a, in, is, it, you, that, he, was, for, on, are, with, as, I, his, they, be, at, one, have, this, from, or, had, by, hot, word, but, what, some, we, can, out, other, were, all, there, when, up, use, your, how, said, an, each, she, which, do, their, time, if, will, way, about, many, then, them, write, would, like, so, these, her, long, make, thing, see, him, two, has, look, more, day, could, go, come, did, number, sound, no, most, people, my, over, know, water, than, call, first, who, may, down, side, been, now, find, any, new, work, part, take, get, place, made, live, where, after, back, little, only, round, man, year, came, show, every, good, me, give, our, under, name, very, through, just, form, sentence, great, think, say, help, low, line, differ, turn, cause, much, mean, before, move, right, boy, old, too, same, tell, does, set, three, want, air, well, also, play, small, end, put, home, read, hand, port, large, spell, add, even, land, here, must, big, high, such, follow, act, why, ask, men, change, went, light, kind, off, need, house, picture, try, us, again, animal, point, mother, world, near, build, self, earth, father, head, stand, own, page, should, country, found, answer, school, grow, study, still, learn, plant, cover, food, sun, four, between, state, keep, eye, never, last, let, thought, city, tree, cross, farm, hard, start, might, story, saw, far, sea, draw, left, late, run, don't, while, press, close, night, real, life, few, north, open, seem, together, next, white, children, begin, got, walk, example, ease, paper, group, always, music, those, both, mark, often, letter, until, mile, river, car, feet, care, second, book, carry, took, science, eat, room, friend, began, idea, fish, mountain, stop, once, base, hear, horse, cut, sure, watch, color, face, wood, main, enough, plain, girl, usual, young, ready, above, ever, red, list, though, feel, talk, bird, soon, body, dog, family, direct, pose, leave, song, measure, door, product, black, short, numeral, class, wind, question, happen, complete, ship, area, half, rock, order, fire, south, problem, piece, told, knew, pass, since, top, whole, king, space, heard, best, hour, better, TRUE, during, hundred, five, remember, step, early, hold, west, ground, interest, reach, fast, verb, sing, listen, six, table, travel, less, morning, ten, simple, several, vowel, toward, war, lay, against, pattern, slow, center, love, person, money, serve, appear, road, map, rain, rule, govern, pull, cold, notice, voice, unit, power, town, fine, certain, fly, fall, lead, cry, dark, machine, note, wait, plan, figure, star, box, noun, field, rest, correct, able, pound, done, beauty, drive, stood, contain, front, teach, week, final, gave, green, oh, quick, develop, ocean, warm, free, minute, strong, special, mind, behind, clear, tail, produce, fact, street, inch, multiply, nothing, course, stay, wheel, full, force, blue, object, decide, surface, deep, moon, island, foot, system, busy, test, record, boat, common, gold, possible, plane, stead, dry, wonder, laugh, thousand, ago, ran, check, game, shape, equate, hot, miss, brought, heat, snow, tire, bring, yes, distant, fill, east, paint, language, among, grand, ball, yet, wave, drop, heart, am, present, heavy, dance, engine, position, arm, wide, sail, material, size, vary, settle, speak, weight, general, ice, matter, circle, pair, include, divide, syllable, felt, perhaps, pick, sudden, count, square, reason, length, represent, art, subject, region, energy, hunt, probable, bed, brother, egg, ride, cell, believe, fraction, forest, sit, race, window, store, summer, train, sleep, prove, lone, leg, exercise, wall, catch, mount, wish, sky, board, joy, winter, sat, written, wild, instrument, kept, glass, grass, cow, job, edge, sign, visit, past, soft, fun, bright, gas, weather, month, million, bear, finish, happy, hope, flower, clothe, strange, gone, jump, baby, eight, village, meet, root, buy, raise, solve, metal, whether, push, seven, paragraph, third, shall, held, hair, describe, cook, floor, either, result, burn, hill, safe, cat, century, consider, type, law, bit, coast, copy, phrase, silent, tall, sand, soil, roll, temperature, finger, industry, value, fight, lie, beat, excite, natural, view, sense, ear, else, quite, broke, case, middle, kill, son, lake, moment, scale, loud, spring, observe, child, straight, consonant, nation, dictionary, milk, speed, method, organ, pay, age, section, dress, cloud, surprise, quiet, stone, tiny, climb, cool, design, poor, lot, experiment, bottom, key, iron, single, stick, flat, twenty, skin, smile, crease, hole, trade, melody, trip, office, receive, row, mouth, exact, symbol, die, least, trouble, shout, except, wrote, seed, tone, join, suggest, clean, break, lady, yard, rise, bad, blow, oil, blood, touch, grew, cent, mix, team, wire, cost, lost, brown, wear, garden, equal, sent, choose, fell, fit, flow, fair, bank, collect, save, control, decimal, gentle, woman, captain, practice, separate, difficult, doctor, please, protect, noon, whose, locate, ring, character, insect, caught, period, indicate, radio, spoke, atom, human, history, effect, electric, expect, crop, modern, element, hit, student, corner, party, supply, bone, rail, imagine, provide, agree, thus, capital, won't, chair, danger, fruit, rich, thick, soldier, process, operate, guess, necessary, sharp, wing, create, neighbor, wash, bat, rather, crowd, corn, compare, poem, string, bell, depend, meat, rub, tube, famous, dollar, stream, fear, sight, thin, triangle, planet, hurry, chief, colony, clock, mine, tie, enter, major, fresh, search, send, yellow, gun, allow, print, dead, spot, desert, suit, current, lift, rose, continue, block, chart, hat, sell, success, company, subtract, event, particular, deal, swim, term, opposite, wife, shoe, shoulder, spread, arrange, camp, invent, cotton, born, determine, quart, nine, truck, noise, level, chance, gather, shop, stretch, throw, shine, property, column, molecule, select, wrong, gray, repeat, require, broad, prepare, salt, nose, plural, anger, claim, continent, oxygen, sugar, death, pretty, skill, women, season, solution, magnet, silver, thank, branch, match, suffix, especially, fig, afraid, huge, sister, steel, discuss, forward, similar, guide, experience, score, apple, bought, led, pitch, coat, mass, card, band, rope, slip, win, dream, evening, condition, feed, tool, total, basic, smell, valley, nor, double, seat, arrive, master, track, parent, shore, division, sheet, substance, favor, connect, post, spend, chord, fat, glad, original, share, station, dad, bread, charge, proper, bar, offer, segment, slave, duck, instant, market, degree, populate, chick, dear, enemy, reply, drink, occur, support, speech, nature, range, steam, motion, path, liquid, log, meant, quotient, teeth, shell, neck, display, uses, browse, allows, relevance, relevant, scroll, brings, looking, service, catalog, catalogue, into, synonyms, prefer, issue, based, smarter, not, user, click, startup, start-up, demo, remove, request, delete, modify, adjust, align, edit, assistance, working, item, i'm, it's, ok, because, onto\";\r\n\t//convert array of uncommon words to string for single search\r\n\tvar searchString = [];\r\n\t//this returns a clean array of uncommon words\t\r\n\tvar searchArray = getUncommon(srch, common);\r\n\t//Search Title or Title and Description against KB Articles\r\n\tfor(var i=0;i < searchArray.length; i++) { \r\n\t\tsearchString += searchArray[i] + \" \";\r\n\t}\r\n\t//make sure the search string grab didnt fail or the search string wasnt somehow empty\r\n\tif(searchString.length > 0) {\t\t\t\t\r\n\t\t//ajax call to the portal API\r\n\t\t$.ajax({\r\n\t\t\turl: \"/api/V3/ArticleList\",\r\n\t\t\tdata: {\r\n\t\t\t\tsearchText: searchString\r\n\t\t\t},\r\n\t\t\ttype: \"GET\", //this particular portal API call is a GET type\r\n\t\t\tsuccess: function (data) {\r\n\t\t\t\t// if data returns results, remove any non published items, then continue ( to check length again)\r\n\t\t\t\tfor (var i = data.length - 1; i > -1; i--) {\r\n\t\t\t\t\tif (data[i].Status.Id != '9508797e-0b7a-1d07-9fa3-587723f09908') {\r\n\t\t\t\t\t\tdata.splice(i,1);\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t\t//makes sure that the data array returned contains some results or it is ignored\r\n\t\t\t\tif (data.length > 0) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t//Currently we just grab the first result as the most popular one since popularity is not automatically calculated\r\n\t\t\t\t\tvar mostRelevent = 0;\r\n\t\t\t\t\t//Relevance Sorter Hashtable used to sort KB articles by most relevant.\r\n\t\t\t\t\tvar htKBRelevanceSorter = new Object ();\r\n\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\t\t\t\tvar relevence = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Compare Relevance Against Title and Description\r\n\t\t\t\t\t\tfor (var j = 0; j < searchArray.length; j++) {\r\n\t\t\t\t\t\t\tvar occured = occurrences(data[i].Title.toLowerCase(), searchArray[j])\r\n\t\t\t\t\t\t\trelevence += occured;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Sets array index element in hashtable, along with associated relevence.\r\n\t\t\t\t\t\thtKBRelevanceSorter[i] = relevence;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar notificationMsg = \"\";\r\n\t\t\t\t\tif (blnDisplayResults) {\r\n\t\t\t\t\t\t//Sort KBArticles by Relevance\r\n\t\t\t\t\t\tarrSortedKBs = getKeysSortedDescending(htKBRelevanceSorter);\r\n\t\t\t\t\t\t//Formulate alertify notification message.\r\n\t\t\t\t\t\tvar intKBLimit = 5;\r\n\t\t\t\t\t\tvar notificationMsg = notificationMsg + \"<b><span style=\\\"font-size: 15px; \\\">\";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (blnIncludeDescription) { \r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"Related Knowledge Article(s) - (Full)</span></b>\"; \r\n\t\t\t\t\t\t\tintKBLimit = 10;\r\n\t\t\t\t\t\t} else { \r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"Related Knowledge Article(s) - (Quick)</span></b>\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (arrSortedKBs.length > intKBLimit) {\r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"<br>The top '\" + intKBLimit + \"' related articles are listed below:\"\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"<br>Potentially related articles are listed below:\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnotificationMsg = notificationMsg + \"<br><br><ol type=\\\"1\\\" style=\\\"line-height: 1.2; text-indent: -4px;\\\">\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//this runs through the arrSortedKBs array and adds the first 5 returned results (or 10 results for comprehensive search) to the Related KBs table\r\n\t\t\t\t\t\tfor (var i = 0; i < arrSortedKBs.length && i < intKBLimit; i++) {\t\t\t\r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"<li><a style=\\\"color: white;margin-left:5px;\\\" href=\\\"/KnowledgeBase/View/\" + data[arrSortedKBs[i]].ArticleId + \"\\\" target=\\\"KB: \" + data[arrSortedKBs[i]].ArticleId + \"\\\"><u><b>KB\" + data[arrSortedKBs[i]].ArticleId + \"</b></u></a> - <i>\" + data[arrSortedKBs[i]].Title.substring(0,60) + \"</i>\";\r\n\t\t\t\t\t\t\tif (data[arrSortedKBs[i]].Title.length > 60) { notificationMsg = notificationMsg + \"...\"; }\r\n\t\t\t\t\t\t\tnotificationMsg = notificationMsg + \"</li>\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tnotificationMsg = notificationMsg + \"</ol>\";\r\n\t\t\t\t\t\tif (blnIncludeDescription == false) { notificationMsg = notificationMsg + \"<a class=\\\"rerunKBSearch\\\" style=\\\"color: white; cursor: pointer;\\\" onclick=\\\"showRelatedKBs(true, true)\\\"><u>Run Full Search</u></a> (Title & Description)\"; }\r\n\t\t\t\t\t\t//alert users of related KB articles\r\n\t\t\t\t\t\tif (oldKBToast != notificationMsg) {\r\n\t\t\t\t\t\t\tcurrKBAlerts = $('article.alertify-log.alertify-log-show span:contains(\"Related Knowledge Article(s)\")');\r\n\t\t\t\t\t\t\tfor( var i=0; i < currKBAlerts.length; i++) {$(currKBAlerts[i]).parent().parent().click();}\r\n\t\t\t\t\t\t\talertify.warning(notificationMsg, \"10\", 0);\r\n\t\t\t\t\t\t\toldKBToast = notificationMsg;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//Only Prompt, instead of displaying results.\r\n\t\t\t\t\t\tnotificationMsg = notificationMsg + \"Found '\" + data.length + \"' Related KB Articles (<a class=\\\"rerunKBSearch\\\" onclick=\\\"showRelatedKBs(false, true)\\\" style=\\\"cursor: pointer; color: lightGray;\\\"><u>view results</u></a>)\";\r\n\t\t\t\t\t\talertify.warning(notificationMsg);\r\n\t\t\t\t\t\toldKBToast = notificationMsg;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$('article.alertify-log.alertify-log-show span:contains(\"Related Knowledge Article(s)\")').parent().parent().click();\r\n\t\t\t\t\toldKBToast = notificationMsg;\r\n\t\t\t\t} // if (data.length > 0)\r\n\t\t\t} // ajax - success: function (data)\r\n\t\t}); // ajax\r\n\t} // if(searchString.length > 0)\r\n\r\n\t//This function cleans up the search string by comparing it against a list of common words and then return an array with uncommon words\r\n\tfunction getUncommon(sentence, common) {\r\n\t\tsentence = sentence.replace(\"/\",\" \").replace(\"\\\\\",\" \");\r\n\t\tsentence = sentence.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()]/g, \" \");\r\n\t\tsentence = sentence.replace(/(\\r\\n|\\n|\\r)/gm,\" \");\t\t\t\t\t\t\t\t\r\n\t\tsentence = sentence.replace(String.fromCharCode(8203),\" \");\r\n\t\t\r\n\t\tvar sentenceArray = sentence.split(' ');\r\n\t\tfor (var i = 0; i < sentenceArray.length; i++) {\r\n\t\t\tsentenceArray[i] = sentenceArray[i].trim();\r\n\t\t}\r\n\r\n\t\t//searches through each word in the search array and matches to common words\r\n\t\t//builds a new array that doesn't have the common words in it\r\n\t\tvar uncommonArray = [];\r\n\t\tfor (var i = 0; i < sentenceArray.length; i++) {\r\n\t\t\tif (common.indexOf(sentenceArray[i]) == -1) {\r\n\t\t\t\tuncommonArray.push(sentenceArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn uncommonArray;\r\n\t} // function getUncommon\r\n\t/*\r\n\t\tFunction count the occurrences of substring in a string;\r\n\t\t@param {String} string Required. The string;\r\n\t\t@param {String} subString Required. The string to search for;\r\n\t\t@param {Boolean} allowOverlapping Optional. Default: false;\r\n\t*/\r\n\tfunction occurrences(string, subString, allowOverlapping) {\t\t\t\t\r\n\t\tstring += \"\"; subString += \"\";\r\n\t\tif (subString.length <= 0) {\r\n\t\t\treturn string.length + 1;\r\n\t\t}\r\n\t\tvar n = 0, pos = 0;\r\n\t\tvar step = (allowOverlapping) ? (1) : (subString.length);\r\n\t\twhile (true) {\r\n\t\t\tpos = string.indexOf(subString, pos);\t\t\t\t\t\r\n\t\t\tif (pos >= 0) { n++; pos += step; } else break;\r\n\t\t}\t\t\t\t\r\n\t\treturn (n);\r\n\t} // function occurrences\r\n\t/* \r\n\t\tReturns keys of a hashtable, sorted by the value assigned. \r\n\t\tUsed to return KB articles in order of relavence.\r\n\t*/\r\n\tfunction getKeysSortedDescending(obj) {\r\n\t\tvar keys = []; for(var key in obj) keys.push(key);\r\n\t\treturn keys.sort(function(a,b){return obj[b]-obj[a]});\r\n\t} // function getKeysSortedDescending\r\n\t\r\n} // function showRelatedKBs", "title": "" }, { "docid": "c861941c9b6e434f61da1e197032a43e", "score": "0.5450819", "text": "function search(url) {\n\t\t\trequest({'uri':url,'headers':{'User-Agent':agents.randomAgentString()}},function(error,response,body){\n\t\t\t\t//code here has to discern whether this is an actual page or not, in addition to the url\n\t\t\t\tvar $ = cheerio.load(body);\n\t\t\t\tif ($('.mw-search-nonefound').length !== 0) {\n\t\t\t\t\t//none found, no search results! \n\t\t\t\t\tsocket.emit('none found',query);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tvar search_results = $('.mw-search-results li');\n\t\t\t\tif (search_results.length !== 0) {\n\t\t\t\t\t//search results exist! pick the first one that comes up\n\t\t\t\t\tvar new_query = 'http://en.wikipedia.org/wiki/Special:Search?search='+$('.mw-search-results li a').attr('href');+'&go=Go'\n\t\t\t\t\tconsole.log('searching new query',new_query);\n\t\t\t\t\tsearch(new_query);//ought to be correct now...\n\t\t\t\t}\n\t\t\t\t//send disambiguation pages as their own article of sorts.\n\t\t\t\tif ('#disambigbox') {\n\t\t\t\t\tvar article = parse_disambig_article($,response.request.uri.href);\n\t\t\t\t\tsocket.emit('article',article);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//otherwise, article is probably a perfect match\n\t\t\t\tvar article = parse_article($,response.request.uri.href);\n\t\t\t\tconsole.log(article.name);\n\t\t\t\tsocket.emit('article',article);//like the random article, send the whole thing.\n\t\t\t\treturn 1;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "b8e0af8107e67b5ee77ab372afe913be", "score": "0.5442128", "text": "function search() {\t\n\t/* Clear the previous search */\n\tremoveResults();\n\t\n\t/*set the number of pages to return*/\n\tpages = document.getElementsByName(\"pages\")[0].value;\n\tif (pages <=5 && pages >= 1) {\n\n\n\t makeRequest(pages);\n\n\t //eg request url: https://api.github.com/gists?page=2\n\n\t} else {\n\t\talert(\"Invalid number of pages (must be 1 through 5).\");\n\t}\n}", "title": "" }, { "docid": "86e01af0cc401140f994d80502b40ea9", "score": "0.5437677", "text": "function search(keyword){\n var list;\n if(keyword==null){\n list = random_cafe();\n return list;\n }\n //check match with hashtags\n list = hashtags_search(keyword);\n //if not match with hashtags, check match with cafes\n if(list==null){\n list = cafe_search(keyword);\n //if not match with cafes, return 8 random cafes\n if(list==null){\n list = random_cafe();\n }\n }\n return list;\n}", "title": "" }, { "docid": "b277495301a2c53b3ce6a9c54d4f746a", "score": "0.54285544", "text": "function movie() {\n\nvar omdb = require('omdb');\n \nomdb.search('saw', function(err, movies) {\n if(err) {\n return console.error(err);\n }\n \n if(movies.length < 1) {\n return console.log('No movies were found!');\n }\n \n movies.forEach(function(movie) {\n console.log('%s (%d)', movie.title, movie.year);\n });\n\n})\n}", "title": "" }, { "docid": "323a21590f962ff9167b0428b8f7284c", "score": "0.5422486", "text": "function search(){\n\n\tvar searchWord = searchBox.value.toLowerCase();\n\tconsole.log(searchWord);\n\tvar primaryHash = hash.getPrimaryHash(searchWord);\n\n\ttry{\n\t\tif(hash.secondaryKeys[primaryHash] == null){\n\t\t\tthrow 'Word Not Found';\n\t\t}\n\n\t\tvar a = hash.secondaryKeys[primaryHash][0];\n\t\tvar b = hash.secondaryKeys[primaryHash][1];\n\t\tvar m = hash.secondaryKeys[primaryHash][2];\n\n\t\tvar secondaryHash = hash.getSecondaryHash(a,b,m,searchWord);\n\n\t\tif(hash.hashTable[primaryHash][secondaryHash]!=null && dictionary.words[hash.hashTable[primaryHash][secondaryHash]].en == searchWord){\n\t\t\tinput.innerHTML = searchWord;\n\t\t\tresult.innerHTML = dictionary.words[hash.hashTable[primaryHash][secondaryHash]].bn;\n\t\t}\n\t\telse{\n\t\t\tthrow 'Word Not Found';\n\t\t}\n\t}catch(err){\n\t\tinput.innerHTML = searchWord;\n\t\tresult.innerHTML = \"Sorry, word not found :(\";\n\t}\t\n\t\n}", "title": "" }, { "docid": "b9db6d49576fd458d2ac7089c65ea2b8", "score": "0.54221493", "text": "genres() {\n let genreListGetter = /genre[\\s]*=[\\s]*(.*?(?:\\n\\|))/sm;\n\n //This is why safe navigation operators exist\n if (!\n (\n this.wikipage\n && this.wikipage.query\n && this.wikipage.query.pages\n && this.wikipage.query.pages[0]\n && this.wikipage.query.pages[0].revisions\n && this.wikipage.query.pages[0].revisions[0]\n && this.wikipage.query.pages[0].revisions[0].content\n )\n ) {\n return [];\n }\n\n let matches = this.wikipage.query.pages[0].revisions[0].content.match(genreListGetter);\n if (!matches || matches.length<2) {return []}\n let rawGenres = matches[1]\n let genreFinder = /\\[\\[([A-Za-z\\- ]+)\\]\\]|\\|([A-Za-z\\- ]+)\\]\\]/g;\n let genres = [];\n\n let match = genreFinder.exec(rawGenres);\n while (match != null) {\n if (match[1] !== undefined) {\n genres.push(toTitleCase(match[1]));\n } else {\n genres.push(toTitleCase(match[2]));\n }\n match = genreFinder.exec(rawGenres);\n }\n\n return genres;\n }", "title": "" }, { "docid": "354b23773e5ac086d9a49998c03515cb", "score": "0.54198253", "text": "function searchBook(){\n let search = document.querySelector(\".search-book\").value.toLocaleLowerCase()\n let allBooks = document.querySelectorAll(\"#all-books li p\")\n let booksArray = Array.from(allBooks)\n\n booksArray.forEach(function(book, index){\n if (book.innerText.toLocaleLowerCase().includes(search)){\n allBooks[index].parentElement.style.display = 'block';\n }else{\n allBooks[index].parentElement.style.display = 'none';\n }\n })\n}", "title": "" }, { "docid": "de5601f5037a3027fd1b7f0638d63912", "score": "0.5408331", "text": "function onSearchInput() {\n searchBibo = null;\n let search = document.querySelector('#search input').value.toUpperCase();\n let searchBox = document.getElementById('search-result');\n if (search) {\n let searchresults = []; //array mit den suchergebnissen\n let searchi = []; //array mit der stell in den bibodaten, war shcon spät, mir ist nichts besseres eingefallen\n [...document.getElementsByClassName(\"dela\")].map(n => n && n.remove());\n for (let i = 0; i < bibodaten.length; i++) {\n if ((bibodaten[i].name.toUpperCase().includes(search)) || (bibodaten[i].ort.toUpperCase().includes(search))) {\n searchresults.push(bibodaten[i]);\n searchi.push(i);\n }\n }\n if (searchresults.length > 0) searchBox.style.display = 'block';\n else searchBox.style.display = 'none';\n for (let b = 0; b < searchresults.length; b++) {\n if (b > 9) {\n break;\n }\n lia = document.createElement(\"a\");\n lia.className = \"dela\";\n lia.id = \"a\" + b;\n lia.setAttribute(\"onmousedown\", \"findLibrary('\" + searchi[b] + \"');\");\n lia.innerHTML = searchresults[b].name + \" \" + searchresults[b].ort;\n document.getElementById(\"search-result\").appendChild(lia);\n }\n } else {\n [...document.getElementsByClassName(\"dela\")].map(n => n && n.remove());\n searchBox.style.display = 'none';\n }\n refreshMarker();\n}", "title": "" }, { "docid": "1740d01300bbd1f104aed2678cca786b", "score": "0.53898036", "text": "findWordSearched(){\n}", "title": "" }, { "docid": "d5614405a0f012bd256bbec34622e281", "score": "0.53875536", "text": "function searchForBooks(term) {\n // TODO\n\n const apiurl = `https://www.googleapis.com/books/v1/volumes?q=${term}${apikey}`;\n\n return fetch(`${apiurl}`)\n .then(res => res.json())\n .catch(error => showError(error));\n}", "title": "" }, { "docid": "d16526555a022426d8841994aad6eea0", "score": "0.538525", "text": "async function SearchAuthors (title_search)\n{\n //process title search; trim extra spaces off, replace inner spaces with +\n title_search = title_search.trim();\n var search = title_search.split(\" \").join(\"+\");\n var authors = []; //authors array to keep track of repeated authors\n var searches = [];\n\n // fetch for title search\n await fetch(`http://openlibrary.org/search.json?title=${search}&limit=25`)\n .then(response => {\n //take response from fetch and turn to json\n return response.json();\n\n })\n .then(jsonResponse => {\n if (jsonResponse.docs) { //check that docs attr of json response exists\n // want to access data for each book result in json response\n jsonResponse.docs.forEach(async book => {\n\n // check that book author does not have repeat author results\n // only want to search each author once\n if (book.author_name && authors.includes(book.author_name[0]) === false) {\n // using author array, add name to array if name is not in array\n authors.push(\n book.author_name[0]\n );\n\n //process author search; replace inner spaces with +\n var author_search = book.author_name[0];\n author_search = author_search.split(\" \").join(\"+\");\n\n //fetch for author search\n await fetch(`http://openlibrary.org/search.json?author=${author_search}`)\n .then(response2 => {\n return response2.json();\n })\n .then(jsonResponse2 => {\n\n //check if json response of author search contains attr numFound\n if (jsonResponse2.numFound) {\n return jsonResponse2.numFound; //return promise of the # of books for author\n }\n })\n .then(numBooks => {\n\n //map each author search into a search object to be returned\n return search =\n {\n \"searchedBook\": title_search,\n \"author\": book.author_name[0],\n \"numBooks\": numBooks\n }\n })\n .then(search => {\n //add searches to search array\n searches.push(search);\n //order them based on numBooks\n searches.sort(function(a, b){\n return b.numBooks - a.numBooks;\n });\n //take the search promise and pass it into PrintArray\n printArray(writeString);\n })\n }\n })\n return searches;\n }\n })\n .catch(error => {\n //if receive error addHTML signifying no matches\n addHTML(`No matches found`);\n });\n /*\n function creates string with search information\n passes into it a callback function\n */\n function printArray(callback) {\n // searches.forEach(search => {\n // var string = `${search.author} wrote the book ${search.searchedBook} and ${search.numBooks} other books`;\n // callback(string);\n // })\n console.log(`${search.author} wrote the book ${search.searchedBook} and ${search.numBooks} other books`);\n var string = `${search.author} wrote the book ${search.searchedBook} and ${search.numBooks} other books`;\n callback(string);\n }\n\n /*\n function passes string the given addHTML function\n */\n function writeString(string) {\n addHTML(string);\n }\n\n\n}", "title": "" }, { "docid": "c0b4d3b01c4a683c8a8ce5c758dc052d", "score": "0.5384392", "text": "function searchSetup() {\n var url = document.location.href;\n var args;\n if (url.indexOf(\"WiSearch\") !== -1) {\n args = SEARCH_SEL.WiSearch;\n args.selectorClass = \".media\";\n } else if (url.indexOf(\"Search\") !== -1) {\n args = SEARCH_SEL.Search;\n args.selectorClass = \".agMovie\";\n }\n if (args === undefined) {\n return\n }\n return displaySearch(args)\n}", "title": "" }, { "docid": "b76a98fa20dda48df451ec582758b703", "score": "0.5384319", "text": "function masSearch() {\n const query = document.getElementById(\"title-busq\").textContent;\n doSearch(query);\n}", "title": "" }, { "docid": "a41cd73eec8b83c0f2e4711bbe73dd80", "score": "0.537934", "text": "function spotifySearch(song) {\n var song = process.argv.slice(3).join(\" \");\n //if the movie doesn't exist\n if (!song) {\n song = \"The Sign\";\n }\n spotifyAPI.search({ type: \"track\", query: song }, function(err, data) {\n if (err) {\n console.log(\"Error occurred: \" + err);\n return\n } else {\n console.log(\"Song Name: \" + \" \" + song);\n console.log(\"Artist Name: \" + data.tracks.items[0].album.artists[0].name);\n console.log(\"Album Name: \" + data.tracks.items[0].album.name);\n console.log(\n \"URL: \" + data.tracks.items[0].album.external_urls.spotify + \"\\n\"\n );\n }\n });\n}", "title": "" }, { "docid": "eccecce4c8a966930922a9796e8e49f9", "score": "0.5367984", "text": "function apiCallSearchPage(title, type, year, page) {\n var url = 'http://www.omdbapi.com/?s=' + title + '&y=' + year + '&type=' + type + '&tomatoes=true&plot=full&page=' + page;\n $.get(url, function (response) {\n displaySearchResults(response);\n });\n }", "title": "" }, { "docid": "1bd1233e1af87c51711e3411c903e188", "score": "0.5367527", "text": "function docsSearch(searchQ) {\n betaLog.write(searchQ, new Date().getTime());\n\n // preprocess query text for result sorting\n let cleanQuery = RiTa.stem(searchQ.toLowerCase());\n let queryArray = RiTa.tokenize(cleanQuery);\n\n let parsedStr = encodeURIComponent(cleanifyQuery(searchQ));\n\n searchResultsWrap.html(\"\");\n searchResultsWrap.html(`\n <div class=\"${b}__search-loading-bar\"></div>\n <div class=\"${b}__search-loading-bar\"></div>\n <div class=\"${b}__search-loading-bar\"></div>\n <div class=\"${b}__search-loading-bar\"></div>\n `);\n\n $(`${dotb}__recommended-articles`).css(\"display\", \"none\");\n $(`${dotb}__search-results-wrap`).css(\"display\", \"flex\");\n\n let urlParams = \"wp-json/flo_api/v1/search/\";\n let url = `${docsURL}${urlParams}?s=${parsedStr}&tags=${themeSlug},generic`;\n\n /* START: RENDERING SEARCH RESULTS LOGIC */\n fetch(url).then(response => {\n response.json().then(resultsJSON => {\n searchResultsWrap.fadeOut(\"400\", () => {\n searchResultsWrap.html(\"\");\n\n if (resultsJSON.length) {\n // declare 5 empty arrays that will hold the results based on relevance score\n let [first, second, third, fourth, fifth] = [[], [], [], [], []];\n\n resultsJSON.forEach((result, index) => {\n /* count relevance score for each article\n We will try to mimic the \"orderby=relevance\" method that WordPress does via get_posts or WP_Query: https://core.trac.wordpress.org/ticket/7394#comment:72\n 1 is the highest value and 5 is the lowest:\n 1 - Full sentence matches in post titles\n 2 - All search terms in post titles\n 3 - Any search terms in post titles\n 4 - Full sentence matches in post content or \"acf sections\" content\n 5 - Each section and any remaining posts are then sorted by date\n for posts that have a relevance score of \"5\" we will sort by the amount of times each query term occurs in the post content or \"acf sections\" content\n */\n\n let postTitle = result.post_title;\n let postContent = result.text_content;\n let postSections = result.acf.sections;\n let postSectionsContent = \"\";\n\n // if post has acf sections, merge the sections content in the postContent variable\n if (postSections && postSections.length) {\n postSections.forEach((section, index) => {\n if (section.content && section.content.length) {\n postSectionsContent += section.content;\n }\n });\n postContent += postSectionsContent;\n }\n\n let postContentPlainText = textify(postContent);\n\n let postExcerpt =\n postContentPlainText.length > 150\n ? postContentPlainText.slice(0, 150) + \"...\"\n : postContentPlainText;\n result.excerpt = textify(postExcerpt);\n\n // preprocess post title for determining relevance scores (2, 3)\n let postTitleStemmed = RiTa.stem(postTitle);\n let postTitleStemmedTokens = tokenize(\n cleanifyQuery(postTitleStemmed).toLowerCase()\n );\n\n function keyIsInString(currentValue) {\n return postTitleStemmed.toLowerCase().includes(currentValue);\n }\n\n setTimeout(function() {\n if (postTitle.toLowerCase().includes(searchQ.toLowerCase())) {\n result.relevance_score = 1;\n first.push(result);\n } else if (queryArray.every(keyIsInString)) {\n result.relevance_score = 2;\n second.push(result);\n } else if (\n tokenize(cleanifyQuery(cleanQuery)).some(substring =>\n cleanifyQuery(postTitleStemmed)\n .toLowerCase()\n .includes(substring)\n )\n ) {\n // count the post title words: how many times these match the query words (repeating increases count as well)\n result.relevance_score = 3;\n result.titleMatchCount = compareTwoTexts(\n tokenize(cleanifyQuery(cleanQuery)),\n postTitleStemmedTokens\n );\n third.push(result);\n } else if (\n RiTa.stem(postContentPlainText.toLowerCase()).includes(\n cleanifyQuery(cleanQuery.toLowerCase())\n )\n ) {\n result.relevance_score = 4;\n fourth.push(result);\n } else {\n // relevance score 5, count how many times each word from the post content occurs in the query\n let wordCount = countWords(\n postContentPlainText.toLowerCase(),\n tokenize(cleanifyQuery(searchQ).toLowerCase())\n );\n let wordCountSum = 0;\n Object.values(wordCount).forEach(wordCountValue => {\n wordCountSum += wordCountValue;\n });\n let wordCountMean =\n wordCountSum / Object.values(wordCount).length;\n let num = Number(wordCountMean); // The Number() only visualizes the type and is not needed\n let roundString = num.toFixed(2); // toFixed() returns a string (often suitable for printing already)\n let roundWordCountMean = Number(roundString);\n\n result.word_count = {\n words: wordCount,\n wordCountScore: roundWordCountMean\n };\n\n fifth.push(result);\n }\n });\n });\n\n // console.log({first, second, third, fourth, fifth});\n setTimeout(function() {\n // for results that have a relevance score of 3 sort them by titleMatchCount\n third.sort((a, b) => {\n return b.titleMatchCount - a.titleMatchCount;\n });\n\n // for results that have a relevance score of 5 sort them by (mean word count - wordcount sum divided by amount of words)\n fifth.sort(function(a, b) {\n return (\n b.word_count.wordCountScore - a.word_count.wordCountScore\n );\n });\n\n let sortedResultsJSON = first.concat(\n second,\n third,\n fourth,\n fifth\n );\n\n searchResultsWrap.append(`\n <span class=\"${b}__search-results-info\">\n Showing ${sortedResultsJSON.length} results\n </span>\n `);\n\n sortedResultsJSON.forEach(result => {\n // let wordCountConditionalInfo = `\n // <span>Relevance Score: ${result.relevance_score}</span>\n // `;\n //\n // if(result.titleMatchCount)\n // wordCountConditionalInfo += `\n // <span>Word matches in title: ${result.titleMatchCount}</span>\n // `;\n //\n // if(result.word_count)\n // wordCountConditionalInfo += `\n // <span>${JSON.stringify(result.word_count.words)}</span>\n // <span>Mean Value: ${result.word_count.wordCountScore}</span>\n // `;\n //\n // let wordCountData = `\n // <span class=\"${b}__wordcount-data-wrap\">\n // <i class=\"dashicons dashicons-info\"></i>\n // <div class=\"${b}__wordcount-info\">\n // ${wordCountConditionalInfo}\n // </div>\n // </span>\n // `;\n\n let itemUrl = docsURL + themeSlug + \"/#\" + result.slug;\n\n let searchResultExcerptWrap =\n result.excerpt.length > 0\n ? `<p class=\"${b}__search-result-excerpt\">${\n result.excerpt\n }</p>`\n : \"\";\n\n searchResultsWrap.append(`\n <div class=\"${b}__search-result\">\n <a href=\"${itemUrl}\" target=\"_blank\">\n <span class=\"${b}__search-result-post-title\">${\n result.post_title\n }</span>\n ${searchResultExcerptWrap}\n <i class=\"${b}-icon-arrow-right ${b}__search-result-item-icon\"></i>\n </a>\n </div>\n `);\n });\n\n let searchResultLink = $(`${dotb}__search-result > a`);\n searchResultLink.on(\"click\", function(event) {\n event.preventDefault();\n let targetIndex = $(event.target)\n .parents(`${dotb}__search-result`)\n .index();\n let articleToRender = sortedResultsJSON[targetIndex - 1];\n renderArticle(articleToRender, true);\n });\n });\n } else {\n searchResultsWrap.html(\"<h4>No results found</h4>\");\n }\n\n searchResultsWrap.fadeIn(\"400\");\n });\n });\n });\n /* END: RENDERING SEARCH RESULTS LOGIC */\n }", "title": "" }, { "docid": "6fa23ab7867965f373d3594676c9d67d", "score": "0.53666353", "text": "function search(response, request)\n{\n\tconsole.log('/search');\n var requestBody = \"\";\n\tvar displaySong = \"\";\n\n request.on('data',function (data)\n\t{\n requestBody += data;\n });\n\n request.on('end', function (data)\n\t{\n\t docs = {};\n var postData = querystring.parse(requestBody);\n var searchTerm = postData.search_text;\n\t\tvar subsST = searchTerm.split(\" \");\n\t\tvar arr = new Array();\n\t\tfor(var j=0;j<subsST.length; j++)\n\t\t{\n\t\t arr[j] = {title: new RegExp(subsST[j], 'i')};\n\t\t}\n\t\tvar count = 0;\n\t\tvar count2 = 0;\n\n mc.connect(\"mongodb://localhost:27017/\", function(err, db)\n\t\t{\n if(err) console.log('FAILED TO CONNECT TO DATABASE');\n else\n\t\t\t{\n\t\t\t\tvar myDB = db.db(\"iRealSongs\");\n\t\t\t\tconsole.log('CONNECTED TO DATABASE');\n\t\t\t\tmyDB.collection(\"songs\", function(err, collection)\n\t\t\t\t{\n\t\t\t\t\tvar cursor = collection.find({$and: arr});\n\t\t\t\t\tcursor.each(function(err,document)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(document != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplaySong = document;\n\t\t\t\t\t\t\tdocs[displaySong.title] = displaySong;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar body = '<html>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<head>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<script>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'function setTitle(ti){document.getElementById(\"cL\").value = ti; document.linkForm.submit();}' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'</script>'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<title>iRealBook</title>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<link href=\"styles/flatnav.css\" rel=\"stylesheet\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<meta name=\"robots\" content=\"noindex,follow\" />' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'</head>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<body>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t '<center>'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<ul class=\"nav\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li id=\"Settings\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<a href=\"#\"><img src=\"images/settings.png\" /></a>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<a href=\"start\">iRealBook Home</a>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<a href=\"#\">Shuffle</a>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li id=\"search song\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<form name=\"actionForm\" action=\"/search\" method=\"post\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<input type=\"text\" name=\"search_text\" id=\"search_text\" placeholder=\"Search\"/>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<input type=\"button\" name=\"search_button\" id=\"search_button\" onClick=\"document.actionForm.submit()\"></a>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</form>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li id=\"options\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<a href=\"#\">Options</a>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<ul class=\"subnav\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li><a href=\"uploadPage\">upload</a></li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li><a href=\"#\">EditSong</a></li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li><a href=\"view\">RecentUpload</a></li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<li><a href=\"#\">Options</a></li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</ul>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '</li>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</ul>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</center>'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t '<form name=\"linkForm\" action=\"/songInfo\" method=\"post\">'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<input type=\"hidden\" id=\"cL\" name=\"cL\" value=\"\">'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<center><br><table>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in docs)\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\tif(count2 >= 12){break;}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbody+= '<tr><td><a href=\"javascript:setTitle(\\''+docs[k].title+'\\');\">'+docs[k].title+'</a></td></tr>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount2++;\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\tbody+= '</table>'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</center>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'</form>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<script src=\"script/prefixfree-1.0.7.js\" type=\"text/javascript\"></script>' +\n\t\t\t\t\t\t\t\t\t\t\t\t'</body>' +\n\t\t\t\t\t\t\t\t\t\t\t\t'</html>';\n\t\t\t\t\t\t\tresponse.writeHead(200, {'Content-Type': 'text/html'});\n\t\t\t\t\t\t\tresponse.write(body);\n\t\t\t\t\t\t\tresponse.end();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n });\n });\n}", "title": "" }, { "docid": "f15a5b874c8bfc5dade3723fd67ef0fc", "score": "0.53661203", "text": "function omdbSearch(urlRef){\n\n request(urlRef, function (error, response, body) {\n\n if(!error && response.statusCode === 200){\n \n console.log('######################################################');\n console.log('#');\n console.log('# ' + JSON.parse(body).Title);\n console.log('#');\n console.log('######################################################');\n console.log('');\n\n console.log('Release Year: ' + JSON.parse(body).Year);\n\n if(JSON.parse(body).Ratings[0].Value){\n console.log('IMDB rating: ' + JSON.parse(body).Ratings[0].Value);\n };\n\n if(JSON.parse(body).Ratings[1].Value){\n console.log('Rotten Tomatoes rating: ' + JSON.parse(body).Ratings[1].Value);\n };\n \n console.log('Produced in: ' +JSON.parse(body).Country);\n console.log('Language: ' + JSON.parse(body).Language);\n console.log('Plot: ' + JSON.parse(body).Plot);\n console.log('Actors: ' + JSON.parse(body).Actors);\n console.log('');\n console.log('######################################################');\n }\n\n if (error || response.statusCode === 400){\n console.log('Whoops, I had an error. Please try again.');\n }\n\n\n });\n}", "title": "" }, { "docid": "ad5fd87b05438751816fd60a3c31e0b3", "score": "0.5361512", "text": "runSearch(state) {\n let url = getBuildingQueryUrl(state, selectFields);\n if (this.props.admin) {\n url += '&creator=true';\n }\n // add search terms (if any)\n const textSearch = document.querySelector('.building-search').value;\n if (textSearch) url += `fulltext=${encodeURIComponent(textSearch)}`;\n api.get(url, this.processBuildings);\n }", "title": "" }, { "docid": "48a7cc22a4fba5225dfde5090a9e6396", "score": "0.53553545", "text": "function nct_versearch(pobject)\n{\n\tif(pobject.value.length > 3)\n\t\tnct_searchest();\n}", "title": "" }, { "docid": "715a6454591d2f13bcfb865a67160c21", "score": "0.53548956", "text": "function searchShows() {\r\n fetch(`//api.tvmaze.com/search/shows?q=${search}`)\r\n .then((response) => {\r\n if (!response.ok) {\r\n throw response;\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n if (data.length === 0) {\r\n notFound();\r\n } else {\r\n for (let i = 0; i < data.length; i++) {\r\n searchedShows.push(data[i].show);\r\n }\r\n paintShows();\r\n listenSearch();\r\n }\r\n })\r\n .catch((err) => {\r\n serverError(err);\r\n });\r\n}", "title": "" }, { "docid": "f214bc110f8228713528861d0589ecb0", "score": "0.5354411", "text": "function soundCloudSearch() {\n // Should not be public, but for this website, oh well\n // If we wanted to hide it, we would have done it on server side and hidden it\n SC.initialize({\n client_id: 'bd791d329c430374438075140d3d3163'\n });\n soundCloudMakeRequest();\n}", "title": "" }, { "docid": "5eb1a8ec311bbd33b54d422bf7c9d01c", "score": "0.53518075", "text": "function doTheSearch() {\n // $('.random').css('display','none');\n $('form').addClass('compact');\n\n var lang = navigator.language.substring(0,2) || \"en\";\n var searchTerm = $('input').val();\n var url = 'https://' + lang + '.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srsearch=' + searchTerm + '&srwhat=text&srinfo=totalhits&srprop=titlesnippet%7Csnippet';\n // empty the page before loading new result\n $('div.results').empty();\n\n // loading jsonp\n $.ajax({\n url:url,\n dataType: \"jsonp\",\n success: function(wikiData) {\n\n if ($('input').val() != '') {\n $('.border').addClass('grow');\n // if loading json successfully, do this:\n var totalHits = wikiData.query.searchinfo.totalhits;\n\n if (totalHits === 0) {\n // if there's no result matched, do this\n // $('form').removeClass('compact');\n $('.border').removeClass('grow');\n $('div.results').addClass('error').html(\"There's no match for \" + searchTerm);\n } else {\n // if there is result, do this\n displayAsHtml(wikiData);\n }\n }\n },\n error: function() {\n // if cannot load json, do this\n alert (\"There's a problem connecting to the server. Please refresh the page and try again.\");\n }\n });\n\n function displayAsHtml(wikiData) {\n /* run each value in the query 'wikiData.query.search'\n i is for index of each object inside 'wikiData.query.search'\n val is the content inside each object 'wikiData.query.search'\n */\n $.each(wikiData.query.search, function(i, val){\n // replace space with _\n\n var url = val.title.replace(/\\s/g, \"_\");\n if ($('div.results').hasClass('error')) {\n $('div.results').removeClass('error');\n }\n $('div.results').append(\n\n '<a class=\"item\" href=\"https://en.wikipedia.org/wiki/' + url + '\" target=\"_blank\">' +\n '<span class=\"title\">' + val.title + '</span>' +\n '<span class=\"desc\">' + val.snippet + '</span>' +\n '</a>'\n\n );\n\n })\n }\n}", "title": "" }, { "docid": "adc9ff285fca3fc22c6ddea19f5d72a0", "score": "0.5342653", "text": "async function getCourses() {\n const pageNumber = 1;\n const pageSize = 10;\n // /api/courses?pageNumber-2&pageSize=10\n const courses = await Course\n // .find({ author: 'Mosh', isPublished: true})\n // .find({ price: { $gte: 10, $lte: 20 } })\n // .find(({ price: { $in: [10, 15, 20] } }))\n .find({author: /^Mosh/}) // start with\n .find({author: /Hamedani$/i}) // end with, i => case insensive\n .find({author: /.*Mosh.*/i}) // include\n .skip((pageNumber - 1) * pageSize)\n .limit(pageSize)\n .or([ { author:'Mosh'}, {isPublished: true} ]) // !! either one of these match \n .sort({ name: 1 })\n .select({ name: 1, tags: 1})\n // .countDocuments()\n console.log(courses);\n \n}", "title": "" }, { "docid": "bbf71a2a1453b95f75c62e3b6358f5d1", "score": "0.5338899", "text": "function searchOnText(books, searchText) {\n let searchedBooks = [];\n searchText = searchText.toLowerCase();\n for (let b of books) {\n if (b.title.toLowerCase().indexOf(searchText) != -1) {\n searchedBooks.push(b);\n continue;\n }\n if (b.author.toLowerCase().indexOf(searchText) != -1) {\n searchedBooks.push(b);\n continue;\n }\n if (b.details.toLowerCase().indexOf(searchText) != -1) {\n searchedBooks.push(b);\n continue;\n }\n }\n console.log(\"searchedBooks \" + searchedBooks);\n return searchedBooks;\n}", "title": "" }, { "docid": "5eebd2ad574974f770ac1535a6763faa", "score": "0.5335644", "text": "function C009_Library_Search_SearchO() {\n\tif (!C009_Library_Search_BondageClubInvitationTaken) {\n\t\tC009_Library_Search_CurrentStage = 101;\n\t\tOverridenIntroText = GetText(\"FindO\");\n\t}\n}", "title": "" }, { "docid": "f80f36c938cc7a16916de27c19d6a56c", "score": "0.53323567", "text": "function getArticle(value){\n var url = \"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + value + \"&prop=revisions&rvprop=content&format=json\";\n $.get(url,function(json){\n if (json.query.searchinfo.totalhits=== 0){\n html = '<div class=\"articles\"><a href=\"#\"><p>Wikipedia does not understand your search term.<p>Please enter a meaningful search term</a></div>';\n $(\".results\").append(html); \n }/*checks if results are more than 1*/\n \n else{\n var results = json.query.search;\n \n/*loop to display results one by one*/ \n for (var result=0; result < results.length;result++){\n \n if (result > 10){break;}/*displays only 10 results*/\n html = '<div \" class=\"articles\"><a href=\"https://en.wikipedia.org/wiki/' + results[result].title + '\"target=\"_blank\"><h3>' + results[result].title + '</h3><p>' + results[result].snippet + '...</p></a></div>';\n \n$(\".results\").append(html);}\n\n }/*end of if-block*/\n }, 'jsonp');}", "title": "" }, { "docid": "78acf91ee13605d77c64d45be7e46440", "score": "0.5329016", "text": "function searchWikipedia(text, callback) {\n\n var endpoint = 'https://en.wikipedia.org/w/api.php?callback=?'\n //object with wikipedia query items.\n var query = {\n action: 'query',\n format: 'json',\n list: 'search',\n generator: 'search',\n srsearch: text,\n gsrsearch: text\n }\n // AJAX call to fetch data from wikipedia\n $.getJSON(endpoint, query, callback)\n}", "title": "" }, { "docid": "b7bfb5ca4c96c666dc860ed6d0615f1b", "score": "0.5328839", "text": "function highlightSearch(page, title, description, keywords) {\n var regex, desc = \"\", matchKey, currPos, repKey;\n frame = '<a href=\"'+ page +'\"><h4><span class=\"label label-info frmSrchBg\">'+ title +'</span></h4></a>';\n for(var src in keywords){\n regex = new RegExp(keywords[src], \"ig\");\n matchKey = description.match(regex);\n if(matchKey !== null){\n for(var i in matchKey) {\n currPos = description.search(matchKey[i]);\n repKey = '<i>'+description.substr(currPos, matchKey[i].length)+'</i>';\n if(desc == \"\")\n desc = description.replace(matchKey[i], repKey);\n else\n desc = desc.replace(new RegExp(matchKey[i], \"g\"), repKey);\n }\n }\n }\n frame += '<p class=\"well well-xs\">'+desc+'</p>';\n\treturn frame;\n}", "title": "" }, { "docid": "546645e9b2a9820f60b28121a763c320", "score": "0.53255075", "text": "function search(req, res) {\n\tlet url = omdbUrl + \"&s=\" + req.query.title;\n\trequest(url, function(err, response, body) {\n\t let movies = JSON.parse(body).Search;\n\t if(!movies) {\n\t \tres.json({message: 'No results found'});\n\t } else {\n\t \tres.json(movies);\n\t }\n\t})\n}", "title": "" }, { "docid": "5368f6416e5733663e6004cf579a6a14", "score": "0.53208697", "text": "function searchAlgolia() {\n const searchValue = searchInput.value.trim();\n if (searchValue.length > 0) {\n document.querySelector('.search-result').style.display = 'block';\n } else {\n emptySearch();\n return;\n }\n\n let perPageCount = 8;\n if (document.querySelector('body').classList.contains('td-searchpage')) {\n perPageCount = 10;\n }\n\n const client = algoliasearch('UMBCUJCBE8', 'e2f160cd7efe96b0ada15fd27f297d66');\n const index = client.initIndex('yugabyte_docs');\n const pageItems = searchURLParameter('page');\n const searchpagerparent = document.querySelector('#pagination-docs');\n const searchOptions = {\n hitsPerPage: perPageCount,\n page: 0,\n filters: 'version:\"preview\"',\n };\n\n if (pageItems && pageItems > 0) {\n searchOptions.page = pageItems - 1;\n }\n\n index.search(searchValue, searchOptions).then(({hits, nbHits, nbPages, page}) => {\n let pagerDetails = {};\n let sectionHTML = '';\n sectionHTML += docsSection(hits);\n if (hits.length > 0) {\n document.getElementById('doc-hit').innerHTML = sectionHTML;\n } else {\n document.getElementById('doc-hit').innerHTML = '<li class=\"no-result\">0 results found for <b>\"' + searchValue + '\"</b></li>';\n }\n\n if (document.querySelector('body').classList.contains('td-searchpage')) {\n pagerDetails = {\n currentPage: page + 1,\n pagerId: 'pagination-docs',\n pagerType: 'docs',\n totalHits: nbHits,\n totalPages: nbPages,\n };\n\n searchPagination(pagerDetails);\n searchpagerparent.className = 'pager results-' + nbHits;\n } else {\n searchpagerparent.className = 'pager results-' + nbHits;\n let viewAll = '';\n if (nbPages > 1) {\n viewAll = '<a href=\"/search/?query=' + searchValue + '\" title=\"View all results\">View all results</a>';\n }\n\n document.getElementById('pagination-docs').innerHTML = '<nav class=\"pager-area\">' +\n '<div class=\"pager-area\">' +\n '<span class=\"total-result\">' + nbHits + ' Results</span>' +\n '</div>' +\n viewAll +\n '</nav>';\n }\n });\n }", "title": "" }, { "docid": "573440eba09bce0e6ced6837849ed058", "score": "0.5320557", "text": "function searchWikiClick(){\n\tif (document.getElementById('searchBox').value!==\"\") {\n\t\tvar search_words = document.getElementById('searchBox').value;\n\t\t//console.log('The search word(s): ' + search_words); // for debugging\n \n if (search_words!==\"\") {\n // search for the search_words\n searchWiki('en.wikipedia.org', search_words, {\n maxResults: 8,\n ssl: true,\n success: successFunction\n });\n }\n\t}\n}", "title": "" }, { "docid": "91e4ec3e6faee4a7aab792ed203dbdef", "score": "0.53205127", "text": "function grabSearchText(){\n searchTerms = searchBox.value.split(' ').join('%20');\n let bookArr = document.querySelectorAll('.book');\n bookArr.forEach(book => resultShelf.removeChild(book));\n}", "title": "" }, { "docid": "4419184eda0880f4f5daa63af8a10165", "score": "0.53203017", "text": "function C009_Library_Search_Run() {\n\tBuildInteraction(C009_Library_Search_CurrentStage);\n}", "title": "" }, { "docid": "a830b088b13e8f2fc53772f246867b33", "score": "0.53200364", "text": "function doSearchCreator() { doSearch('creatordesc'); }", "title": "" }, { "docid": "34a66e294fcb8701ed6551197c475b85", "score": "0.5317199", "text": "function whatItSays(search) {\n // read .txt file and set the parameter to input to the spotify API\n fs.readFile('random.txt', 'utf8', function(error, data) {\n if ( error ) {\n return console.log(error)\n }\n let arg = data.split(',')[1]\n song(arg)\n })\n}", "title": "" }, { "docid": "bab0d8ecb2f3dc5856fd3af07bb468d5", "score": "0.5316222", "text": "function C009_Library_Search_SearchDesk() {\n\tif (!C009_Library_Library_FoundKey) {\n\t\tC009_Library_Library_FoundKey = true;\n\t\tOverridenIntroText = GetText(\"FindKey\");\n\t}\n}", "title": "" }, { "docid": "214f6240687b15f86d7c924b0ec512c7", "score": "0.53129977", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCR5In4DZaTP6IEZQ0r1JceuvluJRzQNLE');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "2822c12095128adac39b24103c606a2c", "score": "0.5311583", "text": "function search(keyword) {\n if (keyword.length > 0) {\n $(\"#suggestedBookList .book\").hide();\n $(\"#suggestedBookList .book:contains(\" + keyword + \")\").show();\n } else\n $(\"#suggestedBookList .book\").show();\n}", "title": "" }, { "docid": "352e32b937fa3fb526c8f0f287d29c50", "score": "0.5311416", "text": "function search() {\n let searchWords = document.getElementById('search-box').value;\n if (searchWords.trim().length == 0) return;\n let url = '/search/' + searchWords;\n request('GET', url, function () {\n if (this.readyState == 4 && this.status == 200) {\n let response = JSON.parse(this.responseText);\n document.getElementById('main-container').innerHTML = response.body;\n document.title = response.title;\n }\n });\n }", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5307896", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5307896", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5307896", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5307896", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "14e97fa4e3c6e91b2db439324c98c2b2", "score": "0.5307799", "text": "function booksByTitle(searchTerm) { \n let encodedSearchTerm = encodeURIComponent(searchTerm);\n let searchUrl = 'https://infinite-river-85875.herokuapp.com/getbooks/byTitle/' + encodedSearchTerm; \n $.getJSON(searchUrl, function (response) {\n let searchedBooksInLibrary = response.map((item, response) => drawSearchRow(item));\n });\n}", "title": "" }, { "docid": "38ccc01487449abf5f9eb43e9e0b9af8", "score": "0.53055143", "text": "function demoDiseasePage(disease_id) {\n\n var e = new bbop.monarch.Engine();\n var info = e.fetchDiseaseInfo(disease_id); \n\n var synBlock = '';\n if (info.has_exact_synonym != null) {\n synBlock = info.has_exact_synonym.map( function(s) {return <li><span>{s}</span></li> } ).join(\"\\n\");\n }\n\n textDescription = function() {\n var content = <></>;\n if (info.comments != null && info.comments[0] != null) {\n content += <span>{info.comments[0]}</span>;\n }\n return content; \n };\n\n liSynonyms = function() {\n var content = <></>;\n if (info.has_exact_synonym != null) {\n for each (var s in info.has_exact_synonym) {\n content += <li>{s}</li>;\n }\n }\n return content; \n };\n\n trPhenotypes = function() {\n var content = <></>;\n if (info.phenotype_associations != null) {\n content += spanJSON(info.ohenotype_associations);\n for each (var a in info.phenotype_associations) {\n content += \n <tr>\n <td>{a.disease.id}</td>\n <td>{a.disease.label}</td>\n <td>{a.onset}</td>\n <td>{a.frequency}</td>\n <td>{a.phenotype.id}</td>\n <td>{a.phenotype.label}</td>\n <td>SOURCE: {a.source}</td>\n </tr>;\n }\n }\n return content; \n };\n\n trGenes = function() {\n var content = <></>;\n if (info.gene_associations != null) {\n content += spanJSON(info.gene_associations);\n for each (var a in info.gene_associations) {\n content += \n <tr>\n <td>{a.disease.id}</td>\n <td>{a.disease.label}</td>\n <td>{a.inheritance}</td>\n <td>{a.gene.id}</td>\n <td>{a.gene.label}</td>\n <td>SOURCE: {a.source}</td>\n </tr>;\n }\n }\n return content; \n };\n\n trAlleles = function() {\n var content = <></>;\n if (info.alleles != null) {\n content += spanJSON(info.alleles);\n for each (var a in info.alleles) {\n content += \n <tr>\n <td>{a.disease.id}</td>\n <td>{a.disease.label}</td>\n <td>{a.allele.id}</td>\n <td>{a.allele.link}</td>\n <td>{a.allele.mutation}</td>\n <td>{a.allele.label}</td>\n <td>SOURCE: {a.source}</td>\n </tr>;\n }\n }\n return content; \n };\n\n trModels = function() {\n var content = <></>;\n if (info.models != null) {\n content += spanJSON(info.models);\n for each (var a in info.models) {\n content += \n <tr>\n <td>{a.disease.id}</td>\n <td>{a.disease.label}</td>\n <td>{a.type.label}</td>\n <td>{a.model.id}</td>\n <td>{a.model.label}</td>\n <td>{a.model.type.label} / {a.model.type.parent}</td>\n <td>{a.model.taxon.label}</td>\n <td>SOURCE: {a.source}</td>\n </tr>;\n }\n }\n return content; \n };\n\n // add json blob for debugging purposes\n spanJSON = function(obj) {\n var s = JSON.stringify(obj);\n return <span><span meta=\"json blob used to make table\" style=\"display: none\">{s}</span></span>;\n }\n\n \n var html =\n<html>\n <head>\n <link href=\"http://faculty.dbmi.pitt.edu/harryh/monarch/pages/styles/pages.css\" rel=\"Stylesheet\" media=\"screen\"\n type=\"text/css\"/> \n\n <title>Monarch Disease: {info.label} </title>\n </head>\n <body>\n <h1 class=\"disname\">{info.label}</h1>\n <div id = \"description\">{ textDescription() }</div>\n\n <div class =\"detail-block,twocol\">\n <b class=\"detail-block-header\">Also known as...</b>\n <div class=\"detail-block-contents\">\n <div class=\"col\">\n <b>Synonyms</b>\n <ul>{liSynonyms()}</ul>\n </div>\n </div>\n </div>\n\n\n <div class=\"detail-block,twocol\">\n <b class=\"detail-block-header\">Phenotypes</b>\n <div class=\"detail-block-contents\">\n <div class=\"col\">\n <b>Human</b>\n <table>{trPhenotypes()}</table>\n </div>\n <div class=\"col\">\n <b>Non-Human (TODO)</b>\n </div>\n </div>\n </div>\n\n <div class=\"detail-block,twocol\">\n <b class=\"detail-block-header\">Genes</b>\n <div class=\"detail-block-contents\">\n <div class=\"col\">\n <b>Human</b>\n <table>{trGenes()}</table>\n </div>\n <div class=\"col\">\n <b>Non-Human (TODO)</b>\n </div>\n </div>\n </div>\n\n <div class=\"detail-block,twocol\">\n <b class=\"detail-block-header\">Alleles</b>\n <div class=\"detail-block-contents\">\n <div class=\"col\">\n <b>Human</b>\n <table>{trAlleles()}</table>\n </div>\n <div class=\"col\">\n <b>Non-Human (TODO)</b>\n </div>\n </div>\n </div>\n\n\n <div class=\"detail-block,twocol\">\n <b class=\"detail-block-header\">Models</b>\n <div class=\"detail-block-contents\">\n <div class=\"col\">\n <b>Human</b>\n <table>{trModels()}</table>\n </div>\n <div class=\"col\">\n <b></b>\n </div>\n </div>\n </div>\n\n </body>\n\n</html>;\n\n return html;\n}", "title": "" }, { "docid": "93064afd8dce79a74a92c7bcf842913f", "score": "0.5296689", "text": "function searchAPI(city) {\n let cityJSON = {\n \"city\" : city,\n \"mood\" : 0,\n \"positiveArticles\" : [],\n \"negativeArticles\" : [],\n };\n newsapi.v2.everything({\n sources: 'cnn, fox-news, the-washington-post, the-wall-street-journal, ' +\n 'business-insider, bloomberg, breitbart-news, buzzfeed, abc-news, cbs-news, cnbc, daily-mail,' +\n 'entertainment-weekly, fortune, independent, msnbc, mtv-news, nbc-news, reuters, newsweek, the-american-conservative, ' +\n 'the-hill, the-huffington-post, the-new-york-times, the-telegraph, the-washington-times, time, usa-today, vice-news',\n q: city,\n from: '2018-05-01',\n to: '2018-05-01',\n language: 'en',\n sortBy: 'relevancy',\n }).then(response => {\n for (let i = 0; i < 20; i++) {\n try {\n let score = 0;\n let titleWords = response.articles[i].title.toLowerCase().split(\" \");\n let descriptionWords = response.articles[i].description.toLowerCase().split(\" \");\n let words = titleWords.concat(descriptionWords);\n for (let j = 0; j < words.length; j++) {\n for (let k = 0; k < Data.PositiveWords.length; k++) {\n if (words[j] === Data.PositiveWords[k]) {\n score++;\n }\n }\n for (let k = 0; k < Data.NegativeWords.length; k++) {\n if (words[j] === Data.NegativeWords[k]) {\n score--;\n }\n }\n }\n if (score >= 0) {\n cityJSON.positiveArticles.push({\n \"title\": response.articles[i].title,\n \"description\": response.articles[i].description\n });\n } else {\n cityJSON.negativeArticles.push({\n \"title\": response.articles[i].title,\n \"description\": response.articles[i].description\n });\n }\n console.log(score);\n cityJSON.mood += score;\n } catch (e) {\n console.log('error');\n }\n }\n console.log(cityJSON);\n return cityJSON;\n });\n}", "title": "" }, { "docid": "bd9e64347b0db1e1de07556298a9a360", "score": "0.52961206", "text": "function searchBookIsbn() {\n let apiQuery = {\n q: searchTerm,\n key: 'AIzaSyD7XwCHKgHcFqBw4S0EGu4RQi4lMcJjrrc'\n }\n $.getJSON(\"https://www.googleapis.com/books/v1/volumes\", apiQuery, function(data) {\n let getData = data.items;\n if (getData != undefined) {\n return getData.map(function(data) {\n bookTitle = data.volumeInfo.title;\n searchTerm = bookTitle;\n bookAuthor = data.volumeInfo.authors[0];\n searchIsbnByTitle();\n });\n } else {\n $('.js-danger').fadeIn('slow').delay(1000).fadeOut('slow');\n }\n });\n}", "title": "" }, { "docid": "2be999812e6a594037ced7a59ddb8b8f", "score": "0.5290413", "text": "function searchFunctionality() {\n const resultsFound = getResults();\n const message = document.getElementById(\"sorry\");\n if (message) {\n pageDiv.removeChild(message);\n }\n if (resultsFound.length === 0) {\n const notFoundMessage = document.createElement(\"p\");\n notFoundMessage.textContent = \"Sorry, no results found.\";\n notFoundMessage.id = \"sorry\";\n pageDiv.appendChild(notFoundMessage);\n }\n pageDiv.removeChild(document.getElementsByClassName(\"pagination\")[0]);\n showPage(resultsFound, 1);\n appendPages(resultsFound);\n}", "title": "" }, { "docid": "07ee7ae1d1008ba9d93124f9d2ef318d", "score": "0.5276494", "text": "function doSearch(url) {\n\t$.getJSON(url, function(data) {\n\t\tvar photos = data.photos;\n\t\tvar photolist = [];\n\n\t\t$.each(photos.photo, function(idx, photo) {\n\n\t\t\tvar purl = 'http://farm' + photo.farm + '.staticflickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret + '_m.jpg';\n\n\t\t\tvar phtml = '<a href=\"' + BASE_URL + '../view/' + photo.id + '\" title=\"' + photo.title + '\">';\n\t\t\tphtml += '<img src=\"' + purl + '\" alt=\"' + photo.title + '\" />';\n\t\t\tphtml += '</a>';\n\n\t\t\tphotolist.push(phtml);\n\t\t});\n\n\t\t$('#photos').html(photolist.join(''));\n\t\t$('#pcount').html(photos.total);\n\n\t\tgeneratePageIndex(photos.total, photos.pages, photos.page);\n\t});\n}", "title": "" }, { "docid": "3251f3504801dc8fdbf95e0d5e96ae71", "score": "0.5274219", "text": "async searchByTitle( title ) {\n\n return films.find( { title } );\n \n }", "title": "" }, { "docid": "8a2c9995f9c5b57d7ecc8fae56a249c2", "score": "0.5271855", "text": "async function keyGuardianPersonalityFetch(searchWord) {\n try {\n let searchValue = 'q=' + `${searchWord}`\n const response = await fetch(`${GuardianUrl}${searchValue}${GuardianFields}${GuardianApiKey}`)\n const data = await response.json()\n headlinesArray = data.response.results\n console.log('Guardian_perFacet: ', headlinesArray)\n allNewsCreateDOMnodes()\n } catch (error) {\n console.log(error.message) \n }\n}", "title": "" }, { "docid": "5f6a9847c55f4a050abb794f0472966f", "score": "0.52686703", "text": "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tGOAnnotSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t}\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: GOAnnotSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "47d783e5c708f277a58a1fb73d8906c3", "score": "0.5268087", "text": "function searchForItem(searchText) {\n console.log(\"Searching for: \" + searchText);\n var bundle = [];\n bundle = exactSearch(searchText); //[0]: plantReference, [1]: page reference\n\n if(bundle == undefined) {\n console.log(\"Exact search for query \" + searchText + \" unsuccessful. Starting approximate search\");\n bundle = approximateSearch(searchText);\n\n if(bundle != undefined) {\n if(bundle.length == 0) {\n console.log(\"There are no matches for search: \" + searchText);\n return [];\n } else {\n return bundle;\n }\n } else {\n console.log(\"ERROR: undefined bundle for search text: \" + searchText);\n }\n } else {\n return bundle;\n }\n}", "title": "" }, { "docid": "b2919343b49b9c11283ef4ca130771a5", "score": "0.5267221", "text": "function searchShow() {\n\tconsole.log(\"Searching for show\");\n\ttv.findShow(searchQuery);\n}", "title": "" }, { "docid": "657f36cef67787336b89122064315b49", "score": "0.5266949", "text": "function a(e){\n//initialize current chapter (bookmark button, figures, alerts)\nfunction t(){$(\"#search\").val(\"\").trigger(\"keyup\"),$(\"figure:not(.equation)\").each(function(){var e=$(this).attr(\"data-id\");if($(this).hasClass(\"video\")){$(this).prepend(\"<span>Figure \"+e+\"</span> &mdash; \"),$(this).wrapInner(\"<figcaption></figcaption>\");var t,a=$('<video controls src=\"'+(\"media/\"+e+\".mp4\")+'\">');$(this).prepend(a)}else{$(this).attr(\"data-frames\")&&(e+=$(this).attr(\"data-frames\").split(\",\")[0]),$(this).prepend(\"<span>Figure \"+e+\"</span> &mdash; \"),$(this).wrapInner(\"<figcaption></figcaption>\");var r,s=$('<img src=\"'+(\"media/\"+e+\".jpg\")+'\">');$(this).prepend(s)}}),$(\"figure.equation\").each(function(){var e=$(this).attr(\"data-id\"),t,a=$('<img src=\"'+(\"media/equation-\"+e+\".png\")+'\">');\n// $(this).prepend('<span>Figure '+figure+'</span> &mdash; ');\n// $(this).wrapInner('<figcaption></figcaption>');\n$(this).prepend(a)}),$(\".alert-note\").each(function(){$(this).prepend(\"<h5>NOTE</h5>\")}),$(\".alert-warning\").each(function(){$(this).prepend('<h5><i class=\"icon mdi mdi-warning\"></i>WARNING<i class=\"icon mdi mdi-warning\"></i></h5>')}),$(\".alert-caution\").each(function(){$(this).prepend('<h5><i class=\"icon mdi mdi-warning\"></i>CAUTION<i class=\"icon mdi mdi-warning\"></i></h5>')})}\n//open chapter with argument ID\ns.chapters=e,n(),\n//toggle bookmark state for chapter in object\ns.bookmarkToggle=function(){1==s.chapters[s.chapterID].bookmarked?s.chapters[s.chapterID].bookmarked=!1:s.chapters[s.chapterID].bookmarked=!0,$(\".bookmark-toggle-btn\").toggleClass(\"bookmarked\"),n()},s.openChapter=function(e){s.chapterID=e,23===s.chapterID?s.translatedChapterID=\"A1\":s.translatedChapterID=\"A2\",s.chapterQuestions=s.questions[e].questions,$(\".portal\").empty().load(e+\".html\",function(){for(var e in s.chapters[s.chapterID].answered)$(\".quiz\").eq(parseInt(e)).find(\".quiz-answer\").eq(s.chapters[s.chapterID].answered[e]).addClass(\"selected\");t(),r()})},s.selectAnswer=function(e){var t=$(e.target);t.addClass(\"selected\").siblings().removeClass(\"selected\");var a=t.parent().children().index(t),r=t.closest(\".quiz\").index(\".quiz\");return s.chapters[s.chapterID].answered||(s.chapters[s.chapterID].answered={}),s.chapters[s.chapterID].answered[r]=a,n(),!1},s.testSelectAnswer=function(e,t,a){var r;\n// var answer=el.parent().children().index(el);\n// var question=el.closest('.quiz').index('.quiz');\n// if(!$scope.chapters[$scope.chapterID].answered){\n// \t$scope.chapters[$scope.chapterID].answered={};\n// }\n// $scope.chapters[$scope.chapterID].answered[question]=answer;\n// saveData();\nreturn $(e.target).addClass(\"selected\").siblings().removeClass(\"selected\"),s.currentTestData.questions[t].selected=a,!1},\n//open starting chapter\ns.openChapter(s.chapterID)}", "title": "" }, { "docid": "ac3723c0844363d4b5887551e1a043c7", "score": "0.5265689", "text": "function beginSearch() {\n search(false);\n }", "title": "" }, { "docid": "7386e581d4db211831e05d0ae77ee333", "score": "0.5265218", "text": "function ajax (keyword) { \n\t$.ajax({ \n\t\turl: \"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + keyword + \"&prop=info&inprop=url&utf8=&format=json\",\n\t\tdataType: \"jsonp\",\n\t\tsuccess: function(response) {\n\t\t\tconsole.log(response.query);\n\t\t\t//if no articles on the keyword, show error message\n\t\t\tif (response.query.searchinfo.totalhits === 0) {\n\t\t\t\tshowError(keyword);\n\t\t\t}\n\n\t\t\t//if articles are found, call the showResults functions\n\t\t\telse {\n\t\t\t\tshowResults(response.query.search);\n\t\t\t}\n\t\t},\n\t\terror: function () {\n\t\t\talert(\"Error retrieving search results, please refresh the page\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b75ce66d574848abccc028d08c07c27d", "score": "0.5262582", "text": "function searchResults() {\n id(\"search-term\").value = id(\"search-term\").value.trim();\n let searchTerm = id(\"search-term\").value;\n if (searchTerm.length !== 0) {\n id(\"home\").disabled = false;\n let bookList = id(\"book-list\");\n clearContainers();\n if (bookList.classList.contains(\"hidden\")) {\n removeHidden(bookList);\n }\n let errorText = id(\"error-text\");\n if (errorText.classList.contains(\"hidden\")) {\n removeHidden(errorText);\n }\n addHidden(id(\"single-book\"));\n getBooks(\"&search=\" + searchTerm);\n }\n }", "title": "" }, { "docid": "586e9f1d1552920646c827328078b76d", "score": "0.52607423", "text": "function C009_Library_Search_CheckYuki() {\n\tSetScene(CurrentChapter, \"Yuki\");\n}", "title": "" }, { "docid": "1f00577177b5beb15f85a0b2f0529682", "score": "0.52593666", "text": "function doLiveSearch(){\n flexContainer.innerHTML =\"\";\n const term = event.target.value.toLowerCase();\n \n let filteredEpisodes = allEpisodes.filter(episode =>{\n\n return (episode.name + episode.summary).toLowerCase().includes(term);\n \n })\n \n displayParagraph[1].innerText = `Displaying:${filteredEpisodes.length}/${allEpisodes.length}`;\n \n filteredEpisodes.forEach(episode =>{\n createEpisodeCards(episode); \n }) \n \n}", "title": "" }, { "docid": "f04b06f52c88bacf72cd322efbbe6592", "score": "0.5258443", "text": "function getUsfmWords(usfm) {\n // first convert to JSON\n const json = usfmjs.toJSON(usfm);\n const chapters = json.chapters;\n let book_map = util.obj_to_map(chapters);\n let words = [];\n\n for (var [k,v] of book_map.entries()) {\n // the value is a verses object \n // where key is verse number\n // and value is an array of verse objects\n var verses_map = util.obj_to_map(v);\n for (var v1 of verses_map.values()) {\n // the value is a set of tags for each object in a verse\n var verse_map = util.obj_to_map(v1);\n for (var v2 of verse_map.values()) {\n for (var i=0; i < v2.length; i++) {\n var verse_obj_map = util.obj_to_map(v2[i]);\n // unaligned text method\n if ( verse_obj_map.has(\"text\") ) {\n words.push(\n verse_obj_map.get(\"text\").toLowerCase()\n );\n }\n // aligned text method\n if ( verse_obj_map.get(\"type\") === \"word\" ) {\n let thisword = verse_obj_map.get(\"text\");\n let lowerCaseVal = thisword.toLowerCase();\n words.push(lowerCaseVal);\n }\n for ( var [k3,v3] of verse_obj_map.entries()) {\n if ( k3 === \"children\" ) {\n process_tags(v3,words,1);\n }\n }\n }\n }\n }\n }\n // return the array of all words found\n // in the order they were found\n return getWords(words.join('\\n'));\n}", "title": "" }, { "docid": "e1fa4f6d0e5cc1a86f411c7afc4c7109", "score": "0.5257532", "text": "async searchpainter({ query, page, amount = 12 }) {\n let offset = (page - 1) * amount\n\n let search = await db.manyOrNone(` SELECT * FROM schilder WHERE document_vectors @@ plainto_tsquery('${query}:*') LIMIT ${amount} OFFSET ${offset}`)\n .then(data => { return data })\n .catch(err => { throw new Error(err) })\n\n let total_search = await db.manyOrNone(`SELECT COUNT(*) FROM schilder WHERE document_vectors @@ plainto_tsquery('${query}:*')`)\n .then(data => { return data })\n .catch(err => { throw new Error(err) })\n\n return {\n total: total_search[0].count,\n painters: search\n }\n }", "title": "" }, { "docid": "151006a2dd7ed4997d6e748c42e50426", "score": "0.525666", "text": "function loadSearch(event, typeSearch, extraTerm) {\n event.preventDefault();\n let client_id = '9b0a14a74c624641947e67fd2eaafbf6', // Your client id\n client_secret = '6f975753ea5a46708e876e54750806c7', \n compiledUrl = \"\",\n artist = searchState.searchTerms\n \n \n\n if (typeSearch === \"artist\" || typeSearch === \"album\" || typeSearch === \"track\"){\n let type = \"&type=\" + typeSearch;\n compiledUrl = `${searchUrl}search?q=\"${artist}${type}&market=US&limit=5`;\n \n console.log(compiledUrl)\n } else if( typeSearch === \"artistAlbums\"){\n let artistID = extraTerm;\n compiledUrl = `${searchUrl}artists/${artistID}/albums?market=US`;\n\n console.log(compiledUrl)\n } else if( typeSearch === \"albumSongs\"){\n let albumID = extraTerm;\n compiledUrl = `${searchUrl}albums/${albumID}/tracks?market=US`;\n\n console.log(compiledUrl)\n } \n \n\n //console.log(compiledUrl)\n\n // your application requests authorization\n var authOptions = {\n url: 'https://accounts.spotify.com/api/token',\n headers: {\n 'Authorization': 'Basic ' + (new Buffer(client_id + ':' + client_secret).toString('base64'))\n },\n form: {\n grant_type: 'client_credentials'\n },\n json: true\n };\n\n request.post(authOptions, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n // use the access token to access the Spotify Web API\n var token = body.access_token;\n var options = {\n url: compiledUrl,\n headers: {\n 'Authorization': 'Bearer ' + token\n },\n json: true\n };\n request.get(options, function (error, response, body) {\n //add if statment for artist, songs, albums\n if(typeSearch === \"artist\") {\n console.log(body.artists.items);\n setResults(body.artists.items);\n };\n \n if(typeSearch === \"album\") {\n console.log(body);\n setResults(body.albums.items);\n };\n\n if(typeSearch === \"track\") {\n console.log(body);\n setSong(body.tracks.items);\n };\n\n if(typeSearch === \"artistAlbums\") {\n console.log(body);\n setResults(body.items);\n };\n\n if(typeSearch === \"albumSongs\") {\n console.log(body);\n setSong(body.items);\n };\n \n });\n }\n });\n \n }", "title": "" }, { "docid": "fef053faa3d6d44c16ecdaa3dcd5a7a8", "score": "0.5252681", "text": "function searchShow(e) {\n let searchString = e.target.value.toLowerCase();\n let filteredInput = allShows.filter((char) => {\n return (\n char.name.toLowerCase().includes(searchString) ||\n char.genres.join(\" \").toLowerCase().includes(searchString) ||\n char.summary.toLowerCase().includes(searchString)\n );\n });\n mainElem.innerHTML = \"\";\n displayShows(filteredInput);\n showCount(filteredInput);\n}", "title": "" } ]
bfedb895f1ebbb0b3b62ee34d4a324ca
builds an html element from todo object
[ { "docid": "159c3077a529c0a177eeff1af62031c8", "score": "0.75808066", "text": "function createTodoElement(todo) {\n const container = document.createElement(\"div\");\n const todoCheck = document.createElement(\"input\");\n const todoPriority = document.createElement(\"div\");\n const timeStamp = document.createElement(\"div\");\n const todoText = document.createElement(\"div\");\n const todoEdit = document.createElement(\"div\");\n container.classList.add(\"todo-container\");\n todoCheck.classList.add(\"todo-check\");\n todoPriority.classList.add(\"todo-priority\");\n timeStamp.classList.add(\"todo-created-at\");\n todoText.classList.add(\"todo-text\");\n todoEdit.classList.add(\"todo-edit\");\n todoCheck.setAttribute(\"Type\", \"checkbox\");\n todoCheck.checked = todo.checked;\n if (todo.checked) container.classList.add(\"checked-task\");\n todoPriority.innerText = todo.priority;\n timeStamp.innerText = dateToSQLFormat( new Date(todo.date) );\n todoText.innerText = todo.text;\n todoEdit.innerHTML = `<i class=\"fa fa-pencil\" aria-hidden=\"true\"></i>`; //awesome fonts\n todoEdit.onclick = createEditPrompt;\n container.append(todoCheck, todoPriority, timeStamp, todoText, todoEdit);\n return container;\n}", "title": "" } ]
[ { "docid": "5000fc3af25f95173cc6b6bbf46ceccc", "score": "0.823906", "text": "function buildTodo(todo) {\n var todoHtml = '<div class=\"todo\" id=\"'+ todo.title +'\" ><p>' + todo.description\n + '</p>'\n + '<button class=\"delete-todo\">Delete</button></div>';\n\n return todoHtml;\n}", "title": "" }, { "docid": "40045e04e31a0288b907cc0a661f7371", "score": "0.7668614", "text": "function renderTodo(todo) {\n\t\tvar html =\n\t\t\t\t'<a class=\"collection-item\" id=\"'+todo.id+'\" href=\"#modal-todo\"'+\n\t\t\t\t\t'data-id=\"'+todo.id+'\"'+\n\t\t\t\t\t'data-title=\"'+todo.title+'\"'+\n\t\t\t\t\t'data-priority=\"'+todo.priority+'\"'+\n\t\t\t\t\t'data-details=\"'+todo.details+'\"'+\n\t\t\t\t\t'data-created=\"'+todo.createdAt+'\"'+\n\t\t\t\t\t'data-elapsed=\"'+todo.elapsedTime+'\"'+\n\t\t\t\t\t'data-finish=\"'+todo.finishAt+'\"'+\n\t\t\t\t\t'data-complete=\"'+todo.isComplete+'\"'+\n\t\t\t\t'>'+\n\t\t\t\t\t'<span class=\"badge '+todo.priority+'\">'+\n\t\t\t\t\t\ttodo.priority+\n\t\t\t\t\t'</span>'+\n\t\t\t\t\ttodo.title+\n\t\t\t\t'</a>';\n\t\tlist.append(html);\n\t}", "title": "" }, { "docid": "8724ac2ba33a5d9a248c7d0e472fb304", "score": "0.7551175", "text": "function addHTMLTodos(todo) {\n\tincompleteTasksList.innerHTML = \"\";\n\tfor (let i = 0; i < todo.length; i++) {\n\t\tlet node = document.createElement(\"li\");\n\t\tnode.setAttribute(\"class\", `\"item\"`);\n\t\tnode.setAttribute(\"dataKey\", todo[i].id);\n\t\tnode.setAttribute(\"update-key\", `\"item${i}\"`);\n\t\tnode.innerHTML =\n\t\t\t`\n <input type=\"checkbox\" class=\"checkbox\" id=\"${i}\" onclick=completeTasks(` +\n\t\t\ttodo[i].id +\n\t\t\t`,` +\n\t\t\ti +\n\t\t\t`)>\n <small>Task Added: ${todo[i].date}</small>\n <span><input type=\"text\" id=\"item${i}\" class=\"myinput\" value=\"${todo[i].name}\" disabled \"/> </span>\n <button class=\"btn btn-warning updateBtn\" id=\"btn${i}\" onclick=editItem(` +\n\t\t\ti +\n\t\t\t`)>Edit</button>\n <button class=\"btn btn-danger deleteBtn\">Delete</button>\n <br/>\n <hr/>\n `;\n\t\t// Append the element to the DOM as the last child of the element\n\t\tincompleteTasksList.append(node);\n\t}\n}", "title": "" }, { "docid": "076179b4b5863c8788c0179aec79af49", "score": "0.74451697", "text": "function showTodo(todo) {\n // Our single todo item template, each todo item is a single LI tag\n // Note that you can run functions and methods within the ${} template strings\n\n // console.log(todo)\n\n var todoTemplate = `<li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" data-id=\"${todo.id}\" />\n ${todo.todo}\n </label>\n </div>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-danger\">${todo.category.toUpperCase()}</span>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-default\">${moment(todo.due_date).format('MM/DD/YYYY')}</span>\n </div>\n </div>\n </li>`\n\n // Concatenate our single todo item template onto the end of the existing todo items on the page\n todosContainer.innerHTML += todoTemplate\n}", "title": "" }, { "docid": "d08bc90d3d494ead9718967172cc84c2", "score": "0.7435558", "text": "async function renderTodo(todo){\n\n const todoIsComplete = todo.complete\n const taskList = todoIsComplete ? completedTodoList : incompleteTodoList;\n const checked = todoIsComplete ? \"checked\" : \"\";\n\n let todoItemHTML = \n `<div class=\"form-check\">\n <label class=\"form-check-label\">\n <input id=\"${todo.id}\" class=\"js-tick\" type=\"checkbox\" ${checked}/>\n ${todo.name}\n </input>\n <p class=\"input-helper\" id=\"incomplete-list\"></p>\n </label>\n\n <div class=\"editicons\">\n <i class=\"remove mdi mdi-close-circle-outline fas fa-edit customeditbutton\"></i>\n <i class=\"remove mdi mdi-close-circle-outline customdeletebutton\"></i>\n </div>\n </div>\n `;\n \n //Add todo to DOM in either the complete or incomplete Task List Depending on variable value\n taskList.insertAdjacentHTML(\"afterbegin\", todoItemHTML)\n \n\n }", "title": "" }, { "docid": "79e9fc7f2ae50be13077a1cc199e3437", "score": "0.7428789", "text": "function addHTMLcomp(todo) {\n\t// alert(todo.length);\n\tcompleteTaskList.innerHTML = \"\";\n\tfor (let i = 0; i < todo.length; i++) {\n\t\tlet node = document.createElement(\"li\");\n\t\tnode.setAttribute(\"class\", `\"item\"`);\n\t\tnode.setAttribute(\"update-key\", `\"item${i}\"`);\n\t\tnode.innerHTML = `\n\t\t<small>Completion Date: ${todo[i].date}</small>\n <span><input type=\"text\" id=\"item${i}\" class=\"myinput\" value=\"${todo[i].name}\" /> </span>\n <hr/>\n `;\n\t\t// Append the element to the DOM as the last child of the element\n\t\tcompleteTaskList.append(node);\n\t}\n}", "title": "" }, { "docid": "120252a7a168495c90b79fb050809e24", "score": "0.7387756", "text": "function createTodoListItem(todo) {\n // var checkbox = document.createElement('input');\n // checkbox.className = 'toggle';\n // checkbox.type = 'checkbox';\n // checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.innerHTML = todo.title;\n //label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n // var deleteLink = document.createElement('button');\n // deleteLink.className = 'destroy';\n // deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n // divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n // divDisplay.appendChild(deleteLink);\n\n // var inputEditTodo = document.createElement('input');\n // inputEditTodo.id = 'input_' + todo._id;\n // inputEditTodo.className = 'edit';\n // inputEditTodo.value = todo.title;\n // inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n // inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n // li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n}", "title": "" }, { "docid": "3d93ced0c06ddf73cd7b58e1c18f92c7", "score": "0.7381102", "text": "function renderTodo(todo) {\n //store todo items into browser storage.\n localStorage.setItem(\"todoItem\", JSON.stringify(todoItems));\n //get reference of required elements.\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n //Runs a check for deleted items and update the DOM.\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const isChecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry.\n const listItemElement = document.createElement(\"li\");\n\n // set class and data-key attributes to the todo entry.\n listItemElement.setAttribute(\"class\", `todo-item ${isChecked}`);\n listItemElement.setAttribute(\"data-key\", todo.id);\n //populate the todo entry with required values.\n listItemElement.innerHTML = `\n <input id =\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run condition to append the created item to the page.\n if (item) {\n list.replaceChild(listItemElement, item);\n }\n else {\n list.append(listItemElement);\n }\n}", "title": "" }, { "docid": "a104888b13fac5da1af49fbe846d5fcd", "score": "0.7379228", "text": "function renderTodo(todo) {\n //Store todo items into broser storage\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\n //Get reference of required elements\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n //Runs a check for deleted items and update the DOM\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const ischecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry\n //set clss and data-key attribute to the todo entry\n const listItemElement = document.createElement(\"li\");\n listItemElement.setAttribute(\"class\", `todo-item ${ischecked}`);\n //populate the required the values\n listItemElement.setAttribute(\"data-key\", todo.id);\n listItemElement.innerHTML = `<input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run the condition to append the created item to the page\n if (item) {\n list.replaceChild(listItemElement, item);\n } else {\n list.append(listItemElement);\n }\n\n}", "title": "" }, { "docid": "79a9e78e44793e718f6305544a4d9cd2", "score": "0.7291781", "text": "function makeTodoHTML(todoText) {\n \n return \"<li class=\\\"todo-item\\\"><span class=\\\"delete-todo\\\"><i class=\\\"fa fa-times\\\" aria-hidden=\\\"true\\\"></i></span> \" + todoText + \"</li>\";\n\n}", "title": "" }, { "docid": "88b9f100f1d29895acc647f1df09e172", "score": "0.7287538", "text": "function buildTodoList(todos) {\n $(\"#todoList\").empty();\n var todo = {};\n for (var i = 0; i < todos.length; i++) {\n todo = todos[i];\n var formattedDate = formatDate(todo.due_date);\n var currStatus = todo.status_name;\n var string = '';\n var dueText = \"Due: \";\n if (currStatus === 'Closed') {\n string += '<div class=\"todo closedTodo\"';\n formattedDate = formatDate(todo.done_date);\n dueText = \"Completed: \";\n } else if (checkOverdue(formattedDate) === true) {\n // console.log(currStatus, checkOverdue(formattedDate));\n currStatus = 'Overdue';\n string += '<div class=\"todo overdueTodo\"';\n } else {\n string += '<div class=\"todo\"';\n }\n\n string += ' data-id=' + todo.id + '>';\n string += '<p>';\n string += '<span>' + currStatus + '</span>';\n string += ' \\- ';\n string += todo.description;\n string += '&nbsp-&nbsp' + dueText + '<span>' + formattedDate + '</span>';\n string += '<button type=\"button\" class=\"deleteButton\" name=\"deleteButton\"><i class=\"material-icons\">remove_circle_outline</i></button>';\n string += '<button type=\"button\" class=\"addTwoButton\" name=\"addTwoButton\"><i class=\"material-icons\">exposure_plus_2</i></button>';\n string += '<button type=\"button\" class=\"addOneButton\" name=\"addOneButton\"><i class=\"material-icons\">exposure_plus_1</i></button>';\n string += '<button type=\"button\" class=\"completeButton\" name=\"completeButton\"><i class=\"material-icons\">done</i></button>';\n string += '</p>';\n string += '</div>';\n $(\"#todoList\").append(string);\n\n // console.log('id: ', $(\"#todoList\").children().last().data('id'));\n }\n } // end function buildTodoList", "title": "" }, { "docid": "d4ab37ec560293eb8f985a4bde780d04", "score": "0.72718626", "text": "function todoCreator(todoText, completed) {\n uniqueCounter = uniqueCounter + 1;\n var todoId = 'todo' + uniqueCounter;\n return '<li class=\"list-group-item d-flex\">' +\n ' <div class=\"form-check\" style=\"flex: 1 1 auto;\" onchange=\"toggleComplete(this);maybeHideDeleteAll();\">' +\n ' <input type=\"checkbox\" class=\"form-check-input\" id=\"' + todoId + '\">' +\n ' <label class=\"form-check-label\" for=\"' + todoId + '\">' +\n (completed ? '<del>' + todoText + '</del>' : todoText) +\n ' </label>' +\n ' </div>' +\n ' <button onclick=\"deleteTodo(this);maybeHideDeleteAll();\" class=\"btn btn-secondary btn-sm\">Delete</button>' +\n '</li>';\n}", "title": "" }, { "docid": "f0195193d9bf3c0a1a643313daa725fa", "score": "0.72714436", "text": "function generateTodoDOM(todo){\n let todoEl = document.createElement(\"label\");\n let containerEl = document.createElement(\"div\");\n let checkbox = document.createElement(\"input\");\n let span = document.createElement(\"span\"); \n let removeButton = document.createElement(\"button\");\n \n // Setup todo checkbox\n checkbox.type = \"checkbox\";\n checkbox.checked = todo.completed;\n containerEl.appendChild(checkbox);\n checkbox.addEventListener(\"change\", function(event){\n toggleTodo(todo.todoID);\n renderTodos();\n });\n \n // Setup the todo text\n span.textContent = todo.title;\n containerEl.appendChild(span);\n\n // Setup container\n todoEl.classList.add(\"list-item\");\n containerEl.classList.add(\"list-item__container\");\n todoEl.appendChild(containerEl);\n \n // Setting up the remove button\n removeButton.textContent = \"Remove\";\n removeButton.classList.add(\"button\", \"button--text\");\n todoEl.appendChild(removeButton);\n removeButton.addEventListener(\"click\", () => {\n removeTodo(todo.todoID);\n renderTodos();\n });\n\n return todoEl;\n}", "title": "" }, { "docid": "696110fbcebbf40e6ee1bedc15937745", "score": "0.72574294", "text": "function renderTodo(idx, todo) {\n return div([\n span(todo.get('text')),\n input(\".todo-completed\",\n { type: 'checkbox', checked : todo.get('completed'), 'data-todo-id' : idx }),\n span(\".remove-todo\", {'data-todo-id' : idx}, \" x\")\n ])\n}", "title": "" }, { "docid": "3d7a81f2d420be9d1b83dca2ae8b6860", "score": "0.7237746", "text": "function renderTodo(todo) {\n //This function renders a todo to the page.\n //If the todo already exists then this function will update it\n\n //Check if todo already exists in dom\n var $existingElem = $('#'+ todo.id);\n if ($existingElem.length) {\n //Update text (possible it's not changed)\n $existingElem.find('.task').text(todo.item);\n\n //Check if element is in correct list and check if \n if (($existingElem.parent('ul').attr('id') === 'todo-list') && (todo.completed === true)) {\n //Move from todo to completed\n $existingElem.detach();\n $('#completed-list').prepend($existingElem); \n $existingElem.slideDown();\n\n } else if (($existingElem.parent('ul').attr('id') === 'completed-list') && (todo.completed === false)) {\n //Move from complted to todo\n $existingElem.detach();\n $('#todo-list').prepend($existingElem); \n $existingElem.slideDown();\n }\n } else {\n // Todo is new to client.. add\n var taskHTML = '<li><span class=\"done\">%</span>'; \n taskHTML += '<span class=\"edit\">+</span>'; \n taskHTML += '<span class=\"delete\">x</span>'; \n taskHTML += '<span class=\"task\"></span></li>';\n\n var $newTask = $(taskHTML); \n $newTask.find('.task').text(todo.item);\n $newTask.attr('id',todo.id);\n $newTask.hide(); \n if (todo.completed === true) {\n $('#completed-list').prepend($newTask); \n } else {\n $('#todo-list').prepend($newTask); \n }\n $newTask.show('clip',250).effect('highlight',1000);\n }\n}", "title": "" }, { "docid": "89f1b845fbf83278bd3c84599a6fc837", "score": "0.7207485", "text": "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.id = 'chk_'+todo.title;\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var colorDiv = document.createElement('div');\n colorDiv.className = 'colorDiv '+todo.color;\n\n var label = document.createElement('label');\n label.setAttribute('for', checkbox.id);\n label.appendChild(document.createTextNode(todo.title));\n\n var text = document.createElement('div');\n text.className = \"todo_text\";\n text.appendChild(document.createTextNode((todo.text !== '') ? todo.text : 'No comment'));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var editLink = document.createElement('button');\n editLink.className = 'edit';\n editLink.addEventListener( 'click', editButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(colorDiv);\n divDisplay.appendChild(text);\n\n divDisplay.appendChild(deleteLink);\n divDisplay.appendChild(editLink);\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "title": "" }, { "docid": "0da8faeab9f0f4b0351fa1b0a7947d2f", "score": "0.7201695", "text": "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.appendChild( document.createTextNode(todo.title));\n label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(deleteLink);\n\n var inputEditTodo = document.createElement('input');\n inputEditTodo.id = 'input_' + todo._id;\n inputEditTodo.className = 'edit';\n inputEditTodo.value = todo.title;\n inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "title": "" }, { "docid": "156847f5c00c9781dc32de469b4e887f", "score": "0.7181971", "text": "function getToDoItemHTML(toDoItem) {\n var listItem = document.createElement(\"li\")\n var itemText = document.createTextNode(toDoItem.text)\n listItem.appendChild(itemText)\n \n if(toDoItem.completed === true){\n listItem.classList.add(\"completed\")\n }\n \n return listItem\n}", "title": "" }, { "docid": "d7ad2c45abb41c5bcdb7a7a52dc39155", "score": "0.7170707", "text": "generateTodoDOM(todo) {\r\n // create elements\r\n const createTodoParagraph = document.createElement('p')\r\n const createTodoBtn = document.createElement('span')\r\n const createTodoText = document.createElement('span')\r\n const createTodoCheck = document.createElement('input')\r\n\r\n // populate elements\r\n createTodoCheck.setAttribute('type', 'checkbox')\r\n createTodoText.className = 'todo-text'\r\n createTodoBtn.innerHTML = '&times;'\r\n createTodoBtn.className = 'todo-close-btn'\r\n createTodoText.textContent = todo.task\r\n\r\n // checkbox status\r\n createTodoCheck.checked = todo.completed\r\n\r\n // checkbox event handler\r\n createTodoCheck.addEventListener('change', () => {\r\n this.changeTodoStatus(todo.id)\r\n this.saveTodos(todos)\r\n this.renderTodos(todos, filters)\r\n })\r\n\r\n // add event handler to button\r\n createTodoBtn.addEventListener('click', () => {\r\n this.removeTodo(todo.id)\r\n this.saveTodos(todos)\r\n this.renderTodos(todos, filters)\r\n })\r\n \r\n // create final paragraph\r\n createTodoParagraph.appendChild(createTodoCheck)\r\n createTodoParagraph.appendChild(createTodoText)\r\n createTodoParagraph.appendChild(createTodoBtn)\r\n\r\n return createTodoParagraph\r\n }", "title": "" }, { "docid": "8b7a574d35070f3ea2271a8094d41097", "score": "0.7141781", "text": "function addTodoToDOM(todo) {\n const node = document.createElement('li')\n const text = document.createTextNode(todo.name)\n\n const removeButton = createRemoveButton(()=>{\n store.dispatch(removeTodoAction(todo.id))\n })\n\n const complete = document.createElement('span')\n complete.innerHTML = todo.complete ? \"<br> Complete\" : \"<br> InComplete\"\n\n const toggleBtn = document.createElement('button')\n toggleBtn.innerHTML=\"Toggle\"\n toggleBtn.addEventListener('click', ()=>{\n store.dispatch(toggleTodoAction(todo.id))\n })\n\n node.appendChild(text) \n node.appendChild(complete) \n node.appendChild(removeButton)\n node.appendChild(toggleBtn)\n\n document.getElementById('todos').appendChild(node)\n}", "title": "" }, { "docid": "f10d96137037e7e8fc52916bbd5f2adf", "score": "0.71039164", "text": "function renderTodo(todo) {\n localStorage.setItem('todoItemsRef', JSON.stringify(todoItems));\n const list = document.querySelector('.js-todo-list');\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = '';\n return\n }\n\n const isChecked = todo.checked ? 'done': '';\n \n const node = document.createElement(\"li\");\n node.setAttribute('class', `todo-item ${isChecked}`);\n node.setAttribute('data-key', todo.id);\n node.innerHTML = `\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n `;\n\n if (item) {\n list.replaceChild(node, item);\n } else {\n list.append(node);\n }\n}", "title": "" }, { "docid": "a28424196960f2d912b6ce702b7deac3", "score": "0.70915955", "text": "function renderTodos(todos) {\n //clear everything inside <ul> w/ clss=todo-todo-items \n todoItemsList.innerHTML = '';\n\n //run through ea item inside of todos\n todos.forEach(function(item){\n //check if each item is completed\n const checked = item.completed ? 'checked' : null;\n\n // make a li element and fill it \n const li = document.createElement('li');\n // <li class=\"item\"></li>\n li.setAttribute('class', 'item');\n // <li class=\"item\" data-key=\"20200708\"> </li> \n li.setAttribute('data-key', item.id);\n /* <li class=\"item\" data-key=\"20200708\"> \n <input type=\"checkbox\" class=\"checkbox\">\n Go to Gym\n <button class=\"delete-button\">X</button>\n </li> */\n\n // if item is completed, then add a class to <li> called 'checked', which will add \n //line-through style\n if(item.completed === true) {\n li.classList.add('checked');\n }\n li.innerHTML = `\n <input type=\"checkbox\" class=\"checkbox\" ${checked}>\n ${item.name}\n <button class=\"delete-button\">X</button>\n `;\n // finally add the <li> to the <ul>\n todoItemsList.append(li) \n });\n}", "title": "" }, { "docid": "49e5ea1b6c3c85f676c18cc58766bc32", "score": "0.7066412", "text": "function view()\n{\n\t// This function takes care of rendering the to do list\n\t// All UI elements should be added to the \"container\" \n\t// section of the HTML. \n\n\t// get container element by id\n\tvar container = document.getElementById(\"container\");\n\n\tcontainer.innerHTML = \"\";\n\n\t// go through todo list items and add them\n\tfor(var i = 0; i < todos.length; i ++) {\n\t\tvar div = document.createElement('div');\n\n\t\tdiv.className = 'row';\n\n\t\tvar status = '';\n\n\t\tif(todos[i].status == true) {\n\t\t\tstatus = 'checked';\n\t\t}\n\n\t\tdiv.innerHTML = '<input class=\"todoItem\" type=\"checkbox\" onclick=\"updateStatus('+i+')\" '+status+'>\\\n \t\t\t\t\t\t <label for=\"todoItem\">'+todos[i].name+'</label>'+todos[i].completeDate+' \\\n \t\t\t\t\t\t <br>';\n\n\t\tcontainer.appendChild(div);\n\t}\n\t\n\n // clear the text in the input field for todo item\n\tdocument.getElementsByName(\"task\")[0].value = \"\";\n\n}", "title": "" }, { "docid": "f5e9786d143d2c4af70fff9d303e8526", "score": "0.70541507", "text": "function renderModalTodo(todo) {\n\t\ttodo = $(todo);\n\t\t\n\t\tvar id = todo.attr('data-id'),\n\t\t\t\ttitle = todo.attr('data-title'),\n\t\t\t\tpriority = todo.attr('data-priority'),\n\t\t\t\tdetails = todo.attr('data-details'),\n\t\t\t\tcreated = todo.attr('data-created'),\n\t\t\t\telapsed = parseInt(todo.attr('data-elapsed')),\n\t\t\t\tfinish = todo.attr('data-finish'),\n\t\t\t\tcomplete = todo.attr('data-complete'),\n\t\t\t\tduration = getDuration(created, elapsed);\n\t\t\n\t\tmodalTodo.find('.modal-header').text(title + \" - \");\n\t\tmodalTodo.find('.modal-header').append(\n\t\t\t'<span class=\"'+priority+'-text\">'+\n\t\t\t\tpriority+\n\t\t\t'</span>'+\n\t\t\t'<button class=\"right waves-effect waves-light btn\"><i class=\"material-icons\">play_arrow</i></button>'\n\t\t);\n\t\t\n\t\tvar html =\n\t\t\t\t'<h5>'+\n\t\t\t\t\tdetails+\n\t\t\t\t'</h5>'+\n\t\t\t\t'<table>'+\n\t\t\t\t\t'<tbody>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Elapsed time</td>'+\n\t\t\t\t\t\t\t'<td>'+duration+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Created</td>'+\n\t\t\t\t\t\t\t'<td>'+moment(created).format(\"DD/MM/YY, HH:MM:SS\")+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Finish by</td>'+\n\t\t\t\t\t\t\t'<td>'+moment(finish).format(\"DD/MM/YY, HH:MM:SS\")+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t'</tbody>'+\n\t\t\t\t'</table>'\n\t\t\t\t;\n\t\t\n\t\tmodalTodo.find('.modal-details').html(html);\n\t\tmodalTodo.find('#trigger-edit').attr('data-id', id);\n\t}", "title": "" }, { "docid": "13895a9a7688b98a43a648fcdfef8ff8", "score": "0.705408", "text": "function create (todo){\n const html = `\n <li class=\"list-group-item d-flex justify-content-between align-items-center todo\">\n <span>\n ${todo}\n </span>\n <i class=\"fas fa-trash-alt delete\"></i>\n</li>\n `\nlist.innerHTML += html;\n}", "title": "" }, { "docid": "3ad4118a3faf630b9bed746790878dd7", "score": "0.70131963", "text": "function generateHtml (todo){\n let html = ` <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n <span>${todo}</span>\n <i class=\"far fa-trash-alt delete\"></i>\n</li>`;\n\nlist.innerHTML+=html;\n\n\n}", "title": "" }, { "docid": "15c14deddc08422b9e5900f67ebe4f02", "score": "0.69875956", "text": "function renderList() {\n //use a for loop to render the list items\n var html = \"\"\n for (let i = 0; i < arr.length; i++) {\n\n if (arr[i].isCompleted) {\n html += `<li class=\"todo-list-item completed\" id=${i}>${arr[i].task}</li>`\n } else {\n html += `<li class=\"todo-list-item\" id=${i}>${arr[i].task}</li>`\n }\n }\n todoList.innerHTML = html\n}", "title": "" }, { "docid": "b9528746bee31e255d8a7c3c51e82ad6", "score": "0.69829696", "text": "function renderTodoList() {\n if (!data.todo.length && !data.completed.length) return;\n\n for (i = 0; i < data.todo.length; i++) {\n var value = data.todo[i];\n addItemToDOM(value);\n }\n for (j = 0; j < data.completed.length; j++) {\n var value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "title": "" }, { "docid": "341cb63a728687bdcace4cb2bfcb6000", "score": "0.6904164", "text": "function addTodo(todo) {\n // Create a new todo with the value from the name property\n var newTodo = $('<li class=\"task\">' + todo.name + '<span>X</span>' + '</li>');\n // Store the todo's id #\n newTodo.data('id', todo._id);\n // Store the todo's completed value\n newTodo.data('completed', todo.completed);\n // If the todo is completed\n if (todo.completed) {\n // Add the done class to the todo\n newTodo.addClass('done');\n }\n // Add the todo to the list of todos\n $('.list').append(newTodo);\n \n}", "title": "" }, { "docid": "d06fb41e7cf4834868a81b730a65a005", "score": "0.6903973", "text": "function generateTodo(value) {\n if (value.trim() === \"\") {\n return;\n }\n const template = `\n <div class=\"mainBox\">\n <p class=\"textMainBox\">${value}</p>\n <span class=\"imgMainBox\"></span></div>\n `;\n mainTodoList.innerHTML += template;\n}", "title": "" }, { "docid": "ed5a34f7ed190624907456296b6b0bf1", "score": "0.68941", "text": "function renderToDos() {\n// let toDos = loadFromLocalStorage();\n ul.innerHTML = \"\";\n for(todo of toDos){\n // Checkbox (when clicked will cross out the text)\n const newCheckBox = document.createElement(\"input\");\n newCheckBox.setAttribute(\"type\", \"checkbox\");\n // task\n const newLi = document.createElement(\"li\");\n // Remove Button (when clicked will remove entire todo)\n const newRemoveBtn = document.createElement(\"button\");\n\n // todo is the object within the array toDos, todo has a key(task) and status set to false\n newLi.innerText = todo.task;\n newRemoveBtn.innerText = \"x\";\n newRemoveBtn.setAttribute(\"id\",\"removeBtn\");\n\n newLi.prepend(newCheckBox);\n newLi.append(newRemoveBtn);\n ul.append(newLi);\n\n // monitor the status of each todo\n if (todo.done) {\n newCheckBox.checked = todo.done;\n newCheckBox.classList.add(\"crossOut\");\n }\n }\n}", "title": "" }, { "docid": "09b71166415765eb21e34f1167284172", "score": "0.68723243", "text": "function todoList(todoItem) {\r\n\r\n var todoObj = todoItem.data();\r\n \r\n todoObj.id = todoItem.id;\r\n\r\n\r\n var p = document.createElement('p');\r\n\r\n var textNode = document.createTextNode(todoObj.todo);\r\n\r\n p.appendChild(textNode);\r\n p.setAttribute('id', todoObj.id);\r\n getDiv.appendChild(p);\r\n\r\n var EditBtn = document.createElement('button');\r\n var EditTextnode = document.createTextNode('Edit Item');\r\n EditBtn.appendChild(EditTextnode);\r\n p.appendChild(EditBtn);\r\n EditBtn.setAttribute('onclick' , 'EditNode(this)');\r\n\r\n var deleteBtn = document.createElement('button');\r\n var deleteTextNode = document.createTextNode(\"delete\");\r\n deleteBtn.appendChild(deleteTextNode);\r\n deleteBtn.setAttribute('onclick' , 'deleteItem(this)');\r\n p.appendChild(deleteBtn);\r\n\r\n var todoImage = document.createElement('img');\r\n todoImage.setAttribute('src' , todoObj.image);\r\n todoImage.setAttribute('width' , '50px');\r\n todoImage.setAttribute('height' , '50px');\r\n console.log(todo)\r\n p.appendChild(todoImage);\r\n\r\n\r\n}", "title": "" }, { "docid": "1a22ccfb520bee5fa355364cb30ba833", "score": "0.6852053", "text": "function renderTodos() { //fução de renderização de 'to do'\n for (todo of todos) { //apliquei o 'for...of' para percorrer o array acima, criando a variável todo \n var todoElement = document.createElement('li'); //criei var todoElement que cria elementos dentro da ul\n var todoText = document.createTextNode(todo);//todos os elementos todo(criados na lista) serão armazenados em todoText\n \n todoElement.appendChild(todoText);\n listElement.appendChild(todoElement);\n }\n}", "title": "" }, { "docid": "105b393222a8297e90b410b2e1545290", "score": "0.68075544", "text": "createDoneTask() {\n let taskDoneItem = document.createElement(\"li\");\n taskDoneItem.className = \"todo-list__item todo-list__item--done\";\n taskDoneItem.innerHTML = `\n <input type=\"text\" class=\"todo-list__value\" disabled value=\"${this.value}\">\n\n <button class=\"todo-list__btn-edit\"><i class=\"far fa-edit\"></i></button>\n <button class=\"todo-list__btn-remove\"><i class=\"far fa-trash-alt\"></i></button>\n `;\n return taskDoneItem;\n }", "title": "" }, { "docid": "287f88040c6ad1b36611ebe41e2eedaa", "score": "0.67983884", "text": "function renderTodo(todo) {\r\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\r\n // seleting the first element with a class of \"js-todo-list\"\r\n const list = document.querySelector(\".js-todo-list\");\r\n // Select the current todo items in the DOM\r\n const item = document.querySelector(`[data-key='${todo.id}']`);\r\n\r\n if(todo.deleted) {\r\n // remove the item from the DOM\r\n item.remove();\r\n return\r\n }\r\n\r\n // use te ternary opertor to check if the \"todo.checked\" is true \r\n // if so, assign 'done' to 'isChecked'.Otherwise, assign an empty string\r\n const isChecked = todo.checked ? 'done' : \" \";\r\n\r\n //create a 'li' element and assign it to 'node'\r\n const node = document.createElement(\"li\");\r\n //set the class attribute\r\n node.setAttribute(\"class\", `todo-item ${isChecked}`);\r\n //set the data-key attribute to the id of the todo\r\n node.setAttribute(\"data-key\", todo.id);\r\n \r\n //Setting the contents of the 'li' element created above \r\n node.innerHTML = `\r\n <input id =\"${todo.id}\" type=\"checkbox\" />\r\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\r\n <span>${todo.text}</span>\r\n <button class=\"delete-todo js-delete-todo\"> <svg><use href=\"#delete-icon\"></use></svg> </button>\r\n \r\n `;\r\n // If the item already exists in the DOM \r\n if (item) {\r\n list.replaceChild(node, item);\r\n } else {\r\n // Otherwise append it to the end of the list\r\n list.append(node);\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "4f3d628e6c594c655efbcfc55c7e1e18", "score": "0.6794065", "text": "function getTodoItem(obj) {\n var wrapper = document.createElement(\"div\"),\n text = document.createTextNode(obj.text),\n close_button = document.createElement(\"span\");\n\n wrapper.className = 'todo-item';\n if (obj.complete) wrapper.classList.toggle('complete');\n wrapper.id = '' + obj.id\n\n close_button.innerText = '❌';\n\n wrapper.addEventListener('click', function() {\n wrapper.classList.toggle('complete');\n });\n\n close_button.addEventListener('click', function(event) {\n context.deleteItem(wrapper);\n wrapper.remove();\n });\n\n wrapper.appendChild(text);\n wrapper.appendChild(close_button);\n\n return wrapper;\n }", "title": "" }, { "docid": "c9fe8547c23a885e356f6b0e46b3df84", "score": "0.6793659", "text": "function viewTodoListDom() {\n //clear list of items before render\n list.innerHTML = \"\";\n for (let i = 0; todoItemsOjb.todoItemsRender.length > i; i++) {\n addToDoItemDom(todoItemsOjb.todoItemsRender[i]);\n }\n}", "title": "" }, { "docid": "eb233f0a1997ce580c4a84f2c54dcb92", "score": "0.67904025", "text": "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "title": "" }, { "docid": "9ca143556679b46eef655eeaa22e189e", "score": "0.6774552", "text": "function addTodo(todo){\n\t//create new jQuery li (add the span for the X button)\n\tvar newTodo = $('<li class=\"task\">' + todo.name + '<span>X</span></li>');\n\t//stick the mongo _id in the jQuery data here so that the delete button works\n\tnewTodo.data('id', todo._id);\n\t//pstick the completed property in the jQuery data store\n\tnewTodo.data('completed', todo.completed);\n\t//cross out item if it's completed\n\tif(todo.completed) {\n\t\tnewTodo.addClass(\"done\");\n\t}\n\t//add the generated todo to the list on the page\n\t$(\".list\").append(newTodo);\n}", "title": "" }, { "docid": "537721d82540192ab8658b57ccadf9c4", "score": "0.6768575", "text": "function addTodo(todo) {\n const newTodo = $(`<li class=\"task\">${todo.name}<span>X</span></li>`);\n newTodo.data('id', todo.id);\n newTodo.data('completed', todo.completed);\n if(todo.completed) {\n newTodo.addClass('done');\n }\n $('.list').append(newTodo);\n}", "title": "" }, { "docid": "697a4153feadd12f9d4481c3c11b26e7", "score": "0.67592853", "text": "function add_todo_elements(id, todos_data_json){\n var parent = document.getElementById(id);\n parent.innerText = todos_data_json;\n}", "title": "" }, { "docid": "a9ed58c5e6a68cb9395bea97407d5c40", "score": "0.67569697", "text": "function createTodo(todo, retObj) {\n // Todo div\n const todoDiv = document.createElement(\"div\");\n todoDiv.classList.add(\"todo\");\n\n // Create li\n const newTodo = document.createElement(\"li\");\n\n newTodo.innerText = todo;\n newTodo.classList.add(\"new-todo\");\n todoDiv.appendChild(newTodo);\n\n // Confirm Button\n const confirmButton = document.createElement(\"button\");\n confirmButton.innerHTML = `<i class=\"fas fa-check\"></i>`;\n confirmButton.classList.add(\"confirm-btn\");\n todoDiv.appendChild(confirmButton);\n\n // Delete Button\n const deleteButton = document.createElement(\"button\");\n deleteButton.innerHTML = `<i class=\"fas fa-trash\"></i>`;\n deleteButton.classList.add();\n deleteButton.classList.add(\"delete-btn\");\n todoDiv.appendChild(deleteButton);\n\n // if retObj is true then creates returns the div\n if (retObj) {\n return todoDiv;\n }\n // Adding todoDiv to list\n todoList.appendChild(todoDiv);\n}", "title": "" }, { "docid": "a1d60df5d7186cef06e39b92225bcd1a", "score": "0.673361", "text": "function renderNewNote(noteObj) {\n const li = document.createElement('li')\n console.log(noteObj)\n// make the id of the li element the id of my todo object\n li.id = noteObj.id\n renderNewNote(li, noteObj)\n todoList.appendChild(li)\n}", "title": "" }, { "docid": "6d50006d34a0874aee0ee2b82b0e1f1f", "score": "0.6731715", "text": "function addTodo(text) {\n var todo = {\n text,\n checked: false,\n id: Date.now(),\n };\n \n todos.set(todo);\n \n const list = document.querySelector('.js-todo-list');\n pos ='beforeend';\n render = `\n <li class=\"todo-item\" data-key=\"${todo.id}\">\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n </li>`;\n list.insertAdjacentHTML(pos ,render);\n //console.log(todos.get(todo));\n}", "title": "" }, { "docid": "ec16d86fc04c9c55ab3724e662397234", "score": "0.67261326", "text": "function displayEntry(idx) { \n var entry = \"<div class=\\\"todo_title\\\">\" + this.title + \"</div>\\n\"\n + \"<div class=\\\"todo_date\\\">\" + this.date + \"</div>\\n\";\n // TODO: display category\n \n var content = \"<div class=\\\"todo_content\\\">\" + this.content + \"</div>\\n\";\n // TODO: display the different elements in the content list as unordered list.\n\n return entry + content;\n}", "title": "" }, { "docid": "46634422d903697e2f661146ebd11fea", "score": "0.67116517", "text": "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "title": "" }, { "docid": "b8172831a564537ba89212cd23140959", "score": "0.6706609", "text": "function createTaskElement(task) {\n const taskElement = document.createElement('li');\n taskElement.className = 'task';\n\n const titleElement = document.createElement('span');\n titleElement.innerText = task.title;\n\n \n\n taskElement.appendChild(titleElement);\n return taskElement;\n}", "title": "" }, { "docid": "ba7ca9712b2b72e81c28fa71dee30610", "score": "0.67006093", "text": "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\tcreateListElement(value, true); \n\t}\n}", "title": "" }, { "docid": "d23661da33042b26865d25e97be42b7d", "score": "0.66895974", "text": "function addtodo(e)\n{\n const todiv=document.createElement('div');\n todiv.classList.add(\"todo\");\n\n const newtodo=document.createElement('li');\n newtodo.innerText=todoinput.value;\n todiv.classList.add(\"todo-item\");\n todiv.appendChild(newtodo);\n saveLocalTodo(todoinput.value);\n \n const completedButton=document.createElement('button');\n \n completedButton.innerHTML=\"<i class='bx bx-check'></i>\";\n completedButton.classList.add(\"comp-butt\");\n todiv.appendChild(completedButton);\n\n \n const trashButton=document.createElement('button');\n \n trashButton.innerHTML=\"<i class='bx bx-trash'></i>\";\n trashButton.classList.add(\"trash-butt\");\n todiv.appendChild(trashButton);\n\n todolist.appendChild(todiv);\n todoinput.value=\" \";\n\n}", "title": "" }, { "docid": "0a0a0885f664134f9aef041d7e231409", "score": "0.6688228", "text": "createUndoneTask() {\n let taskUndoneItem = document.createElement(\"li\");\n taskUndoneItem.className = \"todo-list__item\";\n taskUndoneItem.innerHTML = `\n <input type=\"text\" class=\"todo-list__value\" disabled value=\"${this.value}\">\n \n <button class=\"todo-list__btn-edit\"><i class=\"far fa-edit\"></i></button>\n <button class=\"todo-list__btn-remove\"><i class=\"far fa-trash-alt\"></i></button>\n <form action=\"/action_page.php\">\n\t\t\t</form> `;\n\n return taskUndoneItem;\n }", "title": "" }, { "docid": "2e4eefdb3c44a82236f872dcda92ef6c", "score": "0.66876596", "text": "static renderTasks(tasks) {\n const todoList = document.getElementById(\"taskList\");\n let view = \"\";\n\n tasks.forEach(t => {\n let checked = t.completed ? \"checked\" : \"\";\n let classDone = t.completed ? \"done\" : \"\";\n // console.log(t.id + ' checked: ' + checked + ' ' + t.completed);\n view += `<li id='${t.id}' class='show ${classDone}'>\n <input type='checkbox'\n id='cb_${t.id}' onclick='checkTask(this.id)'${checked}/>\n <p>${t.content}</p>\n <a id='a_${t.id}' href='#' onclick='deleteTask(this.id)'> X </a> \n </li>`;\n });\n todoList.innerHTML = view;\n }", "title": "" }, { "docid": "bd920660f625c6933d65bdd3e4dc5066", "score": "0.6678931", "text": "static createTaskElement(title, due, priorityBtn, priority, id, completed) {\n let taskCompleted = completed ? 'completed' : '';\n let currentTask = `<div class=\"task\" data-id='${id}'>\n <input type=\"checkbox\" name=\"\" class=\"task-checkbox\">\n <div class=\"task-title ${taskCompleted}\"> ${title}</div>\n <div class=\"date-due\"> ${due}</div>\n <div class=\"priority btn-${priorityBtn}\">${priority}</div>\n ${elements.pencilSVG}\n ${elements.trashcanSVG}\n </div>`;\n return currentTask;\n }", "title": "" }, { "docid": "901b57f925e5ac2ea38e309a4d0d35fd", "score": "0.6673244", "text": "function renderTodoList() {\n //if there is nothing...\n if(!data.todo.length && !data.completed.length){\n //exit function\n return;\n }\n\n //if there is something...add them to DOM\n for (let i = 0; i < data.todo.length; i++) {\n let value = data.todo[i];\n addItemToDOM(value);\n }\n\n for (let j = 0; j < data.completed.length; j++) {\n let value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "title": "" }, { "docid": "4fd9b3dcb2988d412ad67f08aa3c47b3", "score": "0.6669992", "text": "function render(){\n var contenL1 = document.getElementById('todo-list-map');\n var arrTodoHtml =todo.map(function(item,i){\n return '<li class =\"list-group-item\" id =\"li-map-'+i+'\">' + item + ' ' \n + '<button class =\"btn btn-outline-secondary _btn-delete\" onclick=\"deleteTodo('+i+')\">Delete</button></li>';\n });\n var content = arrTodoHtml.join('');\n contenL1.innerHTML=content;\n }", "title": "" }, { "docid": "6e5bfc28e362b29b4b303013fd9253dd", "score": "0.6649992", "text": "function HTMLTaskCreator(name, idValue, orderValue, stateValue, animated) {\n\t\tvar newItem = document.createElement('li');\n\t\tif (animated) {\n\t\t\tnewItem.className = 'list-group-item align-items-center animate__animated animate__fadeInDown animate__faster';\n\t\t} else {\n\t\t\tnewItem.className = 'list-group-item align-items-center';\n\t\t}\n\t\tnewItem.innerHTML = `\n\t\t\t<div class=\"form-check col pretty p-bigger p-smooth p-round p-icon\">\n\t\t\t\t<input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"\">\n\t\t\t\t<div class=\"state\">\n\t\t\t\t\t<span class=\"icon mdi mdi-check\"><svg style=\"width:14px;height:14px\" viewBox=\"0 0 24 24\"><g><path fill=\"currentColor\" d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\" /><g></svg></span>\n\t\t\t\t\t<label class=\"form-check-label\" for=\"\">\n\t\t\t\t\t\t` + name + \n\t\t\t\t\t`</label>\n \t\t</div>\n \t</div>`;\n\t\tnewItem.setAttribute('data-task-id', idValue);\n\t\tnewItem.setAttribute('data-task-order-id', orderValue);\n\t\tnewItem.querySelector('.form-check-label').setAttribute('for', 'listItem'+idValue);\n\t\tnewItem.querySelector('.form-check-input').setAttribute('id', 'listItem'+idValue);\n\t\taddsButton(newItem);\n\t\tif (stateValue == \"undone\") {\n\t\t\tlist.appendChild(newItem);\n\t\t\tnewItem.querySelector('.form-check-input').checked = false;\n\t\t} else {\n\t\t\tlistDone.appendChild(newItem);\n\t\t\tnewItem.querySelector('.form-check-input').checked = true;\n\t\t}\n\t\t// Creates task in object if does not already exists\n\t\tvar idAlreadyExists = false;\n\t\tfor(var x = 0; x < tasks.length; x++) {\n\t\t if (tasks[x].id == idValue) {\n\t\t idAlreadyExists = true;\n\t\t break;\n\t\t }\n\t\t}\n\t\tif (idAlreadyExists === false) {\n\t\t\ttaskCreator(name, idValue, orderValue, stateValue);\n\t\t}\n\t}", "title": "" }, { "docid": "935f250c92c8090fecb5a5d0fa442712", "score": "0.66464496", "text": "function createTaskElement(task) {\n const taskElement = document.createElement('li');\n taskElement.className = 'task';\n\n const titleElement = document.createElement('span');\n titleElement.innerText = task.email;\n taskElement.appendChild(titleElement);\n const stateElement = document.createElement('span');\n stateElement.innerText = task.state;\n taskElement.appendChild(stateElement);\n const reasonElement = document.createElement('span');\n reasonElement.innerText = task.reason;\n taskElement.appendChild(reasonElement);\n return taskElement;\n}", "title": "" }, { "docid": "607e60fd9f5e3427bfd71ab9cf1a17f5", "score": "0.6644733", "text": "function displayNotes(notes) {\n $(\"#todo-list\").empty();\n for (var key in notes) {\n var classes = '';\n if(notes[key].status === 'completed') classes += ' strike';\n else if(notes[key].status === 'archived') continue;\n \n var note = $(`\n <li id='toDoListItem' data-uid=\"${key}\">\n <label class=${classes}>\n <input \n type='checkbox' \n name='todo-item-done' \n class='filled-in todo-item-done' \n value='${notes[key].text}'\n data-uid=\"${key}\" />\n ${notes[key].text}\n <button \n class='todo-item-delete waves-effect waves-light btn deleteItemBtn'\n data-uid=\"${key}\">\n Remove\n </button>\n </label>\n </li>\n `);\n $(\"#todo-list\").append(note);\n }\n }", "title": "" }, { "docid": "b5cbd3e78fdc0d3e0b39789a9b98712e", "score": "0.6643197", "text": "function newToDoItem(itemText, completed) {\n var newItem = {\n \"text\": itemText,\n \"completed\": completed\n }\n var toDoList = document.getElementById(\"todo\")\n var itemHTML = getToDoItemHTML(newItem)\n toDoList.append(itemHTML)\n}", "title": "" }, { "docid": "f509bc59aa9e59572ec056fd680f1431", "score": "0.66427684", "text": "function createTodo (val) {\r\n const elem = document.createElement('li')\r\n const content = document.createElement('span')\r\n const actionButtons = createActionButtons()\r\n elem.classList.add('list-item')\r\n content.classList.add('list-item-content')\r\n content.innerHTML = val\r\n elem.appendChild(content)\r\n elem.appendChild(actionButtons)\r\n return elem\r\n}", "title": "" }, { "docid": "ba23cd0fecd1b787de50d4918a90fcbc", "score": "0.66365933", "text": "function renderTheUI() {\n //below is how you make it usable\n const toDoList = document.getElementById(\"toDoList\");\n //textContent is an attribute that it has\n toDoList.textContent = \"\";\n\n //for everything in this list do the thing (this function) this function is not named\n toDos.forEach(function(toDo) {\n //these are creating html elements (document.createElement creates html element without being in the html file)\n const newLi = document.createElement(\"li\");\n const checkbox = document.createElement(\"input\");\n const deleteButton = document.createElement(\"button\");\n\n //create a function to use when you press delete\n function deleteToDo() {\n //I want my list toDos to be filled with filtered items that are not\n //filter is a built in function for lists, which runs a function against your lists\n //item is creating another anonomys function (instead of function ()) and\n //alternative to write [after .filter( ] this could be: function(item){ } item => {return item !== toDos;}\n toDos = toDos.filter(item => {\n return item.id !== toDo.id;\n });\n }\n\n //for above this is what the object item and toDo look like\n // {\n // title\n // complete\n // id\n // };\n deleteButton.addEventListener(\"click\", event => {\n deleteToDo();\n renderTheUI();\n });\n\n checkbox.type = \"checkbox\";\n\n newLi.textContent = toDo.title;\n deleteButton.textContent = \"Delete!\";\n\n toDoList.appendChild(newLi);\n newLi.appendChild(checkbox);\n newLi.appendChild(deleteButton);\n });\n }", "title": "" }, { "docid": "44e268f18692c2d819fe7ad3cfc52a53", "score": "0.66351825", "text": "function chnageInDOM (task){\n \n var html,newhtml;\n html = ' <li class = \"taskList\" id = \"%id%\" > %Value% <span class = \"icons\"><span class= \"complete_button\" button = \"complete\"><img src = \"_ionicons_svg_md-checkmark-circle.svg\" width = \"20px\" heigth = \"20px\"></button><span class = \"edit_button\" button = edit><img src = \"_ionicons_svg_md-create.svg\" width = \"20px\" heigth = \"20px\"></button><span class = \"delete_button\" button = \"delete\"><img src = \"_ionicons_svg_md-trash.svg\" width = \"20px\" height = \"20px\"></button></span></span></span> </span> </li>'\n \n newhtml = html.replace('%Value%',task.text);\n \n newhtml = newhtml.replace('%id%',task.id);// over ridding newhtml\n \n \n document.querySelector(\"#taskList_wrapper\").insertAdjacentHTML('beforeend',newhtml);\n }", "title": "" }, { "docid": "e022653fcebf9d6915e9cfb5d7151f54", "score": "0.6623699", "text": "function loadTodos(){\r\n var i;\r\n for (var i=0; i < todos.length; i++){\r\n\tdocument.getElementById('main-todo-list').innerHTML += '<div class=\"todo\"><input type=\"checkbox\" class=\"todo-checkbox\" /><span class=\"todo-text\">' + todos[i].text + '</span></div>';\r\n }\r\n}", "title": "" }, { "docid": "77afdcc439c54fe0399da5dd314a4b56", "score": "0.6615514", "text": "function renderTask(listTask) {\n ulList.innerHTML = '';\n\n listTask.forEach(function(item) {\n //check if the task is completed or not\n const checked = item.completed ? 'checked': null;\n\n const li = document.createElement('li');\n //set a class to the li\n li.setAttribute('class', 'task');\n //gives the li a id\n li.setAttribute('data-key', item.id);\n\n \n //it creates the li markup\n li.innerHTML = \n `<input type=\"checkbox\" class=\"checkbox\" ${checked}>\n <span>- ${item.name}</span>\n <i class=\"far fa-trash-alt delete-button\"></i>`;\n\n //if the task is completed, it add a line through\n if(item.completed === true) {\n li.children[1].classList.add('strike');\n }\n\n //add task inside ul\n ulList.append(li)\n\n });\n}", "title": "" }, { "docid": "8a4ce6db2e92038a763534c5ee5784aa", "score": "0.65910834", "text": "function buildList(itemArray) {\n var newHtml = '<div class=\"container\">';\n\n for (i = 0; i < itemArray.length; i++) {\n var changeStatusEvent = 'changeStatusOfItem(' + itemArray[i].id + ',' + '$(this).prop(\"checked\"))';\n var deleteItemEvent = 'deleteItem(' + itemArray[i].id + ')';\n var editItemEvent = 'addEditItem(' + itemArray[i].id + ')';\n var descriptionCss = getCssBasedOnPriority(itemArray[i].priorityID);\n\n newHtml += '<div class=\"row top-buffer item-row\">';\n newHtml += '<div class=\"col-sm-1 toDo-cb\">';\n newHtml += '<input type=\"checkbox\"';\n if (itemArray[i].isComplete) {\n newHtml += ' checked'\n }\n newHtml += ' onclick = ' + changeStatusEvent + '>';\n newHtml += '</div >';\n newHtml += '<div class=\"col-sm-7 ' + descriptionCss + '\">';\n newHtml += '<p>' + itemArray[i].description + '</p>';\n newHtml += '</div>';\n newHtml += '<div class=\"col-sm-4 btn-toolbar toDo-buttonGroup\">';\n newHtml += '<button onclick=' + editItemEvent + ' class=\"btn toDo-button btn-warning\"> Edit </button>';\n newHtml += '<button onclick=' + deleteItemEvent + ' class=\"btn toDo-button btn-danger\"> Delete </button>';\n newHtml += '</div>';\n newHtml += '</div>';\n }\n newHtml += '</div>';\n $('#toDoList').html(newHtml);\n}", "title": "" }, { "docid": "81256ffa93992af1db74aa7ee21817b7", "score": "0.65789986", "text": "function renderTask(task) {\n // Create HTML elements\n let item1 = document.createElement(\"li\");\n item1.innerHTML = \"<p>\" + task.taskDescription + \"</p>\";\n tasklist.appendChild(item1);\n let item2 = document.createElement(\"li\");\n item2.innerHTML = \"<p>\" + task.dueDate + \"</p>\";\n tasklist.appendChild(item2);\n let item3 = document.createElement(\"li\");\n item3.innerHTML = \"<p>\" + task.estimatedTime + \"</p>\";\n tasklist.appendChild(item3);\n let item4 = document.createElement(\"li\");\n item4.innerHTML = \"<p>\" + task.priorityRating + \"</p>\";\n tasklist.appendChild(item4);\n let item5 = document.createElement(\"li\");\n tasklist.appendChild(item5);\n // Extra Task DOM elements\n let delButton = document.createElement(\"button\");\n let delButtonText = document.createTextNode(\"Delete Task\");\n delButton.appendChild(delButtonText);\n item5.appendChild(delButton);\n // Event Listeners for DOM elements\n delButton.addEventListener(\"click\", function(event) {\n event.preventDefault();\n item1.remove();\n item2.remove();\n item3.remove();\n item4.remove();\n item5.remove();\n delButton.remove();\n });\n // Clear the input form \n form.reset();\n}", "title": "" }, { "docid": "0427d79c7304372920348a2ec7871e57", "score": "0.6567974", "text": "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "title": "" }, { "docid": "329272e9eee88d09aab7d6a6a94ceebf", "score": "0.6561066", "text": "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItemsReverse) {\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right todoinput\">\n \t\t\t\t<img class=\"image fit\"src=\"images/${todoItem.data.image}\" alt=\"\" />\n \t\t\t\t<div class=\"inner\">\n \t\t\t\t\t<header>\n \t\t\t\t\t\t<h2><a href=\"#/post/${todoItem.id}\">${todoItem.data.title}</a></h2>\n \t\t\t\t\t</header>\n \t\t\t\t\t<p>${todoItem.data.todo}</p>\n \t\t\t\t</div>\n \t\t\t</article>\n\t\t\t `;\n container.appendChild(div);\n };\n }", "title": "" }, { "docid": "7065413523876450f37575b3605e5e2d", "score": "0.6556465", "text": "function createEditInput (todo) {\r\n const content = todo.querySelector('.list-item-content').innerHTML\r\n const input = document.createElement('input')\r\n input.classList.add('edit-field')\r\n input.value = content\r\n return input\r\n}", "title": "" }, { "docid": "875c90d9019c3ed02c6c97b8ebfc4436", "score": "0.65560967", "text": "function addTODO(toDo, id, done, trash) {\r\n const position = \"beforeend\";\r\n if (trash) {\r\n return;\r\n }\r\n\r\n var DONE = done ? CHECK : UNCHECK;\r\n var LINE = done ? LINE_THROUGH : \"\";\r\n const item = `\r\n <li class=\"item\">\r\n <i class=\"fa ${DONE} co\" job=\"complete\" id=\"${id}\"></i>\r\n <p class=\"text ${LINE}\">${toDo}</p>\r\n <i class=\"fa fa-trash-o de\" job=\"delete\" id=\"\"${id}\"></i>\r\n </li>\r\n `;\r\n list.insertAdjacentHTML(position, item);\r\n }", "title": "" }, { "docid": "9d21e811b0cf6f403cc9847b8e78b4e6", "score": "0.6544916", "text": "render() {\n const tasksHtmlList = [];\n\n // Loops through tasks array objects to store in tasksHtmlList\n for (let i = 0; i < this.tasks.length; i++) {\n const task = this.tasks[i]; // initialize an array to store the tasks\n\n // Format the date\n const date = new Date(task.dueDate);\n const formattedDate =\n date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear();\n\n // Pass the task id as a parameter\n const taskHtml = createTaskHtml(\n // call the function expression creattaskHtml with parameters\n task.id,\n task.name,\n task.description,\n task.assignedTo,\n formattedDate,\n task.status\n );\n\n tasksHtmlList.push(taskHtml); // push the new task values to taskHtmlList\n }\n\n const tasksHtml = tasksHtmlList.join(\"\\n\");\n\n const tasksList = document.querySelector(\"#tasksList\");\n tasksList.innerHTML = tasksHtml;\n }", "title": "" }, { "docid": "fda54f6361c5347758dd600a89a760b9", "score": "0.6541617", "text": "function createNewToDo() {\n //Getting element from html and if it doesn't, it returns blank (if new toDo text does not have a value, return blank - if you leave text box blank, nothing happens)\n const newToDoText = document.getElementById(\"newToDoText\");\n if (!newToDoText.value) {\n return;\n }\n\n //look for the toDos above, it's creating am empty list. If i DO have a value, i want to push (add) the value(object things in {} with no functions etc) to the list(toDos)\n toDos.push({\n title: newToDoText.value,\n complete: false,\n //hey id, i'm giving you a value as opposed to just having one... it's... id (see: let id = 0;)\n id: id\n });\n\n //this is what html elements have - i have this element newToDoText, i want to put this value into it('s values slots). value is the label of the spot where newToDoText puts things. I have spots to put my name, gender, etc, same thing.\n newToDoText.value = \"\";\n //++ means take whatever the value of this is and add 1 to it \"here's a new box, (add a new number)\"\n id++;\n\n //calling the function below\n renderTheUI();\n }", "title": "" }, { "docid": "285c1e4f2826bbe98f27c41fa91cebb7", "score": "0.6526801", "text": "function render() {\n let ul = document.getElementById(\"ul\");\n ul.innerHTML = \"\";\n for (let i = 0; i < todos.length; i++) {\n // Create li element\n let li = document.createElement(\"li\");\n li.classList.add(\"list-group-item\");\n li.innerHTML = todos[i].name;\n ul.appendChild(li);\n\n //Create Checkbox\n let checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkBox\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n checkBox.checked = todos[i].isCompleted;\n if (checkBox.checked == true) {\n li.classList.add(\"itemIsChecked\");\n }\n checkBox.addEventListener(\"change\", () => {\n toggleCheckbox(todos[i].name);\n li.classList.toggle(\"itemIsChecked\");\n });\n li.appendChild(checkBox);\n\n //Create remove button\n let remove = document.createElement(\"button\");\n remove.classList.add(\"delete\");\n remove.setAttribute(\"type\", \"button\");\n remove.setAttribute(\"aria-label\", \"Delete button\");\n remove.innerHTML = '<i class=\"far fa-trash-alt\"></i>';\n remove.addEventListener(\"click\", () => {\n removeTodo(todos[i].name);\n li.remove();\n });\n li.appendChild(remove);\n }\n}", "title": "" }, { "docid": "ae72488a6149d78cfa893e90d39b9e8b", "score": "0.6526664", "text": "createTaskNode(task) {\n const li = document.createElement(\"li\")\n li.id = \"task\" + task.id\n li.className = \"list-group-item\"\n\n const exDiv = document.createElement(\"div\")\n exDiv.className = \"d-flex w-100 justify-content-between\"\n const inDiv = document.createElement(\"div\")\n inDiv.className = \"custom-control custom-checkbox\"\n\n const checkBox = document.createElement(\"input\")\n checkBox.type = \"checkbox\"\n checkBox.id = \"checkb-\" + task.id\n if(task.important)\n checkBox.className = \"custom-control-input important\"\n else\n checkBox.className = \"custom-control-input\"\n inDiv.appendChild(checkBox)\n\n const taskDescription = document.createElement(\"label\")\n taskDescription.className = \"custom-control-label\"\n taskDescription.htmlFor = checkBox.id\n taskDescription.innerText = task.description\n inDiv.appendChild(taskDescription)\n\n if(task.project) {\n const projectLabel = document.createElement(\"span\")\n projectLabel.className = \"project badge badge-dark ml-4\"\n projectLabel.innerText = task.project\n inDiv.appendChild(projectLabel)\n }\n\n exDiv.appendChild(inDiv)\n\n if(task.deadline) {\n const taskDeadline = document.createElement(\"small\")\n taskDeadline.className = \"date\"\n taskDeadline.innerText = task.deadline.format(\"dddd, MMMM Do YYYY, hh:mm:ss a\")\n const now = moment()\n if(task.deadline.isBefore(now)) {\n taskDeadline.classList.add(\"bg-danger\")\n taskDeadline.classList.add(\"text-white\")\n }\n exDiv.appendChild(taskDeadline)\n }\n\n if(!task.privateTask){\n inDiv.insertAdjacentHTML(\"afterend\", \"<img src=\\\"https://image.flaticon.com/icons/svg/615/615075.svg\\\" width=\\\"20\\\" height=\\\"20\\\" alt=\\\"\\\">\")\n }\n li.appendChild(exDiv)\n return li\n }", "title": "" }, { "docid": "c9a8f3037332249e007724a1ca92627a", "score": "0.6513784", "text": "function getTodo(todo)\n{\n\n let todos;\n if(localStorage.getItem('todos')=== null)\n {\n todos=[];\n } \n else\n {\n todos=JSON.parse(localStorage.getItem('todos')); \n }\n todos.forEach(function(todo){ \n const todiv=document.createElement('div');\n todiv.classList.add(\"todo\");\n\n const newtodo=document.createElement('li');\n newtodo.innerText=todo;\n todiv.classList.add(\"todo-item\");\n todiv.appendChild(newtodo);\n \n const completedButton=document.createElement('button');\n\n completedButton.innerHTML=\"<i class='bx bx-check'></i>\";\n completedButton.classList.add(\"comp-butt\");\n todiv.appendChild(completedButton);\n\n\n const trashButton=document.createElement('button');\n\n trashButton.innerHTML=\"<i class='bx bx-trash'></i>\";\n trashButton.classList.add(\"trash-butt\");\n todiv.appendChild(trashButton);\n\n todolist.appendChild(todiv);\n });\n}", "title": "" }, { "docid": "0bcafa0786d05c7f6a3c36786b01d918", "score": "0.6512984", "text": "function listHTMLString(item, index) {\r\n\t\treturn `<li class='list-content'> \\\r\n\t\t\t<div> \\\r\n\t\t\t\t<p class='task-to-do'><span class=${item.completed ? 'completed' : ''}>TASK: </span>\r\n\t\t\t\t\t<span class=${item.completed ? 'completed' : ''}>${item.task}</span> \\\r\n\t\t\t\t</p> \\\r\n\t\t\t\t<p>DEADLINE: <span class='deadline'>${item.date} ${item.time}</span></p> \\\r\n\t\t\t</div> \\\r\n\t\t\t<div data-list-index='${item.id}'> \\\r\n\t\t\t\t<i class='fas fa-check ${item.completed ? 'checked' : ''}'></i> \\\r\n\t\t\t\t<i class='fas fa-trash'></i> \\\r\n\t\t\t</div> \\\r\n\t\t</li>`\r\n\t}", "title": "" }, { "docid": "1ab0c136fe415d5ed6a667daad3f011a", "score": "0.6501686", "text": "function taskTemplate(value) {\n const {\n id,\n description\n } = value;\n let newTask =\n `<li class=\"task form-check\" id=\"taskDiv${id}\">\n <div class=\"pretty p-icon p-jelly p-round marginFix\">\n <input type=\"checkbox\" id=\"task${id}\">\n <div class=\"state p-info taskSettings\">\n <i class=\"icon material-icons\">done</i>\n <label id=\"taskLabel${id}\">${description}</label>\n </div>\n </div>\n <div class=\"taskSettings\">\n <i id=\"deleteIcon${id}\" class='material-icons'>delete</i>\n </div>\n </li>`;\n return newTask;\n}", "title": "" }, { "docid": "38a019cf15556c27ef4f3fdfd8bb70bd", "score": "0.6499664", "text": "function render () {\n $toDoList.empty();// empty existing posts from view\n var toDoHtml = getAllToDoHtml(allToDos); // pass `allToDos` into the template function\n $toDoList.append(toDoHtml);// append html to the view\n}", "title": "" }, { "docid": "84e9c186b1683edec624ab5dc1075fd2", "score": "0.64858043", "text": "function createTask(todo, parent) {\n let column = createElement({ class: 'col-md-4' });\n let taskField = createElement({ class: 'task d-flex' });\n taskField.style.background = todo.color;\n\n // <p>{inputValue}</p>\n let taskText = createElement('p');\n taskText.innerHTML = todo.todo;\n taskField.appendChild(taskText);\n\n // <i class=\"far fa-times-circle ms-auto\" ></i>\n let taskDelete = createElement('i', {\n class: 'far fa-times-circle ms-auto',\n });\n taskDelete.addEventListener('click', () => {\n fetch(`${BASE_URL}/${todo.id}`, { method: 'DELETE' });\n parent.removeChild(column);\n });\n taskField.appendChild(taskDelete);\n\n let controlPanel = createTaskController(taskField, todo.id);\n controlPanel.style.display = 'none';\n taskField.appendChild(controlPanel);\n\n // When mouseover in taskField, controlPanel Show\n taskField.addEventListener('mouseover', () => {\n controlPanel.style.display = 'flex';\n });\n\n // When mouseout from taskField, controlPanel Hide\n taskField.addEventListener('mouseout', () => {\n controlPanel.style.display = 'none';\n });\n\n column.appendChild(taskField);\n parent.appendChild(column);\n}", "title": "" }, { "docid": "92658a39f8113e8e88849ac73c3c46c3", "score": "0.6480978", "text": "function crearHTML() {\n\n limpiarHTML();\n\n if (todo.length > 0) {\n todo.forEach(todo => {\n //Agregar boton de eliminar \n const btnEliminar = document.createElement('a');\n btnEliminar.classList.add('borrar-tweet');\n btnEliminar.innerText = 'X';\n\n // Añadir la funcion de eliminar\n btnEliminar.onclick = () => {\n borrarIdea(todo.id);\n }\n\n const li = document.createElement('li');\n\n // añadir el texto\n li.innerText = todo.idea;\n\n // Asignar el boton\n li.appendChild(btnEliminar);\n\n // insertarlo en el html\n todoList.appendChild(li);\n });\n }\n\n sincronizarStorage();\n}", "title": "" }, { "docid": "677d2ae6dd01a34df454bf6b68590b9d", "score": "0.6476798", "text": "function addList(todo) {\n var li;\n if (todo.completed) {\n li = $(`<li class=\"done\">${todo.name} -- <span id=\"dltSpan\" class=\"fas fa-trash-alt\"></span></li>`)\n } else {\n li = $(`<li>${todo.name}<span id=\"dltSpan\" class=\"fas fa-trash-alt\"></span></li>`)\n }\n li.data('id', todo._id)\n $('#ul').append(li)\n}", "title": "" }, { "docid": "b9abcf1a0ccd14c486b986d260db3306", "score": "0.6476318", "text": "function renderTodos () {\n for (i=0; i < todos.length; i++) {\n var todoItem = todos [i];\n var liElement = document.createElement (\"li\");\n liElement.textContent = todoItem;\n todoList.appendChild(liElement);\n }\n}", "title": "" }, { "docid": "e89515c2f62be12da67ec844981230ed", "score": "0.64741117", "text": "function addTaskToDom ( task ) {\n jqueryMap.$list_box.prepend(\n '<li data-id=\"' + task.id + '\" >' + task.desc + '</li>'\n );\n }", "title": "" }, { "docid": "0c08b902c53e4a86fbf4bb1568f2e390", "score": "0.6463244", "text": "function renderTodos(listArray){\n\n $(\"#taskCont\").empty(); \n\nfor(var i = 0; i < listArray.length; i++){\n let toDoItem = $('<p>');\n toDoItem.text(listArray[i]);\n\n let toDoCompleted = $('<button>');\n toDoCompleted.attr('data-to-do', i);\n toDoCompleted.addClass(\"checkbox\");\n toDoCompleted.text(\"✓\");\n\n toDoItem = toDoItem.prepend(toDoCompleted);\n\n $(\"#taskCont\").append(toDoItem);\n}\n\nlocalStorage.setItem(\"toDoList\",JSON.stringify(listArray));\n\n\n}", "title": "" }, { "docid": "1ecc597c15ea3f90796e2c24dc94a5c1", "score": "0.64495987", "text": "function renderTodoHtmlNode(node) {\n const todoListContainer = document.getElementById(\"todo-list-container\")\n todoListContainer.appendChild(node)\n}", "title": "" }, { "docid": "af874beaf8e47dd8e43e4a762afab812", "score": "0.64407444", "text": "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "title": "" }, { "docid": "861e5c3e7ffb717b3e5547b8b77de52c", "score": "0.6437559", "text": "function todo_list(){ /*Defined the function todo_list()*/\n var todo_list_html = \"\"; /*taken a variable which is initialised with blank string. */\n\n if(todos.length){ /*now the array is empty, but as we will insert todo's in it , at each index there will be our li tag.so if there will be any elements in the array, this condition will execute.*/\n for(todo in todos){ /*doing loop through in the todos array, */\n todo_list_html += '<li class=\"list-group-item\"><span class=\"todo_text\">'+todos[todo]+'</span><button class=\"btn btn-danger btn-xs pull-right todo_delete_btn\">x</button></li>';\n }\n }else{\n todo_list_html = '<li class=\"list-group-item text-danger\">No Data Available</li>'; /*if there will be not anything in the todos array , then this part will execute.In this part, in local var , we simply just assign with no data available. */\n }\n $(\"#todo_list\").html(todo_list_html) /*so in that todo_list_html var ,we have the tags in string,so we are just pushing it in the UL list in html, by using the id of the ul tag.By doing that it will dynamically add there. */\n $(\"#todo_count\").html(todos.length) /*we have given a badge near the To Do heading,so at starting assigned with 0, then, what we are doing is, taking its id, and counting the todos array length.basically , what will show here, number of the elements present in the array.so simply we are changing.*/\n }", "title": "" }, { "docid": "e9f2f7ca6811f960d8057da2f61aab8a", "score": "0.6415104", "text": "function addToDoList(){\n var ulTaskList = document.getElementById(\"toDoTasks\"); \n ulTaskList.innerHTML = \"\";\n \n for (var i =0; i<taskList.length; i++){\n var taskItem = taskList[i];\n var liTaskItem = document.createElement(\"li\");\n \n //Concatenation of phrase//\n liTaskItem.innerHTML = taskItem.person + \" has to \" + taskItem.description + \" which is a/an \" + taskItem.difficulty +\" task\"; ulTaskList.appendChild(liTaskItem);\n \n }\n \n \n \n \n \n}", "title": "" }, { "docid": "180b14493536ffe4aa8dd6b50bf1e8c0", "score": "0.64030695", "text": "function addTask(){\n var li = document.createElement(\"LI\");\n li.className = classNames[\"TODO_ITEM\"];\n \n chk = addCheck();\n lbl = addLabel();\n btn = addButton();\n \n li.appendChild(chk);\n li.appendChild(label);\n li.appendChild(btn);\n\n return li;\n}", "title": "" }, { "docid": "038f2254de8807c749ce9f157acf95ad", "score": "0.640298", "text": "function addToDo(toDo,id,done,trash) {\r\n if(trash){ return;}\r\n\r\n const Done = done ? check : uncheck;\r\n\r\n const line = done ? lineTrough : '' ;\r\n\r\n\r\nconst text = `<li class=\"item\">\r\n <i job=\"check\" class=\"far ${Done}\" id =\"${id}\"></i>\r\n <p class=\"text ${line}\">${toDo}</p> \r\n <i job=\"delete\" class=\"fas fa-trash\" id =\"${id}\"></i>\r\n </li>`;\r\nlist.insertAdjacentHTML(\"afterbegin\",text);\r\n}", "title": "" }, { "docid": "3efc1fba198cc67d0797de1708f7e803", "score": "0.6395118", "text": "function renderTodos1(todos) {\n for (var _i = 0, todos_1 = todos; _i < todos_1.length; _i++) {\n var todo = todos_1[_i];\n // let newRow: HTMLTableRowElement = (<HTMLTableElement>document.querySelector('tcontent'))!.insertRow(); // liefert null, #todo\n var newRow = document.getElementById('tcontent').insertRow();\n newRow.insertCell().innerText = String(todo.id);\n newRow.insertCell().innerText = String(todo.userId);\n newRow.insertCell().innerText = String(todo.title);\n newRow.insertCell().innerText = String(todo.completed);\n if (todo.completed) {\n newRow.style.textDecoration = 'line-through';\n }\n }\n}", "title": "" }, { "docid": "88d4dfea2f6dab7c2cc0dbc6e6f1ed30", "score": "0.638882", "text": "function attachToDom(data){ \n //if the data completed is true, add it to the todo list, else, add it to the todo list\n let placeholder = data.completed ? completed: todo;\n //save data into the placeholder variable without erasing what already exists in there\n placeholder.innerHTML += render(data);\n}", "title": "" }, { "docid": "e20b49326dd95f1b4a095f02972ed34c", "score": "0.63672286", "text": "function createToDoElems(todos) {\n const fragment = document.createDocumentFragment();\n todos.forEach((todo) => {\n const selectedNote = todo.id;\n const li = document.createElement(\"li\");\n const checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.checked = todo.completed;\n const h2 = document.createElement(\"h2\");\n const p = document.createElement(\"p\");\n h2.innerText = todo.title;\n p.innerText = todo.text;\n const edit = document.createElement(\"button\");\n edit.innerText = \"Edit\";\n edit.classList.add(\"btn\");\n const done = document.createElement(\"button\");\n done.innerText = \"Done\";\n done.classList.add(\"btn\");\n const remove = document.createElement(\"button\");\n remove.innerText = \"Delete\";\n remove.classList.add(\"btn\");\n const color = document.createElement(\"input\");\n color.type = \"color\";\n const attach = document.createElement(\"input\");\n attach.type = \"file\";\n attach.setAttribute(\"id\", \"selectedFile\");\n const addFile = document.createElement(\"input\");\n addFile.type = \"button\";\n addFile.setAttribute(\"value\", \"Image\");\n addFile.classList.add(\"btn\");\n addFile.addEventListener(\"click\", () => {\n attach.click();\n });\n const image = document.createElement(\"div\");\n image.setAttribute(\"id\", \"imageToDisplay\");\n const panelOfCommands = document.createElement(\"div\");\n panelOfCommands.classList.add(\"panel\");\n\n panelOfCommands.appendChild(checkbox);\n panelOfCommands.appendChild(attach);\n panelOfCommands.appendChild(color);\n panelOfCommands.appendChild(addFile);\n panelOfCommands.appendChild(edit);\n panelOfCommands.appendChild(done);\n panelOfCommands.appendChild(remove);\n\n li.appendChild(image);\n li.appendChild(h2);\n li.appendChild(p);\n li.appendChild(panelOfCommands);\n\n fragment.appendChild(li);\n\n function editContent() {\n h2.contentEditable = true;\n p.contentEditable = true;\n h2.classList.add(\"selected\");\n p.classList.add(\"selected\");\n }\n\n function saveEditedContent() {\n h2.contentEditable = false;\n p.contentEditable = false;\n h2.classList.remove(\"selected\");\n p.classList.remove(\"selected\");\n\n const selectedNote = todo.id;\n fetch(`http://localhost:3000/todos/${selectedNote}`, {\n method: \"PATCH\",\n body: JSON.stringify({\n title: h2.innerText,\n text: p.innerText,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then((res) => res.json());\n }\n\n function saveCheckbox() {\n if (checkbox.checked === true) {\n fetch(`http://localhost:3000/todos/${selectedNote}`, {\n method: \"PATCH\",\n body: JSON.stringify({\n completed: true,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then((res) => res.json());\n } else {\n fetch(`http://localhost:3000/todos/${selectedNote}`, {\n method: \"PATCH\",\n body: JSON.stringify({\n completed: false,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then((res) => res.json());\n }\n }\n\n function changeColor() {\n let updateColor = li.style.backgroundColor;\n updateColor = color.value;\n fetch(`http://localhost:3000/todos/${selectedNote}`, {\n method: \"PATCH\",\n body: JSON.stringify({\n backgroundColor: updateColor,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then(() => displayToDos());\n }\n\n function deleteNote() {\n const url = `http://localhost:3000/todos/${selectedNote}`;\n fetch(url, {\n method: \"DELETE\",\n }).then(() => displayToDos());\n }\n\n function encodeImageFileAsURL() {\n const filesSelected = attach.files;\n\n if (filesSelected.length > 0) {\n const fileToLoad = filesSelected[0];\n const fileReader = new FileReader();\n\n fileReader.onload = function (fileLoadedEvent) {\n const srcData = fileLoadedEvent.target.result; // <--- data: base64\n\n const newImage = document.createElement(\"img\");\n newImage.src = srcData;\n newImage.style.width = \"100%\";\n newImage.style.height = \"300px\";\n image.innerHTML = newImage.outerHTML;\n\n const selectedNote = todo.id;\n fetch(`http://localhost:3000/todos/${selectedNote}`, {\n method: \"PATCH\",\n body: JSON.stringify({\n image: image.innerHTML,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }).then((res) => res.json());\n };\n fileReader.readAsDataURL(fileToLoad);\n }\n }\n attach.addEventListener(\"change\", encodeImageFileAsURL);\n color.addEventListener(\"blur\", changeColor);\n edit.addEventListener(\"click\", editContent);\n done.addEventListener(\"click\", saveEditedContent);\n remove.addEventListener(\"click\", deleteNote);\n checkbox.addEventListener(\"click\", saveCheckbox);\n });\n\n return fragment;\n}", "title": "" }, { "docid": "67020dd881e24022a3ca3fa0ba19a4a0", "score": "0.63671386", "text": "function newItem(todo) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = todo;\n list.appendChild(listItem);\n}", "title": "" }, { "docid": "85ea73d4e20ac133023b1721e86dee93", "score": "0.6361965", "text": "function renderer(tasksToRender) {\n applist.innerHTML = ''\n let fragRender = new DocumentFragment;\n for(let i = 0; i < tasksToRender.length; i++){\n let itemNode = document.createElement(\"LI\");\n if(tasksToRender[i].isComplete){\n itemNode.classList.add(\"line-through\");\n }\n itemNode.classList.add(\"todo-app__item\");\n const wrapper = document.createElement(\"DIV\");\n const checkbox = document.createElement(\"INPUT\");\n itemNode.setAttribute(\"id\", \"Li-\"+tasksToRender[i].id);\n // itemNode.setAttribute(\"class\")\n\n\n // innerHTML version\n itemNode.innerHTML = \n `<div class=\"todo-app__checkbox\">\n <input type=\"checkbox\" id=${tasksToRender[i].id}${tasksToRender[i].isComplete ? ' checked' : ''} />\n </label><label for=${tasksToRender[i].id}>\n </div>\n <h1 class=\"todo-app__item-detail\">${tasksToRender[i].input_content}</h1>\n <img src=\"./img/x.png\" alt=\"\" class=\"todo-app__item-x\" />`;\n applist.appendChild(itemNode);\n }\n todoCount.innerHTML = taskList.filter((ele) => !ele.isComplete).length + ' left';\n // error handler? -->renderer不用特別寫\n}", "title": "" }, { "docid": "364e0a98cbf83f88ac89e31865b71be4", "score": "0.63579434", "text": "function addTaskToToDoList() {\n if (task.value.length > 0) {\n var newTask = document.createElement(\"li\");\n var finalTask = document.createElement(\"label\");\n var taskToBeAdded = void 0;\n if (isCat(task.value)) {\n taskToBeAdded = new CatTask(task.value, \"https://breakbrunch.com/wp-content/uploads/2019/06/cute-cat-with-big-eyes-041619-1.jpg\");\n var img = document.createElement(\"img\");\n img.src = taskToBeAdded.url;\n img.height = 30;\n img.width = 30;\n newTask.appendChild(img);\n }\n else {\n taskToBeAdded = new NormalTask(task.value, false);\n var checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.className = \"todo-check\";\n checkbox.addEventListener(\"click\", tickDoneOnToDoList);\n newTask.appendChild(checkbox);\n }\n finalTask.appendChild(document.createTextNode(taskToBeAdded.text));\n finalTask.className = \"todo\";\n newTask.appendChild(finalTask);\n var newDeleteButton = document.createElement(\"button\");\n newDeleteButton.appendChild(document.createTextNode(\"delete\"));\n newDeleteButton.className = \"btn btn-outline-warning\";\n newDeleteButton.setAttribute(\"id\", \"delete\");\n newDeleteButton.addEventListener(\"click\", deleteTaskFromToDoList);\n newTask.appendChild(newDeleteButton);\n newTask.appendChild(document.createElement(\"BR\"));\n newTask.appendChild(document.createElement(\"BR\"));\n todoList.appendChild(newTask);\n task.value = \"\";\n }\n}", "title": "" }, { "docid": "60ceed1fc357f8df119a5bb8e9ea5ad5", "score": "0.63561916", "text": "function createTodo(text){\r\n var markup = \r\n '<li class=\"ui-state-default\"> <div class=\"row\"><label class=\"custom-checkbox pt-2 col-10\"> <i class=\"far fa-square pt-2\"></i>&nbsp;'+text+'</label><button id=\"removeButton\" class=\"remove-item btn removeButton\"><i class=\"fas fa-times\"></i></button></div><hr class=\"mb-0 mt-1\"></li>';\r\n $(markup).appendTo(\"#sortable\").hide().slideDown();\r\n $('.add-todo').val('');\r\n countTodos();\r\n}", "title": "" }, { "docid": "827c9c4a02453b1f014b7978dd626506", "score": "0.6350171", "text": "function addItemToDOM(itemText, completed) {\r\n //creates li on HTML (next task)\r\n const item = document.createElement('li');\r\n\r\n //inserts text in li\r\n item.innerText = itemText;\r\n\r\n // creates div class=buttons\r\n const buttons = document.createElement('div');\r\n buttons.classList.add('buttons');\r\n\r\n\r\n // creates remove button class= remove\r\n const removeButton = document.createElement('button');\r\n // defines class\r\n removeButton.classList.add('remove')\r\n // gets svg img\r\n removeButton.innerHTML = removeIcon;\r\n // executes removeItem function\r\n removeButton.onclick = removeItem;\r\n\r\n // creates complete button class= complete\r\n const completeButton = document.createElement('button');\r\n //defines class\r\n completeButton.classList.add('complete');\r\n //gets svg img\r\n completeButton.innerHTML = completeIcon;\r\n // executes completeItem function\r\n completeButton.onclick = completeItem;\r\n\r\n // associates remove/complete buttons to div\r\n buttons.append(removeButton);\r\n buttons.append(completeButton);\r\n //associate buttons do li\r\n item.append(buttons);\r\n\r\n // conditional ternary operator\r\n const listId = (completed ? 'completed-list' : 'todo-list');\r\n //accesses ul by id and adds item to the beggining of the to-do/complete list\r\n document.getElementById(listId).prepend(item);\r\n}", "title": "" }, { "docid": "5af0d61329cc16713ebc83d0adaf3924", "score": "0.634393", "text": "function liCreator(itemText, itemID, toDoStatus, classArray=[]) \n{\n\tlet list;\t\n\tlet newToDoItem = document.createElement(\"li\");\n\tlet liTextContainer = document.createElement(\"span\");\n\n\tliTextContainer.textContent = itemText;\n\tnewToDoItem.appendChild(liTextContainer);\n\n\tfor(let i = 0; i < classArray.length; i++) {\n\t\tnewToDoItem.classList.add(classArray[i]);\n\t}\n\tnewToDoItem.setAttribute(\"id\", itemID);\n\n\n\tif(toDoStatus === \"In Progress\")\n\t{\n\n\t\tnewToDoItem.classList.add(\"to-do-list-item\");\n\t\tlist = document.querySelector(\"#toDoUL\");\n\t\tlist.appendChild(newToDoItem);\n\t\tcheckboxCreator(itemID);\n\t}\n\telse\n\t{\n\t\tnewToDoItem.classList.add(\"done-list-item\");\n\t\tlist = document.querySelector(\"#doneUL\");\n\t\tlist.appendChild(newToDoItem);\n\t}\n}", "title": "" }, { "docid": "3b6c5da058c7e92613c1ed4f65f1ec91", "score": "0.63334394", "text": "function getTodos() {\n checksaveTodos();\n todos.forEach(function(todo) {\n var newList = document.createElement('li');\n newList.classList.add(\"list-item\");\n newList.innerHTML = `${todo}`;\n unList.append(newList);\n var icon = document.createElement('i');\n icon.setAttribute(\"class\", \"fas fa-trash\");\n newList.appendChild(icon);\n })\n pendingItem(todos);\n}", "title": "" }, { "docid": "4de13eab13b83d7a764cf53a8d0ae5a5", "score": "0.6330824", "text": "function addTask(){\n var userInput = document.getElementById('input-task').value\n var parentEl = document.getElementById('parent-el')\n\n // creating li element\n var liEl = elementGenerator('li' , userInput)\n\n // Creating Span element\n var spanEl = document.createElement('span')\n\n // Creating Delete Button Element\n var deleteBtnEl = elementGenerator('button' , 'Delete')\n deleteBtnEl.setAttribute('class' , 'deleteBtn')\n deleteBtnEl.setAttribute('onClick' , 'deleteLi(this)')\n\n // Creating Edit Button Element\n var editBtnEl = elementGenerator('button' , \"Edit\")\n editBtnEl.setAttribute('class' , 'editBtn')\n editBtnEl.setAttribute('onClick' , 'editTodo(this)')\n\n \n // Appending Buttons into SPAN\n spanEl.appendChild(deleteBtnEl)\n spanEl.appendChild(editBtnEl) \n\n // Appending Span el into LI\n liEl.appendChild(spanEl)\n\n // Appending LI el onto DOM\n parentEl.appendChild(liEl)\n}", "title": "" } ]
1d49939f40553e1d34e815ed63b0eee3
Applies the [[Fill]] effect to a sprite, changing the color channels of all nontransparent pixels to match a given color
[ { "docid": "072b2b7957d9cf87083b83c60582bfac", "score": "0.6992056", "text": "fill(color) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Fill\"](color));\n }", "title": "" } ]
[ { "docid": "a6e4c4ebafcfa4be9ce8053f6a47f1fa", "score": "0.6395863", "text": "fill(color) {\n this.addEffect(new Effects.Fill(color));\n }", "title": "" }, { "docid": "0c74ebc6ae20dc6da7d7cc91fa61424c", "score": "0.6358689", "text": "function fillBG() {\n ctx.fillStyle = '#191970';\n ctx.fillRect(0, 0, 399, 280);\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 307, 399, 280);\n}", "title": "" }, { "docid": "87fb809ebc6ecd53ff40de7a2f894bab", "score": "0.63463235", "text": "function colorPixel(pixelPos, imgData, curFillRGBA) {\r\n imgData.data[pixelPos] = curFillRGBA[0];\r\n imgData.data[pixelPos + 1] = curFillRGBA[1];\r\n imgData.data[pixelPos + 2] = curFillRGBA[2];\r\n imgData.data[pixelPos + 3] = 255;\r\n }", "title": "" }, { "docid": "cc1d4d3c4320e77decaafea3967795c8", "score": "0.6232841", "text": "function _ctx_fill(fill) {\n if (fill && (fill.a > 0 || fill.clr1)) {\n // Ignore transparent colors.\n // Avoid switching _ctx.fillStyle() - we can gain up to 5fps:\n var f = fill._get();\n if (_ctx.state._fill != f) {\n _ctx.fillStyle = _ctx.state._fill = f;\n }\n _ctx.fill();\n }\n}", "title": "" }, { "docid": "ab2de76dae35f8d566f0164e16e5a25d", "score": "0.62094235", "text": "function losp_2Dpixfill (rawData, index, red, green, blue, trans) {\n\t//window.console.log('Previous pixel color: r' + rawData[index] + ', g' + rawData[index+1] + ', b' + rawData[index+2]);\n\trawData[index] = red;\n\trawData[index+1] = green;\n\trawData[index+2] = blue;\n\trawData[index+3] = trans;\n}", "title": "" }, { "docid": "b7763ca3ef0657138734ce5969d413eb", "score": "0.620562", "text": "function setTransparent(imgd) {\r\n //let imgd = ctx2.getImageData(0, 0, 1280, 720);\r\n let pix = imgd.data;\r\n let newColor = { r: 0, g: 0, b: 0, a: 0 };\r\n\r\n for (let i = 0, n = pix.length; i < n; i += 4) {\r\n let r = pix[i];\r\n let g = pix[i + 1];\r\n let b = pix[i + 2];\r\n\r\n // If its white then change it\r\n if (r == 128 && g == 128 && b == 128) {\r\n //console.log(pix[i + 3],'is alpha for white');\r\n // Change the white to whatever.\r\n pix[i] = newColor.r;\r\n pix[i + 1] = newColor.g;\r\n pix[i + 2] = newColor.b;\r\n pix[i + 3] = newColor.a;\r\n }\r\n };\r\n\r\n return pix;\r\n}", "title": "" }, { "docid": "d40becefd662690cbf7b82d86361e38e", "score": "0.6191811", "text": "function setTransparent(imgd) {\n //let imgd = ctx2.getImageData(0, 0, 1280, 720);\n let pix = imgd.data;\n let newColor = { r: 0, g: 0, b: 0, a: 0 };\n\n for (let i = 0, n = pix.length; i < n; i += 4) {\n let r = pix[i];\n let g = pix[i + 1];\n let b = pix[i + 2];\n\n // If its white then change it\n if (r == 128 && g == 128 && b == 128) {\n //console.log(pix[i + 3],'is alpha for white');\n // Change the white to whatever.\n pix[i] = newColor.r;\n pix[i + 1] = newColor.g;\n pix[i + 2] = newColor.b;\n pix[i + 3] = newColor.a;\n }\n };\n\n return pix;\n}", "title": "" }, { "docid": "d85f02c887844aefe434764182d4ea23", "score": "0.61828166", "text": "function colourPixel(pixelPos, imgData, curFillRGBA) {\n\timgData.data[pixelPos] = Number(curFillRGBA[0]);\n\timgData.data[pixelPos + 1] = Number(curFillRGBA[1]);\n\timgData.data[pixelPos + 2] = Number(curFillRGBA[2]);\n\timgData.data[pixelPos + 3] = Math.round(Number(curFillRGBA[3]) * 255);\n}", "title": "" }, { "docid": "b96b11376542099e0e99cb6992736dc4", "score": "0.6130546", "text": "drawColor() {\n this.engine.notify('draw.redraw', {});\n this.tiles.forEach((tile) => {\n this.painter.paint(tile, this.imageBuffer, this.width);\n });\n this.context.putImageData(this.imageData, 0, 0, 0, 0, this.width, this.height);\n }", "title": "" }, { "docid": "b8bf8c33b1f5311e4c601f3492ec668c", "score": "0.6064101", "text": "function drawTint(x, y, w, h) {\r\n ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';\r\n ctx.fillRect(x, y, w, h);\r\n}", "title": "" }, { "docid": "6ea8084b64546fcb3ce5f4b3f98be09d", "score": "0.60234296", "text": "function reColor(piece, position) {\n\tvar coordinate = IndexToPair(position);\n\t//color without borders\n\tctx.clearRect(coordinate[0] * pieceWidth , coordinate[1] * pieceHeight, pieceWidth, pieceHeight);\n\tctx.drawImage(image, piece.row * pieceWidth, piece.col * pieceHeight, pieceWidth, pieceHeight,\n\tcoordinate[0] * pieceWidth,\n\tcoordinate[1] * pieceHeight,\n\tpieceWidth, pieceHeight);\n\t//add greenborders\n\tcolorGreen(piece, position);\n}", "title": "" }, { "docid": "391d7237596731bde5d4622c4f28ba2b", "score": "0.6016481", "text": "function offRed(x,y) {\n\n ctx.beginPath();\n ctx.rect(x,y,100,80);\n ctx.fillStyle = \"#273746\";\n ctx.fill();\n ctx.stroke();\n\n}", "title": "" }, { "docid": "82f65b64a6cdadcd889dc59dab0ae262", "score": "0.5966344", "text": "function makeSprite() {\n var shaded = [\n // 0 +10 -10 -20\n ['#c1c1c1', '#dddddd', '#a6a6a6', '#8b8b8b'],\n ['#25bb9b', '#4cd7b6', '#009f81', '#008568'],\n ['#3397d9', '#57b1f6', '#007dbd', '#0064a2'],\n ['#e67e23', '#ff993f', '#c86400', '#a94b00'],\n ['#efc30f', '#ffdf3a', '#d1a800', '#b38e00'],\n ['#9ccd38', '#b9e955', '#81b214', '#659700'],\n ['#9c5ab8', '#b873d4', '#81409d', '#672782'],\n ['#e64b3c', '#ff6853', '#c62c25', '#a70010'],\n ['#898989', '#a3a3a3', '#6f6f6f', '#575757'],\n ];\n var glossy = [\n //25 37 52 -21 -45\n ['#ffffff', '#ffffff', '#ffffff', '#888888', '#4d4d4d'],\n ['#7bffdf', '#9fffff', '#ccffff', '#008165', '#00442e'],\n ['#6cdcff', '#93feff', '#c2ffff', '#00629f', '#002c60'],\n ['#ffc166', '#ffe386', '#ffffb0', '#aa4800', '#650500'],\n ['#ffff6a', '#ffff8c', '#ffffb8', '#b68a00', '#714f00'],\n ['#efff81', '#ffffa2', '#ffffcd', '#6b9200', '#2c5600'],\n ['#dc9dfe', '#ffbeff', '#ffe9ff', '#5d287e', '#210043'],\n ['#ff9277', '#ffb497', '#ffe0bf', '#a7000a', '#600000'],\n ['#cbcbcb', '#ededed', '#ffffff', '#545454', '#1f1f1f'],\n ];\n var tgm = [\n ['#7b7b7b', '#303030', '#6b6b6b', '#363636'],\n ['#f08000', '#a00000', '#e86008', '#b00000'],\n ['#00a8f8', '#0000b0', '#0090e8', '#0020c0'],\n ['#f8a800', '#b84000', '#e89800', '#c85800'],\n ['#e8e000', '#886800', '#d8c800', '#907800'],\n ['#f828f8', '#780078', '#e020e0', '#880088'],\n ['#00e8f0', '#0070a0', '#00d0e0', '#0080a8'],\n ['#78f800', '#007800', '#58e000', '#008800'],\n ['#7b7b7b', '#303030', '#6b6b6b', '#363636'],\n ];\n var world = [];\n world[0] = tgm[0];\n world[1] = tgm[6];\n world[2] = tgm[2];\n world[3] = tgm[3];\n world[4] = tgm[4];\n world[5] = tgm[7];\n world[6] = tgm[5];\n world[7] = tgm[1];\n world[8] = tgm[8];\n\n spriteCanvas.width = cellSize * 9;\n spriteCanvas.height = cellSize;\n for (var i = 0; i < 9; i++) {\n var x = i * cellSize;\n if (settings.Block === 0) {\n // Shaded\n spriteCtx.fillStyle = shaded[i][1];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n\n spriteCtx.fillStyle = shaded[i][3];\n spriteCtx.fillRect(x, cellSize / 2, cellSize, cellSize / 2);\n\n spriteCtx.fillStyle = shaded[i][0];\n spriteCtx.beginPath();\n spriteCtx.moveTo(x, 0);\n spriteCtx.lineTo(x + cellSize / 2, cellSize / 2);\n spriteCtx.lineTo(x, cellSize);\n spriteCtx.fill();\n\n spriteCtx.fillStyle = shaded[i][2];\n spriteCtx.beginPath();\n spriteCtx.moveTo(x + cellSize, 0);\n spriteCtx.lineTo(x + cellSize / 2, cellSize / 2);\n spriteCtx.lineTo(x + cellSize, cellSize);\n spriteCtx.fill();\n } else if (settings.Block === 1) {\n // Flat\n spriteCtx.fillStyle = shaded[i][0];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n } else if (settings.Block === 2) {\n // Glossy\n var k = Math.max(~~(cellSize * 0.083), 1);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x + cellSize, cellSize);\n grad.addColorStop(0.5, glossy[i][3]);\n grad.addColorStop(1, glossy[i][4]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x + cellSize, cellSize);\n grad.addColorStop(0, glossy[i][2]);\n grad.addColorStop(0.5, glossy[i][1]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, 0, cellSize - k, cellSize - k);\n\n var grad = spriteCtx.createLinearGradient(\n x + k,\n k,\n x + cellSize - k,\n cellSize - k,\n );\n grad.addColorStop(0, shaded[i][0]);\n grad.addColorStop(0.5, glossy[i][0]);\n grad.addColorStop(0.5, shaded[i][0]);\n grad.addColorStop(1, glossy[i][0]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + k, k, cellSize - k * 2, cellSize - k * 2);\n } else if (settings.Block === 3 || settings.Block === 4) {\n // Arika\n if (settings.Block === 4) tgm = world;\n var k = Math.max(~~(cellSize * 0.125), 1);\n\n spriteCtx.fillStyle = tgm[i][1];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n spriteCtx.fillStyle = tgm[i][0];\n spriteCtx.fillRect(x, 0, cellSize, ~~(cellSize / 2));\n\n var grad = spriteCtx.createLinearGradient(x, k, x, cellSize - k);\n grad.addColorStop(0, tgm[i][2]);\n grad.addColorStop(1, tgm[i][3]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + k, k, cellSize - k * 2, cellSize - k * 2);\n\n var grad = spriteCtx.createLinearGradient(x, k, x, cellSize);\n grad.addColorStop(0, tgm[i][0]);\n grad.addColorStop(1, tgm[i][3]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, k, k, cellSize - k);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x, cellSize - k);\n grad.addColorStop(0, tgm[i][2]);\n grad.addColorStop(1, tgm[i][1]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + cellSize - k, 0, k, cellSize - k);\n }\n }\n}", "title": "" }, { "docid": "b6f02b59138c6194c2ea9ec401590eae", "score": "0.5944495", "text": "function criarBG() {\r\n context.fillStyle = \"lightgreen\";\r\n context.fillRect(0, 0, 16 * box, 16 * box);\r\n}", "title": "" }, { "docid": "e35e848766da54f4d29e523ede858a2f", "score": "0.5910615", "text": "function fillRect(png, x, y, w, h, color) {\n for (let i = 0; i < w; i++) {\n for (let j = 0; j < h; j++) {\n png.buffer[png.index(x + i, y + j)] = color;\n }\n }\n}", "title": "" }, { "docid": "9c3eb8c56a4abd8828e39c782d787fce", "score": "0.59076697", "text": "fill(pixel = Pixel.TRANSPARENT) {\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n this.set(x, y, pixel);\n }\n }\n\n return this;\n }", "title": "" }, { "docid": "cff19e40c429dec71a86553ada056437", "score": "0.5869486", "text": "function correctColor(){\n\tfor (var i = 0; i < tiles.length; i++) {\n\t\t\t\ttiles[i].style.background = picked;\n\t\t\t}\n}", "title": "" }, { "docid": "c685049142bf738d3e7d81edd355d5ec", "score": "0.5865026", "text": "function draw(){\r\n background(0,180,255);\r\n}", "title": "" }, { "docid": "a10e9b608083abfb85305ac0b3b2dee3", "score": "0.5852681", "text": "function changeColor() {\n stroke(255);\n fill(0);\n rect(125, 125, 60, 60);\n rect(-15, -15, 30, 30);\n rect(115, -25, 40, 40);\n}", "title": "" }, { "docid": "a58886c215e3fe7093b76ec6f4aaf282", "score": "0.58350766", "text": "function offPink(x,y) {\n\n ctx.beginPath();\n ctx.rect(x,y,100,80);\n ctx.fillStyle = \"#273746\";\n ctx.fill();\n ctx.stroke();\n\n}", "title": "" }, { "docid": "db9e770dd8bbb6eca72661fb84d93ac1", "score": "0.58325225", "text": "function applyFade() {\n // Set the color to a partially transparent black\n ctx.fillStyle='rgba(0,0,0,0.05)';\n // Fills the whole screen which gives us the fade out.\n ctx.fillRect(0, 0, maxX, maxY);\n\n}", "title": "" }, { "docid": "79107f9844b3d0ae684f331058e265b5", "score": "0.58259696", "text": "fill(...color) { this.addColorType(\"fill\", color) }", "title": "" }, { "docid": "a5dbc6c4eef53beacb7d765e19a09449", "score": "0.5808039", "text": "function changeColor() {\n \n canvasBaseR = random(256);\n canvasBaseG = random(256);\n canvasBaseB = random(256);\n //canvasFillColorMaxDistance = random(40);\n \n for(let i = 0; i < circles.length; i++) {\n if(circles[i] != null) {\n let colorVariety = random(canvasFillColorMaxDistance);\n circles[i].fillStyleUpdateRequired = true;\n circles[i].destFillStyle = [canvasBaseR + colorVariety, canvasBaseG + colorVariety, canvasBaseB + colorVariety]\n }\n }\n\n}", "title": "" }, { "docid": "7b200eb7c15b69b64c3b176cee3e05fb", "score": "0.57804567", "text": "function solid(width, height, clr) { \n /* Returns an image with a solid fill color.\n */\n return render(function(canvas) { \n rect(0, 0, width, height, {fill: clr || [0,0,0,0]}); \n }, width, height);\n}", "title": "" }, { "docid": "90504d14c6282ca89e5f548f76223a6c", "score": "0.57734936", "text": "function offGreen(x,y) {\n\n ctx.beginPath();\n ctx.rect(x,y,100,80);\n ctx.fillStyle = \"#273746\";\n ctx.fill();\n ctx.stroke();\n\n}", "title": "" }, { "docid": "bd7c45091a6635ae73655feb69808d57", "score": "0.57623065", "text": "setPixelColor(coord, color){\n this.data[coord] = color.r\n this.data[coord+1] = color.g\n this.data[coord + 2] = color.b\n this.data[coord + 3] = 255 // should be removable if image file has no transparency\n }", "title": "" }, { "docid": "53d1fe71eb70c9fa63c8657c9c2c8cd7", "score": "0.5756652", "text": "function paintNode(node, color) {\r\r\n \r\r\n\tvar redFilter = new createjs.ColorFilter(1,0,0,1),\r\r\n\tblackFilter = new createjs.ColorFilter(0,0,0,1),\r\r\n\tgreenFilter = new createjs.ColorFilter(0,1,0,1);\r\r\n\t\r\r\n \r\r\n\tif (color == \"black\" ) {\r\r\n\t node.bitmap_image.filters = [ blackFilter ];\r\r\n\t node.changeTextColor(\"#ffffff\");\r\r\n\t}\r\r\n\t\r\r\n\telse if (color == \"red\" ){\r\r\n\t node.bitmap_image.filters = [ redFilter ];\r\r\n\t}\r\r\n\t\r\r\n\telse{\r\r\n\t node.bitmap_image.filters = [ greenFilter ]; \r\r\n\t \r\r\n\t}\r\r\n \r\r\n\t\r\r\n\tnode.bitmap_image.cache(0,0, node.bitmap_image.image.width,\r\r\n\t node.bitmap_image.image.height);\r\r\n\t//var tween = createjs.Tween.get(filter).\r\r\n\t //to({redMultiplier:1 }, 1000);\r\r\n\t\r\r\n\t\r\r\n\tnode.color = color;\r\r\n\t\r\r\n\tfunction updateCache (node){ node.bitmap_image.cache(0,0,\r\r\n\tnode.bitmap_image.width,node.bitmap_image.height); }\r\r\n\t\r\r\n }", "title": "" }, { "docid": "59f08d7bfa7249d1c267e150de7f77b9", "score": "0.575174", "text": "function initColor(){\n \n for (var k = 0; k < regions.length; k++) {\n regions[k].node.style.opacity = 1; \n\t\t regions[k].node.setAttribute('fill', 'none'); \n }\n }", "title": "" }, { "docid": "195202ebc144ec7d9ae7795e2650fc70", "score": "0.57512224", "text": "function colorTile(tile, color) {\r\n tile.style.backgroundColor = color;\r\n}", "title": "" }, { "docid": "12cc4408e27d9977e848442b7f5e841a", "score": "0.57421947", "text": "function fill(x, y, original_color, color) {\n if (x < 0 || y < 0 || x >= world[0].length || y >= world.length) {\n return false;\n }\n if (world[y][x] != original_color) return false;\n world[y][x] = color;\n fill(x - 1, y, original_color, color);\n fill(x + 1, y, original_color, color);\n fill(x, y - 1, original_color, color);\n fill(x, y + 1, original_color, color);\n drawWorld();\n return true;\n}", "title": "" }, { "docid": "a0dde6dff46fa14f67b0383b58e90bba", "score": "0.57229394", "text": "function _fillPixels(buffer, offset, color)\n{\n for (let i = offset; i < buffer.length; i = i + 4)\n {\n buffer[i] = color;\n }\n}", "title": "" }, { "docid": "91df9ea7b4be2f8fe360bed5d7131c75", "score": "0.5713825", "text": "function fillRoomColor(element) {\n var bg = element.style.fill || '';\n if (bg === '' || bg === 'transparent') {\n element.style.fill = '#ffff32';\n }\n }", "title": "" }, { "docid": "19007247f9dbf0107fa90fe585c5ddf8", "score": "0.5701242", "text": "function fill(color, posX, posY){\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.fillRect(posX, posY, 1, 1);\n ctx.closePath();\n}", "title": "" }, { "docid": "5cbc04c94130afeb96487335e4d948bc", "score": "0.56995994", "text": "function cover(color) {\n \n this.graphics = game.add.graphics(0, 0);\n this.graphics.beginFill(color);\n this.graphics.drawRect(0, 0, game.scale.width, game.scale.height);\n this.graphics.endFill();\n this.graphics.fixedToCamera = true;\n}", "title": "" }, { "docid": "35265ac83e9d844d4e6d0cd41ba91bac", "score": "0.5698162", "text": "function fill(color) {\n attributes.useFill = true;\n attributes.fill = color;\n}", "title": "" }, { "docid": "f2e65a7ec78243d69ba8a38eb14b7e9e", "score": "0.56902266", "text": "function MakeIconColor() {\n ct.clearRect(0, 0, 200, 200);\n ct.fillStyle = document.getElementById(\"back\").value;\n ct.fillRect(0,0,200,200);\n}", "title": "" }, { "docid": "375cdc2f21a4bf1258bded62a469dc1a", "score": "0.56869423", "text": "function blackAndWhite(){\n let imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n for (i = 0; i < imgData.data.length; i += 4) {\n let count = imgData.data[i] + imgData.data[i + 1] + imgData.data[i + 2];\n let colour = 0;\n if (count > 383) colour = 255;\n \n imgData.data[i] = colour;\n imgData.data[i + 1] = colour;\n imgData.data[i + 2] = colour;\n imgData.data[i + 3] = 255;\n \n }\n\n ctx.putImageData(imgData, 0, 0, 0, 0, imgData.width, imgData.height);\n}", "title": "" }, { "docid": "be8ee069d04f8345526608143a36b909", "score": "0.5673754", "text": "function fill(rgb, amt) {\n ctx.beginPath(); // start path\n ctx.rect(- canvas.width / 2, - canvas.height / 2, canvas.width, canvas.height) // set rectangle to be the same size as the window\n ctx.fillStyle = `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${amt})` // use the rgb array/color for fill, and amt for opacity\n ctx.fill() // do the drawing\n }", "title": "" }, { "docid": "e7e9e7a41966ae699127fb07f4fb7b7b", "score": "0.5672837", "text": "function doGlow(i) {\n\n var tImage = tGfx.getImageData(0, 0, tCanvas.width, tCanvas.height);\n\n var m = [\n Math.random() * 5.0,\n Math.random() * 5.0,\n Math.random() * 5.0\n ];\n\n for (var y = 0; y < tCanvas.height; y += 1) {\n for (var x = 0; x < tCanvas.width; x += 1) {\n\n var index = (y * tCanvas.width + x);\n var tRed = tImage.data[index * 4 + 0];\n var tGreen = tImage.data[index * 4 + 1];\n var tBlue = tImage.data[index * 4 + 2];\n var tAlpha = tImage.data[index * 4 + 3];\n\n var tGrey = (tRed + tGreen + tBlue) / 3;\n var tGreyNormalized = tGrey / 255.0;\n\n // console.log(tGreyNormalized);\n\n var tBand = getBandColor(tGreyNormalized, m);\n\n tImage.data[index * 4 + 0] = tBand[0];\n tImage.data[index * 4 + 1] = tBand[1];\n tImage.data[index * 4 + 2] = tBand[2];\n // tImage.data[index * 4 + 3] = 0;\n }\n }\n\n var gCanvas = document.createElement('canvas');\n gCanvas.width = tCanvas.width;\n gCanvas.height = tCanvas.height;\n document.body.appendChild(gCanvas);\n\n var gGfx = gCanvas.getContext('2d');\n gGfx.putImageData(tImage, 0, 0);\n\n}", "title": "" }, { "docid": "0012e058603226815f7a4290d17fc052", "score": "0.5668702", "text": "setFill(fill){\n this.fill=fill\n }", "title": "" }, { "docid": "df86f774886efc2e0c9bd52265150885", "score": "0.5661843", "text": "function clrscr() {\n scr.fillStyle = \"#ffffff\";\n scr.fillRect(0,0,maxx,maxy);\n scr.fillStyle = \"#f24200\"; // Resets the fill color\n}", "title": "" }, { "docid": "c460f4c2ec1385dbdd49d8311b8fc115", "score": "0.56518483", "text": "constructor(x,y,w,h,fillColour){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.fillColour = fillColour;\n\n }", "title": "" }, { "docid": "c460f4c2ec1385dbdd49d8311b8fc115", "score": "0.56518483", "text": "constructor(x,y,w,h,fillColour){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.fillColour = fillColour;\n\n }", "title": "" }, { "docid": "60c5d8c91413d1a6537acf04d3f6116e", "score": "0.564793", "text": "function fillInWaterPixels(destImageData, colour)\n{\n let d = destImageData.data;\n let n = _w*_h;\n for(let i = 0 ; i < n;++i)\n {\n if(_idmap[i]==-2)\n {\n d[4*i + 0] = colour[0];\n d[4*i + 1] = colour[1];\n d[4*i + 2] = colour[2];\n d[4*i + 3] = 255;\n\n }\n }\n}", "title": "" }, { "docid": "65ddc383fa953fb131b9ec99503e210e", "score": "0.5647338", "text": "function renderBG(){\n context.fillStyle = colorService.LIGHT;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }", "title": "" }, { "docid": "65b90548356ebb5fb21d0419d65f6e60", "score": "0.564712", "text": "function offPurple(x,y) {\n\n ctx.beginPath();\n ctx.rect(x,y,100,80);\n ctx.fillStyle = \"#273746\";\n ctx.fill();\n ctx.stroke();\n\n}", "title": "" }, { "docid": "07d2c3b58007d0fb0a5e0b85521706db", "score": "0.5644853", "text": "function ponerPixel(contexto, x,y, color){\n contexto.fillStyle = color;\n contexto.fillRect(x, y, 1, 1);\n}", "title": "" }, { "docid": "3de5af981c4b5914344163d1e3e4ec4c", "score": "0.5637935", "text": "get fillAlpha2() {return this.fillAlpha}", "title": "" }, { "docid": "b764774af4cc614d65965f2c3d16f2df", "score": "0.5633809", "text": "FillWithWhite()\n {\n const white = [1.0, 1.0, 1.0, 1.0];\n for (let j = 0; j < 1000; j++)\n {\n this.colours = this.colours.concat(white, white, white, white,);\n }\n }", "title": "" }, { "docid": "8c06932495e15509878b59116bba345c", "score": "0.5629772", "text": "function resetPixel(pixel){\n pixel.style.backgroundColor = 'black';\n}", "title": "" }, { "docid": "1b05f953251fd383cedd52fb684fe1df", "score": "0.56294805", "text": "function setBlack(x) {\n x.setRed(0);\n x.setGreen(0);\n x.setBlue(0);\n}", "title": "" }, { "docid": "77a87184e6038e7e07e677ea904b1268", "score": "0.5626465", "text": "markDirtyFill() {\n assert && Color.checkPaint( this.instance.node._fill );\n\n this.dirtyFill = true;\n this.markPaintDirty();\n this.fillObserver.setPrimary( this.instance.node._fill );\n // TODO: look into having the fillObserver be notified of Node changes as our source\n }", "title": "" }, { "docid": "3ef289032752e219746a286d3d8046c3", "score": "0.56202275", "text": "function draw() {\nbackground(0)\ndrawSprites();\n}", "title": "" }, { "docid": "356ad8d0fcba3efabbde2341aff79cda", "score": "0.56185615", "text": "function redrawBackground(){\n\n cont.fillStyle = \"white\";\n cont.fillRect(0, 0, can.width, can.height);\n\n}", "title": "" }, { "docid": "874e6e8ea08175b0e0abccdd4ce40c82", "score": "0.56169254", "text": "function offBlue(x,y) {\n\n ctx.beginPath();\n ctx.rect(x,y,100,80);\n ctx.fillStyle = \"#273746\";\n ctx.fill();\n ctx.stroke();\n\n}", "title": "" }, { "docid": "dfbb4aaf802d28bdaa8d12ccdde12692", "score": "0.559825", "text": "function set_pixel_color(x, y, r, g, b) {\n // calculate x offset first\n var offset = y % height;\n // add x offset\n offset += x * height;\n set_pixel_color(offset, r, g, b);\n }", "title": "" }, { "docid": "1b5bc9315d0024bd1378a1e1a2163f7b", "score": "0.55912226", "text": "function draw() {\n background(204, 153, 0);\n}", "title": "" }, { "docid": "a5e55ad6e21aefb68002f026298acb20", "score": "0.5584256", "text": "fill(color) {\n for( r = 0; r < this.activeTetromino.length; r++){\n for(c = 0; c < this.activeTetromino.length; c++){\n // we draw only occupied squares\n if( this.activeTetromino[r][c]){\n drawSquare(this.x + c,this.y + r, color);\n }\n }\n }\n }", "title": "" }, { "docid": "b7b699bfd3bbaaaac1e587bc077b2833", "score": "0.5582406", "text": "function flat(x, y, z, color) {\n\t}", "title": "" }, { "docid": "b31b7be05f64e3a5b32198818b29d19a", "score": "0.5575172", "text": "function SetColor(x, y, rgba) {\n var data = new Uint8ClampedArray(4);\n data[0] = rgba.r; data[1] = rgba.g; data[2] = rgba.b; data[3] = rgba.a;\n var new_pixel = new ImageData(data, 1, 1);\n context.putImageData(new_pixel, x, y);\n fake_canvas[x][y] = rgba;\n}", "title": "" }, { "docid": "c109cef9269fdb4b26376c01a2e76af7", "score": "0.55739176", "text": "_updateSprite(layer) {\n super._updateSprite(layer);\n // we use the front layer for a specular highlight, so don't tint it\n if (layer !== 2 /* FRONT */) {\n const sprite = this.getSpriteForLayer(layer);\n if (!sprite)\n return;\n sprite.tint = this.color;\n }\n }", "title": "" }, { "docid": "a58b3f6cb3c73c6e72af2777989a5454", "score": "0.5567574", "text": "function draw(){\n //background\n ctx.globalCompositeOperation = \"source-over\";\n ctx.fillStyle = \"rgba(0,0,0,0.5)\";\n ctx.fillRect(0,0,W,H);\n\n ctx.globalCompositeOperation = \"lighter\";\n\n //loop through boxes and draw them\n for(i=0; i < boxes.length; i++){\n boxes[i].draw();\n }\n\n update();\n }", "title": "" }, { "docid": "d24dc4af8579da364a5cec58ecd85dfa", "score": "0.55653346", "text": "function fillPNG(png, data, alphaColor) {\n // see https://www.arduino.cc/en/Reference/Map\n function map(x, in_min, in_max, out_min, out_max) {\n return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;\n }\n\n for (var i = 0; i < data.length; i++) {\n var color = new Color( // see https://en.wikipedia.org/wiki/8-bit_color\n map((data[i] >> 5) & 0b111, 0, 7, 0, 255), // bit 5-7: red amount\n map((data[i] >> 2) & 0b111, 0, 7, 0, 255), // bit 2-4: green amount\n map( data[i] & 0b11, 0, 3, 0, 255), // bit 0-1: blue amount\n data[i] === alphaColor ? 0 : 255\n );\n setPixel(png, new Point(i % params.width, Math.floor(i / params.width)), color);\n }\n }", "title": "" }, { "docid": "065e8420c7e601e6dbc17ae2460c07db", "score": "0.5564813", "text": "function colorAll(targetColor) {\r\n\tfor(var i = 0; i<squares.length; i++)\r\n\t\tsquares[i].style.background = targetColor;\r\n}", "title": "" }, { "docid": "c1eae9b1d6427539292232a014917000", "score": "0.5562961", "text": "function white(){\n canvas.width=width;\n canvas.height=height;\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(0, 0, width, height);\n}", "title": "" }, { "docid": "ace10237725f4dd6ce60500c48555a29", "score": "0.5557173", "text": "function drawBackgroundColor(){\n\tvar canvas = GameCanvas.getContext('2d');\n\tcanvas.fillStyle = Display.bgColor;\n\tcanvas.fillRect(0, 0, GameCanvas.width, GameCanvas.height);\n}", "title": "" }, { "docid": "72707699d2ff90653fa217ac943d14e4", "score": "0.55553746", "text": "function resetPixel(pixel) {\n pixel.style.backgroundColor = 'black';\n}", "title": "" }, { "docid": "763c51cfc87136812e946ceb1a6eb966", "score": "0.5554467", "text": "function allgreen() {\n for (var i = 0; i < whiteCircles.length; i++) {\n whiteCircles[i].style.opacity = \"0%\";\n }\n}", "title": "" }, { "docid": "e5225948887d81818690ec03d61f77ed", "score": "0.5534444", "text": "function changeColor(cuenta, seccion){\n \n\n $(\"#\" + seccion).attr(\"fill\",\"#cc7000\");\n $(\"#\" + seccion).attr(\"fill-opacity\",cuenta*.02);\n $('#'+ seccion).css({ fill: \"#cc7000\"});\n\n\n}", "title": "" }, { "docid": "f0e71ae741c11103fa376bbb2dfc3dad", "score": "0.55331904", "text": "function drawBackground(rsize,c1=100,c2=200){\r\r\n//\tc1 =200;\r\r\n\t//c2=100;\r\r\n noStroke();\t//disables the stroke\r\r\n for(var x=0; x<width;x+=rsize){\t\t//cycles through the width\r\r\n for(var y=0;y<height;y+=rsize){\t// cycles through the heigh\r\r\n if((Math.floor(x/rsize)+Math.floor(y/rsize))%2==0){\t\t//selects the collor of the current block\r\r\n \tfill(c1);\t\t//sets fillcolor to c1\r\r\n }else{\r\r\n fill(c2);\t\t//sets fillcolor to c2\r\r\n }\r\r\n rect(x,y,rsize,rsize); \t//drawing the block\r\r\n }\r\r\n }\r\r\n}", "title": "" }, { "docid": "85e0dbf765f3b25f679a518ab6034a28", "score": "0.55275685", "text": "function findFillArea (event, cx, clear) {\n var currentPos = new Vector(position(event, cx.canvas).x, position(event, cx.canvas).y);\n var targetColor = colorFromPixel(cx, currentPos);\n var replaceColor;\n if (clear) {\n replaceColor = blankColor;\n } else {\n var rgb = hexToRgb(document.getElementById(\"color-picker\").value);\n var opacity = Number(defaultOpacity) * 255;\n replaceColor = new Color([rgb.r, rgb.g, rgb.b, opacity]);\n }\n floodFill(currentPos, targetColor, replaceColor, cx);\n}", "title": "" }, { "docid": "cfd74a2ec15d74a4e95b5681cfcc15df", "score": "0.5527079", "text": "draw() {\n this.fill(this.color);\n }", "title": "" }, { "docid": "09bf300747bd94c08e0cfea42304970d", "score": "0.55255675", "text": "display() {\n for (let i = 0; i < this.history.length; i += 1) {\n let pos = this.history[i];\n let j = (i == 0 ? 1 : i);\n\n //want colour to be based on raius\n let trailColour = color(this.col[0], this.col[1], this.col[2]);\n trailColour.setAlpha(j * 10);\n fill(trailColour);\n circle(pos.x, pos.y, 10)\n }\n\n //want colour to be based on raius\n //fill(255, 0, 0);\n fill(this.col[0], this.col[1], this.col[2]);\n circle(this.x, this.y, 10);\n }", "title": "" }, { "docid": "7fa137f5a6b7c4e4fe34ffcc8d97a929", "score": "0.5524965", "text": "function renderBackground() {\r\n screen.fillStyle = \"#EEEEEE\";\r\n screen.fillRect(0, 0, 256, 224);\r\n}", "title": "" }, { "docid": "db304da27dc521fe9d4cb83b9a4f433a", "score": "0.5509585", "text": "get transparent() {\n return this.bg.r === 255 && this.bg.g === 0 && this.bg.b === 255;\n }", "title": "" }, { "docid": "035e019f55b6e139b945c684f053d831", "score": "0.55068433", "text": "function drawClearSolid(context) {\n\tcontext.fillStyle = \"#ffffff\";\n\tcontext.fillRect(0, 0, context.canvas.width, context.canvas.height); \n}", "title": "" }, { "docid": "5823c46785a48ef19eac81b913ee3290", "score": "0.5506217", "text": "function updateColor(node, color){\n\tlet colorMod = colors[color]\n\tfor(let j = 0; j < node.children.length-1; j++) {\n\t\tlet exponent = Math.round(Math.log(node.children.length-1, baseVal));\n\t\tif (visualSeperation \n\t\t\t&& node.children.length-1 != 1 \n\t\t\t&& j%Math.pow(baseVal,exponent-1) == 0) {\n\t\t\tif (colorMod.includes(colors[color])) { colorMod = colorsOff[color] }\n\t\t\telse { colorMod = colors[color] }\n\t\t} \n\t\tnode.children[j].graphics._fill.style = colorMod;\n\t}\n\tnode.color = color\n}", "title": "" }, { "docid": "bbdedcd0b225f9a484aa35eedd084adf", "score": "0.55003965", "text": "draw() {\n const { display, game } = this;\n\n const ppumask = getMask();\n\n // draw the background\n for (let y=0; y<240; y++){\n // inform the game which scan line we're updating\n if (game && game.onScanline) {\n game.onScanline(y);\n }\n\n for (let x=0; x<256; x++) {\n const color = getPixel(x, y); // NES color index\n // color options\n display.setPixel(x, y, color, ppumask);\n }\n }\n\n // draw all sprites\n spriteManager.draw(display);\n\n // render to screen\n display.draw();\n }", "title": "" }, { "docid": "6426fc295662a7b02b833681e04c4001", "score": "0.5499132", "text": "function drawWhiteBg() {\n const context = can.getContext('2d');\n context.fillStyle = \"white\";\n context.fillRect(0, 0, canWidth, canHeight);\n }", "title": "" }, { "docid": "da7632aeb8cd0bd1574d24782ee2668b", "score": "0.54986167", "text": "function fill(context, size, color, x, y) {\n context.fillStyle = color;\n context.fillRect(x * size + 1, y * size + 1, size - 2, size - 2);\n}", "title": "" }, { "docid": "42099fdfe8073becdd40958810b5c862", "score": "0.549636", "text": "function clear()\r\n{\r\n context.beginPath();\r\n context.fillStyle = \"rgba(255,255,255,255)\";\r\n context.moveTo(0,0);\r\n context.lineTo(WIDTH,0);\r\n context.lineTo(WIDTH,HEIGHT);\r\n context.lineTo(0,HEIGHT);\r\n context.lineTo(0,0);\r\n context.fill();\r\n context.closePath();\r\n}", "title": "" }, { "docid": "415651d678cdd980597f21e095446869", "score": "0.5491406", "text": "function setPixel(data, idx, color) {\n\tidx = idx*4;\n\tfor(var i = 0; i < color.length; i++) data[idx+i] = color[i];\n}", "title": "" }, { "docid": "beb29326f42bd0e55fd429ae04450e62", "score": "0.5484055", "text": "function clearCanv(col) {\n context.fillStyle = \"rgba(\" + col + \"1\" + \")\";\n context.fillRect(0, 0, width, height);\n}", "title": "" }, { "docid": "9697d3f84dae4cd48278f1cbe79babb0", "score": "0.54651153", "text": "function shade() {\nshadeOn = !shadeOn;\nmulticolorOn = false;\n}", "title": "" }, { "docid": "09809515aef46d17a25c653469ee499d", "score": "0.54606974", "text": "popSpriteMask()\n {\n this.renderer.filter.pop();\n this.alphaMaskIndex--;\n }", "title": "" }, { "docid": "82328be16f3ce5b7540e736104b722ce", "score": "0.5460008", "text": "function stripAlpha(d)\n{\n var i;\n for (i = 0; i < (d.width * d.height * 4); i += 4)\n d.data[i + 3] = 255;\n}", "title": "" }, { "docid": "410bc9b711213151973ca94054c97b3e", "score": "0.54529244", "text": "onResetEvent() {\n me.game.world.addChild(new me.ColorLayer(\"background\", \"#ff0000\", 0), 0); \n }", "title": "" }, { "docid": "99166140ca6550abaae60142d4f4cade", "score": "0.54489064", "text": "drawBg() {\n let color;\n for (let i = 0; i < 48; i++) {\n for (let j = 0; j < 30; j++) {\n ctx.beginPath();\n ctx.rect(i * height, j * width, width, height);\n if ((i % 2 == 0 && j % 2 == 1) || (i % 2 == 1 && j % 2 == 0)) {\n color = \"#0b3058\";\n } else {\n color = \"#081727\";\n }\n ctx.fillStyle = color;\n ctx.fill();\n ctx.closePath();\n }\n }\n }", "title": "" }, { "docid": "e49cdc31aced858f15dc9f6f0792833f", "score": "0.5446407", "text": "function setPixelPal(data, x, y, color)\n{\n\tfirespace[y*width + x] = color\n\tsetPixelRgb(data, x, y, palette[color])\n}", "title": "" }, { "docid": "147aae01b33a4bf978401ea0e915c0dd", "score": "0.5443498", "text": "function render() {\n background.removeAllChildren();\n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n\n var backgroundFill = draw.rect(canvasWidth,900,'grey');\n background.addChild(backgroundFill);\n\n var backgroundFill = draw.rect(canvasWidth,620,'#461308');\n background.addChild(backgroundFill);\n\n\n var backgroundFill = draw.rect(canvasWidth,430,'green');\n background.addChild(backgroundFill);\n \n \n var backgroundFill = draw.rect(canvasWidth,groundY,'navy');\n background.addChild(backgroundFill);\n \n var backgroundFill = draw.rect(90,90,'gold');\n background.addChild(backgroundFill); \n\n //My underground stuff\n \n var coal = draw.bitmap('img/coal.png');\n coal.x = 500;\n coal.y = 700;\n coal.scaleX = 0.18;\n coal.scaleY = 0.18;\n background.addChild(coal);\n \n \n var coal = draw.bitmap('img/coal.png');\n coal.x = 900;\n coal.y = 650;\n coal.scaleX = 0.18;\n coal.scaleY = 0.18;\n background.addChild(coal);\n \n var iron = draw.bitmap('img/iron.jfif');\n iron.x = 200;\n iron.y = 620;\n iron.scaleX = 0.4;\n iron.scaleY = 0.4;\n background.addChild(iron);\n \n var iron = draw.bitmap('img/iron.jfif');\n iron.x = 1200;\n iron.y = 680;\n iron.scaleX = 0.4;\n iron.scaleY = 0.4;\n background.addChild(iron);\n \n\n \n \n \n \n //My underground Stuff\n\n // TODO: 3 - Add a moon and starfield\n \n //Imported moon from minecraft to fit theme\n\n \n var star;\n for(var i=0; i < 20; i++) {\n star = draw.circle(10,'white','LightGray',2);\n star.x = canvasWidth*Math.random();\n star.y = 300*Math.random();\n background.addChild(star);\n }\n \n \n var moon = draw.bitmap('img/moon!.jfif');\n moon.x = 0;\n moon.y = 0;\n moon.scaleX = 0.4;\n moon.scaleY = 0.4;\n background.addChild(moon);\n \n // TODO: 5 - Add buildings! Q: This is before TODO 4 for a reason! Why?\n \n\n \n for (var i = 0; i < 3; i++) {\n \n house = draw.bitmap('img/New Piskel-1.png.png');\n houses[i] = house\n houses[i].x = 280 * (i + 1);\n houses[i].y = groundY - 117;\n houses[i].scaleX = 0.28;\n houses[i].scaleY = 0.28;\n background.addChild(houses[i]);\n }\n \n \n \n // TODO 4: Part 1 - Add a tree\n for (var i = 0; i < 1; i++) { \n tree = draw.bitmap('img/Tree-1.png.png');\n trees[i] = tree\n trees[i].x = 1000 * (i + 1);\n trees[i].y = groundY - 234;\n trees[i].scaleX = 0.3;\n trees[i].scaleY = 0.3;\n background.addChild(tree);\n \n }\n \n \n } // end of render function - DO NOT DELETE", "title": "" }, { "docid": "c6603153c3c2d01933cd97714ba21de8", "score": "0.54427993", "text": "function drawBG() {\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\n purpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\n}", "title": "" }, { "docid": "27a7309fe7d44f242576c5172101c9b9", "score": "0.5438534", "text": "function resetPixel(pixel) {\n pixel.style.backgroundColor = DEFAULT_COLOR;\n}", "title": "" }, { "docid": "27a7309fe7d44f242576c5172101c9b9", "score": "0.5438534", "text": "function resetPixel(pixel) {\n pixel.style.backgroundColor = DEFAULT_COLOR;\n}", "title": "" }, { "docid": "27a7309fe7d44f242576c5172101c9b9", "score": "0.5438534", "text": "function resetPixel(pixel) {\n pixel.style.backgroundColor = DEFAULT_COLOR;\n}", "title": "" }, { "docid": "ec9466ad9f3c40cc0714f2cc1ddd7277", "score": "0.54327637", "text": "floodFill(point, color, fillArr) {\n\t\tconst {x, y} = point;\n\t\tif (!this.isValidTile(x, y)) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.tilesArray[x][y].isEmpty) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.pointInArr(fillArr, point)) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.tilesArray[x][y].tint === color) {\n\t\t\tfillArr.push(point);\n\t\t\tthis.floodFill(new Point(x + 1, y), color, fillArr);\n\t\t\tthis.floodFill(new Point(x - 1, y), color, fillArr);\n\t\t\tthis.floodFill(new Point(x, y + 1), color, fillArr);\n\t\t\tthis.floodFill(new Point(x, y - 1), color, fillArr);\n\t\t}\n\t}", "title": "" }, { "docid": "bfda9d1f03845283602639718867f0d0", "score": "0.54295015", "text": "function updateCircle(sprite, fillColor, strokeColor) {\n\n let circleGraphic = new Graphics();\n circleGraphic.beginFill(fillColor);\n circleGraphic.lineStyle(8, strokeColor, 1);\n circleGraphic.drawCircle(0, 0, 64);\n circleGraphic.endFill();\n let circleTexture = circleGraphic.generateTexture();\n sprite.texture = circleTexture; \n}", "title": "" }, { "docid": "ae275cbdf64da4241c9b891125ce63be", "score": "0.5428804", "text": "function makeItHot(x, y, width, height) {\n // Generate the colors\n var imgData = ctx.getImageData(x, y, width, height),\n pixData = imgData.data;\n\n for (var i = 0, len = pixData.length; i < len; i += 4) {\n if (pixData[i + 3] !== 0) {\n\n var alpha = pixData[i + 3],\n r = 0,\n g = 0,\n b = 0,\n comp = 0;\n\n if (alpha <= 255 && alpha >= 235) {\n comp = 255 - alpha;\n r = 255 - comp;\n g = comp * 12;\n } else if (alpha <= 234 && alpha >= 200) {\n comp = 234 - alpha;\n r = 255 - comp * 8;\n g = 255;\n } else if (alpha <= 199 && alpha >= 150) {\n comp = 199 - alpha;\n g = 255;\n b = comp * 5;\n } else if (alpha <= 149 && alpha >= 100) {\n comp = 149 - alpha;\n g = 255 - comp * 5;\n b = 255;\n } else {\n b = 255;\n }\n\n pixData[i] = r;\n pixData[i + 1] = g;\n pixData[i + 2] = b;\n pixData[i + 3] = alpha;\n }\n }\n\n ctx.putImageData(imgData, x, y);\n}", "title": "" }, { "docid": "51901fbc40117ebf05d13c631d11a23e", "score": "0.5424275", "text": "function drawBackground() {\n for (row = 0; row < tiles.length; row++) {\n for (col = 0; col < tiles[row].length; col++) {\n tiles[row][col].drawBackground();\n }\n }\n}", "title": "" }, { "docid": "bccac1faec179ea0fa8af21d1f72c269", "score": "0.5407279", "text": "function getColor() {\n player.setColor();\n player.drawPlayer();\n}", "title": "" } ]
fab1d8160b4baed92aa03fdcaded1892
====================== Enabled Cipher Table ======================
[ { "docid": "80dd0f5fb105754e7bb67a4e4e8399be", "score": "0.0", "text": "function saveInitialCiphers() {\r\n\tif (cipherListSaved.length == 0) cipherListSaved = [...cipherList] // make a copy of initial ciphers to revert changes\r\n}", "title": "" } ]
[ { "docid": "424547976649e53a33eaa195c7101e11", "score": "0.6962106", "text": "function printKey() {\n console.log(cipher.key);\n var tableHtml = '<table class =\"table mt-5 mb-5\" >';\n for (var i = 0; i < 25; i = i + 5) {\n tableHtml += \"<tr>\";\n var row = cipher.key.substring(i, i + 5);\n var chars = row.split(\"\");\n var myInputKey = document.getElementById(\"keyword\").value.toUpperCase();\n for (var x = 0; x < 5; x++) {\n if (myInputKey.includes(chars[x])) {\n tableHtml += '<td class=\"table-active \">' + chars[x] + \"</td>\";\n } else {\n tableHtml += \"<td>\" + chars[x] + \"</td>\";\n }\n }\n tableHtml += \"</tr>\";\n }\n tableHtml += \"</table>\";\n var tableNode = new DOMParser().parseFromString(tableHtml, \"text/html\");\n\n document.getElementById(\"keyTable\").appendChild(tableNode.firstChild);\n}", "title": "" }, { "docid": "50013f7918685ddeef8e7dfb2c446c69", "score": "0.64249253", "text": "ceaserCipher(boolean) {\n\n let result = '';\n for (let i = 0; i < this.state.originalText.length; i++) {\n const c = this.state.originalText.charCodeAt(i);\n\n let uppercase = boolean \n ? \n String.fromCharCode(this.mod(c - 65 - this.state.shiftAmount, 26) + 65) // decrypt\n :\n String.fromCharCode(this.mod(c - 65 + this.state.shiftAmount, 26) + 65); // encrypt\n\n let lowercase = boolean\n ? String.fromCharCode(this.mod(c - 97 - this.state.shiftAmount, 26) + 97) // decrypt\n :\n String.fromCharCode(this.mod(c - 97 + this.state.shiftAmount, 26) + 97); // encrypt\n\n // Uppercase\n if (65 <= c && c <= 90) {\n result += uppercase;\n } \n\n // Lowercase\n else if (97 <= c && c <= 122) {\n result += lowercase;\n }\n\n // Copy\n else {\n result += this.state.originalText.charAt(i); \n }\n }\n\n // update state\n this.setState({\n originalText: result\n })\n\n // set result\n document.querySelector('.textarea').value = result;\n }", "title": "" }, { "docid": "a275058d5d92128fd30a655e27805d2c", "score": "0.6378034", "text": "function initialize() {\n const poly = (1 << 8) | (1 << 4) | (1 << 3) | (1 << 1) | (1 << 0);\n function mul(b, c) {\n let i = b;\n let j = c;\n let s = 0;\n for (let k = 1; k < 0x100 && j !== 0; k <<= 1) {\n // Invariant: k == 1<<n, i == b * x^n\n if ((j & k) !== 0) {\n // s += i in GF(2); xor in binary\n s ^= i;\n j ^= k; // turn off bit to end loop early\n }\n // i *= x in GF(2) modulo the polynomial\n i <<= 1;\n if ((i & 0x100) !== 0) {\n i ^= poly;\n }\n }\n return s;\n }\n const rot = (x) => (x << 24) | (x >>> 8);\n // Generate encryption tables.\n Te0 = new Uint32Array(256);\n Te1 = new Uint32Array(256);\n Te2 = new Uint32Array(256);\n Te3 = new Uint32Array(256);\n for (let i = 0; i < 256; i++) {\n const s = SBOX0[i];\n let w = (mul(s, 2) << 24) | (s << 16) | (s << 8) | mul(s, 3);\n Te0[i] = w;\n w = rot(w);\n Te1[i] = w;\n w = rot(w);\n Te2[i] = w;\n w = rot(w);\n Te3[i] = w;\n w = rot(w);\n }\n // Generate decryption tables.\n Td0 = new Uint32Array(256);\n Td1 = new Uint32Array(256);\n Td2 = new Uint32Array(256);\n Td3 = new Uint32Array(256);\n for (let i = 0; i < 256; i++) {\n const s = SBOX1[i];\n let w = (mul(s, 0xe) << 24) | (mul(s, 0x9) << 16) |\n (mul(s, 0xd) << 8) | mul(s, 0xb);\n Td0[i] = w;\n w = rot(w);\n Td1[i] = w;\n w = rot(w);\n Td2[i] = w;\n w = rot(w);\n Td3[i] = w;\n w = rot(w);\n }\n isInitialized = true;\n}", "title": "" }, { "docid": "df82d178d51a3f0797a55d5dae75a8b5", "score": "0.6199399", "text": "function generateKeyTable(keystring) {\n if (!keystring) keystring = \"PLAYFAIRCIPHER\";\n\n // Sanitize\n keystring = keystring.toUpperCase();\n keystring = keystring.replace(/\\W+/g, \"\");\n keystring = keystring.replace(cipher.subCh.sub, cipher.subCh.rpl);\n // Reset our key and alphabet\n cipher.key = \"\";\n cipher.alpha = cipher.allowed;\n\n // Create the start of the table with our key string\n var keyArr = keystring.split(\"\");\n keyArr.forEach((c) => {\n if (cipher.alpha.indexOf(c) > -1 && cipher.key.indexOf(c) == -1) {\n cipher.key += c;\n cipher.alpha = cipher.alpha.replace(c, \"\");\n }\n });\n\n // Fill in the rest of the table\n // If we enabled randomizing the table, do it. Playfair does not.\n if (cipher.randomTable) cipher.key += shuffleStr(cipher.alpha);\n else cipher.key += cipher.alpha;\n}", "title": "" }, { "docid": "bb22027e892c95135b5425a291df51e5", "score": "0.60588706", "text": "function printKey() {\n\t\tvar tableHtml = \"<table class='table table-condensed'>\";\n\t\tfor (var i = 0; i < 25; i = i + 5) {\n\t\t\ttableHtml += \"<tr>\";\n\t\t\tvar row = keyPhrase.substring(i, i + 5);\n\t\t\tvar chars = row.split(\"\");\n\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\ttableHtml += \"<td>\" + chars[x] + \"</td>\";\n\t\t\t}\n\t\t\ttableHtml += \"</tr>\";\n\t\t}\n\t\ttableHtml += \"</table>\";\n\t\t$(\"#keyTable\").html(tableHtml);\n\t}", "title": "" }, { "docid": "a4072e7a12d3c46eb4e51c245da82b87", "score": "0.6048062", "text": "function caesarCipher() {\n let originalString = getText();\n let cipherAmt = getCipherAmount();\n let encryptedString = \"\";\n for (let char of originalString) {\n char = char.toUpperCase();\n // Check if this char is a letter.\n if (char.toUpperCase() !== char.toLowerCase()) {\n // Char is a letter. Encrypt it.\n let charCode = ((char.charCodeAt(0) + cipherAmt) - 65) % 26 + 65;\n encryptedString += String.fromCharCode(charCode);\n } else {\n // Otherwise, add it to encrypted string unchanged.\n encryptedString += char;\n }\n }\n // Display the encrypted text in the top portion of the page\n let outputSection = document.getElementById(\"caesarCipherSection\");\n outputSection.innerText = encryptedString;\n}", "title": "" }, { "docid": "7bd65cf0f4d9bfd959ca817f4532b125", "score": "0.6041485", "text": "function ccipher(d) {\n var encMsg = '';\n var shift = 3; //shift alpha 3 letters over\n for (var i = 0; i < d.length; i++) {\n var code = d.charCodeAt(i);\n if ((code >= 65) && (code <= 90)) {\n //uppercase\n encMsg += String.fromCharCode((mod((code - 65 + shift), 26) + 65));\n } else if ((code >= 97) && (code <= 122)) {\n encMsg += String.fromCharCode((mod((code - 97 + shift), 26) + 97));\n } else {\n encMsg += String.fromCharCode(code);\n }\n }\n return encMsg;\n}", "title": "" }, { "docid": "c7e8ad7ba1d69adbab1fc688a7f56680", "score": "0.5920169", "text": "function Encrypt(plainText) {\n\t// Array with induvidual chars, split strings in chars\n\tvar array = [],\n\t newArray = [];\n\t// Uppercase whole text because of matematical operation on chars\n\tvar uppercasePlainText = plainText.toUpperCase();\n\t// Cast string in chars array\n\tarray = uppercasePlainText.split(\"\");\n\t// Array length is zero in start (logic)\n\tvar arraylength = 0;\n\tfor (var i = 0; i < array.length; i++) {\n\t\t// If there is two empty spaces in row that means that text is over\n\t\tif((array[i-1]==' ')&&(array[i]==' ')) {\n\t\t\t// Decrease array length because in this mode after last character first empty \n\t\t\t// space means end of the text and that is one char more than it is needed\n\t\t\tarraylength--;\n\t\t\t// First empty space at the end of message, delete it\n\t\t\tnewArray.pop();\n\t\t\t// (If there is case of two empty spaces in a row) break the loop, because \n\t\t\t// text is over\n\t\t\tbreak;\n\t\t}\n\t\telse {\n\t\t\t// Increase array length in normal situation\n\t\t\tarraylength++;\n\t\t\t// Put plan text in array for scrypt text, just in case, because than is not empty\n\t\t\tnewArray.push(array[i]);\n\t\t}\n\t}\n\tfor (var j = 0; j < arraylength; j++) {\n\t\tvar oldCharacter = String.fromCharCode(array[j].charCodeAt()); \n\t\tif (oldCharacter.charCodeAt() > 64) {\n\t\t\t// Calculate new character - KEY SHIFT\n\t\t\tvar newCharacter = String.fromCharCode(oldCharacter.charCodeAt() + 13);\n\t\t\t// Take care about situation whene NEW character is greater than Z, it must go from A again\n\t\t\tif(newCharacter.charCodeAt() > 90)\n\t\t\t{\n\t\t\t\tnewCharacter = String.fromCharCode(newCharacter.charCodeAt() - 26);\n\t\t\t}\n\t\t\tnewArray[j] = newCharacter;\n\t\t}\t\n\t\telse {\n\t\t\tnewArray[j] = oldCharacter;\n\t\t}\n\t}\n\tcryptText = newArray.toString();\n\tcryptText = cryptText.replace(/,/g, \"\");\n\treturn cryptText;\n}", "title": "" }, { "docid": "ddafb8eabe212a361b816f6c0055a951", "score": "0.5891996", "text": "function HASH_CA() {\n GameBoard.posKey ^= CastleKeys[GameBoard.castlePerm];\n}", "title": "" }, { "docid": "bc7b60775b36292bfc5a9184697c822f", "score": "0.5891807", "text": "function cipher(mode, msg, key) {\r\n\tconst alph = \"lm2pik5oMKO3ESWNLPI1JBdrzes9awqCU4FTFX8DZHYG7njbhuv6y gcftx0RQA\".split(\"\")\r\n\tkey = key % 63\r\n\tvar newMsg = \"\"\r\n\tfor (let i = 0; i < msg.length; i++) {\r\n\t\tvar currChar = msg[i]\r\n\t\tvar currIndex = alph.indexOf(currChar)\r\n\t\tif (mode == 0) {\r\n\t\t\tvar newIndex = currIndex + key\r\n\t\t} else if (mode == 1) {\r\n\t\t\tvar newIndex = currIndex - key\r\n\t\t}\r\n\t\tif (newIndex > 62) newIndex = newIndex - 63\r\n\t\tif (newIndex < 0) newIndex = 63 + newIndex\r\n\t\tnewMsg += alph[newIndex]\r\n\t}\r\n\treturn newMsg\r\n}", "title": "" }, { "docid": "97fd08416139fd08f9dc9631b769f598", "score": "0.58642536", "text": "function generateCipher() { \n let input = id('input-text');\n let cipherType = id('cipher-type').value;\n let output = '';\n let result = id('result');\n if (cipherType == 'shift') {\n output = shiftCipher(input.value);\n } else {\n output = customCipher(input.value);\n }\n result.innerHTML = output;\n }", "title": "" }, { "docid": "5464155802da1e3a37002c6db859ece4", "score": "0.58520246", "text": "function rotationalCipher(str, key) {\n // Write your code here\n let cipher = '';\n\n //decipher each letter\n for (let i = 0; i < str.length; i++) {\n\n if (isNumeric(str[i])) {\n cipher += String.fromCharCode(((str.charCodeAt(i) + key - 48) % 10 + 48));\n } else if (isSpecialCharacter(str[i])) {\n cipher += str[i]\n }\n //if letter is uppercase then add uppercase letters\n else if (isUpperCase(str[i])) {\n cipher += String.fromCharCode((str.charCodeAt(i) + key - 65) % 26 + 65);\n } else {\n //else add lowercase letters\n cipher += String.fromCharCode((str.charCodeAt(i) + key - 97) % 26 + 97);\n }\n }\n\n return cipher;\n\n //check if letter is uppercase\n function isUpperCase(str) {\n return str === str.toUpperCase();\n }\n\n function isSpecialCharacter(str) {\n return str.match(/\\W|_/g);\n }\n\n function isNumeric(str) {\n return str.match(/^\\d+$/)\n }\n}", "title": "" }, { "docid": "bbdc9475ab7b14a2d4ea952d85713db1", "score": "0.5842216", "text": "function ceasarCipher3(alphabet) {\n for (var i = 0; i < alphabet.length; i++){\n console.log(alphabet[i].charCodeAt());\n }\n}", "title": "" }, { "docid": "ca047e82fa8e701b8f7069723925e6fc", "score": "0.58406067", "text": "function cipher(cipherPhrase) { // y decipher (revisar luego nombres de variables)\r\n var upperCiphPhrase = cipherPhrase.toUpperCase();// sin return porque no necesito que me la muestre\r\n // var arrayFrase = array.from(upperCiphPhrase); charcode at no funciona con array\r\n var cipherArray = []; // la ponemos fuera del for ya que sino se va limpiando en cada vuelta del recorrido\r\n for (var i = 0; i < upperCiphPhrase.length; i++) {\r\n // console.log(i);\r\n var onAscci = upperCiphPhrase.charCodeAt(i); // para sacar el numero ascii correspondiente al numero de los elementos\r\n // console.log(onAscci);\r\n var algorithm = ((onAscci - 65 + 33) % 26 + 65) ; // nos da el numero ascci de la letra desplazada\r\n // console.log(desplazamiento);\r\n var cipherMsg = String.fromCharCode(algorithm); // pasamos los numeros ascii a sus letras correspondientes\r\n // console.log(newLetra);\r\n cipherArray.push(cipherMsg); // ingresamos cada letra al array para tener todas las letras en un array y luego convertirla a cadena\r\n // console.log(finalArray);\r\n var cypherStr = cipherArray.join(''); // array a string porque es solicitadoque se presente de sta forma\r\n // console.log(strCifrado);\r\n }\r\n // return strCifrado;\r\n return alert('Su mensaje es ' + cypherStr); // porque tengo que hacerle doble enter??\r\n }", "title": "" }, { "docid": "63bb0151f9bd415cbb68b53288aed5af", "score": "0.5811126", "text": "_precompute() {\n const encTable = this._tables[0];\n const decTable = this._tables[1];\n const sbox = encTable[4];\n const sboxInv = decTable[4];\n const d = [];\n const th = [];\n let xInv, x2, x4, x8;\n for (let i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n for (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n let s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x;\n x8 = d[x4 = d[x2 = d[x]]];\n let tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;\n let tEnc = d[s] * 257 ^ s * 16843008;\n for (let i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n }\n for (let i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n }", "title": "" }, { "docid": "c5468da6a8e7ff480f1ee665acb1db34", "score": "0.580947", "text": "function createTableCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 5; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "title": "" }, { "docid": "76f534d6c168e6245b556fb3a8d68f89", "score": "0.5799664", "text": "function encrypt_key(cipher, a) {\n if (!a) a = [];\n if (a.length == 4) return cipher.encrypt(a);\n var x = [];\n for (var i = 0; i < a.length; i += 4) x = x.concat(cipher.encrypt([a[i],\n a[i + 1],\n a[i + 2],\n a[i + 3]\n ]));\n return x;\n}", "title": "" }, { "docid": "04e6c97a0f5af8b9252fcc14d91130f2", "score": "0.57569104", "text": "function Cipher3()\n{\n var user_input = document.getElementById(\"input3\").value.toUpperCase(); // get user input from webpage\n var show_Output;\n var key = document.getElementById(\"key_input3\").value.toUpperCase(); // cipher key number to be used\n var keySum =0;\n if (user_input.trim().length == 0)\n {\n alert(\"white space\");\n show_Output = document.getElementById(\"result3\");\n show_Output.style.color = \"red\";\n show_Output.innerHTML =\"Invalid input. \\n\\nPlease only enter alphabets between A-Z or a-z\";\n \n }\n else if(key.trim().length == 0 )\n {\n show_Output = document.getElementById(\"result3\");\n show_Output.style.color = \"red\";\n \n show_Output.innerHTML =\"Please enter key.\";\n }\n else{\n \n \n for(i=0; i<key.length; i++)\n {\n keySum = keySum + key.charCodeAt(i); // working out key number by iterating through all chracters\n }\n \n\n \n keySum = keySum % 6; // further operation on key value to be used for encryption\n\n \n var cipherText = \"\";\n for(i=0; i<user_input.length; i++)\n {\n var unico = user_input.charCodeAt(i); // looping thoriugh every single input charcter to convert it into ciphered text\n\n \n cipherText = cipherText + String.fromCharCode(unico + keySum); // finally encrypting input to cipher text\n \n\n }\n\n\n \n\n show_Output = document.getElementById(\"result3\");\n show_Output.style.color = \"black\";\n show_Output.innerHTML = cipherText.toString(); // display result\n }\n \n}", "title": "" }, { "docid": "e740f9c1baf1617128e3ac59a17d4e55", "score": "0.5749205", "text": "function decipher(cifrado){\n\n alert (\"SORPRENDENTE: \" + cifrado);\n\n\n var descifrado =\"\";\n\n\n for(var j=0; j<cifrado.length; j++) { //el for recorrera las letras del texto a descifrar//\n\n var ubicacionDescifrado = (cifrado.charCodeAt(j) + 65 - 33) % 26 + 65;\n var palabraDescifrada= String.fromCharCode(ubicacionDescifrado);\n\n descifrado+=palabraDescifrada; //acumular las letras descifradas//\n}\n\nreturn descifrado;\n\n\n}", "title": "" }, { "docid": "0a34bab84788ecb5eca09545cc50a387", "score": "0.56849784", "text": "function encrypt(plaintext, key) {\r\n errors = \"\";\r\n const encrypted = groupBy(processToStr(plaintext, key, 1), 78);\r\n if (errors) {\r\n document.getElementById(\"messages\").value = \"Characters skipped: \" + errors;\r\n }\r\n return encrypted;\r\n}", "title": "" }, { "docid": "6b71e1839aaa5af67a907fae99b03903", "score": "0.56785744", "text": "function caeserCipherEncryptor(str, key) {\n // intitalize an array to contain solution\n const newLetters = []\n // if the key is a big number (ie 54), we want the remainder\n // otherwise we want the number is smaller, it will be the remainder so all is well\n const newKey = key % 26\n // loop thru our str\n for (const letter of str) {\n // add the ciphered letter to result array\n newLetters.push(getNewLetter(letter, newKey))\n }\n //return the ciphered letters\n return newLetters.join('')\n}", "title": "" }, { "docid": "34d286f68d48099fc9e57758d780a7a9", "score": "0.5677679", "text": "function encryptElements() {\r\n for (let i = 0; i < elements.length; i++) {\r\n let elementText = document.getElementById(elements[i]).innerHTML;\r\n document.getElementById(elements[i]).innerHTML = encryption.iterateString(elementText, 13, false);\r\n }\r\n $(\"#hide-cesar\").addClass(\"hidden\");\r\n $(\"#hide-vigenere\").addClass(\"hidden\");\r\n $(\"#intro-more-two\").addClass(\"hidden\");\r\n $(\"#start-game-btn\").addClass(\"hidden\");\r\n $(\"input\").prop('disabled', true);\r\n $(\"textarea\").prop('disabled', true);\r\n $(\"number\").prop('disabled', true);\r\n $(\"button\").prop(\"disabled\", true);\r\n $(\"button\").text(\"xxxx\");\r\n $(\"a\").attr({ \"href\": \"https://www..../\", \"target\": \"_blank\" });\r\n $(\"#input-shift\").val(0);\r\n $(\"#output-shift\").val(0);\r\n $(\"#vigenere-key\").val(\":-(\");\r\n $(\"#vigenere-key-decrypt\").val(\":-(\");\r\n $(\"#restore\").removeClass(\"hidden\");\r\n }", "title": "" }, { "docid": "aac9b0805a96be78bac8ed59b73b2091", "score": "0.56764615", "text": "function caeserCipherEncryptor(str, key) {\n\t// intitalize an array to contain solution\n\tconst newLetters = []\n\t// mod ur current key by 26, cause theres ony 26 letters\n const newKey = key % 26\n //make the alphaet\n const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\t// loop thru our str\n\tfor (const letter of str) {\n\t\t// add the ciphered letter to result array\n\t\tnewLetters.push(getNewLetterB(letter, newKey, alphabet))\n\t}\n\n\t//return the ciphered letters\n\treturn newLetters.join('')\n}", "title": "" }, { "docid": "01c372070fe11603475a5391e70cc100", "score": "0.5669652", "text": "encryptAll(keyphrase) {\r\n const results = [];\r\n this.accounts.map((acct, i) => {\r\n results.push(this.encrypt(i, keyphrase));\r\n });\r\n log.info(`decryptAll for Wallet ${this.name}: ${results.reduce((c, p) => {\r\n return p + (c ? \"1\" : \"0\");\r\n }, \"\")}`);\r\n return results;\r\n }", "title": "" }, { "docid": "8b624ed19c7afb2cae81458f7784c8ff", "score": "0.5658133", "text": "function VigenereCipher(key, abc) {\n let _key = [...key].map(char =>\n abc.indexOf(char))\n\n let _nextKey = index =>\n _key[index % _key.length]\n\n let checkAlphabet = (x, f) => \n abc.indexOf(x) >= 0 ? f(x) : x\n\n this.encode = str =>\n str.replace(/./g, (x, i) =>\n checkAlphabet(x, x => abc[(abc.indexOf(x) + _nextKey(i)) % abc.length]))\n\n this.decode = str =>\n str.replace(/./g, (x, i) =>\n checkAlphabet(x, x => abc[(abc.indexOf(x) - _nextKey(i) + abc.length) % abc.length]))\n}", "title": "" }, { "docid": "c23f0373cd4aedcb7e0fd71f45c0330f", "score": "0.5647893", "text": "updateKeys()\n {\n for (let i = 0; i < NUM_KEYS; i += 4) {\n let a = this.m_keys[i + 0]; let b = this.m_keys[i + 1];\n let c = this.m_keys[i + 2]; let d = this.m_keys[i + 3];\n\n const e = (b & c) | ((~b) & d);\n const f = (d & b) | ((~d) & c);\n const g = b ^ c ^ d;\n const h = c ^ (b | (~d));\n a = (Coder.leftRotate(e, 5) + f * 13) & 0x3fffffff;\n b = (Coder.leftRotate(g, 11) + h * 9) & 0x3fffffff;\n c = (Coder.leftRotate(f, 4) + h * 9871) & 0x3fffffff;\n d = (Coder.leftRotate(h, 21) + e * 0x87a51) & 0x3fffffff;\n this.m_keys[i + 0] = a; this.m_keys[i + 1] = b;\n this.m_keys[i + 2] = c; this.m_keys[i + 3] = d;\n }\n }", "title": "" }, { "docid": "4c8da20c1517b59ba7c7c36cd68da111", "score": "0.5634811", "text": "function makeTable() {\n\t var c, table = [];\n\t\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\t\n\t return table;\n\t }", "title": "" }, { "docid": "a3ed53ab7e765e8802408efc3f5b64ca", "score": "0.5634763", "text": "function Cipher2()\n{\n \n var user_input = document.getElementById(\"input2\").value.toUpperCase(); // get user input from webpage\n var show_Output;\n var keySum = 0; // cipher key number to be used\n \n if (user_input.trim().length == 0)\n {\n alert(\"white space\");\n show_Output = document.getElementById(\"resultC2\");\n show_Output.style.color = \"red\";\n show_Output.innerHTML =\"Invalid input. \\n\\nPlease only enter alphabets between A-Z or a-z\";\n \n }\n else{\n \n \n for(i=0; i<user_input.length; i++)\n {\n keySum = keySum + user_input.charCodeAt(i); // working out key number by iterating through all chracters\n }\n\n key = keySum;\n keySum = keySum % 13; // further operation on key value to be used for encryption\n\n \n var cipherText = \"\";\n for(i=0; i<user_input.length; i++)\n {\n var unico = user_input.charCodeAt(i); // looping thoriugh every single input charcter to convert it into ciphered text\n\n if(unico >=65 && unico <=90) // only convert ciphered text if its UNICODE in specified range\n {\n cipherText = cipherText + String.fromCharCode(unico + keySum); // finally encrypting input to cipher text\n }\n\n\n }\n\n\n cipherText = cipherText + key; // this is to give hint to decrypter to decode text\n\n show_Output = document.getElementById(\"resultC2\");\n show_Output.style.color = \"black\";\n show_Output.innerHTML = cipherText.toString(); // display result\n }\n \n \n}", "title": "" }, { "docid": "8dbf32c771dd3dd1d5597d14f383454b", "score": "0.5620971", "text": "function caesarCipherDecript(str) {\r\n \r\n const alphabetArr = \"abcdefghijklmnopqrstuvwxyz\".split(\"\");\r\n let resultrot13EncriptCaesarCypher = \"\";\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n const char = str[i];\r\n const idx = alphabetArr.indexOf(char);\r\n\r\n // if it is not a letter, don`t shift it\r\n if (idx === -1) {\r\n resultrot13EncriptCaesarCypher += char;\r\n continue;\r\n }\r\n\r\n // only 26 letters in alphabet, if > 26 it wraps around\r\n var shift = 6;\r\n const encodedIdx = (idx + shift) % 26;\r\n resultrot13EncriptCaesarCypher += alphabetArr[encodedIdx];\r\n }\r\n //return res;\r\n document.getElementById(\"showresult\").value = resultrot13EncriptCaesarCypher;\r\n //console.log(res);\r\n}", "title": "" }, { "docid": "afded9229e682e27b776c4aeb0acbf82", "score": "0.5619491", "text": "function caesarCipher(str, key) {\n if (key > 26)\n key = key % 26;\n return str.toLocaleLowerCase().split('').map(function (val) {\n return String.fromCharCode((val.charCodeAt(0) + key) > 122 ? val.charCodeAt(0) + key - 26 :\n val.charCodeAt(0) + key); // 122 is 'z' so if charCode more than 122 we need to circle it by subtracting 26\n }).join('');\n}", "title": "" }, { "docid": "0a6f55d0af1da4b74d15562dfee7cb3c", "score": "0.5615959", "text": "function CaesarCipher(str,num) { \n var littleAlpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n var bigAlpha = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n var result = '';\n var parts = str.split('');\n var ourIndex = 0;\n for (var i = 0; i < parts.length; i++){\n if (parts[i] >= 'a' && parts[i] <= 'z'){\n ourIndex = littleAlpha.indexOf(parts[i]);\n result += littleAlpha[ourIndex + num];\n } else if (parts[i] >= 'A' && parts[i] <= 'Z'){\n ourIndex = bigAlpha.indexOf(parts[i]);\n result += bigAlpha[ourIndex + num];\n } else {\n result += parts[i];\n }\n }\n return result;\n}", "title": "" }, { "docid": "a2f94a43f3a04c90906e95c8bb4f3e21", "score": "0.56101555", "text": "encrypt(plaintext, key) {\n \n // Pad the plaintext (using spaces as padding).\n while(plaintext.length % 8 != 0) {\n plaintext += \" \";\n }\n plaintext = convertToBits(plaintext);\n \n // Encrypt the plaintext (64 bits at a time).\n for(let i = 0; i < plaintext.length / 64; i++) {\n let blockOfPlaintext = plaintext.slice(i * 64, (i + 1) * 64);\n let subkeys = DES_Subkeys.generateSubkeysEncryption(key);\n Permutation.initialPermute(blockOfPlaintext);\n }\n\n\n\n\n return plaintext;\n \n }", "title": "" }, { "docid": "f1b652c47168e2962bbd6a050a0280db", "score": "0.5604379", "text": "function caesarCipher(plaintext, key) {\n let shiftedPlainText = '';\n for (let char of plaintext) {\n if ((/[a-z]/i).test(char)) {\n shiftedPlainText += shiftLetter(char, key);\n } else {\n shiftedPlainText += char;\n }\n }\n\n return shiftedPlainText;\n\n function shiftLetter(letter, key) {\n const ALPHABET = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r' ,'s', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n let shiftedIndex = ((ALPHABET.indexOf(letter.toLowerCase()) + key) % 26);\n let shiftedLetter = ALPHABET[shiftedIndex];\n if (letter === letter.toUpperCase()) {\n return shiftedLetter.toUpperCase();\n } else {\n return shiftedLetter;\n }\n }\n}", "title": "" }, { "docid": "4be4c709b6232c2f3933e4290e6b3519", "score": "0.56036377", "text": "function login_cipher(enctext,N)\r\n{\r\n\t//\r\n\tvar hidden = ((g_old_random_N & 0x00FFFFFF) + (g_random_N & 0x00FFFFFF)) & 0x00FFFFFF;\t// variable line\r\n\t//\t\r\n\tvar i = 0;\t\r\n\tvar dest = \"\";\r\n\t\r\n\tvar R = hidden;\r\n\t\r\n\twhile ( i < N ) {\r\n\t\tvar c = enctext.charAt(i);\r\n\t\tvar cc = enctext.charCodeAt(i);\r\n\t\tvar mc = (R & 0xFF);\r\n\t\r\n\t\tR = (R >> 8) & 0x00FFFFFF;\r\n\t\tif ( R == 0 ) {\r\n\t\t\thidden *= g_localprime;\r\n\t\t\thidden = ( hidden & 0x00FFFFFF );\r\n\t\t\tR = hidden;\r\n\t\t}\r\n\t\t//\r\n\t\t//\r\n\t\tcc = mc ^ cc;\r\n\t\t\r\n\t\tdest += cc.toString() + '_';\r\n\t\t//\r\n\t\ti++;\r\n\t\t//\r\n\t}\r\n\t\r\n\treturn(dest);\r\n}", "title": "" }, { "docid": "f491dcf422b74eb0a58a36656589b99d", "score": "0.55861557", "text": "function decrypt(p){\n var ciphertext=document.getElementById(\"ciphertextArea\").value;\n myFunc=function(c){\n return alphabet[p[c]];\n };\n var plainText = ciphertext.split('').map(myFunc).join(\"\");\n return plainText;\n //document.getElementById(\"plaintextArea\").value = plainText;\n}", "title": "" }, { "docid": "f0c7c85ec7b737de1c151c0803658e13", "score": "0.5583317", "text": "function firstLayerEncryption(input) {\n var output = [];\n var i;\n for ( i in input) {\n output[i] = String.fromCharCode((input[i].charCodeAt(0)) ^ (Math.random()*(255-1)+1));\n }\n //writeToFile(output,\"AsciiEncoded.js\");\n return output;\n}", "title": "" }, { "docid": "94baab24847ea08c4bf383c1bc5ccdad", "score": "0.55824095", "text": "function caesarCipherEncryptor(string, key) {\n // Write your code here.\n // Create a var representing the alphabet\n // for loop: for each letter of the string,\n // find that letter's index in the alphabet. add 2 to that.\n // return alphabet with the new index\n // if it goes past 26, subtract 26\n\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let newStr = \"\";\n\n for (let i = 0; i < string.length; i++) {\n let idx = alphabet.indexOf(string[i]) + key;\n if (idx > 25) {\n idx = idx % 26;\n }\n newStr += alphabet[idx];\n }\n return newStr;\n}", "title": "" }, { "docid": "df431bc4cde377c9331eb47733e4919a", "score": "0.5579745", "text": "function decipher() {\n var keyInput = parseInt(document.getElementById(\"key\").value);\n var uInput = document.getElementById(\"ceaser\").value;\n var alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n var output = \"\";\n\n for (i = 0; i <= uInput.length; i++) {\n\n for (j = 0; j <= alphabet.length; j++) {\n\n if (uInput[i] == \" \") {\n\n output += \" \";\n\n } else if (uInput[i] == alphabet[j]) {\n\n var index2 = j - keyInput;\n if (index2 < 0) {\n\n index2 += 26;\n }\n x = alphabet[index2];\n output += x;\n }\n\n\n }\n\n\n }\n\n var sillyString = output.slice(0, -1);\n document.getElementById(\"test\").innerHTML = sillyString;\n\n\n}", "title": "" }, { "docid": "95cd3df0374792c1a506d3f4492cdde0", "score": "0.5570171", "text": "function cipher (arr,ee,nn) {\n\t//TODO\n\tvar arrOut=[];\n\tfor (var i in arr) {\t\t\t\n\t\tarrOut.push(powMod(arr[i],ee,nn));\t// arrOut.push(Math.pow(arr[i],ee) % nn) ;\t\n\t}\t\n\treturn arrOut;\n}", "title": "" }, { "docid": "372c1727757e4f20bda06b5e3343b697", "score": "0.5567031", "text": "function atbashCipher(text) {\n let output = \"\";\n let alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n for (let i = 0; i < text.length; i++) {\n output += alphabet[26 - alphabet.indexOf(text[i]) - 1];\n }\n return output;\n}", "title": "" }, { "docid": "e8c71dc2eec1c5472314e3a8e710b52b", "score": "0.5528228", "text": "function caesarCipherEncryptor(string, key) {\n // Write your code here.\n if (key === 0) return string;\n let result = \"\";\n let alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n for (let i = 0; i < string.length; i++) {\n console.log(\"char\", string[i]);\n //grab the current char from input and find at what idx is it in alphabet\n let curIdx = alphabet.indexOf(string[i]); //23\n console.log(\"currentIdx\", curIdx);\n //find the needed idx of the letter that should replace it (from alphabet)\n let newIdx = curIdx + key; //25\n console.log(\"newIdx\", newIdx);\n while (newIdx >= 26) {\n newIdx = newIdx - 26;\n console.log(\"newIdx in loop\", newIdx);\n }\n //find that new letter and add it to the result string\n result += alphabet.charAt(newIdx);\n console.log(\"results string\", result);\n }\n return result;\n}", "title": "" }, { "docid": "84583ac931e156b8828912927e6a698e", "score": "0.5502226", "text": "encryptBlock(block) {\n const src = block.data;\n const dst = block.data;\n let s0 = readUint32BE(src, 0);\n let s1 = readUint32BE(src, 4);\n let s2 = readUint32BE(src, 8);\n let s3 = readUint32BE(src, 12);\n // First round just XORs input with key.\n s0 ^= this._encKey[0];\n s1 ^= this._encKey[1];\n s2 ^= this._encKey[2];\n s3 ^= this._encKey[3];\n let t0 = 0;\n let t1 = 0;\n let t2 = 0;\n let t3 = 0;\n // Middle rounds shuffle using tables.\n // Number of rounds is set by length of expanded key.\n const nr = this._encKey.length / 4 - 2; // - 2: one above, one more below\n let k = 4;\n for (let r = 0; r < nr; r++) {\n t0 = this._encKey[k + 0] ^ Te0[(s0 >>> 24) & 0xff] ^ Te1[(s1 >>> 16) & 0xff] ^\n Te2[(s2 >>> 8) & 0xff] ^ Te3[s3 & 0xff];\n t1 = this._encKey[k + 1] ^ Te0[(s1 >>> 24) & 0xff] ^ Te1[(s2 >>> 16) & 0xff] ^\n Te2[(s3 >>> 8) & 0xff] ^ Te3[s0 & 0xff];\n t2 = this._encKey[k + 2] ^ Te0[(s2 >>> 24) & 0xff] ^ Te1[(s3 >>> 16) & 0xff] ^\n Te2[(s0 >>> 8) & 0xff] ^ Te3[s1 & 0xff];\n t3 = this._encKey[k + 3] ^ Te0[(s3 >>> 24) & 0xff] ^ Te1[(s0 >>> 16) & 0xff] ^\n Te2[(s1 >>> 8) & 0xff] ^ Te3[s2 & 0xff];\n k += 4;\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n }\n // Last round uses s-box directly and XORs to produce output.\n s0 = (SBOX0[t0 >>> 24] << 24) | (SBOX0[(t1 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t2 >>> 8) & 0xff]) << 8 | (SBOX0[t3 & 0xff]);\n s1 = (SBOX0[t1 >>> 24] << 24) | (SBOX0[(t2 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t3 >>> 8) & 0xff]) << 8 | (SBOX0[t0 & 0xff]);\n s2 = (SBOX0[t2 >>> 24] << 24) | (SBOX0[(t3 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t0 >>> 8) & 0xff]) << 8 | (SBOX0[t1 & 0xff]);\n s3 = (SBOX0[t3 >>> 24] << 24) | (SBOX0[(t0 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t1 >>> 8) & 0xff]) << 8 | (SBOX0[t2 & 0xff]);\n s0 ^= this._encKey[k + 0];\n s1 ^= this._encKey[k + 1];\n s2 ^= this._encKey[k + 2];\n s3 ^= this._encKey[k + 3];\n writeUint32BE(s0, dst, 0);\n writeUint32BE(s1, dst, 4);\n writeUint32BE(s2, dst, 8);\n writeUint32BE(s3, dst, 12);\n return this._emptyPromise;\n }", "title": "" }, { "docid": "f6fc69d7beb32e703e9280731378c941", "score": "0.55018574", "text": "function Cipher3Decode()\n{\n var user_input = document.getElementById(\"inputC3\").value.toUpperCase(); // get user input from webpage\n var show_Output;\n var key = document.getElementById(\"key_inputC3\").value.toUpperCase(); // cipher key number to be used\n var keySum =0;\n if (user_input.trim().length == 0)\n {\n alert(\"white space\");\n show_Output = document.getElementById(\"resultC3\");\n show_Output.style.color = \"red\";\n show_Output.innerHTML =\"Invalid input. \\n\\nPlease only enter alphabets between A-Z or a-z\";\n \n }\n else if(key.trim().length == 0 )\n {\n show_Output = document.getElementById(\"resultC3\");\n show_Output.style.color = \"red\";\n \n show_Output.innerHTML =\"Please enter key.\";\n }\n else{\n \n \n for(i=0; i<key.length; i++)\n {\n keySum = keySum + key.charCodeAt(i); // working out key number by iterating through all chracters\n }\n \n\n \n keySum = keySum % 6; // further operation on key value to be used for encryption\n\n \n var cipherText = \"\";\n for(i=0; i<user_input.length; i++)\n {\n var unico = user_input.charCodeAt(i); // looping thoriugh every single input charcter to convert it into ciphered text\n\n \n cipherText = cipherText + String.fromCharCode(unico - keySum); // finally encrypting input to cipher text\n \n\n }\n\n\n \n\n show_Output = document.getElementById(\"resultC3\");\n show_Output.style.color = \"black\";\n show_Output.innerHTML = cipherText.toString(); // display result\n }\n \n}", "title": "" }, { "docid": "2c2cb8d28d4e9ae404d92c119a8765b7", "score": "0.5495046", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n =0; n < 256; n++) {\n\t c = n;\n\t for (var k =0; k < 8; k++) {\n\t c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "2c2cb8d28d4e9ae404d92c119a8765b7", "score": "0.5495046", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n =0; n < 256; n++) {\n\t c = n;\n\t for (var k =0; k < 8; k++) {\n\t c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "b3516c9fe0af26ffe5d2724033b6e6b3", "score": "0.54877555", "text": "function makeTable() {\n var c, table = [];\n \n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n \n return table;\n }", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "9d0b288a96fab24669f3333935d7f87a", "score": "0.5485722", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "d161a16196421fd84efb43d69bfb0bd1", "score": "0.54811877", "text": "function caesarEncrypt(plainText, key) {\n var LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var isLowerCaseLetter = function (c) { return /[a-z]/.test(c); };\n var isUpperCaseLetter = function (c) { return /[A-Z]/.test(c); };\n\n return plainText.split('').map(function (char) {\n var index = Math.max(LETTERS.indexOf(char),\n LETTERS.indexOf(char.toUpperCase()));\n\n if (index === -1) return char;\n\n if (key > 0) index = shiftRight(index, key, LETTERS.length);\n if (key < 0) index = shiftLeft(index, -key, LETTERS.length);\n\n var cipher = LETTERS[index];\n if (isLowerCaseLetter(char)) {\n cipher = cipher.toLowerCase();\n }\n\n return cipher;\n }).join('');\n}", "title": "" }, { "docid": "ab69a49968ff3db68c1589d6e16f0b11", "score": "0.5477761", "text": "function caesarCipher(s, k) {\n // 한바퀴를 더 돌 경우( a+25=>z ) 모듈러 연산으로 무시\n k = k % 26;\n return s.split(\"\").map((char) => {\n let ascii = char.charCodeAt(0);\n if (ascii >= 65 && ascii <= 90) {\n let offset = 90 - k + 1;\n if (ascii / offset >= 1) {\n return String.fromCharCode(ascii % offset + 65);\n } else {\n return String.fromCharCode(ascii + k);\n }\n } else if (ascii >= 97 && ascii <= 122) {\n let offset = 122 - k + 1;\n if (ascii / offset >= 1) {\n return String.fromCharCode(ascii % offset + 97);\n } else {\n return String.fromCharCode(ascii + k);\n }\n } else {\n return char;\n }\n }).join(\"\");\n}", "title": "" }, { "docid": "f90821fbfdfb1992e511ce8d78e0dfd0", "score": "0.5471522", "text": "function encryption(){\n this.saltrounds = 10;\n this.rawtext = '';\n this.encryptedword = '';\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "7eea2dd797d78b463b209f64a5f89a61", "score": "0.54702914", "text": "function makeTable() {\n var c, table = [];\n\n for(var n =0; n < 256; n++){\n c = n;\n for(var k =0; k < 8; k++){\n c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "51c90bd8afc9ab169ff7c7869a4fc93e", "score": "0.54634273", "text": "function makeTable() {\n\t var c, table = [];\n\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\n\t return table;\n\t}", "title": "" }, { "docid": "d5b7ee678408b74d6dc4e78f5c2a8042", "score": "0.5463269", "text": "function EncryptData() {\n var _0xd2e2x2 = $('#ctl00_ucRight1_txtMatKhau')[_0xa5e2[0]]();\n var _0xd2e2x3 = document[_0xa5e2[1]]('ctl00_ucRight1_txtMatKhau'); // Lấy đối tượng input passowrd\n var _0xd2e2x4 = $('#ctl00_ucRight1_txtMaSV')[_0xa5e2[0]](); // Lấy ra giá trị mã sinh viên để tạo salt\n try {\n var _0xd2e2x5 = CryptoJS[_0xa5e2[5]][_0xa5e2[4]][_0xa5e2[3]](_0xa5e2[2]);\n var _0xd2e2x6 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](GetPrivateKey(_0xd2e2x4)); /// Lấy chuổi salt\n var _0xd2e2x7 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](_0xa5e2[7]);\n var _0xd2e2x8 = CryptoJS.PBKDF2(_0xd2e2x6.toString(CryptoJS[_0xa5e2[5]].Utf8), _0xd2e2x7, {\n keySize: 128 / 32,\n iterations: 1000\n });\n var _0xd2e2x9 = CryptoJS[_0xa5e2[13]][_0xa5e2[12]](_0xd2e2x2, _0xd2e2x8, {\n mode: CryptoJS[_0xa5e2[9]][_0xa5e2[8]],\n iv: _0xd2e2x5,\n padding: CryptoJS[_0xa5e2[11]][_0xa5e2[10]]\n });\n _0xd2e2x3[_0xa5e2[14]] = _0xd2e2x9[_0xa5e2[15]].toString(CryptoJS[_0xa5e2[5]].Base64); // Lấy ra Passowrd đã dược hash\n } catch (err) {\n return _0xa5e2[16]; // trả về \"\"\n };\n}", "title": "" }, { "docid": "d54471b16b52a3304e004450caefa80e", "score": "0.5462922", "text": "function caesarCipherEncryptor(string, key) {\n\t// initialize new letter array\n\tconst newLetters = []\n\t// mod by number of letters just in case key > 26\n\tconst newKey = key % 26\n\tfor (const letter of string) {\n\t\tnewLetters.push(getNewLetter(letter, newKey))\n\t}\n\treturn newLetters.join('')\n}", "title": "" }, { "docid": "0f3f208469b50e1d63d9b30098ef4569", "score": "0.54623574", "text": "relevant_l33t_subtable(password, table) {\n const password_chars = {};\n for (let chr of Array.from(password.split(''))) {\n password_chars[chr] = true;\n }\n const subtable = {};\n for (let letter in table) {\n const subs = table[letter];\n const relevant_subs = (Array.from(subs).filter((sub) => sub in password_chars));\n if (relevant_subs.length > 0) {\n subtable[letter] = relevant_subs;\n }\n }\n return subtable;\n }", "title": "" }, { "docid": "c5d4d0a6421bedc10b2cd55e895558ff", "score": "0.5460464", "text": "function encrypt(clearText){\n var result = \"\";\n //loopt door elk character van clearText\n for (var i = 0; i < clearText.length; i++) {\n \n //get the character code van elk character\n var charcode = clearText.charCodeAt(i);\n \n // handle uppercase letters\n if(charcode >= 65 && charcode <= 90) {\n result += String.fromCharCode((charcode - 65 + setOffsetValue()) % 26 + 65); \n \n // handle lowercase letters\n }else if(charcode >= 97 && charcode <= 122){\n result += String.fromCharCode((charcode - 97 + setOffsetValue()) % 26 + 97);\n \n // Negeer het als het geen letter is\n }else {\n result += clearText.charAt(i);\n }\n }\n return result;\n }", "title": "" }, { "docid": "4200baa6f460000b22134dce5b360269", "score": "0.5457054", "text": "function caesarCipherEncryptor(string, key) {\n const newLetters = []\n\tconst newKey = key % 26\n\tconst alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\tfor (const letter of string) {\n\t\tnewLetters.push(getNewLetter(letter, newKey, alphabet))\n\t}\n\treturn newLetters.join('')\n}", "title": "" }, { "docid": "0721b3d5af229dadb9dd2df6d5e3d123", "score": "0.5455955", "text": "function encipherPair(str) {\n if (str.length != 2) return false;\n var pos1 = getCharPosition(str.charAt(0));\n var pos2 = getCharPosition(str.charAt(1));\n var char1 = \"\";\n\n // Same Column - Increment 1 row, wrap around to top\n if (pos1.col == pos2.col) {\n pos1.row++;\n pos2.row++;\n if (pos1.row > cipher.maxRow - 1) pos1.row = 0;\n if (pos2.row > cipher.maxRow - 1) pos2.row = 0;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n } else if (pos1.row == pos2.row) {\n // Same Row - Increment 1 column, wrap around to left\n pos1.col++;\n pos2.col++;\n if (pos1.col > cipher.maxCol - 1) pos1.col = 0;\n if (pos2.col > cipher.maxCol - 1) pos2.col = 0;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n } else {\n // Box rule, use the opposing corners\n var col1 = pos1.col;\n var col2 = pos2.col;\n pos1.col = col2;\n pos2.col = col1;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n }\n return char1;\n}", "title": "" }, { "docid": "417d45b62cdebe4d0bd84a4cbe4a2f4c", "score": "0.5454998", "text": "function caesarCipherEncryptor(string, key) {\n // Write your code here.\n // we have to mutate this array we created, to work w edge case, where the ends move to the front. \n // the search ? // charAt(), IndexAt() or we can use a hash table \n const shiftedAlphabet = shiftAlphabet(key);\n let alphabet = 'abcdefghijklnmopqrstuvwxyz'.split('');\n let returnString = []; //space\n // O(n) \n for (let i = 0; i < string.length; i++) {\n // indexof O(N) if it is, we have to use a hash table in Javascript O(n) of constant 26\n let letterIndex = alphabet.indexOf(string[i]); \n returnString.push(shiftedAlphabet[letterIndex]) \n }\n return returnString.join('')\n }", "title": "" }, { "docid": "af0622264929bf5de54acc9a7dbaa4fc", "score": "0.5452733", "text": "function crypto(inputText){\n var letter = /^[a-zA-Z]+$/;\n let sentenceOne = inputText.toLowerCase().split(\"\");\n console.log('sentenceOne (after split) = ', sentenceOne);\n var array=[];\n for(var i = 0 ; i < sentenceOne.length; i++){\n if(sentenceOne[i].match(letter)){\n array.push(sentenceOne[i]);\n }\n }\n\n // array = ['b', 'u', 'n', 'm', 'a', ..,]\n // finalSentence = 'bunmannunsun'\n var rows = Math.ceil(Math.sqrt(array.length));\n var cols = Math.ceil(array.length/rows);\n var finalSentence = array.join(\"\");\n console.log('stripped sentence - ', finalSentence);\n\n for(var i=1; i < rows+1 ; i ++){\n this[\"row\"+i] = finalSentence.slice(0,cols);\n finalSentence = finalSentence.slice(cols);\n console.log(\"row\"+i+\" = \", this[\"row\"+i]);\n }\n\n for(var i = 1; i < cols+1; i++){\n this[\"cols\"+i] = \"\";\n }\n\n for(var i = 0; i < cols; i++) {\n let colName = \"cols\"+ (i + 1);\n for(var j = 1; j < rows+1; j++){\n this[colName] = this[colName] + this[\"row\"+j][i];\n }\n\n console.log(`${colName} = ${this[colName]}`);\n }\n var colsJoin = \"\";\n for(var i = 1; i < cols+1; i++){\n colsJoin = colsJoin + this[\"cols\"+i];\n }\n\n // nn\n // bmnsu; bmnsu\n // uuunn; bmnsu uuunn nn\n var output = \"\";\n while(colsJoin.length > 0){\n output = output + colsJoin.slice(0,5) + \" \";\n colsJoin= colsJoin.slice(5);\n console.log(`output: ${output}`);\n }\n return output;\n }", "title": "" }, { "docid": "a81185daf1a2c11cf7efbdaaf05e105e", "score": "0.5448676", "text": "function encryptGameWord() {\r\n if (level < stages.length - 1) {\r\n encryptedGameWord = encryption.iterateString(gameWord, gameShift, true);\r\n }\r\n else {\r\n gameKey = encryption.convertKeyToNumbers(finalStageKeys[0]);\r\n encryptedGameWord = encryption.iterateVigenereString(gameWord, gameKey, false);\r\n\r\n }\r\n }", "title": "" }, { "docid": "31db5c5a5ca2330913ebdc6656bddddc", "score": "0.54473794", "text": "function makeTable() {\n var c,\n table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;\n }\n table[n] = c;\n }\n\n return table;\n }", "title": "" }, { "docid": "dea0f88660242da484ce890bdece7e24", "score": "0.544266", "text": "static Cipher(input, key, Nk, Nr) {\n input = roteteArray(input);\n //key = roteteArray(key);\n\n let w = this.KeyExpansion(key, Nk, Nr);\n\n let state = input;\n\n state = this.AddRoundKey(state, w, 0);\n\n for (let round = 1; round <= Nr - 1; ++round) {\n state = this.SubBytes(state);\n state = this.ShiftRows(state);\n state = this.MixColumns(state);\n state = this.AddRoundKey(state, w, round);\n }\n\n state = this.SubBytes(state);\n state = this.ShiftRows(state);\n state = this.AddRoundKey(state, w, Nr);\n\n let output = roteteArray(state);\n return output;\n }", "title": "" }, { "docid": "321073f9ebe01e010a5c1ee061815fcb", "score": "0.54421926", "text": "function makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n }", "title": "" }, { "docid": "f3c3cb252ded72ef749324d0701f7317", "score": "0.5440261", "text": "function enableDecryptFields() {\r\n $(\"#text-to-decrypt\").prop('disabled', false);\r\n $(\"#vigenere-to-decrypt\").prop('disabled', false);\r\n }", "title": "" }, { "docid": "800962914fcfc6b5abe6a4b521867916", "score": "0.5433139", "text": "function cipher() {\n // variable acía, para recibir los índices cifrados\n var cipherPhrase = '';\n // recorro la frase obtenida\n for (var i = 0; i < obtainedPhrase.length; i++) {\n // si la frase tiene espacio, devuelve espacio\n if (obtainedPhrase[i] === ' ') {\n cipherPhrase = cipherPhrase + ' ';\n } else {\n // codifica a ASCII las letras de la frase\n var letters = obtainedPhrase.charCodeAt(i);\n // fórmula para cifrar\n letters = (((letters - 65) + 7) % 26) + 65;\n // devuelve las letras de lo cifrado\n letters = String.fromCharCode(letters);\n cipherPhrase = cipherPhrase + letters;\n }\n }\n return alert('Tu frase cifrada se ve así: \\n' + cipherPhrase);\n}", "title": "" } ]
b72cd1b7cfdd23defafce63117091164
End squirrel code Check screen orientation
[ { "docid": "2d9fdb8323852eea025b44f46fa67310", "score": "0.66998523", "text": "function readDeviceOrientation() {\n if ( win.innerWidth > win.innerHeight ) {\n AG.env.isPortrait = false; // Landscape\n } else {\n AG.env.isPortrait = true; // Portrait\n }\n }", "title": "" } ]
[ { "docid": "52647fa6440a4b2c00cebe3b160e4e09", "score": "0.72427016", "text": "function checkOrientation() {\n\t$heightCon = ($(\"div#container\").height == screen.height) || ($(\"div#container\") == screen.width / 1.5);\n\t$widthCon = $(\"div#container\").width() == screen.width;\n\n\tif ($heightCon && $widthCon) {\n\t\tclearInterval(interval);\n\t} else {\n\t\tinitialize();\n\t}\n}", "title": "" }, { "docid": "263c55196e84feb761e7e977e0471c7e", "score": "0.709092", "text": "function checkOrientation()\n{\n\tif(window.matchMedia(\"(orientation: portrait)\").matches) {\n\t\talert(\"Please switch to Landscape Mode\");\n\t}\n}", "title": "" }, { "docid": "780fa3f6fb2390043f810e99056195c8", "score": "0.69242865", "text": "function checkMobileOrientation() {\n\tvar isLandscape=false;\n\t\n\tif(window.innerWidth>window.innerHeight){\n\t\tisLandscape=true;\n\t}\n\t\n\tif($.editor.enable){\n\t\tviewport.isLandscape = edit.isLandscape;\n\t}else{\n\t\tviewport.isLandscape = isLandscape;\t\n\t}\n\t\n\tchangeViewport(viewport.isLandscape);\n\tresizeGameFunc();\n\t$('#canvasHolder').show();\n}", "title": "" }, { "docid": "e45b3ad285011bbed92ccc774e5f2810", "score": "0.6826164", "text": "static getScreenOrientation() {\n const ws = window.screen;\n const o = (ws.orientation || ws.webkitOrientation || ws.mozOrientation || ws.msOrientation || {});\n const angle = typeof window.orientation === 'number' ? window.orientation : o.angle;\n if (o.type) {\n return o.type.replace(/-primary|-secondary/, '');\n } else if (typeof angle === 'undefined') {\n return 'unknown';\n } else if (angle === -90 || angle === 90) {\n return 'landscape'; // + (if angle is 90 then \"-primary\" else \"-secondary\")\n }\n return 'portrait'; // we assume primary since most devices don't allow using the browser upside-down\n }", "title": "" }, { "docid": "d0d8792b3cece63fffb7324ab2890b20", "score": "0.6821445", "text": "function crudeOrientationDetection()\n{\n if(window.innerWidth > window.innerHeight)\n _isPortrait = false;\n else\n _isPortrait = true;\n\n scaleRot = [10*60/window.innerWidth, 30/window.innerHeight];\n centerPos = [0.5*window.innerWidth, 0.5*window.innerHeight];\n\n scaleMovement = [2000/window.innerWidth, 300/window.innerHeight]\n}", "title": "" }, { "docid": "ea82e69216982133c4c1fb4c1b89ea88", "score": "0.6693251", "text": "DetectOrientation() {\n if(this.state.Height_Layout > this.state.Width_Layout) {\n this.setState({\n OrientationPortrait: true,\n OrientationLandScape: false\n })\n }else if(this.state.Height_Layout < this.state.Width_Layout) {\n this.setState({\n OrientationPortrait: false,\n OrientationLandScape: true\n })\n }\n }", "title": "" }, { "docid": "8fc1fc5dcf6bcf36cabcdb5765ef005e", "score": "0.6651539", "text": "function checkIfOrientationChanged() {\n var oldValue = orientation.name;\n\n orientation.isPortrait = window.innerWidth < window.innerHeight;\n orientation.isLandscape = !orientation.isPortrait;\n orientation.name = orientation.isPortrait ? 'portrait' : 'landscape';\n\n return orientation.name != oldValue;\n }", "title": "" }, { "docid": "427be77a450b2802901a16f932d24adc", "score": "0.64901376", "text": "function landScapeMode() {\n toggleFullScreen();\n\n if(typeof window.screen.orientation !== 'undefined'){\n window.screen.orientation.lock(\"landscape-primary\")\n .then(function () {\n\n })\n .catch(function (error) {\n //alert(error);\n });\n }\n\n}", "title": "" }, { "docid": "8b0902440808e4ffa0ce724439457e88", "score": "0.63972336", "text": "function androidProfileCheck() {\nreturn deviceProfile ? window.innerHeight === deviceProfile[orientation] : false;\n}", "title": "" }, { "docid": "d5abf327b87767978c415966dba61de5", "score": "0.6384725", "text": "function orientation(orient) {\n try {\n screen.orientation.lock(orient).then(\n function(){},\n function(){}\n ).catch(function(){}); \n }catch(e){}; \n}", "title": "" }, { "docid": "10f1c34bdce20e878cd2b3894797a6a8", "score": "0.63695544", "text": "function _android_portrait () {\n var w = parseInt( window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 10 ),\n h = parseInt( window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 10 );\n\n return h > w;\n }", "title": "" }, { "docid": "f17c7d971d2d11c29f5bd6d8b2e2f3d1", "score": "0.6320499", "text": "function determineOrientation() {\n //right side\n let rightShoulderPos = model_getPartCoordinate(\"rightShoulder\", minConfidence);\n let rightWristPos = model_getPartCoordinate(\"rightWrist\", minConfidence);\n\n //left side\n let leftShoulderPos = model_getPartCoordinate(\"leftShoulder\", minConfidence);\n let leftWristPos = model_getPartCoordinate(\"leftWrist\", minConfidence);\n\n //determine which side the user is facing\n if (rightShoulderPos == undefined || rightWristPos == undefined) {\n return orientation.LEFT;\n }\n else if (leftShoulderPos == undefined || leftWristPos == undefined) {\n return orientation.RIGHT;\n }\n else {\n //determine orientation manually\n let rightAvg = rightShoulderPos[1] + rightWristPos[1];\n let leftAvg = leftShoulderPos[1] + leftWristPos[1];\n if (rightAvg > leftAvg) {\n return orientation.RIGHT;\n } else if (leftAvg > rightAvg) {\n return orientation.LEFT;\n } else {\n //in the one in a billion chance that the averages are equal\n return undefined;\n }\n }\n}", "title": "" }, { "docid": "52770aaf77d25fa4a24573440e36abf9", "score": "0.63026243", "text": "function forceScreenOrientation() {\n // in portrait mode\n while(window.matchMedia(\"(orientation: portrait)\").matches) {\n alert(\"Please change device to landscape mode\");\n if(!!window.chrome || !!window.chrome.webstore) { // if chrome\n alert(\"Reload it in landscape mode for proper functionality, or use another browser.\"); // need to fix reset method to remove this alert\n break;\n } else {\n alert();\n }\n }\n}", "title": "" }, { "docid": "0b002d42fefbee72dfd7d4f41dbe1784", "score": "0.6214598", "text": "function readDeviceOrientation() {\r\n\r\n\t\tif (Math.abs(window.orientation) == 90) {\r\n\t\t\t// Landscape\r\n\t\t\tdocument.getElementById('coverLandscape').style.display = \"table\";\r\n\t\t\tdocument.getElementById('listadoContenedor').style.display = \"none\";\r\n\t\t\t//document.getElementById('Body').style.overflow = \"hidden\";\r\n\r\n\t\t} else {\r\n\t\t\t// Portrait\r\n\t\t\tdocument.getElementById('coverLandscape').style.display = \"none\";\r\n\t\t\tdocument.getElementById('listadoContenedor').style.display = \"table\";\r\n\t\t\t//document.getElementById('Body').style.overflow = \"visible\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8e5e8ab3f1b9e5cd2ba2112089b4bdb8", "score": "0.62104034", "text": "static orientation(orientation) {\n let a1, a2;\n if (orientation == null) { orientation = 'all'; }\n const existingElement = document.querySelector('.ce-turn-screen');\n if (existingElement != null) { document.body.removeChild(existingElement); }\n const existingStyle = document.querySelector('.ce-turn-screen-style');\n if (existingStyle != null) { document.head.removeChild(existingStyle); }\n if (orientation === 'all') { return; }\n\n const ORIENTATIONS = ['all', 'landscape', 'portrait']\n if (!ORIENTATIONS.includes(orientation)) { throw new Error(`invalid orientation type '${orientation}'`); }\n\n const div = document.createElement('div');\n div.setAttribute('class', 'ce-turn-screen');\n div.style = `position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background-color: #f0f0f0; z-index: ${Config.instance.ui.zIndex.orientation};`;\n\n const img = document.createElement('img');\n img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AYNDy012n9FrgAABkxJREFUeNrt3T1sG+cBgGGTRx3FH5GipADhjyGAg5EgaBa1BWog7dIgY5DFXQLEBRJ4yFI0S7aqyOAtS1B3bBEgWYIMLYJ0MZKxk7yoSzoYgmFRaAtRKgmSIU++6xKgi4eTJYo0+TzzR+l0pxffd+Tx7to1AAAAAAAAAOD/MnbB07Xb7d2HDx/uTvN37OzsJPb0bOzt7aX638/aVU9Xq9V+1263d+2J5SYQkSAQkSAQkSAQkSAQkSAQkSAQkSAQkbCocsv2BzcajReDIHg1CIJXgiBo53K57SAI6kEQbGaz2Vo2m13NZDLhOSK5Nu1P3NN+6svlX52w8IE0m80bKysrb4Rh+Nrq6urNlZWV5hRmkqlHghnk0rRarZ/m8/lbxWLxrTAM21e03BKJQOZ66fRCPp+/XSqV3s3n8zdmdE4iEoHM3RLq5UKh8MHa2trb2Ww2Pwcn7iIRyFyE8VKpVNotl8u3MpmMk1gE8sNSaqtYLH5UqVTey2QywTxt28nJye/NHgKZiXq9ngnD8M76+vrdXC63Pm/bJw6BzHI51a5UKn8qFos/n8ftE4dAZmZ7e/udWq32SRAEa1f1O5MkeZJ2+SYOgcxqSbVaKpXuVavVX1/2zz47OzudTCb7URTtR1G0H8fxQRzHnSRJ/pUkSffo6ChK84msOAQyqyVVo1qt/qVQKPz4Mn5eHMfj4XD4zXg8vh9F0f04jvePjo4udEmCOAQyqzh+tLGx8XUYhq0LLpOS4XD47Wg0+iyKoi87nc5/nXPwXAfSarVubm1tfR0EQfUCs8X3/X7/09Fo9PHh4eF3TshZiECuX7/+i83Nza+CICg/YxiTXq93bzQa3e10Ov+exjaKQyCzmjl+dpE4+v3+F4PB4MPDw8OH09pGcQhkZuccW1tbf3uWOKIo6pyent559OjRV9PcRnEIZFZxNDY2Np7pnKPX630+GAze73Q6p+Jg4QKp1+ur1Wr1r+d9typJkqjb7f7m4ODg3rS3URzMLJByufzHQqGwc57XnJ2d/ef4+PjNx48f/10cLGwg29vb71Qqldvnec1kMnnU7XZfPzw8/OdVbKM4mEkgzWazXavVPjnPa8bj8XfdbveXnU7nsUPGVbrS2/7U6/VMpVL583kuPPxh5hAHix9IGIZ3isXia+c55+h2u6+Lg4UPpNFobK2vr99NOz6O48nx8fGbV3XOATMNpFgsfnSebwKenJz89irerYKZB9JsNl+qVCrvpR3f6/U+Pzg4+IPDw1IEUiqVdtN+Qy+Kos5gMHjfoWEpAmk2my+Xy+Vbacefnp7emfblIzA3gRQKhQ/S3req3+9/Me0LD2FuAmk0Gi+sra29nWZsHMeTwWDwoUPC0gSSz+dvp70daK/XuzfN73PA3AVSKpXeTTl7fD8aje46HCxNIK1W6ydp77Le7/c/ndbXZGEuA8nn879KMy5JkmQ0Gn3sULBUgRSLxbfSjBsOh99O4+4jMLeBNJvNG2mf7DQajT5zGFiqQFZWVt5IeXI+jqLoS4eBpQokDMNUl7QPh8NvLvOOh/BcBLK6unozzbjxeHzfIWCpAmk0Gi+mfdRyFEUCYbkCCYLg1TTjzs7OTuM43ncIWLZAXkkzbjKZXPgRBPA8BpLq7d0oisweLF8guVxuO+US6x92P8s4g9TTjHvy5MmB3c8yBrKZZlySJB27n6ULJJvN1tKMi+PY1bssZSCrKWcQ3ztn+QLJZDJhmnFHR0cju595d+k3r37w4EFgt2IGAYGAQACBgEBAICAQEAgIBAQCAgGBAAIBgYBAQCAgEBAICAQEAgIBgQACAYHA5Ul947idnR0Pu5mR53Hf7+3tZcwgYIkFAgEEAgIBgYBAQCAgEHguXfoj2BblE1SebtmuqDCDgEBAICAQEAgIBAQCAgGBgEAAgYBAQCAgEBAICAQEAgIBgYBAAIGAQEAgIBAQCAgEBAICAYEAAgGBgEBAICAQmDc5u4BpWJRHtZlBQCAgEBAICAQEAgIBgYBAYAn5JJ2p2Nvby5hBwBILBAIIBAQCAgGBgEBAICAQEAgIBBAICAQEAgIBgYBAQCAgEBAICAQQCAgEBAICAYGAQEAgsFAu/e7ui/J8bDCDgEBAICAQEAgIBAQCAgGBAAAAAAAAAADAtf8BFNg15uCjV1oAAAAASUVORK5CYII=';\n const baseStyle = 'position: absolute; margin: auto; top: 0; left: 0; right: 0; bottom: 0;';\n if (orientation === 'landscape') {\n img.style = `${baseStyle}transform: rotate(90deg);`;\n a1 = 'canvas#coffee-engine-dom';\n a2 = '.ce-turn-screen';\n } else {\n img.style = baseStyle;\n a1 = '.ce-turn-screen';\n a2 = 'canvas#coffee-engine-dom';\n }\n\n const style = document.createElement('style');\n style.setAttribute('class', 'ce-turn-screen-style');\n style.setAttribute('type', 'text/css');\n style.setAttribute('media', 'all');\n style.innerHTML = `\\\n@media all and (orientation:portrait) { \\\n${a1} { \\\ndisplay: none; \\\n} \\\n} \\\n@media all and (orientation:landscape) { \\\n${a2} { \\\ndisplay: none; \\\n} \\\n}`;\n document.head.appendChild(style);\n div.appendChild(img);\n return document.body.appendChild(div);\n }", "title": "" }, { "docid": "6a5ee1be10f3c8362573d949cc388ab2", "score": "0.60420233", "text": "function updateOrientation()\n{\n\t/*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the\n\t left, or landscape mode with the screen turned to the right. */\n\tvar orientation=window.orientation;\n\tswitch(orientation)\n\t{\n\t\n\t\tcase 0:\n\t\t\t\tgame.orientation = \"portrait\";\n\t\t\t\tbreak;\n\t\tcase 90:\n\t\t\t\tgame.orientation = \"landscapeLeft\";\n\t\t\t\tbreak;\n\t\tcase -90:\t\n\t\t\t\tgame.orientation = \"landscapeRight\";\n\t\t\t\tbreak;\n\t\tcase 180:\t\n\t\t\t\tgame.orientation = \"portraitDown\";\n\t\t\t\tbreak;\n\t}\n\n}", "title": "" }, { "docid": "82b123120e90797e19fb320d2c19926b", "score": "0.60145366", "text": "function onSnapEnd(orientation) {\n\n if ((orientation === 'white' && piece.search(/^w/) === -1) ||\n (orientation === 'black' && piece.search(/^b/) === -1)) {\n return false\n }\n\n }", "title": "" }, { "docid": "c3dfc393a8dd3497cbdfb1c62bc2e2c0", "score": "0.598288", "text": "isMobilePortrait() {\n if (window.innerWidth < 576) return true;\n return false;\n }", "title": "" }, { "docid": "896c5761bba4b28bbc2a9e7687230ae3", "score": "0.5919711", "text": "switchOrientation(){\n this.orientation = (this._orientation === \"vertical\") ? \"horizontal\" : \"vertical\";\n }", "title": "" }, { "docid": "87cf794d8c658caacbd147b33d250fe9", "score": "0.5914373", "text": "function getSurfaceOrientation (dumpsys) {\n let m = /SurfaceOrientation: \\d/gi.exec(dumpsys);\n return m && parseInt(m[0].split(':')[1], 10);\n}", "title": "" }, { "docid": "06e88bfdbd5e71688664e59f89657785", "score": "0.5892022", "text": "function watchOrientation(callback){\n addWatcher(callback);\n //callback(orientation);\n console.log(orientation);\n return orientation;\n }", "title": "" }, { "docid": "9297b840e6f2100746efdf001e35a8dc", "score": "0.5883315", "text": "function doClientAndOrientationStuff() {\n console.log(\"f:doClientAndOrientationStuff()\");\n\n $(\".agentInfo\").text(\"\");\n\n /*\n if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {\n if (window.orientation == -90 || window.orientation == 90) {\n // landscape\n// $('#Viewport').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=yes');\n } else {\n // portrait\n $('#Viewport').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=yes');\n }\n }\n return;\n //*/\n\n if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {\n console.log(\"PHONE OR TABLET! --> window.orientation = \" + window.orientation);\n if (window.orientation == -90 || window.orientation == 90) {\n console.log(\" landscape\");\n // landscape\n\n // var ww = ( $(window).width() < window.screen.width ) ? $(window).width() : window.screen.width; //get proper width\n var ww = 0; //get proper width\n if (window.innerWidth) {\n ww = window.innerWidth;\n // if (window.screen.availWidth) {\n// ww = window.screen.availWidth;\n\n// if( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n// ww = window.innerWidth;\n// }\n } else if($(window).width()) {\n ww = $(window).width();\n } else {\n\n }\n\n // ww = 480;\n\n var mw = imgDims[0]; // min width of site\n //*\n if( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n var mw = imgDims[1]; // in landscape: min-width is image width\n }\n //*/\n var ratio = ww / mw; //calculate ratio\n $('#Viewport').attr('content', 'initial-scale='+ratio+',maximum-scale='+ratio+',minimum-scale='+ratio+',user-scalable=no,width='+mw);\n if( ww < mw){ //smaller than minimum size\n// $(\".colmask\").css(\"background-color\", \"#ff0\");\n // $('#Viewport').attr('content', 'initial-scale=' + ratio + ', maximum-scale=' + ratio + ', minimum-scale=' + ratio + ', user-scalable=yes, width=' + ww);\n // $('#Viewport').attr('content', 'initial-scale=1.0, maximum-scale=2, minimum-scale=1.0, user-scalable=yes, width=' + ww);\n }else{ //regular size\n// $(\".colmask\").css(\"background-color\", \"#0ff\");\n // $('#Viewport').attr('content', 'initial-scale=1.0, maximum-scale=2, minimum-scale=1.0, user-scalable=yes, width=' + ww);\n }\n\n console.log(\" ww: \" + ww + \", mw: \" + mw + \", ratio: \" + ratio);\n\n $(\".agentInfo\").append(\"ww: \" + ww + \", mw: \" + mw + \"<br/>\");\n $(\".agentInfo\").append(\"ratio: \" + ratio + \"<br/>\");\n $(\".agentInfo\").append(\"<br/>\");\n } else {\n console.log(\" portrait\");\n // portrait\n// $('#Viewport').attr('content', 'initial-scale='+1+',maximum-scale='+1+',minimum-scale='+1+',user-scalable=no');\n $('#Viewport').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no');\n }\n\n } else {\n // console.log(\"else\");\n $(\".colmask\").css(\"background-color\", \"#f80\");\n\n }\n\n\n $(\".agentInfo\").append(\"$(window).width(): \" + $(window).width() + \"<br/>\");\n $(\".agentInfo\").append(\"window.screen.width: \" + window.screen.width+ \"<br/>\");\n $(\".agentInfo\").append(\"window.screen.availWidth: \" + window.screen.availWidth+ \"<br/>\");\n $(\".agentInfo\").append(\"<br/>\");\n $(\".agentInfo\").append(\"window.innerWidth: \" + window.innerWidth + \"<br/>\");\n $(\".agentInfo\").append(\"window.innerHeight: \" + window.innerHeight + \"<br/>\");\n $(\".agentInfo\").append(\"<br/>\");\n $(\".agentInfo\").append(\"$(window).height(): \" + $(window).height() + \"<br/>\");\n $(\".agentInfo\").append(\"window.screen.height: \" + window.screen.height+ \"<br/>\");\n $(\".agentInfo\").append(\"window.screen.availHeight: \" + window.screen.availHeight+ \"<br/>\");\n $(\".agentInfo\").append(\"<br/>\");\n $(\".agentInfo\").append(\"user agent: \" + navigator.userAgent + \"<br/>\");\n}", "title": "" }, { "docid": "88a01f0a536c9484045a3b30e1166449", "score": "0.58760667", "text": "function orientationChange()\n {\n switch(window.orientation) {\n // landscape\n case -90:\n case 90:\n log('CROrientation change to landscape (' + window.orientation + ') CR');\n break;\n\n // portrait\n default:\n log('CROrientation change to portrait CR');\n break;\n }\n pimageheight();\n sizeclock();\n }", "title": "" }, { "docid": "aaddf77af5af9e0b460a8f9c9b3b79f0", "score": "0.5851261", "text": "function confirmOrientationChange() {\n // Get the current scale\n var currentScale = $(window).height() / $(window).width();\n // Check the scale vs. the target scale\n if (Math.abs(system.scale - currentScale) > 0.1) {\n console.error(\"Redraw\");\n console.log(\"-> CurrentScale: \" + currentScale);\n console.log(\"-> SystemScale: \" + system.scale);\n orientationChange();\n } else {\n // Zoom the container based on the orientation\n if (system.orientation == 'portrait') {\n $('#ahrs_container').css('zoom', (system.scale * 100) + '%');\n }\n }\n}", "title": "" }, { "docid": "20c62bcb7b0cde8f2073e53b8b00f994", "score": "0.58403087", "text": "checkScreen() {\n if ((this.y + this.size) - this.size <= 0) {\n this.direction = 1;\n } else if (this.y + this.size >= 500) {\n this.direction = -1;\n }\n }", "title": "" }, { "docid": "f67ca0a8883a9252d0ea5a382180be3f", "score": "0.58300585", "text": "currentOrientation(){\r\n this.init();\r\n }", "title": "" }, { "docid": "3533120a96f258034bd1732e64f71ae6", "score": "0.58194566", "text": "switchOrientation() {\n if (this.orientation == \"V\") {\n this.orientation = \"H\";\n }\n else {\n this.orientation = \"V\";\n }\n }", "title": "" }, { "docid": "24d30e5969c19e1b8fa21b9589ae4808", "score": "0.57958466", "text": "function checkScreen() {\n\n var w = window;\n\n return w.outerWidth == 0 && w.outerHeight == 0\n\n }", "title": "" }, { "docid": "bf245229e39c655632ca63ac88fbcf83", "score": "0.57718", "text": "function checkVerticals() {\n return checkWin({ i: -1, j: 0 }, { i: 1, j: 0 })\n }", "title": "" }, { "docid": "ddda1db269f19b4d43fb3747e47c071f", "score": "0.5770168", "text": "function onOrientationChanged(){\n var doNothing = true;\n}", "title": "" }, { "docid": "f30085643820dd1917829543b4b381b4", "score": "0.57410234", "text": "get verticalOrientation() {\n return this.navBarLocation === 'left' || this.navBarLocation === 'right';\n }", "title": "" }, { "docid": "3ddb1d121f89aeeca1be95e46465807e", "score": "0.57377374", "text": "initOrientationChange () {\n $(window).on('orientationchange', function (e) {\n if (mq['mq-lg'].matches) {\n return\n }\n\n let $player = $('.CraftsyVideoPlayer')\n const isPlayerFullscreen = ($player.find('.vjs-fullscreen').length > 0)\n\n if ((window.orientation == 90 && !isPlayerFullscreen) || (window.orientation != 90 && isPlayerFullscreen)) {\n $player.find('.theoplayer-container').addClass('theo-menu-opened')\n $player.find('.vjs-fullscreen-control').click()\n }\n })\n }", "title": "" }, { "docid": "f20df95faf3d12db2761c5d34b8a72b4", "score": "0.57375544", "text": "function orientationChange() {\n // Reset the system screen width and height based on the current values\n system.screen_width = $(window).width();\n system.screen_height = $(window).height();\n\n // Detect if in landscape or portrait based on the screen height and width\n if (system.screen_width > system.screen_height) {\n // Set to landscape\n system.orinetation = \"landscape\";\n // Reset ahrs_container css values to defaults\n $('#ahrs_container').css('height', system.screen_height);\n $('#ahrs_container').css('width', '100%');\n $('#ahrs_container').css('zoom', '100%');\n $('#ahrs_container').css('left', 'unset');\n\n if (system.overlay_active === true) {\n $('#overlay').css('height', system.screen_height);\n $('#overlay').css('width', '100%');\n $('#overlay').css('zoom', '100%');\n $('#overlay').css('left', 'unset');\n $('#overlay').css('top', 'unset');\n $('#overlay').css('transform', 'unset');\n }\n\n // Set the system scale value ratio\n system.scale = system.screen_height / system.screen_width;\n } else {\n // Set to portrait\n system.orinetation = \"portrait\";\n // Detect if the user is using an ios device and correct for status bar\n // intrusion\n if (system.ios.correction === true) {\n system.screen_height = system.ios.orgnial_height;\n $('#ahrs_container').css('left', '31px');\n }\n // Set the system scale value ratio\n system.scale = system.screen_height / system.screen_width;\n // Update the width to fit the portrait mode\n let width = system.screen_height / system.scale;\n let height = system.screen_width / system.scale;\n $('#ahrs_container').css('width', width);\n $('#ahrs_container').css('height', height);\n // Set the scale to fit the portrait mode\n $('#ahrs_container').css('zoom', (system.scale * 100 + 1) + '%');\n\n if (system.overlay_active === true) {\n $('#overlay').css('width', width + 20);\n $('#overlay').css('height', height);\n // Set the scale to fit the portrait mode\n $('#overlay').css('zoom', (system.scale * 100 + 1) + '%');\n $('#overlay').css('transform', 'rotate(90deg)');\n $('#overlay').css('left', -(width / 2 - height / 2));\n $('#overlay').css('top', (width / 2 - height / 2) - 10);\n }\n }\n\n // Record total sizes\n system.ahrs.width = $('#ahrs_container').outerWidth();\n system.ahrs.height = $('#ahrs_container').outerHeight();\n\n // Configure specific div sizes based on the current window size\n $('#heading_tape').css('width', system.ahrs.width - $('#speed_tape').outerWidth() - $('#alt_tape ').outerWidth() - 1);\n $('#heading_tape').css('left', $('#speed_tape').outerWidth());\n $('#readouts').css('width', system.ahrs.width - $('#speed_tape').outerWidth() - $('#alt_tape ').outerWidth() - 1);\n $('#readouts').css('left', $('#speed_tape').outerWidth());\n $('#heading_tape').css('top', $('#speed_tape').outerHeight() - $('#heading_tape').outerHeight());\n $('#speed_counter').css('margin-right', $('#speed_tape_tick_holder').outerWidth() - 2);\n $('#g_meter').css('bottom', $('#heading_tape').outerHeight() + 10);\n $('#g_meter').css('right', $('#alt_tape ').outerWidth() + 10);\n $('#overheat_flag').css('display', 'none');\n\n // Generate the tapes\n generateTapes();\n\n // Check the orientation change after 1/2 second\n setTimeout(confirmOrientationChange, 500);\n\n}", "title": "" }, { "docid": "743acd0cf5e9a29c1e1dca2bba44f817", "score": "0.57374746", "text": "function changeMobileLandscape() {\n\n}", "title": "" }, { "docid": "4f193dd1bb1e478ff93926c37192a4d9", "score": "0.57354814", "text": "checkScreen() {\n if (this.y + this.size - this.size <= 0) {\n this.directionY = 1;\n } else if (this.y + this.size >= 500) {\n this.directionY = -1;\n } else if (this.x + this.size - this.size <= 0) {\n this.directionX = 1;\n }\n }", "title": "" }, { "docid": "9abf17e65db1de3d8e559f139eaabaf1", "score": "0.56884736", "text": "function updateOrientation(){ //actions to take when orientation is changed.\n\n // give the height of the viewport to the various divs used\n // exception code is for the different browsers used.\n\t// these checks will determine the best height/width settings\n \n var cwidth = $(window).width()\n var cheight= $(window).height()\n \n if (typeof(window.innerWidth)=='number'){\n\t\tvar cwidth = window.innerWidth;\n\t\tvar cheight= window.innerHeight;\n } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){\n\t\tvar cwidth = document.documentElement.clientWidth;\n\t\tvar cheight= document.documentElement.clientHeight;\n } else if (document.body && (document.body.clientWidth || document.body.clientHeight)){\n\t\tvar cwidth=document.body.clientWidth;\n\t\tvar cheight=document.body.clientHeight;\n }\n \n $(window).width(cwidth);\n $(window).height(cheight);\n \n\t// ensures the html code fits properly\n $(\"body\").css('height',cheight);\n $(\"body\").css('width',cwidth); \n \n\t// a class that can be changed, \n\t// changing every div with the class\n $(\".fullPage\").css('height',cheight);\n $(\".fullPage\").css('width',cwidth); \n \n\t// a separate div used in development\n $(\".content-wrapper\").css('height',cheight);\n $(\".content-wrapper\").css('width',cwidth);\n\n\t// a spacer class based off of the height of screen\n $(\".filler\").css('height',cheight*0.25);\n \n\t// a smaller spacer based off of the height of screen\n $(\".fillerSmall\").css('height',cheight*0.1);\n \n\t// for centering a content div on all browsers\n var columnWidth = 300;\n var gutterSide = (cwidth-columnWidth)/2;\n $(\".article-content\").css('left', gutterSide);\n \n\t// for centering a backgorund image\n\t// is img portrait or landscape?\n\t// is space for it portrait or landscape?\n if (cwidth>cheight) { \n var narrower = ((cwidth-cheight)/2);\n $(\".backdrop>img\").css({'left': 0,'width':cwidth+'px','height':cwidth+'px'});\n $(\".backdrop>img\").css({'top': -narrower+'px','left': 0});\n cheight=cwidth;\n }\n \n if (cheight>cwidth) {\n var taller = ((cheight-cwidth)/2);\n $(\".backdrop>img\").css({'width':cheight+'px','height':cheight+'px','top': 0}); \n $(\".backdrop>img\").css({'left': -taller+'px','top': 0});\n cwidth=cheight;\n }\n \n\t\n}", "title": "" }, { "docid": "77a18b706e26caa82ebcdcd3b609c75e", "score": "0.56855494", "text": "isTablet() {\n \treturn Math.max( window.screen.width, window.screen.height ) / Math.min( window.screen.width, window.screen.height ) < 1.35 &&\n \t!( /(Oculus|Gear)/ ).test( navigator.userAgent );\n }", "title": "" }, { "docid": "39759bf9cac91d73c971edce978c5e1b", "score": "0.5678098", "text": "function orientationChanged() {\n var timeout = 45;\n return new window.Promise(function (resolve) {\n var go = function (i, height0) {\n window.innerHeight != height0 || i >= timeout ?\n resolve() :\n window.requestAnimationFrame(function () {\n go(i + 1, height0);\n }); // jshint ignore:line\n };\n go(0, window.innerHeight);\n });\n }", "title": "" }, { "docid": "c8f8fbfca4d1ea4f7ace0c5915567a0a", "score": "0.5667857", "text": "function orientationChanged() {\n var timeout = 45;\n return new window.Promise(function (resolve) {\n var go = function (i, height0) {\n window.innerHeight != height0 || i >= timeout ?\n resolve() :\n window.requestAnimationFrame(function () {\n go(i + 1, height0);\n }); // jshint ignore:line\n };\n go(0, window.innerHeight);\n });\n }", "title": "" }, { "docid": "d827219b0d7cb05de40f0aff98c74b51", "score": "0.5662498", "text": "function delaunator_orient(rx, ry, qx, qy, px, py) {\n const sign = orientIfSure(px, py, rx, ry, qx, qy) ||\n orientIfSure(rx, ry, qx, qy, px, py) ||\n orientIfSure(qx, qy, px, py, rx, ry);\n return sign < 0;\n}", "title": "" }, { "docid": "e95f391d45d286b0f7e9a1849005a9b3", "score": "0.5658297", "text": "function decideLorR(x){\n if(x.matches){\n document.getElementById('closemenu').innerHTML = 'Menu »'\n devOrientation = 'portrait';\n }else{\n document.getElementById('closemenu').innerHTML = '«'\n devOrientation = 'landscape';\n }\n}", "title": "" }, { "docid": "6928bd2f559f0463cbe14c11f6736a49", "score": "0.5647213", "text": "function handler() {\n // Get the current orientation.\n var orientation = get_orientation();\n\n if (orientation !== last_orientation) {\n // The orientation has changed, so trigger the orientationchange event.\n last_orientation = orientation;\n win.trigger(\"orientationchange\");\n }\n }", "title": "" }, { "docid": "cb1580794828eebf06cb417c28c67d17", "score": "0.5638063", "text": "function onCapturePortOrientaion(cameraObject)\n\t{\n\t\tkony.application.showLoadingScreen(\"loadingscreen\",\"Loading...\",constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, null);\n\t\tfrmCameraOrientation.imgPortrait.rawBytes = cameraObject.rawBytes;\n\t\tfrmCameraOrientation.lblDesc.text = \"Camera orientation mode is in Portrait mode.\";\n\t\tkony.application.dismissLoadingScreen();\n\t}", "title": "" }, { "docid": "e1a87d9114f3386bdaed14ab6a12e930", "score": "0.5630252", "text": "function onOrientationChange() {\n var result = options.method()\n updateCssVar(options.cssVarName, result)\n }", "title": "" }, { "docid": "5e59145c3072111c9a938bfd5e43f7c5", "score": "0.5599896", "text": "init(){\n this._super(...arguments);\n var that = this;\n window.onorientationchange = function(event){\n that.checkWindowOrientation(); \n };\n this.checkWindowOrientation();\n}", "title": "" }, { "docid": "2f4fe56fafbece4451b1993b2cdfb186", "score": "0.55988145", "text": "function judgeFullScreen() {\n return Util.judgeFullScreen();\n }", "title": "" }, { "docid": "a706d05328c4060d3a135480b079d6f9", "score": "0.55909604", "text": "function updateLayout()\n{\n\tvar orient = (window.orientation==0 || window.orientation==180) ? \"portrait\" : \"landscape\";\n if (!loaded)\n {\n \n /*if (window.innerWidth != _currentWidth || !loaded)\n\t{\n\t\t_currentWidth = window.innerWidth;\n\t\tvar orient = _currentWidth == 320 ? \"portrait\" : \"landscape\";\n\t*/\n \t// change the orientation properties\n \tdocument.body.setAttribute(\"orient\", orient);\n \tif (OpManagerFactory.getInstance().loadCompleted){\n \t\tloaded=true;\n \t\tclearInterval(updateInterval);\n \t\tOpManagerFactory.getInstance().activeWorkSpace.updateLayout(orient);\n \t}\n \telse{\n \t\tloaded=false;\n \t} \n }\n else{\n \t//the onorientationchange has hapenned\n \tdocument.body.setAttribute(\"orient\", orient);\n \tOpManagerFactory.getInstance().activeWorkSpace.updateLayout(orient);\n }\n}", "title": "" }, { "docid": "fae1580b28e275e00f2569c8bd847528", "score": "0.5588426", "text": "function toggleOrientationEvent() {\n\n if (window.innerHeight > window.innerWidth || gridContainer.clientHeight > gridContainer.clientWidth) {\n gridContainer.classList.add(\"portrait\");\n sidebar.classList.remove(\"landscape\");\n\n grid.style.height = (gridContainer.clientWidth * ( 95 / 100 )) + \"px\";\n grid.style.width = (gridContainer.clientWidth * ( 95 / 100 )) + \"px\";\n\n }\n else {\n gridContainer.classList.remove(\"portrait\");\n sidebar.classList.add(\"landscape\");\n\n grid.style.width = (gridContainer.clientHeight * ( 95 / 100 )) + \"px\";\n grid.style.height = (gridContainer.clientHeight * ( 95 / 100 )) + \"px\";\n\n }\n\n if (mobileAndTabletcheck() && ! isSetOrientationEvent) {\n window.addEventListener(\"deviceorientation\", toggleOrientationEvent);\n isSetOrientationEvent = true;\n }\n\n }", "title": "" }, { "docid": "0ea3f5872c1f40d858fe4d4cd2b3036b", "score": "0.558599", "text": "_isHorizontal() {\n return this.orientation === 'horizontal';\n }", "title": "" }, { "docid": "456795d55b8611609fa5403a445bffea", "score": "0.5572795", "text": "function yogaAgoraRTCDeviceOrientation(orientation) {\n console.log(\"[Native call js](屏幕方向变化)\");\n console.log(orientation);\n if (orientation == 3 || orientation == 4) {\n YogaAgoraRTC.setLocalVideoViewLayout();\n YogaAgoraRTC.setMargin(20, 0, 20, 0.25);//上、左、下、右\n YogaAgoraRTC.setRemoteVideoViewLayout();\n YogaAgoraRTC.setMargin(20, 0.75, -1, 0);//上、左、下、右\n YogaAgoraRTC.setRemoteViewScrollDirection(false);// 垂直滚动\n YogaAgoraRTC.setRemoteViewItemSize(0.5, 0.5);\n }else {\n YogaAgoraRTC.setLocalVideoViewLayout();\n YogaAgoraRTC.setMargin(0.55, 10, 0.25, 0.5);//上、左、下、右\n YogaAgoraRTC.setRemoteVideoViewLayout();\n YogaAgoraRTC.setMargin(50, 10, 0.5, 10);//上、左、下、右\n YogaAgoraRTC.setRemoteViewScrollDirection(true);// 水平滚动\n YogaAgoraRTC.setRemoteViewItemSize(1, 1);\n }\n}", "title": "" }, { "docid": "f03895f1f4cdcbebbdb74cd0d8bd2628", "score": "0.5541128", "text": "get horizontalOrientation() {\n return this.navBarLocation === 'top' || this.navBarLocation === 'bottom';\n }", "title": "" }, { "docid": "b50d77724dd4755a7bd9606d9f8036ab", "score": "0.5537784", "text": "function lockedIsVert()\r\n{\r\n\tif (window.innerWidth < window.innerHeight)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "8569d13e7df2a9e5dc73f0a600459580", "score": "0.55235934", "text": "function handleOrientation() {\n if (device.landscape()) {\n removeClass('portrait');\n addClass('landscape');\n walkOnChangeOrientationList('landscape');\n } else {\n removeClass('landscape');\n addClass('portrait');\n walkOnChangeOrientationList('portrait');\n }\n setOrientationCache();\n}", "title": "" }, { "docid": "8569d13e7df2a9e5dc73f0a600459580", "score": "0.55235934", "text": "function handleOrientation() {\n if (device.landscape()) {\n removeClass('portrait');\n addClass('landscape');\n walkOnChangeOrientationList('landscape');\n } else {\n removeClass('landscape');\n addClass('portrait');\n walkOnChangeOrientationList('portrait');\n }\n setOrientationCache();\n}", "title": "" }, { "docid": "d1a65b64540b96adb713f17126bc6290", "score": "0.5522961", "text": "orientation(p, q, r)\n\t{\n\t var val = (q.y - p.y) * (r.x - q.x) -\n\t (q.x - p.x) * (r.y - q.y);\n\t \n\t if (val === 0) return 0; // colinear\n\t \n\t return (val > 0)? 1: 2; // clock or counterclock wise\n\t}", "title": "" }, { "docid": "e255b06b919d7cd3b019d3395cdb1478", "score": "0.5511398", "text": "checkScreen() {\n if (this.y + this.size - this.size < 0) {\n this.y = 0;\n } else if (this.y + this.size > 600) {\n this.y = 550;\n }else if(this.x + this.size -this.size <0){\n this.x =0;\n }else if (this.x + this.size >600){\n this.x =550; \n }\n }", "title": "" }, { "docid": "c5fbff7693e6484f51dfd665e9de7383", "score": "0.5506136", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( \"orientationchange\" );\n\t\t}\n\t}", "title": "" }, { "docid": "c5fbff7693e6484f51dfd665e9de7383", "score": "0.5506136", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( \"orientationchange\" );\n\t\t}\n\t}", "title": "" }, { "docid": "ece2a8c0d4bc80c1b414593afff9f8a4", "score": "0.54970664", "text": "function start_orientation (){\r\n //start now\r\n //var start = Date.now();\r\n var time = 0;\r\n var second_times=3;\r\n $(\"#menubar\").slideUp(1000);\r\n\r\n (new Orientation()).init();\r\n \r\n setInterval(function (){\r\n second_times++;\r\n if(second_times%2){\r\n\r\n var fight_times = localStorage.getItem('fight_times');\r\n fight_times-=0.5;\r\n localStorage.setItem(\"fight_times\", fight_times);\r\n\r\n $.post('/update/rank/exp='+ goal/200 + '/fightTimes=' + fight_times, function (data){\r\n if(data.result){\r\n\r\n if(goal<100){ \r\n alert(\"太low了,才:\" + goal + \"分\");\r\n }else if( 100<goal<200){ \r\n alert(\"还不错,再甩一把:\" + goal + \"分\");\r\n }else{ \r\n alert(\"果真撸神:\" + goal + \"分\");\r\n }\r\n\r\n location.href='/';\r\n }else{\r\n //console.log(data);\r\n }\r\n }, \"json\");\r\n }else{\r\n //location.href='/';\r\n }\r\n },10000);\r\n }", "title": "" }, { "docid": "e381d36cef6bc4640ad9c555eb5aad5d", "score": "0.5496638", "text": "orientation(p, q, r) {\n let val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y)\n if (val == 0) {\n return 0\n }\n return (val > 0) ? 1 : 2\n }", "title": "" }, { "docid": "03b314061fbb99c7b2285fd3f202ebc9", "score": "0.54948354", "text": "function orientation(p, q, r) \n{ \n let val = (q.y - p.y) * (r.x - q.x) - \n (q.x - p.x) * (r.y - q.y); \n \n if (val == 0) return 0; // colinear \n return (val > 0)? 1: 2; // clock or counterclock wise \n}", "title": "" }, { "docid": "c2cd60f7e7589ab3dbd2f7b1c2f19d8a", "score": "0.54876083", "text": "function setOrientation() {\n\t\t$(\".cardBody\").css('height', window.innerHeight - 70);\n\t\t$(\".cardBody\").css('width', window.innerWidth - 100);\n\n\t}", "title": "" }, { "docid": "23a9b45b3a9029803f80ad1c14de0f4b", "score": "0.5479845", "text": "is360() {\n return Scene.modeType === '360';\n }", "title": "" }, { "docid": "b95a73a50f0cbcf448ec5d0b4c0b4313", "score": "0.54697347", "text": "function sizeOrientationChange(){\r\n\t\tcheckMQs();\r\n\t}", "title": "" }, { "docid": "9eaaec0f5cc73d1c7f2f1b9cf67e7740", "score": "0.54685354", "text": "function onDeviceOrientation (e) {\n // checking for null and undefined in one check using ==\n if (e.webkitCompassHeading == null && !e.absolute || // if absolute is false, null or undefined stop here\n e.alpha == null ||\n e.beta == null ||\n e.gamma == null\n\n ) {\n return;\n }\n\n this.updateOrientationMarker(e.webkitCompassHeading || orientationToCompassHeading(e.alpha, e.beta, e.gamma));\n}", "title": "" }, { "docid": "516075496f472745344cff923538b6e0", "score": "0.54680747", "text": "function isFullScreen() {\n var leftEdge = window.screenLeft;\n if (typeof leftEdge === 'undefined' ) {\n \tleftEdge = window.screenX;\n }\n return (leftEdge <= 0) ? \"maximized\" : \"other\";\n}", "title": "" }, { "docid": "2f639e3e68acca5be77da30ad70c6c64", "score": "0.54597545", "text": "function testEnvironment() {\nvar currentEnvironment = environment;\nwindowWidth = viewport().width;\nif (windowWidth <= 1279 && windowWidth > 639) {\nenvironment = 'tablette';\n} else if (windowWidth <= 639) {\nenvironment = 'mobile';\n} else {\nenvironment = 'desktop';\n}\nif (currentEnvironment != environment) {\nreturn true;\n} else {\nreturn false;\n}\n}", "title": "" }, { "docid": "4a6facca21a030cc67aec98a7bf3bbff", "score": "0.5455958", "text": "function rotateBack() {\n\tif(window.innerHeight < window.innerWidth && window.innerHeight < 768 && window.innerWidth < 812){\n\t\tdocument.getElementById(\"overlay\").classList.add(\"overlay\");\n\t\tdocument.body.classList.add(\"stop-Scrolling\");\n\t\tconsole.log(\"Please use Portrait!\");\n\t}else {\n\t\tdocument.getElementById(\"overlay\").classList.remove(\"overlay\");\n\t\tdocument.body.classList.remove(\"stop-Scrolling\");\n\t\tconsole.log(\"Normal Mode\");\n\t} \n}", "title": "" }, { "docid": "e7a76401fc97e5cf6174bc5a657249ab", "score": "0.545301", "text": "function orientationChange(e) {\n var orientation=\"portrait\";\n if(window.orientation == -90 || window.orientation == 90) orientation = \"landscape\";\n\n var iframeElement = document.getElementById(\"pricfy-web\");\n iframeElement.setAttribute('width', screen.width+\"px\");\n console.log(orientation);\n}", "title": "" }, { "docid": "3f720714b28d7bc065245ffc64f2fdb8", "score": "0.5444718", "text": "function observeOrientation(){\n if (checkIfOrientationChanged()){\n callWatchers();\n }\n }", "title": "" }, { "docid": "f348bc60d1e296c5aace55be2c969149", "score": "0.5444496", "text": "function r$17(t){if(!t)return !1;const e=t.verticalOffset;return !!e&&!(e.screenLength<=0||e.maxWorldLength<=0)}", "title": "" }, { "docid": "ebe22db14b77b4f3bccc4059d0baf8e0", "score": "0.5432301", "text": "function Start () {\n\tScreen.autorotateToPortrait = true;\n\tScreen.autorotateToPortraitUpsideDown = true;\n\tScreen.orientation = ScreenOrientation.AutoRotation;\n}", "title": "" }, { "docid": "ac2e3b47c0c912fdeab580e388dc2af5", "score": "0.5432229", "text": "function checkRightDiag() {\r\n\r\n}", "title": "" }, { "docid": "f653b6add3d179bcde48787961644995", "score": "0.54292864", "text": "function portrait(self) {\n self.trigger({ type: 'portrait', landscape: false, portrait: true });\n self.trigger({ type: 'orientationchanged', landscape: false, portrait: true });\n }", "title": "" }, { "docid": "90066f11186e27826356a7e7ccff4259", "score": "0.5421464", "text": "function setLandscape() {\n $(document.body).toggleClass('landscape', Math.abs(window.orientation) === 90);\n}", "title": "" }, { "docid": "b9d30a23826515a4811d2efbcdf9a891", "score": "0.54207915", "text": "function add_tablet_orientation_listener(){\n jQuery(document).ready(function() {\n jQuery(window).bind('orientationchange', function(e) {\n switch (window.orientation) {\n case -90:\n case 90:\n if (JSON.parse(window.localStorage.getItem('hide_side_menu')) === true) {\n hide_side_menu(false);\n } else {\n show_side_menu(false);\n }\n break;\n default:\n hide_side_menu(false);\n break;\n }\n });\n });\n}", "title": "" }, { "docid": "3d4b7c9035df025300491c5e9f3a3fd5", "score": "0.54061764", "text": "function toggle_orientation() {\n smallwrap.style.flexDirection = smallwrap.style.flexDirection == 'row' ? 'row-reverse' : 'row';\n}", "title": "" }, { "docid": "e5bd470560930bc5eab8704cde8ee081", "score": "0.53968155", "text": "function getOrientation(){\n return orientation;\n }", "title": "" }, { "docid": "025b34d76c04f3e43b5fcfc74c8c03b7", "score": "0.5391575", "text": "isOnScreen(v)\r\n {\r\n let b = this.getBoundaries();\r\n if(v.x > b.left && v.x < b.right\r\n && v.y > b.top && v.y < b.bottom)\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "d3bfcc159cfc18c8455f22aa55857c2e", "score": "0.53889024", "text": "function orientation (p, q, r) { \n let val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); \n \n if (val === 0) return 0; // colinear \n \n return (val > 0)? 1: 2; // clock or counterclock wise \n }", "title": "" }, { "docid": "eb2bcb9a6c9474a7c12502bde62eb427", "score": "0.53801954", "text": "function checkMobileEvent(){\n\tif($.browser.mobile || isTablet){\n\t\t$( window ).off('orientationchange').on( \"orientationchange\", function( event ) {\n\t\t\t$('#canvasHolder').hide();\n\t\t\t$('#rotateHolder').hide();\n\t\t\t\n\t\t\tclearTimeout(resizeTimer);\n\t\t\tresizeTimer = setTimeout(checkMobileOrientation, 1000);\n\t\t});\n\t\t\n\t\tcheckMobileOrientation();\n\t}\n}", "title": "" }, { "docid": "9be087529331778993eef8a7749a0978", "score": "0.5379308", "text": "function detectDisplayMode() {\n if(w.width() < 568)\n displayMode = displayModes.MOBILE;\n else if(w.width() < 980)\n displayMode = displayModes.TABLET;\n else\n displayMode = displayModes.DESKTOP;\n\n // Detect display mode changes\n if(oldDisplayMode != displayMode) {\n oldDisplayMode = displayMode;\n\n if(displayMode == displayModes.DESKTOP)\n Menu.toggleMenu({label: 'detectDisplayMode'}, 'close');\n \n onModeChange();\n }\n\n TePapa.isMobile = (displayMode == displayModes.MOBILE);\n\n // Refresh the scroller on resize\n setTimeout(function () {\n if(TePapa.Scrollers.intance != null)\n TePapa.Scrollers.intance.refresh();\n }, 0);\n }", "title": "" }, { "docid": "251c4e1a9523f54cc5ddb9bd8c84f069", "score": "0.5374932", "text": "function landscape(self) {\n self.trigger({ type: 'landscape', landscape: true, portrait: false });\n self.trigger({ type: 'orientationchanged', landscape: true, portrait: false });\n }", "title": "" }, { "docid": "f76058b728a1f33d33cbd11425b5446f", "score": "0.5372502", "text": "function lyingAboutRes() {\n return screen.width != screen.availWidth || screen.height != screen.availHeight ||\n screen.width != window.innerWidth || screen.height * 0.85 > window.innerHeight;\n}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.53628236", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.53628236", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.53628236", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "b3ce67e1ca4043879044f7e035b61331", "score": "0.53628236", "text": "function handler() {\n\t\t// Get the current orientation.\n\t\tvar orientation = get_orientation();\n\n\t\tif ( orientation !== last_orientation ) {\n\t\t\t// The orientation has changed, so trigger the orientationchange event.\n\t\t\tlast_orientation = orientation;\n\t\t\twin.trigger( event_name );\n\t\t}\n\t}", "title": "" }, { "docid": "d7ea6de0212976ce6a859937a5796b69", "score": "0.5361206", "text": "function updateOrientation(){\n\tvar container = document.getElementById('container');\n\t\n\tswitch(window.orientation) {\n\t\t// Portrait mode\n\t\tcase 0:\n\t\tcase 180:\n\t\t\tcontainer.style.minHeight = '313px';\n\t\t\tbreak;\n\t\t// Landscape mode\n\t\tcase -90:\n\t\tcase 90:\n\t\t\tcontainer.style.minHeight = '194px';\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "5fce0a6b5840053c5537ec5a91f00a00", "score": "0.53513104", "text": "function orientationChanged() {\n orientationChange = true;\n if (map) {\n var timeout = (isMobileDevice && isiOS) ? 100 : 500;\n map.infoWindow.hide();\n setTimeout(function () {\n if (isMobileDevice) {\n map.reposition();\n map.resize();\n setTimeout(function () {\n SetHeightSplashScreen();\n setTimeout(function () {\n if (mapPoint) {\n map.setExtent(GetBrowserMapExtent(mapPoint));\n }\n orientationChange = false;\n }, 300);\n SetMblListContainer();\n }, 300);\n } else {\n setTimeout(function () {\n if (mapPoint) {\n map.setExtent(GetMobileMapExtent(selectedGraphic));\n }\n orientationChange = false;\n }, 500);\n FixBottomPanelWidth(); //function to set width of shortcut links in ipad orientation change\n }\n }, timeout);\n }\n}", "title": "" }, { "docid": "604f2b1eb9647935233aeedbdd7f2bd8", "score": "0.5349902", "text": "function p(){var e=f();return 90===u._viewrotation||270===u._viewrotation?T(e):e}", "title": "" }, { "docid": "604f2b1eb9647935233aeedbdd7f2bd8", "score": "0.5349902", "text": "function p(){var e=f();return 90===u._viewrotation||270===u._viewrotation?T(e):e}", "title": "" }, { "docid": "0bc7b29cb9fd06364f81f73bfd29ab3f", "score": "0.534817", "text": "function screenResize() {\n let w = parseInt(window.innerWidth);\n if (w <= 569) {\n //max-width 569px\n swal(\"Try rotating device if graphs are not displayed properly\");\n }\n}", "title": "" }, { "docid": "3b42d17e7ef6c9da7f522d3bd4744687", "score": "0.534658", "text": "isScreenDevice() {\n if (this.getOriginalDetectIntentRequest() == \"google\") {\n return this.request.originalDetectIntentRequest.payload.surface.capabilities.find(a => a.name == 'actions.capability.SCREEN_OUTPUT') || false;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "05cb11b8c83df8a16912e4da7a138ce1", "score": "0.5344584", "text": "function onCaptureLandOrientaion(cameraObject)\n\t{\n\t\tkony.application.showLoadingScreen(\"loadingscreen\",\"Loading...\",constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, null);\n\t\tfrmCameraOrientation.imgLandscape.rawBytes=cameraObject.rawBytes;\n\t\tfrmCameraOrientation.lblDesc.text = \"Camera orientation mode is in Landscape mode.\";\n\t\tkony.application.dismissLoadingScreen();\n\t}", "title": "" }, { "docid": "3f2fc29685fc8ec4f6af581e7d3613a6", "score": "0.5320965", "text": "function onDeviceReady() {\n\tscreen.orientation.lock('portrait');\n document.addEventListener(\"pause\", onPause, false);\n document.addEventListener(\"resume\", onResume, false);\n document.addEventListener(\"menubutton\", onMenuKeyDown, false);\n\tdocument.addEventListener('backbutton',onBackPress, false);\n\n \n}", "title": "" }, { "docid": "d44dcbdf29a6bbf0df2055fa0b627e40", "score": "0.531814", "text": "function deviceOrientationTest(event) {\n window.removeEventListener('deviceorientation', deviceOrientationTest);\n if (event.beta != null && event.gamma != null) {\n window.addEventListener('deviceorientation', onDeviceOrientationChange, false);\n movementTimer = setInterval(onRenderUpdate, 10); \n }\n}", "title": "" }, { "docid": "d3383dc0bd3216f09626d670c2949237", "score": "0.53054315", "text": "function exitFullScreen() {}", "title": "" }, { "docid": "d7660551009cbb986a3ef867abc5e37d", "score": "0.52930385", "text": "function findOrientation(dir, ori) {\n // dirs: 1 = noturn, 2 = right, 4 = uturn, 8 = left\n if (dir === 1) {\n // noturn\n return ori;\n } else if (dir === 4) {\n // uturn\n if (ori === 'n') {\n return 's';\n } else if (ori === 's') {\n return 'n';\n } else if (ori === 'e') {\n return 'w';\n } else {\n return 'e';\n }\n } else {\n // right (2) or left (8)\n if (ori == 'n') {\n return dir === 2 ? 'e' : 'w';\n } else if (ori == 'e') {\n return dir === 2 ? 's' : 'n';\n } else if (ori == 's') {\n return dir === 2 ? 'w' : 'e';\n } else {\n // 'w'\n return dir === 2 ? 'n' : 's';\n }\n }\n}", "title": "" }, { "docid": "b32c44fb6805d08a5abddf717d616db8", "score": "0.5291129", "text": "function handleOrientation(event) {\n var z = event.alpha;\n var x = ((event.beta + 50)/1.8) + 5; //-180 to 180\n var y = ((event.gamma + 90)/1.8) + 5; //-90 to 90\n\n// Contraints on coordinates for ball to remain in box\n if (x > 93) { x = 93};\n if (x < 5) { x = 5};\n if (y > 90) { y = 90};\n if (y < 10) { y = 10};\n\n// Apply position to ball\n ball.style.top = x + '%';\n ball.style.left = y + '%';\n\n\n// Rules for getting ball in hole\n var xupper = num(hTop) + 3;\n var xlower = num(hTop) - 3;\n var xtrue = (xupper > x && xlower < x);\n\n var yupper = num(hLeft) + 3;\n var ylower = num(hLeft) - 3;\n var ytrue = (yupper > y && ylower < y);\n\n// Things to do WHEN ball in hole\n if(xtrue && ytrue) {\n\n onSuccess();\n }\n}", "title": "" } ]
8065685fac1cd9d3397fe7435f9cd247
supports only 2.0style add(1, 's') or add(duration)
[ { "docid": "bfb50c271c6c146f95b73990f4fa7f52", "score": "0.0", "text": "function add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n}", "title": "" } ]
[ { "docid": "d073cb06b83a1b452c9f1836ab51a70d", "score": "0.66241705", "text": "function durationValue(value)\n{\n return value + 's';\n}", "title": "" }, { "docid": "3655050a036db8b1fae22c8b27707517", "score": "0.6571986", "text": "AddSeconds() {\n\n }", "title": "" }, { "docid": "182c4c449442cdd86496d7bacb0ec258", "score": "0.65638834", "text": "function durationValue(value) {\n return value + \"s\";\n}", "title": "" }, { "docid": "32fd36009f05f0838f83913bd8b1b6e7", "score": "0.65521336", "text": "function addSeconds( seconds : float ){\n\n //Debug.Log(\"Adding \" + seconds + \" seconds!\");\n\n fl_time_extra += seconds;\n\n}", "title": "" }, { "docid": "deac7279036bb641ec2fae288c60b806", "score": "0.6451924", "text": "function durationValue(value) {\n return value + 's';\n}", "title": "" }, { "docid": "6c260782b02ba5cedea686d28196be40", "score": "0.643445", "text": "AddMilliseconds() {\n\n }", "title": "" }, { "docid": "977550715299db9a7aab836b4c5322d9", "score": "0.63467985", "text": "function durationValue(value) {\n return value + 's';\n }", "title": "" }, { "docid": "19eef95449950fa6e24b0534b67fe6bc", "score": "0.6261951", "text": "function addOneSecond(d){\n\t\td.setSeconds(d.getSeconds() + 1);\n\t\treturn d;\n\t}", "title": "" }, { "docid": "f79b38a9c9dc7b30d0138759b7aa3008", "score": "0.62124556", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "5a730bbed69ece751029e46eea891f23", "score": "0.61891973", "text": "constructor(string_or_hours=0, minutes=0, seconds=0, milliseconds=0){ //First arg can be \"12:34\" for hours:mins,\n // \"12:34:56\" for hours:mins:secs,\n // or 123 for hours\n if (typeof(string_or_hours) == \"string\") { //presume \"12:34\"(hours and mins) or \"12:34:56\" hours, mins, secs\n if (is_hour_colon_minute(string_or_hours) || is_hour_colon_minute_colon_second(string_or_hours)){\n var [h, m, s] = string_or_hours.split(\":\")\n var secs = parseInt(h) * 60 * 60\n secs += parseInt(m) * 60\n if (s) { secs += parseInt(s) }\n this.milliseconds = secs * 1000 //to get milliseconds\n return\n }\n }\n else if (typeof(string_or_hours) == \"number\"){\n let secs = (string_or_hours * 60 * 60) + (minutes * 60) + seconds\n this.milliseconds = (secs * 1000) + milliseconds\n return\n }\n throw new Error(\"new Duration passed arg: \" + string_or_hours + \" which is not a number or a string of the format 12:34 or 12:34:56 \")\n }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "277ed8e6d8f900570e5e6fce06b8915e", "score": "0.6065316", "text": "addSeconds(seconds){\n if(! seconds) return this;\n return this.addProp(this._time + (seconds*1000));\n }", "title": "" }, { "docid": "849909b2f3bba95fe6c00bc17049bb61", "score": "0.60134435", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "849909b2f3bba95fe6c00bc17049bb61", "score": "0.60134435", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "8b93b6fdf80824320d311f7b395cbdb8", "score": "0.59494525", "text": "durationchange(e) { update({duration: Math.trunc(e.target.duration * 1e6)}); }", "title": "" }, { "docid": "304964da19858bb42c44300a053aa3c8", "score": "0.5946267", "text": "function add(time) {\n if (time < 10) {\n //Adding a 0 to the timer \n return `0${time}`;\n }\n return time;\n}", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "1697176aec033339014f30141019f83a", "score": "0.58866024", "text": "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "title": "" }, { "docid": "b394952d09bb98650265c09de08e5677", "score": "0.5786336", "text": "constructor(duration) {\n this[$duration] = duration;\n this[$time] = 0;\n }", "title": "" }, { "docid": "35fd53e2da24fcf9f4efcd023267724d", "score": "0.5738952", "text": "add(t) {\n let v = this.constructor.validateStringInput(t);\n\n if (v) {\n v = this.constructor.parseTimeInput(this.constructor.splitStringInput(t));\n\n this.addedTime += v;\n this.currentTime += v;\n } else {\n throw `${t} is invalid input!`;\n }\n }", "title": "" }, { "docid": "b01dbc7aa0015f2fd989b864083b2d73", "score": "0.56961393", "text": "function timeAdd(s1, s2)\n{\n\tvar sec = toSeconds(s1) + toSeconds(s2);\n\treturn fill(Math.floor(sec / 3600), 2) + ':' +\n\t\tfill(Math.floor(sec / 60) % 60, 2) + ':' +\n\t\tfill(sec % 60, 2);\n}", "title": "" }, { "docid": "e85eb9a78fbd6e4ece8b0899d39e164b", "score": "0.56565344", "text": "function changeDuration(duration) {\n const hoursMin = parseInt((duration.split(\" \")[0])) * 60;\n const min = duration.split(\" \").length===2 ? parseInt((duration.split(\" \")[1])) : 0;\n return hoursMin + min;\n}", "title": "" }, { "docid": "79c4164dd54870ecb858a264cd144e7a", "score": "0.5646986", "text": "function add() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n if (minutes >= 60) {\n minutes = 0;\n hours++;\n }\n }\n\n timerElement.textContent = (hours ? (hours > 9 ? hours : \"0\" + hours) : \"00\") + \":\" + (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") + \":\" + (seconds > 9 ? seconds : \"0\" + seconds);\n timer();\n}", "title": "" }, { "docid": "1cb418b56d4291a73c7b26b0b5e3e448", "score": "0.56027055", "text": "function showDuration( t ) {\n if ( t >= 1000 ) {\n return `${t / 1000} s`;\n }\n\n if ( t <= 1 ) {\n return `${t * 1000} μs`;\n }\n\n return `${t} ms`;\n}", "title": "" }, { "docid": "0eea96313e86ab432db642177bb2f12e", "score": "0.55720586", "text": "function string_to_seconds(dur){\n if(typeof(dur) === \"number\") { return dur }\n else if(typeof(dur) == \"string\"){\n let num_strings = dur.split(\":\")\n if(num_strings.length == 0) { dde_error(\"string_to_seconds passed empty string for dur of: \" + dur) }\n else if (num_strings.length == 1) {\n if(is_string_a_number(num_strings[0])) {\n return parseFloat(num_strings[0])\n }\n else { dde_error(\"string_to_seconds passed string that is not a number: \" + dur) }\n }\n else if(num_strings.length == 2) {\n if(!is_string_a_integer(num_strings[0]) ||\n !is_string_a_number(num_strings[1])) {\n dde_error(\"string_to_seconds passed string that does not contain valid numbers: \" + dur)\n }\n else {\n let result = parseInt(num_strings[0]) * 60\n result += parseFloat(num_strings[1])\n return result\n }\n }\n else if(num_strings.length == 3) {\n if(!is_string_a_integer(num_strings[0]) ||\n !is_string_a_integer(num_strings[0]) ||\n !is_string_a_number(num_strings[2])) {\n dde_error(\"string_to_seconds passed string that does not contain valid numbers: \" + dur)\n }\n else {\n let result = parseInt(num_strings[0]) * 60 * 60\n result += parseInt(num_strings[0]) * 60\n result += parseFloat(num_strings[2])\n return result\n }\n }\n else {\n dde_error(\"string_to_seconds passed string that does not 1 to 3 numbers: \" + dur)\n }\n }\n else {\n dde_error(\"string_to_seconds passed non number, non string: \" + dur)\n }\n}", "title": "" }, { "docid": "2d6ad721d354342478bca7ee9fdc17c4", "score": "0.55699027", "text": "constructor (time, duration) {\n\t\tsuper(time)\n\t\tthis._duration = duration || 5\n this.core = undefined;\n\t}", "title": "" }, { "docid": "db521e9f03e01c4052e37788133f720d", "score": "0.5562265", "text": "constructor() {\n super('FireFlameDuration', ['min', 's', 'h']);\n }", "title": "" }, { "docid": "7c8c5f6d9b954c88e19a93e39149f890", "score": "0.55483156", "text": "function u(e) {\n var i = e;\n // Allow string durations like 'fast' and 'slow', without overriding numeric values.\n return \"string\" != typeof i || i.match(/^[\\-0-9\\.]+/) || (i = t.fx.speeds[i] || t.fx.speeds._default), h(i, \"ms\")\n }", "title": "" }, { "docid": "e03be2d00cf60c473cab498a1ad65fc9", "score": "0.55366325", "text": "function add() {\n miliseconds++;\n if (miliseconds >= 99) {\n miliseconds = 0;\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n }\n }\n \n // Appear current time on the screen\n h1.textContent = \"Time: \" + (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") + \":\" + (seconds ? (seconds > 9 ? seconds : \"0\" + seconds) : \"00\") + \":\" + (miliseconds > 9 ? miliseconds : \"0\" + miliseconds);\n\n timer();\n}", "title": "" }, { "docid": "f3b41ce33c6c66f2b4adb3f5d221fd9c", "score": "0.5534839", "text": "function Timer(duration) { this._duration = duration; }", "title": "" }, { "docid": "840c494bb890301e4fe5764a0dd987a6", "score": "0.5532601", "text": "function parseDuration (arg) {\n\t\t\t\t\tif (this.durations[arg]) {\n\t\t\t\t\t\treturn this.durations[arg];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn !isNaN(parseInt(arg)) ? parseInt(arg) : this.durations[duration];\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "39e6e3f52b766646df16f21632cb657e", "score": "0.5517466", "text": "function calculateDurationCost(h, m ,s) {\n return h * 100 + m * 10 + s * 1;\n}", "title": "" }, { "docid": "f85d3ce4dee3266e17a0d3c92e372ae1", "score": "0.5482249", "text": "function addSecond(timer){\n\ttimer.seconds++\n\tif (timer.seconds >= 60) {\n\t\ttimer.seconds -= 60\n\t\ttimer.minutes++\n\t\tif (timer.minutes >= 60) {\n\t\t\ttimer.minutes -= 60\n\t\t\ttimer.hours++\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ad148774b1fafe8f5322415a1383ec19", "score": "0.54767746", "text": "function timeAdd(t,dur)\n{\n var hr = parseInt(t.substr(0,2),10),\n min = parseInt(t.substr(3,2),10),\n mer = t.substr(-2),\n h = Math.floor(dur/60);\n min += dur - h*60;\n hr +=h;\n h = Math.floor(min/60);\n hr +=h;\n min -= h*60;\n hr = (hr - 1) % 12 + 1;\n if(hr>=12 && (h || dur>=60) )\n {\n mer=(mer==\"PM\")?\"AM\":\"PM\";\n } \n return (\"0\"+hr).substr(-2)+\":\"+(\"0\"+min).substr(-2)+\" \"+mer;\n}", "title": "" }, { "docid": "69da0537bdcd7e163b2e758d7744f49b", "score": "0.5452029", "text": "function addToTimer(time) {\n counter = counter + time;\n}", "title": "" }, { "docid": "61a969c96d4e1934de60763f737accb1", "score": "0.54264206", "text": "format(startTime, timeWidth, length, extra) {\n }", "title": "" }, { "docid": "12326e582214937f468369719e9e081a", "score": "0.5420017", "text": "function seconds(n) {\n return n * 1000;\n}", "title": "" }, { "docid": "b24c88da9a8e3110cedf706476042c26", "score": "0.5415911", "text": "function addTimes(inNumber) {\n\n if (inNumber == 1) {\n return inNumber + \" <span class='translatable'>time</span>\";\n } else {\n return inNumber + \" <span class='translatable'>times</span>\";\n }\n}", "title": "" }, { "docid": "9446362255e7432cafb64598b3411033", "score": "0.54150325", "text": "get duration() { return 8000 }", "title": "" }, { "docid": "ef91ffbdcadbcfa939ffc604df37837f", "score": "0.5410859", "text": "function checkDuration (val, name, vnode) {\nif (typeof val !== 'number') {\nwarn(\n\"<transition> explicit \" + name + \" duration is not a valid number - \" +\n\"got \" + (JSON.stringify(val)) + \".\",\nvnode.context\n);\n} else if (isNaN(val)) {\nwarn(\n\"<transition> explicit \" + name + \" duration is NaN - \" +\n'the duration expression might be incorrect.',\nvnode.context\n);\n}\n}", "title": "" }, { "docid": "08365a33d6705a12f017ba0b802c21f1", "score": "0.5402992", "text": "function updateDuration() {\r\n\r\n let newTime = audio.currentTime * (100 / audio.duration);\r\n let curMins = Math.floor(audio.currentTime / 60);\r\n let curSecs = Math.floor(audio.currentTime - curMins * 60);\r\n let durMins = Math.floor(audio.duration / 60);\r\n let durSecs = Math.floor(audio.duration - durMins * 60);\r\n if (curMins < 10) {\r\n curMins = `0${curMins}`\r\n }\r\n if (curSecs < 10) {\r\n curSecs = `0${curSecs}`\r\n }\r\n if (durMins < 10) {\r\n durMins = `0${durMins}`\r\n }\r\n if (durSecs < 10) {\r\n durSecs = `0${durSecs}`\r\n }\r\n currTime.innerHTML = `${curMins}:${curSecs}`;\r\n durTime.innerHTML = `${durMins}:${durSecs}`;\r\n}", "title": "" }, { "docid": "3a6be247ab947c0c143540074a60de6b", "score": "0.53733516", "text": "duration(val) {\n this._duration = val;\n return this;\n }", "title": "" }, { "docid": "708f2665f5d68260acd1d3c6f24d672b", "score": "0.5370378", "text": "function updateDuration() {\n 'use strict';\n \n // Get now:\n var now = new Date();\n\n // Create the message and divide by 1000 to fix error in book\n var message = 'It has been ' + now.getTime() / 1000;\n message += ' seconds since the epoch.';\n\n // Update the page:\n U.setText('output', message);\n \n} // End of updateDuration() function.", "title": "" }, { "docid": "2a743f7ec98851857dc108aaffff2084", "score": "0.5364169", "text": "getDuration() {\n const duration = util.timeToSec(this.args.join(' '));\n while (util.isTime(this.args[0])){\n this.args.shift();\n }\n return duration;\n }", "title": "" }, { "docid": "3027af6f1214f239e5ca80edec61d3b5", "score": "0.535815", "text": "Duration() {\n let value = this.Numeric();\n\n const units = this.queue.eat('SEC', 'MIN', 'HR'); // TODO: update TokenQueue to allow eat to accept multiple tokenTypes.\n // Convert the durations to seconds\n switch (units.type) {\n case 'SEC':\n // Throw an error if seconds is a float\n if (!Number.isInteger(value)) throw new UnexpectedTokenError(units, 'MIN/HR');\n break;\n case 'MIN':\n value *= 60;\n break;\n case 'HR':\n value *= 3600;\n break;\n default:\n throw new UnexpectedTokenError(units, 'SEC/MIN/HR');\n }\n return value;\n }", "title": "" }, { "docid": "14fc989399befd6f415e530f37780c78", "score": "0.5356705", "text": "static timeUnitTransformer(duration, cSharpStr) {\n switch (cSharpStr) {\n case 'Day':\n return { duration, tsStr: 'day' };\n case 'Week':\n return { duration: duration * 7, tsStr: 'day' };\n case 'Second':\n return { duration, tsStr: 'second' };\n case 'Minute':\n return { duration, tsStr: 'minute' };\n case 'Hour':\n return { duration, tsStr: 'hour' };\n case 'Month':\n return { duration, tsStr: 'month' };\n case 'Year':\n return { duration, tsStr: 'year' };\n default:\n return { duration, tsStr: undefined };\n }\n }", "title": "" }, { "docid": "c9d3c4c84d5a36f3c8b47f65b8e35b90", "score": "0.5353242", "text": "onDuration(duration) {\n this.setState({ duration });\n }", "title": "" }, { "docid": "95a131b4ec8f83cb858415ab3a6060d3", "score": "0.5343356", "text": "function addSeconds() {\n\n race.secondsRemaining += 2;\n\n }", "title": "" }, { "docid": "c932fe50b606364eb13fb185f1c37645", "score": "0.534297", "text": "function seconds( unit, amount ) {\n\treturn ({\n\t\tsec: 1,\t\t\t// Seconds\n\t\tmin: 60,\t\t// Minutes\n\t\thr: 3600,\t\t// Hours\n\t\tday: 86400,\t\t// Days\n\t\tweek: 604800,\t// Weeks\n\t\tdefault: 1\t\t// Default to seconds.\n\t}[unit] || 1) * (amount || 1); // Default amount to 1.\n}", "title": "" }, { "docid": "87f8617055dcbe1b8fa0d0aafb0cd0ca", "score": "0.53408885", "text": "addSecond (date, second, format = this.DTS) {\n\n }", "title": "" } ]
13a41634861f3b8fa23f52b280f97efc
transition(currentRoot); Do the zoom animation, and set each parent block to take up as much space as it can proportionately
[ { "docid": "139cc1d43337606b18554c21382cc681", "score": "0.6413601", "text": "function transition(currentRoot) {\n\t\t\t\tif (_transitioning || !currentRoot) return;\n\t\t\t\t_transitioning = true;\n\n\n\t\t\t\t//call display again to transition to the next level\n\t\t\t\tvar depthContainerChildren = display(currentRoot),\n\t\t\t\t\tparentTransition = depthContainer.transition().duration(_chart.transitionDuration()),\n\t\t\t\t\tchildTransition = depthContainerChildren.transition().duration(_chart.transitionDuration());\n\n\t\t\t\t// Update the domain only after entering new elements.\n\t\t\t\tx.domain([currentRoot.x, currentRoot.x + currentRoot.dx]);\n\t\t\t\ty.domain([currentRoot.y, currentRoot.y + currentRoot.dy]);\n\t\t\t\t_currentXscale = x;\n\t\t\t\t_currentYscale = y;\n\n\t\t\t\t// Enable anti-aliasing during the transition.\n\t\t\t\tsvg.style(\"shape-rendering\", null);\n\n\t\t\t\t// Draw child nodes on top of parent nodes.\n\t\t\t\tsvg.selectAll(\".depth\").sort(function(a, b) {\n\t\t\t\t\treturn a.depth - b.depth; \n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Start children opacity at 0, then fade in.\n\t\t\t\tdepthContainerChildren.selectAll(\"text\").style(\"fill-opacity\", 0);\n\n\t\t\t\t// Transition to the new view.\n\t\t\t\t//parent elements are dissappearing(0 opacity), while child elements are appearing(1 opacity)\n _labelFuncsArray.forEach(function(func, index) {\n func(parentTransition.selectAll(\"text.label_\" + index), {x: _currentXscale, y: _currentYscale}, 0);\n func(childTransition.selectAll(\"text.label_\" + index), {x: _currentXscale, y: _currentYscale}, 1);\n });\n\n parentTransition.selectAll(\"rect\").call(rect);\n\t\t\t\tchildTransition.selectAll(\"rect\").call(rect);\n\n\t\t\t\t// Remove the old node when the transition is finished.\n\t\t\t\tparentTransition.remove().each(\"end\", function() {\n\t\t\t\t\tsvg.style(\"shape-rendering\", \"crispEdges\");\n\t\t\t\t\t_transitioning = false;\n\t\t\t\t});\n\n\t\t\t\t//Hook for custom functionality on level change\n \t_onLevelChangeFunc();\n\t\t\t}", "title": "" } ]
[ { "docid": "58dbb6a87c1f400d2c7ba5355051a810", "score": "0.70188165", "text": "function zoom(root, p) {\n\t\t if (document.documentElement.__transition__) return;\n\t\t // Rescale outside angles to match the new layout.\n\t\t var enterArc,\n\t\t exitArc,\n\t\t outsideAngle = d3.scale.linear().domain([0, 2 * Math.PI]);\n\n\t\t function insideArc(d) {\n\t\t return p.key > d.key\n\t\t ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key\n\t\t ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n\t\t : {depth: 0, x: 0, dx: 2 * Math.PI};\n\t\t }\n\n\t\t function outsideArc(d) {\n\t\t return {depth: d.depth + 1, x: outsideAngle(d.x), dx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};\n\t\t }\n\n\t\t center.datum(root);\n\t\t // When zooming in, arcs enter from the outside and exit to the inside.\n\t\t // Entering outside arcs start from the old layout.\n\t\t if (root === p) { enterArc = outsideArc, exitArc = insideArc, outsideAngle.range([p.x, p.x + p.dx]); }\n\t\t path = path.data(partition.nodes(root).slice(1), function(d) { return d.key; });\n\t\t\tg = g.data(partition.nodes(root).slice(1), function(d) { return d.key; });\n\t\t // When zooming out, arcs enter from the inside and exit to the outside.\n\t\t // Exiting outside arcs transition to the new layout.\n\t\t if (root !== p) enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\t\t d3.transition().duration(d3.event.altKey ? 7500 : 750).each(function() {\n\t\t \t\n\t\t \tpath.exit().transition()\n\t\t\t\t\t.style(\"fill-opacity\", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n\t\t\t\t\t.attrTween(\"d\", function(d) { return arcTween.call(this, exitArc(d)); })\n\t\t\t\t\t.remove();\n\n\t\t \tpath.enter().append(\"path\")\n\t\t\t\t\t.style(\"fill-opacity\", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n\t\t\t\t\t.style(\"fill\", function(d) { d.color = color(d.name); return d.color; })\n\t\t\t\t\t.on(\"click\", zoomIn)\n\t\t\t\t\t.on(\"mouseover\", mouseOverArc)\n\t\t\t\t\t.on(\"mousemove\", mouseMoveArc)\n\t\t\t\t\t.on(\"mouseout\", mouseOutArc)\n\t\t\t\t\t.each(function(d) { this._current = enterArc(d); });\n\t\t\t\n\t\t\t\tg.enter().append(\"text\")\n\t\t\t\t\t.attr(\"transform\", function(d) { return \"rotate(\" + computeTextRotation(d) + \")\"; })\n\t\t\t\t\t.attr(\"x\", function(d) { return (d.y); })\n\t\t\t\t\t.attr(\"dx\", \"-50\") // margin\n\t\t\t\t\t.attr(\"dy\", \".35em\") // vertical-align\n\t\t\t \t.attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t.text(function(d) { return d.shortName; });\n\n\t\t\t\tsvg.selectAll(\"text\")\n\t\t\t\t\t.style(\"display\", 'none')\n\t\t\t\t\t.filter(filter_min_arc_size_text)\n\t\t\t\t\t.transition().delay(750)\n\t\t\t\t\t.style(\"display\", \"inline-block\");\n\t\t\t\n\t\t \tpath.transition()\n\t\t\t\t\t.style(\"fill-opacity\", 1)\n\t\t\t\t\t.attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); });\n\t\t });\n\t\t}", "title": "" }, { "docid": "1334bdfd581e56b537d3f27b023f098b", "score": "0.67728895", "text": "function zoom(root, p) {\n\t\tif (document.documentElement.__transition__) return\n\n\t\t// Rescale outside angles to match the new layout.\n\t\tvar enterArc, exitArc\n\n\t\tfunction insideArc(d) {\n\t\t\treturn p.key > d.key\n\t\t\t\t? {depth: d.depth - 1, x: 0, dx: 0}\n\t\t\t\t: p.key < d.key\n\t\t\t\t\t? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n\t\t\t\t\t: {depth: 0, x: 0, dx: 2 * Math.PI}\n\t\t}\n\n\t\tcenter.datum(root)\n\n\t\t// When zooming in, arcs enter from the outside and exit to the inside.\n\t\t// Entering outside arcs start from the old layout.\n\t\tif (root === p) {\n\t\t\tenterArc = outsideArc\n\t\t\texitArc = insideArc\n\t\t\toutsideAngle.range([p.x, p.x + p.dx])\n\t\t\tMain.data = p\n\t\t\ttext.text(filesize(p.sum))\n\t\t\tp.open = true\n\t\t\trootScope.$apply()\n\t\t}\n\n\t\tpath = path.data(\n\t\t\tpartition\n\t\t\t.nodes(root)\n\t\t\t.slice(1)\n\t\t\t.filter(d => d.dx > 0.005), d => d.key\n\t\t)\n\n\t\t// When zooming out, arcs enter from the inside and exit to the outside.\n\t\t// Exiting outside arcs transition to the new layout.\n\t\tif (root !== p) {\n\t\t\tenterArc = insideArc\n\t\t\texitArc = outsideArc\n\t\t\toutsideAngle.range([p.x, p.x + p.dx])\n\n\t\t\tMain.data = root\n\t\t\ttext.text(filesize(root.sum))\n\t\t\troot.open = true\n\t\t\trootScope.$apply()\n\t\t}\n\n\t\td3.transition().duration(750).each(() => {\n\t\t\tpath.exit().classed('transition-remove', true).transition()\n\t\t\t\t.attrTween('d', function(d) { return arcTween.call(this, exitArc(d)) })\n\t\t\t\t.remove()\n\n\t\t\tpath.enter().append('path')\n\t\t\t\t.style('fill', d => d.fill)\n\t\t\t\t.on('click', zoomIn)\n\t\t\t\t.on('mouseover', mouseover)\n\t\t\t\t.each(function(d) { this._current = enterArc(d) })\n\n\t\t\tpath.transition()\n\t\t\t\t.attrTween('d', function(d) { return arcTween.call(this, updateArc(d)) })\n\t\t})\n\t}", "title": "" }, { "docid": "2a0a46fc2457763b039c2857a8892e2f", "score": "0.66885316", "text": "function transition(zoomLevel) {\n svg_zoom.transition()\n .delay(100)\n .duration(700)\n .call(zoom.scaleBy, zoomLevel);\n //.call(zoom.transform, transform);\n //.on(\"end\", function() { canvas.call(transition); });\n}", "title": "" }, { "docid": "b1d2df6154967d53110bffe03c6e5fdc", "score": "0.6674151", "text": "function zoom(root, p) {\n\t\t\tif (document.documentElement.__transition__) return;\n\n\t\t\t// Rescale outside angles to match the new layout.\n\t\t\tvar enterArc,\n\t\t\t exitArc,\n\t\t\t outsideAngle = d3.scale.linear().domain([0, 2 * Math.PI]);\n\n\t\t\tfunction insideArc(d) {\n\t\t\t return p.key > d.key\n\t\t\t ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key\n\t\t\t ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n\t\t\t : {depth: 0, x: 0, dx: 2 * Math.PI};\n\t\t\t};\n\n\t\t\tfunction outsideArc(d) {\n\t\t\t\treturn {depth: d.depth + 1, \n\t\t\t\t\t\tx: outsideAngle(d.x), \n\t\t\t\t\t\tdx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};\n\t\t\t};\n\n\t\t\tcenter.datum(root);\n\n\t\t\t// When zooming in, arcs enter from the outside and exit to the inside.\n\t\t\t// Entering outside arcs start from the old layout.\n\t\t\tif (root === p) enterArc = outsideArc, exitArc = insideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\n\t\t\tpath = path.data(partition.nodes(root).slice(1), function(d) { return d.key; });\n\n\t\t\t// When zooming out, arcs enter from the inside and exit to the outside.\n\t\t\t// Exiting outside arcs transition to the new layout.\n\t\t\tif (root !== p) enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\n\t\t\td3.transition().duration(d3.event.altKey ? 7500 : 750).each(function() {\n\t\t\t\tpath.exit().transition()\n\t\t\t\t\t.style('fill-opacity', function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n\t\t\t\t\t.attrTween('d', function(d) { return arcTween.call(this, exitArc(d)); })\n\t\t\t\t\t.remove();\n\n\t\t\t\tpath.enter().append('path')\n\t\t\t\t\t.style('fill-opacity', function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n\t\t\t\t\t.style('fill', function(d) { return d.fill; })\n\t\t\t\t\t.on('click', zoomIn)\n\t\t\t\t\t.on('mouseover', tooltipShow)\n\t\t\t\t\t.on('mouseout', tooltipRemove)\n\t\t\t\t\t.on('mousemove', tooltipFollow)\n\t\t\t\t\t.each(function(d) { this._current = enterArc(d); });\n\n\t\t\t\tpath.transition()\n\t\t\t\t\t.style('fill-opacity', 1)\n\t\t\t\t\t.attrTween('d', function(d) { return arcTween.call(this, updateArc(d)); });\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "45f6f2c1f96db91eb7cb9667f6536559", "score": "0.6624531", "text": "function zoom() {\n // START: FIREFOX BROWSER BUG FIX: I COMMENTED THIS BLOCK OUT FOR NOW TO FIX IT\n // let props = $('.treeGroup').css('transform');\n // let vals = props.split('(')[1];\n // vals = vals.split(')')[0];\n // vals = vals.split(',');\n // END: FIREFOX BROWSER BUG FIX\n currentScale = initScale * d3v3.event.scale;\n currentPos.x = d3v3.event.translate[0] + origin.x;\n currentPos.y = d3v3.event.translate[1] + origin.y;\n svgGroup.attr(\"transform\", \"translate(\" + currentPos.x + ',' + currentPos.y + \") scale(\" + currentScale + \")\");\n }", "title": "" }, { "docid": "71b2f9ff1052765a73cdf1629603f113", "score": "0.64670295", "text": "zoom()\n {\n scale(this.scaleLevel);\n }", "title": "" }, { "docid": "dba93f0be18579493e3bfea305dcc68b", "score": "0.64188826", "text": "function setResizeByZoom() {\n preRatio = $utils.getDevicePixelRatio();\n $(\".content\").css(\"width\", trueWidth / $utils.getDevicePixelRatio());\n $(\".content\").css(\"height\", trueHeight / $utils.getDevicePixelRatio());\n\n $(\".content\").css(\"margin-top\", root_margin_top / $utils.getDevicePixelRatio());\n $(\".content\").css(\"margin-left\", root_margin_left / $utils.getDevicePixelRatio());\n\t//divtrogiup_svg \n\t//width/height = \n\t$tb.updatePos();\n\tcalDivScroll();\n}", "title": "" }, { "docid": "222f75c57fdb45526b9bb167c470158e", "score": "0.64103997", "text": "function zoomAndCenter() {\n var bounds = boundingBox(focus);\n\n var aspectRatio = width/height;\n var boundingAspectRatio = bounds.w/bounds.h;\n\n var scale = boundingAspectRatio > aspectRatio ? width/bounds.w : height/bounds.h;\n var targetWidth = boundingAspectRatio > aspectRatio ? bounds.w : width/scale;\n\n var translate = [-bounds.x*scale, -bounds.y*scale];\n\n if(scale > 1.5) {\n scale = 1.5;\n targetWidth = bounds.w/1.5;\n translate = [-bounds.x*scale+200, -bounds.y*scale];\n }\n\n// var i = d3.interpolateZoom([zoom.translate()[0], zoom.translate()[1], width*zoom.scale()],\n// [translate[0], translate[1], targetWidth]);\n//\n// viewport.transition().delay(100)\n// .duration(i.duration/2)\n// .attrTween(\"transform\", function() {\n// return function(t) {\n// var p = i(t);\n// return \"translate(\" + p[0] + \",\" + p[1] + \")scale(\" + (width / p[2]) + \")\";\n// }\n// })\n// .each(\"end\", function() {\n// zoom.translate(translate);\n// zoom.scale(scale);\n// });\n\n zoomed(translate, scale);\n\n viewport.selectAll(\".node text\")\n .style(\"font-size\", fontScale(scale) + \"px\");\n }", "title": "" }, { "docid": "ec7c12b79dc6f5b7eb88e51cc19ae83f", "score": "0.6389033", "text": "function zoomSelfAndParents(jQNode) {\n if (jQNode.hasClass(\"circle\")) {\n jQNode.addClass(\"zoom\");\n zoomSelfAndParents(jQNode.parent());\n }\n}", "title": "" }, { "docid": "19d06dc95c1888bf06ff4c373af6d10e", "score": "0.6262476", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3v3.event.translate + \")scale(\" + d3v3.event.scale + \")\");\n }", "title": "" }, { "docid": "004165e3f4bca0f80d362e3b793c4530", "score": "0.6261966", "text": "zoom() {\n log.debug('App - zoom()');\n\n // const containerWidth = this.container.width();\n // const containerHeight = this.container.height();\n // const windowWidth = this.window.width();\n // const windowHeight = this.window.height();\n // let zoomFactor = windowWidth / containerWidth;\n //\n // if (containerHeight + 50 >= windowHeight) {\n // zoomFactor = windowHeight / (containerHeight + 50);\n // }\n //\n // if (this.getScaleFactor() === 3) {\n // zoomFactor -= 0.1;\n // }\n\n // this.body.css({\n // zoom: zoomFactor,\n // '-moz-transform': `scale(${zoomFactor})`,\n // });\n\n this.border.css('top', 0);\n // this.zoomFactor = zoomFactor;\n }", "title": "" }, { "docid": "f4ed9f3f5b1502cb24387e81f71d3bd0", "score": "0.6250076", "text": "function zoom() {\n\n if (RotateX == 0)\n RotateX = SVGWIDTH / 2;\n if (RotateY == 0)\n RotateY = SVGHEIGHT / 2;\n\n if ((!!zm.translate()) && (!!zm.scale() || zm.scale() == 0)) {\n //calculate the centroid\n var translate = zm.translate();\n var scale = Math.min(maxScale, Math.max(minScale, zm.scale()));\n //$(\"#SVGBox\").width()\n var tx = Math.min(Math.max(SVGWIDTH * scale * (-0.9), translate[0]), $(\"#SVGBox\").width() * 0.9),\n ty = Math.max(SVGHEIGHT * scale * (-0.9), Math.min($(\"#SVGBox\").height() * 0.9, translate[1]));\n\n CURRENT_ZOOM = scale;\n if (tx && ty) {\n MAPSVG.attr(\"transform\", \"translate(\" + (tx) + \",\" + (ty) + \") scale(\" + scale + \") rotate(\" + Rotation + \", \" + RotateX + \", \" + RotateY + \")\");\n $('#YouAreHere circle').attr(\"r\", 15 / scale);\n $('#YouAreHere text').attr(\"r\", 20 / scale);\n $(\"#pathGroup circle\").attr(\"r\",DEFAULTSIZE / scale);\n $(\"#pathGroup text\").attr(\"font-size\", DEFAULTSIZE / scale)\n .attr(\"transform\", function () {\n return CustomTransformForLabelTranslate(scale);\n });\n\n mainVM.ContentsGeofences().CurrentScale(scale);\n mainVM.pushContentAndGeoFenceInMap(100);\n\n } else {\n //This is where is has issues\n var attribute = $('svg#mainSVG g')[0].attributes[0];\n var currentTransform = \"\";\n if (attribute) currentTransform = attribute.value.split('scale')[0];\n MAPSVG.attr(\"transform\", currentTransform + \" scale(\" + scale + \") rotate(\" + Rotation + \", \" + RotateX + \", \" + RotateY + \")\");\n $('#YouAreHere circle').attr(\"r\", 15 / scale);\n $('#YouAreHere text').attr(\"r\", 20 / scale);\n $(\"#pathGroup circle\").attr(\"r\", DEFAULTSIZE / scale);\n $(\"#pathGroup text\").attr(\"font-size\", DEFAULTSIZE / scale)\n .attr(\"transform\", function () {\n return CustomTransformForLabelTranslate(scale);\n });\n }\n setSlider(scale);\n }\n}", "title": "" }, { "docid": "7b7a1cd93263357475b554fa544d5fc3", "score": "0.6243425", "text": "function zoom() {\n\t\tsvgGroup.attr(\"transform\", \"translate(\" + d3.event.translate\n\t\t\t\t+ \")scale(\" + d3.event.scale + \")\");\n\t}", "title": "" }, { "docid": "685adb16ac8a853e5dcca208193244e9", "score": "0.622657", "text": "function scaleTree() {\n\ttreeLayout.updateScale(tree)\n}", "title": "" }, { "docid": "2f30a6cf3a8742e3b312982420a88767", "score": "0.6216563", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "2f30a6cf3a8742e3b312982420a88767", "score": "0.6216563", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "6bdf3cdb204f9f7bf06c30afe8bae32b", "score": "0.6216476", "text": "function zoom() {\n\t\t//check whether this is a mouse event or not (0 duration for immediate response then)\n\t\tvar duration = 0;\n\t\tif (!d3.event.sourceEvent) duration = me.zoomDuration;\n\n\t\tme.vis.transition().duration(duration).attr(\"transform\", d3.event.transform);\n\t}", "title": "" }, { "docid": "d42a3db12d1c7ca2aa13b7eb7bf5ee17", "score": "0.61993504", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate +\n \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "502fe63ad021d0e778aed2a15f5d9b42", "score": "0.61991096", "text": "function zoomIn(e) {\r\tvar block = document.getElementById(\"blocker\");\r\tblock.style.zIndex = 1000;\r\tvar height = computeHeight(e);\r\tvar width = computeWidth(e);\r\t\r\tif (e.style.width == \"\") {\r\t\te.style.height = height + 15 + \"px\";\r\t\te.style.width = width + \"px\";\r\t\tvar innerCells = e.children;\r\t\tvar biggestChild = width;\r\t\tfor (var i = 1; i < e.parentElement.children.length; i++) {\r\t\t\tif (e.parentElement.children[i].clientWidth > biggestChild) {\r\t\t\t\tbiggestChild = e.parentElement.children[i].clientWidth;\r\t\t\t}\r\t\t}\r\t\twhile(e.parentElement.className != \"SearchContainer LifeProcessWhole\") {\r\t\t\tfor (i = 1; i < e.parentElement.children.length; i++) {\r\t\t\t\tif (e.parentElement.children[i].clientWidth > biggestChild) {\r\t\t\t\t\tbiggestChild = e.parentElement.children[i].clientWidth;\r\t\t\t\t}\r\t\t\t}\r\t\t\tvar ph = height + e.parentElement.clientHeight;\r\t\t\tvar double = (e.classList[1] == \"Double\");\r\t\t\tif (double) {\r\t\t\t\tbiggestChild = e.parentElement.clientWidth;\r\t\t\t}\r\t\t\tvar pw = biggestChild + 30;\r\t\t\te.parentElement.style.height = ph + \"px\";\r\t\t\te.parentElement.style.width = pw + \"px\";\r\t\t\ttry {\r\t\t\t\tif (e.nextElementSibling.classList[1] == \"AfterDouble\") {\r\t\t\t\t\te.nextElementSibling.style.height = e.nextElementSibling.clientHeight + height + \"px\";\r\t\t\t\t}\r\t\t\t\tif (e.nextElementSibling.nextElementSibling.nextElementSibling.classList[1] == \"AfterDouble\") {\r\t\t\t\t\te.nextElementSibling.nextElementSibling.nextElementSibling.style.height = e.nextElementSibling.nextElementSibling.nextElementSibling.clientHeight + height + \"px\";\r\t\t\t\t}\r\t\t\t}\r\t\t\tcatch (err) {}\r\t\t\te = e.parentNode;\r\t\t\tbiggestChild += 30;\r\t\t}\r\t\tevent.stopPropagation();\r\t\tsetTimeout(function() {\r\t\t\tfor (var i = 0; i < innerCells.length; i++) {\r\t\t\t\tif (e.style.height != \"\") {\r\t\t\t\t\tinnerCells[i].classList.remove(\"Hidden\");\r\t\t\t\t}\r\t\t\t}\r\t\t}, 500);\r\t}\r\telse {\r\t\te.style.height = \"\";\r\t\te.style.width = \"\";\r\t\theight = e.clientHeight - 15;\r\t\tinnerCells = e.getElementsByClassName(\"Inner\");\r\t\tfor (i = 0; i < innerCells.length; i++) {\r\t\t\tinnerCells[i].classList.add(\"Hidden\");\r\t\t\tinnerCells[i].style.height = \"\";\r\t\t\tinnerCells[i].style.width = \"\";\r\t\t}\r\t\tbiggestChild = 180;\r\t\tfor (i = 1; i < e.parentElement.children.length; i++) {\r\t\t\tif (parseInt(e.parentElement.children[i].style.width) >= biggestChild) {\r\t\t\t\tbiggestChild = e.parentElement.children[i].clientWidth + 30;\r\t\t\t}\r\t\t}\r\t\twhile(e.parentElement.className != \"SearchContainer LifeProcessWhole\") {\r\t\t\tfor (i = 1; i < e.parentElement.children.length; i++) {\r\t\t\t\tif (e.parentElement.children[i] != e) {\r\t\t\t\t\tif (parseInt(e.parentElement.children[i].style.width) >= biggestChild) {\r\t\t\t\t\t\tbiggestChild = e.parentElement.children[i].clientWidth + 30;\r\t\t\t\t\t}\r\t\t\t\t}\r\t\t\t}\r\t\t\tph = e.parentElement.clientHeight - height;\r\t\t\tdouble = (e.classList[1] == \"Double\");\r\t\t\tif (double) {\r\t\t\t\tbiggestChild = e.parentElement.clientWidth - 30;\r\t\t\t}\r\t\t\tpw = biggestChild;\r\t\t\te.parentElement.style.height = ph + \"px\";\r\t\t\te.parentElement.style.width = pw + \"px\";\r\t\t\ttry {\r\t\t\t\tif (e.nextElementSibling.classList[1] == \"AfterDouble\") {\r\t\t\t\t\te.nextElementSibling.style.height = \"\";\r\t\t\t\t}\r\t\t\t\tif (e.nextElementSibling.nextElementSibling.nextElementSibling.classList[1] == \"AfterDouble\") {\r\t\t\t\t\te.nextElementSibling.nextElementSibling.nextElementSibling.style.height = \"\";\r\t\t\t\t}\r\t\t\t}\r\t\t\tcatch (err) {}\r\t\t\te = e.parentNode;\r\t\t\tbiggestChild += 30;\r\t\t}\r\t\tevent.stopPropagation();\r\t}\r\tsetTimeout(function() {\r\t\tblock.style.zIndex = \"\";\r\t}, 500);\r}", "title": "" }, { "docid": "567a5e5b14e37c8ef530c4cb1dcdb667", "score": "0.61986053", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.6188575", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "c95188aa0af16c87b8126d81c68dafa4", "score": "0.61864734", "text": "function updateScaling(rootSelection) {\n var mySankey;\n var parentSelector;\n var graph;\n var trans = d3.transition().duration(1000);\n\n scaleGlobal = rootSelection.select(\".nodeScaling\").node().checked;\n\n allGraphs.forEach(function (col, colIndex) {\n col.forEach(function (container, rowIndex) {\n mySankey = container.sankey;\n graph = container.graph;\n\n if (scaleGlobal) {\n mySankey.maxValue(allGraphs.maxValue);\n } else {\n mySankey.maxValue(-1);\n }\n mySankey.layout();\n\n // transition links\n parentSelector = \"g.sankeySeq.s\" + colIndex + \"-\" + rowIndex;\n rootSelection.select(parentSelector).selectAll(\".link\").data(graph.links, function (d) {\n return d.id;\n }) // data join for clarity. Data attributes have been changed even without join!\n .transition(trans).attr(\"d\", mySankey.link()).style(\"stroke-width\", function (d) {\n return Math.max(1, d.dy) + \"px\";\n });\n\n // transition nodes\n rootSelection.select(parentSelector).selectAll(\".node\").data(graph.nodes).transition(trans).attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n rootSelection.select(parentSelector).selectAll(\"rect.sankeyNode\").transition(trans).attr(\"height\", function (d) {\n return d.dy;\n });\n\n rootSelection.select(parentSelector).selectAll(\"text.nodeLabel\").transition(trans).attr(\"y\", function (d) {\n // adjustment if text would cross x axis \n if (debugOn) {\n var transNode = getTranslation(d3.select(this.parentNode).attr(\"transform\"))[1];\n console.log(\"transform: \" + d3.select(this.parentNode).attr(\"transform\"));\n console.log(transNode);\n }\n var pyHeight = parseInt(d3.select(this).style(\"font-size\"));\n return d.dy < pyHeight ? d.dy - pyHeight / 2 - 2 : Math.min(d.dy / 2, d.dy - pyHeight / 2 - 2);\n });\n\n rootSelection.select(parentSelector).selectAll(\"rect.sankeyNodeInfo\").filter(function (d) {\n nodeInfoKeys.forEach(function (key) {\n if (key !== nodeInfoNone) {\n // skip case for no nodeInfo selection\n d.nodeInfos[key + \"_dy\"] = mySankey.getNodeHeight(+d.nodeInfos[key]);\n } else {\n if (nodeInfoKey === nodeInfoNone) {\n rootSelection.selectAll(\"rect.sankeyNodeInfo\").attr(\"y\", function (d) {\n return d.dy;\n });\n }\n }\n });\n return typeof d.nodeInfos !== \"undefined\";\n }).attr(\"height\", function () {\n return d3.select(this).attr(\"height\");\n }).transition(trans).attr(\"y\", function (d) {\n if (nodeInfoKey === nodeInfoNone) {\n return d.dy;\n } else {\n if (debugOn) {\n console.log(\"value: \" + +d.nodeInfos[nodeInfoKey]);\n console.log(\"newHeight: \" + d.nodeInfos[nodeInfoKey + \"_dy\"]);\n }\n return d.dy - d.nodeInfos[nodeInfoKey + \"_dy\"];\n }\n }).attr(\"height\", function (d) {\n if (nodeInfoKey === nodeInfoNone) {\n return 0;\n } else {\n return d.nodeInfos[nodeInfoKey + \"_dy\"];\n }\n });\n });\n });\n }", "title": "" }, { "docid": "874915afdf2e3e4ae4f99850f340ae77", "score": "0.61864024", "text": "resetZoom() {\n this.state.blocklyWorkspace?.setScale(1);\n this.state.blocklyWorkspace?.scrollCenter();\n }", "title": "" }, { "docid": "3d73a4bf37753980227521902f126999", "score": "0.6174026", "text": "function zoom() {\n console.log(\"zooming\");\n /*\n console.log(\"zoom\", d3.event.translate, d3.event.scale);\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update positions\n */\n }", "title": "" }, { "docid": "9bd2e2d829cb1f1c8c0f7289a4aa317c", "score": "0.613405", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "1064979df8dce06f0f34c21d4d861ceb", "score": "0.61208665", "text": "function zoom() {\n //svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "d48b3bfff7da77003dba076cc9a58798", "score": "0.6091974", "text": "function resetZoom() {\n var translate = [0, 0],\n scale = 1;\n\n zoom.translate(translate).scale(scale);\n d3.select(\"#map svg g.mapG\").transition()\n .duration(1500)\n .attr(\"transform\", \"translate(\" + translate + \")scale(\" + scale + \")\");\n}", "title": "" }, { "docid": "f476d1e98e22033ed88cb8152d0481fd", "score": "0.6079918", "text": "function SetTreePanZoom(nInitialScale){\t\t\n\t\t// make the tree draggable and zoomable\t\n\t\tvar $panzoom = $('#tree');\n\t\t$panzoom.panzoom();\n\t\t\n\t\t$panzoom.panzoom(\"option\", {\n\t\t\tincrement: 0.7,\n\t\t\tminScale: 0.1,\n\t\t\tmaxScale: 12,\n\t\t\tduration: 200\t\t\t\n\t\t\t//$reset: $(\"a.reset-panzoom, button.reset-panzoom\")\n\t\t});\n\t\t\n\t\n\t\t// set initial scale\n\t\tvar nInitialScale = .4;\t\t\n\t\t\n\t\tvar oCoord = {clientX:0,clientY:0};\n\t\t$panzoom.panzoom(\"zoom\", nInitialScale, { focal: oCoord });\n\t\t\n\t\t// center single line labels\n\t\tCenterVertically ($(\".center-v\"));\n\t\t\t\t\t\t\n\t\t// center first gen family\n\t\tCenterHorizontally ($(\".center-h\"));\t\t\n\n\t\tvar nTreeCenteredX = $(window).width()/2 - ($(\"#tree .gen1 .family\").first().offset().left+105);\t\t\n\t\tvar nTreeTopY = ($(window).width() > 1250) ? 90 : 80;\t\t\n\t\t//move the tree more down if in iphone portrait\n\t\tif (isiPhone) if (window.innerHeight > window.innerWidth) nTreeTopY = 250;\t\t\t\n\t\t\n\t\t$(\"#tree\").panzoom(\"pan\", nTreeCenteredX, nTreeTopY, { relative: true });\t\n\t\t\n\t\t// repeat center if window is resized\n\t\t$(window).resize(function() {\n\t\t\tCenterTree();\n\t\t});\n\t\t// set position for reset button\n\t\tvar aTreeResetMatrix = $panzoom.panzoom(\"getMatrix\");\n\t\t\n\t\t\n\t\t// save data to set the tree to previous state\n\t\t$panzoom.on('panzoomend', function(e) {\n\t\t\toTreeState.aTreeMatrix = $panzoom.panzoom(\"getMatrix\");\n\t\t\t//dataSave.saveData(JSON.stringify(oTreeState));\n\t\t\t$.cookie(\"data\", oTreeState);\n\t\t});\t\t\t\n\t \n\t \n\t // enable mousewheel zoom\n\t\t$panzoom.parent().on('mousewheel.focal', function( e ) {\n\t\t\t// proportional scale increment varying with scale\n\t\t\tvar aMatrixArray = $panzoom.panzoom(\"getMatrix\");\n\t \tvar nIncrement = 0.05;\n\t \tif (!isiPad || !isiPhone) {\n\t\t \tif (aMatrixArray[0] <= 0.4) nIncrement = 0.01;\n\t\t\t if (aMatrixArray[0] > 2) nIncrement = 0.2;\t\n\t\t\t} else {\n\t\t\t\tvar nIncrement = 0.02;\n\t\t\t}\t \n\t\n\t e.preventDefault();\n var delta = e.delta || e.originalEvent.wheelDelta;\n var zoomOut = delta ? delta < 0 : e.originalEvent.deltaY > 0;\n $panzoom.panzoom('zoom', zoomOut, {\n increment: nIncrement,\n focal: e\n });\n // set scrolled cookie\n oTreeState.bScrolled = true;\t\t\t\t\t\t\t\t \n\t\t\t//dataSave.saveData(JSON.stringify(oTreeState));\n\t\t\toTreeState.aTreeMatrix = $panzoom.panzoom(\"getMatrix\");\n\t\t\t$.cookie(\"data\", oTreeState);\n\t }); \n\t \t\n\t \n\t $(\"#zoom-panel .zoom-in-button\").click(function (e){\n\t \t// proportional scale increment varying with scale\n\t \tvar aMatrixArray = $panzoom.panzoom(\"getMatrix\");\n\t \tvar nIncrement = 0.3;\n\t \tif (aMatrixArray[0] <= 0.4) nIncrement = 0.1;\n\t\t if (aMatrixArray[0] > 0.8) nIncrement = 0.5;\n\t\t if (aMatrixArray[0] > 1.5) nIncrement = 0.9;\n\t\t if (aMatrixArray[0] > 3) nIncrement = 1.5;\t\t \n\t\t \n\t \te.preventDefault();\n\t \tvar oWindowCenter = {clientX:$(window).width()/2,clientY:$(window).height()/2};\n\t \t$panzoom.panzoom(\"zoom\", {\n\t \t\tfocal: oWindowCenter,\n\t \t\tanimate: true,\n\t \t\tincrement: nIncrement\n\t \t});\n\t \toTreeState.aTreeMatrix = $panzoom.panzoom(\"getMatrix\");\n\t \t$.cookie(\"data\", oTreeState);\n\t });\t\n\t $(\"#zoom-panel .zoom-out-button\").click(function (e){\n\t \t// proportional scale increment varying with scale\n\t \tvar aMatrixArray = $panzoom.panzoom(\"getMatrix\");\n\t \tvar nIncrement = 0.3; \t\n\t \tif (aMatrixArray[0] <= 0.4) nIncrement = 0.06;\n\t\t if (aMatrixArray[0] > 0.8) nIncrement = 0.5;\n\t\t if (aMatrixArray[0] > 1.5) nIncrement = 0.9;\n\t\t if (aMatrixArray[0] > 3) nIncrement = 1.5;\n\t\t \n\t \te.preventDefault();\n\t \tvar oWindowCenter = {clientX:$(window).width()/2,clientY:$(window).height()/2};\n\t \t$panzoom.panzoom(\"zoom\",true,{\n\t \t\tfocal: oWindowCenter,\n\t \t\tanimate: true,\n\t \t\tincrement: nIncrement\n\t \t});\n\t \toTreeState.aTreeMatrix = $panzoom.panzoom(\"getMatrix\");\n\t \t$.cookie(\"data\", oTreeState);\n\t });\n\t $(\"#zoom-panel .reset-button\").click(function (e){\n\t\t e.preventDefault();\n\t \t$panzoom.panzoom(\"setMatrix\", aTreeResetMatrix);\n\t \toTreeState.aTreeMatrix = aTreeResetMatrix;\n\t \t$.cookie(\"data\", oTreeState);\n\t });\n\t }", "title": "" }, { "docid": "ca9a033d60f863f14abd03dd326d023f", "score": "0.60721874", "text": "function Lens(){\n var $obj=this;\n this.node=$('<div/>').addClass('zoomPup');\n //this.nodeimgwrapper = $(\"<div/>\").addClass('zoomPupImgWrapper');\n this.append=function(){\n $('.zoomPad',el).append($(this.node).hide());\n if(settings.zoomType == 'reverse'){\n this.image=new Image();\n this.image.src=smallimage.node.src; // fires off async\n $(this.node).empty().append(this.image);\n }\n };\n this.setdimensions=function(){\n this.node.w=(parseInt((settings.zoomWidth) / el.scale.x) > smallimage.w) ? smallimage.w : (parseInt(settings.zoomWidth / el.scale.x));\n this.node.h=(parseInt((settings.zoomHeight) / el.scale.y) > smallimage.h) ? smallimage.h : (parseInt(settings.zoomHeight / el.scale.y));\n this.node.top=(smallimage.oh - this.node.h - 2) / 2;\n this.node.left=(smallimage.ow - this.node.w - 2) / 2;\n //centering lens\n this.node.css({\n top:0,\n left:0,\n width:this.node.w + 'px',\n height:this.node.h + 'px',\n position:'absolute',\n display:'none',\n borderWidth:1 + 'px'\n });\n\n\n\n if(settings.zoomType == 'reverse'){\n this.image.src=smallimage.node.src;\n $(this.node).css({\n 'opacity':1\n });\n\n $(this.image).css({\n position:'absolute',\n display:'block',\n left:-(this.node.left + 1 - smallimage.bleft) + 'px',\n top:-(this.node.top + 1 - smallimage.btop) + 'px'\n });\n\n }\n };\n this.setcenter=function(){\n //calculating center position\n this.node.top=(smallimage.oh - this.node.h - 2) / 2;\n this.node.left=(smallimage.ow - this.node.w - 2) / 2;\n //centering lens\n this.node.css({\n top:this.node.top,\n left:this.node.left\n });\n if(settings.zoomType == 'reverse'){\n $(this.image).css({\n position:'absolute',\n display:'block',\n left:-(this.node.left + 1 - smallimage.bleft) + 'px',\n top:-(this.node.top + 1 - smallimage.btop) + 'px'\n });\n\n }\n //centering large image\n largeimage.setposition();\n };\n this.setposition=function(e){\n el.mousepos.x=e.pageX;\n el.mousepos.y=e.pageY;\n var lensleft=0;\n var lenstop=0;\n\n function overleft(lens){\n return el.mousepos.x - (lens.w) / 2 < smallimage.pos.l;\n }\n\n function overright(lens){\n return el.mousepos.x + (lens.w) / 2 > smallimage.pos.r;\n\n }\n\n function overtop(lens){\n return el.mousepos.y - (lens.h) / 2 < smallimage.pos.t;\n }\n\n function overbottom(lens){\n return el.mousepos.y + (lens.h) / 2 > smallimage.pos.b;\n }\n\n lensleft=el.mousepos.x + smallimage.bleft - smallimage.pos.l - (this.node.w + 2) / 2;\n lenstop=el.mousepos.y + smallimage.btop - smallimage.pos.t - (this.node.h + 2) / 2;\n if(overleft(this.node)){\n lensleft=smallimage.bleft - 1;\n }else if(overright(this.node)){\n lensleft=smallimage.w + smallimage.bleft - this.node.w - 1;\n }\n if(overtop(this.node)){\n lenstop=smallimage.btop - 1;\n }else if(overbottom(this.node)){\n lenstop=smallimage.h + smallimage.btop - this.node.h - 1;\n }\n\n this.node.left=lensleft;\n this.node.top=lenstop;\n this.node.css({\n 'left':lensleft + 'px',\n 'top':lenstop + 'px'\n });\n if(settings.zoomType == 'reverse'){\n if($.browser.msie && $.browser.version > 7){\n $(this.node).empty().append(this.image);\n }\n\n $(this.image).css({\n position:'absolute',\n display:'block',\n left:-(this.node.left + 1 - smallimage.bleft) + 'px',\n top:-(this.node.top + 1 - smallimage.btop) + 'px'\n });\n }\n\n largeimage.setposition();\n };\n this.hide=function(){\n img.css({\n 'opacity':1\n });\n this.node.hide();\n };\n this.show=function(){\n\n if(settings.zoomType != 'innerzoom' && (settings.lens || settings.zoomType == 'drag')){\n this.node.show();\n }\n\n if(settings.zoomType == 'reverse'){\n img.css({\n 'opacity':settings.imageOpacity\n });\n }\n };\n this.getoffset=function(){\n var o={};\n o.left=$obj.node.left;\n o.top=$obj.node.top;\n return o;\n };\n return this;\n }", "title": "" }, { "docid": "3986308c3021557a9daa09d68023a8bd", "score": "0.6067953", "text": "function zoomBrainSlice(cardinalParent, zoomFactor){\n\n // the element to zoom is the canvas with the class brainSlice\n var element = $(\"#\" + cardinalParent).find(\".brainSlice\");\n var scale = parseFloat( $(element).attr(\"scale\") );\n\n var parentHeight = element.parent().height();\n\n // getting the (css) left offset\n var left = element.css(\"left\");\n if(typeof left == \"undefined\"){\n left = 0;\n }else{\n // removing the ending \"px\"\n left = parseFloat(left.slice(0, -2));\n }\n\n // getting the (css) top offset\n var top = element.css(\"top\");\n if(typeof top == \"undefined\"){\n top = 0;\n }else{\n // removing the ending \"px\"\n top = parseFloat(top.slice(0, -2));\n }\n\n scale *= zoomFactor;\n element.css(\"transform\", \"scale(\" + scale + \")\");\n adjustLeft = left * zoomFactor;\n adjustTop = top*zoomFactor + ((zoomFactor - 1) * parentHeight) / 2;\n\n\n element.attr(\"scale\", scale);\n\n // adjust the top and left offset\n element.css(\"left\" , adjustLeft + \"px\");\n element.css(\"top\" , adjustTop + \"px\");\n\n}", "title": "" }, { "docid": "1788bc236ff6c860641aa97e7054d0b5", "score": "0.6065573", "text": "function Lens() {\n var $obj = this;\n this.node = $('<div/>').addClass('zoomPup');\n //this.nodeimgwrapper = $(\"<div/>\").addClass('zoomPupImgWrapper');\n this.append = function () {\n $('.zoomPad', el).append($(this.node).hide());\n if (settings.zoomType == 'reverse') {\n this.image = new Image();\n this.image.src = smallimage.node.src; // fires off async\n $(this.node).empty().append(this.image);\n }\n };\n this.setdimensions = function () {\n this.node.w = (parseInt((settings.zoomWidth) / el.scale.x) > smallimage.w ) ? smallimage.w : (parseInt(settings.zoomWidth / el.scale.x)); \n this.node.h = (parseInt((settings.zoomHeight) / el.scale.y) > smallimage.h ) ? smallimage.h : (parseInt(settings.zoomHeight / el.scale.y)); \n this.node.top = (smallimage.oh - this.node.h - 2) / 2;\n this.node.left = (smallimage.ow - this.node.w - 2) / 2;\n //centering lens\n this.node.css({\n top: 0,\n left: 0,\n width: this.node.w + 'px',\n height: this.node.h + 'px',\n position: 'absolute',\n display: 'none'\n });\n\n\n\n if (settings.zoomType == 'reverse') {\n this.image.src = smallimage.node.src;\n $(this.node).css({\n 'opacity': 1\n });\n\n $(this.image).css({\n position: 'absolute',\n display: 'block',\n left: -(this.node.left + 1 - smallimage.bleft) + 'px',\n top: -(this.node.top + 1 - smallimage.btop) + 'px'\n });\n\n }\n };\n this.setcenter = function () {\n //calculating center position\n this.node.top = (smallimage.oh - this.node.h - 2) / 2;\n this.node.left = (smallimage.ow - this.node.w - 2) / 2;\n //centering lens\n this.node.css({\n top: this.node.top,\n left: this.node.left\n });\n if (settings.zoomType == 'reverse') {\n $(this.image).css({\n position: 'absolute',\n display: 'block',\n left: -(this.node.left + 1 - smallimage.bleft) + 'px',\n top: -(this.node.top + 1 - smallimage.btop) + 'px'\n });\n\n }\n //centering large image\n largeimage.setposition();\n };\n this.setposition = function (e) {\n el.mousepos.x = e.pageX;\n el.mousepos.y = e.pageY;\n var lensleft = 0;\n var lenstop = 0;\n\n function overleft(lens) {\n return el.mousepos.x - (lens.w) / 2 < smallimage.pos.l; \n }\n\n function overright(lens) {\n return el.mousepos.x + (lens.w) / 2 > smallimage.pos.r; \n \n }\n\n function overtop(lens) {\n return el.mousepos.y - (lens.h) / 2 < smallimage.pos.t; \n }\n\n function overbottom(lens) {\n return el.mousepos.y + (lens.h) / 2 > smallimage.pos.b; \n }\n \n lensleft = el.mousepos.x + smallimage.bleft - smallimage.pos.l - (this.node.w + 2) / 2;\n lenstop = el.mousepos.y + smallimage.btop - smallimage.pos.t - (this.node.h + 2) / 2;\n if (overleft(this.node)) {\n lensleft = smallimage.bleft - 1;\n } else if (overright(this.node)) {\n lensleft = smallimage.w + smallimage.bleft - this.node.w - 1;\n }\n if (overtop(this.node)) {\n lenstop = smallimage.btop - 1;\n } else if (overbottom(this.node)) {\n lenstop = smallimage.h + smallimage.btop - this.node.h - 1;\n }\n \n this.node.left = lensleft;\n this.node.top = lenstop;\n this.node.css({\n 'left': lensleft + 'px',\n 'top': lenstop + 'px'\n });\n if (settings.zoomType == 'reverse') {\n if ($.browser.msie && $.browser.version > 7) {\n $(this.node).empty().append(this.image);\n }\n\n $(this.image).css({\n position: 'absolute',\n display: 'block',\n left: -(this.node.left + 1 - smallimage.bleft) + 'px',\n top: -(this.node.top + 1 - smallimage.btop) + 'px'\n });\n }\n \n largeimage.setposition();\n };\n this.hide = function () {\n img.css({\n 'opacity': 1\n });\n this.node.hide();\n };\n this.show = function () { \n \n if (settings.zoomType != 'innerzoom' && (settings.lens || settings.zoomType == 'drag')) {\n this.node.show();\n } \n\n if (settings.zoomType == 'reverse') {\n img.css({\n 'opacity': settings.imageOpacity\n });\n }\n };\n this.getoffset = function () {\n var o = {};\n o.left = $obj.node.left;\n o.top = $obj.node.top;\n return o;\n };\n return this;\n }", "title": "" }, { "docid": "4558d7ae495b053cde967f72cc92fd55", "score": "0.6055917", "text": "function zoom(root, p,newradius,sig,sig2) {\n\t\tif (document.documentElement.__transition__) return;\n\t\t// Rescale outside angles to match the new layout.\n\t\tvar enterArc,\n\t\t\texitArc,\n\t\t\toutsideAngle = d3.scale.linear().domain([0, 2*Math.PI]); // [0, 2 * Math.PI]\n\t\tvar arc2 = d3.svg.arc()\n\t\t.startAngle(function(d) { return d.x; })\n\t\t.endAngle(function(d) { return d.x + d.dx; })\n\t\t.padAngle(.01)\n\t\t.padRadius(newradius /3 )\n\t\t.innerRadius(newradius)\n\t\t.outerRadius(newradius - 40);\n\t\tfunction insideArc(d) {\n\t\t return p.key > d.key\n\t\t\t ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key\n\t\t\t ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n\t\t\t : {depth: 0, x: 0, dx: 2 * Math.PI};\n\t\t\t}\n\t\tfunction outsideArc(d) {\n\t\t return {depth: d.depth + 1, x: outsideAngle(d.x), dx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};\n\t\t\t}\n\t\tcenter.datum(root);\n\t\t// When zooming in, arcs enter from the outside and exit to the inside.\n\t\t// Entering outside arcs start from the old layout.\n\t\tif (root === p) enterArc = outsideArc, exitArc = insideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\t\tpath = path.data(partition.nodes(root).slice(1), function(d) { return d.key; });\n\t\t// When zooming out, arcs enter from the inside and exit to the outside.\n\t\t// Exiting outside arcs transition to the new layout.\n\n\t\t//Modifying this so that they get sucked into the clicked arc\n\t\tif (root !== p) enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\t\t\n\t\tif (root == p) {\n\t\t\td3.transition().duration(d3.event.altKey ? 7500 : sig2).each(function() {\n\t\t path.exit().transition()\n\t\t\t .style(\"fill-opacity\", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n\t\t\t .attrTween(\"d\", function(d) { return arcTween.call(this, exitArc(d)); })\n\t\t\t .remove();\n\t\t path.enter().append(\"path\")\n\t\t \t\t.attr(\"class\",\"path\")\n\t\t\t .style(\"fill-opacity\", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n\t\t\t .style(\"fill\", function(d) { return d.fill; }) //'url(#grad)')//\n\t\t\t .on(\"click\", zoomIn)\n\t\t\t .each(function(d) { this._current = enterArc(d); });\n\t\t\t path.transition()\n\t\t\t .style(\"fill-opacity\", 1)\n\t\t\t .style(\"stroke\",function(d) {return d.parent.id == 50? \"#2b2b2b\":null})\n\t\t\t .attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); })\n\t\t\t .transition().duration(sig).attr(\"d\",arc2);\n\n\t\t });\n\t\t\t} \n\t\telse {\n\t\t\tpath.transition().duration(2000).attr(\"d\",arc);\n\t\t\td3.transition().duration(2000)\n\t\t\t\t.each(function() {\n\t\t\t\t\t \tpath.exit().transition()\n\t\t\t\t\t\t .style(\"fill-opacity\", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n\t\t\t\t\t\t .attrTween(\"d\", function(d) { return arcTween.call(this, exitArc(d)); })\n\t\t\t\t\t\t .remove();\n\t\t\t\t\t \tpath.enter()\n\t\t\t\t\t \t\t.append(\"path\")\n\t\t\t\t\t\t \t.style(\"fill-opacity\", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n\t\t\t\t\t\t \t.style(\"fill\", function(d) { return d.fill; }) //'url(#grad)')//\n\t\t\t\t\t\t \t.on(\"click\", zoomIn)\n\t\t\t\t\t\t \t.style(\"pointer-events\",\"auto\")\n\t\t\t\t\t\t \t.on(\"mouseover\",function(o){\n\t\t\t\t\t\t\t\tvar h = d3.selectAll(\".node\").filter(function(e) {return e.comp == o.parent.id && e.suggest == o.parent.id ? this : null;}).node();\n\t\t\t\t\t\t\t\tvar g = d3.selectAll(\"circle\").filter(function(e) {return e.comp == o.parent.id && e.suggest != 0 ? this : null;}).node();\n\t\t\t\t\t\t\t\td3.selectAll(\"circle\").style(\"fill\", function(d) { return color(d.comp); });\n\t \t\t\t\t\t\t\td3.select(g).style(\"fill\",\"#2b2b2b\");\n\t\t\t\t\t\t\t\tvar f = h.__data__;\n\t\t\t\t\t\t\t\tif (f.time != null) {\n\t\t\t\t\t\t\t \t\tdiv.html('<u>Central cluster article:</u><br/><br/><a href=' + f.url + '>' + f.title + '</a><br/><br/>' + f.source + ' ' + f.time.substr(5,2) + '/' + f.time.substr(8,2) + ' ' + f.time.substr(11,5) + '</><br/><br/>' + f.summary);\n\t\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\tdiv.html('<u>Central cluster article:</u><br/><br/><a href=' + f.url + '><b>' + f.title + '</b></a><br/><br/><b>' + f.source + '</b><br/><br/>' + f.summary);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t \t\t})\n\t\t\t\t\t\t\t.each(function(d) { this._current = enterArc(d); });\n\t\t\t\t\t\tpath.transition()\n\t\t\t\t\t\t\t\t.style(\"fill-opacity\", 1) \n\t\t\t\t\t\t\t\t.attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); });\n\t\t\t\t \t});\n\t\t \t\t}\n\t\t\t}//end of zoom function", "title": "" }, { "docid": "bf35fe72cc926461e382dc6216849ca0", "score": "0.60442156", "text": "function zoomed() {\n const transform = `translate(${d3.event.transform.x}, ${d3.event.transform.y}) scale(${d3.event.transform.k})`;\n const nodes = document.querySelector(\".nodes\");\n const links = document.querySelector(\".links\");\n nodes.setAttribute(\"transform\", transform);\n links.setAttribute(\"transform\", transform);\n }", "title": "" }, { "docid": "b9582350411db707e2f8bd70031051d5", "score": "0.6038959", "text": "function zoomLayers()\n {\n // image layer\n if( imageLayer ) {\n imageLayer.zoom(scale, scale, scaleCenter.x, scaleCenter.y);\n imageLayer.draw();\n }\n // draw layer\n if( drawController ) {\n drawController.zoomStage(scale, scaleCenter);\n }\n // fire event\n fireEvent({\"type\": \"zoom-change\", \"scale\": scale, \"cx\": scaleCenter.x, \"cy\": scaleCenter.y });\n }", "title": "" }, { "docid": "956cce2f2566cd65237ac7d8eec176b1", "score": "0.6023286", "text": "function enterFrame() {\n if (dur > 0) {\n\t\t\t\t\tif (isFinite(Crafty.viewport._zoom)) zoom = Crafty.viewport._zoom;\n var old = {\n width: act.width * zoom,\n height: act.height * zoom\n };\n zoom += zoom_tick;\n Crafty.viewport._zoom = zoom;\n var new_s = {\n width: act.width * zoom,\n height: act.height * zoom\n },\n diff = {\n width: new_s.width - old.width,\n height: new_s.height - old.height\n };\n Crafty.stage.inner.style[prop] = 'scale(' + zoom + ',' + zoom + ')';\n if (Crafty.canvas._canvas) {\n\t\t\t\t\t\tvar czoom = zoom / (zoom - zoom_tick);\n\t\t\t\t\t\tCrafty.canvas.context.scale(czoom, czoom);\n Crafty.DrawManager.drawAll();\n }\n Crafty.viewport.x -= diff.width * prct.width;\n Crafty.viewport.y -= diff.height * prct.height;\n dur--;\n }\n }", "title": "" }, { "docid": "5c89f3e2e902781962832f4f6a06aff9", "score": "0.60226846", "text": "zoomInOut(step){if(2<=this.instance.currentZoomVal){this.instance.currentZoomVal=2}else if(.1>=this.instance.currentZoomVal){this.instance.currentZoomVal=.1}else{this.$.zoomIcon.icon=\"fullscreen\";this.instance.zoomInOut(step)}}", "title": "" }, { "docid": "48c7cf26e9466848ad12b07de11ce679", "score": "0.6012148", "text": "function applyZoom(newLevel, updateSlider) {\n // Hides a radial menu when zoomed as the scaling does not quite work\n jQuery(\"#radial_menu\").radmenu(\"hide\");\n jQuery(\"#radial_menu_relation\").radmenu(\"hide\");\n $('.popover').remove();\n\n // Reset the zoom of the canvas if the canvas has been moved or resized\n if (fd.canvas.scaleOffsetX != zoomLevel) {\n newLevel = zoomLevel / fd.canvas.scaleOffsetX;\n }\n\n // Enforce zoom limits\n else if (zoomLevel * newLevel < zoomMax && zoomLevel * newLevel > zoomMin) {\n zoomLevel = zoomLevel * newLevel;\n } else if (zoomLevel * newLevel > zoomMin) {\n newLevel = zoomMax / zoomLevel;\n zoomLevel = zoomMax;\n } else {\n newLevel = zoomMin / zoomLevel;\n zoomLevel = zoomMin;\n }\n\n // Zoom the nodes with CSS3's transform\n $(\"#infovis-label div.node\")\n .css(\"-webkit-transform\", \"scale(\" + zoomLevel + \")\")\n .css(\"-moz-transform\", \"scale(\" + zoomLevel + \")\")\n .css(\"-ms-transform\", \"scale(\" + zoomLevel + \")\")\n .css(\"-o-transform\", \"scale(\" + zoomLevel + \")\")\n .css(\"transform\", \"scale(\" + zoomLevel + \")\");\n\n // Apply ForceDirected's zoom\n fd.canvas.scale(newLevel, newLevel);\n\n // Update the slider if necessary\n if (updateSlider) {\n $(\"#slider-vertical\").slider(\"value\", (zoomLevel - zoomMin) * zoomSteps / (zoomMax - zoomMin));\n }\n}", "title": "" }, { "docid": "23999e1ed95a3a1931095164ce4f36a2", "score": "0.600485", "text": "zoomFrame(idx, dir, onfinish) {\n var view = this;\n var composite = this.all[idx];\n\n var frame = this.frames[idx];\n var frameX = frame.attr('x');\n var frameW = frame.attr('width');\n var frameY = frame.attr('y');\n var frameH = frame.attr('height');\n var centerX = frameX + frameW / 2;\n var centerY = frameY + frameH / 2;\n\n var animSpeed = 700;\n\n // delta to translate to.\n var dx = this.compositeCenter.x - centerX;\n var dy = this.compositeCenter.y - centerY;\n var scaleFactor = this.compositeDim.w / this.frameDim.w;\n\n if (dir === 'out' && this.state.zoomed) {\n scaleFactor = 1;\n dx = -this.state.zoomed.dx;\n dy = -this.state.zoomed.dy;\n view.all.animate({\n 'transform': `s1,1,${this.state.centerX},${this.state.centerY}`,\n }, animSpeed, 'bounce', onfinish);\n // Clear the zoom data.\n this.state.zoomed = null;\n } else if (dir !== 'out') {\n view.all.animate({\n 'transform': `t${dx},${dy}`\n }, animSpeed, '<>', function () {\n view.all.animate({\n 'transform': `...s${scaleFactor},${scaleFactor},${centerX},${centerY}`,\n }, animSpeed, 'bounce', onfinish);\n });\n // Store the zoom data for next zoom.\n this.state.zoomed = {\n dx: dx,\n dy: dy,\n centerX: centerX,\n centerY: centerY,\n scaleFactor: scaleFactor\n };\n }\n }", "title": "" }, { "docid": "76fc099016bd66c1c1d0643ce1659adc", "score": "0.59922606", "text": "function zoom() {\n var zoom = diva.getZoomLevel() - document.querySelector(\".zoomSlider\").value;\n\n if (zoom < 0) {\n for (let i = 0; i < Math.abs(zoom); i++) { diva.zoomIn(); }\n } else if (zoom > 0) {\n for (let i = 0; i < Math.abs(zoom); i++) { diva.zoomOut(); }\n }\n\n // Workaround: Ensures that correct zoom is displayed even if slider moves fast\n diva.setZoomLevel(diva.getZoomLevel());\n}", "title": "" }, { "docid": "7775cfa5450f58443ad4632570780138", "score": "0.59847134", "text": "function zoom() {\n svgGraph.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\"\n + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "029f8162964a4738e87e918d2aac0f1c", "score": "0.5971458", "text": "function zoomHandler(){\r\n\t\tsvg_content.attr(\"transform\", d3.event.transform);\r\n\t}", "title": "" }, { "docid": "122942bfc8c8a71a66426883c5c433be", "score": "0.5963576", "text": "function zoomHandler() {\n \t\tviewport.attr(\"transform\", \"translate(\" + d3.event.translate + \") scale(\" + d3.event.scale + \")\");\n\t}", "title": "" }, { "docid": "122942bfc8c8a71a66426883c5c433be", "score": "0.5963576", "text": "function zoomHandler() {\n \t\tviewport.attr(\"transform\", \"translate(\" + d3.event.translate + \") scale(\" + d3.event.scale + \")\");\n\t}", "title": "" }, { "docid": "f50aef9c72632fd7376eea8b2a768324", "score": "0.5956454", "text": "function fullSizeMinimap() {\n $(\"#zoom\").animate({\n height: screenHeight - 250 - $('#header').height()\n }, 500);\n\n $('#phylogenyContainer').animate({\n 'width': 30\n }, 1000, function () {\n zoom(1, 0, 1);\n screenResize();\n });\n}", "title": "" }, { "docid": "59f4bedeaf3c504c3a4594c5402d3b46", "score": "0.5933346", "text": "function doZoom( increment ) {\r\n var newZoom = increment === undefined ? d3.event.scale : zoomScale(currentZoom+increment);\r\n if( currentZoom == newZoom )\r\n return; // no zoom change\r\n // See if we cross the 'show' threshold in either direction\r\n if( currentZoom<SHOW_THRESHOLD && newZoom>=SHOW_THRESHOLD )\r\n svg.selectAll(\"g.label\").classed('on',true);\r\n else if( currentZoom>=SHOW_THRESHOLD && newZoom<SHOW_THRESHOLD )\r\n svg.selectAll(\"g.label\").classed('on',false);\r\n\r\n\r\n // Compute the new offset, so that the graph center does not move\r\n var zoomRatio = newZoom/currentZoom;\r\n var newOffset = { x : currentOffset.x*zoomRatio + WIDTH/2*(1-zoomRatio), y : currentOffset.y*zoomRatio + HEIGHT/2*(1-zoomRatio) }; \r\n\r\n // Reposition the graph\r\n repositionGraph( newOffset, newZoom, \"zoom\" );\r\n }", "title": "" }, { "docid": "cb19dd2bfc47606100866208757bb65b", "score": "0.5932166", "text": "function zoomAction() {\n graphWrapper.attr('transform', d3.event.transform);\n }", "title": "" }, { "docid": "4b1e24294a5b9e96cd92221e6c4446b1", "score": "0.5922359", "text": "function updateZoom() {\n var scale = zoom.scale();\n layer.attr(\"transform\",\n \"translate(\" + zoom.translate() + \") \" +\n \"scale(\" + [scale, scale] + \")\");\n}", "title": "" }, { "docid": "172ef4939ce76ef22f612742effe5100", "score": "0.589697", "text": "function zoom_to(level)\n {\n while(drawer.cell_width > level)\n {\n zoom_centered(true);\n }\n\n while(drawer.cell_width * 2 < level)\n {\n zoom_centered(false);\n }\n }", "title": "" }, { "docid": "94ab330fbfcb20adfafbe59cab634e4f", "score": "0.5889895", "text": "function zoomIn(i)\n {\n // console.log(\"DEBUG: zoomIn() >> index: \" + i);\n\n return new Promise(function(resolve,reject)\n {\n var c = apps.children[ parseInt(i) ];\n\n if(c == undefined)\n {\n return;\n }\n\n var tt = 1;\n\n // ANIMATE: fade Select\n animSelectFadeOut = select.animateTo({ a: 0 }, 0.3, scene.animation.TWEEN_LINEAR, scene.animation.OPTION_FASTFORWARD, 1);\n animSelectFadeOut.then( function()\n {\n animSelectFadeOut = null;\n\n// if(demoStopping == true) return;\n\n var sx = (root.w / c.w);\n var sy = (root.h / c.h);\n\n var xx = -c.x * sx;\n var yy = -c.y * sy;\n\n // ANIMATE: zoom-in App\n animAppZoomIn = apps.animateTo({ sx: sx, sy: sy, x: xx, y: yy }, tt, scene.animation.TWEEN_STOP, scene.animation.OPTION_FASTFORWARD)\n animAppZoomIn.then(function()\n {\n animAppZoomIn = null;\n\n c.focus = true;\n resolve();\n\n }) // animAppZoomIn\n });//promise\n });\n }", "title": "" }, { "docid": "7eb3980b7350d0d505b5e0cba9ed6a4b", "score": "0.5882317", "text": "function zoom() {\n\t\t\t\t\t\t\td3.event.sourceEvent.stopPropagation();\n\t\t\t\t\t\t\tsvgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")\");\n\t\t\t\t\t\t}", "title": "" }, { "docid": "56581eb8e29360c563e2cbf42456b822", "score": "0.5870982", "text": "function setupZoom(initialScale) {\n\n // calculate minScale, maxScale\n globalVar.minScale = Math.min(globalVar.curCanvas.zoomOutFactorX,\n globalVar.curCanvas.zoomOutFactorY, 1);\n globalVar.maxScale = Math.max(globalVar.curCanvas.zoomInFactorX,\n globalVar.curCanvas.zoomInFactorY, 1);\n\n // set up zoom\n globalVar.zoom = d3.zoom()\n .scaleExtent([globalVar.minScale, globalVar.maxScale])\n .on(\"zoom\", zoomed);\n\n // set up zooms\n d3.select(\"#maing\").call(globalVar.zoom)\n .on(\"wheel.zoom\", null)\n .on(\"dblclick.zoom\", function () {\n\n var mousePos = d3.mouse(this);\n event.preventDefault();\n event.stopImmediatePropagation();\n var finalK = (event.shiftKey ? globalVar.minScale : globalVar.maxScale);\n var duration = (event.shiftKey ? 1 / finalK / 2 : finalK / 2) * param.literalZoomDuration;\n startLiteralZoomTransition(mousePos, finalK, duration);\n })\n .call(globalVar.zoom.transform, d3.zoomIdentity.scale(initialScale));\n}", "title": "" }, { "docid": "01a59657efc02a0ee3f2f47259fc33df", "score": "0.5853679", "text": "function centerNode(source) {\n lastExpandedNode = source;\n var scale = zoomListener.scale();\n var x = -source.y0;\n var y = -source.x0;\n x = x * scale + viewerWidth / 2;\n y = y * scale + viewerHeight / 2;\n // d3.select('#tree-container g').transition()\n svg.select('g').transition()\n .duration(duration)\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + scale + \")\");\n zoomListener.scale(scale);\n zoomListener.translate([x, y]);\n }", "title": "" }, { "docid": "921a6cb8282d58a18ed62332f3febb58", "score": "0.5853026", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n}", "title": "" }, { "docid": "76fed6fce084ae3c128b2346e7f8a2d3", "score": "0.58446026", "text": "function geometric_zoom() {\n canvas.attr(\"transform\", \"translate(\" + d3.event.translate[0] + \",\" + d3.event.translate[1] + \")scale(\" + (d3.event.scale) + \")\");\n }", "title": "" }, { "docid": "9d58f4ccc7d414ed60c87275cf6c2120", "score": "0.5844576", "text": "function zoom() {\n var svg = document.getElementById(\"mySVG\");\n var point = svg.createSVGPoint();\n point.x = event.clientX; \n point.y = event.clientY;\n point = coordinateTransform(point, svg);\n if (zoomed == false) {\n for (var i=0; i<origMatrix.length; i++) {\n origMatrix[i] *= 1.9;\n }\n origMatrix[4] = (origMatrix[4] - point.x);\n origMatrix[5] = (origMatrix[5] - point.y);\n newMatrix = \"matrix(\" + origMatrix.join(' ') + \")\";\n $(\"#svgGroup\").attr(\"transform\", newMatrix);\n zoomed = true;\n if ('speechSynthesis' in window) {\n msg.text = 'Zoomed in'; speechSynthesis.speak(msg);\n }\n $(\".default\").hide();\n $(\".zoomed\").show();\n } else if (zoomed == true) {\n origMatrix = initialValue.slice(0);\n $(\"#svgGroup\").attr(\"transform\", \"matrix(\" + origMatrix + \")\");\n zoomed = false;\n if ('speechSynthesis' in window) {\n msg.text = 'Zoomed out'; speechSynthesis.speak(msg);\n }\n $(\".default\").show();\n $(\".zoomed\").hide();\n }\n }", "title": "" }, { "docid": "08a17ce946e6e6ca73715f69b3a8f65d", "score": "0.5843461", "text": "function updatezoomWindow() {\n if (minimapNodes) {\n var zoom = updateZoomValues();\n var boundingBox = {xleft: Math.floor(zoomLeft), xright: Math.ceil(zoomRight), zoom: Math.ceil(zoom), isMiniMap: false};\n getNodes(boundingBox, drawZoom);\n }\n}", "title": "" }, { "docid": "e827dc64c686e58b256b4c159496112b", "score": "0.579662", "text": "function setupZoom(){prepZooms();insertZoomHTML();zoomdiv=document.getElementById(zoomID);zoomimg=document.getElementById(theID)}", "title": "" }, { "docid": "ec679fa7bf1afa38af6c89b4cc9f2cc8", "score": "0.5793824", "text": "function zoomin() {\n ruler.graphics.clear();\n var tickcheck = tickcircle.visible;\n tickcircle.graphics.clear();\n rulerCont.removeAllChildren();\n stage.update();\n //update rulerSpacing\n var rulerOldDiff = rulerSpacing;\n if (zoom_check == 1) {\n rulerSpacing = rulerSpacing + 35;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth + 250;\n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n } else if (zoom_check == 2) {\n rulerSpacing = rulerSpacing + 40;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth - 850; \n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n }\n zoom_check++;\n //update innerBaseWidth\n innerBaseWidth = (3 * rulerSpacing) - 20; \n //update ruler width\n rulerWidth = (rulerSpacing + 1) * 100;\n\n createRuler(30, rulerWidth, textarray, tickcheck);\n //for clock and start up message infront of ruler\n if (clock_cont.visible == true) {\n stage.setChildIndex(clock_cont, stage.getNumChildren() - 1);\n }\n\t//For numberJumps\n var tempArray = [];\n var tempCustomText = [];\n for (var i in jumpObjectsList) {\n stage.setChildIndex(jumpObjectsList[i], stage.getNumChildren() - 1);\n var count = Math.round(jumpObjectsList[i].jumpWidth / rulerOldDiff);\n var width = count * rulerSpacing;\n var color = jumpObjectsList[i].color;\n oldX = jumpObjectsList[i].x;\n oldY = jumpObjectsList[i].y;\n oldPos = Math.round(oldX / rulerOldDiff);\n var tempTopbitmap = jumpObjectsList[i].getChildByName('top');\n //check text on innershape \n if (jumpObjectsList[i].getChildAt(9) != undefined) {\n checkcont = jumpObjectsList[i].getChildAt(9);\n if (checkcont.children != undefined) {\n tempCustomText = checkcont.children;\n }\n }\n stage.removeChild(jumpObjectsList[i]);\n tempArray.push(jumpObjectsList[i]);\n newContainX = oldPos * rulerSpacing;\n createJump(width, newContainX, oldY, color, tempTopbitmap.y, tempCustomText);\n stage.update();\n tempCustomText = [];\n\t snapLeft();\n }\n for (var t in tempArray) {\n removeFromArray(jumpObjectsList, tempArray[t]);\n }\n\t//snapLeft();\n\t//For tickMarkers\n for (var p in purplecircleArray) {\n stage.setChildIndex(purplecircleArray[p], stage.getNumChildren() - 1);\n var purplecircle = purplecircleArray[p].children[1];\n numcnt = purplecircle.name.replace(\"circle\", \"\");\n\t numcnt = (purplecircleArray[p].x - 3)/rulerOldDiff;\n\t purplecircleArray[p].x += numcnt * (rulerSpacing - rulerOldDiff);\n } \n }", "title": "" }, { "docid": "e37d9d41f398bec0753529405d8f1003", "score": "0.57784855", "text": "function zoom() {\n // Adjust the width of links on zoom\n if(d3.event.sourceEvent.type == 'wheel' && d3.event.type == 'zoom') {\n settings.zoomScale = d3.event.scale;\n }\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n scaleLineGroup.attr(\"transform\", \"translate(1,1)scale(\" + d3.event.scale + ', 1' + \")\");\n }", "title": "" }, { "docid": "edc54136ba273324009c66c2269d95ae", "score": "0.5775863", "text": "setZoomFactor(zoomLevel) {\n const attrs = this.getChartState()\n const calc = attrs.calc\n\n // Store passed zoom level\n attrs.initialZoom = zoomLevel\n\n // Rescale container element accordingly\n attrs.centerG.attr(\n 'transform',\n ` translate(${calc.centerX}, ${calc.nodeMaxHeight / 2}) scale(${\n attrs.initialZoom\n })`\n )\n }", "title": "" }, { "docid": "e0daf6c343c047bc5e6716b19e7ce4e3", "score": "0.57595444", "text": "function zoomClick() {\n \t \t var clicked = d3.event.target,\n \t \t direction = 1,\n \t \t factor = 0.1,\n \t \t target_zoom = 1,\n \t \t center = [width >> 1, height >> 1],\n \t \t extent = zoom.scaleExtent(),\n \t \t translate = zoom.translate(),\n \t \t translate0 = [],\n \t \t l = [],\n \t \t view = {x: translate[0], y: translate[1], k: zoom.scale()};\n \t \t // console.log(this.id);\n \t \t d3.event.preventDefault();\n \t \t direction = (this.id === 'zoom_in') ? 1 : -1;\n \t \t target_zoom = zoom.scale() * (1 + factor * direction);\n \t \t if (target_zoom < extent[0] || target_zoom > extent[1]) { return false; }\n \t \t translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];\n \t \t view.k = target_zoom;\n \t \t l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];\n \t \t view.x += center[0] - l[0];\n \t \t view.y += center[1] - l[1];\n \t \t interpolateZoom([view.x, view.y], view.k);\n \t \t}", "title": "" }, { "docid": "e195f04f3539430a323ef1aee872f6ec", "score": "0.5753388", "text": "function zoomed () {\n svg.attr(\"transform\",\n \"translate(\" + zoom.translate() + \")\" +\n \"scale(\" + zoom.scale() + \")\"\n );\n }", "title": "" }, { "docid": "a7f6d3dadff84e9fa3c4a5a74ff65185", "score": "0.57433015", "text": "function resetZoom() {\n scaleFactor = 1;\n } // resetZoom", "title": "" }, { "docid": "8258fcf30216ce002b6bf9a0ab8fa155", "score": "0.5740726", "text": "function zoomfonc(d) {\n\t\tvar focus0 = focus; focus = d;\n\n\t\tvar transition = d3.transition()\n\t\t\t\t.duration(d3.event.altKey ? 7500 : 750)\n\t\t\t\t.tween(\"zoom\", function(d) {\n\t\t\t\t\tvar i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);\n\t\t\t\t\treturn function(t) { zoomTo(i(t)); };\n\t\t\t\t});\n\n /*transition.selectAll(\"text\")\n .filter(function(d) { return d.parent === focus || this.style.display === \"inline\"; })\n .style(\"fill-opacity\", function(d) { return d.parent === focus ? 1 : 0; })\n .each(\"start\", function(d) { if (d.parent === focus) this.style.display = \"inline\"; })\n .each(\"end\", function(d) { if (d.parent !== focus) this.style.display = \"none\"; });*/\n\t}", "title": "" }, { "docid": "53beeddb52e82b21498fdb5ab246c984", "score": "0.5732755", "text": "function zoomInMap() {\n var scale = zoom.scale();\n if(scale <= maxScale - scaleBy){\n zoom.scale(scale + scaleBy);\n zoom.translate([\n zoom.translate()[0] - (width * scaleBy / 2), \n zoom.translate()[1] - (height * scaleBy / 2)\n ]);\n zoomed(); \n }\n }", "title": "" }, { "docid": "f43eb531601f5868803149f4402fbcbf", "score": "0.57306266", "text": "function zoom() {\n document.body.style.zoom = \"75%\"\n}", "title": "" }, { "docid": "ed1822dfba895fd8e9bc7cc7c638608b", "score": "0.57219034", "text": "function zoomTo() {\n\t\tif ( d3.event) {\n\t\t\tExt.getCmp(\"zoomslider\").setValue(7+Math.log(d3.event.scale)/Math.log(2));\n\t\t}\n\t}", "title": "" }, { "docid": "f467ce5cbb3a0ee20ef1be7f01aba305", "score": "0.57129973", "text": "zoomView() {\n this.groupNode.attr(\"transform\", d3.event.transform);\n this.groupLink.attr(\"transform\", d3.event.transform);\n }", "title": "" }, { "docid": "47d443e9ea0979dc02d89b782b27faae", "score": "0.5709423", "text": "updateZoomState ({ state, commit }) {\n commit('setZoom', Math.floor(state.graph.view.scale * 100))\n }", "title": "" }, { "docid": "f8c29e750932966227179c514c8533d4", "score": "0.57004946", "text": "function zoom(t) {\n scale = (scale += scale * t * 0.1) < .01 ? .01 : scale > 1 / mult ? 1 / mult : scale;\n app.stage.scale.set(scale);\n}", "title": "" }, { "docid": "10c43dbbcacd4e607256fe1c8f41c565", "score": "0.568705", "text": "function zoom (map, d) {\n if (map.activeNode && map.activeNode.node() === this.node()) {\n return reset(map)\n }\n\n map.activeNode = this.classed('active', true)\n\n var bounds = map.path.bounds(d)\n var dx = bounds[1][0] - bounds[0][0]\n var dy = bounds[1][1] - bounds[0][1]\n var x = (bounds[0][0] + bounds[1][0]) / 2\n var y = (bounds[0][1] + bounds[1][1]) / 2\n var scale = 0.9 / Math.max(dx / map.width, dy / map.height)\n var translate = [map.width / 2 - scale * x, map.height / 2 - scale * y]\n\n d3.select('g.zoom').transition().duration(750)\n .attr('transform', 'translate(' + translate + ')scale(' + scale + ')')\n }", "title": "" }, { "docid": "e8de9b2b3be51eeca30a97c634b79a62", "score": "0.56663495", "text": "function handleZoom(){\r\n \tif( ctrl.minimap ) return;\r\n \t_zoom( d3.event.translate, d3.event.scale ); \t\r\n }", "title": "" }, { "docid": "7caf13c2de4abd8d7ea3d7188ff29ff0", "score": "0.5665106", "text": "function constructTree(root) {\n\t// Misc. variables\n\tvar assignedKeys = 0;\n\tvar duration = 750;\n\n\t// size of pass bar\n\tvar passBarWidth = 25;\n\tvar passBarHeight = 5;\n\n\t// size of the diagram\n\tvar viewerWidth = $(document).width();\n\tvar viewerHeight = $(document).height();\n\n\t// define a d3 diagonal projection for use by the node paths later on.\n\tdiagonal = d3.svg.diagonal();\n\n\t// A recursive helper function for performing some setup by walking through all nodes\n\tfunction visit(parent, visitFn, childrenFn) {\n\t\tif (!parent) return;\n\n\t\tvisitFn(parent);\n\n\t\tvar children = childrenFn(parent);\n\t\tif (children) {\n\t\t\tvar count = children.length;\n\t\t\tfor (var i = 0; i < count; i++) {\n\t\t\t\tvisit(children[i], visitFn, childrenFn);\n\t\t\t}\n\t\t}\n\t}\n\n\t// define the zoomListener which calls the zoom function on the \"zoom\" event constrained within the scaleExtents\n\tvar zoomListener = d3.behavior.zoom().scaleExtent([0.1, 3]).on(\"zoom\", function() {\n\t\tsvgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n\t});\n\n\n\t// Helper functions for collapsing and expanding nodes.\n\n\tfunction collapse(d) {\n\t\tif (d.children) {\n\t\t\td._children = d.children;\n\t\t\td._children.forEach(collapse);\n\t\t\td.children = null;\n\t\t}\n\t}\n\n\tfunction expand(d) {\n\t\tif (d._children) {\n\t\t\td.children = d._children;\n\t\t\td.children.forEach(expand);\n\t\t\td._children = null;\n\t\t}\n\t}\n\n\n\t// Function to center node when clicked so node doesn't get lost when collapsing with large amount of children.\n\tfunction centerNode(node) {\n\t\tvar scale = zoomListener.scale();\n\t\tvar x = -node.x0 * scale + viewerWidth / 2;\n\t\tvar y = -node.y0 * scale + viewerHeight / 2;\n\t\td3.select('g').transition()\n\t\t\t.duration(duration)\n\t\t\t.attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + scale + \")\");\n\t\tzoomListener.scale(scale);\n\t\tzoomListener.translate([x, y]);\n\t}\n\n\t// Toggle children function\n\tfunction toggleChildren(d) {\n\t\tif (d.children) {\n\t\t\td._children = d.children;\n\t\t\td.children = null;\n\t\t} else if (d._children) {\n\t\t\td.children = d._children;\n\t\t\td._children = null;\n\t\t}\n\t}\n\n\t// Toggle children on click.\n\tfunction click(d) {\n\t\tif (d3.event.defaultPrevented) return; // click suppressed\n\t\ttoggleChildren(d);\n\t\tupdate(d);\n\t\tcenterNode(d);\n\t}\n\n\tfunction update(source) {\n\t\t// Call visit function to establish maxLabelLength\n\t\tvar maxLabelLength = 0;\n\t\tvisit(root, function(d) {\n\t\t\tmaxLabelLength = Math.max(d.name.length, maxLabelLength);\n\t\t}, function(d) {\n\t\t\treturn d.children && d.children.length > 0 ? d.children : null;\n\t\t});\n\n\t\t// Compute the new tree layout.\n\t\tvar tree = d3.layout.tree()\n\t\t\t.nodeSize([maxLabelLength * 6, maxLabelLength * 4]);\n\t\tvar nodes = tree.nodes(root),\n\t\t\tlinks = tree.links(nodes);\n\n\t\t// Update the nodes…\n\t\tvar gNodes = svgGroup.selectAll(\"g.node\")\n\t\t\t.data(nodes, function(d) {\n\t\t\t\treturn d.id || (d.id = ++assignedKeys);\n\t\t\t});\n\n\n\t\t// Enter any new nodes at the parent's previous position.\n\t\tvar nodeEnter = gNodes.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"node\")\n\t\t\t.attr(\"transform\", function(d) {\n\t\t\t\treturn \"translate(\" + source.x0 + \",\" + source.y0 + \")\";\n\t\t\t})\n\t\t\t.on('click', click);\n\n\t\tvar leafNodeEnter = nodeEnter.filter(function(d, i) {\n\t\t\treturn (!d.children && !d._children);\n\t\t});\n\n\n\t\t// Append circle and node title\n\t\tnodeEnter.append(\"circle\")\n\t\t\t.attr('class', 'nodeCircle')\n\t\t\t.attr(\"r\", 0);\n\n\t\tnodeEnter.append(\"text\")\n\t\t\t.attr(\"y\", -10)\n\t\t\t.attr('class', 'nodeText')\n\t\t\t.attr(\"text-anchor\", \"middle\")\n\t\t\t.text(function(d) {\n\t\t\t\treturn d.name;\n\t\t\t})\n\t\t\t.style(\"fill-opacity\", 0);\n\n\n\t\t// Append pass info for leaf nodes\n\t\tleafNodeEnter.append(\"rect\")\n\t\t\t.attr(\"x\", -passBarWidth / 2)\n\t\t\t.attr(\"y\", 20)\n\t\t\t.attr(\"width\", function(d) { return passBarWidth * d.passTotalRatio; })\n\t\t\t.attr(\"height\", passBarHeight)\n\t\t\t.style(\"fill\", \"green\")\n\t\t\t.style(\"fill-opacity\", 0);\n\n\t\tleafNodeEnter.append(\"rect\")\n\t\t\t.attr(\"x\", function(d) { return -passBarWidth / 2 + passBarWidth * d.passTotalRatio; })\n\t\t\t.attr(\"y\", 20)\n\t\t\t.attr(\"width\", function(d) { return passBarWidth * (1 - d.passTotalRatio); })\n\t\t\t.attr(\"height\", passBarHeight)\n\t\t\t.style(\"fill\", \"red\")\n\t\t\t.style(\"fill-opacity\", 0);\n\n\t\tleafNodeEnter.append(\"text\")\n\t\t\t.attr(\"y\", 18)\n\t\t\t.attr(\"text-anchor\", \"middle\")\n\t\t\t.text(function(d) {\n\t\t\t\treturn d.passFailRatio;\n\t\t\t})\n\t\t\t.style(\"fill-opacity\", 0);\n\n\n\t\t// Change the circle fill depending on whether it has children and is collapsed\n\t\tgNodes.select(\"circle.nodeCircle\")\n\t\t\t.style(\"fill\", function(d) {\n\t\t\t\treturn d._children ? \"lightsteelblue\" : \"#fff\";\n\t\t\t});\n\n\t\t// Transition nodes to their new position.\n\t\tvar nodeUpdate = gNodes.transition()\n\t\t\t.duration(duration)\n\t\t\t.attr(\"transform\", function(d) {\n\t\t\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\";\n\t\t\t});\n\n\n\t\t// Fade in new nodes\n\t\tnodeUpdate.select(\"circle\")\n\t\t\t.attr(\"r\", 4.5);\n\n\t\tnodeUpdate.selectAll(\"text\")\n\t\t\t.style(\"fill-opacity\", 1);\n\n\t\tnodeUpdate.selectAll(\"rect\")\n\t\t\t.style(\"fill-opacity\", 1);\n\n\n\t\t// Transition exiting nodes to the parent's new position.\n\t\tvar nodeExit = gNodes.exit().transition()\n\t\t\t.duration(duration)\n\t\t\t.attr(\"transform\", function(d) {\n\t\t\t\treturn \"translate(\" + source.x + \",\" + source.y + \")\";\n\t\t\t})\n\t\t\t.remove();\n\n\n\t\t// Fade out exiting nodes\n\t\tnodeExit.select(\"circle\")\n\t\t\t.attr(\"r\", 0);\n\n\t\tnodeExit.selectAll(\"text\")\n\t\t\t.style(\"fill-opacity\", 0);\n\n\t\tnodeExit.selectAll(\"rect\")\n\t\t\t.style(\"fill-opacity\", 0);\n\n\n\t\t// Update the links…\n\t\tvar gLinks = svgGroup.selectAll(\"g.link\")\n\t\t\t.data(links, function(d) {\n\t\t\t\treturn d.target.id;\n\t\t\t});\n\n\t\t// Enter any new links\n\t\tvar linkEnter = gLinks.enter().insert(\"g\", \"g\")\n\t\t\t.attr(\"class\", \"link\");\n\n\n\t\t// Append path and text at the parent's previous position.\n\t\tlinkEnter.append(\"path\")\n\t\t\t.attr('class', 'linkPath')\n\t\t\t.attr(\"d\", function(d) {\n\t\t\t\tvar o = {\n\t\t\t\t\tx: source.x0,\n\t\t\t\t\ty: source.y0\n\t\t\t\t};\n\t\t\t\treturn diagonal({\n\t\t\t\t\tsource: o,\n\t\t\t\t\ttarget: o\n\t\t\t\t});\n\t\t\t});\n\n\t\tlinkEnter.append(\"text\")\n\t\t\t.attr('class', 'linkText')\n\t\t\t.attr(\"x\", source.x0)\n\t\t\t.attr(\"y\", source.y0)\n\t\t\t.attr(\"text-anchor\", \"middle\")\n\t\t\t.text(function(d) {\n\t\t\t\tvar sign;\n\t\t\t\tif (d.target.side == \"left\") {\n\t\t\t\t\tsign = \">\";\n\t\t\t\t} else if (d.target.side == \"right\") {\n\t\t\t\t\tsign = \"≤\";\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\"Child side is incorrect\");\n\t\t\t\t}\n\t\t\t\treturn sign + \" \" + d.source.passMark;\n\t\t\t})\n\t\t\t.style(\"fill-opacity\", 0);\n\n\n\t\t// Transition links\n\t\tvar linkUpdate = gLinks.transition()\n\t\t\t.duration(duration);\n\n\n\t\t// Move links to their new position and fade in label\n\t\tlinkUpdate.select(\"path\")\n\t\t\t.attr(\"d\", diagonal);\n\n\t\tlinkUpdate.select(\"text\")\n\t\t\t.attr(\"x\", function(d) { return (d.source.x + d.target.x) / 2; })\n\t\t\t.attr(\"y\", function(d) { return (d.source.y + d.target.y) / 2; })\n\t\t\t.style(\"fill-opacity\", 1);\n\n\n\t\t// Transition exiting links\n\t\tvar linkExit = gLinks.exit().transition()\n\t\t\t.duration(duration)\n\t\t\t.remove();\n\n\n\t\t// Move exiting links to the parent's new position and fade out label\n\t\tlinkExit.select(\"path\")\n\t\t\t.attr(\"d\", function(d) {\n\t\t\t\tvar o = {\n\t\t\t\t\tx: source.x,\n\t\t\t\t\ty: source.y\n\t\t\t\t};\n\t\t\t\treturn diagonal({\n\t\t\t\t\tsource: o,\n\t\t\t\t\ttarget: o\n\t\t\t\t});\n\t\t\t});\n\n\t\tlinkExit.select(\"text\")\n\t\t\t.attr(\"x\", source.x)\n\t\t\t.attr(\"y\", source.y)\n\t\t\t.style(\"fill-opacity\", 0);\n\n\n\t\t// Stash the old positions for transition for later use\n\t\tnodes.forEach(function(d) {\n\t\t\td.x0 = d.x;\n\t\t\td.y0 = d.y;\n\t\t});\n\t}\n\n\t// Append a group which holds all nodes and which the zoom Listener can act upon.\n\tvar svgGroup = d3.select(\"#tree-container\").append(\"svg\")\n\t\t.attr(\"width\", viewerWidth)\n\t\t.attr(\"height\", viewerHeight)\n\t\t.attr(\"class\", \"overlay\")\n\t\t.call(zoomListener)\n\t\t.append(\"g\");\n\n\t// Set start position for all nodes\n\troot.x0 = viewerWidth / 2;\n\troot.y0 = 0;\n\n\t// Layout the tree initially and center on the root node.\n\tupdate(root);\n\tcenterNode(root);\n}", "title": "" }, { "docid": "5f043636744e7deef0eb920f7e6dca31", "score": "0.5662187", "text": "setRoot(root){\n this.setState({root: root});\n this.updateNotesInScale(root, this.state.scale);\n }", "title": "" }, { "docid": "1ed57889d9a07f10dad0e819fcdb19b6", "score": "0.5647768", "text": "function Stage() {\n var $obj = this;\n this.node = $(\"<div class='zoomWindow'><div class='zoomWrapper'><div class='zoomWrapperTitle'></div><div class='zoomWrapperImage'></div></div></div>\");\n this.ieframe = $('<iframe class=\"zoomIframe\" src=\"javascript:\\'\\';\" marginwidth=\"0\" marginheight=\"0\" align=\"bottom\" scrolling=\"no\" frameborder=\"0\" ></iframe>');\n this.setposition = function () {\n this.node.leftpos = 0;\n this.node.toppos = 0;\n if (settings.zoomType != 'innerzoom') {\n //positioning\n switch (settings.position) {\n case \"left\":\n this.node.leftpos = (smallimage.pos.l - smallimage.bleft - Math.abs(settings.xOffset) - settings.zoomWidth > 0) ? (0 - settings.zoomWidth - Math.abs(settings.xOffset)) : (smallimage.ow + Math.abs(settings.xOffset));\n this.node.toppos = Math.abs(settings.yOffset);\n break;\n case \"top\":\n this.node.leftpos = Math.abs(settings.xOffset);\n this.node.toppos = (smallimage.pos.t - smallimage.btop - Math.abs(settings.yOffset) - settings.zoomHeight > 0) ? (0 - settings.zoomHeight - Math.abs(settings.yOffset)) : (smallimage.oh + Math.abs(settings.yOffset));\n break;\n case \"bottom\":\n this.node.leftpos = Math.abs(settings.xOffset);\n this.node.toppos = (smallimage.pos.t - smallimage.btop + smallimage.oh + Math.abs(settings.yOffset) + settings.zoomHeight < screen.height) ? (smallimage.oh + Math.abs(settings.yOffset)) : (0 - settings.zoomHeight - Math.abs(settings.yOffset));\n break;\n default:\n this.node.leftpos = (smallimage.rightlimit + Math.abs(settings.xOffset) + settings.zoomWidth < screen.width) ? (smallimage.ow + Math.abs(settings.xOffset)) : (0 - settings.zoomWidth - Math.abs(settings.xOffset));\n this.node.toppos = Math.abs(settings.yOffset);\n break;\n }\n }\n this.node.css({\n 'left': this.node.leftpos + 'px',\n 'top': this.node.toppos + 'px'\n });\n return this;\n };\n this.append = function () {\n $('.zoomPad', el).append(this.node);\n this.node.css({\n position: 'absolute',\n display: 'none',\n zIndex: 5001\n });\n if (settings.zoomType == 'innerzoom') {\n this.node.css({\n cursor: 'default'\n });\n var thickness = (smallimage.bleft == 0) ? 1 : smallimage.bleft;\n $('.zoomWrapper', this.node).css({\n borderWidth: thickness + 'px'\n }); \n }\n\t\t\t\t\t//thickness = thickness?thickness:0;\n $('.zoomWrapper', this.node).css({\n width: Math.round(settings.zoomWidth)-2 + 'px' \n //borderWidth: thickness + 'px' //MetInfo\n });\n $('.zoomWrapperImage', this.node).css({\n width: '100%',\n height: Math.round(settings.zoomHeight)-2 + 'px'\n });\n //zoom title\n $('.zoomWrapperTitle', this.node).css({\n width: '100%',\n position: 'absolute'\n }); \n \n $('.zoomWrapperTitle', this.node).hide();\n if (settings.title && zoomtitle.length > 0) {\n $('.zoomWrapperTitle', this.node).html(zoomtitle).show();\n }\n $obj.setposition();\n };\n this.hide = function () {\n switch (settings.hideEffect) {\n case 'fadeout':\n this.node.fadeOut(settings.fadeoutSpeed, function () {});\n break;\n default:\n this.node.hide();\n break;\n }\n this.ieframe.hide();\n };\n this.show = function () {\n switch (settings.showEffect) {\n case 'fadein':\n this.node.fadeIn();\n this.node.fadeIn(settings.fadeinSpeed, function () {});\n break;\n default:\n this.node.show();\n break;\n }\n if (isIE6 && settings.zoomType != 'innerzoom') {\n this.ieframe.width = this.node.width();\n this.ieframe.height = this.node.height();\n this.ieframe.left = this.node.leftpos;\n this.ieframe.top = this.node.toppos;\n this.ieframe.css({\n display: 'block',\n position: \"absolute\",\n left: this.ieframe.left,\n top: this.ieframe.top,\n zIndex: 99,\n width: this.ieframe.width + 'px',\n height: this.ieframe.height + 'px'\n });\n $('.zoomPad', el).append(this.ieframe);\n this.ieframe.show();\n };\n };\n }", "title": "" }, { "docid": "51cc287b6001ad407e4d5dca09b13995", "score": "0.5642864", "text": "function zoomed() {\n\t\t\tgraphContainer.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n\t\t}", "title": "" }, { "docid": "0c02f40446adead95c5a63eb5de050d5", "score": "0.56422436", "text": "function zoomHandler() {\r\n\t\t\tvar scale = 1 - ( (1 - d3.event.scale) * 0.1 );\r\n\t\t mainG.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\r\n\t\t LodSight.view.textSize = minTextSize / d3.event.scale;\r\n\t\t d3.selectAll(\".nodename\").style(\"font-size\", LodSight.view.textSize+\"px\");\r\n\t\t}", "title": "" }, { "docid": "124e04dc464498f3dd82deec01283b28", "score": "0.5637492", "text": "function Stage(){\n var $obj=this;\n this.node=$(\"<div class='zoomWindow'><div class='zoomWrapper'><div class='zoomWrapperTitle'></div><div class='zoomWrapperImage'></div></div></div>\");\n this.ieframe=$('<iframe class=\"zoomIframe\" src=\"javascript:\\'\\';\" marginwidth=\"0\" marginheight=\"0\" align=\"bottom\" scrolling=\"no\" frameborder=\"0\" ></iframe>');\n this.setposition=function(){\n this.node.leftpos=0;\n this.node.toppos=0;\n if(settings.zoomType != 'innerzoom'){\n //positioning\n switch(settings.position){\n case \"left\":\n this.node.leftpos=(smallimage.pos.l - smallimage.bleft - Math.abs(settings.xOffset) - settings.zoomWidth > 0) ? (0 - settings.zoomWidth - Math.abs(settings.xOffset)) : (smallimage.ow + Math.abs(settings.xOffset));\n this.node.toppos=Math.abs(settings.yOffset);\n break;\n case \"top\":\n this.node.leftpos=Math.abs(settings.xOffset);\n this.node.toppos=(smallimage.pos.t - smallimage.btop - Math.abs(settings.yOffset) - settings.zoomHeight > 0) ? (0 - settings.zoomHeight - Math.abs(settings.yOffset)) : (smallimage.oh + Math.abs(settings.yOffset));\n break;\n case \"bottom\":\n this.node.leftpos=Math.abs(settings.xOffset);\n this.node.toppos=(smallimage.pos.t - smallimage.btop + smallimage.oh + Math.abs(settings.yOffset) + settings.zoomHeight < screen.height) ? (smallimage.oh + Math.abs(settings.yOffset)) : (0 - settings.zoomHeight - Math.abs(settings.yOffset));\n break;\n default:\n this.node.leftpos=(smallimage.rightlimit + Math.abs(settings.xOffset) + settings.zoomWidth < screen.width) ? (smallimage.ow + Math.abs(settings.xOffset)) : (0 - settings.zoomWidth - Math.abs(settings.xOffset));\n this.node.toppos=Math.abs(settings.yOffset);\n break;\n }\n }\n this.node.css({\n 'left':this.node.leftpos + 'px',\n 'top':this.node.toppos + 'px'\n });\n return this;\n };\n this.append=function(){\n $('.zoomPad',el).append(this.node);\n this.node.css({\n position:'absolute',\n display:'none',\n zIndex:5001\n });\n if(settings.zoomType == 'innerzoom'){\n this.node.css({\n cursor:'default'\n });\n var thickness=(smallimage.bleft == 0) ? 1 : smallimage.bleft;\n $('.zoomWrapper',this.node).css({\n borderWidth:thickness + 'px'\n });\n }\n\n $('.zoomWrapper',this.node).css({\n width:Math.round(settings.zoomWidth) + 'px',\n borderWidth:thickness + 'px'\n });\n $('.zoomWrapperImage',this.node).css({\n width:'100%',\n height:Math.round(settings.zoomHeight) + 'px'\n });\n //zoom title\n $('.zoomWrapperTitle',this.node).css({\n width:'100%',\n position:'absolute'\n });\n\n $('.zoomWrapperTitle',this.node).hide();\n if(settings.title && zoomtitle.length > 0){\n $('.zoomWrapperTitle',this.node).html(zoomtitle).show();\n }\n $obj.setposition();\n };\n this.hide=function(){\n switch(settings.hideEffect){\n case 'fadeout':\n this.node.fadeOut(settings.fadeoutSpeed,function(){\n });\n break;\n default:\n this.node.hide();\n break;\n }\n this.ieframe.hide();\n };\n this.show=function(){\n switch(settings.showEffect){\n case 'fadein':\n this.node.fadeIn();\n this.node.fadeIn(settings.fadeinSpeed,function(){\n });\n break;\n default:\n this.node.show();\n break;\n }\n if(isIE6 && settings.zoomType != 'innerzoom'){\n this.ieframe.width=this.node.width();\n this.ieframe.height=this.node.height();\n this.ieframe.left=this.node.leftpos;\n this.ieframe.top=this.node.toppos;\n this.ieframe.css({\n display:'block',\n position:\"absolute\",\n left:this.ieframe.left,\n top:this.ieframe.top,\n zIndex:99,\n width:this.ieframe.width + 'px',\n height:this.ieframe.height + 'px'\n });\n $('.zoomPad',el).append(this.ieframe);\n this.ieframe.show();\n }\n ;\n };\n }", "title": "" }, { "docid": "ac4337b1f24629981b09e4740eaff486", "score": "0.56369805", "text": "centerNode(x1, y1) {\n // Get the width and height of the document\n let bodyWidth = d3.select(this.mapContainer).style(\"width\");\n let bodyHeight = d3.select(this.mapContainer).style(\"height\");\n bodyWidth = parseInt(bodyWidth.substring(0, bodyWidth.length - 2));\n bodyHeight = parseInt(bodyHeight.substring(0, bodyHeight.length - 2));\n \n let scale = d3.zoomTransform(this.svg).scale();\n //this.zoomListener.scale();\n \n // Center the node at 0 on the svg\n let x2 = (bodyWidth / 2 - x1);\n let y2 = (bodyHeight / 2 - y1);\n \n // Get the screen position of the node at the center of the svg\n let sPos = this.getScreenCoords(x1, y1, [x2, y2], scale);\n \n // Center the node on the display\n x2 = x2 + (bodyWidth / 2 - sPos[0]);\n y2 = y2 + (bodyHeight / 2 - sPos[1]);\n \n // Apply the transformation to the display\n let transform = d3.zoomTransform(this.svg);\n transform.scale(scale);\n transform.translate([x2, y2]);\n transform.translate(this.vis.transition().duration(750));\n\n /*this.zoomListener.scale(scale);\n this.zoomListener.translate([x2, y2]);\n this.zoomListener.event(this.vis.transition().duration(750));*/\n }", "title": "" }, { "docid": "df9c88ab470c8ab0ba78cb8a74983e7b", "score": "0.56321037", "text": "function zoomed() {\n var zoomEventByMWheel = false;\n if (d3.event.sourceEvent) {\n if (d3.event.sourceEvent.deltaY) zoomEventByMWheel = true;\n }\n if (zoomEventByMWheel === false) {\n if (transformAnimation === true) {\n return;\n }\n zoomFactor = d3.event.scale;\n graphTranslation = d3.event.translate;\n graphContainer.attr(\"transform\", \"translate(\" + graphTranslation + \")scale(\" + zoomFactor + \")\");\n updateHaloRadius();\n return;\n }\n /** animate the transition **/\n zoomFactor = d3.event.scale;\n graphTranslation = d3.event.translate;\n graphContainer.transition()\n .tween(\"attr.translate\", function () {\n return function (t) {\n transformAnimation = true;\n var tr = d3.transform(graphContainer.attr(\"transform\"));\n graphTranslation[0] = tr.translate[0];\n graphTranslation[1] = tr.translate[1];\n zoomFactor = tr.scale[0];\n updateHaloRadius();\n graph.options().zoomSlider().updateZoomSliderValue(zoomFactor);\n };\n })\n .each(\"end\", function () {\n transformAnimation = false;\n })\n .attr(\"transform\", \"translate(\" + graphTranslation + \")scale(\" + zoomFactor + \")\")\n .ease('linear')\n .duration(250);\n }// end of zoomed function", "title": "" }, { "docid": "95b09570c33ab41aa41073888c922e9c", "score": "0.56286484", "text": "updateTransitionStartZoom() {\n let offset;\n if (this.battle.transitionZoom) {\n this.battle.sceneMap.camera.distance = ((this.battle\n .mapCameraDistance - Scene.Battle.START_CAMERA_DISTANCE) * (1 -\n ((new Date().getTime() - this.battle.time) / Scene.Battle\n .TRANSITION_ZOOM_TIME))) + Scene.Battle.START_CAMERA_DISTANCE;\n if (this.battle.sceneMap.camera.distance <= Scene.Battle\n .START_CAMERA_DISTANCE) {\n this.battle.sceneMap.camera.distance = Scene.Battle\n .START_CAMERA_DISTANCE;\n this.battle.transitionZoom = false;\n this.battle.updateBackgroundColor();\n this.battle.time = new Date().getTime();\n }\n this.battle.sceneMap.camera.update();\n return;\n }\n if (this.battle.camera.distance < this.battle.cameraDistance) {\n offset = Scene.Battle.START_CAMERA_DISTANCE / this.battle\n .cameraDistance * Scene.Battle.TRANSITION_ZOOM_TIME;\n this.battle.camera.distance = (((new Date().getTime() - this.battle\n .time) - offset) / (Scene.Battle.TRANSITION_ZOOM_TIME - offset))\n * this.battle.cameraDistance;\n if (this.battle.camera.distance >= this.battle.cameraDistance) {\n this.battle.camera.distance = this.battle.cameraDistance;\n this.battle.cameraON = true;\n }\n else {\n return;\n }\n }\n this.battle.turn = 1;\n this.battle.changeStep(BattleStep.StartTurn);\n }", "title": "" }, { "docid": "cf81cbffaf08c7f44c0e14c6f9813d38", "score": "0.56286436", "text": "zoomIn() {\n this.zoomFactor = Math.min(this.zoomFactor + 0.25, 2.0);\n return this.animation.scale(this.zoomFactor);\n }", "title": "" }, { "docid": "cea1c72a8d7fc222ef66a8176255f63b", "score": "0.5627728", "text": "function slide_after_actions(){\n\n trigger_zoom();\n\n }", "title": "" }, { "docid": "678f149c773391d6a9ecd9706ab87f75", "score": "0.56234914", "text": "function zoomIn(){\r\n\t\tconsole.log(targetZoom);\r\n\t\tif(!isZooming)\r\n\t\t{\r\n\t\t\ttargetZoom -= ZOOM_INCREMENT;\r\n\t\t\tif(targetZoom < MINIMUM_ZOOM)\r\n\t\t\t\ttargetZoom = MINIMUM_ZOOM;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "aa6fcc676d0b01b43139cc5284d10c31", "score": "0.56203574", "text": "async fit() {\n const svgNode = this.svg.node();\n const {\n width: offsetWidth,\n height: offsetHeight\n } = svgNode.getBoundingClientRect();\n const {\n fitRatio\n } = this.options;\n const {\n minX,\n maxX,\n minY,\n maxY\n } = this.state;\n const naturalWidth = maxY - minY;\n const naturalHeight = maxX - minX;\n const scale = Math.min(offsetWidth / naturalWidth * fitRatio, offsetHeight / naturalHeight * fitRatio, 2);\n const initialZoom = identity$1.translate((offsetWidth - naturalWidth * scale) / 2 - minY * scale, (offsetHeight - naturalHeight * scale) / 2 - minX * scale).scale(scale);\n return this.transition(this.svg).call(this.zoom.transform, initialZoom).end().catch(noop$1);\n }", "title": "" }, { "docid": "b1555fb976159063221e9b0e71a618a5", "score": "0.5616514", "text": "function zoomed() {\n transform = d3.event.transform;\n simulationUpdate();\n}", "title": "" }, { "docid": "27c5daff4e4683cc37264e66a54a0126", "score": "0.56082255", "text": "function zoomed() {\n\n // no dynamic layers? return\n if (d3.select(\".mainsvg:not(.static)\").size() == 0)\n return ;\n\n // frequently accessed global variables\n var cWidth = globalVar.curCanvas.w;\n var cHeight = globalVar.curCanvas.h;\n var vWidth = globalVar.viewportWidth;\n var vHeight = globalVar.viewportHeight;\n var iVX = globalVar.initialViewportX;\n var iVY = globalVar.initialViewportY;\n var zoomInFactorX = globalVar.curCanvas.zoomInFactorX;\n var zoomOutFactorX = globalVar.curCanvas.zoomOutFactorX;\n var zoomInFactorY = globalVar.curCanvas.zoomInFactorY;\n var zoomOutFactorY = globalVar.curCanvas.zoomOutFactorY;\n\n // get current zoom transform\n var transform = d3.event.transform;\n\n // remove all popovers\n removePopovers();\n\n // get scale x and y\n var scaleX = transform.k;\n var scaleY = transform.k;\n if (zoomInFactorX <= 1 && zoomOutFactorX >= 1)\n scaleX = 1;\n if (zoomInFactorY <= 1 && zoomOutFactorY >= 1)\n scaleY = 1;\n\n // get new viewport coordinates\n var viewportX = iVX - transform.x / scaleX;\n var viewportY = iVY - transform.y / scaleY;\n\n // restrict panning by modifying d3 event transform, which is a bit sketchy. However,\n // d3-zoom is so under-documented that I could not use it to make single-axis literal zooms work\n if (viewportX < 0) {\n viewportX = 0;\n d3.event.transform.x = iVX * scaleX;\n }\n if (viewportX > cWidth - vWidth / scaleX) {\n viewportX = cWidth - vWidth / scaleX;\n d3.event.transform.x = (iVX - viewportX) * scaleX;\n }\n if (viewportY < 0) {\n viewportY = 0;\n d3.event.transform.y = iVY * scaleY;\n }\n if (viewportY > cHeight - vHeight / scaleY) {\n viewportY = cHeight - vHeight / scaleY;\n d3.event.transform.y = (iVY - viewportY) * scaleY;\n }\n\n // set viewBox size && refresh canvas\n var curViewport = d3.select(\".mainsvg:not(.static)\").attr(\"viewBox\").split(\" \");\n curViewport[2] = vWidth / scaleX;\n curViewport[3] = vHeight / scaleY;\n d3.selectAll(\".mainsvg:not(.static)\")\n .attr(\"viewBox\", curViewport[0]\n + \" \" + curViewport[1]\n + \" \" + curViewport[2]\n + \" \" + curViewport[3]);\n\n // get data\n RefreshDynamicLayers(viewportX, viewportY);\n\n // check if zoom scale reaches zoomInFactor\n if ((zoomInFactorX > 1 && scaleX >= globalVar.maxScale) ||\n (zoomInFactorY > 1 && scaleY >= globalVar.maxScale))\n completeZoom(\"literal_zoom_in\", zoomInFactorX, zoomInFactorY);\n\n // check if zoom scale reaches zoomOutFactor\n if ((zoomOutFactorX < 1 && scaleX <= globalVar.minScale) ||\n (zoomOutFactorY < 1 && scaleY <= globalVar.minScale))\n completeZoom(\"literal_zoom_out\", zoomOutFactorX, zoomOutFactorY);\n}", "title": "" }, { "docid": "c151f12b725294574270434acbb4b35f", "score": "0.56075794", "text": "function zoom(Sx, Sy, Sz, prevScale) {\n\t\n\tvar fix = (mProj[0][0])/prevScale;\n\tvar mScale = scalem(Sx*fix, Sy, Sz);\n\tmProj[0][0] = mScale[0][0];\n\tmProj[1][1] = mScale[1][1];\n\tmProj[2][2] = mScale[2][2];\n\t\n\tvar d = mPerspective[3][2];\n\tmScale[3][2] = d;\n\tmPerspective = mScale;\n}", "title": "" }, { "docid": "fffb5cf8a71e0eb52c9c962eee2b987f", "score": "0.5591735", "text": "function updateTreeScale(treeScale, parentTreeScale, parentDelta) {\n treeScale.x = parentTreeScale.x * parentDelta.x.scale;\n treeScale.y = parentTreeScale.y * parentDelta.y.scale;\n}", "title": "" }, { "docid": "75b4beeb7e640d3446e7da38bd4cb792", "score": "0.55865175", "text": "function doTouchZoom(event) {\n\n var arrTouches = g_functions.getArrTouches(event);\n\n var distance = g_functions.getDistance(arrTouches[0].pageX, arrTouches[0].pageY, arrTouches[1].pageX, arrTouches[1].pageY);\n var zoomRatio = distance / g_temp.startDistance;\n\n var middlePoint = g_functions.getMiddlePoint(arrTouches[0].pageX, arrTouches[0].pageY, arrTouches[1].pageX, arrTouches[1].pageY);\n\n //set zoom data:\n var newWidth = g_temp.objImageSize.width * zoomRatio;\n var newHeight = g_temp.objImageSize.height * zoomRatio;\n\n //check max zoom ratio:\n var objOriginalSize = g_functions.getImageOriginalSize(g_temp.objImage);\n var expectedZoomRatio = 1;\n if (objOriginalSize.width > 0)\n expectedZoomRatio = newWidth / objOriginalSize.width;\n\n if (expectedZoomRatio > g_options.slider_zoom_max_ratio)\n return (true);\n\n //set pan data:\n panX = -(g_temp.imageOrientPoint.x * zoomRatio - g_temp.imageOrientPoint.x);\n panY = -(g_temp.imageOrientPoint.y * zoomRatio - g_temp.imageOrientPoint.y);\n\n var diffMiddleX = (middlePoint.x - g_temp.startMiddlePoint.x);\n var diffMiddleY = (middlePoint.y - g_temp.startMiddlePoint.y);\n\n var posx = g_temp.startImageX + panX + diffMiddleX;\n var posy = g_temp.startImageY + panY + diffMiddleY;\n\n\n //resize and place:\n g_functions.setElementSizeAndPosition(g_temp.objImage, posx, posy, newWidth, newHeight);\n\n //trigger zooming event\n g_objParent.trigger(g_parent.events.ZOOMING);\n g_objParent.trigger(g_parent.events.ZOOM_CHANGE);\n\n /*\n debugLine({\n middleStartX: g_temp.startMiddlePoint.x,\n middleX: middlePoint.x,\n diffMiddleX: diffMiddleX\n });\n */\n\n }", "title": "" }, { "docid": "678dcb1ac262a8c514d0b4b5a373f8a6", "score": "0.5569657", "text": "zoomInOut(step) {\n if (this.instance.currentZoomVal >= 2) {\n this.instance.currentZoomVal = 2;\n } else if (this.instance.currentZoomVal <= 0.1) {\n this.instance.currentZoomVal = 0.1;\n } else {\n this.shadowRoot.querySelector(\"#zoomIcon\").icon = \"fullscreen\";\n this.instance.zoomInOut(step);\n }\n }", "title": "" }, { "docid": "0935b8f7657dcdadd9c551f3085e29b2", "score": "0.5565385", "text": "function zoomout() {\n ruler.graphics.clear();\n var tickcheck = tickcircle.visible;\n tickcircle.graphics.clear();\n rulerCont.removeAllChildren();\n stage.update();\n var rulerOldDiff = rulerSpacing;\n if (zoom_check == 3) {\n rulerSpacing = rulerSpacing - 40;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth - 7250;\n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n } else if (zoom_check == 2) {\n rulerSpacing = rulerSpacing - 35;\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth - 5370;\n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n } else {\n if (clock_cont.visible == true) {\n stage.canvas.width = rulerWidth - 4820;\n } else {\n stage.canvas.width = ((rulerSpacing + 2) * 100) + 50;\n }\n }\n zoom_check--;\n //update innerBaseWidth\n innerBaseWidth = (3 * rulerSpacing) - 20;\n //update ruler width\n rulerWidth = (rulerSpacing + 1) * 100;\n createRuler(30, rulerWidth, textarray, tickcheck);\n //for clock and start up message infront of ruler\n if (clock_cont.visible == true) {\n stage.setChildIndex(clock_cont, stage.getNumChildren() - 1);\n }\n var temp = [];\n var tempCustomText = [];\n for (var b in jumpObjectsList) {\n stage.setChildIndex(jumpObjectsList[b], stage.getNumChildren() - 1);\n var count = Math.round(jumpObjectsList[b].jumpWidth / rulerOldDiff);\n var width = count * rulerSpacing;\n var color = jumpObjectsList[b].color;\n oldX = jumpObjectsList[b].x;\n oldY = jumpObjectsList[b].y;\n oldPos = Math.round(oldX / rulerOldDiff);\n var tempTopbitmap = jumpObjectsList[b].getChildByName('top');\n if (jumpObjectsList[b].getChildAt(9) != undefined) {\n checkcont = jumpObjectsList[b].getChildAt(9);\n if (checkcont.children != undefined) {\n tempCustomText = checkcont.children;\n }\n }\n stage.removeChild(jumpObjectsList[b]);\n temp.push(jumpObjectsList[b]);\n newContainX = oldPos * rulerSpacing;\n createJump(width, newContainX, oldY, color, tempTopbitmap.y, tempCustomText);\n stage.update();\n tempCustomText = [];\n\t snapLeft();\n }\n for (var t in temp) {\n removeFromArray(jumpObjectsList, temp[t]);\n }\n //snapLeft();\n for (var p in purplecircleArray) {\n stage.setChildIndex(purplecircleArray[p], stage.getNumChildren() - 1);\n var purplecircle = purplecircleArray[p].children[1];\n numcnt = purplecircle.name.replace(\"circle\", \"\");\n numcnt = (purplecircleArray[p].x - 3)/rulerOldDiff;\n\t purplecircleArray[p].x += numcnt * ( rulerSpacing - rulerOldDiff);\n\t \n }\n }", "title": "" }, { "docid": "ee6cc5e7859dfc4d7c299ee70ff428a8", "score": "0.55646557", "text": "function changeScale(delta,xx,yy,method=1) {\n\n\t// method = 3/2 - Zoom wrt center of screen\n\t// method = 1 - Zoom wrt position of mouse\n\t// Otherwise zoom wrt to selected object\n\n if(method==3){\n xx =(width/2 - globalScope.ox) / globalScope.scale\n yy = (height/2 - globalScope.oy) / globalScope.scale\n }\n else if(xx===undefined||yy===undefined||xx=='zoomButton'||yy=='zoomButton'){\n if (simulationArea.lastSelected && simulationArea.lastSelected.objectType!=\"Wire\") { // selected object\n xx = simulationArea.lastSelected.x;\n yy = simulationArea.lastSelected.y;\n } else { //mouse location\n if(method==1){\n xx = simulationArea.mouseX;\n yy = simulationArea.mouseY;\n }\n else if(method==2){\n xx =(width/2 - globalScope.ox) / globalScope.scale\n yy = (height/2 - globalScope.oy) / globalScope.scale\n }\n }\n }\n\n\n var oldScale = globalScope.scale;\n globalScope.scale = Math.max(0.5,Math.min(4*DPR,globalScope.scale+delta));\n globalScope.scale = Math.round(globalScope.scale * 10) / 10;\n globalScope.ox -= Math.round(xx * (globalScope.scale - oldScale)); // Shift accordingly, so that we zoom wrt to the selected point\n globalScope.oy -= Math.round(yy * (globalScope.scale - oldScale));\n // dots(true,false);\n\n\n\t// MiniMap\n if(!embed && !lightMode){\n findDimensions(globalScope);\n miniMapArea.setup();\n $('#miniMap').show();\n lastMiniMapShown = new Date().getTime();\n $('#miniMap').show();\n setTimeout(removeMiniMap,2000);\n }\n\n\n}", "title": "" }, { "docid": "8fc108af45eb4e9440e22bc4abfaa4b0", "score": "0.5562687", "text": "function zoomed() {\n g_zoom.attr('transform', `translate(${d3.event.transform.x}, ${d3.event.transform.y}) scale(${d3.event.transform.k})`);\n}", "title": "" }, { "docid": "097a85c955a775e51be3abc570e24ecf", "score": "0.5561406", "text": "function zoomHandler() {\n //zoom.scale(zoom.scale());\n chart.attr(\"transform\", \"translate(\" + d3.event.translate[0] + \",0\" + \") scale(\" + d3.event.scale + \",1)\");\n chartRoot.select(\"g.x-axis\").call(xAxis);\n dispatch.zoom_all(zoom.scale(),zoom.translate());\n }", "title": "" } ]
55141b768c627fd296e96b8d7cc83449
Does our fallback bestguess model think this event signifies that composition has begun?
[ { "docid": "a391b8c785d27be3dd0807d2488177b0", "score": "0.56037205", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n }", "title": "" } ]
[ { "docid": "2ad2bb4998b4695a1b0b14863c6bf338", "score": "0.7298839", "text": "function onCompositionStart(e) {\n e.target.composing = true;\n}", "title": "" }, { "docid": "5cebd985e4cc33c25ced5e9873a5deb8", "score": "0.6573186", "text": "function CompositionEventInit() {\n}", "title": "" }, { "docid": "3a53e9b27544b1bac73a88786c02ccf4", "score": "0.61254966", "text": "function editOnCompositionStart(editor, e) {\n\t editor.setMode('composite');\n\t editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n\t // Allow composition handler to interpret the compositionstart event\n\t editor._onCompositionStart(e);\n\t}", "title": "" }, { "docid": "bf5e8a175e56e85107d4415a661c3e06", "score": "0.5995209", "text": "function isEventComposing(nativeEvent) {\n return nativeEvent.isComposing || nativeEvent.keyCode === 229;\n}", "title": "" }, { "docid": "73e75946999c422e71f2f53e0bc6a0f3", "score": "0.5986176", "text": "compositionEnd(event) {\n this.handleUncapturedEvent(event);\n }", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1ffd47c4a6ef2ff18e9e74303c06adfc", "score": "0.5902632", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n // Allow composition handler to interpret the compositionstart event\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1b7485afba9a3213ebf139c1b9520d4b", "score": "0.58832705", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, {\n inCompositionMode: true\n })); // Allow composition handler to interpret the compositionstart event\n\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1b7485afba9a3213ebf139c1b9520d4b", "score": "0.58832705", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, {\n inCompositionMode: true\n })); // Allow composition handler to interpret the compositionstart event\n\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "1b7485afba9a3213ebf139c1b9520d4b", "score": "0.58832705", "text": "function editOnCompositionStart(editor, e) {\n editor.setMode('composite');\n editor.update(EditorState.set(editor._latestEditorState, {\n inCompositionMode: true\n })); // Allow composition handler to interpret the compositionstart event\n\n editor._onCompositionStart(e);\n}", "title": "" }, { "docid": "58ba3f5014d4a2ac0c3f180bb5702837", "score": "0.5836905", "text": "function getCompositionEventType(domEventName){switch(domEventName){case'compositionstart':return'onCompositionStart';case'compositionend':return'onCompositionEnd';case'compositionupdate':return'onCompositionUpdate';}}", "title": "" }, { "docid": "1f7560a5e436d33389bf5679b83065db", "score": "0.5770623", "text": "function baseEstablished()\n{\n\t//Now we check if there is stuff built here already from cam1-C.\n\tif (camCountStructuresInArea(\"buildArea\") >= 7)\n\t{\n\t\tif (blipActive)\n\t\t{\n\t\t\tblipActive = false;\n\t\t\thackRemoveMessage(\"C1CA_OBJ1\", PROX_MSG, CAM_HUMAN_PLAYER);\n\t\t}\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tif (!blipActive)\n\t\t{\n\t\t\tblipActive = true;\n\t\t\thackAddMessage(\"C1CA_OBJ1\", PROX_MSG, CAM_HUMAN_PLAYER, false);\n\t\t}\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "3eb45232326de944727955dc6b92304b", "score": "0.57070583", "text": "function isFallbackCompositionEnd(domEventName,nativeEvent){switch(domEventName){case'keyup':// Command keys insert or clear IME input.\nreturn END_KEYCODES.indexOf(nativeEvent.keyCode)!==-1;case'keydown':// Expect IME keyCode on each keydown. If we get any other\n// code we must have exited earlier.\nreturn nativeEvent.keyCode!==START_KEYCODE;case'keypress':case'mousedown':case'focusout':// Events are not possible without cancelling IME.\nreturn true;default:return false;}}", "title": "" }, { "docid": "fb1cfbdd7fb4bc618eed5832616b80f1", "score": "0.5689059", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n }", "title": "" }, { "docid": "ba866eea08506703fc07575e7f9aa130", "score": "0.5628102", "text": "function isFallbackCompositionStart(domEventName,nativeEvent){return domEventName==='keydown'&&nativeEvent.keyCode===START_KEYCODE;}", "title": "" }, { "docid": "3b749e499af200eed4db48fae8947937", "score": "0.5617738", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "a7e8f38b3494b8f556a80a6316acad6d", "score": "0.5556954", "text": "function wasComposedPreviously(input) {\n return !!input.fluentComposeConfig;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "7bbeadf042e5d05819dc843cd3a65b63", "score": "0.550736", "text": "function isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}", "title": "" }, { "docid": "68b597b80317a9c1e78908b5adbe77d2", "score": "0.5503703", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "68b597b80317a9c1e78908b5adbe77d2", "score": "0.5503703", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "c913c8956a662561ea66f048b3bd3a41", "score": "0.5494482", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "f28e5a4575239373c941cd2760c77351", "score": "0.5476766", "text": "componentDidUpdate() {\n if (!this.state.end) {\n this.isCompleted() // check if the gamer win\n }\n }", "title": "" }, { "docid": "78356a37168ab978663a808dd5b0e08b", "score": "0.54476166", "text": "shouldComponentUpdate(next){\n /**\n * composedUUID to identify each compose, so createComposed2Parent can be cached.\n */ \n this.computed.composedUUID=Date.now()\n if(!this.isAllChildrenComposed()){\n //clear last allComposed, so it can be reset\n this.computed.allComposed=undefined\n }\n if(this.context.shouldContinueCompose && !this.context.shouldContinueCompose(this)){\n return false\n }\n this.cancelUnusableLastComposed(...arguments)\n return true\n }", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "b146420737e8a2ec33e52a1b44cd4d52", "score": "0.54252553", "text": "function isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}", "title": "" }, { "docid": "76d3e7bdd6b8bfc92afef34f9fd6976b", "score": "0.5413628", "text": "onPresenceDetected() {\n\t\tlogUtil.log({\n\t\t\ttype: 'info',\n\t\t\ttitle: `Box \"${ this.name }\" detected a presence`\n\t\t});\n\t\tthis.motor.standUp()\n\t\t\t.then(() => {\n\t\t\t\tthis.motor.lookUp()\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tthis.speaker.explainRules()\n\t\t\t\t\t\t\t.then(this.onRulesExplained.bind(this))\n\t\t\t\t\t\t\t.catch(() => {\n\t\t\t\t\t\t\t\tlogUtil.log({\n\t\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\t\ttitle: `Rules not explained`\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tthis.motor.lookStraight()\n\t\t\t\t\t\t\t\t\t.then(this.startTheShow.bind(this));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t});\n\t}", "title": "" }, { "docid": "488a282f840866a65cd3fdc2d5a0d2b3", "score": "0.533161", "text": "cs20_epoc_was_requested_callback() {\n console.log('cs20_epoc_was_requested_callback ');\n this.cs20_epoc_needs_latch = true;\n }", "title": "" }, { "docid": "ec900c0682c9a7e1f510401c6f68ad7d", "score": "0.5319432", "text": "function signalEventObserved(e) {\n var p = e;\n while (p) {\n if (p.__slickgrid_uid__ === uid) {\n return true;\n }\n p = p.originalEvent;\n }\n // Event has not been visited yet: signal it and return FALSE to signal caller it has work to do.\n p = e;\n while (p) {\n p.__slickgrid_uid__ = uid;\n p = p.originalEvent;\n }\n return false;\n }", "title": "" }, { "docid": "d269ed9a2ba2a5ecd489ec3d7780a7e4", "score": "0.5292057", "text": "function PokerEvents() {\n }", "title": "" }, { "docid": "3531cb29b445e934fd0733ea7da23a6a", "score": "0.5255108", "text": "_isLastComposedFitIntoParent(lastComposed){\n\t\t\treturn false\n }", "title": "" }, { "docid": "db3f2081e99df37ba46b98bc84da1269", "score": "0.5241798", "text": "function eventsShouldAct() {\n\t\t\tresultsBlock = getResultsBlock();\n\t\t\treturn (resultsBlock != null);\n\t\t}", "title": "" }, { "docid": "db95c06fdf76f23c7231cb730b76bc56", "score": "0.51446706", "text": "decompose(composer, data = {}, name = null) {\n let comps = this.composers.filter(c => c.compose(composer));\n if (comps.length) {\n let event = new EventModel('ComposerEvent', name, Object.assign({}, data, { composer }));\n comps.forEach(c => c.call(event));\n this.composers = this.composers.filter(c => !!c.elasped);\n }\n return this;\n }", "title": "" }, { "docid": "d61b49b84cd6c6e1765f2ea6be24333b", "score": "0.51442814", "text": "onCanPlay() {\n\t\tthis.onComplete();\n\t\tthis.removeEvents();\n\t}", "title": "" }, { "docid": "fa9c08751a8b2b062d86fee6a9042fa5", "score": "0.5140913", "text": "function onCompositionLoad() {\n self.select.setSelected(self.config.object);\n }", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.5102795", "text": "function Composition() {}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.5102795", "text": "function Composition() {}", "title": "" }, { "docid": "69542f19cf63055be0d70005c8e23796", "score": "0.5099841", "text": "getComposition() {\n return this._composition;\n }", "title": "" }, { "docid": "49f25817d9517d6f45b28a973e76991f", "score": "0.50754154", "text": "get gameStarted() {\n return this.currentlyChosen !== undefined;\n }", "title": "" }, { "docid": "94bb9f7601f6a1c3686501b6c821825a", "score": "0.5072295", "text": "isCollected() {\n\t\tthis.collected = true;\n\t}", "title": "" }, { "docid": "bd4abb41fab3191d9d7c08c943c7d98e", "score": "0.506856", "text": "function destroyDuringResume() {\n var blip = new Blip(\"victimized\");\n var coll = new EventCollector();\n\n coll.listenAllCommon(blip);\n blip.on(\"data\", function() { blip.destroy(); });\n blip.resume();\n\n assert.equal(coll.events.length, 3);\n // Assume they're the three expected events, as tested elsewhere.\n}", "title": "" }, { "docid": "a82de9e522c8ad6732db6828926510e0", "score": "0.5052946", "text": "_checkLifecycleComplete () {\n // We expect navigation to commit.\n if (!checkLifecycle(this._frame, this._expectedLifecycle)) return\n this._lifecycleCallback()\n if (\n this._frame._loaderId === this._initialLoaderId &&\n !this._hasSameDocumentNavigation\n ) {\n return\n }\n if (this._hasSameDocumentNavigation) {\n this._sameDocumentNavigationCompleteCallback()\n }\n if (this._frame._loaderId !== this._initialLoaderId) {\n this._newDocumentNavigationCompleteCallback()\n }\n }", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.5042627", "text": "attachedCallback() {}", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.5042627", "text": "attachedCallback() {}", "title": "" }, { "docid": "305469a7f8821888eaeb95310f684d2a", "score": "0.5033358", "text": "#fireRollUpConditionMet(){\n\t\tconst sources = [[],[],[],[]];\n\t\tfor (let i =2; i<6; i++){\n\t\t\tfor (let card of this.#cardPiles[i]){\n\t\t\t\tsources[i-2].push(card.id);\n\t\t\t}\n\t\t}\n\t\tconst destinations = [];\n\t\tfor (let i = 9 ;i <13; i++){\n\t\t\tlet endPile = this.#cardPiles[i];\n\t\t\tdestinations.push(endPile[endPile.length-1].id);\n\t\t}\n\t\t\n\t\tthis.dispatchEvent(new ModelRollUpEvent(sources, destinations))\n\t}", "title": "" }, { "docid": "45e73b1405fe7fb60b9b21b03afe199e", "score": "0.50043154", "text": "function isInitial(e) {\n return e && e._isInitial;\n}", "title": "" }, { "docid": "68c887b29b91f0b48a2d1f5f4e0ed091", "score": "0.49926463", "text": "checkCaseEvents(ending) {\n $player2.moveToPlayer();\n // stamina, sfx,fx , check auto-break cases ....\n //play audio ...\n $camera.moveToTarget($player,0)//$camera.moveToTarget(6);\n this.inCase.DataLink.playFX_landing();\n if(ending){\n !this.stopFromBadColorCase && this.inCase.DataLink.executeCaseType();\n this.stopFromBadColorCase = false; // reset\n } else {// if not endCase\n //check if autorised color in displacement huds\n if(this.inCase.DataLink._colorType !== 'white' && !$huds.displacement.diceColors.contains(this.inCase.DataLink._colorType)){\n $huds.displacement.setStamina(0);\n this.stopFromBadColorCase = true; // when stop from bad color case, dont allow recive bonus case eventType\n }else{\n $huds.displacement.addStamina(-1);\n }\n };\n }", "title": "" }, { "docid": "c567d85c35ebe55966d3db887a42ba74", "score": "0.49801517", "text": "function wheelElementCreated(element) {\n // if \"created\" hasn't been suspended: run created code\n if (!element.hasAttribute('suspend-created')) {\n\n }\n }", "title": "" }, { "docid": "b96fb16f4ea3e202508d56da61f1db1c", "score": "0.49739924", "text": "attached() {}", "title": "" }, { "docid": "b96fb16f4ea3e202508d56da61f1db1c", "score": "0.49739924", "text": "attached() {}", "title": "" }, { "docid": "77178801ad49adde5fb0ef19132bc1cd", "score": "0.49686232", "text": "start() {\n if (this._gameStatus !== GAME_STATUS.INIT && this._gameStatus !== GAME_STATUS.PAUSE)\n return false;\n\n if (this._gameStatus === GAME_STATUS.INIT) {\n this._newFigure();\n this._gameStatus = GAME_STATUS.WORK;\n return true;\n }\n\n if (this._gameStatus === GAME_STATUS.PAUSE) {\n this._gameStatus = GAME_STATUS.WORK;\n }\n }", "title": "" }, { "docid": "0bd9a3d3395e73b598a6e31277daaf34", "score": "0.4967222", "text": "attachedCallback () { }", "title": "" }, { "docid": "ee9193f90fb7dfb95f8c77a1ee1252ca", "score": "0.4952588", "text": "triggersCollisionEvent() { return this.hasCollisionEvent; }", "title": "" } ]
0c97578a6eca108f7fb2bc6dacc178d6
This is needed if the LanguageProvider gets languages from compendiums, since they require the game state to be ready.
[ { "docid": "c5fbf349400798079f0183404df6a12f", "score": "0.0", "text": "get requiresReady() {\n\t\treturn false;\n\t}", "title": "" } ]
[ { "docid": "a50ab2149340e28bd787eecb592d602e", "score": "0.6962232", "text": "async getLanguages() {\n\t\tconst replaceLanguages = game.settings.get(\"polyglot\", \"replaceLanguages\");\n\t\tif (CONFIG[game.system.id.toUpperCase()]?.languages) {\n\t\t\tif (replaceLanguages)\n\t\t\t\tCONFIG[game.system.id.toUpperCase()].languages = {};\n\t\t\tthis.languages = CONFIG[game.system.id.toUpperCase()].languages;\n\t\t}\n\t}", "title": "" }, { "docid": "491c0fbb7c9fd6b620752242ea7cfc54", "score": "0.6900012", "text": "initLanguage() {\r\n\t\tlet language = this.getUrlLanguage();\r\n\t\tif (typeof language !== 'string') {\r\n\t\t\tlanguage = this.getBrowserLanguage();\r\n\t\t}\r\n\t\tif (this.supported.indexOf(language) >= 0) {\r\n\t\t\tthis.lang = language;\r\n\t\t} else {\r\n\t\t\tconsole.warn(`Unsportted language: ${language}`);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "fa035cd0fcccd0ddc3226e2c265c94d0", "score": "0.6520146", "text": "function loadLanguages() {\n\t console.log('Load languages called.');\n\t\t$.getJSON(URLS.LANGUAGES).done(function(data){\n\t\t\tlanguages = data;\n\t\t\tapplyLangTemplate();\n\t\t\tlangChangeBinding();\n\t\t}).fail(function(){\n\t\t\t\tconsole.log('Fetch failed for categories');\n\t\t});\n\t}", "title": "" }, { "docid": "c8a4c4f8738c4927264d2f3879baf8e9", "score": "0.65043575", "text": "function loadLanguageLiterals() {\r\n\ttranslate('msgHomeDescription', true);\r\n\ttranslate('msgSelectEnvironment', true);\r\n\ttranslate('msgSelectEnvironmentOption', true);\r\n\ttranslate('msgSelectUser', true);\r\n\ttranslate('msgSelectCredsOption', true);\r\n\ttranslate('msgSlaHome', true);\r\n\ttranslate('msgLoginInject', true);\r\n\ttranslate('msgSettings', true);\r\n\ttranslate('msgMoreOptions', true);\r\n\ttranslate('msgCleanData', true);\r\n\ttranslate('msgChangeLang', true);\r\n\ttranslate('msgHelp', true);\r\n\ttranslate('msgExportSettings', true);\r\n\ttranslate('msgExportToFile', true);\r\n\ttranslate('msgExportToClipboard', true);\r\n\ttranslate('msgImportSettings', true);\r\n\ttranslate('msgImportFromFile', true);\r\n\ttranslate('msgSuggestComms', true);\r\n\ttranslate('msgContact', true);\r\n\ttranslate('msgGithubFork', true);\r\n\ttranslate('msgAbout', true);\r\n\ttranslate('msgAboutContent1', true);\r\n\ttranslate('msgAboutContent2', true);\r\n\ttranslate('msgAboutContent3', true);\r\n\ttranslate('msgAboutContent4', true);\r\n}", "title": "" }, { "docid": "3aa42296a56822590ce16a95c16da7e3", "score": "0.6466398", "text": "getAvailableLanguages() {\n if (!this._availableLanguages) {\n this._availableLanguages = [];\n Object.keys(this._props).forEach(key => {\n this._availableLanguages.push(key);\n });\n }\n return this._availableLanguages;\n }", "title": "" }, { "docid": "12abb07fbb2930eee45d13f2f6fa6aff", "score": "0.64569134", "text": "function onLanguageLoaded() {\n // check, if there is a language setting in the local storage\n var lang = JSGDemo.utils.Storage.load('language');\n if (!lang) {\n lang = window.navigator.userLanguage || window.navigator.language;\n }\n if (lang) {\n JSGDemo.lang = lang;\n }\n\n // if a URL parameter was set for the language, use this one \n lang = JSGDemo.getURLParameters('lang');\n if (lang) {\n JSGDemo.lang = lang;\n }\n //JSGDemo.lang = \"zh_CN\";\n // load language string and EXT locales based on settings\n switch (JSGDemo.lang) {\n case \"de\":\n case \"de-CH\":\n case \"de-AT\":\n case \"de-DE\":\n JSGDemo.lang = \"de\";\n JSGDemo.resourceProvider = new JSGDemo.German();\n Loader.addScript(\"ext-lang-de.js\", EXT_HOME + \"/locale\");\n break;\n case \"zh_CN\":\n \tJSGDemo.lang = \"zh_CN\";\n JSGDemo.resourceProvider = new JSGDemo.German();\n \tLoader.addScript(\"ext-lang-zh_CN.js\", EXT_HOME + \"/locale\");\n \tbreak;\n default:\n JSGDemo.lang = \"en\";\n JSGDemo.resourceProvider = new JSGDemo.Default();\n Loader.addScript(\"ext-lang-en.js\", EXT_HOME + \"/locale\");\n break;\n }\n\n // set the library to show initially \n var activeRepository = JSGDemo.getURLParameters('library');\n if (activeRepository !== undefined) {\n JSGDemo.activeRepository = activeRepository;\n }\n}", "title": "" }, { "docid": "f1e5db1a8ac736065315f9eaec88b852", "score": "0.64413774", "text": "defineComponents () {\n new Language();\n }", "title": "" }, { "docid": "b628c4b82f5cd95cf7944adc98a2a3f5", "score": "0.63857746", "text": "function langset() {}", "title": "" }, { "docid": "cdecfc6bf038b4aa15af922fd60a3dec", "score": "0.63319796", "text": "_checkLanguage () {\n\t\tif (this.opts.language && !Object.prototype.hasOwnProperty.call(prism.languages, this.opts.language)) {\n\t\t\tthrowError(`The language ${this.opts.language} is not supported. Please contact Origami if you would like to have it added.`);\n\t\t}\n\t}", "title": "" }, { "docid": "afe06391588bd3a40e5c7fcd3cfd161d", "score": "0.6275547", "text": "function Language(lang){var __construct=function(){\"undefined\"==eval(\"typeof \"+lang)&&(lang=\"tr\")}();this.getStr=function(str,defaultStr){var retStr=eval(\"eval(lang).\"+str);return\"undefined\"!=typeof retStr?retStr:\"undefined\"!=typeof defaultStr?defaultStr:eval(\"en.\"+str)}}", "title": "" }, { "docid": "7bdcc0774a0d53c28b649ed80091437f", "score": "0.62627864", "text": "init(defaultLanguage, supportedLanguages) {\n this.defaultLanguage = defaultLanguage;\n this.supportedLanguages = supportedLanguages;\n this.language = \"\";\n // Warning: this subscription will always be alive for the app's lifetime\n this.langChangeSubscription = this.translateService.onLangChange.subscribe(\n (event) => {\n localStorage.setItem(languageKey, event.lang);\n }\n );\n }", "title": "" }, { "docid": "660b5906963f0f12069929f6487def1b", "score": "0.62578726", "text": "loadTongues() {\n\t\tconst replaceLanguages = game.settings.get(\"polyglot\", \"replaceLanguages\");\n\t\tconst customLanguages = game.settings.get(\"polyglot\", \"customLanguages\");\n\t\tconst comprehendLanguages = game.settings.get(\"polyglot\", \"comprehendLanguages\");\n\t\tconst truespeech = game.settings.get(\"polyglot\", \"truespeech\");\n\t\tthis.tongues = !replaceLanguages ? this.originalTongues : {\"_default\": this.originalTongues[\"_default\"]};\n\t\tif (customLanguages) {\n\t\t\tfor (let lang of customLanguages.split(/[,;]/)) {\n\t\t\t\tlang = lang.trim();\n\t\t\t\tthis.addLanguage(lang);\n\t\t\t}\n\t\t}\n\t\tif (comprehendLanguages && !customLanguages.includes(comprehendLanguages)) {\n\t\t\tthis.addLanguage(comprehendLanguages);\n\t\t}\n\t\tif (truespeech && !customLanguages.includes(truespeech)) {\n\t\t\tthis.addLanguage(truespeech);\n\t\t}\n\t}", "title": "" }, { "docid": "6f6c997befa10bdfd32703575e74bce3", "score": "0.6236096", "text": "function _getPreferredLanguagesFor() {\n _getPreferredLanguagesFor = (0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(person) {\n var _store$fetcher;\n var doc, list, languageCodeArray;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n doc = person.doc();\n _context.next = 3;\n return (_store$fetcher = _solidLogic.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.load(doc);\n case 3:\n list = _solidLogic.store.any(person, ns.schema('knowsLanguage'), null, doc);\n if (list) {\n _context.next = 6;\n break;\n }\n return _context.abrupt(\"return\", defaultPreferredLanguages);\n case 6:\n languageCodeArray = [];\n list.elements.forEach(function (item) {\n // console.log('@@ item ' + item)\n var lang = _solidLogic.store.any(item, ns.solid('publicId'), null, doc);\n if (!lang) {\n console.warn('getPreferredLanguages: No publiID of language.');\n return;\n }\n if (!lang.value.startsWith(languageCodeURIBase)) {\n console.error(\"What should be a language code \".concat(lang.value, \" does not start with \").concat(languageCodeURIBase));\n return;\n }\n var code = lang.value.slice(languageCodeURIBase.length);\n languageCodeArray.push(code);\n });\n if (!(languageCodeArray.length > 0)) {\n _context.next = 11;\n break;\n }\n console.log(\" User knows languages with codes: \\\"\".concat(languageCodeArray.join(','), \"\\\"\"));\n return _context.abrupt(\"return\", addDefaults(languageCodeArray));\n case 11:\n return _context.abrupt(\"return\", null);\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _getPreferredLanguagesFor.apply(this, arguments);\n}", "title": "" }, { "docid": "3d139262b7a42e4bcb2837e008662ea5", "score": "0.6234109", "text": "getCurrentLanguage(val){return this.language[this.currentLocale][val]}", "title": "" }, { "docid": "de5e80b4d16731a5a6230310497b9724", "score": "0.62189925", "text": "function switchLanguage() {\r\nswitch (TB3O.language) {\r\ncase \"hu\":\r\n//by geo.\r\nxLang['ALLIANCE'] = 'Klán';\r\nxLang['SIM'] = 'Harc szimulátor';\r\nxLang['AREYOUSURE'] = 'Biztos vagy benne?';\r\nxLang['LOSS'] = 'Veszteség';\r\nxLang['PROFIT'] = 'Nyereség';\r\nxLang['EXTAV'] = 'Fejlesztés elérheto';\r\nxLang['PLAYER'] = 'Játékos';\r\nxLang['VILLAGE'] = 'Falu';\r\nxLang['POPULATION'] = 'Népesség';\r\nxLang['COORDS'] = 'Koordináták';\r\nxLang['MAPTBACTS'] = 'Mozgás:';\r\nxLang['SAVED'] = 'Mentve';\r\nxLang['YOUNEED'] = 'Kell';\r\nxLang['TODAY'] = 'ma';\r\nxLang['TOMORROW'] = 'holnap';\r\nxLang['PAS_MANYANA'] = 'holnapután';\r\nxLang['MARKET'] = 'Piac';\r\nxLang['BARRACKS'] = 'Kaszárnya';\r\nxLang['RALLYPOINT'] = 'Gyülekezotér';\r\nxLang['STABLE'] = 'Istálló';\r\nxLang['WORKSHOP'] = 'Muhely';\r\nxLang['SENDRES'] = 'Nyersanyag küldése';\r\nxLang['COMPRAR'] = 'Vétel';\r\nxLang['SELL'] = 'Eladás';\r\nxLang['SENDIGM'] = 'Üzenet küldése';\r\nxLang['LISTO'] = 'Elérheto';\r\nxLang['ON'] = 'ezen a napon:';\r\nxLang['A_LAS'] = 'ekkor:';\r\nxLang['EFICIENCIA'] = 'Hatékonyság';\r\nxLang['NEVER'] = 'Soha';\r\nxLang['ALDEAS'] = 'Falvak';\r\nxLang['TIEMPO'] = 'Ido';\r\nxLang['OFREZCO'] = 'Felajánlás';\r\nxLang['BUSCO'] = 'Keresés';\r\nxLang['TIPO'] = 'Típus';\r\nxLang['DISPONIBLE'] = 'Csak elfogadhatót';\r\nxLang['CUALQUIERA'] = 'Mind';\r\nxLang['YES'] = 'Igen';\r\nxLang['NO'] = 'Nem';\r\nxLang['LOGIN'] = 'Bejelentkezés';\r\nxLang['MARCADORES'] = 'Könyvjelzok';\r\nxLang['ANYADIR'] = 'Hozzáad';\r\nxLang['ENLACE'] = 'Könyvjelzo URL';\r\nxLang['TEXTO'] = 'Könyvjelzo szövege';\r\nxLang['ELIMINAR'] = 'Törlés';\r\nxLang['MAPA'] = 'Térkép';\r\nxLang['MAXTIME'] = 'Maximum ido';\r\nxLang['ARCHIVE'] = 'Archívum';\r\nxLang['SUMMARY'] = 'Összefoglalás';\r\nxLang['TROPAS'] = 'Egységek';\r\nxLang['CHECKVERSION'] = 'TBeyond frissítése';\r\nxLang['ACTUALIZAR'] = 'Falu információ frissítése';\r\nxLang['VENTAS'] = 'Mentett ajánlatok';\r\nxLang['MAPSCAN'] = 'Térkép vizsgálata';\r\nxLang['BIGICONS'] = 'Bovített ikonok';\r\nxLang['SAVE'] = 'Mentés';\r\nxLang['RPDEFACT'] = 'Gyülekezotér alapmuvelet';\r\nxLang['ATTACKTYPE2'] = 'Támogatás';\r\nxLang['ATTACKTYPE3'] = 'Normál támadás';\r\nxLang['ATTACKTYPE4'] = 'Rablótámadás';\r\nxLang['SHOWCENTERNUMBERS'] = 'Épület szintek mutatása';\r\nxLang['NPCSAVETIME'] = 'Spórolsz: ';\r\nxLang['SHOWCOLORRESLEVELS'] = 'Külterület színjelzése';\r\nxLang['SHOWCOLORBUILDLEVELS'] = 'Épületek színjelzése';\r\nxLang['CNCOLORNEUTRAL'] = 'Szín, ha fejlesztheto<br>(az alaphoz hagyd üresen)';\r\nxLang['CNCOLORMAXLEVEL'] = 'Szín, ha teljesen ki van építve<br>(az alaphoz hagyd üresen)';\r\nxLang['CNCOLORNOUPGRADE'] = 'Szín, ha nem elérheto a fejlesztés<br>(az alaphoz hagyd üresen)';\r\nxLang['CNCOLORNPCUPGRADE'] = 'Szín, ha NPC-vel fejlesztheto<br>(az alaphoz hagyd üresen)';\r\nxLang['TOTALTROOPS'] = 'A faluban képzett egységek';\r\nxLang['SHOWBOOKMARKS'] = 'Könyvjelzok mutatása';\r\nxLang['RACECRTV2'] = 'Nép';\r\nxLang['SERVERVERSION2'] = \"Travian v2.x kiszolgáló\";\r\nxLang['SELECTALLTROOPS'] = \"Minden egység kiválasztása\";\r\nxLang['PARTY'] = \"Ünnepségek\";\r\nxLang['CPPERDAY'] = \"KP/nap\";\r\nxLang['SLOT'] = \"Hely\";\r\nxLang['TOTAL'] = \"Teljes\";\r\nxLang['NOPALACERESIDENCE'] = \"Nincs rezidencia vagy palota a faluban, vagy a faluközpont még nincs megnyitva!\";\r\nxLang['SELECTSCOUT'] = \"Kémek kiválasztása\";\r\nxLang['SELECTFAKE'] = \"Fake kiválasztása\";\r\nxLang['NOSCOUT2FAKE'] = \"Nem használhatsz kémeket fake támadásra!\";\r\nxLang['NOTROOP2FAKE'] = \"Nincsenek egységek fake támadáshoz!\";\r\nxLang['NOTROOP2SCOUT'] = \"Nincsenek egységek kémleléshez!\";\r\nxLang['NOTROOPS'] = \"Nincsenek egységek a faluban!\";\r\nxLang['ALL'] = \"Mind\";\r\nxLang['COLORHELP'] = \"A színeket így add meg:<br>- green vagy red vagy orange stb.<br>- vagy HEX színkóddal #004523<br>- hagyd üresen az alapértelmezett színhez\";\r\nxLang['SHOWORIGREPORT'] = \"Eredeti jelentés (küldéshez)\";\r\nxLang['SHOWCELLTYPEINFO'] = \"Mezo-típus, oázis infó mutatása<br>az egérmutató alatt\";\r\nxLang['WARSIM'] = \"Harcszimulátor link:<br>(bal oldali menü)\";\r\nxLang['WARSIMOPTION1'] = \"Beépített\";\r\nxLang['WARSIMOPTION2'] = \"Külso (kirilloid.ru által)\";\r\nxLang['WSANALYSER'] = \"World Analyser választása\";\r\nxLang['SHOWSTATLINKS'] = \"Linkek a statisztika elemzohöz\";\r\nxLang['NONEWVER'] = \"A legújabb verziót használod\";\r\nxLang['BVER'] = \"Lehet hogy BETA verziód van\";\r\nxLang['NVERAV'] = \"A szkript új verziója elérheto\";\r\nxLang['UPDATESCRIPT'] = \"Frissíted most?\";\r\nxLang['CHECKUPDATE'] = \"Szkript-frissítés keresése. Kérlek várj...\";\r\nxLang['CROPFINDER'] = \"Búzakereso\";\r\nxLang['AVPOPPERVIL'] = \"Falunkénti átlag népesség\";\r\nxLang['AVPOPPERPLAYER'] = \"Játékosonkénti átlag népesség\";\r\nxLang['SHOWRESUPGRADETABLE'] = \"Külterület fejlesztési táblája\";\r\nxLang['SHOWBUPGTABLE'] = \"Épületek fejlesztési táblája\";\r\nxLang['CONSOLELOGLEVEL'] = \"Konzol naplózási szint<br>CSAK PROGRAMOZÓKNAK VAGY HIBAKERESÉSHEZ<br>(Alap = 1)\";\r\nxLang['MARKETPRELOAD'] = \"Piaci ajánlatoknál több oldal elore betöltése<br>A Piac -Vásárlás- oldalán<br>(Alap = 1)\";\r\nxLang['CAPITAL'] = 'Fofalud neve<br><a href=\"spieler.php\">Nézd meg a profilodat a frissítéshez</a>';\r\nxLang['CAPITALXY'] = 'Fofalud koordinátái<br><a href=\"spieler.php\">Nézd meg a profilodat a frissítéshez</a>';\r\nxLang['MAX'] = 'Max';\r\nxLang['TOTALTROOPSTRAINING'] = 'Összes kiképzés alatt álló egység';\r\nxLang['SHOWDISTTIMES'] = 'Távolság/ido mutatása';\r\nxLang['TBSETUPLINK'] = TB3O.shN + ' Beállítások';\r\nxLang['UPDATEALLVILLAGES'] = 'Minden falu frissítése. HASZNÁLD ÓVATOSAN, TILTÁS JÁRHAT ÉRTE!';\r\nxLang['SHOWMENUSECTION3'] = \"További linkek bal oldalon<br>(Traviantoolbox, World Analyser, Travilog, Térkép, stb.)\";\r\nxLang['LARGEMAP'] = 'Nagy térkép';\r\nxLang['USETHEMPR'] = 'Arányos elosztás';\r\nxLang['USETHEMEQ'] = 'Egyenlo elosztás';\r\nxLang['TOWNHALL'] = 'Tanácsháza';\r\nxLang['GAMESERVERTYPE'] = 'Játék kiszolgáló';\r\nxLang['ACCINFO'] = 'Felhasználó információ';\r\nxLang['MENULEFT'] = 'Baloldali menü';\r\nxLang['STATISTICS'] = 'Statisztikák';\r\nxLang['RESOURCEFIELDS'] = 'Külterület';\r\nxLang['VILLAGECENTER'] = 'Faluközpont';\r\nxLang['MAPOPTIONS'] = 'Térkép beállítások';\r\nxLang['COLOROPTIONS'] = 'Szín beállítások';\r\nxLang['DEBUGOPTIONS'] = 'Hibakeresési beállítások';\r\nxLang['SHOWBIGICONMARKET'] = 'Piac';\r\nxLang['SHOWBIGICONMILITARY'] = 'Gyülekezotér/Kaszárnya/Muhely/Istálló';\r\nxLang['SHOWBIGICONMILITARY2'] = \"Tanácsháza/Hosök háza/Páncélkovács/Fegyverkovács\";\r\nxLang['HEROSMANSION'] = \"Hosök háza\";\r\nxLang['BLACKSMITH'] = 'Fegyverkovács';\r\nxLang['ARMOURY'] = 'Páncélkovács';\r\nxLang['NOW'] = 'Most';\r\nxLang['CLOSE'] = 'Bezárás';\r\nxLang['USE'] = 'Használat';\r\nxLang['USETHEM1H'] = 'Egy órai termelés';\r\nxLang['OVERVIEW'] = 'Áttekintés';\r\nxLang['FORUM'] = 'Fórum';\r\nxLang['ATTACKS'] = 'Támadások';\r\nxLang['NEWS'] = 'Hírek';\r\nxLang['ADDCRTPAGE'] = 'Jelenlegi hozzáadása';\r\nxLang['SCRIPTPRESURL'] = 'TBeyond oldal';\r\nxLang['NOOFSCOUTS'] = 'Kémek száma a<br>\"Kémek választása\" funkcióhoz';\r\nxLang['SPACER'] = 'Elválasztó';\r\nxLang['SHOWTROOPINFOTOOLTIPS'] = 'Egység információ mutatása gyorstippben';\r\nxLang['MESREPOPTIONS'] = 'Üzenetek & Jelentések';\r\nxLang['MESREPPRELOAD'] = 'Üzenetek/jelentések elore betöltött oldalainak száma<br>(Default = 1)';\r\nxLang['ATTABLES'] = 'Egység tábla';\r\nxLang['MTWASTED'] = 'Elpazarolva';\r\nxLang['MTEXCEED'] = 'Meghaladja';\r\nxLang['MTCURRENT'] = 'Jelenlegi rakomány';\r\nxLang['ALLIANCEFORUMLINK'] = 'Link külso fórumhoz<br>(belsohöz hagyd üresen)';\r\nxLang['LOCKBOOKMARKS'] = 'Könyvjelzok lezárása<br>(Törlés és mozgatás ikonok eltüntetése)';\r\nxLang['MTCLEARALL'] = 'Mindet törölni';\r\nxLang['UNLOCKBOOKMARKS'] = 'Könyvjelzok feloldása<br>(Törlés és mozgatás ikonok mutatása)';\r\nxLang['CLICKSORT'] = 'Rendezéshez kattints';\r\nxLang['MIN'] = 'Min';\r\nxLang['SAVEGLOBAL'] = 'Minden faluhoz menteni';\r\nxLang['VILLAGELIST'] = 'Falu lista';\r\nxLang['SHOWINOUTICONS'] = \"'dorf1.php' és 'dorf2.php' linkek mutatása\";\r\nxLang['UPDATEPOP'] = 'Népesség frissítése';\r\nxLang['SHOWRPRINFOTOOLTIPS'] = 'Távolság és ido mutatása falvakhoz<br>(Gyülekezotér & Jelentések)';\r\nxLang['EDIT'] = 'Szerkesztés';\r\nxLang['NPCOPTIONS'] = 'NPC segíto beállításai';\r\nxLang['NPCASSISTANT'] = 'NPC segíto számítások és linkek mutatása';\r\nxLang['SHOWMAPTABLE'] = 'Játékosok/falvak/oázisok mutatása a térképnél';\r\nxLang['NEWVILLAGEAV'] = 'Dátum/Ido';\r\nxLang['TIMEUNTIL'] = 'Várakozás';\r\nxLang['SHOWREPDELTABLE'] = '\"Mindet törölni\" mutatása a jelentésekhez';\r\nxLang['SHOWIGMLINKFORME'] = '\"Üzenet küldése\" mutatása magam részére is';\r\nxLang['CENTERMAP'] = 'Térkép középpontjába ezt a falut';\r\nxLang['SHOWCENTERMAPICON'] = 'Mutasd a \"Térkép központosítása\" ikont';\r\nxLang['SENDTROOPS'] = 'Kiküldés';\r\nxLang['SHOWBRSTATDETAILS'] = 'Jelentés statisztika részletezése';\r\nxLang['SHOWBIGICONMISC'] = \"Palota/Rezidencia/Akadémia/Kincstár\";\r\nxLang['PALACE'] = \"Palota\";\r\nxLang['RESIDENCE'] = \"Rezidencia\";\r\nxLang['ACADEMY'] = \"Akadémia\";\r\nxLang['TREASURY'] = \"Kincstár\";\r\nxLang['SHOWBBLINK'] = \"Villogó szintjelzés az éppen fejlesztett épületekhez\";\r\nxLang['SHOWMESOPENLINKS'] = 'Linkek az üzenetek felugró ablakban mutatásához';\r\nbreak;\r\n}\r\n}", "title": "" }, { "docid": "df619a339b420042d1268639292b1712", "score": "0.62099266", "text": "function loadLanguage() {\n\n\tvar hash = window.location.hash;\n\n\tif (hash == '#l=en') {\n\t\tlangtoggle('en')\n\t}\n\telse {\n\t\tlangtoggle('fr')\n\t}\n}", "title": "" }, { "docid": "7ce492272c45323b86573fc598e4674d", "score": "0.6154075", "text": "function loaderLanguage(){\r\n var language = getCookie();\r\n if(language === \"spanish\"){\r\n screenLoaderSpanish();\r\n }\r\n else if(language === \"maya\"){\r\n screenLoaderMaya();\r\n }\r\n else{\r\n return 0;\r\n }\r\n}", "title": "" }, { "docid": "310558f5c7ca415bf91655353154097e", "score": "0.614583", "text": "supportedLanguages() {\n return this.getPromise('supported-languages');\n }", "title": "" }, { "docid": "58f9d2a9505f5a8519635f017bb2d149", "score": "0.61433893", "text": "function loadLanguage() {\n if (!localStorage.getItem(\"lang\") || localStorage.getItem(\"lang\") == \"undefined\")\n localStorage.setItem(\"lang\", 'en');\n\n switch (localStorage.getItem(\"lang\")) {\n case 'fi':\n $(\"#curLang\").html('<span class=\"flag-icon flag-icon-fi\"></span> FI<span class=\"caret\"></span>');\n break;\n case 'en':\n $(\"#curLang\").html('<span class=\"flag-icon flag-icon-us\"></span> EN<span class=\"caret\"></span>');\n break;\n case 'ja':\n $(\"#curLang\").html('<span class=\"flag-icon flag-icon-jp\"></span> JP<span class=\"caret\"></span>');\n break;\n }\n\n $.i18n.properties({\n name: 'PlayTalkWin',\n path: '/localization/',\n mode: 'both',\n async: true,\n cache: true,\n language: localStorage.getItem(\"lang\"),\n callback: function () {\n // Frontpage\n $(\"#fp_games\").text(fp_games);\n $(\".fp_click2play\").text(fp_click2play);\n $(\"#fp_starttoday\").text(fp_starttoday);\n $(\"#fp_sponsors\").text(fp_sponsors);\n $(\"#fp_createaccount\").text(fp_createaccount);\n $(\"#fp_createaccount_text\").text(fp_createaccount_text);\n $(\"#fp_playgames\").text(fp_playgames);\n $(\"#fp_playgames_text\").text(fp_playgames_text);\n $(\"#fp_refer\").text(fp_refer);\n $(\"#fp_refer_text\").text(fp_refer_text);\n $(\"#fp_spendcoins\").text(fp_spendcoins);\n $(\"#fp_spendcoins_text\").text(fp_spendcoins_text);\n $(\"#slider_challenge\").text(slider_challenge);\n $(\"#slider_challenge_text\").text(slider_challenge_text);\n $(\"#slider_buyprizes\").text(slider_buyprizes);\n $(\"#slider_buyprizes_text\").text(slider_buyprizes_text);\n $(\"#slider_playgames\").text(slider_playgames);\n $(\"#slider_playgames_text\").text(slider_playgames_text);\n $(\"#fp_createaccount_btn\").text(fp_createaccount_btn);\n $(\"#fp_playgame_btn\").text(fp_playgame_btn);\n $(\"#fp_refer_btn\").text(fp_refer_btn);\n $(\"#fp_shop_btn\").text(fp_shop_btn);\n $(\".fp_learnmore_btn\").text(fp_learnmore_btn);\n // Referral Modal\n $(\"#refer_title\").text(refer_title);\n $(\"#refer_desc\").text(refer_desc);\n $(\"#refer_submit_btn\").val(refer_submit_btn);\n $(\"#refer_name\").attr('placeholder', form_name);\n $(\"#refer_name\").attr('title', form_valid_name);\n $(\"#refer_email\").attr('placeholder', form_email);\n $(\"#refer_email\").attr('title', form_valid_email);\n // Navbar\n $(\"#navbar_home\").text(navbar_home);\n $(\"#navbar_shop\").text(navbar_shop);\n $(\"#navbar_profile\").text(navbar_profile);\n $(\"#navbar_community\").text(navbar_community);\n $(\"#navbar_signin\").text(navbar_signin);\n $(\"#navbar_signup\").text(navbar_signup);\n $(\"#navbar_logout\").text(navbar_logout);\n // Games\n $(\"#game_yourscore\").text(game_yourscore);\n $(\"#game_yourhighscore\").text(game_yourhighscore);\n $(\"#game_start\").text(game_start);\n $(\"#snake_desc\").text(snake_desc);\n $(\"#flappy_desc\").text(flappy_desc);\n $(\"#reaction_desc\").text(reaction_desc);\n $(\"#jumper_desc\").text(jumper_desc);\n //Chat\n $(\"#chat_send\").text(chat_send);\n $(\"#msgbox\").attr('placeholder', chat_write);\n $(\"#emoji_search\").attr('placeholder', chat_emoji);\n //Footer\n $(\"#footer_cc\").text(footer_cc);\n $(\"#footer_design\").text(footer_design);\n //Webstore\n $(\"#shop_prizes\").text(shop_prizes);\n $(\"#shop_trades\").text(shop_trades);\n $(\"#shop_giveinfo\").text(shop_giveinfo);\n $(\"#shop_name\").text(shop_name);\n $(\"#shop_cost\").text(shop_cost);\n $(\"#shop_imageurl\").text(shop_imageurl);\n $(\"#shop_product_desc\").text(shop_product_desc);\n $(\"#shop_stock\").text(shop_stock);\n $(\"#shop_amount\").text(shop_amount);\n $(\"#submitForm\").text(shop_add);\n $(\"#addProductButton\").text(shop_addproducts);\n $(\"#shop_contact\").text(shop_contact);\n $(\"#shop_phonenum\").text(shop_phonenum);\n $(\"#shop_location\").text(shop_location);\n $(\"#shop_livechat\").text(shop_livechat);\n $(\"#shop_needcoins\").text(shop_needcoins);\n $(\"#shop_desc1\").text(shop_desc1);\n $(\"#shop_desc2\").text(shop_desc2);\n //Trade\n $(\"#trade_new_heading\").text(trade_new_heading);\n $(\"#trade_giveinfo\").text(trade_giveinfo);\n $(\"#trade_product\").text(trade_product);\n $(\"#trade_orgcost\").text(trade_orgcost);\n $(\"#trade_description\").text(trade_description);\n $(\"#trade_sellingprice\").text(trade_sellingprice);\n $(\"#trade_product_desc\").text(trade_product_desc);\n $(\"#trade_submit_form\").text(trade_submit_form);\n $(\"#trade_add_button\").text(trade_add_button);\n $(\"#trade_manage_button\").text(trade_manage_button);\n $(\"#trade_noitems\").text(trade_noitems);\n $(\"#trade_myopentrades\").text(trade_myopentrades);\n $(\"#trade_mybuyinghistory\").text(trade_mybuyinghistory);\n $(\"#trade_mysellinghistory\").text(trade_mysellinghistory);\n //Profile\n $(\"#editprofilebuttontext\").text(profile_edit);\n //$(\"#editpicturebuttontext\").text(profile_changepic);\n $(\"#mycollectionbuttontext\").text(profile_collection);\n $(\"#profilehighscoretext\").text(profile_highscore);\n $(\"#lastonlinetext\").text(profile_lastonline);\n $(\"#lastloggedintext\").text(profile_lastlogged);\n $(\"#newuserstext\").text(profile_newusers);\n $(\"#memebersincetext\").text(profile_memebersince);\n $(\"#profile_collection\").text(profile_collection);\n $(\"#userfriendstext\").text(profile_friends);\n //Edit profile modal\n $(\"#editprofileheading\").text(profile_edit);\n $(\"#editprofilefirstname\").text(form_firstname);\n $(\"#editprofilelastname\").text(form_lastname);\n $(\"#editprofiledescription\").text(form_desc);\n $(\"#editprofilelocation\").text(form_location);\n $(\"#editprofileage\").text(form_birthday);\n $(\"#editprofilegender\").text(form_gender);\n $(\"#editprofilemale\").text(form_male);\n $(\"#editprofilefemale\").text(form_female);\n $(\"#editprofileother\").text(form_other);\n $(\"#editprofilepublic\").text(form_public);\n $(\"#editprofileprivate\").text(form_private);\n $(\"#gender-select\").text(form_select_am);\n $(\"#editprofilepicture\").text(form_changepicture);\n $(\"#saveprivateprofilebutton\").val(form_save);\n $(\"#savepublicprofilebutton\").val(form_save);\n $(\"#newpassword\").text(form_newpassword);\n $(\"#confirmpassword\").text(form_confirmpassword);\n $(\"#editprofilepassword\").text(form_editpassword);\n $(\"#savenewpassword\").val(form_save);\n\n //Edit picture modal\n //$(\"#editpictureheading\").text(profile_changepic);\n $(\"#uploadpicturebutton\").val(form_upload);\n //My friends modal\n $(\"#myfriendsheading\").text(profile_friends);\n $(\"#friendstabtext\").text(profile_friends);\n $(\"#friendrequeststabtext\").text(profile_requests);\n $(\"#pendingfriendstabtext\").text(profile_pending);\n //search\n $(\"#finduser\").text(profile_find);\n //General\n $(\".buttonText\").text(form_file);\n $(\".form_close_btn\").text(form_close_btn);\n $(\".form_dismiss_btn\").text(form_dismiss_btn);\n $(\".close_friends_btn\").text(form_dismiss_btn);\n $('.edit_name').attr('title', form_valid_name);\n $('.password_input').attr('title', form_valid_password);\n $('.form_required').attr('oninvalid', 'this.setCustomValidity(\"' + form_required + '\")');\n $('.form_required').attr('onchange', 'this.setCustomValidity(\"\")');\n\n if (typeof updateLogoutButton == 'function') updateLogoutButton();\n if (typeof generateProducts == 'function') generateProducts();\n if (typeof cookieMessage == 'function') cookieMessage();\n if (typeof createCollection == 'function') createCollection();\n if (typeof getTradeManageInfo == 'function') getTradeManageInfo();\n }\n });\n}", "title": "" }, { "docid": "c8f48d2b12d63839fc7cba3840b009e7", "score": "0.61383164", "text": "reloadLanguages() {\n\t\tlet langSettings = game.settings.get(\"polyglot\", \"Languages\");\n\t\tif (this.tongues == langSettings) return;\n\t\tfor (let lang in langSettings) {\n\t\t\tif (!(lang in this.tongues)) {\n\t\t\t\tdelete langSettings[lang];\n\t\t\t\tthis.removeFromConfig(lang);\n\t\t\t}\n\t\t}\n\t\tfor (let lang in this.tongues) {\n\t\t\tif (!(lang in langSettings)) {\n\t\t\t\tlangSettings[lang] = this.tongues[\"_default\"];\n\t\t\t}\n\t\t}\n\t\tthis.tongues = langSettings;\n\t}", "title": "" }, { "docid": "2fb7c63157c09b82e3f0d498a61c3993", "score": "0.61252123", "text": "getLanguages() {\n\t\treturn this.state.languages;\n\t}", "title": "" }, { "docid": "a60fe03a306e22cf84ede174a962d724", "score": "0.6121032", "text": "function getLanguageSupport() { return [\n { code: \"be\", international: \"Belarusian\", local: \"Беларуская мова\" },\n { code: \"bs\", international: \"Bosnian\", local: \"Bosanski jezik\" },\n { code: \"bg\", international: \"Bulgarian\", local: \"Български език\" },\n { code: \"cs\", international: \"Czech\", local: \"Čeština\" },\n { code: \"en\", international: \"English\", local: \"English\" },\n { code: \"fr\", international: \"French\", local: \"Français\" },\n { code: \"de\", international: \"German\", local: \"Deutsch\" },\n { code: \"el\", international: \"Greek\", local: \"Ελληνικά\" },\n { code: \"it\", international: \"Italian\", local: \"Italiano\" },\n { code: \"mk\", international: \"Macedonian\", local: \"Македонски јазик\" },\n { code: \"pl\", international: \"Polish\", local: \"Język polski\" },\n { code: \"pt\", international: \"Portuguese\", local: \"Português\" },\n { code: \"ro\", international: \"Romanian\", local: \"Română\" },\n { code: \"ru\", international: \"Russian\", local: \"Русский\" },\n { code: \"sr\", international: \"Serbian\", local: \"Српски језик\" },\n { code: \"sk\", international: \"Slovak\", local: \"Slovenčina\" },\n { code: \"sl\", international: \"Slovenian\", local: \"Slovenščina\" },\n { code: \"es\", international: \"Spanish\", local: \"Español\" },\n { code: \"sv\", international: \"Swedish\", local: \"Svenska\" },\n { code: \"uk\", international: \"Ukrainian\", local: \"Українська\" },\n]}", "title": "" }, { "docid": "263e5cb3955048367d529366807304ab", "score": "0.6109602", "text": "function getLaunguageCode() {\n var Langcode = window.navigator.userLanguage || window.navigator.language;\n /*loadScript('language/ja_JP.js', changeTextcontent);*/\n if (typeof Langcode === 'string') {\n if (Langcode.length === 0) {\n loadScript('language/en_US.js', changeTextcontent);\n }\n splitName = Langcode.toLowerCase().match('^([a-z]+)(-[a-z1-9]+)?$');\n if (splitName) {\n if (languageLookup[splitName[0]] != undefined) {\n loadScript(languageLookup[splitName[0]], changeTextcontent);\n } else if (languageLookup[splitName[1]] != undefined) {\n loadScript(languageLookup[splitName[1]], changeTextcontent);\n } else {\n loadScript('language/en_US.js', changeTextcontent);\n }\n }\n } else if (Langcode == null) {\n loadScript('language/en_US.js', changeTextcontent);\n }\n\n}", "title": "" }, { "docid": "b601a5e9af1a6c3269f7b5ecd3396d3f", "score": "0.61048216", "text": "loadLanguage()\n {\n var language;\n var languagePath = \"\";\n\n // checks current path first, then Omega path, using F_OK to catch permission issues\n if (this.isPath(this.conf.workingPath + this.conf.languageFileName,fs.F_OK) === true)\n {\n languagePath = this.conf.workingPath + this.conf.languageFileName;\n }\n else if (this.isPath(this.conf.omegaPath + this.conf.languageFileName,fs.F_OK) === true)\n {\n languagePath = this.conf.omegaPath + this.conf.languageFileName;\n }\n\n if (languagePath)\n {\n try\n {\n language = JSON.parse(fs.readFileSync(languagePath, 'utf8'));\n }\n catch (e)\n {\n language = \"\"; // invalid file\n this.log(\"Invalid or inaccessible language file \"+languagePath+\", skipping it...\\n\");\n }\n }\n\n if (language)\n {\n this.log(\"Using language file: \" + languagePath);\n this.language = language;\n }\n }", "title": "" }, { "docid": "3e813866e5a13803f52b8ad441338c5b", "score": "0.61031234", "text": "function checkAvailableLocales() {\n let currentLocale;\n const previousState = vscode.getState();\n if (previousState.localeSelection !== undefined && previousState.localeSelection !== LOADING) {\n currentLocale = previousState.localeSelection;\n }\n vscode.postMessage({\n message: CHECK_AVAILABLE_LOCALES,\n currentLocale: currentLocale,\n type: SIMULATOR_MESSAGE_TYPE.LOCALE,\n });\n}", "title": "" }, { "docid": "b5b62d6db73e48f4698100cd570df0ea", "score": "0.61026233", "text": "function _getPreferredLanguages() {\n _getPreferredLanguages = (0, _asyncToGenerator2[\"default\"])( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var me, solidLanguagePrefs;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return _solidLogic.authn.currentUser();\n case 2:\n me = _context2.sent;\n if (!me) {\n _context2.next = 9;\n break;\n }\n _context2.next = 6;\n return getPreferredLanguagesFor(me);\n case 6:\n solidLanguagePrefs = _context2.sent;\n if (!solidLanguagePrefs) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt(\"return\", solidLanguagePrefs);\n case 9:\n if (!(typeof navigator !== 'undefined')) {\n _context2.next = 14;\n break;\n }\n if (!navigator.languages) {\n _context2.next = 12;\n break;\n }\n return _context2.abrupt(\"return\", addDefaults(navigator.languages.map(function (longForm) {\n return longForm.split('-')[0];\n })));\n case 12:\n if (!navigator.language) {\n _context2.next = 14;\n break;\n }\n return _context2.abrupt(\"return\", addDefaults([navigator.language.split('-')[0]]));\n case 14:\n return _context2.abrupt(\"return\", defaultPreferredLanguages);\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _getPreferredLanguages.apply(this, arguments);\n}", "title": "" }, { "docid": "4c28234867ae39213a9ab1a33532c7c3", "score": "0.6083954", "text": "getDefaultLanguage() {\n\t\tconst defaultLang = game.settings.get(\"polyglot\", \"defaultLanguage\");\n\t\tif (defaultLang) {\n\t\t\tif (this.languages[defaultLang]) this.defaultLanguage = defaultLang;\n\t\t\tconst inverted = invertObject(this.languages);\n\t\t\tif (inverted[defaultLang]) this.defaultLanguage = inverted[defaultLang];\n\t\t}\n\t\telse {\n\t\t\tthis.defaultLanguage = this.getSystemDefaultLanguage();\n\t\t}\n\t}", "title": "" }, { "docid": "5a0ac7b1ae288d8e9608a80f89fc9d1f", "score": "0.6083634", "text": "function insertAvailableLanguages(el)\n{\n\tif (typeof(el) === \"undefined\" || el === null) { return; }\n\tvar codeBuffer = \"\";\n\t//NOTE: to make it easier, it does not change the hash (but in a deployment it probably should).\n\tfor (var languageCode in LANGUAGES_AVAILABLE)\n\t{\n\t\tcodeBuffer += '<a href=\"#\" id=\"language_' + languageCode + '\" onClick=\"localizeAll(\\'' + languageCode + '\\'); return false;\" class=\"language\">' + LANGUAGES_AVAILABLE[languageCode] + '</a>'; //Faster than using createElement.\n\t}\n\tel.innerHTML = codeBuffer;\n}", "title": "" }, { "docid": "b8dc348c5e51d6e142e193e56c306735", "score": "0.6078488", "text": "function langCallBack( event) {\r\n\t// sur tous les menus\r\n\tpageTranslate();\r\n\t// sur tous les modules\r\n\t_apps.forEach( function( app) {\r\n\t\tapp.translate();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "6bd0c393d950ffed0c5ba479430452e9", "score": "0.6062273", "text": "function load_language_api() {\n if (typeof(google) != \"undefined\") {\n google.load(\"language\", \"1\", {callback: translate_label});\n } \n}", "title": "" }, { "docid": "388bc15f72c866916715a6d78c7f594a", "score": "0.6044313", "text": "constructor () {\r\n let dir = path.join(__dirname, '../i18n/lang');\r\n if (!fs.existsSync(dir)) {\r\n dir = path.join(__dirname, 'i18n/lang');\r\n }\r\n const defaultLocale = path.join(dir, 'zh.i18n.json');\r\n this.loadedLanguage = JSON.parse(fs.readFileSync(defaultLocale, 'utf8'));\r\n const locale = path.join(dir, `${eApp.getLocale()}.i18n.json`);\r\n if (fs.existsSync(locale)) {\r\n const lang = JSON.parse(fs.readFileSync(locale, 'utf8'));\r\n this.loadedLanguage = Object.assign(this.loadedLanguage, lang);\r\n }\r\n }", "title": "" }, { "docid": "56b10b56eb22cad0306c76ed8a994dbe", "score": "0.6042962", "text": "setLanguages(languages) {\n // to be overloaded by subclasses\n }", "title": "" }, { "docid": "3b31eb7a191d7a20ca7d8fe08ebd6296", "score": "0.6028191", "text": "function setUsedLang() {\n\tconst systemLangNoRegion = systemLang.split('-')[0];\n\tconst defaultTranslations = ALL_TRANSLATIONS[DEFAULT_LANG];\n\n\tif (systemLangNoRegion in ALL_TRANSLATIONS) {\n\t\t// Use system language if translations are available\n\t\tlang = systemLang;\n\t\tlangNoRegion = systemLangNoRegion;\n\t\ttranslations = {\n\t\t\t...defaultTranslations,\n\t\t\t...ALL_TRANSLATIONS[langNoRegion]\n\t\t};\n\t} else {\n\t\t// Otherwise, fall back to default language\n\t\tlang = DEFAULT_LANG;\n\t\tlangNoRegion = DEFAULT_LANG;\n\t\ttranslations = defaultTranslations;\n\t}\n}", "title": "" }, { "docid": "e2510a1510ccc1ad1983721d7a569dda", "score": "0.60157126", "text": "function updateLanguages() {\n getLanguagesData(function(data) {\n runQuery(\"update\", \"languages\", data, false, true);\n });\n}", "title": "" }, { "docid": "04b2e92a75e30f7cb39fefe66f583bc2", "score": "0.5991221", "text": "function wlCommonInit(){\n $('#languages').bind('change', languageChanged);\n\n\tnavigator.globalization.getLocaleName(\n \tfunction (localeValue) {\n\t\t\tWL.Logger.debug(\">> Detected locale: \" + localeValue.value);\n\t\t\t\n\t\t\tif (locale.indexOf(\"en\",2)!=-1) languageChanged(\"english\");\n\t\t\tif (locale.indexOf(\"fr\",2)!=-1) languageChanged(\"french\");\n\t\t\tif (locale.indexOf(\"ru\",2)!=-1) languageChanged(\"russian\");\n\t\t\tif (locale.indexOf(\"he\",2)!=-1) languageChanged(\"hebrew\");\n\t\t\tif (locale.indexOf(\"ce\",2)!=-1) languageChanged(\"creole\");\n\t\t\tif (locale.indexOf(\"sp\",2)!=-1) languageChanged(\"spanish\");\n\t\t\t\n\t\t},\n \tfunction() {\n\t\t\tWL.Logger.debug(\">> Unable to detect locale.\");\n\t\t}\n\t);\n\t\n\tnavigator.globalization.getPreferredLanguage(\n \tfunction (langValue) {\n\t\t\tlang = langValue.value;\n\t\t\tWL.Logger.debug(\">> Detected language: \" + langValue.value);\n\t\t},\n \tfunction() {\n\t\t\tWL.Logger.debug(\">> Unable to detect language.\");\n\t\t}\n\t);\n}", "title": "" }, { "docid": "8373b6063f60d8b2fedc4326e88f3e94", "score": "0.599057", "text": "function loadEnglish(){\r\n}", "title": "" }, { "docid": "345f16856ffb22da9f6d83fac120023e", "score": "0.5983787", "text": "get isSupportedLanguage() {\n return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang) > -1;\n }", "title": "" }, { "docid": "52dd7332a2755a907de92c7cbc7bfe4b", "score": "0.59626174", "text": "function displaySourceLang(source) {\n const languages = {\n az: \"Azerbaijan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n en: \"English\",\n ar: \"Arabic\",\n hy: \"Armenian\",\n af: \"Afrikaans\",\n eu: \"Basque\",\n ba: \"Bashkir\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n my: \"Burmese\",\n bg: \"Bulgarian\",\n bs: \"Bosnian\",\n cy: \"Welsh\",\n hu: \"Hungarian\",\n vi: \"Vietnamese\",\n ht: \"Haitian (Creole)\",\n gl: \"Galician\",\n nl: \"Dutch\",\n mrj: \"Hill Mari\",\n el: \"Greek\",\n ka: \"Georgian\",\n gu: \"Gujarati\",\n da: \"Danish\",\n he: \"Hebrew\",\n yi: \"Yiddish\",\n id: \"Indonesian\",\n ga: \"Irish\",\n it: \"Italian\",\n is: \"Icelandic\",\n es: \"Spanish\",\n kk: \"Kazakh\",\n kn: \"Kannada\",\n ca: \"Catalan\",\n ky: \"Kyrgyz\",\n zh: \"Chinese\",\n ko: \"Korean\",\n xh: \"Xhosa\",\n km: \"Khmer\",\n lo: \"Laotian\",\n la: \"Latin\",\n lv: \"Latvian\",\n lt: \"Lithuanian\",\n lb: \"Luxembourgish\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mk: \"Macedonian\",\n mi: \"Maori\",\n mr: \"Marathi\",\n mhr: \"Mari\",\n mn: \"Mongolian\",\n de: \"German\",\n ne: \"Nepali\",\n no: \"Norwegian\",\n pa: \"Punjabi\",\n pap: \"Papiamento\",\n fa: \"Persian\",\n pl: \"Polish\",\n pt: \"Portuguese\",\n ro: \"Romanian\",\n ru: \"Russian\",\n ceb: \"Cebuano\",\n sr: \"Serbian\",\n si: \"Sinhala\",\n sk: \"Slovakian\",\n sl: \"Slovenian\",\n sw: \"Swahili\",\n su: \"Sundanese\",\n tg: \"Tajik\",\n th: \"Thai\",\n tl: \"Tagalog\",\n ta: \"Tamil\",\n tt: \"Tatar\",\n te: \"Telugu\",\n tr: \"Turkish\",\n udm: \"Udmurt\",\n uz: \"Uzbek\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n fi: \"Finnish\",\n fr: \"French\",\n hi: \"Hindi\",\n hr: \"Croatian\",\n cs: \"Czech\",\n sv: \"Swedish\",\n gd: \"Scottish\",\n et: \"Estonian\",\n eo: \"Esperanto\",\n jv: \"Javanese\",\n ja: \"Japanese\"\n };\n\n $('#js-auto-detect').text(languages[source]);\n}", "title": "" }, { "docid": "b70e2116891d7168387de7fd2d77476f", "score": "0.5956852", "text": "onLanguageChange(newLanguage) {\n\n if (newLanguage) {\n this.setState({\n language: newLanguage\n })\n }\n }", "title": "" }, { "docid": "ee66115c710762b0f30bbe9e5d3c62e1", "score": "0.59549814", "text": "_setupLanguageSupport(languages) {\n\t\tthis._supportedLanguages = languages;\n\n\t\t// add helpers for each Language supported\n\t\tthis.forEach(languages, (language) => {\n\t\t\tthis['is' + language] = () => {\n\t\t\t\treturn language === this._currentLanguage;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "9fd824664337f316ed2b306e4dce8e65", "score": "0.5941635", "text": "function switchToEmbeddedLanguageIfNecessary(context) {\n\t\t\tvar i,\n\t\t\t\tembeddedLanguage;\n\t\t\t\n\t\t\tfor (i = 0; i < context.language.embeddedLanguages.length; i++) {\n\t\t\t\tif (!languages[context.language.embeddedLanguages[i].language]) {\n\t\t\t\t\t//unregistered language\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tembeddedLanguage = clone(context.language.embeddedLanguages[i]);\n\t\t\t\t\n\t\t\t\tif (embeddedLanguage.switchTo(context)) {\n\t\t\t\t\tembeddedLanguage.oldItems = clone(context.items);\n\t\t\t\t\tcontext.embeddedLanguageStack.push(embeddedLanguage);\n\t\t\t\t\tcontext.language = languages[embeddedLanguage.language];\n\t\t\t\t\tcontext.items = merge(context.items, clone(context.language.contextItems));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "643a0c8f244cf69b496834a42c3f8b1d", "score": "0.5936028", "text": "function addLanguageListener() {\n SettingsListener.observe('language.current', 'en-US', function(lang) {\n document.documentElement.lang = lang;\n var total = pageHelper.total();\n for (var i = 0; i < total; i++) {\n pages.list[i].translate();\n }\n });\n }", "title": "" }, { "docid": "e7c9244451423f42e9d9749a3000f095", "score": "0.5927162", "text": "function languageChanged() {\n if (!util.isNullOrUndefined(vm.selectedLanguage) && util.isNonEmptyString(vm.selectedLanguage)) {\n\n languageHandler.setLanguage(vm.selectedLanguage);\n }\n }", "title": "" }, { "docid": "9696864eda71ea56b89273962fa16d57", "score": "0.59031206", "text": "firstSupportedLanguage() {\n const languages = [this.queryStringLang(), this.localStorageLang()]\n .concat([this.options.get('defaultLanguage')])\n .concat(this.browserLangs())\n .concat(['en'])\n .filter(Boolean);\n const preferredLanguage = languages.find(lang => this.getSupported(lang));\n return this.getSupported(preferredLanguage);\n }", "title": "" }, { "docid": "ca1052ff90998e0019ce4fb027710122", "score": "0.59001", "text": "handleLanguagechange() {\n this.$('.vjs-control-text').textContent = this.localize('{1} is loading.', [\n this.player_.isAudio() ? 'Audio Player' : 'Video Player'\n ]);\n }", "title": "" }, { "docid": "7f2934f5655d5cbc95513d2b6d95e863", "score": "0.5878238", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "2f623f681f7c8150fa5205436a178663", "score": "0.5876312", "text": "handleLanguageUpdate(language) {\n this.setState({\n language\n });\n }", "title": "" }, { "docid": "336d45ab709d2c1e2c39089ed7cae6e5", "score": "0.58754486", "text": "function loadLangInfo(langs) {\n for(var i = 0; i < langs.length; i++) {\n var langName = langs[i][LANG_NAME];\n var enrolmentId = langs[i][ENROLMENT_ID];\n languages[enrolmentId] = langName;\n addLangListElement(enrolmentId, langName);\n }\n setLangChange();\n}", "title": "" }, { "docid": "4f88fb777f578b77f784e6b6232e2d62", "score": "0.5870529", "text": "function LoadLanguageRequestHandler(language) {\n voiceAssistant.saywithlang(\"Language change to \" + language, false, 'US English Female');\n switch (language) {\n case \"english\":\n LANG = \"en-US\";\n voiceAssistant.speechRecognition.lang = \"en-US\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'UK English Female'\n };\n requestHandlers = voiceRequestHandlers_en_US;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_en_US;\n break;\n case \"vietnamese\":\n LANG = \"vi-VN\";\n voiceAssistant.speechRecognition.lang = \"vi-VN\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Vietnamese Male'\n };\n requestHandlers = voiceRequestHandlers_vi_VN;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_vi_VN;\n break;\n case \"vietnam\":\n LANG = \"vi-VN\";\n voiceAssistant.speechRecognition.lang = \"vi-VN\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Vietnamese Male'\n };\n requestHandlers = voiceRequestHandlers_vi_VN;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_vi_VN;\n break;\n case \"thai language\":\n LANG = \"th-TH\";\n voiceAssistant.speechRecognition.lang = \"th-TH\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Thai Female'\n };\n requestHandlers = voiceRequestHandlers_th_TH;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_th_TH;\n break;\n case \"chinese\":\n LANG = \"cmn-Hans-CN\";\n voiceAssistant.speechRecognition.lang = \"cmn-Hans-CN\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Chinese Female'\n };\n requestHandlers = voiceRequestHandlers_cmn_Hans_CN;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_cmn_Hans_CN;\n break;\n case \"spanish\":\n LANG = \"es-ES\";\n voiceAssistant.speechRecognition.lang = \"es-ES\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Spanish Female'\n };\n requestHandlers = voiceRequestHandlers_es_ES;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_es_ES;\n break;\n case \"korean\":\n LANG = \"ko-KR\";\n voiceAssistant.speechRecognition.lang = \"ko-KR\";\n responsive_voice_params = {\n rate: 1,\n pitch: 1,\n volume: 1,\n voice: 'Korean Female'\n };\n requestHandlers = voiceRequestHandlers_ko_KR;\n voiceAssistant.config.requestHandlers = voiceRequestHandlers_ko_KR;\n break;\n }\n voiceAssistant.say(\"\");\n}", "title": "" }, { "docid": "968fb9975741aa32285fd2995b3cdaec", "score": "0.58694977", "text": "function loadLang(key, values) {\r\n values.abbr = key;\r\n if (!languages[key]) {\r\n languages[key] = new Language();\r\n }\r\n languages[key].set(values);\r\n return languages[key];\r\n }", "title": "" }, { "docid": "968fb9975741aa32285fd2995b3cdaec", "score": "0.58694977", "text": "function loadLang(key, values) {\r\n values.abbr = key;\r\n if (!languages[key]) {\r\n languages[key] = new Language();\r\n }\r\n languages[key].set(values);\r\n return languages[key];\r\n }", "title": "" }, { "docid": "c83ee2d714df9298e9adf9249de7f062", "score": "0.58671767", "text": "function lang_api_loaded() {\n\tlog('Language API loaded');\n\t// Only enabled when #feedcontainer exists\n\tif (!$('#feedcontainer').length)\n\t\treturn;\n\n\tgoogle = unsafeWindow.google\n\t// Check settings\n\tif (to_lang != '')\n\t\tif (!google.language.isTranslatable(google.language.Languages[to_lang]))\n\t\t\tto_lang == '';\n\n\t// Create t-box\n\tt_box = $('<div id=\"t-box\"></div>').appendTo('body');\n\t// Add languages\n\tt_box_lang = $('<select id=\"t-box-lang\"><option value=\"\">Disable</option></select>');\n\tfor (lang in google.language.Languages) {\n\t\tif (!google.language.isTranslatable(google.language.Languages[lang])\n\t\t\t|| lang == 'UNKNOWN')\n\t\t\tcontinue;\n\t\tselected = (lang == to_lang) ? ' selected' : '';\n\t\tlang_desc = lang;\n\t\tif (lang_readable[lang])\n\t\t\tlang_desc = lang_readable[lang];\n\t\t$('<option value=\"' + lang + '\"' + selected + '>' + lang_desc + '</option>').appendTo(t_box_lang);\n\t\t}\n\n\tt_box_lang\n\t\t.appendTo(t_box)\n\t\t.change(function() {\n\t\t\tto_lang = $(this).find(':selected').get(0).value;\n\t\t\tlog('To language: ' + to_lang);\n\t\t\tGM_setValue('to_lang', to_lang);\n\t\t\t});\n\tt_box.append(' ');\n\tt_ori = $('<span class=\"toggle-original\">Original</span>')\n\t\t.click(function() {\n\t\t\tshow_o = !show_o;\n\t\t\tGM_setValue('show_o', show_o);\n\t\t\tif (show_o)\n\t\t\t\t$(this).css({fontWeight: 'bold'});\n\t\t\telse\n\t\t\t\t$(this).css({fontWeight: 'normal'});\n\t\t\trefresh_trans();\n\t\t\t});\n\tif (show_o)\n\t\tt_ori.css({fontWeight: 'bold'});\n\tt_ori.appendTo(t_box);\n\t// Add 'Translate' to each cluster\n\ttrans_attach();\n\t}", "title": "" }, { "docid": "e567a86efd33cb09e3c7aea7eb68fab5", "score": "0.5865785", "text": "patch_game_language_list(language_list) {\n\t\tfor (let patched = language_list.length;\n\t\t patched < this.locale_count;\n\t\t ++patched) {\n\t\t\tconst locale = this.localedef_by_index[patched];\n\t\t\tif (!locale) {\n\t\t\t\tconsole.error(\"language array out of sync ?\",\n\t\t\t\t\t \"patched \", patched, \" out of \",\n\t\t\t\t\t this.locale_count, \" size is \",\n\t\t\t\t\t language_list.length);\n\t\t\t\tlanguage_list.push(\"ERROR\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst lang_name = this.added_locales[locale].language;\n\t\t\tlanguage_list.push(lang_name[this.final_locale]\n\t\t\t\t\t || lang_name[locale]\n\t\t\t\t\t || \"ERROR NO LANGUAGE\");\n\t\t}\n\t}", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "6b208ea65fc31bebf3b349e930cd0e06", "score": "0.5863656", "text": "function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }", "title": "" }, { "docid": "2a7d6b34762d8ee30e3ce67f62c92600", "score": "0.5858348", "text": "async setup() {\n\t\tif (this.requiresReady) {\n\t\t\tHooks.on(\"ready\", async () => {\n\t\t\t\tawait this.getLanguages();\n\t\t\t\tthis.loadAlphabet();\n\t\t\t\tthis.loadTongues();\n\t\t\t\tthis.loadCustomFonts();\n\t\t\t\tthis.reloadLanguages();\n\t\t\t\tthis.getDefaultLanguage();\n\t\t\t\tHooks.callAll(\"polyglot.languageProvider.ready\");\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tawait this.getLanguages();\n\t\t\tthis.loadAlphabet();\n\t\t\tthis.loadTongues();\n\t\t\tthis.loadCustomFonts();\n\t\t\tthis.reloadLanguages();\n\t\t\tthis.getDefaultLanguage();\n\t\t}\n\t}", "title": "" }, { "docid": "adadfd79f5b5aeef1b642ea473fa16a5", "score": "0.5853188", "text": "onLanguageChange(language) {\n let lang = language === \"English\" ? \"en\" : \"es\"\n i18n.locale = lang\n this.setState({ language })\n }", "title": "" }, { "docid": "c60eb6d0cd4c8a42206d122aeefe2e32", "score": "0.5846746", "text": "_Initialize(msg, language, args){\n this.language = language;\n }", "title": "" }, { "docid": "c60eb6d0cd4c8a42206d122aeefe2e32", "score": "0.5846746", "text": "_Initialize(msg, language, args){\n this.language = language;\n }", "title": "" }, { "docid": "867fe5ba2768dd92a303a5ddb4aa0a9b", "score": "0.58435786", "text": "function validateLocaleAndSetLanguage(locale,sys,errors){var matchResult=/^([a-z]+)([_\\-]([a-z]+))?$/.exec(locale.toLowerCase());if(!matchResult){if(errors){errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1,\"en\",\"ja-jp\"));}return;}var language=matchResult[1];var territory=matchResult[3];// First try the entire locale, then fall back to just language if that's all we have.\n// Either ways do not fail, and fallback to the English diagnostic strings.\nif(!trySetLanguageAndTerritory(language,territory,errors)){trySetLanguageAndTerritory(language,/*territory*/undefined,errors);}// Set the UI locale for string collation\nts.setUILocale(locale);function trySetLanguageAndTerritory(language,territory,errors){var compilerFilePath=ts.normalizePath(sys.getExecutingFilePath());var containingDirectoryPath=ts.getDirectoryPath(compilerFilePath);var filePath=ts.combinePaths(containingDirectoryPath,language);if(territory){filePath=filePath+\"-\"+territory;}filePath=sys.resolvePath(ts.combinePaths(filePath,\"diagnosticMessages.generated.json\"));if(!sys.fileExists(filePath)){return false;}// TODO: Add codePage support for readFile?\nvar fileContents=\"\";try{fileContents=sys.readFile(filePath);}catch(e){if(errors){errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0,filePath));}return false;}try{// this is a global mutation (or live binding update)!\nts.setLocalizedDiagnosticMessages(JSON.parse(fileContents));}catch(_a){if(errors){errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0,filePath));}return false;}return true;}}", "title": "" }, { "docid": "9840818ba06dc15767937abbf5b7d626", "score": "0.58188266", "text": "constructor(\n /**\n The language object.\n */\n language, \n /**\n An optional set of supporting extensions. When nesting a\n language in another language, the outer language is encouraged\n to include the supporting extensions for its inner languages\n in its own set of support extensions.\n */\n support = []) {\n this.language = language;\n this.support = support;\n this.extension = [language, support];\n }", "title": "" }, { "docid": "9840818ba06dc15767937abbf5b7d626", "score": "0.58188266", "text": "constructor(\n /**\n The language object.\n */\n language, \n /**\n An optional set of supporting extensions. When nesting a\n language in another language, the outer language is encouraged\n to include the supporting extensions for its inner languages\n in its own set of support extensions.\n */\n support = []) {\n this.language = language;\n this.support = support;\n this.extension = [language, support];\n }", "title": "" }, { "docid": "291f8f75b194f9cb8e34d41ceb8ed195", "score": "0.5814318", "text": "function setUpLocale(language) {\n let text = locale[language].htmlText;\n document.getElementById(\"sr-next\").innerText = text.srNext;\n document.getElementById(\"sr-previous\").innerText = text.srPrevious;\n document.getElementById(\"headingAllergens\").innerText = text.headingAllergens;\n document.getElementById(\"headingSupplements\").innerText = text.headingSupplements;\n document.getElementById(\"headingTags\").innerText = text.headingTags;\n document.getElementById(\"headingPrice\").innerText = text.headingPrice;\n document.getElementById(\"headingCategory\").innerText = text.headingCategory;\n document.getElementById(\"disclaimerText\").innerHTML = text.disclaimerText;\n document.getElementById(\"aboutText\").innerHTML = text.aboutText;\n populateCheckboxes(locale[language].supplements);\n}", "title": "" }, { "docid": "eb270f7eb51f88b582563e45f46dc9f8", "score": "0.5783918", "text": "_prioritizeLocales () {\n debug('_prioritizeLocales');\n\n for (let i = 0; i < navigator.languages.length; i++) {\n let idx = this.supportedLocales.indexOf(navigator.languages[i]);\n if (idx !== -1) {\n let supportedLocale = this.supportedLocales.splice(idx, 1);\n this.supportedLocales.unshift(supportedLocale.pop());\n break;\n }\n }\n\n this.prioritizedLangs = this.supportedLocales.map((lang) => {\n return {code: lang, src: 'app'};\n });\n }", "title": "" }, { "docid": "ca5e2681e1a9f09d387ad355dd18cbb8", "score": "0.5779917", "text": "function onOfflineStorageReady() {\n var storedLanguage = Adapt.offlineStorage.get(\"lang\");\n\n if (storedLanguage) {\n languagePickerModel.setLanguage(storedLanguage);\n } else if (languagePickerModel.get('_showOnCourseLoad') === false) {\n languagePickerModel.setLanguage(Adapt.config.get('_defaultLanguage'));\n } else {\n showLanguagePickerView();\n }\n }", "title": "" }, { "docid": "3b9e01025175df6ef6349872cbe9a6ae", "score": "0.5768489", "text": "function switchLanguage() {\n currentLang = (currentLang === 'en') ? 'ja' : 'en';\n return currentLang;\n}", "title": "" }, { "docid": "fbf5472947ee276f629d7347af4b93e7", "score": "0.57652915", "text": "switchToLanguage(lang) {\n return __awaiter(this, void 0, void 0, function* () {\n const moduleLang = lang.replace('_', '-');\n try {\n yield this.loadLocales(moduleLang);\n }\n catch (e) {\n const lessSpecificModuleLang = moduleLang.split('-').shift();\n if (lessSpecificModuleLang !== moduleLang) {\n yield this.loadLocales(lessSpecificModuleLang);\n }\n else {\n throw e;\n }\n }\n this.setLanguage(lang);\n });\n }", "title": "" }, { "docid": "c4a43c68180403b49a57e9470300eab3", "score": "0.57604426", "text": "installLocalizationStrings_() {\n const localizationService = getLocalizationService(this.element);\n const storyLanguages = localizationService.getLanguageCodesForElement(\n this.element\n );\n if (this.maybeRegisterInlineLocalizationStrings_(storyLanguages[0])) {\n return;\n }\n this.fetchLocalizationStrings_(storyLanguages);\n }", "title": "" }, { "docid": "bf84edb83855e3fbd770cda171df7ad2", "score": "0.5753518", "text": "getLanguage() {\n return gLanguage;\n }", "title": "" }, { "docid": "50dd6aeb56574bc3c91615856544699a", "score": "0.5752043", "text": "function languageObject() {\n\treturn {/** {enum} Language test taken\n\t\t * \n\t\t * Use the languageTest enum\n\t\t */\n\t\ttest: null,\n\t\t/** 0 to 10 */\n\t\tspeaking: null,\n\t\t/** 0 to 10 */\n\t\tlistening: null,\n\t\t/** 0 to 10 */\n\t\treading: null,\n\t\t/** 0 to 10 */\n\t\twriting: null\n\t}\n}", "title": "" }, { "docid": "bca66e75c43ce9eafa6f8629567a0432", "score": "0.57508", "text": "function funEnableLanguages() {\n\ttry {\n\t\tvar objchkAllLangs = document.getElementById(\"chkAllLanguages\");\n\t\tdocument.getElementById(\"hdLangXML\").value = \"\";\n\n\t\tvar objarrInputTags = document.getElementsByTagName('input');\n\t\tfor (i = 0; i < objarrInputTags.length; i++) {\n\t\t\tif (objarrInputTags[i].type == 'checkbox' && objarrInputTags[i].id.substring(0, 8) == 'chkLANG_') {\n\t\t\t\tif (objchkAllLangs.checked == false) {\n\t\t\t\t\tobjarrInputTags[i].disabled = false;\n\t\t\t\t\tobjarrInputTags[i].checked = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tobjarrInputTags[i].disabled = true;\n\t\t\t\t\tobjarrInputTags[i].checked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse continue;\n\t\t}\n\t}\n\tcatch (e) {\n\t\tsubDisplayError(\"BackOfficeModuleCode.js\", \"funEnableLanguages()\", e);\n\t}\n}", "title": "" }, { "docid": "46ab786476c6d3f1470aecdf2bcc14b2", "score": "0.5748977", "text": "getPreferredLanguage() {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "1ac903a72589e1553512310fca005018", "score": "0.57484007", "text": "function changeLanguage(){\r\n language = prompt('Enter Language Code:')\r\n recognizer.lang = language;\r\n}", "title": "" }, { "docid": "96339c1a4689ee9c18a5cc5ed0474b4f", "score": "0.5746295", "text": "function randomLanguage() {\n return strings[Math.floor(Math.random() * strings.length)];\n}", "title": "" }, { "docid": "123265ae4c0999b00efa4ce31c264d40", "score": "0.57458526", "text": "function languageGreeter(name, language){\n language(name) \n}", "title": "" }, { "docid": "993589498f6f09452b8821602ac078f5", "score": "0.5744983", "text": "render() {\n return (\n <Context.Provider\n value={{ ...this.state, onLanguageChange: this.onLanguageChange }}\n >\n {this.props.children}\n </Context.Provider>\n );\n }", "title": "" }, { "docid": "8438e95cc9aa3b37dbc051b24848de9d", "score": "0.5742817", "text": "function changeLang() {\n if (langNew == false) {\n document.getElementById(\"changeLang\").innerHTML = \"English\";\n document.querySelector(\"#OVOSoph h2\").innerHTML = \"Esta es la chaqueta Sophmore\";\n document.querySelector(\"#OVOHood h2\").innerHTML = \"Sweat à capuche de tournoi OVO\";\n document.querySelector(\"#YeezyBoost h2\").innerHTML = \"Yeezy Renforcer 350 V2\";\n document.querySelector(\"#YeezyTract h2\").innerHTML = \"Pantalon de survêtement Calabasas\";\n document.querySelector(\"#RecoTee h2\").innerHTML = \"T-shirt de récupération\";\n document.querySelector(\"#SlimHood h2\").innerHTML = \"T-shirt long et mince\";\n document.querySelector(\"#LilTee h2\").innerHTML = \"T-shirt promotionnel de Tha Carter V\";\n document.querySelector(\"#LilHood h2\").innerHTML = \"Lil Wayne X T-shirt Wikipédia Crystals X du conseil consultatif\";\n document.querySelector(\"#XOLongTee h2\").innerHTML = \"XO Classic Logo Manches Longues\";\n document.querySelector(\"#KissTee h2\").innerHTML = \"Tee shirt fantastique pour Kiss Land\";\n langNew = true;\n }\n else {\n document.getElementById(\"changeLang\").innerHTML = \"French\";\n document.querySelector(\"#OVOSoph h2\").innerHTML = \"OVO Sophmore Jacket\"\n document.querySelector(\"#OVOHood h2\").innerHTML = \"OVO Tournament Hoodie\"\n document.querySelector(\"#YeezyBoost h2\").innerHTML = \"Yeezy Boost 350 V2\"\n document.querySelector(\"#YeezyTract h2\").innerHTML = \"Calabasas Track Pants\"\n document.querySelector(\"#RecoTee h2\").innerHTML = \"Recovery T-shirt\"\n document.querySelector(\"#SlimHood h2\").innerHTML = \"Slim Shady Long Tee\"\n document.querySelector(\"#LilTee h2\").innerHTML = \"Tha Carter V Promo T-Shirt\"\n document.querySelector(\"#LilHood h2\").innerHTML = \"Lil Wayne X Advisory Board Crystals X Wikipedia T-shirt\"\n document.querySelector(\"#XOLongTee h2\").innerHTML = \"XO Classic Logo Longsleeve\"\n document.querySelector(\"#KissTee h2\").innerHTML = \"Kiss Land Super Fantastic Tee\"\n\n langNew = false;\n }\n\n}", "title": "" }, { "docid": "413189277264b4533cfdea40af6f6ad5", "score": "0.57421666", "text": "function onTranslationsLoad() {\n evme.info(NAME, 'all translations loaded, parse and fire load event');\n\n if (!localStrings) {\n localStrings = {};\n }\n if (!defaultStrings) {\n defaultStrings = {};\n }\n\n renderTranslations();\n\n // fire a custom event alerting l10n is done\n evme.utils.trigger(NAME, self.EVENTS.LOAD, {\n 'language': currLang,\n 'country': currCountry,\n 'post': true\n });\n }", "title": "" }, { "docid": "dda2da099d2e94216deed26e534493e3", "score": "0.57411855", "text": "function esmLanguage() {\n\tif (localStorage.language == \"english\") localStorage.language = \"finnish\";\n\telse localStorage.language = \"english\";\n\n\twriteESM();\n}", "title": "" }, { "docid": "3d019d725bf68e8f06931b3254fc1c65", "score": "0.5735734", "text": "function initLanguageSelector() {\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(\"#header .language-selector .goog-te-menu-value span:first-child\").text(\"Translate\");\n\t\t\t\t$(\"#header .language-selector\").show();\n\t\t\t}, 1000);\n\n\t\t}", "title": "" }, { "docid": "4cd67d680be139869eade879ca396709", "score": "0.573408", "text": "function onUseDeviceLanguage() {\n auth.useDeviceLanguage();\n $('#language-code').val(auth.languageCode);\n alertSuccess('Using device language \"' + auth.languageCode + '\".');\n}", "title": "" }, { "docid": "e59b1ed7c42df78ab9559254ae76112c", "score": "0.57198364", "text": "getAcceptableLanguages(languageCode) {\n return languages[languageCode] || languageCode;\n }", "title": "" }, { "docid": "554a49f2ead888ff813a16e956601844", "score": "0.5717975", "text": "checkLanguage() {\n let language = 'en';\n try {\n language = (navigator.languages==undefined)?navigator.language:navigator.languages[0];\n } catch (e) {\n \n console.error(e);\n }\n //navigator.browserLanguage?navigator.browserLanguage:navigator.language;\n let type = undefined;\n if (language.indexOf('en') > -1) {\n type = 1 ;// enums.language.en;//english\n }\n else if (language.indexOf('zh') > -1) {\n type = 2 ;//enums.language.zh; //chinese\n }\n else if(language.indexOf('ko') > -1){\n type = 3;//enums.language.ko;\n }\n else if(language.indexOf('fr') > -1){\n type = 4;//enums.language.fr;\n }else if(language.indexOf('es') > -1){\n type = 5;//enums.language.es;\n }\n //type = Number(type);\n this.set(type);\n }", "title": "" } ]
96fb56f913d22b794164829dda9e7279
These helpers produce better VM code in JS engines due to their explicitness and function inlining.
[ { "docid": "6d9326a730b674391fb133fd2fa685c5", "score": "0.0", "text": "function isUndef(v) {\n return v === undefined || v === null;\n}", "title": "" } ]
[ { "docid": "987665d3235abb1714603841cc28a8d8", "score": "0.6424415", "text": "function __f_14() {\n \"use asm\";\n function __f_15() { return 0; }\n function __f_15() { return 137; } // redeclared function\n return {};\n}", "title": "" }, { "docid": "e5700dc3467dbfb744fb4da22682c77e", "score": "0.596037", "text": "function renderAsmFuncCreation(r) {\n if (r.hasRenderedAsmFuncCreation) {\n return\n }\n r.hasRenderedAsmFuncCreation = true\n\n // We need to provide a couple of imports to the asmjs module\n // that have to be constructed dynamically. First, a dynamic\n // call helper for each type signature in the module.\n\n if (r.tables.length === 1) {\n r.types.forEach(function(t) {\n var sigStr = makeSigStr(t)\n var args = [\"idx\"]\n for (var i = 0; i < t.param_types.length; i++) {\n args.push(\"a\" + i)\n }\n r.putln(\"imports.call_\", sigStr, \" = function call_\", sigStr, \"(\", args.join(\",\"), \"){\")\n r.putln(\" idx = idx >>> 0\")\n r.putln(\" var func = T0._get(idx)\")\n r.putln(\" if (func._wasmTypeSigStr) {\")\n r.putln(\" if (func._wasmTypeSigStr !== '\", sigStr, \"') { imports.trap('table sig') }\")\n r.putln(\" }\")\n r.putln(\" return func(\", args.slice(1).join(\",\"), \")\")\n r.putln(\"}\")\n })\n }\n\n // Create unaligned memory-access helpers.\n // These need to be dynamically created in order\n // to close over a reference to a DataView of the heap.\n\n r.memories.forEach(function(m, idx) {\n r.putln(\"var HDV = new DataView(M\", idx, \".buffer)\")\n if (m.limits.initial !== m.limits.maximum) {\n r.putln(\"M\", idx, \"._onChange(function() {\")\n r.putln(\" HDV = new DataView(M\", idx, \".buffer)\")\n r.putln(\"});\")\n }\n r.putln(\"imports.i32_load_unaligned = function(addr) {\")\n r.putln(\" return HDV.getInt32(addr, true)\")\n r.putln(\"}\")\n r.putln(\"imports.i32_load16_s_unaligned = function(addr) {\")\n r.putln(\" return HDV.getInt16(addr, true)\")\n r.putln(\"}\")\n r.putln(\"imports.i32_load16_u_unaligned = function(addr) {\")\n r.putln(\" return HDV.getInt16(addr, true) & 0x0000FFFF\")\n r.putln(\"}\")\n r.putln(\"imports.f32_load_unaligned = function(addr) {\")\n r.putln(\" return HDV.getFloat32(addr, true)\")\n r.putln(\"}\")\n r.putln(\"imports.f64_load_unaligned = function(addr) {\")\n r.putln(\" return HDV.getFloat64(addr, true)\")\n r.putln(\"}\")\n r.putln(\"imports.i32_store_unaligned = function(addr, value) {\")\n r.putln(\" HDV.setInt32(addr, value, true)\")\n r.putln(\"}\")\n r.putln(\"imports.i32_store16_unaligned = function(addr, value) {\")\n r.putln(\" HDV.setInt16(addr, value & 0x0000FFFF, true)\")\n r.putln(\"}\")\n r.putln(\"imports.f32_store_unaligned = function(addr, value) {\")\n r.putln(\" HDV.setFloat32(addr, value, true)\")\n r.putln(\"}\")\n r.putln(\"imports.f64_store_unaligned = function(addr, value) {\")\n r.putln(\" HDV.setFloat64(addr, value, true)\")\n r.putln(\"}\")\n // For JS engines that canonicalize NaNs, we need to jump through\n // some hoops to preserve precise NaN bitpatterns. We do this\n // by boxing it into a Number() and attaching the precise bit pattern\n // as integer properties on this object.\n r.putln(\"var f32_isNaN = imports.f32_isNaN\")\n r.putln(\"var f64_isNaN = imports.f64_isNaN\")\n r.putln(\"imports.f32_load_nan_bitpattern = function(v, addr) {\")\n r.putln(\" if (f32_isNaN(v)) {\")\n r.putln(\" v = new Number(v)\")\n r.putln(\" v._wasmBitPattern = HDV.getInt32(addr, true)\")\n r.putln(\" }\")\n r.putln(\" return v\")\n r.putln(\"}\")\n r.putln(\"imports.f32_store_nan_bitpattern = function(v, addr) {\")\n r.putln(\" if (typeof v === 'object' && v._wasmBitPattern) {\")\n r.putln(\" HDV.setInt32(addr, v._wasmBitPattern, true)\")\n r.putln(\" }\")\n r.putln(\"}\")\n r.putln(\"imports.f64_load_nan_bitpattern = function(v, addr) {\")\n r.putln(\" if (f64_isNaN(v)) {\")\n r.putln(\" v = new Number(v)\")\n r.putln(\" v._wasmBitPattern = new Long(\")\n r.putln(\" HDV.getInt32(addr, true),\")\n r.putln(\" HDV.getInt32(addr + 4, true)\")\n r.putln(\" )\")\n r.putln(\" }\")\n r.putln(\" return v\")\n r.putln(\"}\")\n r.putln(\"imports.f64_store_nan_bitpattern = function(v, addr) {\")\n r.putln(\" if (typeof v === 'object' && v._wasmBitPattern) {\")\n r.putln(\" HDV.setInt32(addr, v._wasmBitPattern.low, true)\")\n r.putln(\" HDV.setInt32(addr + 4, v._wasmBitPattern.high, true)\")\n r.putln(\" }\")\n r.putln(\"}\")\n })\n\n // Alright, now we can invoke the asmjs sub-function,\n // creating the function objects.\n\n if (r.functions.length > 0) {\n if (r.memories.length === 1) {\n r.putln(\"var funcs = asmfuncs(asmlib, imports, M0.buffer)\")\n } else {\n r.putln(\"var funcs = asmfuncs(asmlib, imports)\")\n }\n }\n\n // Type-tag each function object.\n // XXX TODO: using a string for this is *ugh*,\n // come up with something bettter.\n\n r.functions.forEach(function(f, idx) {\n var sigStr = makeSigStr(r.getFunctionTypeSignatureByIndex(idx))\n r.putln(\"funcs.\", f.name, \"._wasmTypeSigStr = '\", sigStr, \"'\")\n r.putln(\"funcs.\", f.name, \"._wasmJSWrapper = null\")\n })\n}", "title": "" }, { "docid": "27dc811c76072e5bab37bf5f1dce9187", "score": "0.5838608", "text": "function __f_109() {\n \"use asm\";\n function __f_18() {\n var a = 0;\n while(2147483648) {\n a = 1;\n break;\n }\n return a|0;\n }\n return {__f_18: __f_18};\n}", "title": "" }, { "docid": "27dc811c76072e5bab37bf5f1dce9187", "score": "0.5838608", "text": "function __f_109() {\n \"use asm\";\n function __f_18() {\n var a = 0;\n while(2147483648) {\n a = 1;\n break;\n }\n return a|0;\n }\n return {__f_18: __f_18};\n}", "title": "" }, { "docid": "f3f752ffa396692b4cbbfaa12b4d8f8d", "score": "0.5810784", "text": "function get_jit_compiled_function() {\n function target(num) {\n num += 1.234;\n for (var i = 0; i < 200; i++)\n num /= 0.1;\n num = num % 3;\n return num;\n }\n\n for (var i = 0; i < 100000; i++) {\n target(10.42);\n }\n\n return target;\n}", "title": "" }, { "docid": "27e1d82185c7a7a033fbe2f62e1f3507", "score": "0.57313454", "text": "function _0x2847(_0x574939,_0x42115e){const _0x2607f3=_0x2607();return _0x2847=function(_0x2847da,_0x7dacbc){_0x2847da=_0x2847da-0x6e;let _0x1afb53=_0x2607f3[_0x2847da];return _0x1afb53;},_0x2847(_0x574939,_0x42115e);}", "title": "" }, { "docid": "3e40801cc237a59500e65f44bd3aeb83", "score": "0.5668251", "text": "function inlined(x) {\n return x + x;\n}", "title": "" }, { "docid": "3d969011ce25cc55f5a03ee1a29909da", "score": "0.56534356", "text": "function asm() {\n \"use asm\";\n function f(a) {\n a = a | 0;\n tab[a & 0]() | 0;\n }\n function unused() {\n return 0;\n }\n var tab = [ unused ];\n return f;\n}", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.56511056", "text": "function _0x359e(_0x4458a7,_0x21f8ae){const _0x2ded4b=_0x2ded();return _0x359e=function(_0x359e4e,_0x430b46){_0x359e4e=_0x359e4e-0x1d7;let _0xa0187a=_0x2ded4b[_0x359e4e];return _0xa0187a;},_0x359e(_0x4458a7,_0x21f8ae);}", "title": "" }, { "docid": "af28c3e414c1d20f34601707f230dca4", "score": "0.5647235", "text": "function _0x539f(_0x503842,_0x106b6d){const _0x1d5ba4=_0x1d5b();return _0x539f=function(_0x539fda,_0x10d002){_0x539fda=_0x539fda-0x115;let _0x931179=_0x1d5ba4[_0x539fda];return _0x931179;},_0x539f(_0x503842,_0x106b6d);}", "title": "" }, { "docid": "d08aed1793a1a632e246cc96f21e6472", "score": "0.5615409", "text": "function o0(o421,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function o290() {\n // compatibility - merge in anything from Module['postRun'] at this time\n try {\nif (Module['postRun']) {\n try {\nif (typeof Module['postRun'] == 'function') try {\nModule['postRun'] = [Module['postRun']];\n}catch(e){}\n}catch(e){}\n try {\nwhile (Module['postRun'].length) {\n try {\no291(Module['postRun'].shift());\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\no276(o283);\n}catch(e){}\n};\n //views\n var o1 =new stdlib.Float64Array(buffer);\n\n function Symbol(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no849 = o6;\n}catch(e){}\n try {\nreturn +(o0[o1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "1e36b59f4f7a6971c9f695ea2bc7a385", "score": "0.55475086", "text": "function Module(global, env, buffer) {\n \"use asm\";\n\n function test1() {\n var x = 0;\n x = -1 / 1 | 0;\n return x | 0;\n }\n\n function test2() {\n var x = 0;\n x = -1 / 1 | 0;\n return x | 0;\n }\n\n return {\n test1: test1,\n test2: test2\n };\n}", "title": "" }, { "docid": "f057865c862dbdc2ab42f614f6e5522f", "score": "0.5535706", "text": "function fnToNative(fargs, fbody, env){\n //wrap around a macro\n return function(...args){ return compute(fbody, new LEXEnv(env, fargs, args)) } }", "title": "" }, { "docid": "9aff5b306da4ae8d8a61f3f6904252c8", "score": "0.5525493", "text": "function v(){}", "title": "" }, { "docid": "9aff5b306da4ae8d8a61f3f6904252c8", "score": "0.5525493", "text": "function v(){}", "title": "" }, { "docid": "457bd5e0b08123e6c9167de626666e75", "score": "0.5476076", "text": "function f() {\n \"use asm\";\n\n}", "title": "" }, { "docid": "a14da0869c9ec852f22623e2eabde51b", "score": "0.54756653", "text": "function foo12( a ) { return a * 4; }", "title": "" }, { "docid": "7af3177e28b626cfd364bf894050f3ea", "score": "0.5472978", "text": "function v89(v90,v91) {\n function v92(v93,v94) {\n const v96 = [13.37,v6];\n // v96 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v97(v98,v99) {\n return v96;\n }\n const v100 = v97(13.37,v97);\n // v100 = .unknown\n let v101 = v94;\n function v102(v103,v104) {\n const v106 = v100.toLocaleString();\n // v106 = .unknown\n const v107 = v96.join(v106);\n // v107 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v108 = eval(v107);\n // v108 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n const v109 = v102(v102,v101);\n // v109 = .unknown\n }\n const v111 = new Promise(v92);\n // v111 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "5eefb4cf8dbbbcfb10a8f4d0a751c1e3", "score": "0.544689", "text": "function renderAsmFuncHeader(r) {\n if (r.hasRenderedAsmFuncHeader) {\n return\n }\n r.hasRenderedAsmFuncHeader = true\n\n // XXX TODO: if it turns out we couldn't render valid\n // asmjs, we should overwrite this string so that Firefox\n // doesn't waste its time trying to validate it.\n r.putln(\"function asmfuncs(stdlib, foreign, heap) {\")\n r.putln(\"\\\"use asm\\\"\")\n\n // Make heap views, if there's a memory.\n // If the heap is not growable then we can hard-code\n // the memory size and remain valid asmjs.\n\n r.memories.forEach(function(m, idx) {\n var buf\n if (idx > 0 || m.limits.initial !== m.limits.maximum) {\n buf = \"M\" + idx + \".buffer\"\n r.putln(\"var memorySize = \", buf, \".byteLength|0\")\n } else {\n buf = \"heap\"\n r.putln(\"var memorySize = \", m.limits.initial * PAGE_SIZE)\n }\n r.putln(\"var HI8 = new stdlib.Int8Array(\", buf, \")\")\n r.putln(\"var HI16 = new stdlib.Int16Array(\", buf, \")\")\n r.putln(\"var HI32 = new stdlib.Int32Array(\", buf, \")\")\n r.putln(\"var HU8 = new stdlib.Uint8Array(\", buf, \")\")\n r.putln(\"var HU16 = new stdlib.Uint16Array(\", buf, \")\")\n r.putln(\"var HU32 = new stdlib.Uint32Array(\", buf, \")\")\n r.putln(\"var HF32 = new stdlib.Float32Array(\", buf, \")\")\n r.putln(\"var HF64 = new stdlib.Float64Array(\", buf, \")\")\n if (m.limits.initial !== m.limits.maximum) {\n r.putln(\"M\", idx, \"._onChange(function() {\")\n r.putln(\" memorySize = \", buf, \".byteLength|0\")\n r.putln(\" HI8 = new stdlib.Int8Array(\", buf, \")\")\n r.putln(\" HI16 = new stdlib.Int16Array(\", buf, \")\")\n r.putln(\" HI32 = new stdlib.Int32Array(\", buf, \")\")\n r.putln(\" HU8 = new stdlib.Uint8Array(\", buf, \")\")\n r.putln(\" HU16 = new stdlib.Uint16Array(\", buf, \")\")\n r.putln(\" HU32 = new stdlib.Uint32Array(\", buf, \")\")\n r.putln(\" HF32 = new stdlib.Float32Array(\", buf, \")\")\n r.putln(\" HF64 = new stdlib.Float64Array(\", buf, \")\")\n r.putln(\"});\")\n }\n })\n\n // Take local references to our helper functions.\n\n r.putln(\"var fround = stdlib.Math.fround\")\n Object.keys(stdlib).forEach(function(key) {\n r.putln(\"var \", key, \" = foreign.\", key)\n })\n\n // Take local references to all the imports.\n\n r.imports.forEach(function(i, idx) {\n switch (i.kind) {\n case EXTERNAL_KINDS.FUNCTION:\n r.putln(\"var F\", i.index, \" = foreign.F\", i.index)\n break\n case EXTERNAL_KINDS.GLOBAL:\n switch (i.type.content_type) {\n case TYPES.I32:\n r.putln(\"var Gi\", i.index, \" = foreign.G\", i.index, \"|0\")\n break\n case TYPES.I64:\n r.putln(\"var Gl\", i.index, \" = foreign.G\", i.index)\n break\n case TYPES.F32:\n r.putln(\"var Gf\", i.index, \" = fround(foreign.G\", i.index, \")\")\n break\n case TYPES.F64:\n r.putln(\"var Gd\", i.index, \" = +foreign.G\", i.index)\n break\n }\n break\n }\n })\n\n // Take local references to dynamic call helpers.\n\n if (r.tables.length === 1) {\n r.types.forEach(function(t) {\n var sigStr = makeSigStr(t)\n r.putln(\"var call_\", sigStr, \" = foreign.call_\", sigStr)\n })\n }\n\n // Take local references to unaligned load/store helpers.\n\n r.putln(\"var i32_load_unaligned = foreign.i32_load_unaligned\")\n r.putln(\"var i32_load16_s_unaligned = foreign.i32_load16_s_unaligned\")\n r.putln(\"var i32_load16_u_unaligned = foreign.i32_load16_u_unaligned\")\n r.putln(\"var f32_load_unaligned = foreign.f32_load_unaligned\")\n r.putln(\"var f64_load_unaligned = foreign.f64_load_unaligned\")\n r.putln(\"var i32_store_unaligned = foreign.i32_store_unaligned\")\n r.putln(\"var i32_store16_unaligned = foreign.i32_store16_unaligned\")\n r.putln(\"var f32_store_unaligned = foreign.f32_store_unaligned\")\n r.putln(\"var f64_store_unaligned = foreign.f64_store_unaligned\")\n r.putln(\"var f32_store_nan_bitpattern = foreign.f32_store_nan_bitpattern\")\n r.putln(\"var f32_load_nan_bitpattern = foreign.f32_load_nan_bitpattern\")\n r.putln(\"var f64_store_nan_bitpattern = foreign.f64_store_nan_bitpattern\")\n r.putln(\"var f64_load_nan_bitpattern = foreign.f64_load_nan_bitpattern\")\n\n // Declare all the global variables.\n // This repeats the declaration of any globals that were imported/exported,\n // but they're immutable, so whatevz.\n\n r.globals.forEach(function(g, idx) {\n if (idx >= r.numImportedGlobals) {\n switch (g.type.content_type) {\n case TYPES.I32:\n r.putln(\"var Gi\", idx, \" = \", g.init.jsexpr, \"|0\")\n break\n case TYPES.I64:\n r.putln(\"var Gl\", idx, \" = \", g.init.jsexpr)\n break\n case TYPES.F32:\n r.putln(\"var Gf\", idx, \" = fround(\", g.init.jsexpr, \")\")\n break\n case TYPES.F64:\n r.putln(\"var Gd\", idx, \" = +\", g.init.jsexpr)\n break\n }\n }\n })\n\n // XXX TODO: if the there's a single, ungrowable table that's\n // neither imported nor exported, we could declare its contents\n // inline here and made the generated code faster, rather than\n // always having to use the dynamic call helpers.\n}", "title": "" }, { "docid": "e7b9754e712a0d093d755f885d3b1671", "score": "0.54357374", "text": "function foo() { return 1; }", "title": "" }, { "docid": "e87c3ad6aeb5f400434935c1dba9382f", "score": "0.54347366", "text": "function __f_100() {\n \"use asm\";\n function __f_76() {\n var __v_39 = 0;\n outer: while (1) {\n while (__v_39 == 4294967295) {\n }\n }\n }\n return {__f_76: __f_76};\n}", "title": "" }, { "docid": "a3235fca5ae328a09a383c84b99b8e46", "score": "0.5432364", "text": "function __func(){return 1}", "title": "" }, { "docid": "4539bf9237993786a5ea2824c3c4aca0", "score": "0.5399151", "text": "function module0(stdlib) {\n \"use asm\"\n var u4 = stdlib.SIMD.Uint32x4;\n var u4check = u4.check;\n\n function foo(abc) {\n abc = u4check(abc);\n return ;\n }\n return { foo:foo }\n}", "title": "" }, { "docid": "46f1bd873066573ce296cd83f6dc6192", "score": "0.5382758", "text": "function v(a,b){for(var c,d=0;null!=(c=a[d]);d++)ea._data(c,\"globalEval\",!b||ea._data(b[d],\"globalEval\"))}", "title": "" }, { "docid": "38ff96403385d4c4de110fbd49a92689", "score": "0.53743535", "text": "function v32(v33) {\n function v35(v36,v37) {\n const v39 = [2798630069,2798630069,2798630069,2798630069];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v40(v41,v42) {\n return v36;\n }\n v39.__proto__ = v33;\n for (let v46 = 0; v46 < 100; v46 = v46 + 1) {\n const v47 = \"number\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = Int16Array;\n // v48 = .constructor([.integer | .object()] => .object(ofGroup: Int16Array, withProperties: [\"buffer\", \"byteLength\", \"constructor\", \"byteOffset\", \"length\", \"__proto__\"], withMethods: [\"some\", \"includes\", \"every\", \"set\", \"reduce\", \"reduceRight\", \"forEach\", \"join\", \"lastIndexOf\", \"values\", \"filter\", \"fill\", \"indexOf\", \"map\", \"find\", \"slice\", \"subarray\", \"copyWithin\", \"reverse\", \"sort\", \"entries\", \"keys\", \"findIndex\"]))\n const v49 = Number;\n // v49 = .object(ofGroup: NumberConstructor, withProperties: [\"MIN_SAFE_INTEGER\", \"MIN_VALUE\", \"MAX_VALUE\", \"NaN\", \"MAX_SAFE_INTEGER\", \"NEGATIVE_INFINITY\", \"POSITIVE_INFINITY\", \"prototype\", \"EPSILON\"], withMethods: [\"isNaN\", \"isFinite\", \"isSafeInteger\", \"isInteger\"]) + .function([.anything] => .number) + .constructor([.anything] => .number)\n const v51 = [1337,1337,1337,1337,1337];\n // v51 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v52(v53) {\n }\n const v54 = Function;\n // v54 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v57 = [\"function\",Int8Array];\n // v57 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v58(v59,v60) {\n const v63 = Proxy(v57,Object);\n // v63 = .unknown\n }\n function v64(v65,v66) {\n }\n const v68 = \"bigint\" in v39;\n // v68 = .boolean\n const v69 = {valueOf:v40};\n // v69 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"valueOf\"])\n const v71 = 100;\n // v71 = .integer\n const v72 = Object.defineProperty(v39,\"bigint\",v69);\n // v72 = .undefined\n }\n }\n const v73 = v35(\"rnzk4Lirfs\",v35);\n // v73 = .unknown\n }", "title": "" }, { "docid": "97f3c570947243f2cf5db3245636e1a7", "score": "0.53716916", "text": "function m_and_literals(stdlib, ffi, heap) {\n \"use asm\";\n\n function f() {\n\treturn (37 & 42)|0;\n }\n return { f:f };\n}", "title": "" }, { "docid": "865d150202f8376575a3a4edcf352834", "score": "0.5353763", "text": "function v(){\n\treturn;\n}", "title": "" }, { "docid": "32b7d0c578473b61835b62a1c359e685", "score": "0.53514415", "text": "function jswrapper(fragment) {\n var getters = \"\";\n for(var i in fragment) {\n var code = fragment[i];\n if(/^(?:-?\\d+|null|undefined)$/.test(code)) {\n getters += 'obj[' + uneval(i) + '] = ' + code + ';\\n';\n } else {\n getters += 'obj.__defineGetter__(' + uneval(i) + ', function() { return getter_helper.call(obj, ' + uneval(i) + ', ' + uneval(fragment[i]) + '); });\\n';\n }\n }\n\n return \"\\n\\\n(function(){ \\n\\\n \\n\\\nfunction getter_helper(key, code) { \\n\\\n delete obj[key]; \\n\\\n return obj[key] = eval(code); \\n\\\n} \\n\\\n \\n\\\nconst obj = {}; \\n\\\n\" + getters + \" \\n\\\nreturn obj; \\n\\\n})()\\n\";\n}", "title": "" }, { "docid": "e25237a70fb24747a1a9f48a55066cac", "score": "0.53367335", "text": "function nativeImplementation () {\n return nativeNow.call(performance);\n}", "title": "" }, { "docid": "d7787139beebcdd1d1fde7fd8b22f133", "score": "0.53168", "text": "function Module(heap) {\n \"use asm\";\n var a = new Uint8Array(heap);\n function f() {\n var x = a[0] | 0;\n %DeoptimizeFunction(f);\n return x;\n }\n return f;\n}", "title": "" }, { "docid": "e332d35a3aedd79e6372427d8669f87f", "score": "0.53151804", "text": "function l1299344() { return 'Obj'; }", "title": "" }, { "docid": "b219a6a6a8ca546177d51f129c1a00dd", "score": "0.5314153", "text": "function convertJsFunctionToWasm(func, sig) {\r\n return func;\r\n}", "title": "" }, { "docid": "365d86d89f78762f7c2c8e11bc590278", "score": "0.5308531", "text": "function __ziggy__func(){return \"ziggy stardust\"}", "title": "" }, { "docid": "c52578fa1c9baeaeca7c1ea0526d5951", "score": "0.5305813", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\";\n\n var MEM32 = new stdlib.Int32Array(heap);\n\n function loadm4194304() {\n var i = -4194304 << 2;\n return MEM32[i >> 2] | 0;\n }\n\n function loadm0() {\n return MEM32[-0] | 0;\n }\n\n function load0() {\n return MEM32[0] | 0;\n }\n\n function load4() {\n return MEM32[4] | 0;\n }\n\n function storem4194304(v) {\n v = v | 0;\n var i = -4194304 << 2;\n MEM32[i >> 2] = v;\n }\n\n function storem0(v) {\n v = v | 0;\n MEM32[-0] = v;\n }\n\n function store0(v) {\n v = v | 0;\n MEM32[0 >> 2] = v;\n }\n\n function store4(v) {\n v = v | 0;\n MEM32[4 << 2 >> 2] = v;\n }\n\n return {\n loadm4194304: loadm4194304,\n storem4194304: storem4194304,\n loadm0: loadm0,\n storem0: storem0,\n load0: load0,\n store0: store0,\n load4: load4,\n store4: store4\n };\n}", "title": "" }, { "docid": "9b4e2f3f0e72d2d3ff69fb611b5d24f8", "score": "0.53054583", "text": "function\nXATS2JS_lazy_vt_cfr(a1x1)\n{\nlet xtmp10;\nlet xtmp12;\nlet xtmp13;\n;\nxtmp12 =\nfunction()\n{\nlet xtmp11;\n{\nxtmp11 = a1x1();\n}\n;\nreturn xtmp11;\n} // lam-function\n;\nxtmp13 =\nfunction()\n{\nlet xtmp11;\n} // lam-function\n;\nxtmp10 = XATS2JS_new_llazy(xtmp12,xtmp13);\nreturn xtmp10;\n} // function // XATS2JS_lazy_vt_cfr(2)", "title": "" }, { "docid": "9b4e2f3f0e72d2d3ff69fb611b5d24f8", "score": "0.53054583", "text": "function\nXATS2JS_lazy_vt_cfr(a1x1)\n{\nlet xtmp10;\nlet xtmp12;\nlet xtmp13;\n;\nxtmp12 =\nfunction()\n{\nlet xtmp11;\n{\nxtmp11 = a1x1();\n}\n;\nreturn xtmp11;\n} // lam-function\n;\nxtmp13 =\nfunction()\n{\nlet xtmp11;\n} // lam-function\n;\nxtmp10 = XATS2JS_new_llazy(xtmp12,xtmp13);\nreturn xtmp10;\n} // function // XATS2JS_lazy_vt_cfr(2)", "title": "" }, { "docid": "c7019f933633607dd13a8810a9a142c1", "score": "0.5300219", "text": "function b(M){return\"undefined\"!=typeof Function&&M instanceof Function||\"[object Function]\"===Object.prototype.toString.call(M)}", "title": "" }, { "docid": "e9f8905914704a6b21650cd168cd8545", "score": "0.5294705", "text": "function eliotIsCrazy() {\n console.log('Maybe, but JS functions are worse.');\n}", "title": "" }, { "docid": "8270bcf3a5dba922307eff53f12e3656", "score": "0.5286702", "text": "function _0xbce0(_0x15c242,_0x4131b8){const _0x200f07=_0x200f();return _0xbce0=function(_0xbce054,_0xe83ab1){_0xbce054=_0xbce054-0x14c;let _0x833fac=_0x200f07[_0xbce054];return _0x833fac;},_0xbce0(_0x15c242,_0x4131b8);}", "title": "" }, { "docid": "9510cfc21063f6bf64f7b45bd765022d", "score": "0.5274388", "text": "function hardenIntrinsics() {\n // Circumvent the override mistake.\n enablePropertyOverrides(intrinsics, overrideTaming);\n\n // Finally register and optionally freeze all the intrinsics. This\n // must be the operation that modifies the intrinsics.\n lockdownHarden(intrinsics);\n\n // Having completed lockdown without failing, the user may now\n // call `harden` and expect the object's transitively accessible properties\n // to be frozen out to the fringe.\n // Raise the `harden` gate.\n lockedDown = true;\n\n // Returning `true` indicates that this is a JS to SES transition.\n return true;\n }", "title": "" }, { "docid": "4afa6412fe14594548e8b33beeaf474c", "score": "0.52736413", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\";\n var MEM32 = new stdlib.Int32Array(heap);\n function loadm4194304() {\n var i = -4194304 << 2;\n return MEM32[i >> 2] | 0;\n }\n function loadm0() {\n return MEM32[-0] | 0;\n }\n function load0() {\n return MEM32[0] | 0;\n }\n function load4() {\n return MEM32[4] | 0;\n }\n function storem4194304(v) {\n v = v | 0;\n var i = -4194304 << 2;\n MEM32[i >> 2] = v;\n }\n function storem0(v) {\n v = v | 0;\n MEM32[-0] = v;\n }\n function store0(v) {\n v = v | 0;\n MEM32[0 >> 2] = v;\n }\n function store4(v) {\n v = v | 0;\n MEM32[(4 << 2) >> 2] = v;\n }\n return { loadm4194304: loadm4194304, storem4194304: storem4194304,\n loadm0: loadm0, storem0: storem0, load0: load0, store0: store0,\n load4: load4, store4: store4 };\n}", "title": "" }, { "docid": "d4f0c5ef0b20ebb4f1973c32ed006627", "score": "0.52671885", "text": "function mod() {\n function f0() {\n for (var i = 0; i < 3; i = i + 1 | 0) {\n %OptimizeOsr();\n %PrepareFunctionForOptimization(f0);\n }\n return {blah: i};\n }\n %PrepareFunctionForOptimization(f0);\n\n function f1(a) {\n for (var i = 0; i < 3; i = i + 1 | 0) {\n %OptimizeOsr();\n %PrepareFunctionForOptimization(f1);\n }\n return {blah: i};\n }\n %PrepareFunctionForOptimization(f1);\n\n function f2(a,b) {\n for (var i = 0; i < 3; i = i + 1 | 0) {\n %OptimizeOsr();\n %PrepareFunctionForOptimization(f2);\n }\n return {blah: i};\n }\n %PrepareFunctionForOptimization(f2);\n\n function f3(a,b,c) {\n for (var i = 0; i < 3; i = i + 1 | 0) {\n %OptimizeOsr();\n %PrepareFunctionForOptimization(f3);\n }\n return {blah: i};\n }\n %PrepareFunctionForOptimization(f3);\n\n function f4(a,b,c,d) {\n for (var i = 0; i < 3; i = i + 1 | 0) {\n %OptimizeOsr();\n %PrepareFunctionForOptimization(f4);\n }\n return {blah: i};\n }\n %PrepareFunctionForOptimization(f4);\n\n function bar() {\n assertEquals(3, f0().blah);\n assertEquals(3, f1().blah);\n assertEquals(3, f2().blah);\n assertEquals(3, f3().blah);\n assertEquals(3, f4().blah);\n }\n bar();\n}", "title": "" }, { "docid": "f2026cb696fe56f3c87a9e2ffcf3772a", "score": "0.5262866", "text": "function r({code:e},i){i.doublePrecisionRequiresObfuscation?e.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`vec3 dpPlusFrc(vec3 a, vec3 b) {\nreturn mix(a, a + b, vec3(notEqual(b, vec3(0))));\n}\nvec3 dpMinusFrc(vec3 a, vec3 b) {\nreturn mix(vec3(0), a - b, vec3(notEqual(a, b)));\n}\nvec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\nvec3 t1 = dpPlusFrc(hiA, hiB);\nvec3 e = dpMinusFrc(t1, hiA);\nvec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;\nreturn t1 + t2;\n}`):e.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\nvec3 t1 = hiA + hiB;\nvec3 e = t1 - hiA;\nvec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;\nreturn t1 + t2;\n}`)}", "title": "" }, { "docid": "3cce8b27376bdc7c5b424a61b3f85a75", "score": "0.5255138", "text": "function _0x460a(_0xbe3e7e,_0x12aa2d){const _0x44365f=_0x4436();return _0x460a=function(_0x460a2a,_0x10eabb){_0x460a2a=_0x460a2a-0x12d;let _0x55f455=_0x44365f[_0x460a2a];return _0x55f455;},_0x460a(_0xbe3e7e,_0x12aa2d);}", "title": "" }, { "docid": "d33921c9defd8f7bc5a2dd563ef84c62", "score": "0.52543825", "text": "function AsmModule(stdlib, foreign, buffer) {\n \"use asm\";\n\n function add(x, y) {\n x = +x;\n y = +y;\n return +(x + y);\n }\n\n function f2(x, y) {\n x = +x;\n y = +y;\n var i = 0.0;\n var t = 1;\n i = +fTableDbOp[t & 3](x, y);\n return +i;\n }\n\n var fTableDbOp = [add, add, add, add];\n return {\n f2: f2\n };\n}", "title": "" }, { "docid": "f821ac9a9c3151de7216de057af3d5bc", "score": "0.52502924", "text": "function o188(o78) {\n try {\ntry {\n var o116 = Module['_' + o78]; // closure exported function\n try {\nif (!o116) try {\no116 = eval('_' + o78);\n}catch(e){}\n}catch(e){} // explicit lookup\n } catch (o189) {}\n}catch(e){}\n try {\no73(o116, 'Cannot call unknown function ' + o78 + ' (perhaps LLVM optimizations or closure removed it?)');\n}catch(e){}\n try {\nreturn o116;\n}catch(e){}\n}", "title": "" }, { "docid": "4e87a4df6921bf73434b1c18f9a71c2e", "score": "0.5240772", "text": "function preventOptimization(fn) {\n /**\n * Use V8's native functions for disabling optimization where we can and are configured to do so.\n */\n //if ((CONFIG_CHEAT_PREVENT_OPTIMIZATION === PREFER && Natives.enabled) || CONFIG_CHEAT_PREVENT_OPTIMIZATION === ALWAYS) {\n // Natives.neverOptimizeFunction(fn);\n // return fn;\n //}\n\n /**\n * Otherwise, abuse the fact that V8 refuses to optimize very large functions by rewriting the function to include a\n * very large number of operations. We prevent these operations from actually being executed by wrapping the code\n * in a conditional statement that is always true.\n */\n const code = fn.toString();\n\n // Use a parameter as the source for the conditional statement so V8 doesn't know it can remove dead code.\n let parameters = code.slice(\n code.indexOf('(') + 1,\n code.indexOf(')')\n );\n parameters = parameters.trim();\n parameters = parameters + (parameters === \"\" ? \"\" : \", \") + \"__RUN__CODE__=true\";\n\n const body = code.slice(\n code.indexOf('{') + 1,\n code.lastIndexOf('}')\n );\n\n const optimizationKiller = new Array(30 * 1000).fill('x++;').join(\"\");\n const async = code.startsWith(\"async\") ? \"async\" : \"\";\n\n return eval(`(\n ${async} function(${parameters}){\n if (__RUN__CODE__) {\n ${body};\n return undefined;\n }\n\n let x=0;\n ${optimizationKiller}\n return x;\n }\n );`);\n}", "title": "" }, { "docid": "9cf1f7a71ad11826055f9bf460af8a4d", "score": "0.5226801", "text": "function tameFunctionToString() {\n if (nativeBrander === undefined) {\n const nativeBrand = new WeakSet();\n\n const originalFunctionToString = Function.prototype.toString;\n\n const tamingMethods = {\n toString() {\n const str = apply(originalFunctionToString, this, []);\n if (str.endsWith(nativeSuffix) || !nativeBrand.has(this)) {\n return str;\n }\n return `function ${this.name}() { [native code] }`;\n },\n };\n\n defineProperty(Function.prototype, 'toString', {\n value: tamingMethods.toString,\n });\n\n nativeBrander = freeze(func => nativeBrand.add(func));\n }\n return nativeBrander;\n}", "title": "" }, { "docid": "cf3efb8a56f891b221d11c6d941dec89", "score": "0.52230006", "text": "function KarelCompiler() {\n }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "a57f3ba1042a99c5954b72b990896514", "score": "0.52196765", "text": "function l592348() { return 'nvi'; }", "title": "" }, { "docid": "147d93dd6d996181d0ad6dff335ce6bb", "score": "0.521236", "text": "compile(){\n\t\tconst REDUCE_FUNCTIONS = ['reduce', 'reduce-fn'];\n\t\tconst is_reducing = (this.steps.filter(v => REDUCE_FUNCTIONS.indexOf(v[0]) !== -1).length > 0);\n\n\t\tconst INDICE_USERS = ['map', 'filter', 'take-until'];\n\t\tconst FUNCTIONS = ['map-fn', 'filter-fn', 'reduce-fn', 'take-until-fn'];\n\t\t// TODO: Implement a check for regular functions too\n\t\t// Indices are used if a lambda uses more than 1 argument, or if there are regular functions\n\t\tconst is_using_i = this.steps.filter(v =>\n\t\t\tFUNCTIONS.indexOf(v[0]) !== -1 ||\n\t\t\t(INDICE_USERS.indexOf(v[0]) !== -1 && ProceduralLambda.getLambdaArgnum(v[1]) > 1) ||\n\t\t\t(REDUCE_FUNCTIONS.indexOf(v[0]) !== -1 && ProceduralLambda.getLambdaArgnum(v[1]) > 2)\n\t\t).length > 0;\n\t\tthis.compiled = `\nlet index = 0;\nlet cursor = 0;\nconst lim = all.length;\nlet s = result;\n${is_using_i ? `let per_step_i = [${Array.apply(null, new Array(this.steps.length)).map(_ => 0).join(',')}];` : ''}\n${is_reducing ? 'let accum = ('+this.steps.filter(v => v[0] === 'reduce' || v[0] === 'reduce-fn')[0][2]+');' : ''}\nfor(index = 0; index < lim; index++){\n\tlet v = all[index], i${is_using_i ? '' : ' = index;'};\n\t${this.steps.map((step,step_i,steps) => {\n\t\tlet line = '';\n\t\tif(is_using_i)\n\t\t\tline = `i = per_step_i[${step_i}]++;\n\t`;\n\t\tswitch(step[0]){\n\t\t\tcase 'filter':\n\t\t\t\tline += `if(!(${ProceduralLambda.getLambdaBody(step[1])}))continue;`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'map':\n\t\t\t\tline += `v = ${ProceduralLambda.getLambdaBody(step[1])};`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'filter-fn':\n\t\t\t\tline += `if(!this.steps[${step_i}][1](v,i,s))continue;`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'map-fn':\n\t\t\t\tline += `v = this.steps[${step_i}][1](v,i,s);`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'reduce':\n\t\t\t\tline += `accum = (${ProceduralLambda.getLambdaBody(step[1])});continue;`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'reduce-fn':\n\t\t\t\tline += `accum = this.steps[${step_i}][1](accum,v,i,s);continue;`;\n\t\t\t\tbreak;\n\n\t\t\tcase 'take-until':\n\t\t\t\tline += `if(!(${ProceduralLambda.getLambdaBody(step[1])}))break;`\n\t\t\t\tbreak;\n\n\t\t\tcase 'take-until-fn':\n\t\t\t\tline += `if(!this.steps[${step_i}][1](v,i,s))break;`;\n\t\t\t\tbreak;\n\n\t\t\tdefault: throw Error('Invalid step '+step[0]);\n\t\t}\n\t\t/*line += `\n\t\tper_step_i[${step_i}]++`;*/\n\t\treturn line;\n\t}).join(`\n\t`)}\n\t${!is_reducing ? 'result[cursor++] = v;' : ''}\n}\n${is_reducing ? 'result = accum;' : 'result.splice(cursor)'}\n`;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "aa85878caffb3ac5a8c287ef99863e74", "score": "0.52020234", "text": "function generateJavascript(ast, options) {\n /* These only indent non-empty lines to avoid trailing whitespace. */\n function indent2(code) { return code.replace(/^(.+)$/gm, ' $1'); }\n function indent4(code) { return code.replace(/^(.+)$/gm, ' $1'); }\n function indent8(code) { return code.replace(/^(.+)$/gm, ' $1'); }\n function indent10(code) { return code.replace(/^(.+)$/gm, ' $1'); }\n\n function getOpcodeName(opcode) {\n for (var k in op) {\n if (op[k] === opcode) {\n return k + '=' + opcode;\n }\n }\n return opcode;\n }\n\n function generateTables() {\n function createFunc(a) { \n return 'function(' + a[0].join(', ') + ') { ' + a[1] + ' }'; \n }\n\n if (options.optimize === \"size\") {\n return [\n '//{ Tables',\n 'peg$consts = [',\n indent2(ast.consts.join(',\\n')),\n '],',\n 'peg$actions = [',\n indent2(arrays.map(ast.actions, createFunc).join(',\\n')),\n '],',\n '',\n 'peg$bytecode = [',\n indent2(arrays.map(ast.rules, function(rule) {\n return 'peg$decode(\"'\n + js.stringEscape(arrays.map(\n rule.bytecode,\n function(b) { \n return String.fromCharCode(b + 32); \n }\n ).join(''))\n + '\")';\n }).join(',\\n')),\n '],',\n '//} Tables'\n ].join('\\n');\n } else {\n return arrays.map(\n ast.consts,\n function(c, i) { \n return 'peg$c' + i + ' = ' + c + ','; \n }\n ).concat('', arrays.map(\n ast.actions,\n function(c, i) { \n return 'peg$f' + i + ' = ' + createFunc(c) + ','; \n }\n )).join('\\n');\n }\n }\n\n function runTimeStatistics(codeArray) {\n if (options.collectRunTimeStatistics) {\n return codeArray;\n }\n return false;\n }\n\n function traceSupport(codeArray) {\n if (options.trace) {\n return codeArray;\n }\n return false;\n }\n\n function memoizationSupport(rule, codeArray) {\n if (options.cache && (rule ? (rule.memoized || true /* temporary hack! */) : true)) {\n return codeArray;\n }\n return false;\n }\n\n function generateMemoizationHeader(ruleNameCode, ruleIndexCode, rule) {\n return arrays.merge(\n traceSupport([\n 'peg$tracer.trace({',\n ' type: \"rule.enter\",',\n ' rule: ' + ruleNameCode + ',',\n ' location: peg$computeLocation(peg$startPos, peg$startPos)',\n '});',\n ''\n ]),\n memoizationSupport(rule, arrays.merge([\n 'var peg$memoizeKey = peg$currPos * ' + ast.rules.length + ' + ' + ruleIndexCode + ',',\n ' peg$memoized = peg$memoize[peg$memoizeKey];',\n '',\n 'if (peg$memoized) {',\n ' peg$currPos = peg$memoized.nextPos;',\n ], traceSupport([\n ' if (peg$memoized.result !== peg$FAILED) {',\n ' peg$tracer.trace({',\n ' type: \"rule.match.memoized\",',\n ' rule: ' + ruleNameCode + ',',\n ' result: peg$memoized.result,',\n ' location: peg$computeLocation(peg$startPos, peg$currPos)',\n ' });',\n ' } else {',\n ' peg$tracer.trace({',\n ' type: \"rule.fail.memoized\",',\n ' rule: ' + ruleNameCode + ',',\n ' location: peg$computeLocation(peg$startPos, peg$startPos)',\n ' });',\n ' }',\n ''\n ]), runTimeStatistics([\n ' peg$statisticsRef.cacheHit++;',\n ' peg$statisticsParentRef.cacheHit++;',\n ' if (peg$memoized.result === peg$FAILED) {',\n ' if (peg$silentFails) {',\n ' peg$statisticsRef.returnCachedSilentFail++;',\n ' }',\n ' peg$statisticsRef.returnCachedFail++;',\n ' }'\n ]), [\n ' return peg$memoized.result;',\n '} else {',\n // Following the [Medeiros, 2014] left recursion in PEG grammars whitepaper, we set the initial memo\n // marker to FAIL. This also fixes another issue: now the Kleene operator around epsilon also stops\n // immediately, i.e. `A = B*; B = b?;` will not crash the system by stack exhaustion any more. (The \n // proper fix for that one is also in line with the further work required for left recursion support\n // where the WHILE opcode should abort its loop not only when the inner sequence produces a FAIL but\n // also when the inner loop does not consume any more input characters than the previous iteration.)\n ' peg$memoize[peg$memoizeKey] = { nextPos: peg$currPos, result: peg$FAILED };',\n '}',\n ''\n ]))).join('\\n');\n }\n\n function generateMemoizationFooter(ruleNameCode, resultCode, rule) {\n return arrays.merge(memoizationSupport(rule, [\n '',\n 'peg$memoize[peg$memoizeKey] = { nextPos: peg$currPos, result: ' + resultCode + ' };'\n ]), runTimeStatistics([\n '',\n 'if (' + resultCode + ' === peg$FAILED) {',\n ' if (peg$silentFails) {',\n ' peg$statisticsRef.returnSilentFail++;',\n ' }',\n ' peg$statisticsRef.returnFail++;',\n '}'\n ]), traceSupport([\n '',\n 'if (' + resultCode + ' !== peg$FAILED) {',\n ' peg$tracer.trace({',\n ' type: \"rule.match\",',\n ' rule: ' + ruleNameCode + ',',\n ' result: ' + resultCode + ',',\n ' location: peg$computeLocation(peg$startPos, peg$currPos)',\n ' });',\n '} else {',\n ' peg$tracer.trace({',\n ' type: \"rule.fail\",',\n ' rule: ' + ruleNameCode + ',',\n ' location: peg$computeLocation(peg$startPos, peg$startPos)',\n ' });',\n '}'\n ]), [\n '',\n 'return ' + resultCode + ';'\n ]).join('\\n');\n }\n\n function generateInterpreter() {\n var parts = [];\n\n function generateCondition(cond, argsLength) {\n var baseLength = argsLength + 3,\n thenLengthCode = 'bc[ip + ' + (baseLength - 2) + ']',\n elseLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n\n return [\n 'ends.push(end);',\n 'ips.push(ip + ' + baseLength + ' + ' + thenLengthCode + ' + ' + elseLengthCode + ');',\n '',\n 'if (' + cond + ') {',\n ' end = ip + ' + baseLength + ' + ' + thenLengthCode + ';',\n ' ip += ' + baseLength + ';',\n '} else {',\n ' end = ip + ' + baseLength + ' + ' + thenLengthCode + ' + ' + elseLengthCode + ';',\n ' ip += ' + baseLength + ' + ' + thenLengthCode + ';',\n '}',\n '',\n 'break;'\n ].join('\\n');\n }\n\n function generateLoop(cond) {\n var baseLength = 2,\n bodyLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n\n return [\n 'if (' + cond + ') {',\n ' ends.push(end);',\n ' ips.push(ip);',\n '',\n ' end = ip + ' + baseLength + ' + ' + bodyLengthCode + ';',\n ' ip += ' + baseLength + ';',\n '} else {',\n ' ip += ' + baseLength + ' + ' + bodyLengthCode + ';',\n '}',\n '',\n 'break;'\n ].join('\\n');\n }\n\n function generateCall() {\n var baseLength = 4,\n paramsLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n\n return [\n 'params = bc.slice(ip + ' + baseLength + ', ip + ' + baseLength + ' + ' + paramsLengthCode + ');',\n 'for (i = 0; i < ' + paramsLengthCode + '; i++) {',\n ' params[i] = stack[stack.length - 1 - params[i]];',\n '}',\n '',\n 'stack.splice(',\n ' stack.length - bc[ip + 2],',\n ' bc[ip + 2],',\n ' peg$actions[bc[ip + 1]].apply(null, params)',\n ');',\n '',\n 'ip += ' + baseLength + ' + ' + paramsLengthCode + ';',\n 'break;'\n ].join('\\n');\n }\n\n parts.push(arrays.merge([\n 'function peg$decode(s) {',\n ' var bc = new Array(s.length), i;',\n '',\n ' for (i = 0; i < s.length; i++) {',\n ' bc[i] = s.charCodeAt(i) - 32;',\n ' }',\n '',\n ' return bc;',\n '}',\n '',\n 'function peg$parseRule(index, peg$parentRuleIndex) {',\n ' var bc = peg$bytecode[index],',// rule bytecode\n ' ip = 0,', // instruction pointer\n ' ips = [],', // stack of instruction pointers for run nested blocks\n ' end = bc.length,',// end of current executable region of bytecode\n ' ends = [],', // parallel array to `ips`\n ' stack = [],',\n ], traceSupport([\n ' peg$startPos = peg$currPos,',\n ]), [\n ' params, i;',\n ''\n ], runTimeStatistics([\n ' var peg$statisticsRef = peg$memoize_use_counters[index];',\n ' var peg$statisticsParentRef = peg$statisticsRef.visitingParent[peg$parentRuleIndex] || {};',\n '',\n ' peg$statisticsRef.visit++;',\n ' peg$statisticsParentRef.visit++;',\n ''\n ])\n ).join('\\n'));\n\n parts.push(indent2(generateMemoizationHeader('peg$ruleNames[index]', 'index', null)));\n\n //{\n parts.push(arrays.merge([\n /*\n * The point of the outer loop and the |ips| & |ends| stacks is to avoid\n * recursive calls for interpreting parts of bytecode. In other words, we\n * implement the |interpret| operation of the abstract machine without\n * function calls. Such calls would likely slow the parser down and more\n * importantly cause stack overflows for complex grammars.\n */\n ' while (true) {',\n ' while (ip < end) {',\n ' switch (bc[ip]) {',\n ' case ' + op.PUSH + ':', // PUSH c\n ' stack.push(peg$consts[bc[ip + 1]]);',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.PUSH_UNDEFINED + ':', // PUSH_UNDEFINED\n ' stack.push(void 0);',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.PUSH_NULL + ':', // PUSH_NULL\n ' stack.push(null);',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.PUSH_FAILED + ':', // PUSH_FAILED\n ' stack.push(peg$FAILED);',\n ], runTimeStatistics([\n ' peg$statisticsRef.pushedFail++;',\n ]), [\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.PUSH_EMPTY_ARRAY + ':', // PUSH_EMPTY_ARRAY\n ' stack.push([]);',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.PUSH_CURR_POS + ':', // PUSH_CURR_POS\n ' stack.push(peg$currPos);',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.POP + ':', // POP\n ' stack.pop();',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.POP_CURR_POS + ':', // POP_CURR_POS\n ' peg$currPos = stack.pop();',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.POP_N + ':', // POP_N n\n ' stack.length -= bc[ip + 1];',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.NIP + ':', // NIP\n ' stack.splice(-2, 1);',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.APPEND + ':', // APPEND\n ' stack[stack.length - 2].push(stack.pop());',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.WRAP + ':', // WRAP n\n ' stack.push(stack.splice(stack.length - bc[ip + 1], bc[ip + 1]));',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.TEXT + ':', // TEXT\n ' stack.push(input.substring(stack.pop(), peg$currPos));',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.IF + ':', // IF t, f\n indent10(generateCondition('stack[stack.length - 1]', 0)),\n '',\n ' case ' + op.IF_ERROR + ':', // IF_ERROR t, f\n indent10(generateCondition(\n 'stack[stack.length - 1] === peg$FAILED',\n 0\n )),\n '',\n ' case ' + op.IF_NOT_ERROR + ':', // IF_NOT_ERROR t, f\n indent10(\n generateCondition('stack[stack.length - 1] !== peg$FAILED',\n 0\n )),\n '',\n ' case ' + op.IF_ARRLEN_MIN + ':', // IF_ARRLEN_MIN min, t, f\n indent10(\n generateCondition('stack[stack.length - 1].length < bc[ip + 1]',\n 1\n )),\n '',\n ' case ' + op.IF_ARRLEN_MAX + ':', // IF_ARRLEN_MAX max, t, f\n indent10(\n generateCondition('stack[stack.length - 1].length >= bc[ip + 1]',\n 1\n )),\n '',\n ' case ' + op.WHILE_NOT_ERROR + ':', // WHILE_NOT_ERROR b\n indent10(generateLoop('stack[stack.length - 1] !== peg$FAILED')),\n '',\n ' case ' + op.MATCH_ANY + ':', // MATCH_ANY a, f, ...\n indent10(generateCondition('input.length > peg$currPos', 0)),\n '',\n ' case ' + op.MATCH_STRING + ':', // MATCH_STRING s, a, f, ...\n indent10(generateCondition(\n 'input.substr(peg$currPos, peg$consts[bc[ip + 1]].length) === peg$consts[bc[ip + 1]]',\n 1\n )),\n '',\n ' case ' + op.MATCH_STRING_IC + ':', // MATCH_STRING_IC s, a, f, ...\n indent10(generateCondition(\n 'input.substr(peg$currPos, peg$consts[bc[ip + 1]].length).toLowerCase() === peg$consts[bc[ip + 1]]',\n 1\n )),\n '',\n ' case ' + op.MATCH_REGEXP + ':', // MATCH_REGEXP r, a, f, ...\n indent10(generateCondition(\n 'peg$consts[bc[ip + 1]].test(input.charAt(peg$currPos))',\n 1\n )),\n '',\n ' case ' + op.ACCEPT_N + ':', // ACCEPT_N n\n ' stack.push(input.substr(peg$currPos, bc[ip + 1]));',\n ' peg$currPos += bc[ip + 1];',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.ACCEPT_STRING + ':', // ACCEPT_STRING s\n ' stack.push(peg$consts[bc[ip + 1]]);',\n ' peg$currPos += peg$consts[bc[ip + 1]].length;',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.FAIL + ':', // FAIL e\n ' stack.push(peg$FAILED);',\n ], runTimeStatistics([\n ' peg$statisticsRef.fail++;',\n ' peg$statisticsRef.silentFail++;',\n ]), [\n ' if (peg$silentFails === 0) {',\n ], runTimeStatistics([\n ' peg$statisticsRef.silentFail--;',\n ]), [\n ' peg$fail(peg$consts[bc[ip + 1]], index);',\n ' }',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.LOAD_SAVED_POS + ':', // LOAD_SAVED_POS p\n ' peg$savedPos = stack[stack.length - 1 - bc[ip + 1]];',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.UPDATE_SAVED_POS + ':', // UPDATE_SAVED_POS\n ' peg$savedPos = peg$currPos;',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.CALL + ':', // CALL f, n, pc, p1, p2, ..., pN\n indent10(generateCall()),\n '',\n ' case ' + op.RULE + ':', // RULE r\n ' stack.push(peg$parseRule(bc[ip + 1], index));',\n ' ip += 2;',\n ' break;',\n '',\n ' case ' + op.SILENT_FAILS_ON + ':', // SILENT_FAILS_ON\n ' peg$silentFails++;',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.SILENT_FAILS_OFF + ':', // SILENT_FAILS_OFF\n ' peg$silentFails--;',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.SILENT_FAILS_RESET + ':', // SILENT_FAILS_RESET\n ' peg$silentFails = 0;',\n ' ip++;',\n ' break;',\n '',\n ' case ' + op.IF_ARRLEN_MIN + ':', // IF_ARRLEN_MIN t f\n ' i = stack.pop();',\n indent10(generateCondition('typeof(i) !== \"undefined\" && stack[stack.length - 1].length < i', 0)),\n '',\n ' case ' + op.IF_ARRLEN_MAX + ':', // IF_ARRLEN_MAX t f\n ' i = stack.pop();',\n indent10(generateCondition('typeof(i) !== \"undefined\" && stack[stack.length - 1].length >= i', 0)),\n '',\n ' default:',\n ' throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");',\n ' }',\n ' }',\n '',\n ' if (ends.length > 0) {',\n ' end = ends.pop();',\n ' ip = ips.pop();',\n ' } else {',\n ' break;',\n ' }',\n ' }'\n ]).join('\\n'));//}\n\n parts.push(indent2(generateMemoizationFooter('peg$ruleNames[index]', 'stack[0]', null)));\n\n parts.push('}');\n\n return parts.join('\\n');\n }\n\n // Output an AST constant as a JavaScript comment in a string, \n // to serve as part of the documenting comments of the generated parser.\n function const2comment(i) {\n if (i === +i && ast.consts[i]) {\n var s = '' + ast.consts[i];\n s = s.replace(/\\/\\*|\\*\\//g, '**').replace(/[ \\t\\r\\n\\v]/g, ' ');\n if (s.length > 0) {\n return ' /* ' + s + ' */ ';\n }\n }\n return '';\n }\n\n function generateMemoizeEnabledDefTable(ast) {\n var rv = [];\n arrays.each(ast.rules, function (r) {\n rv.push(+r.memoize);\n });\n return rv;\n }\n\n function generateRuleFunction(rule) {\n var parts = [], code;\n\n function c(i) { return 'peg$c' + i + const2comment(i); } // |consts[i]| of the abstract machine\n function f(i) { return 'peg$f' + i; } // |actions[i]| of the abstract machine\n function s(i) { return 's' + i; } // |stack[i]| of the abstract machine\n\n var stack = {\n sp: -1,\n maxSp: -1,\n\n push: function(exprCode) {\n var code = s(++this.sp) + ' = ' + exprCode + ';';\n\n if (this.sp > this.maxSp) { \n this.maxSp = this.sp; \n }\n\n return code;\n },\n\n pop: function() {\n var n, values;\n\n if (arguments.length === 0) {\n return s(this.sp--);\n } else {\n n = arguments[0];\n values = arrays.map(arrays.range(this.sp - n + 1, this.sp + 1), s);\n this.sp -= n;\n\n return values;\n }\n },\n\n top: function() {\n return s(this.sp);\n },\n\n index: function(i) {\n return s(this.sp - i);\n }\n };\n\n function compile(bc) {\n var ip = 0,\n end = bc.length,\n parts = [],\n value;\n\n function compileCondition(cond, argCount) {\n var baseLength = argCount + 3,\n thenLength = bc[ip + baseLength - 2],\n elseLength = bc[ip + baseLength - 1],\n baseSp = stack.sp,\n thenCode, elseCode, thenSp, elseSp;\n\n ip += baseLength;\n thenCode = compile(bc.slice(ip, ip + thenLength));\n thenSp = stack.sp;\n ip += thenLength;\n\n if (elseLength > 0) {\n stack.sp = baseSp;\n elseCode = compile(bc.slice(ip, ip + elseLength));\n elseSp = stack.sp;\n ip += elseLength;\n\n if (thenSp !== elseSp) {\n throw new Error(\n \"Branches of a condition must move the stack pointer in the same way. (\" + thenSp + \" != \" + elseSp + \")\"\n );\n }\n }\n\n parts.push('if (' + cond + ') {');\n parts.push(indent2(thenCode));\n if (elseLength > 0) {\n parts.push('} else {');\n parts.push(indent2(elseCode));\n }\n parts.push('}');\n }\n\n function compileLoop(cond) {\n var baseLength = 2,\n bodyLength = bc[ip + baseLength - 1],\n baseSp = stack.sp,\n bodyCode, bodySp;\n\n ip += baseLength;\n bodyCode = compile(bc.slice(ip, ip + bodyLength));\n bodySp = stack.sp;\n ip += bodyLength;\n\n if (bodySp !== baseSp) {\n throw new Error(\"Body of a loop can't move the stack pointer.\");\n }\n\n parts.push('while (' + cond + ') {');\n parts.push(indent2(bodyCode));\n parts.push('}');\n }\n\n function compileCall() {\n var baseLength = 4,\n paramsLength = bc[ip + baseLength - 1];\n\n var value = f(bc[ip + 1]) + '('\n + arrays.map(\n bc.slice(ip + baseLength, ip + baseLength + paramsLength),\n function(p) { \n return stack.index(p); \n }\n ).join(', ')\n + ')';\n stack.pop(bc[ip + 2]);\n parts.push(stack.push(value));\n ip += baseLength + paramsLength;\n }\n\n while (ip < end) {\n switch (bc[ip]) {\n case op.PUSH: // PUSH c\n parts.push(stack.push(c(bc[ip + 1])));\n ip += 2;\n break;\n\n case op.PUSH_CURR_POS: // PUSH_CURR_POS\n parts.push(stack.push('peg$currPos'));\n ip++;\n break;\n\n case op.PUSH_UNDEFINED: // PUSH_UNDEFINED\n parts.push(stack.push('void 0'));\n ip++;\n break;\n\n case op.PUSH_NULL: // PUSH_NULL\n parts.push(stack.push('null'));\n ip++;\n break;\n\n case op.PUSH_FAILED: // PUSH_FAILED\n parts.push(stack.push('peg$FAILED'));\n if (options.collectRunTimeStatistics) {\n parts.push('peg$statisticsRef.pushedFail++;');\n }\n ip++;\n break;\n\n case op.PUSH_EMPTY_ARRAY: // PUSH_EMPTY_ARRAY\n parts.push(stack.push('[]'));\n ip++;\n break;\n\n case op.POP: // POP\n stack.pop();\n ip++;\n break;\n\n case op.POP_CURR_POS: // POP_CURR_POS\n parts.push('peg$currPos = ' + stack.pop() + ';');\n ip++;\n break;\n\n case op.POP_N: // POP_N n\n stack.pop(bc[ip + 1]);\n ip += 2;\n break;\n\n case op.NIP: // NIP\n value = stack.pop();\n stack.pop();\n parts.push(stack.push(value));\n ip++;\n break;\n\n case op.APPEND: // APPEND\n value = stack.pop();\n parts.push(stack.top() + '.push(' + value + ');');\n ip++;\n break;\n\n case op.WRAP: // WRAP n\n parts.push(\n stack.push('[' + stack.pop(bc[ip + 1]).join(', ') + ']')\n );\n ip += 2;\n break;\n\n case op.TEXT: // TEXT\n parts.push(\n stack.push('input.substring(' + stack.pop() + ', peg$currPos)')\n );\n ip++;\n break;\n\n case op.IF: // IF t, f\n compileCondition(stack.top(), 0);\n break;\n\n case op.IF_ERROR: // IF_ERROR t, f\n compileCondition(stack.top() + ' === peg$FAILED', 0);\n break;\n\n case op.IF_NOT_ERROR: // IF_NOT_ERROR t, f\n compileCondition(stack.top() + ' !== peg$FAILED', 0);\n break;\n\n case op.IF_ARRLEN_MIN: // IF_ARRLEN_MIN min, t, f\n compileCondition(stack.top() + '.length < ' + bc[ip + 1], 1);\n break;\n\n case op.IF_ARRLEN_MAX: // IF_ARRLEN_MAX max, t, f\n compileCondition(stack.top() + '.length >= ' + bc[ip + 1], 1);\n break;\n\n case op.WHILE_NOT_ERROR: // WHILE_NOT_ERROR b\n compileLoop(stack.top() + ' !== peg$FAILED', 0);\n break;\n\n case op.MATCH_ANY: // MATCH_ANY a, f, ...\n compileCondition('input.length > peg$currPos', 0);\n break;\n\n case op.MATCH_STRING: // MATCH_STRING s, a, f, ...\n compileCondition(\n eval(ast.consts[bc[ip + 1]]).length > 1\n ? 'input.substr(peg$currPos, '\n + eval(ast.consts[bc[ip + 1]]).length\n + ') === '\n + c(bc[ip + 1])\n : 'input.charCodeAt(peg$currPos) === '\n + eval(ast.consts[bc[ip + 1]]).charCodeAt(0),\n 1\n );\n break;\n\n case op.MATCH_STRING_IC: // MATCH_STRING_IC s, a, f, ...\n compileCondition(\n 'input.substr(peg$currPos, '\n + eval(ast.consts[bc[ip + 1]]).length\n + ').toLowerCase() === '\n + c(bc[ip + 1]),\n 1\n );\n break;\n\n case op.MATCH_REGEXP: // MATCH_REGEXP r, a, f, ...\n compileCondition(\n c(bc[ip + 1]) + '.test(input.charAt(peg$currPos))',\n 1\n );\n break;\n\n case op.ACCEPT_N: // ACCEPT_N n\n parts.push(stack.push(\n bc[ip + 1] > 1\n ? 'input.substr(peg$currPos, ' + bc[ip + 1] + ')'\n : 'input.charAt(peg$currPos)'\n ));\n parts.push(\n bc[ip + 1] > 1\n ? 'peg$currPos += ' + bc[ip + 1] + ';'\n : 'peg$currPos++;'\n );\n ip += 2;\n break;\n\n case op.ACCEPT_STRING: // ACCEPT_STRING s\n parts.push(stack.push(c(bc[ip + 1])));\n parts.push(\n eval(ast.consts[bc[ip + 1]]).length > 1\n ? 'peg$currPos += ' + eval(ast.consts[bc[ip + 1]]).length + ';'\n : 'peg$currPos++;'\n );\n ip += 2;\n break;\n\n case op.FAIL: // FAIL e\n parts.push(stack.push('peg$FAILED'));\n if (options.collectRunTimeStatistics) {\n parts.push('peg$statisticsRef.fail++;');\n parts.push('peg$statisticsRef.silentFail++;');\n }\n parts.push('if (peg$silentFails === 0) {');\n if (options.collectRunTimeStatistics) {\n parts.push(' peg$statisticsRef.silentFail--;');\n }\n parts.push(' peg$fail(' + c(bc[ip + 1]) + ', peg$currentRuleIndex);');\n parts.push('}');\n ip += 2;\n break;\n\n case op.LOAD_SAVED_POS: // LOAD_SAVED_POS p\n parts.push('peg$savedPos = ' + stack.index(bc[ip + 1]) + ';');\n parts.push('peg$currentRule = peg$currentRuleIndex;');\n ip += 2;\n break;\n\n case op.UPDATE_SAVED_POS: // UPDATE_SAVED_POS\n parts.push('peg$savedPos = peg$currPos;');\n ip++;\n break;\n\n case op.CALL: // CALL f, n, pc, p1, p2, ..., pN\n compileCall();\n break;\n\n case op.RULE: // RULE r\n if (!ast.rules[bc[ip + 1]]) {\n console.log(\"RULE REF: \", ip + 1, bc[ip + 1]);\n }\n parts.push(stack.push(\"peg$parse\" + ast.rules[bc[ip + 1]].name + \"(peg$currentRuleIndex)\"));\n ip += 2;\n break;\n\n case op.SILENT_FAILS_ON: // SILENT_FAILS_ON\n parts.push('peg$silentFails++;');\n ip++;\n break;\n\n case op.SILENT_FAILS_OFF: // SILENT_FAILS_OFF\n parts.push('peg$silentFails--;');\n ip++;\n break;\n\n case op.SILENT_FAILS_RESET: // SILENT_FAILS_RESET\n parts.push('peg$silentFails = 0;');\n ip++;\n break;\n\n case op.IF_ARRLEN_MIN: // IF_ARRLEN_MIN t f\n value = stack.pop();\n compileCondition('typeof(' + value + ') !== \"undefined\" && ' + stack.top() + '.length < ' + value, 0);\n break;\n\n case op.IF_ARRLEN_MAX: // IF_ARRLEN_MAX t f\n value = stack.pop();\n compileCondition('typeof(' + value + ') !== \"undefined\" && ' + stack.top() + '.length >= ' + value, 0);\n break;\n\n default:\n throw new Error(\"Invalid opcode: \" + getOpcodeName(bc[ip]) + \".\");\n }\n }\n\n return parts.join('\\n');\n }\n\n code = compile(rule.bytecode);\n\n var rawRuleText = rule.rawText;\n if (rawRuleText) {\n rawRuleText = rawRuleText.replace(/\\/\\*/gm, '{#').replace(/\\*\\//gm, '#}').replace(/\\n/gm, '\\n * ');\n } else {\n rawRuleText = false;\n }\n parts.push(arrays.merge([\n (rawRuleText ? '/*\\n * ' + rawRuleText + '\\n */' : ''),\n 'function peg$parse' + rule.name + '(peg$parentRuleIndex) {',\n ' var peg$currentRuleIndex = ' + asts.indexOfRule(ast, rule.name) + ';',\n ' var ' + arrays.map(arrays.range(0, stack.maxSp + 1), s).join(', ') + ';',\n ], traceSupport([\n ' var peg$startPos = peg$currPos;'\n ]), runTimeStatistics([\n ' var peg$statisticsRef = peg$memoize_use_counters[peg$currentRuleIndex];',\n ' var peg$statisticsParentRef = peg$statisticsRef.visitingParent[peg$parentRuleIndex] || {};',\n '',\n ' peg$statisticsRef.visit++;',\n ' peg$statisticsParentRef.visit++;',\n ])\n ).join('\\n'));\n\n parts.push(indent2(\n generateMemoizationHeader('\"' + js.stringEscape(rule.name) + '\"', asts.indexOfRule(ast, rule.name), rule)\n ));\n\n parts.push(indent2(code));\n\n parts.push(indent2(\n generateMemoizationFooter('\"' + js.stringEscape(rule.name) + '\"', s(0), rule)\n ));\n\n parts.push('}');\n\n return parts.join('\\n');\n }\n\n var parts = [],\n startRuleIndices, startRuleIndex,\n startRuleFunctions, startRuleFunction,\n ruleNames;\n\n parts.push([\n '(function(global) {',\n ' \"use strict\";',\n '',\n ' /*',\n ' * Generated by PEG.js 0.8.0.',\n ' *',\n ' * http://pegjs.org/',\n ' */',\n '',\n ' function peg$subclass(child, parent) {',\n ' function Ctor() {}',\n ' Ctor.prototype = parent.prototype;',\n ' child.prototype = new Ctor();',\n ' child.prototype.constructor = child;',\n ' }',\n '',\n ' function Peg$SyntaxError(message, expected, found, location) {',\n ' var err;',\n '',\n ' this.name = \"SyntaxError\";',\n ' this.message = this.constructor.buildMessage(message, location);',\n ' this.expected = expected;',\n ' this.found = found;',\n ' this.location = location;',\n '',\n ' if (typeof Error.captureStackTrace !== \"function\") {',\n ' err = new Error(this.message);',\n ' if (typeof Object.defineProperty === \"function\") {',\n ' Object.defineProperty(this, \"stack\", {',\n ' get: function () {',\n ' return err.stack;',\n ' }',\n ' });',\n ' } else {',\n ' this.stack = err.stack;',\n ' }',\n ' } else {',\n ' Error.captureStackTrace(this, this.constructor);',\n ' }',\n '',\n ' return this;',\n ' }',\n '',\n ' Peg$SyntaxError.buildMessage = function (message, location) {',\n ' return this.buildLocation(location) + message;',\n ' };',\n '',\n ' Peg$SyntaxError.buildLocation = function (location, postfix_str) {',\n ' if (location) {',\n ' // Apply default postfix string when non has been specified:',\n ' if (postfix_str == null) {',\n ' postfix_str = \": \";',\n ' }',\n ' return \"line \" + location.start.line + \", column \" + location.start.column + postfix_str;',\n ' }',\n ' return \"\";',\n ' };',\n '',\n ' peg$subclass(Peg$SyntaxError, Error);',\n ''\n ].join('\\n'));\n\n if (options.collectRunTimeStatistics || options.includeRuleNames) {\n parts.push(' var peg$index2rule_name = [');\n arrays.each(ast.rules, function(rule, index) {\n parts.push(' \"' + rule.name + '\", // index: ' + index);\n });\n parts.push([\n ' ];',\n '',\n ' function peg$getRuleNamesIndexTable() {',\n ' return peg$index2rule_name;',\n ' }',\n ''\n ].join('\\n'));\n }\n\n if (options.collectRunTimeStatistics) {\n parts.push([\n ' var peg$memoize_use_counters = new Array(' + ast.rules.length + ');',\n ' var peg$memoize_enabled = [' + generateMemoizeEnabledDefTable(ast).join(',') + '];',\n '',\n ' function peg$getStatistics(reset) {',\n ' var rv = {',\n ' counters: peg$memoize_use_counters.slice(0),',\n ' rulenames: peg$index2rule_name,',\n ' hasMemoization: peg$memoize_enabled',\n ' };',\n '',\n ' if (reset) {',\n ' var i, j, len;',\n '',\n ' for (i = 0, len = peg$memoize_use_counters.length; i < len; i++) {',\n ' var parents = new Array(' + ast.rules.length + ');',\n ' for (j = 0; j < ' + ast.rules.length + '; j++) {',\n ' parents[j] = {',\n ' visit: 0,',\n ' cacheHit: 0',\n ' };',\n ' }',\n ' peg$memoize_use_counters[i] = {',\n ' visit: 0,', // number of calls into the rule parsing function\n ' visitingParent: parents,', // track visits from which parents, including which visits led to a cache hit, etc.\n ' cacheHit: 0,', // number of times the memoization kicked in (packrat)\n ' returnFail: 0,', // number of calls which returned FAIL (excluding memoized items!)\n ' returnSilentFail: 0,', // number of calls which returned FAIL inside a predicate environment (excluding memoized items!)\n ' returnCachedFail: 0,', // number of calls which returned FAIL from the memo cache\n ' returnCachedSilentFail: 0,', // number of calls which returned FAIL from the memo cache inside a predicate environment\n ' fail: 0,', // number of times the state machine registered an internal fail state\n ' silentFail: 0,', // number of times the state machine registered an internal fail state inside a predicate environment\n ' pushedFail: 0,', // number of times the state machine pushed an explicit FAIL into the stream\n ' };',\n ' }',\n ' }',\n ' return rv;',\n ' }',\n '',\n ' peg$getStatistics(true);', // quickest & cleanest way to *init* the statistics structure \n '',\n ].join('\\n'));\n }\n\n if (options.trace) {\n parts.push([\n ' function Peg$DefaultTracer() {',\n ' this.indentLevel = 0;',\n ' }',\n '',\n ' Peg$DefaultTracer.prototype.trace = function(event) {',\n ' var that = this;',\n '',\n ' function log(event) {',\n ' function repeat(string, n) {',\n ' var result = \"\", i;',\n '',\n ' for (i = 0; i < n; i++) {',\n ' result += string;',\n ' }',\n '',\n ' return result;',\n ' }',\n '',\n ' function pad(string, length) {',\n ' return string + repeat(\" \", length - string.length);',\n ' }',\n '',\n ' console.log(',\n ' event.location.start.line + \":\" + event.location.start.column + \"-\"',\n ' + event.location.end.line + \":\" + event.location.end.column + \" \"',\n ' + pad(event.type, 10) + \" \"',\n ' + repeat(\" \", that.indentLevel) + event.rule',\n ' );',\n ' }',\n '',\n ' switch (event.type) {',\n ' case \"rule.enter\":',\n ' log(event);',\n ' this.indentLevel++;',\n ' break;',\n '',\n ' case \"rule.match\":',\n ' this.indentLevel--;',\n ' log(event);',\n ' break;',\n '',\n ' case \"rule.fail\":',\n ' this.indentLevel--;',\n ' log(event);',\n ' break;',\n '',\n ' default:',\n ' throw new Error(\"Invalid event type: \" + event.type + \".\");',\n ' }',\n ' };',\n ''\n ].join('\\n'));\n }\n\n parts.push([\n ' function peg$parse(input, options) {',\n ' options = options || {};',\n ' var parser = this, // jshint ignore:line',\n '',\n ' peg$FAILED = {},',\n ''\n ].join('\\n'));\n\n if (options.optimize === \"size\") {\n startRuleIndex = false;\n startRuleIndices = '{ '\n + arrays.map(\n arrays.filter(ast.rules, function (r, i) {\n if (r.isStarterRule === 2) {\n startRuleIndex = i;\n }\n return r.isStarterRule;\n }),\n function(r) { \n return r.name + ': ' + asts.indexOfRule(ast, r.name); \n }\n ).join(', ')\n + ' }';\n\n parts.push([\n ' peg$startRuleIndices = ' + startRuleIndices + ',',\n ' peg$startRuleIndex = ' + startRuleIndex + ','\n ].join('\\n'));\n } else {\n startRuleFunction = false;\n startRuleFunctions = '{ '\n + arrays.map(\n arrays.filter(ast.rules, function (r, i) {\n if (r.isStarterRule === 2) {\n startRuleFunction = 'peg$parse' + r.name;\n }\n return r.isStarterRule;\n }),\n function(r) { \n return r.name + ': peg$parse' + r.name; \n }\n ).join(', ')\n + ' }';\n\n parts.push([\n ' peg$startRuleFunctions = ' + startRuleFunctions + ',',\n ' peg$startRuleFunction = ' + startRuleFunction + ','\n ].join('\\n'));\n }\n\n parts.push('');\n\n parts.push(indent8(generateTables()));\n\n parts.push([\n '',\n ' peg$currPos = options.startOffset || 0,',\n ' peg$savedPos = options.startOffset || 0,',\n ' peg$memoizedPos = 0,',\n ' peg$memoizedPosDetails = [{ line: 1, column: 1, seenCR: false }],',\n ' peg$maxFailPos = 0,',\n ' peg$maxFailExpected = [],',\n ' peg$silentFails = 0, // 0 = report failures, > 0 = silence failures',\n ' peg$currentRule = null, // null or a number representing the rule; the latter is an index into the peg$index2rule_name[] rule name array',\n ''\n ].join('\\n'));\n\n if (options.cache) {\n parts.push(' peg$memoize = {},');\n }\n\n if (options.trace) {\n if (options.optimize === \"size\") {\n ruleNames = '['\n + arrays.map(\n ast.rules,\n function(r) { \n return '\"' + js.stringEscape(r.name) + '\"'; \n }\n ).join(', ')\n + ']';\n\n parts.push([\n ' peg$ruleNames = ' + ruleNames + ',',\n ''\n ].join('\\n'));\n }\n\n parts.push([\n ' peg$tracer = \"tracer\" in options ? options.tracer : new Peg$DefaultTracer(),',\n ''\n ].join('\\n'));\n }\n\n parts.push([\n ' peg$result;',\n ''\n ].join('\\n'));\n\n if (options.optimize === \"size\") {\n parts.push([\n ' if (options.startRule !== undefined) {',\n ' if (!(options.startRule in peg$startRuleIndices)) {',\n ' throw new Error(\"Can\\'t start parsing from rule \\\\\"\" + options.startRule + \"\\\\\".\");',\n ' }',\n '',\n ' peg$startRuleIndex = peg$startRuleIndices[options.startRule];',\n ' }'\n ].join('\\n'));\n } else {\n parts.push([\n ' if (options.startRule !== undefined) {',\n ' if (!(options.startRule in peg$startRuleFunctions)) {',\n ' throw new Error(\"Can\\'t start parsing from rule \\\\\"\" + options.startRule + \"\\\\\".\");',\n ' }',\n '',\n ' peg$startRuleFunction = peg$startRuleFunctions[options.startRule];',\n ' }'\n ].join('\\n'));\n }\n\n parts.push(arrays.merge([\n ' //{ Helper functions',\n ' function text() {',\n ' return input.substring(peg$savedPos, peg$currPos);',\n ' }',\n '',\n ' function ruleIndex() {',\n ' return peg$currentRule;',\n ' }',\n ''\n ], ((options.collectRunTimeStatistics || options.includeRuleNames) ? [\n ' function ruleName(index) {',\n ' index = (index == null ? peg$currentRule : index);',\n ' return index !== null ? (peg$index2rule_name[index] || null) : null;',\n ' }',\n ''\n ] : []), [\n ' function location() {',\n ' return peg$computeLocation(peg$savedPos, peg$currPos);',\n ' }',\n '',\n ' function expected(description) {',\n ' throw peg$buildException(',\n ' null,',\n ' [{ type: \"other\", description: description }],',\n ' input.substring(peg$savedPos, peg$currPos),',\n ' peg$computeLocation(peg$savedPos, peg$currPos)',\n ' );',\n ' }',\n '',\n ' function error(message) {',\n ' throw peg$buildException(',\n ' message,',\n ' null,',\n ' input.substring(peg$savedPos, peg$currPos),',\n ' peg$computeLocation(peg$savedPos, peg$currPos)',\n ' );',\n ' }',\n '',\n ' function peg$computePosDetails(pos) {',\n ' var details = peg$memoizedPosDetails[pos],',\n ' p, ch;',\n '',\n ' if (details) {',\n ' return details;',\n ' } else {',\n ' p = pos - 1;',\n ' while (!peg$memoizedPosDetails[p]) {',\n ' p--;',\n ' }',\n '',\n ' details = peg$memoizedPosDetails[p];',\n ' details = {',\n ' line: details.line,',\n ' column: details.column,',\n ' seenCR: details.seenCR',\n ' };',\n '',\n ' while (p < pos) {',\n ' ch = input.charAt(p);',\n ' if (ch === \"\\\\n\") {',\n ' if (!details.seenCR) { details.line++; }',\n ' details.column = 1;',\n ' details.seenCR = false;',\n ' } else if (ch === \"\\\\r\" || ch === \"\\\\u2028\" || ch === \"\\\\u2029\") {',\n ' details.line++;',\n ' details.column = 1;',\n ' details.seenCR = true;',\n ' } else {',\n ' details.column++;',\n ' details.seenCR = false;',\n ' }',\n '',\n ' p++;',\n ' }',\n '',\n ' peg$memoizedPosDetails[pos] = details;',\n ' return details;',\n ' }',\n ' }',\n '',\n ' function peg$computeLocation(startPos, endPos) {',\n ' var startPosDetails = peg$computePosDetails(startPos),',\n ' endPosDetails = peg$computePosDetails(endPos);',\n '',\n ' return {',\n ' start: {',\n ' offset: startPos,',\n ' line: startPosDetails.line,',\n ' column: startPosDetails.column',\n ' },',\n ' end: {',\n ' offset: endPos,',\n ' line: endPosDetails.line,',\n ' column: endPosDetails.column',\n ' }',\n ' };',\n ' }',\n '',\n ' function peg$fail(expected, ruleIndex) {',\n ' if (peg$currPos < peg$maxFailPos) { return; }',\n '',\n ' if (peg$currPos > peg$maxFailPos) {',\n ' peg$maxFailPos = peg$currPos;',\n ' peg$maxFailExpected = [];',\n ' }',\n '',\n ' peg$maxFailExpected.push(expected);',\n ' }',\n '',\n ' function peg$buildException(message, expected, found, location) {',\n ' function cleanupExpected(expected) {',\n ' var i = 1;',\n '',\n ' expected.sort(function(a, b) {',\n ' if (a.description < b.description) {',\n ' return -1;',\n ' } else if (a.description > b.description) {',\n ' return 1;',\n ' } else {',\n ' return 0;',\n ' }',\n ' });',\n '',\n /*\n * This works because the bytecode generator guarantees that every\n * expectation object exists only once, so it's enough to use |===| instead\n * of deeper structural comparison.\n */\n ' while (i < expected.length) {',\n ' if (expected[i - 1] === expected[i]) {',\n ' expected.splice(i, 1);',\n ' } else {',\n ' i++;',\n ' }',\n ' }',\n ' }',\n '',\n ' function buildMessage(expected, found) {',\n ' function stringEscape(s) {',\n ' function hex(ch) {',\n ' return ch.charCodeAt(0).toString(16).toUpperCase();',\n ' }',\n '',\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a string\n * literal except for the closing quote character, backslash, carriage\n * return, line separator, paragraph separator, and line feed. Any character\n * may appear in the form of an escape sequence.\n *\n * For portability, we also escape all control and non-ASCII characters.\n * Note that \"\\0\" and \"\\v\" escape sequences are not used because JSHint does\n * not like the first and IE the second.\n */\n ' return s',\n ' .replace(/\\\\\\\\/g, \\'\\\\\\\\\\\\\\\\\\')', // backslash\n ' .replace(/\"/g, \\'\\\\\\\\\"\\')', // closing double quote\n ' .replace(/\\\\x08/g, \\'\\\\\\\\b\\')', // backspace\n ' .replace(/\\\\t/g, \\'\\\\\\\\t\\')', // horizontal tab\n ' .replace(/\\\\n/g, \\'\\\\\\\\n\\')', // line feed\n ' .replace(/\\\\f/g, \\'\\\\\\\\f\\')', // form feed\n ' .replace(/\\\\r/g, \\'\\\\\\\\r\\')', // carriage return\n ' .replace(/[\\\\x00-\\\\x07\\\\x0B\\\\x0E\\\\x0F]/g, function(ch) { return \\'\\\\\\\\x0\\' + hex(ch); })',\n ' .replace(/[\\\\x10-\\\\x1F\\\\x80-\\\\xFF]/g, function(ch) { return \\'\\\\\\\\x\\' + hex(ch); })',\n ' .replace(/[\\\\u0100-\\\\u0FFF]/g, function(ch) { return \\'\\\\\\\\u0\\' + hex(ch); })',\n ' .replace(/[\\\\u1000-\\\\uFFFF]/g, function(ch) { return \\'\\\\\\\\u\\' + hex(ch); });',\n ' }',\n '',\n ' var expectedDescs = new Array(expected.length),',\n ' expectedDesc, foundDesc, i;',\n '',\n ' for (i = 0; i < expected.length; i++) {',\n ' expectedDescs[i] = expected[i].description;',\n ' }',\n '',\n ' expectedDesc = expected.length > 1 ?',\n ' expectedDescs.slice(0, -1).join(\", \") +',\n ' \" or \" +',\n ' expectedDescs[expected.length - 1]',\n ' : expectedDescs[0];',\n '',\n ' foundDesc = (found && found.length) ? \"\\\\\"\" + stringEscape(found) + \"\\\\\"\" : \"end of input\";',\n '',\n ' return \"Expected \" + expectedDesc + \" but \" + foundDesc + \" found in pending input: \\'\" + input.substring(peg$maxFailPos, input.length) + \"\\'; entire input: \\'\" + input + \"\\'.\";',\n ' }',\n '',\n ' /* TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD TBD',\n '',\n ' if (pos < input.length) {',\n ' found = input.charAt(pos);',\n '',\n ' // Heuristics: grab one word or non-word at the error location to help the diagnostics.',\n ' // Limit the extracted content to 17 characters, anything longer gets an ellipsis at the end.',\n ' // And: also including leading whitespace.',\n ' var inputRemainder = input.substr(pos);',\n ' var extractedWord = inputRemainder.match(/^\\\\s*\\\\w+/i);',\n ' var extractedNonWord = inputRemainder.match(/^\\\\s*[^\\\\s\\\\w]+/i);',\n ' if (extractedWord || extractedNonWord) {',\n ' found = (extractedWord || extractedNonWord)[0].replace(/\\\\s+/g, \" \"); // and convert TAB, CR/LF, etc. whitespace to a single space',\n ' if (found.length > 17) {',\n ' found = found.substr(0, 17) + \"...\";',\n ' }',\n ' }',\n ' found = inputRemainder.substr(0, 256);',\n ' } else {',\n ' found = null;',\n ' }',\n '',\n ' */',\n '',\n ' if (expected !== null) {',\n ' cleanupExpected(expected);',\n ' }',\n '',\n ' return new Peg$SyntaxError(',\n ' message !== null ? message : buildMessage(expected, found),',\n ' expected,',\n ' found,',\n ' location',\n ' );',\n ' }',\n ' //}'\n ]).join('\\n'));\n\n if (options.optimize === \"size\") {\n parts.push(indent4(generateInterpreter()));\n parts.push('');\n } else {\n parts.push(' //{ Parse rule functions');\n arrays.each(ast.rules, function(rule) {\n parts.push(indent4(generateRuleFunction(rule)));\n parts.push('');\n });\n parts.push(' //}');\n }\n\n if (ast.initializer) {\n parts.push(indent2(ast.initializer.code));\n parts.push('');\n }\n\n if (options.optimize === \"size\") {\n parts.push(' peg$result = peg$parseRule(peg$startRuleIndex, null);');\n } else {\n parts.push(' peg$result = peg$startRuleFunction(null);');\n }\n\n parts.push(arrays.merge([\n '',\n ' if (peg$result !== peg$FAILED && peg$currPos === input.length) {',\n ' return peg$result;',\n ' } else {',\n ' if (peg$result !== peg$FAILED && peg$currPos < input.length) {',\n ' peg$fail({ type: \"end\", description: \"end of input\" }, -1);',\n ' }',\n '',\n ' throw peg$buildException(',\n ' null,',\n ' peg$maxFailExpected,',\n ' peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,',\n ' peg$maxFailPos < input.length',\n ' ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)',\n ' : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)',\n ' );',\n ' }',\n ' }',\n '',\n ' var peg$result = {',\n ' SyntaxError: Peg$SyntaxError,',\n ], traceSupport([\n ' DefaultTracer: Peg$DefaultTracer,',\n ]), runTimeStatistics([\n ' getStatistics: peg$getStatistics,'\n ]), ((options.collectRunTimeStatistics || options.includeRuleNames) ? [\n ' getRuleNamesIndexTable: peg$getRuleNamesIndexTable,',\n ] : []), [\n ' parse: peg$parse',\n ' };',\n ' if (typeof define === \"function\" && define.amd) {',\n // AMD module\n ' define(function() {',\n ' return peg$result;',\n ' });',\n ' } else if (typeof exports === \"object\") {',\n // CommonJS module\n ' module.exports = peg$result;',\n ' } else if (typeof modules === \"object\" && typeof modules.define === \"function\") {',\n // PEG.js module for Web Browser\n ' module.exports = peg$result;',\n ' } else {',\n // Web Browser\n ' global.' + options.exportVar + ' = peg$result;',\n ' }',\n // for compatibility\n ' return peg$result;',\n '})(this);'\n ]).join('\\n'));\n\n ast.code = parts.join('\\n');\n}", "title": "" }, { "docid": "9611952c61acaf50f0566bfc54c99812", "score": "0.5196368", "text": "function v(){\r\n\treturn;\r\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "1381968a510bcbf7ab612808510e6f87", "score": "0.5195055", "text": "function l152864() { return ' s'; }", "title": "" }, { "docid": "cbbdcb55097844edba064b8e877c5e4c", "score": "0.5194684", "text": "function v29(v30,v31,...v32) {\n function v34(v35,v36,...v37) {\n }\n const v38 = v34(-2987865916,v34,v34);\n // v38 = .unknown\n try {\n const v41 = {get:v38};\n // v41 = .object(ofGroup: Object, withProperties: [\"get\", \"__proto__\"])\n const v43 = Object.defineProperty(split,257,v41);\n // v43 = .undefined\n } catch(v44) {\n }\n const v45 = Number.isFinite(v10);\n // v45 = .boolean\n for (let v49 = 0; v49 < 100; v49 = v49 + 1) {\n }\n const v54 = [13.37,13.37,13.37,13.37,13.37];\n // v54 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v56 = 7;\n // v56 = .integer\n let v57 = 0;\n const v59 = eval();\n // v59 = .string + .object(ofGroup: String, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"substring\", \"includes\", \"padEnd\", \"codePointAt\", \"slice\", \"indexOf\", \"endsWith\", \"startsWith\", \"charCodeAt\", \"repeat\", \"charAt\", \"replace\", \"trim\", \"matchAll\", \"padStart\", \"concat\", \"search\", \"match\", \"split\", \"lastIndexOf\"])\n const v60 = 0;\n // v60 = .integer\n const v61 = 100;\n // v61 = .integer\n const v62 = 1;\n // v62 = .integer\n const v68 = [v54];\n // v68 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v69 = [v68,String,\"number\",String,-1411548425];\n // v69 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v70 = {__proto__:13.37,b:1337,constructor:\"number\",e:v69,toString:String,valueOf:1337};\n // v70 = .object(ofGroup: Object, withProperties: [\"b\", \"valueOf\", \"e\", \"constructor\", \"__proto__\"], withMethods: [\"toString\"])\n const v72 = v70[-2987865916];\n // v72 = .unknown\n for (let v73 = 0; v73 < 100; v73 = v73 + 1) {\n }\n}", "title": "" }, { "docid": "a77375f94a6b6a41e6bbb78a01efa4bc", "score": "0.5191784", "text": "function foo() {\n \treturn 42;\n }", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "86c4bb13496b4900bbc634ad89d12b01", "score": "0.5185184", "text": "function foo() {\n return 'bar';\n}", "title": "" }, { "docid": "94548efaf3e9ff5c01cb9aca6938fe88", "score": "0.51850325", "text": "function o242(o116) {\n var o82 = 3;\n // params, etc.\n var o243 = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var o244 = [];\n var o245 = true;\n\n function o47(o23) {\n //return;\n try {\nif (o23) try {\nModule.print(o23);\n}catch(e){}\n}catch(e){}\n try {\nModule.print(o116);\n}catch(e){}\n var o246 = '';\n try {\nfor (var o247 = 0; o247 < o82; o247++) try {\no246 += ' ';\n}catch(e){}\n}catch(e){}\n try {\nModule.print(o246 + '^');\n}catch(e){}\n }\n\n function o248() {\n try {\no82++;\n}catch(e){}\n try {\nif (o116[o82] === 'K') try {\no82++;\n}catch(e){}\n}catch(e){} // ignore const\n var o249 = [];\n try {\nwhile (o116[o82] !== 'E') {\n try {\nif (o116[o82] === 'S') { // substitution\n try {\no82++;\n}catch(e){}\n var next = o116.indexOf('_', o82);\n var o250 = o116.substring(o82, next) || 0;\n try {\no249.push(o244[o250] || '?');\n}catch(e){}\n try {\no82 = next + 1;\n}catch(e){}\n try {\ncontinue;\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o116[o82] === 'C') { // constructor\n try {\no249.push(o249[o249.length - 1]);\n}catch(e){}\n try {\no82 += 2;\n}catch(e){}\n try {\ncontinue;\n}catch(e){}\n }\n}catch(e){}\n var o85 = parseInt(o116.substr(o82));\n var o246 = o85.toString().length;\n try {\nif (!o85 || !o246) {\n try {\no82--;\n}catch(e){}\n try {\nbreak;\n}catch(e){}\n }\n}catch(e){} // counter i++ below us\n var o99 = o116.substr(o82 + o246, o85);\n try {\no249.push(o99);\n}catch(e){}\n try {\no244.push(o99);\n}catch(e){}\n try {\no82 += o246 + o85;\n}catch(e){}\n }\n}catch(e){}\n try {\no82++;\n}catch(e){} // skip E\n try {\nreturn o249;\n}catch(e){}\n }\n\n function parse(o251, o252, o253) { // main parser\n try {\no252 = o252 || Infinity;\n}catch(e){}\n var o30 = '',\n o254 = [];\n\n function o255() {\n try {\nreturn '(' + o254.join(', ') + ')';\n}catch(e){}\n }\n var name;\n try {\nif (o116[o82] === 'N') {\n // namespaced N-E\n try {\nname = o248().join('::');\n}catch(e){}\n try {\no252--;\n}catch(e){}\n try {\nif (o252 === 0) try {\nreturn o251 ? [name] : name;\n}catch(e){}\n}catch(e){}\n } else {\n // not namespaced\n try {\nif (o116[o82] === 'K' || (o245 && o116[o82] === 'L')) try {\no82++;\n}catch(e){}\n}catch(e){} // ignore const and first 'L'\n var o85 = parseInt(o116.substr(o82));\n try {\nif (o85) {\n var o246 = o85.toString().length;\n try {\nname = o116.substr(o82 + o246, o85);\n}catch(e){}\n try {\no82 += o246 + o85;\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\no245 = false;\n}catch(e){}\n try {\nif (o116[o82] === 'I') {\n try {\no82++;\n}catch(e){}\n var o256 = parse(true);\n var o257 = parse(true, 1, true);\n try {\no30 += o257[0] + ' ' + name + '<' + o256.join(', ') + '>';\n}catch(e){}\n } else {\n try {\no30 = name;\n}catch(e){}\n }\n}catch(e){}\n try {\no258: try {\nwhile (o82 < o116.length && o252-- > 0) {\n //dump('paramLoop');\n var o259 = o116[o82++];\n try {\nif (o259 in o243) {\n try {\no254.push(o243[o259]);\n}catch(e){}\n } else {\n try {\nswitch (o259) {\n case 'P':\n try {\no254.push(parse(true, 1, true)[0] + '*');\n}catch(e){}\n try {\nbreak;\n}catch(e){} // pointer\n case 'R':\n try {\no254.push(parse(true, 1, true)[0] + '&');\n}catch(e){}\n try {\nbreak;\n}catch(e){} // reference\n case 'L':\n { // literal\n try {\no82++;\n}catch(e){} // skip basic type\n var o260 = o116.indexOf('E', o82);\n var o85 = o260 - o82;\n try {\no254.push(o116.substr(o82, o85));\n}catch(e){}\n try {\no82 += o85 + 2;\n}catch(e){} // size + 'EE'\n try {\nbreak;\n}catch(e){}\n }\n case 'A':\n { // array\n var o85 = parseInt(o116.substr(o82));\n try {\no82 += o85.toString().length;\n}catch(e){}\n try {\nif (o116[o82] !== '_') try {\nthrow '?';\n}catch(e){}\n}catch(e){}\n try {\no82++;\n}catch(e){} // skip _\n try {\no254.push(parse(true, 1, true)[0] + ' [' + o85 + ']');\n}catch(e){}\n try {\nbreak;\n}catch(e){}\n }\n case 'E':\n try {\nbreak o258;\n}catch(e){}\n default:\n try {\no30 += '?' + o259;\n}catch(e){}\n try {\nbreak o258;\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}catch(e){}\n try {\nif (!o253 && o254.length === 1 && o254[0] === 'void') try {\no254 = [];\n}catch(e){}\n}catch(e){} // avoid (void)\n try {\nreturn o251 ? o254 : o30 + o255();\n}catch(e){}\n }\n try {\ntry {\n // Special-case the entry point, since its name differs from other name mangling.\n try {\nif (o116 == 'Object._main' || o116 == '_main') {\n try {\nreturn 'main()';\n}catch(e){}\n }\n}catch(e){}\n try {\nif (typeof o116 === 'number') try {\no116 = o122(o116);\n}catch(e){}\n}catch(e){}\n try {\nif (o116[0] !== '_') try {\nreturn o116;\n}catch(e){}\n}catch(e){}\n try {\nif (o116[1] !== '_') try {\nreturn o116;\n}catch(e){}\n}catch(e){} // C function\n try {\nif (o116[2] !== 'Z') try {\nreturn o116;\n}catch(e){}\n}catch(e){}\n try {\nswitch (o116[3]) {\n case 'n':\n try {\nreturn 'operator new()';\n}catch(e){}\n case 'd':\n try {\nreturn 'operator delete()';\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn parse();\n}catch(e){}\n } catch (o189) {\n try {\nreturn o116;\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "f38bbd29bbd84c95b9393ee2e44ee653", "score": "0.5181418", "text": "function o0(stdlib,o1,buffer) {\n try {\no8[4294967294];\n}catch(o1){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no16++;\n}catch(e){}\n\n try {\nif (o929 == 0x8 && o421.o643 == 0x7FFF) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(o123){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o3 =new stdlib.set.o500(buffer);\n\n function o4(){\n var o689 = o474.o687(o479.o502.o333, o479.name)\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "2bab3c467fb0b01379dd339091f386da", "score": "0.51773834", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\";\n var MEM32 = new stdlib.Int32Array(heap);\n function foo(i) {\n i = i|0;\n return +MEM32[i >> 2];\n }\n return {foo: foo};\n}", "title": "" }, { "docid": "aabd46650ab68064cde7ba62b0a85fd7", "score": "0.5174839", "text": "function worthless(){\n}", "title": "" }, { "docid": "6a360cd6d0adeefd33197bb49795e72d", "score": "0.5174643", "text": "function\nauxmain_4062_(a3x1, a3x2)\n{\nlet xtmp108;\nlet xtmp113;\nlet xtmp114;\n;\n;\nxtmp113 =\nfunction()\n{\nlet xtmp109;\nlet xtmp110;\nlet xtmp111;\nlet xtmp112;\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 2883(line=207, offs=1) -- 2940(line=208, offs=50)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_gte_sint_sint_2466_ = XATS2JS_gint_gte_sint_sint\n;\nxtmp110 = gint_gte_sint_sint_2466_(a3x2, a3x1);\n}\n;\nif\n(xtmp110)\n// then\n{\n{\nxtmp109 = [0];\n}\n;\n} // if-then\nelse\n{\n{\n{\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 2015(line=148, offs=1) -- 2064(line=149, offs=42)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_succ_sint_1861_ = XATS2JS_gint_succ_sint\n;\nxtmp112 = gint_succ_sint_1861_(a3x2);\n}\n;\nxtmp111 = auxmain_4062_(a3x1, xtmp112);\n}\n;\nxtmp109 = [1, a3x2, xtmp111];\n}\n;\n} // if-else\n;\nreturn xtmp109;\n} // lam-function\n;\nxtmp114 =\nfunction()\n{\nlet xtmp109;\nlet xtmp110;\nlet xtmp111;\nlet xtmp112;\n} // lam-function\n;\nxtmp108 = XATS2JS_new_llazy(xtmp113,xtmp114);\nreturn xtmp108;\n}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5173437", "text": "function func() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5173437", "text": "function func() {}", "title": "" }, { "docid": "48dc1dedd6f2876f5e808360c91fa8fe", "score": "0.51729274", "text": "function r(e){return Boolean(e)&&\"function\"===(typeof e).toLowerCase()&&(e===Function.prototype||/^\\s*function\\s*(\\b[a-z$_][a-z0-9$_]*\\b)*\\s*\\((|([a-z$_][a-z0-9$_]*)(\\s*,[a-z$_][a-z0-9$_]*)*)\\)\\s*{\\s*\\[native code]\\s*}\\s*$/i.test(String(e)))}", "title": "" }, { "docid": "b29a294d961ac383bd6d3e98e8c437fa", "score": "0.5165551", "text": "function asmModule(g, foreign, heap) {\n \"use asm\";\n let HEAP8 = new g.Int8Array(heap);\n\n function f() { return 99; } \n return {f: f};\n}", "title": "" }, { "docid": "81f4c5975dc94d19bc7583d7e0343bc3", "score": "0.5164888", "text": "function v17(v18,v19) {\n for (let v23 = 0; v23 < 4; v23 = v23 + 1) {\n let v26 = 0;\n while (v26 < 3) {\n function v27(v28,v29) {\n for (let v33 = 0; v33 < 9; v33 = v33 + 1) {\n async function v34(v35,v36,v37,v38) {\n for (let v41 = v33; v41 < 100; v41 = v41 + 3168844224) {\n }\n }\n const v42 = 0;\n // v42 = .integer\n const v43 = 10;\n // v43 = .integer\n const v44 = 1;\n // v44 = .integer\n }\n const v46 = [13.37,13.37,13.37,13.37];\n // v46 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n const v47 = 0;\n // v47 = .integer\n const v48 = 1337;\n // v48 = .integer\n const v49 = 1;\n // v49 = .integer\n }\n }\n }", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "04c74957dbfa725a16df69e1d64f0866", "score": "0.514923", "text": "function sc_func(x, y) {\r\n\r\n // JIT spray - this example is a nop sled ending in int3\r\n // Point is to prove that we are generating code of the form\r\n // 01: xor eax, 0x01eb9090\r\n // 06: xor eax, 0x01eb9090\r\n // 0b: xor eax, 0x01eb9090\r\n // ... etc ...\r\n var mynum = x ^\r\n 0x23840952 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0xcccccccc ^\r\n 0x23840952 ^ \r\n 0x23840952;\r\n\r\n return mynum + y;\r\n}", "title": "" }, { "docid": "a44ac1bff4cb30921e0f5911cdffad04", "score": "0.5147144", "text": "function Code(){}", "title": "" }, { "docid": "2cfcf744b5afa9636aaa817bcc8b334e", "score": "0.5141706", "text": "async function v17(v18,v19) {\n const v20 = 0;\n // v20 = .integer\n let v22 = 7;\n const v23 = 0;\n // v23 = .integer\n const v24 = 100;\n // v24 = .integer\n const v25 = 1;\n // v25 = .integer\n const v26 = v22 + 1;\n // v26 = .primitive\n const v27 = -1073741824;\n // v27 = .integer\n const v28 = \"-1\";\n // v28 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v29 = isNaN;\n // v29 = .function([.anything] => .boolean)\n const v31 = [13.37,13.37,13.37];\n // v31 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v33 = [1337,1337,1337,1337,1337];\n // v33 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v34 = [v33,13.37,13.37];\n // v34 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v35 = {};\n // v35 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v36 = v31;\n const v37 = -1073741824;\n // v37 = .integer\n const v38 = \"-1\";\n // v38 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v39 = isNaN;\n // v39 = .function([.anything] => .boolean)\n const v41 = [13.37,13.37,13.37];\n // v41 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v43 = [1337,1337,1337,1337,1337];\n // v43 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v44 = [v43,13.37,13.37];\n // v44 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v45 = {};\n // v45 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v46 = v41;\n const v47 = -1073741824;\n // v47 = .integer\n const v48 = \"-1\";\n // v48 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v49 = isNaN;\n // v49 = .function([.anything] => .boolean)\n const v53 = [1337,1337,1337];\n // v53 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v54 = [v53,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v54 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v55 = {b:v54,constructor:v54,d:v53,toString:-1504637233,valueOf:v53};\n // v55 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"__proto__\", \"b\", \"d\", \"valueOf\"])\n const v57 = Promise;\n // v57 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v60 = [1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v61 = [v60,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v61 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v62 = {b:v61,constructor:v61,d:v60,toString:-1504637233,valueOf:v60};\n // v62 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"valueOf\", \"__proto__\", \"d\", \"b\"])\n const v63 = -1504637233;\n // v63 = .integer\n const v64 = Promise;\n // v64 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v66 = [13.37,13.37,13.37,13.37,13.37];\n // v66 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n let v69 = Object;\n const v71 = Object;\n // v71 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v72 = -1504637233;\n // v72 = .integer\n const v74 = parseInt;\n // v74 = .function([.string] => .integer)\n const v75 = Proxy;\n // v75 = .constructor([.object(), .object()] => .unknown)\n const v76 = [13.37,13.37,13.37,13.37,13.37];\n // v76 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v78 = [1337,1337,1337];\n // v78 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v79 = [v78,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v79 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n let v80 = -1504637233;\n const v81 = 6;\n // v81 = .integer\n const v82 = {call:Object,defineProperty:Object,deleteProperty:Object,getOwnPropertyDescriptor:Object,getPrototypeOf:Object,has:Object,ownKeys:Object,preventExtensions:Object,set:Object};\n // v82 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"deleteProperty\", \"set\", \"getOwnPropertyDescriptor\", \"has\", \"preventExtensions\", \"defineProperty\", \"call\", \"getPrototypeOf\", \"ownKeys\"])\n const v83 = Proxy;\n // v83 = .constructor([.object(), .object()] => .unknown)\n const v84 = \"127\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v85 = gc;\n // v85 = .function([] => .undefined)\n const v86 = 706559.8191058293;\n // v86 = .float\n const v87 = -536870912;\n // v87 = .integer\n const v88 = 6;\n // v88 = .integer\n const v89 = -1504637233;\n // v89 = .integer\n const v90 = \"127\";\n // v90 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v91 = Promise;\n // v91 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v92 = 13.37;\n // v92 = .float\n const v94 = [1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n let v95 = 13516;\n const v98 = Promise[Promise];\n // v98 = .unknown\n const v100 = [13.37,13.37,13.37,v95,13.37];\n // v100 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v101 = v100.toLocaleString();\n // v101 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v102 = -1504637233;\n // v102 = .integer\n const v103 = \"127\";\n // v103 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v104 = typeof v98;\n // v104 = .string\n const v106 = Promise;\n // v106 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v107 = v66.__proto__;\n // v107 = .object()\n const v108 = 1337 >> v101;\n // v108 = .integer | .bigint\n const v109 = Object;\n // v109 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v110 = v104 === \"number\";\n // v110 = .boolean\n const v113 = [13.37,13.37,13.37,13.37,13.37];\n // v113 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v115 = \"bigint\";\n // v115 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v116 = [1337,1337,1337];\n // v116 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v117 = [v116,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v117 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v118 = {b:v117,constructor:v117,d:v116,toString:-1504637233,valueOf:v116};\n // v118 = .object(ofGroup: Object, withProperties: [\"constructor\", \"toString\", \"d\", \"valueOf\", \"b\", \"__proto__\"])\n const v119 = {length:1337,toString:Promise};\n // v119 = .object(ofGroup: Object, withProperties: [\"length\", \"__proto__\", \"toString\"])\n const v120 = v119.__proto__;\n // v120 = .object()\n let v121 = Promise;\n let v122 = Promise;\n let v123 = -1504637233;\n const v125 = v100 - 1;\n // v125 = .primitive\n const v126 = \"number\" + 13.37;\n // v126 = .primitive\n const v127 = \"127\";\n // v127 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v128 = Promise;\n // v128 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v130 = [13.37,13.37,13.37,13.37,13.37];\n // v130 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v133 = \"valueOf\" instanceof Int32Array;\n // v133 = .boolean\n const v135 = [3345548163,3345548163,3345548163];\n // v135 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v136 = [v135,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v136 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v137 = {b:v136,constructor:v136,d:v135,toString:-1504637233,valueOf:v135};\n // v137 = .object(ofGroup: Object, withProperties: [\"b\", \"__proto__\", \"constructor\", \"d\", \"toString\", \"valueOf\"])\n const v138 = v122.allSettled(v136);\n // v138 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"])\n let v139 = -1504637233;\n const v141 = \"127\";\n // v141 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v142 = Promise;\n // v142 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v144 = [13.37,13.37,13.37,13.37,v69];\n // v144 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v146 = 13.37;\n // v146 = .float\n const v147 = undefined;\n // v147 = .undefined\n const v148 = [3511628336,3511628336,3511628336];\n // v148 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v149 = [v148,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v149 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v150 = {b:v149,constructor:v149,d:v148,toString:-1504637233,valueOf:v148};\n // v150 = .object(ofGroup: Object, withProperties: [\"b\", \"d\", \"toString\", \"__proto__\", \"constructor\", \"valueOf\"])\n let v151 = -1504637233;\n const v153 = \"127\";\n // v153 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v154 = Promise;\n // v154 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v156 = [13.37,13.37,13.37,13.37,13.37];\n // v156 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v158 = [1337,1337,1337];\n // v158 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v159 = 0;\n // v159 = .integer\n const v160 = [v158,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v160 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v161 = {b:v160,constructor:v160,d:v158,toString:-1504637233,length:v158};\n // v161 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"toString\", \"d\", \"constructor\", \"length\", \"b\"])\n let v162 = -1504637233;\n const v163 = Object;\n // v163 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v164 = Object;\n // v164 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v165 = Proxy;\n // v165 = .constructor([.object(), .object()] => .unknown)\n const v166 = -1504637233;\n // v166 = .integer\n const v168 = \"cx/Ct5Ew/k\";\n // v168 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v169 = Promise;\n // v169 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"reject\", \"allSettled\", \"all\", \"race\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"catch\", \"finally\", \"then\"]))\n const v171 = [13.37,13.37,13.37,13.37,13.37];\n // v171 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v173 = [1942131045,1942131045,1942131045];\n // v173 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v174 = [v173,13.37,13.37,13.37,-1504637233,-1504637233,-1504637233];\n // v174 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v175 = {constructor:v174,constructor:v174,d:v173,toString:-1504637233,valueOf:v173};\n // v175 = .object(ofGroup: Object, withProperties: [\"d\", \"__proto__\", \"toString\", \"valueOf\", \"constructor\"])\n let v176 = 1942131045;\n const v178 = [1337];\n // v178 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n for (let v181 = 0; v181 < v178; v181 = v181 + 1) {\n }\n}", "title": "" } ]
66e12615e88435dc4b4020db36797dc0
Convert XYZ to LUV
[ { "docid": "4f622566a5d2db40ec655abbbb2c9ab5", "score": "0.8386028", "text": "static XYZtoLUV(xyz, normalizedInput = false, normalizedOutput = false) {\n let [x, y, z] = (normalizedInput) ? xyz.$normalize(false) : xyz;\n let u = (4 * x) / (x + (15 * y) + (3 * z));\n let v = (9 * y) / (x + (15 * y) + (3 * z));\n y = y / 100;\n y = (y > 0.008856) ? Math.pow(y, 1 / 3) : (7.787 * y + 16 / 116);\n let refU = (4 * Color.D65[0]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let refV = (9 * Color.D65[1]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let L = (116 * y) - 16;\n return Color.luv(L, 13 * L * (u - refU), 13 * L * (v - refV), xyz.alpha);\n }", "title": "" } ]
[ { "docid": "617baa28db2e910b47bfefb176c27c4e", "score": "0.7688969", "text": "static LUVtoXYZ(luv, normalizedInput = false, normalizedOutput = false) {\n let [l, u, v] = (normalizedInput) ? luv.$normalize(false) : luv;\n let y = (l + 16) / 116;\n let cubeY = y * y * y;\n y = (cubeY > 0.008856) ? cubeY : (y - 16 / 116) / 7.787;\n let refU = (4 * Color.D65[0]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let refV = (9 * Color.D65[1]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n u = u / (13 * l) + refU;\n v = v / (13 * l) + refV;\n y = y * 100;\n let x = -1 * (9 * y * u) / ((u - 4) * v - u * v);\n let z = (9 * y - (15 * v * y) - (v * x)) / (3 * v);\n return Color.xyz(x, y, z, luv.alpha);\n }", "title": "" }, { "docid": "08b9465861e9947233664f663c47a0a9", "score": "0.6864313", "text": "function x2L (xyz) {\n var X = xyz[0] / 95.047,\n Y = xyz[1] / 100,\n Z = xyz[2] / 108.883,\n T = 1 / 3,\n K = 16 / 116;\n\n X = X > 0.008856? Math.pow (X, T) : (7.787 * X) + K;\n Y = Y > 0.008856? Math.pow (Y, T) : (7.787 * Y) + K;\n Z = Z > 0.008856? Math.pow (Z, T) : (7.787 * Z) + K;\n\n var L = (116 * Y) - 16,\n a = 500 * (X - Y),\n b = 200 * (Y - Z);\n\n return [L, a, b, xyz[3]];\n }", "title": "" }, { "docid": "d5ca79921a80c6b2670b7e0af242ba14", "score": "0.6818725", "text": "function XYZtoLAB(xyz) {\n var x = xyz[0];\n var y = xyz[1];\n var z = xyz[2];\n var x2 = x / 95.047;\n var y2 = y / 100;\n var z2 = z / 108.883;\n if (x2 > 0.008856) {\n x2 = Math.pow(x2, 1 / 3);\n }\n else {\n x2 = (7.787 * x2) + (16 / 116);\n }\n if (y2 > 0.008856) {\n y2 = Math.pow(y2, 1 / 3);\n }\n else {\n y2 = (7.787 * y2) + (16 / 116);\n }\n if (z2 > 0.008856) {\n z2 = Math.pow(z2, 1 / 3);\n }\n else {\n z2 = (7.787 * z2) + (16 / 116);\n }\n var l = 116 * y2 - 16;\n var a = 500 * (x2 - y2);\n var b = 200 * (y2 - z2);\n var labresult = new Array();\n labresult[0] = l;\n labresult[1] = a;\n labresult[2] = b;\n return labresult;\n}", "title": "" }, { "docid": "da3f55cf2147966c78d1e4ed10bc8aed", "score": "0.6731956", "text": "function xyzToLab(xyz){\n var ref_X = 95.047;\n var ref_Y = 100.000;\n var ref_Z = 108.883;\n \n var _X = xyz[0] / ref_X;\n var _Y = xyz[1] / ref_Y;\n var _Z = xyz[2] / ref_Z;\n \n if (_X > 0.008856) {\n _X = Math.pow(_X, (1/3));\n }\n else { \n _X = (7.787 * _X) + (16 / 116);\n }\n \n if (_Y > 0.008856) {\n _Y = Math.pow(_Y, (1/3));\n }\n else {\n _Y = (7.787 * _Y) + (16 / 116);\n }\n \n if (_Z > 0.008856) {\n _Z = Math.pow(_Z, (1/3));\n }\n else { \n _Z = (7.787 * _Z) + (16 / 116);\n }\n \n var CIE_L = (116 * _Y) - 16;\n var CIE_a = 500 * (_X - _Y);\n var CIE_b = 200 * (_Y - _Z);\n \n return [CIE_L, CIE_a, CIE_b];\n}", "title": "" }, { "docid": "8b2934724469da81ad6338bbde91eb28", "score": "0.6708123", "text": "toXYZ() {\r\n let y = (this.l * 100 + 16) / 116;\r\n let x = this.a / 5 + y;\r\n let z = y - this.b / 2;\r\n [x, y, z] = [x, y, z].map((v) => {\r\n const v3 = v * v * v;\r\n return (v3 > 0.008856451) ? v3 : (v - 16 / 116) / 7.787037;\r\n });\r\n return new XYZColor_1.XYZColor(x * XYZColor_1.XYZColor.D65.x, y * XYZColor_1.XYZColor.D65.y, z * XYZColor_1.XYZColor.D65.z);\r\n }", "title": "" }, { "docid": "161793d74a6396ea5ac84e32b9678dbe", "score": "0.66617554", "text": "function Luv() {\n classCallCheck(this, Luv);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var rest = [].concat(args);\n var scope = internal$10(this);\n if (args[args.length - 1] instanceof Illuminant) {\n scope.illuminant = rest.pop();\n } else {\n scope.illuminant = Illuminant.D50;\n }\n if (rest.length === 0) {\n this.l = 0;\n this.u = 0;\n this.v = 0;\n } else if (rest.length === 1) {\n var _rest = slicedToArray(rest, 1),\n value = _rest[0];\n\n this.l = value || 0;\n this.u = 0;\n this.v = 0;\n } else {\n var _rest2 = slicedToArray(rest, 3),\n l = _rest2[0],\n a = _rest2[1],\n b = _rest2[2];\n\n this.l = l || 0;\n this.u = a || 0;\n this.v = b || 0;\n }\n }", "title": "" }, { "docid": "de835415054fe0d020fb69c6a7579f3e", "score": "0.66143453", "text": "function XYZtoLAB(x, y, z){\n let _X = x / 95.047;\n let _Y = y / 100;\n let _Z = z / 108.883;\n // doin the thang to X\n if (_X > 0.008856) {\n _X = Math.pow(_X, 1/3)\n } else {\n _X = (7.787 * _X) + (16 / 116)\n }\n // doin the thang to Z\n if (_Y > 0.008856) {\n _Y = Math.pow(_Y, 1/3)\n } else {\n _Y = (7.787 * _Y) + (16 / 116)\n }\n // doin the thang to Z\n if (_Z > 0.008856) {\n _Z = Math.pow(_Z, 1/3)\n } else {\n _Z = (7.787 * _Z) + (16 / 116)\n }\n let L = ( 116 * _Y ) - 16;\n let a = 500 * ( _X - _Y );\n let b = 200 * ( _Y - _Z );\n return[L,a,b]\n}", "title": "" }, { "docid": "ff828d6796e68432c3c92faf7d10113a", "score": "0.6596362", "text": "static RGBtoLUV(rgb, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? rgb.$normalize(false) : rgb;\n return Color.XYZtoLUV(Color.RGBtoXYZ(c), false, normalizedOutput);\n }", "title": "" }, { "docid": "8cc56ccac396a9402d2e83fbc77e2d2c", "score": "0.649948", "text": "getUV(point) {\n // convert point in cartesian coordinates to barycentric coordinates\n const v0v1 = vec3.subtract(vec3.create(), this.v1, this.v0);\n const v0v2 = vec3.subtract(vec3.create(), this.v2, this.v0);\n const v2v0 = vec3.subtract(vec3.create(), this.v0, this.v2);\n const v0p = vec3.subtract(vec3.create(), point, this.v0);\n const v2p = vec3.subtract(vec3.create(), point, this.v2);\n\n const n = vec3.cross(vec3.create(), v0v1, v0v2);\n const nLength = vec3.length(n);\n const n1 = vec3.cross(vec3.create(), v2v0, v2p);\n const n2 = vec3.cross(vec3.create(), v0v1, v0p);\n\n const beta = vec3.dot(n, n1) / (nLength * nLength);\n const gamma = vec3.dot(n, n2) / (nLength * nLength);\n\n // compute uv coordinates\n const u = this.uv0[0] + beta * (this.uv1[0] - this.uv0[0]) + gamma * (this.uv2[0] - this.uv0[0]);\n const v = this.uv0[1] + beta * (this.uv1[1] - this.uv0[1]) + gamma * (this.uv2[1] - this.uv0[1]);\n\n return [u, v];\n }", "title": "" }, { "docid": "05c5b8e91e20ae0b21c15451849d62c5", "score": "0.6429967", "text": "function xyzToLab(x, y, z) {\n var ref_X = 95.047;\n var ref_Y = 100.000;\n var ref_Z = 108.883;\n\n var _X = x / ref_X; //ref_X = 95.047 Observer= 2°, Illuminant= D65\n var _Y = y / ref_Y; //ref_Y = 100.000\n var _Z = z / ref_Z; //ref_Z = 108.883\n\n if ( _X > 0.008856 ) {\n\n \t_X = Math.pow(_X, ( 1/3 ));\n }\n else { \n \t_X = ( 7.787 * _X ) + ( 16 / 116 );\n }\n\n if ( _Y > 0.008856 ) {\n \t_Y = Math.pow(_Y, ( 1/3 ));\n }\n else {\n _Y = ( 7.787 * _Y ) + ( 16 / 116 );\n }\n\n if ( _Z > 0.008856 ) {\n \t_Z = Math.pow(_Z, ( 1/3 ));\n }\n else { \n \t_Z = ( 7.787 * _Z ) + ( 16 / 116 );\n }\n\n var CIE_L = ( 116 * _Y ) - 16;\n var CIE_a = 500 * ( _X - _Y );\n var CIE_b = 200 * ( _Y - _Z );\n\n\treturn [CIE_L, CIE_a, CIE_b];\n}", "title": "" }, { "docid": "84b38170fcd76d9e56b59e0117eafb33", "score": "0.6427246", "text": "static XYZtoLAB(xyz, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? xyz.$normalize(false) : xyz.clone();\n // adjust for D65 \n c.divide(Color.D65);\n let fn = (n) => (n > 0.008856) ? Math.pow(n, 1 / 3) : (7.787 * n) + 16 / 116;\n let cy = fn(c[1]);\n let cc = Color.lab((116 * cy) - 16, 500 * (fn(c[0]) - cy), 200 * (cy - fn(c[2])), xyz.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "13207a49d6f3f6662baa277ab12b8aee", "score": "0.64057463", "text": "function xyzToLab(x, y, z) {\r\n var ref_X = 95.047;\r\n var ref_Y = 100.000;\r\n var ref_Z = 108.883;\r\n\r\n var _X = x / ref_X;\r\n var _Y = y / ref_Y;\r\n var _Z = z / ref_Z;\r\n\r\n if (_X > 0.008856) {\r\n _X = Math.pow(_X, (1 / 3));\r\n }\r\n else {\r\n _X = (7.787 * _X) + (16 / 116);\r\n }\r\n\r\n if (_Y > 0.008856) {\r\n _Y = Math.pow(_Y, (1 / 3));\r\n }\r\n else {\r\n _Y = (7.787 * _Y) + (16 / 116);\r\n }\r\n\r\n if (_Z > 0.008856) {\r\n _Z = Math.pow(_Z, (1 / 3));\r\n }\r\n else {\r\n _Z = (7.787 * _Z) + (16 / 116);\r\n }\r\n\r\n var CIE_L = (116 * _Y) - 16;\r\n var CIE_a = 500 * (_X - _Y);\r\n var CIE_b = 200 * (_Y - _Z);\r\n\r\n return [CIE_L, CIE_a, CIE_b];\r\n }", "title": "" }, { "docid": "5dd127bcf0d85fbea5cb05488938f129", "score": "0.63887036", "text": "xyz() {\n const { r, g, b } = this;\n return rgb2xyz(r, g, b);\n }", "title": "" }, { "docid": "5dd127bcf0d85fbea5cb05488938f129", "score": "0.63887036", "text": "xyz() {\n const { r, g, b } = this;\n return rgb2xyz(r, g, b);\n }", "title": "" }, { "docid": "f936c41218ea30fc3393205f6e06dcd4", "score": "0.61997235", "text": "getUV() {\n return [\n //DERECHO\n 0.75, 0.625,\n 0.5, 0.375,\n 0.75, 0.375,\n 0.5, 0.625,\n 0.5, 0.375,\n 0.75, 0.625,\n\n //ATRAS\n 0.75, 0.375,\n 0.75, 0.625,\n 1, 0.625,\n 1, 0.625,\n 1, 0.375,\n 0.75, 0.375,\n\n // IZQUIERDA\n 0, 0.625,\n 0, 0.375,\n 0.25, 0.625,\n 0.25, 0.375,\n 0.25, 0.625,\n 0, 0.375,\n\n //FRENTE\n 0.25, 0.625,\n 0.25, 0.375,\n 0.5, 0.625,\n 0.25, 0.375,\n 0.5, 0.375,\n 0.5, 0.625,\n\n // ABAJO\n 0.5, 0.625,\n 0.5, 0.875,\n 0.25, 0.625,\n 0.25, 0.875,\n 0.25, 0.625,\n 0.5, 0.875,\n\n // // ARRIBA\n 0.5, 0.375,\n 0.25, 0.375,\n 0.25, 0.125,\n 0.5, 0.375,\n 0.25, 0.125,\n 0.5, 0.125,\n ]\n }", "title": "" }, { "docid": "f8740b85a4cd4db6fb3d60070750722e", "score": "0.6071714", "text": "static LABtoXYZ(lab, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? lab.$normalize(false) : lab;\n let y = (c[0] + 16) / 116;\n let x = (c[1] / 500) + y;\n let z = y - c[2] / 200;\n let fn = (n) => {\n let nnn = n * n * n;\n return (nnn > 0.008856) ? nnn : (n - 16 / 116) / 7.787;\n };\n let d = Color.D65;\n // adjusted\n let cc = Color.xyz(\n // Math.max(0, Math.min( 100, d[0] * fn(x) )),\n // Math.max(0, Math.min( 100, d[1] * fn(y) )),\n // Math.max(0, Math.min( 100, d[2] * fn(z) )),\n Math.max(0, d[0] * fn(x)), Math.max(0, d[1] * fn(y)), Math.max(0, d[2] * fn(z)), lab.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "160244c85a9372f3f507c0959ae4db35", "score": "0.60551953", "text": "function ll2xyz( latitude, longitude, radius ){\n\t\n\tvar\n\tphi = ( 90 - latitude ) * Math.PI / 180,\n\ttheta = ( 360 - longitude ) * Math.PI / 180\n\n\treturn {\n\n\t\tx: radius * Math.sin( phi ) * Math.cos( theta ),\n\t\ty: radius * Math.cos( phi ),\n\t\tz: radius * Math.sin( phi ) * Math.sin( theta )\n\t}\n}", "title": "" }, { "docid": "d709efd816cb0f0e7c2d11077af05625", "score": "0.59047854", "text": "function LCHuv() {\n classCallCheck(this, LCHuv);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var rest = [].concat(args);\n var scope = internal$9(this);\n if (args[args.length - 1] instanceof Illuminant) {\n scope.illuminant = rest.pop();\n } else {\n scope.illuminant = Illuminant.D50;\n }\n if (rest.length === 0) {\n this.l = 0;\n this.c = 0;\n this.h = 0;\n } else if (rest.length === 1) {\n var _rest = slicedToArray(rest, 1),\n value = _rest[0];\n\n this.l = value || 0;\n this.c = 0;\n this.h = 0;\n } else {\n var _rest2 = slicedToArray(rest, 3),\n l = _rest2[0],\n c = _rest2[1],\n h = _rest2[2];\n\n this.l = l || 0;\n this.c = c || 0;\n this.h = h || 0;\n }\n }", "title": "" }, { "docid": "8645f3588b400cc2fc2beb9b16435f68", "score": "0.589531", "text": "function uv_planar(geometry){\n geometry.computeBoundingBox();\n \n var max = geometry.boundingBox.max;\n var min = geometry.boundingBox.min;\n \n var offset = new THREE.Vector3(0 - min.x, 0 - min.y, 0-min.z);\n var range = new THREE.Vector3(max.x - min.x, max.y - min.y, max.z - min.z);\n var positions = Array.from(geometry.attributes.position.array);\n var uvAttribute = geometry.attributes.uv;\n\n for (var i = 0; i < positions.length / 3; i++) {\n var x = positions[i * 3];\n var y = positions[i * 3 + 1];\n var z = positions[i * 3 + 2];\n x = (x+offset.x)/range.x;\n y = (y+offset.y)/range.y;\n z = (z+offset.z)/range.z;\n var U = uvAttribute.getX( i );\n var V = uvAttribute.getY( i );\n \n U = z;\n V = y;\n\n let uvcoord = new THREE.Vector2(U,V);\n uvMapPlanar.push(uvcoord);\n }\n }", "title": "" }, { "docid": "7aacfbf67659b70f6b25d8e7c366f211", "score": "0.58599955", "text": "static radiansBetweenVectorsXYZ(ux, uy, uz, vx, vy, vz) {\n // const uu = ux * ux + uy * uy + uz * uz;\n const uDotV = ux * vx + uy * vy + uz * vz; // magU magV cos(theta)\n // const vv = vx * vx + vy * vy + vz * vz;\n return Math.atan2(Geometry_1.Geometry.crossProductMagnitude(ux, uy, uz, vx, vy, vz), uDotV);\n }", "title": "" }, { "docid": "879c6e3a3f815de13e19bf2acd48bb8f", "score": "0.58499956", "text": "function xyz2lab(xyz, w, h) {\n\t function f(x) {\n\t if (x > 0.00856)\n\t return Math.pow(x, 0.33333333);\n\t else\n\t return 7.78706891568 * x + 0.1379310336;\n\t }\n\t var xw = 1.0 / 3.0,\n\t yw = 1.0 / 3.0,\n\t Yw = 1.0,\n\t Xw = xw / yw,\n\t Zw = (1-xw-yw) / (yw * Yw),\n\t ix = 1.0 / Xw,\n\t iy = 1.0 / Yw,\n\t iz = 1.0 / Zw,\n\t labData = new Float32Array(3*w*h);\n\t for (var i = 0; i<w*h; i++) {\n\t var fx = f(xyz[i] * ix),\n\t fy = f(xyz[w*h + i] * iy),\n\t fz = f(xyz[2*w*h + i] * iz);\n\t labData[i] = 116.0 * fy - 16.0;\n\t labData[i + w*h] = 500.0 * (fx - fy);\n\t labData[i + 2*w*h] = 200.0 * (fy - fz);\n\t }\n\t return labData;\n\t }", "title": "" }, { "docid": "6f27c09abe1b3929cea5b4fa454423e7", "score": "0.57402474", "text": "generateUVCoordinates() {\n var UV = [[0, 0], [0, 1], [1, 1], [0, 0], [1, 1], [1, 0]]\n\n this.vertices.forEach((v, i) => {\n v.uv = UV[i % 6]\n })\n }", "title": "" }, { "docid": "a2138c7c3ff162eb02bb743e7182b186", "score": "0.5617053", "text": "getUV() {\n this.m_tempUPV.copyFrom(this.m_up);\n return this.m_tempUPV;\n }", "title": "" }, { "docid": "934910793f80aec39a9cf5c1d2abf1d9", "score": "0.56055313", "text": "function Lorenz(){\n\tthis.attType = 'Lorenz';\n\tthis.a = 12;\n\tthis.b = 26;\n\tthis.c = 3;\n\tthis.t = 0.001;\n\tthis.iterations = 100000;\n\tthis.opacity = 0.3;\n\tthis.pointSize = 2.2;\n\tthis.cameraDistance = 320;\n\tthis.scale = 3;\n\tthis.rotationX = 0;\n\tthis.rotationY = 0;\n\tthis.rotationZ = 0;\n\tthis.color1 = \"#e32e8e\";\n\tthis.color2 = \"#2e98e3\";\n\tthis.color3 = \"#2e58e3\";\n\tthis.newX = function(x,y,z) {\n\treturn x - this.a * x * this.t + this.a * y * this.t;\n\t}\n\tthis.newY = function(x,y,z) {\n\treturn y + this.b * x * this.t - y * this.t - z * x * this.t;\n\t}\n\tthis.newZ = function(x,y,z) {\n\treturn z - this.c * z * this.t + x * y * this.t;\n\t}\n}", "title": "" }, { "docid": "3372d89ed4b319d98d37ff79ed8c96ff", "score": "0.55944973", "text": "static ria_to_xyz(radius, inclination, azimuth){\n return [radius * Math.sin(inclination) * Math.cos(azimuth), //x\n radius * Math.sin(inclination) * Math.sin(azimuth), //y\n radius * Math.cos(inclination)] //z\n }", "title": "" }, { "docid": "4dc04133ce1b896552450d7b1a9a8b20", "score": "0.559053", "text": "static LUVtoRGB(luv, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? luv.$normalize(false) : luv;\n return Color.XYZtoRGB(Color.LUVtoXYZ(c), false, normalizedOutput);\n }", "title": "" }, { "docid": "1e5033af3431f0964204f48fcded5e37", "score": "0.5539691", "text": "generateUVCoordinates() {\n \n var v1,v2,v3,v4, v11,v21,v31,v41, v12,v22,v32,v42, v13,v23,v33,v43, v14,v24,v34,v44 \n v1 = [1,1]\n v2 = [1,0]\n v3 = [0,1]\n v4 = [0,0]\n\n v11 = [1,1]\n v21 = [1,0.5]\n v31 = [0,1]\n v41 = [0,0.5]\n\n v12 = [1,0.5]\n v22 = [1,0]\n v32 = [0,0.5]\n v42 = [0,0]\n\n v13 = [2,1]\n v23 = [2,0]\n v33 = [0,1]\n v43 = [0,0]\n\n v14 = [3,3]\n v24 = [3,0]\n v34 = [0,3]\n v44 = [0,0]\n // v7----- v5\n // /| /|\n // v3------v1|\n // | | | |\n // | |v8---|-|v6\n // |/ |/\n // v4------v2\n var uvs = [v1,v2,v3, v2,v4,v3,\n v11,v21,v31, v21,v41,v31,\n v12,v22,v32, v22,v42,v32,\n v13,v23,v33, v23,v43,v33,\n v1,v2,v3, v2,v4,v3,\n v14,v24,v34, v24,v44,v34]\n\n for(var i = 0; i< 36; i++)\n {\n this.vertices[i].uv[0] = uvs[i][0]\n this.vertices[i].uv[1] = uvs[i][1]\n }\n\n\n // Recomendations: Remember uv coordinates are defined from 0.0 to 1.0.\n }", "title": "" }, { "docid": "1b5db3d97f1c8b7cd0f52d8bd34e1e2f", "score": "0.55209494", "text": "function RGBtoXYZ(rgb) {\n var red2 = rgb[0] / 255;\n var green2 = rgb[1] / 255;\n var blue2 = rgb[2] / 255;\n if (red2 > 0.04045) {\n red2 = (red2 + 0.055) / 1.055;\n red2 = Math.pow(red2, 2.4);\n }\n else {\n red2 = red2 / 12.92;\n }\n if (green2 > 0.04045) {\n green2 = (green2 + 0.055) / 1.055;\n green2 = Math.pow(green2, 2.4);\n }\n else {\n green2 = green2 / 12.92;\n }\n if (blue2 > 0.04045) {\n blue2 = (blue2 + 0.055) / 1.055;\n blue2 = Math.pow(blue2, 2.4);\n }\n else {\n blue2 = blue2 / 12.92;\n }\n red2 = (red2 * 100);\n green2 = (green2 * 100);\n blue2 = (blue2 * 100);\n var x = (red2 * 0.4124) + (green2 * 0.3576) + (blue2 * 0.1805);\n var y = (red2 * 0.2126) + (green2 * 0.7152) + (blue2 * 0.0722);\n var z = (red2 * 0.0193) + (green2 * 0.1192) + (blue2 * 0.9505);\n var xyzresult = new Array();\n xyzresult[0] = x;\n xyzresult[1] = y;\n xyzresult[2] = z;\n return(xyzresult);\n}", "title": "" }, { "docid": "b041867382c48216a19253fd254153ed", "score": "0.5434388", "text": "function getXYZ(array) {\n\t\tdebug('Running getXYZ on ' + array);\n\t\tvar xyz = {};\n\n\t\t// console.log(array);\n\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tswitch (array[i][0].toLowerCase()) {\n\t\t\t\tcase 'x':\n\t\t\t\t\txyz.x = scale(parseFloat(array[i].substring(1)));\n\t\t\t\t\tdebug('\\tX was determined to be ' + xyz.x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\txyz.y = scale(parseFloat(array[i].substring(1))) * -1;\n\t\t\t\t\tdebug('\\tY was determined to be ' + xyz.y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'z':\n\t\t\t\t\txyz.z = scale(parseFloat(array[i].substring(1)));\n\t\t\t\t\tdebug('\\tZ was determined to be ' + xyz.z);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tdebug('\\tTranslating the coordinates to the visual origin.');\n\t\tdebug('\\tReturn values:')\n\n\t\treturn translateToVisualOrigin(xyz);\n\t}", "title": "" }, { "docid": "c2abfd7d2196c6dacb90dcf77e5b8c21", "score": "0.54336923", "text": "function rgb_xyz(c) {\n if ((c /= 255) <= 0.04045)\n return c / 12.92;\n return Math.pow((c + 0.055) / 1.055, 2.4);\n }", "title": "" }, { "docid": "58a0ab06ad6ce3e7c44f67f09a8779d9", "score": "0.54157025", "text": "function l2X (Lab) {\n var Y = (Lab[0] + 16) / 116,\n X = Lab[1] / 500 + Y,\n Z = Y - Lab[2] / 200,\n K = 16 / 116;\n\n X = 95.047 * ((X * X * X) > 0.008856? X * X * X : (X - K) / 7.787);\n Y = 100 * ((Y * Y * Y) > 0.008856? Y * Y * Y : (Y - K) / 7.787);\n Z = 108.883 * ((Z * Z * Z) > 0.008856? Z * Z * Z : (Z - K) / 7.787);\n\n return [X, Y, Z, Lab[3]];\n }", "title": "" }, { "docid": "846ea12cc00e6f25f4e335a2681c5477", "score": "0.53976506", "text": "function getUV(long, lat) {\n\t\t// UV Index URL\n\t\tvar uvQuery =\n\t\t\t\"https://api.openweathermap.org/data/2.5/uvi?lat=\" +\n\t\t\tlat +\n\t\t\t\"&lon=\" +\n\t\t\tlong +\n\t\t\t\"&appid=\" +\n\t\t\tapiKey;\n\n\t\t// Call UV Index API\n\t\t$.ajax({\n\t\t\turl: uvQuery,\n\t\t\tmethod: \"GET\",\n\t\t}).then(function (data) {\n\t\t\tvar currentUV = $(\"<h2>UV Index: </h2>\");\n\t\t\tvar uvIndex = $(\"<span>\" + data.value + \"</span>\");\n\t\t\t$(currentUV).append(uvIndex);\n\t\t\t// Assign UV color coding class based on EPA guidelines\n\t\t\tif (data.value < 3) {\n\t\t\t\t$(uvIndex).addClass(\"low\");\n\t\t\t} else if (data.value >= 3 && data.value < 6) {\n\t\t\t\t$(uvIndex).addClass(\"moderate\");\n\t\t\t} else if (data.value >= 6 && data.value < 8) {\n\t\t\t\t$(uvIndex).addClass(\"high\");\n\t\t\t} else if (data.value >= 8 && data.value < 11) {\n\t\t\t\t$(uvIndex).addClass(\"veryHigh\");\n\t\t\t} else {\n\t\t\t\t$(uvIndex).addClass(\"extreme\");\n\t\t\t}\n\t\t\t// Send UV info to display div\n\t\t\t$(\"#newUV\").html(currentUV);\n\t\t});\n\t}", "title": "" }, { "docid": "82f00d86e6f4d9a760e95c8bd2e74ebb", "score": "0.5396885", "text": "invertUVs() {\n for (let i = 1; i < this.uvs.length; i += 2) {\n this.uvs[i] = 1.0 - this.uvs[i];\n }\n return this;\n }", "title": "" }, { "docid": "9b233bfc6f08a0ddc5a0548941ed2aad", "score": "0.5365677", "text": "function toVec3Normalized(out, hexColor) {\n out[0] = (hexColor >> 16 & 255) / 255;\n out[1] = (hexColor >> 8 & 255) / 255;\n out[2] = (hexColor & 255) / 255;\n return out;\n }", "title": "" }, { "docid": "1973e3ad933f73149d1761fd10528ede", "score": "0.53574014", "text": "function UV(u, v) {\n if (typeof u === \"undefined\") { u = 0; }\n if (typeof v === \"undefined\") { v = 0; }\n this._u = u;\n this._v = v;\n }", "title": "" }, { "docid": "723538d2e072dc9b60f40fed375449ae", "score": "0.5340023", "text": "function x2R (xyz) {\n var X = xyz[0] / 100,\n Y = xyz[1] / 100,\n Z = xyz[2] / 100,\n T = 1 / 2.4;\n\n var R = X * 3.2406 + Y * -1.5372 + Z * -0.4986,\n G = X * -0.9689 + Y * 1.8758 + Z * 0.0415,\n B = X * 0.0557 + Y * -0.2040 + Z * 1.0570;\n\n R = 255 * (R > 0.0031308? 1.055 * Math.pow (R, T) - 0.055 : 12.92 * R);\n G = 255 * (G > 0.0031308? 1.055 * Math.pow (G, T) - 0.055 : 12.92 * G);\n B = 255 * (B > 0.0031308? 1.055 * Math.pow (B, T) - 0.055 : 12.92 * B);\n\n return [R, G, B, xyz[3]];\n }", "title": "" }, { "docid": "8886e4c6df0d8e45551ad165845c833b", "score": "0.5336653", "text": "function lonlat2xyz(coord) {\n\n var lon = coord[0] * to_radians;\n var lat = coord[1] * to_radians;\n\n var x = Math.cos(lat) * Math.cos(lon);\n\n var y = Math.cos(lat) * Math.sin(lon);\n\n var z = Math.sin(lat);\n\n return [x, y, z];\n}", "title": "" }, { "docid": "a2369a4e08d0ec2803b4a71ba00046ef", "score": "0.53299886", "text": "function slippyDecimal2LngLat(x, y, z) {return [((-1.0)*(Pi))+((Math.pow(2.0,(1.0)+((-1.0)*(z))))*(Pi)*(x)), Math.gudermannian((Pi)+((-1.0)*(Math.pow(2.0,(1.0)+((-1.0)*(z))))*(Pi)*(y)))];}", "title": "" }, { "docid": "9e0a53ee205e5f403623ccd536072e79", "score": "0.53297913", "text": "function zvhToL(path) {\n var ret = [];\n var startPoint = ['L', 0, 0];\n var last_point;\n\n for (var i = 0, len = path.length; i < len; i++) {\n var pt = path[i];\n switch (pt[0]) {\n case 'M':\n startPoint = ['L', pt[1], pt[2]];\n ret.push(pt);\n break;\n case 'Z':\n ret.push(startPoint);\n break;\n case 'H':\n last_point = ret[ret.length - 1] || ['L', 0, 0];\n ret.push(['L', pt[1], last_point[last_point.length - 1]]);\n break;\n case 'V':\n last_point = ret[ret.length - 1] || ['L', 0, 0];\n ret.push(['L', last_point[last_point.length - 2], pt[1]]);\n break;\n default:\n ret.push(pt);\n }\n }\n return ret;\n}", "title": "" }, { "docid": "f9322c75cf20ec414f7fef1d02ca6ce2", "score": "0.5309175", "text": "function XYZ() {\n classCallCheck(this, XYZ);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var rest = [].concat(args);\n var scope = internal$7$1(this);\n if (args[args.length - 1] instanceof Illuminant) {\n scope.illuminant = rest.pop();\n } else {\n scope.illuminant = Illuminant.D50;\n }\n if (rest.length === 0) {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n } else if (rest.length === 1) {\n var _rest = slicedToArray(rest, 1),\n value = _rest[0];\n\n this.x = 0;\n this.y = value || 0;\n this.z = 0;\n } else {\n var _rest2 = slicedToArray(rest, 3),\n x = _rest2[0],\n y = _rest2[1],\n z = _rest2[2];\n\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n }\n }", "title": "" }, { "docid": "46b299e387f94f89e21f577d9991a2da", "score": "0.53061575", "text": "function returnLatLon(xyzObj) {\r\n\tvar latLonObj = Array();\r\n\tfor (var i = 0; i < xyzObj.length; i++) {\r\n\tlatLonObj[i] = {lon: Math.atan2(xyzObj[i].x, xyzObj[i].z),\r\n\t\t\t\t\t\t \t\t lat: Math.PI/2 - Math.acos(xyzObj[i].y / ( (earthRadius*1000) / metersToPix) )};\r\n\t}\r\n\treturn latLonObj;\r\n}", "title": "" }, { "docid": "feb3e84f93ac15c8c3ae8b577b9f3f4e", "score": "0.5305182", "text": "get uv() {\n if (!this._state.uv) {\n return;\n }\n if (!this._state.quantized) {\n return this._state.uv;\n }\n if (!this._decompressedUV) {\n this._decompressedUV = new Float32Array(this._state.uv.length);\n math.decompressUVs(this._state.uv, this._state.uvDecodeMatrix, this._decompressedUV);\n }\n return this._decompressedUV;\n }", "title": "" }, { "docid": "dda9337dd22e6c4bcdfaf93982b88c57", "score": "0.5300266", "text": "function lonlat2xyz( coord ){\n\n var lon = coord[0] * to_radians;\n var lat = coord[1] * to_radians;\n\n var x = Math.cos(lat) * Math.cos(lon);\n\n var y = Math.cos(lat) * Math.sin(lon);\n\n var z = Math.sin(lat);\n\n return [x, y, z];\n }", "title": "" }, { "docid": "39bbf24e30a90d8fe075ccc95ea8737b", "score": "0.52882063", "text": "function upvp_to_xy(up, vp, /* *xc, *yc*/)\n{\n return [(9 * up) / ((6 * up) - (16 * vp) + 12) /*xc*/,\n (4 * vp) / ((6 * up) - (16 * vp) + 12) /*yc*/];\n}", "title": "" }, { "docid": "e0a5d788254a3f2173ac2d4c218be89f", "score": "0.5259329", "text": "function rgbToXyz(rgb){\n var _r = (rgb[0] / 255);\n var _g = (rgb[1] / 255);\n var _b = (rgb[2] / 255);\n \n if (_r > 0.04045) {\n _r = Math.pow(((_r + 0.055) / 1.055), 2.4);\n }\n else {\n _r = _r / 12.92;\n }\n \n if (_g > 0.04045) {\n _g = Math.pow(((_g + 0.055) / 1.055), 2.4);\n }\n else { \n _g = _g / 12.92;\n }\n \n if (_b > 0.04045) {\n _b = Math.pow(((_b + 0.055) / 1.055), 2.4);\n }\n else { \n _b = _b / 12.92;\n }\n \n _r = _r * 100;\n _g = _g * 100;\n _b = _b * 100;\n \n X = _r * 0.4124 + _g * 0.3576 + _b * 0.1805;\n Y = _r * 0.2126 + _g * 0.7152 + _b * 0.0722;\n Z = _r * 0.0193 + _g * 0.1192 + _b * 0.9505;\n \n return [X, Y, Z];\n}", "title": "" }, { "docid": "09f7650eec36fb47bc907a6491ad7489", "score": "0.5246958", "text": "static XYZtoRGB(xyz, normalizedInput = false, normalizedOutput = false) {\n let [x, y, z] = (!normalizedInput) ? xyz.$normalize() : xyz;\n let rgb = [\n x * 3.2404542 + y * -1.5371385 + z * -0.4985314,\n x * -0.9692660 + y * 1.8760108 + z * 0.0415560,\n x * 0.0556434 + y * -0.2040259 + z * 1.0572252\n ];\n // convert xyz to rgb. Note that not all colors are visible in rgb, so here we bound rgb between 0 to 1\n for (let i = 0; i < 3; i++) {\n rgb[i] = (rgb[i] < 0) ? 0 : (rgb[i] > 0.0031308) ? (1.055 * Math.pow(rgb[i], 1 / 2.4) - 0.055) : (12.92 * rgb[i]);\n rgb[i] = Math.max(0, Math.min(1, rgb[i]));\n if (!normalizedOutput)\n rgb[i] = Math.round(rgb[i] * 255);\n }\n let cc = Color.rgb(rgb[0], rgb[1], rgb[2], xyz.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "06332c7427ac3df2b1ae558a947972d5", "score": "0.52166885", "text": "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "2a7cf0cc84b4309876414faba7d5ad33", "score": "0.52103895", "text": "function v (x,y,z) {\r\n\t\t\treturn new THREE.Vector3(x,y,z);\r\n\t\t}", "title": "" }, { "docid": "03e529a08b52c7c23867a5f9e096aca8", "score": "0.5205116", "text": "function vector(obj) {\n\t\t\tlet lat = Math.atan(0.993277*Math.tan(DEG2RAD*obj.Lat));\n\t\t\tlet lon = DEG2RAD*obj.Lon;\n\t\t\tobj.Z = Math.sin(lat);\n\t\t\tlet rxy = Math.cos(lat);\n\t\t\tobj.X = rxy*Math.cos(lon);\n\t\t\tobj.Y = rxy*Math.sin(lon);\n\t\t}", "title": "" }, { "docid": "02b97a7b93319e698931faaf3f6c4c41", "score": "0.51995915", "text": "normalize(){\n\t\t\t\t var longitud=this.length();\n\t\t\t\t return (new Vector4(this.x/longitud,this.y/longitud,this.z/longitud,this.w/longitud));\n\t\t\t }", "title": "" }, { "docid": "6fbae786df5752c7c870bb69430808ba", "score": "0.5168899", "text": "function zToL(path){\n var ret = [];\n var startPoint = ['L',0,0];\n\n for(var i=0, len=path.length; i<len; i++){\n var pt = path[i];\n switch(pt[0]){\n case 'M':\n startPoint = ['L', pt[1], pt[2]];\n ret.push(pt);\n break;\n case 'Z':\n ret.push(startPoint);\n break;\n default: \n ret.push(pt);\n }\n }\n return ret;\n}", "title": "" }, { "docid": "7b1e9bc7e0f37010e4a3f45a13cabc96", "score": "0.51647615", "text": "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "99ffaa1ef5b599423c99c1ee18918d8e", "score": "0.5164218", "text": "static RGBtoHSL (vecRGB) {\r\n\t\t// float3 HCV = RGBtoHCV(RGB);\r\n\t\tconst vecHCV = MathUtils.RGBtoHCV(vecRGB);\r\n\r\n\t\t// float L = HCV.z - HCV.y * 0.5;\r\n\t\tconst L = vecHCV.z - vecHCV.y * DIV_2;\r\n\r\n\t\t// float S = HCV.y / (1 - abs(L * 2 - 1) + Epsilon);\r\n\t\tconst S = vecHCV.y / (ONE - Math.abs(L * TWO - ONE) + Number.EPSILON);\r\n\r\n\t\t// return float3(HCV.x, S, L);\r\n\t\treturn { x: vecHCV.x, y: S, z: L };\r\n\t}", "title": "" }, { "docid": "24fe7802f80b90aa655e27e7fb87a409", "score": "0.515888", "text": "function luminanace (r, g, b) {\n var a = [r, g, b].map(function (v) {\n v /= 255;\n return v <= 0.03928\n ? v / 12.92\n : Math.pow((v + 0.055) / 1.055, 2.4)\n })\n return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;\n}", "title": "" }, { "docid": "ae09df2938ee8ff11df150aa01de9123", "score": "0.513976", "text": "translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n }", "title": "" }, { "docid": "280bccc35ec40a025835c2f0a7c9831b", "score": "0.5131768", "text": "function RGBtoXY(red, green, blue, model)\n{\n\n if(red > 1 || green > 1 || blue > 1)\n {\n red /= 255;\n green /= 255;\n blue /= 255;\n }\n\n red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92);\n green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92);\n blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92);\n\n var X = red * 0.649926 + green * 0.103455 + blue * 0.197109;\n var Y = red * 0.234327 + green * 0.743075 + blue * 0.022598;\n var Z = red * 0.0000000 + green * 0.053077 + blue * 1.035763;\n\n var cx = X / (X + Y + Z);\n var cy = Y / (X + Y + Z);\n\n if (isNaN(cx)) {\n cx = 0.0;\n }\n\n if (isNaN(cy)) {\n cy = 0.0;\n }\n\n//Check if the given XY value is within the colourreach of our lamps.\n var xyPoint = XYPoint(cx, cy);\n\n var colorPoints = colorPointsForModel(model);\n\n var inReachOfLamps = checkPointInLampsReach(xyPoint, colorPoints);\n\n if (!inReachOfLamps)\n {\n //It seems the colour is out of reach\n //let's find the closest colour we can produce with our lamp and send this XY value out.\n\n //Find the closest point on each line in the triangle.\n\n var pAB =getClosestPointToPoints( colorPoints[cptRED], colorPoints[cptGREEN], xyPoint);\n\n var pAC =getClosestPointToPoints( colorPoints[cptBLUE], colorPoints[cptRED], xyPoint);\n\n var pBC =getClosestPointToPoints( colorPoints[cptGREEN], colorPoints[cptBLUE], xyPoint);\n\n //Get the distances per point and see which point is closer to our Point.\n var dAB = getDistanceBetweenTwoPoints(xyPoint, pAB);\n var dAC = getDistanceBetweenTwoPoints(xyPoint, pAC);\n var dBC = getDistanceBetweenTwoPoints(xyPoint, pBC);\n\n var lowest = dAB;\n\n var closestPoint = pAB;\n\n if (dAC < lowest) {\n lowest = dAC;\n closestPoint = pAC;\n }\n if (dBC < lowest) {\n lowest = dBC;\n closestPoint = pBC;\n }\n\n //Change the xy value to a value which is within the reach of the lamp.\n cx = closestPoint.x;\n cy = closestPoint.y;\n }\n\n return {\n x: cx,\n y: cy,\n bri: Y\n };\n}", "title": "" }, { "docid": "a284e52da79bfc1defc0a9d64c5c999a", "score": "0.51241523", "text": "function interpolateUV(v0, v1, v2, t_alpha, t_beta, t_gamma) {\n var inv_z0 = 1 / v0.camV[2];\n var inv_z1 = 1 / v1.camV[2];\n var inv_z2 = 1 / v2.camV[2];\n var u_0 = v0.t[0] * inv_z0;\n var v_0 = v0.t[1] * inv_z0;\n var u_1 = v1.t[0] * inv_z1;\n var v_1 = v1.t[1] * inv_z1;\n var u_2 = v2.t[0] * inv_z2;\n var v_2 = v2.t[1] * inv_z2;\n var interpolated_u = t_alpha * u_0 + t_beta * u_1 + t_gamma * u_2;\n var interpolated_v = t_alpha * v_0 + t_beta * v_1 + t_gamma * v_2;\n var interpolated_z = t_alpha * inv_z0 + t_beta * inv_z1 + t_gamma * inv_z2;\n var inv_interpolated_z = 1 / interpolated_z;\n var corrected_UV = [];\n corrected_UV[0] = interpolated_u * inv_interpolated_z;\n corrected_UV[1] = interpolated_v * inv_interpolated_z;\n return corrected_UV;\n}", "title": "" }, { "docid": "7d909fa1eb745ddb66d931b630cd08c1", "score": "0.5120882", "text": "getReverse() {\n const reversesCoords = [];\n this.coords.forEach(coord => {\n reversesCoords.push(-1 * coord);\n });\n\n return new Vector(reversesCoords);\n }", "title": "" }, { "docid": "49e0e7571a0e8eec7fa2adb9f03bc241", "score": "0.5116378", "text": "function posnormtriv( pos, norm, o1, o2, o3, renderCallback ) {\n\n\t\tvar c = scope.count * 3;\n\n\t\t// positions\n\n\t\tscope.positionArray[ c + 0 ] = pos[ o1 ];\n\t\tscope.positionArray[ c + 1 ] = pos[ o1 + 1 ];\n\t\tscope.positionArray[ c + 2 ] = pos[ o1 + 2 ];\n\n\t\tscope.positionArray[ c + 3 ] = pos[ o2 ];\n\t\tscope.positionArray[ c + 4 ] = pos[ o2 + 1 ];\n\t\tscope.positionArray[ c + 5 ] = pos[ o2 + 2 ];\n\n\t\tscope.positionArray[ c + 6 ] = pos[ o3 ];\n\t\tscope.positionArray[ c + 7 ] = pos[ o3 + 1 ];\n\t\tscope.positionArray[ c + 8 ] = pos[ o3 + 2 ];\n\n\t\t// normals\n\n\t\tscope.normalArray[ c + 0 ] = norm[ o1 ];\n\t\tscope.normalArray[ c + 1 ] = norm[ o1 + 1 ];\n\t\tscope.normalArray[ c + 2 ] = norm[ o1 + 2 ];\n\n\t\tscope.normalArray[ c + 3 ] = norm[ o2 ];\n\t\tscope.normalArray[ c + 4 ] = norm[ o2 + 1 ];\n\t\tscope.normalArray[ c + 5 ] = norm[ o2 + 2 ];\n\n\t\tscope.normalArray[ c + 6 ] = norm[ o3 ];\n\t\tscope.normalArray[ c + 7 ] = norm[ o3 + 1 ];\n\t\tscope.normalArray[ c + 8 ] = norm[ o3 + 2 ];\n\n\t\t// uvs\n\n\t\tif ( scope.enableUvs ) {\n\n\t\t\tvar d = scope.count * 2;\n\n\t\t\tscope.uvArray[ d + 0 ] = pos[ o1 ];\n\t\t\tscope.uvArray[ d + 1 ] = pos[ o1 + 2 ];\n\n\t\t\tscope.uvArray[ d + 2 ] = pos[ o2 ];\n\t\t\tscope.uvArray[ d + 3 ] = pos[ o2 + 2 ];\n\n\t\t\tscope.uvArray[ d + 4 ] = pos[ o3 ];\n\t\t\tscope.uvArray[ d + 5 ] = pos[ o3 + 2 ];\n\n\t\t}\n\n\t\t// colors\n\n\t\tif ( scope.enableColors ) {\n\n\t\t\tscope.colorArray[ c + 0 ] = pos[ o1 ];\n\t\t\tscope.colorArray[ c + 1 ] = pos[ o1 + 1 ];\n\t\t\tscope.colorArray[ c + 2 ] = pos[ o1 + 2 ];\n\n\t\t\tscope.colorArray[ c + 3 ] = pos[ o2 ];\n\t\t\tscope.colorArray[ c + 4 ] = pos[ o2 + 1 ];\n\t\t\tscope.colorArray[ c + 5 ] = pos[ o2 + 2 ];\n\n\t\t\tscope.colorArray[ c + 6 ] = pos[ o3 ];\n\t\t\tscope.colorArray[ c + 7 ] = pos[ o3 + 1 ];\n\t\t\tscope.colorArray[ c + 8 ] = pos[ o3 + 2 ];\n\n\t\t}\n\n\t\tscope.count += 3;\n\n\t\tif ( scope.count >= scope.maxCount - 3 ) {\n\n\t\t\tscope.hasPositions = true;\n\t\t\tscope.hasNormals = true;\n\n\t\t\tif ( scope.enableUvs ) {\n\n\t\t\t\tscope.hasUvs = true;\n\n\t\t\t}\n\n\t\t\tif ( scope.enableColors ) {\n\n\t\t\t\tscope.hasColors = true;\n\n\t\t\t}\n\n\t\t\trenderCallback( scope );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "cbe6cdd0bba991f9f563ca8602c96e4c", "score": "0.5115806", "text": "function latLongToVector3(lat, lon, r) {\n // http://www.smartjava.org/content/render-open-data-3d-world-globe-threejs\n\n const phi = lat * Math.PI / 180;\n const theta = (lon - 180) * Math.PI / 180;\n\n const x = -r * Math.cos(phi) * Math.cos(theta);\n const y = r * Math.sin(phi);\n const z = r * Math.cos(phi) * Math.sin(theta);\n\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "17286dbc1a4af38efbd4a3de6694c6e2", "score": "0.5088091", "text": "function sph2xyz(obj) {\n\n arr = [obj.r * Math.cos(obj.ph) * Math.cos(obj.th),\n obj.r * Math.cos(obj.ph) * Math.sin(obj.th),\n obj.r * Math.sin(obj.ph)];\n\n return {x: arr[0], y: arr[1], z: arr[2], arr:arr};\n}", "title": "" }, { "docid": "8c7252cfc0d3efec5bb4c7a3187bab47", "score": "0.50832623", "text": "function zToL(path) {\n var ret = [];\n var startPoint = ['L', 0, 0];\n\n for (var i = 0, len = path.length; i < len; i++) {\n var pt = path[i];\n switch (pt[0]) {\n case 'M':\n startPoint = ['L', pt[1], pt[2]];\n ret.push(pt);\n break;\n case 'Z':\n ret.push(startPoint);\n break;\n default:\n ret.push(pt);\n }\n }\n return ret;\n}", "title": "" }, { "docid": "2c4ff666c99d4a1c3f17fc2245fc5bc1", "score": "0.5082652", "text": "function d2l(v, axis) {\n return axis ? axis.d2l(v) : v;\n}", "title": "" }, { "docid": "1c49987c8385f1a235cee2783a65ddd2", "score": "0.5081213", "text": "function getNormalizedVectorBetweenTwoPoints(x0,y0,z0, x1,y1,z1)\n{\n var magnitude = getDistanceBetweenTwoPoints(x0,y0,z0, x1,y1,z1)\n var vector = new Array((x1-x0)/magnitude, (y1-y0)/magnitude, (z1-z0)/magnitude);\n return vector;\n}", "title": "" }, { "docid": "74a75b1fb116bc15bcab08f0c04db240", "score": "0.5080109", "text": "function toPlaneOfOrbit(xyz) {\n // Get least squares best fit to orbital plane.\n let [x2, xy, y2, xz, yz] = xyz.reduce(\n ([x2, xy, y2, xz, yz], [x, y, z, zvar]) =>\n [x2+x**2, xy+x*y, y2+y**2, xz+x*z, yz+y*z], [0, 0, 0, 0, 0]);\n let det = x2*y2 - xy**2;\n // Gradient (mx, my), z(x, y) ~ mx*x + my*y:\n let [mx, my] = [(y2*xz - xy*yz) / det, (x2*yz - xy*xz) / det];\n let [mxx, myy, mxy] = [mx**2, my**2, mx*my];\n let mu = mxx + myy; // mxx+myy = square of tangent of inclination\n let ci = Math.sqrt(1 + mu);\n mu = 1 + ci;\n ci = 1 / ci; // cosine of inclination (very near 1)\n mu = ci / mu;\n [mxx, myy, mxy] = [1 - mu*mxx, 1 - mu*myy, mu*mxy];\n let [mxz, myz] = [ci*mx, ci*my];\n return xyz.map(([x, y, z]) =>\n [mxx*x - mxy*y + mxz*z, myy*y - mxy*x + myz*z,\n ci*z - mxz*x - myz*y]);\n }", "title": "" }, { "docid": "2bd93a12d7d61064fa7da9e1c66d3a96", "score": "0.50731355", "text": "function correctUV( uv, vector, azimuth ) {\n\n\t\tif ( ( azimuth < 0 ) && ( uv.u === 1 ) ) uv = new THREE.UV( uv.u - 1, uv.v );\n\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.UV( azimuth / 2 / Math.PI + 0.5, uv.v );\n\t\treturn uv;\n\n\t}", "title": "" }, { "docid": "4758fc889f78dffb139cb4cdf1668c19", "score": "0.5068138", "text": "static LCHtoLAB(lch, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? lch.$normalize(false) : lch;\n let rad = Num_1.Geom.toRadian(c[2]);\n return Color.lab(c[0], Math.cos(rad) * c[1], Math.sin(rad) * c[1], lch.alpha);\n }", "title": "" }, { "docid": "ff771f2eac3b129ee4c06819f4725500", "score": "0.506478", "text": "toSRGB() {\r\n return this.toXYZ().toRGB().toSRGB();\r\n }", "title": "" }, { "docid": "a4290bfef76bc780706c9f6d1f3519b4", "score": "0.5064229", "text": "function uv_spherical(geometry){\n geometry.computeBoundingBox();\n \n var max = geometry.boundingBox.max;\n var min = geometry.boundingBox.min;\n \n var offset = new THREE.Vector3(0 - min.x, 0 - min.y, 0-min.z);\n var range = new THREE.Vector3(max.x - min.x, max.y - min.y, max.z - min.z);\n var positions = Array.from(geometry.attributes.position.array);\n var uvAttribute = geometry.attributes.uv;\n\n for (var i = 0; i < positions.length / 3; i++) {\n \n var x = positions[i * 3];\n var y = positions[i * 3 + 1];\n var z = positions[i * 3 + 2];\n x = (x)/Math.abs(range.x);\n y = (y)/Math.abs(range.y);\n z = (z)/Math.abs(range.z);\n var U = uvAttribute.getX( i );\n var V = uvAttribute.getY( i );\n\n U = (Math.atan2(y, x) / Math.PI*0.5)+0.5 ;\n V = 0.5 - (Math.asin(z) / Math.PI);\n \n let uvcoord = new THREE.Vector2(U,V);\n uvMapSpherical.push(uvcoord);\n }\n }", "title": "" }, { "docid": "1454cd33fefbfe19f722039f0be4709d", "score": "0.5048263", "text": "function getNorm( va, vb, vc )\n{\n\tvar d1 = vec3.fromValues( vb.x-va.x, vb.y-va.y, vb.z-va.z );\n\tvar d2 = vec3.fromValues( vc.x-va.x, vc.y-va.y, vc.z-va.z );\n\tvar perp = vec3.create();\n\tvec3.cross(perp, d1, d2);\n\tvar norm = vec3.create();\n\tvec3.normalize(norm, perp);\n\treturn norm;\n}", "title": "" }, { "docid": "979c88332c0c0bfeffebfcd334a387a6", "score": "0.50424147", "text": "setuvcoords(x, y, dx, dy){\n this.uvcoords = [\n x, y, // 0\n x + dx, y, // 1\n x, y - dy, // 2\n x + dx, y - dy // 3\n ];\n //console.log(this.uvcoords);\n }", "title": "" }, { "docid": "7540051b3ffbd2ed1250bb0cbe39cd08", "score": "0.5042313", "text": "function rgbToLinearLuminance(rgb) {\n return rgb.r * 0.2126 + rgb.g * 0.7152 + rgb.b * 0.0722;\n}", "title": "" }, { "docid": "780bcea941153ae8baa956a0d9594b74", "score": "0.5038226", "text": "function vector3toLonLat(v) {\n const vPoint = new Vector3(v.x, v.y, v.z);\n vPoint.normalize();\n\n // longitude = angle of the vector around the Y axis\n // -( ) : negate to flip the longitude (3d space specific )\n // - PI / 2 to face the Z axis\n let lng = -(Math.atan2(-vPoint.z, -vPoint.x)) - r90;\n\n // to bind between -PI / PI\n if (lng < -Math.PI) lng += r360;\n\n // latitude : angle between the vector & the vector projected on the XZ plane on a unit sphere\n\n // project on the XZ plane\n const p = new Vector3(vPoint.x, 0, vPoint.z);\n // project on the unit sphere\n p.normalize();\n\n // commpute the angle ( both vectors are normalized, no division by the sum of lengths )\n const dot = _.clamp(p.dot(vPoint), -1, 1);\n let lat = Math.acos(dot);\n\n // invert if Y is negative to ensure teh latitude is comprised between -PI/2 & PI / 2\n if (vPoint.y < 0) lat *= -1;\n\n if (lng < 0) lng += r360;\n\n if (!(_N(lng).isValid && _N(lat).isValid)) {\n console.log('vector3toLonLat: bad lng:', lng, 'lat:', lat);\n // eslint-disable-next-line no-use-before-define\n console.log(' ... input:', v, 'point:', cleanV3(vPoint));\n console.log(' ... dot = ', dot);\n }\n return [_N(lng)\n .deg()\n .round().value,\n _N(lat)\n .deg()\n .round().value,\n ];\n}", "title": "" }, { "docid": "3de62eea7eacddefaea7c45df9b41895", "score": "0.50211227", "text": "function vector3toLonLat( vector )\n{\n\t\tconst vector3 = new THREE.Vector3(vector.x, vector.y, vector.z);\n vector3.normalize();\n\n //longitude = angle of the vector around the Y axis\n //-( ) : negate to flip the longitude (3d space specific )\n //- PI / 2 to face the Z axis\n var lng = -( Math.atan2( -vector3.z, -vector3.x ) ) - Math.PI / 2;\n\n //to bind between -PI / PI\n if( lng < - Math.PI )lng += Math.PI * 2;\n\n //latitude : angle between the vector & the vector projected on the XZ plane on a unit sphere\n\n //project on the XZ plane\n var p = new THREE.Vector3( vector3.x, 0, vector3.z );\n //project on the unit sphere\n p.normalize();\n\n //commpute the angle ( both vectors are normalized, no division by the sum of lengths )\n var lat = Math.acos( p.dot( vector3 ) );\n\n //invert if Y is negative to ensure teh latitude is comprised between -PI/2 & PI / 2\n if( vector3.y < 0 )\n {\n \t lat *= -1;\n }\n\n return [ lng,lat ];\n\n}", "title": "" }, { "docid": "f72560ebcbaaed3e0468728e54cbaa11", "score": "0.5019733", "text": "ll(px) {\n /* Lon */\n var floatX = px[0] / this.mapwh[0];\n var rad = ((floatX * 2) - 1) * Math.PI;\n var lon = rad * DEG;\n\n /* Lat */\n var floatY = px[1] / this.mapwh[1];\n var _nor = floatY; // 0-1, increases down the Y axis\n var _nor = (_nor * 2) - 1;\n var _nor = -_nor;\n var _nor = _nor * Math.PI;\n var _nor = Math.sinh(_nor);\n var _rad = Math.atan(_nor);\n var lat = _rad * (180 / Math.PI);\n\n return [lon, lat];\n }", "title": "" }, { "docid": "38b07132728057a6e919be41a57e4c6c", "score": "0.50175726", "text": "static RGBtoXYZ(rgb, normalizedInput = false, normalizedOutput = false) {\n let c = (!normalizedInput) ? rgb.$normalize() : rgb.clone();\n for (let i = 0; i < 3; i++) {\n c[i] = (c[i] > 0.04045) ? Math.pow((c[i] + 0.055) / 1.055, 2.4) : c[i] / 12.92;\n if (!normalizedOutput)\n c[i] = c[i] * 100;\n }\n let cc = Color.xyz(c[0] * 0.4124564 + c[1] * 0.3575761 + c[2] * 0.1804375, c[0] * 0.2126729 + c[1] * 0.7151522 + c[2] * 0.0721750, c[0] * 0.0193339 + c[1] * 0.1191920 + c[2] * 0.9503041, rgb.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "52006f836317767bebdb459a14a6bad7", "score": "0.5002414", "text": "function correctUV( uv, vector, azimuth ) {\n\n\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\n\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\treturn uv;\n\n\t}", "title": "" }, { "docid": "560579dc184cbdf360e652263c1d62dd", "score": "0.50018126", "text": "function generate_point(x0, y0, z0, x1, y1, z1, level_now, l0, alpha, beta) {\n var x, y, z;\n var l = l0 / Math.pow(2, level_now);\n var v = [];\n var vec = [];\n vec.push(x1 - x0);\n vec.push(y1 - y0);\n vec.push(z1 - z0);\n\n // This (x, y, z) currently surrounds z axis.\n // I will need to rotate it to make it surround vec\n x = l * Math.sin(beta) * Math.cos(alpha);\n y = l * Math.sin(beta) * Math.sin(alpha);\n z = l * Math.cos(beta);\n\n // Then I need to rotate this (x, y, z) by an axis to some degree\n // The axis can be calculated by doing cross product from (0, 0, 1) with vec/||vec||.\n var len = Math.sqrt(Math.pow(vec[0], 2) + Math.pow(vec[1], 2) + Math.pow(vec[2], 2));\n vec[0] = vec[0] / len;\n vec[1] = vec[1] / len;\n vec[2] = vec[2] / len;\n // (0, 0, 1) and vec, cross product, use determinant:\n // | i j k |\n // | 0 0 1 | = (-vec[1])i + (vec[0])j\n // |vec[0] vec[1] vec[2]|\n var axis = [];\n axis.push(-vec[1]);\n axis.push(vec[0]);\n axis.push(0);\n var la = Math.sqrt(Math.pow(axis[0], 2) + Math.pow(axis[1], 2) + Math.pow(axis[2], 2));\n if (la != 0) {\n axis[0] /= la;\n axis[1] /= la;\n axis[2] /= la;\n }\n\n // Now, I will rotate (x, y, z) by that axis\n // I need a rotational angle. It can be calculated by a dot product\n // cos(r_angle) = (0, 0, 1).*(vec[0], vec[1], vec[2])/(1*1);\n var r_angle = Math.acos(0 * vec[0] + 0 * vec[1] + 1 * vec[2]);\n\n // Here is the rotation matrix I google and get from http://blog.atelier39.org/cg/463.html\n var m00 = Math.pow(axis[0], 2) * (1 - Math.cos(r_angle)) + Math.cos(r_angle);\n var m01 = axis[0] * axis[1] * (1 - Math.cos(r_angle)) - axis[2] * Math.sin(r_angle);\n var m02 = axis[0] * axis[2] * (1 - Math.cos(r_angle)) + axis[1] * Math.sin(r_angle);\n var m10 = axis[0] * axis[1] * (1 - Math.cos(r_angle)) + axis[2] * Math.sin(r_angle);\n var m11 = Math.pow(axis[1], 2) * (1 - Math.cos(r_angle)) + Math.cos(r_angle);\n var m12 = axis[1] * axis[2] * (1 - Math.cos(r_angle)) - axis[0] * Math.sin(r_angle);\n var m20 = axis[0] * axis[2] * (1 - Math.cos(r_angle)) - axis[1] * Math.sin(r_angle);\n var m21 = axis[1] * axis[2] * (1 - Math.cos(r_angle)) + axis[0] * Math.sin(r_angle);\n var m22 = Math.pow(axis[2], 2) * (1 - Math.cos(r_angle)) + Math.cos(r_angle);\n\n // Do matrix multiplication:\n v.push(m00 * x + m01 * y + m02 * z);\n v.push(m10 * x + m11 * y + m12 * z);\n v.push(m20 * x + m21 * y + m22 * z);\n\n // Do translation:\n v[0] = v[0] + x1;\n v[1] = v[1] + y1;\n v[2] = v[2] + z1;\n\n return v;\n}", "title": "" }, { "docid": "17de75cbbf3ebe5f594246ff1b0d68fe", "score": "0.5000152", "text": "function TextureUvs()\n\t{\n\t this.x0 = 0;\n\t this.y0 = 0;\n\n\t this.x1 = 1;\n\t this.y1 = 0;\n\n\t this.x2 = 1;\n\t this.y2 = 1;\n\n\t this.x3 = 0;\n\t this.y3 = 1;\n\t}", "title": "" }, { "docid": "02ff7dc92dbd3fd01c5d3015f9b453da", "score": "0.4985644", "text": "function vecToLocal(vector, mesh){\n var m = mesh.getWorldMatrix();\n var v = BABYLON.Vector3.TransformCoordinates(vector, m);\n return v;\t\t \n }", "title": "" }, { "docid": "83d5eb038f37ae2c1c08a5d52ac06140", "score": "0.49847794", "text": "mapUVs( font, char ) {\n\n const charOBJ = font.chars.find( charOBJ => charOBJ.char === char );\n\n const common = font.common;\n\n const xMin = charOBJ.x / common.scaleW;\n\n const xMax = (charOBJ.x + charOBJ.width ) / common.scaleW;\n\n const yMin = 1 -((charOBJ.y + charOBJ.height ) / common.scaleH);\n\n const yMax = 1 - (charOBJ.y / common.scaleH);\n\n //\n\n const uvAttribute = this.attributes.uv;\n\n for ( let i = 0; i < uvAttribute.count; i ++ ) {\n\n let u = uvAttribute.getX( i );\n let v = uvAttribute.getY( i );\n\n [ u, v ] = (()=> {\n switch ( i ) {\n case 0 : return [ xMin, yMax ]\n case 1 : return [ xMax, yMax ]\n case 2 : return [ xMin, yMin ]\n case 3 : return [ xMax, yMin ]\n }\n })();\n\n uvAttribute.setXY( i, u, v );\n\n }\n\n }", "title": "" }, { "docid": "f718b2d372f87e847f1e5eb5388eecd6", "score": "0.4978228", "text": "function xyz_rgb(c) {\n return 255 * (c <= 0.00304 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055);\n }", "title": "" }, { "docid": "90a5da8837a60f500d7939bbce8c7605", "score": "0.4966757", "text": "function correctUV( uv, vector, azimuth ) {\n\t\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\t\treturn uv.clone();\n\t\n\t\t}", "title": "" }, { "docid": "fbfc240b1cc759256150b2ba4065a0d3", "score": "0.49582267", "text": "function rgb2xyz(rgba, w, h) {\n\t var xyz = new Float32Array(3*w*h),\n\t gamma = 2.2;\n\t for (var i = 0; i<w*h; i++) {\n\t // 1.0 / 255.9 = 0.00392156862.\n\t var r = rgba[4*i+0] * 0.00392156862,\n\t g = rgba[4*i+1] * 0.00392156862,\n\t b = rgba[4*i+2] * 0.00392156862;\n\t r = Math.pow(r, gamma);\n\t g = Math.pow(g, gamma);\n\t b = Math.pow(b, gamma);\n\t xyz[i] = (r * 0.4887180 + g * 0.310680 + b * 0.2006020);\n\t xyz[i + w*h] = (r * 0.1762040 + g * 0.812985 + b * 0.0108109);\n\t xyz[i + 2*w*h] = (g * 0.0102048 + b * 0.989795);\n\t }\n\t return xyz;\n\t }", "title": "" }, { "docid": "4c5e27809bc8f4b45ca6540cb5a68672", "score": "0.49484247", "text": "function normalize(u)\n{\n var result = length(u);\n\n return vec3(u.array[0]/result, u.array[1]/result, u.array[2]/result); \n}", "title": "" }, { "docid": "b41d4729cb3574a3066ab2ee56b346f6", "score": "0.49467966", "text": "function assignUVs(geometry) {\n geometry.computeBoundingBox();\n\n var max = geometry.boundingBox.max;\n var min = geometry.boundingBox.min;\n\n var offset = new THREE.Vector2(0 - min.x, 0 - min.y);\n var range = new THREE.Vector2(max.x - min.x, max.y - min.y);\n\n geometry.faceVertexUvs[0] = [];\n var faces = geometry.faces;\n\n for (i = 0; i < geometry.faces.length ; i++) {\n\n var v1 = geometry.vertices[faces[i].a];\n var v2 = geometry.vertices[faces[i].b];\n var v3 = geometry.vertices[faces[i].c];\n\n geometry.faceVertexUvs[0].push([\n new THREE.Vector2( ( v1.x + offset.x ) / range.x , ( v1.y + offset.y ) / range.y ),\n new THREE.Vector2( ( v2.x + offset.x ) / range.x , ( v2.y + offset.y ) / range.y ),\n new THREE.Vector2( ( v3.x + offset.x ) / range.x , ( v3.y + offset.y ) / range.y )\n ]);\n\n }\n\n geometry.uvsNeedUpdate = true;\n }", "title": "" }, { "docid": "1211fbc2205ba357c234caff3c423f5f", "score": "0.49435288", "text": "function correctUV( uv, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new Vector2( uv.x - 1, uv.y );\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\t\treturn uv.clone();\n\n\t\t}", "title": "" }, { "docid": "4cc7e40dfc34608245b29260d5d60017", "score": "0.49400705", "text": "toRGB() {\r\n return this.toXYZ().toRGB();\r\n }", "title": "" }, { "docid": "310b960dc4b37a42938e087f6be7d9c3", "score": "0.4938869", "text": "function setValueV2ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2ui( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}", "title": "" }, { "docid": "553621e56e35e10d5ab93eb48b55aca0", "score": "0.49379528", "text": "function correctUV( uv, vector, azimuth ) {\n\t\n\t\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new Vector2( uv.x - 1, uv.y );\n\t\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\t\t\treturn uv.clone();\n\t\n\t\t\t}", "title": "" }, { "docid": "f5f922c0198eebc2bf9c9706d04624f7", "score": "0.49237198", "text": "function lorentzDot( u, v ){\n\treturn u[0]*v[0] + u[1]*v[1] + u[2]*v[2] - u[3]*v[3];\n}", "title": "" }, { "docid": "bd78074f93632a876e21b67b99881f85", "score": "0.49226543", "text": "luDecomposition() {\n const width = this.width;\n const height = this.height;\n const uRowArrays = this.asRowArrays(Float64Array);\n const lRowArrays = arrayFromFunction(height, () => new Float64Array(height));\n const pRowArrays = Matrix.identityN(height).asRowArrays(Float64Array);\n let currentRowIndex = 0;\n for (let colIndex = 0; colIndex < width; colIndex++) {\n currentRowIndex = colIndex;\n // console.log('currentRowIndex', currentRowIndex)\t// find largest value in colIndex\n let maxAbsValue = 0, pivotRowIndex = -1, numberOfNonZeroRows = 0;\n for (let rowIndex = currentRowIndex; rowIndex < height; rowIndex++) {\n const el = uRowArrays[rowIndex][colIndex];\n numberOfNonZeroRows += +(0 != el);\n if (Math.abs(el) > maxAbsValue) {\n maxAbsValue = Math.abs(el);\n pivotRowIndex = rowIndex;\n }\n }\n // TODO: check with isZero\n if (0 == maxAbsValue) {\n // column contains only zeros\n continue;\n }\n assert(-1 !== pivotRowIndex);\n // swap rows\n arraySwap(uRowArrays, currentRowIndex, pivotRowIndex);\n arraySwap(lRowArrays, currentRowIndex, pivotRowIndex);\n arraySwap(pRowArrays, currentRowIndex, pivotRowIndex);\n lRowArrays[currentRowIndex][colIndex] = 1;\n if (1 < numberOfNonZeroRows) {\n // subtract pivot (now current) row from all below it\n for (let rowIndex = currentRowIndex + 1; rowIndex < height; rowIndex++) {\n const l = uRowArrays[rowIndex][colIndex] /\n uRowArrays[currentRowIndex][colIndex];\n lRowArrays[rowIndex][colIndex] = l;\n // subtract pivot row * l from row 'rowIndex'\n for (let colIndex2 = colIndex; colIndex2 < width; colIndex2++) {\n uRowArrays[rowIndex][colIndex2] -=\n l * uRowArrays[currentRowIndex][colIndex2];\n }\n }\n }\n // currentRowIndex++ // this doesn't increase if pivot was zero\n }\n return {\n L: Matrix.fromRowArrays(...lRowArrays),\n U: Matrix.fromRowArrays(...uRowArrays),\n P: Matrix.fromRowArrays(...pRowArrays),\n };\n }", "title": "" }, { "docid": "0dfef60d173cb0054f6389311fc3aefa", "score": "0.4920798", "text": "function buildL(row, col, orientation) {\n if (orientation === 1) {\n blockCoords = [[row, col], [row + 1, col], [row + 1, col - 1], [row + 1, col - 2]];\n }\n\n else if (orientation === 2) {\n blockCoords = [[row, col], [row, col - 1], [row - 1, col - 1], [row - 2, col - 1]];\n }\n\n else if (orientation === 3) {\n blockCoords = [[row, col], [row - 1, col], [row - 1, col + 1], [row - 1, col + 2]];\n }\n\n else {\n blockCoords = [[row, col], [row, col + 1], [row + 1, col + 1], [row + 2, col + 1]];\n };\n\n return blockCoords;\n }", "title": "" }, { "docid": "1e975b6de03da3d9e5bd1470e35e5b22", "score": "0.4916335", "text": "async function getUv(data) {\n //query UV url by using the coord of the current city in the api for UV.\n let queryUv = `https://api.openweathermap.org/data/2.5/uvi?appid=${myKey}&lat=${data.coord.lat}&lon=${data.coord.lon}`;\n const response = await fetch(queryUv);\n const uv = await response.json();\n displayUvIndex(uv.value);\n}", "title": "" }, { "docid": "5af1a71e62190d617bd0665cb967512e", "score": "0.48961332", "text": "function correctUV( uv, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\t\treturn uv.clone();\n\n\t\t}", "title": "" }, { "docid": "56d45206fafcbfba75ba0122b2d654ba", "score": "0.4893205", "text": "static TransformNormalFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n result.x = x * m[0] + y * m[4] + z * m[8];\n result.y = x * m[1] + y * m[5] + z * m[9];\n result.z = x * m[2] + y * m[6] + z * m[10];\n }", "title": "" }, { "docid": "489ad76c21a77b9b4f0c0f67dbd737da", "score": "0.4889549", "text": "function correctUV( uv, vector, azimuth ) {\n\n\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\n\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\n\t\treturn uv.clone();\n\n\t}", "title": "" }, { "docid": "573733280784138c950830b8e5c5c2f6", "score": "0.48857906", "text": "mapUVs( font, char ) {\n const charOBJ = font.chars.find( charOBJ => charOBJ.char === char );\n const common = font.common;\n const xMin = charOBJ.x / common.scaleW;\n const xMax = (charOBJ.x + charOBJ.width ) / common.scaleW;\n const yMin = 1 -((charOBJ.y + charOBJ.height ) / common.scaleH);\n const yMax = 1 - (charOBJ.y / common.scaleH);\n\n const uvAttribute = this.attributes.uv;\n\n for ( let i = 0; i < uvAttribute.count; i ++ ) {\n let u = uvAttribute.getX( i );\n let v = uvAttribute.getY( i );\n\n [ u, v ] = (()=> {\n switch ( i ) {\n case 0 : return [ xMin, yMax ]\n case 1 : return [ xMax, yMax ]\n case 2 : return [ xMin, yMin ]\n case 3 : return [ xMax, yMin ]\n }\n })();\n\n uvAttribute.setXY( i, u, v );\n }\n }", "title": "" }, { "docid": "950cd94afbc63e1ef34de58133f7b149", "score": "0.48840326", "text": "function correctUV( uv, vector, azimuth ) {\r\n\r\n\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\r\n\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\r\n\t\treturn uv.clone();\r\n\r\n\t}", "title": "" }, { "docid": "950cd94afbc63e1ef34de58133f7b149", "score": "0.48840326", "text": "function correctUV( uv, vector, azimuth ) {\r\n\r\n\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );\r\n\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );\r\n\t\treturn uv.clone();\r\n\r\n\t}", "title": "" } ]
5354847ed03caa792963cba180128262
Initialize and add the map
[ { "docid": "7d8bbe772ade7c85f4cb0a496558784e", "score": "0.0", "text": "function initMap() {\n // The location of Uluru\n var uluru = {lat: -25.344, lng: 131.036};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 4, center: uluru});\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "title": "" } ]
[ { "docid": "d8f276e143f9b283d1382aa53cac3bfe", "score": "0.7922108", "text": "function init() {\n initMap();\n }", "title": "" }, { "docid": "2b8984f261e579663eaa66f5cdfe5dc0", "score": "0.7824918", "text": "function initMap() {\n displayMap(0, 0, 2);\n }", "title": "" }, { "docid": "62a81c1bc22c20fc9bd1d50f0a44729c", "score": "0.7721099", "text": "function initialize(){\n setMap();\n}", "title": "" }, { "docid": "62a81c1bc22c20fc9bd1d50f0a44729c", "score": "0.7721099", "text": "function initialize(){\n setMap();\n}", "title": "" }, { "docid": "4b90f838ce134a5b6859a40773d7e8fe", "score": "0.76895016", "text": "function initMap() {\n createRoscoesMap();\n createOhMap();\n createGreenEggsMap();\n createBirrieriaMap();\n createNandosMap();\n createMisoyaMap();\n}", "title": "" }, { "docid": "29ba052b3135b270d15ad399d97258a7", "score": "0.76612306", "text": "initMap() {\n\t\tthis.mymap = L.map(this.mapid).setView([this.latitude, this.longitude], 13);\n\n\t\tlet korona = L.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {\n\t\t\tattribution: '<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>',\n\t\t\tminZoom: 0,\n\t\t\tmaxZoom: 18\n\t\t});\n\n\t\tthis.mymap.addLayer(korona);\n\n\t\tthis.markersCluster = new L.MarkerClusterGroup();\n\n\t\tthis.getStations();\n\t}", "title": "" }, { "docid": "e205c16d9918e5dff6915f844445d231", "score": "0.7629252", "text": "function initialize(){\n createMap();\n}", "title": "" }, { "docid": "2839ee697b071e62fcc4aefbd2c5f4d1", "score": "0.7594491", "text": "function initialize(){\r\n setMap(); \r\n}", "title": "" }, { "docid": "c8f111827f5990b0fe97c8172a5002e7", "score": "0.7455379", "text": "function initMap() {\n map = new HomeMap();\n}", "title": "" }, { "docid": "d7c91d650985796643fcd231bf3e074a", "score": "0.7376699", "text": "constructor() {\n this.map = new Map();\n }", "title": "" }, { "docid": "984269418c0abf98d9b561b416de55ad", "score": "0.73636687", "text": "function lazyLoadMap() {\n initMap();\n addMarkersToMap();\n}", "title": "" }, { "docid": "c1b703db25f9a04397f7b5bea521c136", "score": "0.7355514", "text": "function initMap() {\n\n\t\t// Set source path for Map\n\n\t\t// Set values for map dimensions\n\t\t\tgMO.mapWidth = mapImage.width;\n\t\t\tgMO.mapHeight = mapImage.height;\n\n\t\t\tconsole.log(\"Map Drawn\");\n\t\t\t// Set Map Floor Value\n\t\t\tgMO.mapFloor = 510;\n\n\n\n\t}", "title": "" }, { "docid": "2494b6a79451fe90306017f532fa2ccf", "score": "0.7284105", "text": "function initMap() {\n buildMap();\n loadLocations();\n bindSearchButtonClick();\n bindResetButtonClick();\n} // end initMap", "title": "" }, { "docid": "a9895656f260df606a9cabb964e345b0", "score": "0.72806925", "text": "function initMap() {\n\taddSaveTripClickListener();\n\taddTripClickListener();\n}", "title": "" }, { "docid": "4d1a0bca06d506fa96c387c6e6389184", "score": "0.7256893", "text": "loadMap(){}", "title": "" }, { "docid": "d4c727e121311206f8217db14d65527b", "score": "0.72471243", "text": "function initMap() {\n // Créer l'objet de map et l'insèrer dans l'élément HTML qui a l'ID \"map\"\n myMap = L.map('map').setView([lat, lon], 10.5);\n // on précise quelle carte on utilise\n L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {\n // on cite la source\n attribution: 'données © <a href=\"//osm.org/copyright\">OpenStreetMap</a>/ODbL - rendu <a href=\"//openstreetmap.fr\">OSM France</a>',\n minZoom: 1,\n maxZoom: 20\n }).addTo(myMap);\n addCircuitLoireVelo(myMap);\n addAccueilVelo(myMap);\n\n}", "title": "" }, { "docid": "6798bbd3760baf49f10cab32c1f89b68", "score": "0.7224513", "text": "addMap() {\n\t\t// Initialisation de la carte\n\t\tthis.map = L.map(this.idMap).setView(this.latLng, this.zoom);\n\t\t// Chargement des \"tuiles\"\n\t\tL.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {\n\t\t\tminZoom: 1,\n\t\t\tmaxZoom: 20,\n\t\t\tattribution: '&copy; Openstreetmap France | &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n\t\t}).addTo(this.map);\n\t}", "title": "" }, { "docid": "fa288c388379037994221b8c94b09e07", "score": "0.7208144", "text": "function initMap() {\n map = L.mapbox.map('car-map', 'mapbox.streets');\n map.setView([1.303, 103.788], 12);\n }", "title": "" }, { "docid": "c79c56c82901d9dcdcb69f12883c98b8", "score": "0.72079796", "text": "function initMap() {\n const mapController = new MapController();\n}", "title": "" }, { "docid": "c27642c6d669024350c3ee246d19cee6", "score": "0.71884984", "text": "function mapLoaded() {\n initialize(\"withMap\");\n}", "title": "" }, { "docid": "99c763c0a83cc0f1d30cff3ffbc3b17d", "score": "0.7173504", "text": "function initmap(){\n map = L.map('map').setView([47.0, 3.0], 6);\n let link = 'https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}'\n L.tileLayer(link, {\n maxZoom: 6,\n minZoom: 6,\n tileSize: 512,\n zoomOffset: -1\n \n }).addTo(map);\n }", "title": "" }, { "docid": "8d5352d4510664d8b2df47fa486de539", "score": "0.7161793", "text": "function initMap() {\r\n vm.updateLocations();\r\n vm.updateMap();\r\n calculateLayout();\r\n}", "title": "" }, { "docid": "830b0f618faa4fbfc8d8578a0c2abb95", "score": "0.7156753", "text": "initialize() {\n BaseMap.prototype.initialize.apply(this);\n }", "title": "" }, { "docid": "e01f7048d73e297d4c6b9cd1f1c4d014", "score": "0.71310747", "text": "function initMap() {\n //Lviv coords\n var coords = {\n lat: 49.834050,\n lng: 24.008120\n };\n //Add on page\n new google.maps.Map(document.querySelector(\".js-map\"), {\n zoom: 16,\n center: coords\n });\n }", "title": "" }, { "docid": "37644e8b53f47dfa2b864aafbd547d49", "score": "0.7085732", "text": "async init() {\n await this.map.init(this.infoPanel);\n }", "title": "" }, { "docid": "73048bbb20dddc43567b8d6c10aa4712", "score": "0.70806575", "text": "initMap() {\n this.map = L.map('map').setView([this.lattitudeMap, this.longitudeMap], 13);\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n }).addTo(this.map);\n }", "title": "" }, { "docid": "9c08103bd5a9b27cda12a44534bde6d1", "score": "0.70488656", "text": "function initMap() {\n\n /**\n * Dummy data\n */\n var dummyData = initData();\n\n /**\n * Output event data\n */\n dummyData.events.SineeParty.output('div.sidebar.container');\n\n /**\n * Create map with center at event\n */\n var map = dummyData.events.SineeParty.createMap('#map');\n\n var marker = dummyData.events.SineeParty.createMarker(map, true);\n marker.createInfoWindow({\n contentString: '<div class=\"markinfo dark right placepin\">' +\n '<h3>' + dummyData.events.SineeParty.place.data('name') + '</h3>' +\n '<span class=\"descr\">' + dummyData.events.SineeParty.place.data('address') + '</span>' +\n '<a href=\"javascript:void(0);\" class=\"uber\">GO!</a>' +\n '<div>'\n });\n marker.infoWindow.show();\n\n }", "title": "" }, { "docid": "a18794f8dc93f81f27d4963d71db5121", "score": "0.703861", "text": "function init_map() {\n\tpOld = new Proj4js.Point(0,0);\n \n\t//resize\n //$(\"#map\").height($(window).height()-$(\".header\").height()-$(\".footer\").height());\n\n init(function(feature) { \n selectedFeature = feature; \n });\n \n //query cache\n __load_inspired_map();\n}", "title": "" }, { "docid": "258bdc0ac9305f619568444f6cd9df37", "score": "0.7038523", "text": "function initMap() {\n mapObj.initMap(45.753, 4.850);\n getStationLocations(refresh);\n}", "title": "" }, { "docid": "7bcad406a6bd5b6325534daadd8b1581", "score": "0.70383793", "text": "function init() {\n map = new L.Map('map');\n L.tileLayer('https://api.mapbox.com/styles/v1/julienchenel/cjfdz2p2fa5g92sq0dzgxf95o/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoianVsaWVuY2hlbmVsIiwiYSI6ImNqZmR6MGhvYjJiOGo0YXFoejFobXJqaGIifQ.SZ2HjrSNVhc7hCyXZlDv9A', {\n attribution: '&copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors',\n maxZoom: 18\n }).addTo(map);\n map.attributionControl.setPrefix(''); // Don't show the 'Powered by Leaflet' text.\n\n // map view before we get the location\n map.setView(new L.LatLng(43.116312, 1.612136), 13);\n }", "title": "" }, { "docid": "f11149efaaf6ce61ca09242070aa7d12", "score": "0.7024786", "text": "function _initMap() {\n map = new google.maps.Map(document.getElementById('gmap'), {\n center: {lat: DEFAULT_LAT, lng: DEFAULT_LONG},\n scrollwheel: false,\n zoom: 8,\n clickableIcons: false,\n disableDefaultUI: true,\n zoomControl: true\n });\n\n // once map has finished loading, create autocomplete and infowindow\n autocomplete = new google.maps.places.Autocomplete(document.getElementsByName('location')[0]);\n autocomplete.bindTo('bounds', map);\n autocomplete.addListener('place_changed', _handleAutoComplete);\n $locationInput.removeAttr('disabled');\n infowindow = new google.maps.InfoWindow({content: \"\"});\n\n // once map has finished loading, show all lures\n google.maps.event.addListenerOnce(map, 'idle', _fetchAllLures);\n }", "title": "" }, { "docid": "1ab09b3bdf7e393e97c6813bc323f6a5", "score": "0.70085734", "text": "function initmap() {\n let data = initialMap(Home,map,marker,1);\n map = data.map;\n marker = data.marker;\n}", "title": "" }, { "docid": "6db2395c24ad314ac0a2e85ed198663a", "score": "0.699907", "text": "function initializeMap() {\n\t\t\n\t\tmap = L.map('map').setView([51.4438971705205, -0.16874313354492188], 5);\n\t\t//L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {\n\t\tL.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {\n\t\t\tattribution: ''\n\t\t}).addTo(map);\n\n\t\tclusterLayer = new L.MarkerClusterGroup();\n\t\tclusterLayer.addTo(map);\n\n\t\tmap.on('zoomend', getPointsFromEvent);\n\t\tmap.on('moveend', getPointsFromEvent);\n\t}", "title": "" }, { "docid": "bcadedd2786cc9fda31e65412c5c8f03", "score": "0.69883966", "text": "initializeMap_() {\n const paramHash = JSON.stringify(this.config_);\n if (this.templateCache_[paramHash]) {\n this.applyTemplate_(this.templateCache_[paramHash]);\n return;\n }\n let mapUrl = 'https://' + this.account_ + '.carto.com/api/v1/map';\n\n if (this.mapId_) {\n mapUrl += '/named/' + this.mapId_;\n }\n\n const client = new XMLHttpRequest();\n client.addEventListener(\n 'load',\n this.handleInitResponse_.bind(this, paramHash)\n );\n client.addEventListener('error', this.handleInitError_.bind(this));\n client.open('POST', mapUrl);\n client.setRequestHeader('Content-type', 'application/json');\n client.send(JSON.stringify(this.config_));\n }", "title": "" }, { "docid": "abf5ac6f0c6a15c7db13cb7433066db6", "score": "0.69834715", "text": "function initMap(){\n\t$.get(\"./api/map\").done(function(geojson) {\n\t\t\tlayer = geojson;\n\t\t\tmap.on('load', function () {\n\n map.addSource('single-point',singlepoint);\n map.addLayer(point);\n searchBar(layer);\n showLocations(layer);\n\n });\n\t });\n}", "title": "" }, { "docid": "1d36a5951c57d37f8ea7b0e1488d6cbb", "score": "0.6979598", "text": "function init_map() {\n map = L.map(\"mapid\", {\n center: [0, 0],\n zoom: 2\n });\n\n streets = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data © <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery (c) <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n accessToken: API_KEY\n });\n\n streets.addTo(map);\n}", "title": "" }, { "docid": "527b253b63cd165f2c08860e199b8ecb", "score": "0.6968458", "text": "function initMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 13,\n center: { lat: 28.639321, lng: -106.073284 },\n });\n setMarkers(map);\n }", "title": "" }, { "docid": "1efaebcf999cd10a9b68229189ce0056", "score": "0.69615805", "text": "function mapSetup(){\n map = L.map('map').setView([-45.875, 170.500], 15);\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n { maxZoom: 18,\n attribution: 'Map data &copy; ' +\n '<a href=\"http://www.openstreetmap.org/copyright\">' +\n 'OpenStreetMap contributors</a> CC-BY-SA'\n }).addTo(map);\n }", "title": "" }, { "docid": "9cd45b900ba2c1e7bc383c8356b7b417", "score": "0.6947447", "text": "function Map() {\n this.map_ = new global.Map;\n this.keys_ = [];\n }", "title": "" }, { "docid": "166d1b46cc738499dcb94a1ed28837fd", "score": "0.6946487", "text": "function initMap() {\n var uluru = {lat: 33.6448, lng: -117.834718};\n var map = new google.maps.Map(document.getElementById('addMaps'), {\n zoom: 14,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "title": "" }, { "docid": "729d6e950b268788b3a6f29e2656bd31", "score": "0.69434816", "text": "function Map(data){\n this.elements = data;\n this.fetch_map(); //This is async -- it calls initialize when done\n }", "title": "" }, { "docid": "864a64929eae638fbdd60e0f53a49866", "score": "0.6938269", "text": "function createAndAddMap() {\n\t\t//https://stackoverflow.com/questions/17401972/bootstrap-100-height-with-navbar\n\t\t$(\".full-map\").append(\"<div id=\\\"map-content\\\"></div>\");\n\t\t//$(\".full-map\").height(newHeight);\n\t\tmap = L.map(\"map-content\", { maxBounds: maxBounds, maxBoundsViscosity: 1.0 });//.fitWorld(); //substituir por setView(das coordenadas lidas do JSON)\n\t\tmap.attributionControl.setPrefix(\"\"); // Para não apresentar o texto Leaflet nas atribuições.\n\t\tmap.setMinZoom(minMapZoom);\n\t\tmap.setMaxZoom(maxMapZoom);\n\t}", "title": "" }, { "docid": "53ec6ea588436ed911e2f22650dd1308", "score": "0.69325894", "text": "function initMap() {\n notifier.notifySubscribers(\"map is ready\", \"mapReadyForInit\");\n}", "title": "" }, { "docid": "6d60646442747f7d7bc516c2ee13de3a", "score": "0.69278127", "text": "function initMap() {\n // [START maps_add_map_instantiate_map]\n const check24 = { lat: 52.5111213, lng:13.4023262 };\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 17,\n center: check24,\n });\n // [END maps_add_map_instantiate_map]\n // [START maps_add_map_instantiate_marker]\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: check24,\n map: map,\n });\n // [END maps_add_map_instantiate_marker]\n}", "title": "" }, { "docid": "26e6715b8c940c8111e6a2d6533667f0", "score": "0.69254327", "text": "function createMap() {\n var baseMaps = {\n \"Satellite Map\": satelliteMap,\n \"Greyscale\": greyMap,\n \"Outdoors\": streetMap\n };\n var overlayMaps = {\n \"Earthquakes\": earthquakeMap,\n \"Fault Lines\": faultMap\n }\n L.control.layers(baseMaps, overlayMaps).addTo(myMaps);\n}", "title": "" }, { "docid": "f5b9c5939eabf885789ccfaf695ddf75", "score": "0.6921271", "text": "function initMap() {\n drawMap(ip);\n}", "title": "" }, { "docid": "c228450fba86c945a992d423b38dfb41", "score": "0.691937", "text": "constructor() {\r\n this[map] = {};\r\n this[zoom] = 16;\r\n this[init]();\r\n }", "title": "" }, { "docid": "2d675a280dbd1f9ccd753d8b1557fddf", "score": "0.6917189", "text": "function initMap() {\r\n // [START maps_add_map_instantiate_map]\r\n // The location of Uluru\r\n const uluru = {lat: 22.298337, lng: 114.17};\r\n // The map, centered at Uluru\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 16,\r\n center: uluru,\r\n });\r\n // [END maps_add_map_instantiate_map]\r\n // [START maps_add_map_instantiate_marker]\r\n // The marker, positioned at Uluru\r\n const marker = new google.maps.Marker({\r\n position: uluru,\r\n map: map,\r\n });\r\n // [END maps_add_map_instantiate_marker]\r\n}", "title": "" }, { "docid": "469d99a4e409f1e2c4dedb4448aef602", "score": "0.6914841", "text": "function standard_map()\n{\n\trun_on_load(init_standard_map);\n}", "title": "" }, { "docid": "4aa39b83b8a147f78979d91c653196b6", "score": "0.6877886", "text": "function initMap() {\n mapInstance = new MapViewModel();\n}", "title": "" }, { "docid": "be32ebfd1baec17d263447796996966d", "score": "0.6870009", "text": "function initMap() {\r\n // Créer l'objet \"macarte\" et l'insèrer dans l'élément HTML qui a l'ID \"map\"\r\n macarte = L.map('map').setView([lat, lon], 11);\r\n // Leaflet ne récupère pas les cartes (tiles) sur un serveur par défaut. Nous devons lui préciser où nous souhaitons les récupérer. Ici, openstreetmap.fr\r\n L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {\r\n // Il est toujours bien de laisser le lien vers la source des données\r\n attribution: 'données © <a href=\"//osm.org/copyright\">OpenStreetMap</a>',\r\n minZoom: 1,\r\n maxZoom: 20\r\n }).addTo(macarte);\r\n\t\t\t\t// Nous ajoutons un marqueur\r\n\t\t\t\tvar marker = L.marker([lat, lon]).addTo(macarte);\r\n }", "title": "" }, { "docid": "65260a6f6bf2691799fb7ff17ff15591", "score": "0.686592", "text": "function initMap() {\n\tconsole.log(\"initMap\");\n\t// create a new google map object\n\tvar map = new google.maps.Map(mapEl, options);\n\tgoogleMapsDemo();\n}", "title": "" }, { "docid": "06162f99e8e440c0baa7738cd248dcbd", "score": "0.68569756", "text": "function initMap() {\r\n var i;\r\n var j;\r\n for (i = 0; i < map.length; i++) {\r\n map[i] = 0;\r\n }\r\n for (i = 0; i < 6; i++) {\r\n map[i] = 1;\r\n map[i * 6] = 1;\r\n }\r\n // put values in map[]\r\n for (i = 0; i < 4; i++) {\r\n for (j = 0; j < 4; j++) {\r\n map[7 + i * 6 + j] = (i * 4 + j + 1) & 15;\r\n }\r\n }\r\n // tileMap maps row-column codes \"11\", \"12\", \"13\", ... to array indexes 0, 1, 2 ...\r\n if (tileMap.length < 6) {\r\n tileMap.splice(0, 0, \"11\", \"12\", \"13\", \"14\", \"21\", \"22\", \"23\", \"24\", \"31\", \"32\", \"33\", \"34\", \"41\", \"42\", \"43\", \"44\");\r\n }\r\n}", "title": "" }, { "docid": "7eb4389fc61917c6bde8801741203d99", "score": "0.68440986", "text": "function setupMap() {\n var eliteStatus = LEXUS.dealer.eliteStatus;\n var lat = $map.data(\"lat\"),\n lng = $map.data(\"lng\"),\n\n /** @type {Location} */\n pin = new Dealer({\n dealerLatitude: lat,\n dealerLongitude: lng,\n eliteStatus: eliteStatus,\n });\n\n //prevent map from initialzing again\n if (map !== undefined) {\n return;\n }\n\n map = new Map($map.get(0), {\n zoom: CITY_LEVEL_ZOOM,\n disableUserInput: true,\n height: getMapHeight(),\n width: $map.width(),\n onResize: function() {\n var width = $map.width(),\n height = getMapHeight();\n\n map.setDimensions(width, height);\n },\n pins: [pin]\n });\n\n\n geolocationHelper.fetchData(function(resp) {\n var geolocation = resp.data;\n if (geolocation.zip !== null) {\n lat = geolocation.latitude;\n lng = geolocation.longitude;\n map.addCurrentLocationPin([lat, lng]);\n }\n });\n\n }", "title": "" }, { "docid": "a132ab3311e22e6690d2e73af1271edf", "score": "0.68376577", "text": "function initMap() {\n\tconsole.log(\"initMap\");\n\n\t// Demo 3: Google Places API\n\tgooglePlacesDemo();\n}", "title": "" }, { "docid": "e2ba7d05fcb7dd7ec50b4cd4711d82b3", "score": "0.6827547", "text": "function initMap() {\n\n\t// Specify features and elements to define styles.\n\tvar styleArray = [\n\t\t{\n\t\t\tfeatureType: \"all\",\n\t\t\tstylers: [\n\t\t\t\t{\n\t\t\t\t\tsaturation: -70\n\t\t\t\t}\n\t\t\t]\n\t\t}, {\n\t\t\tfeatureType: \"road.arterial\",\n\t\t\telementType: \"geometry\",\n\t\t\tstylers: [\n\t\t\t\t{\n\t\t\t\t\thue: \"#a8a8a8\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsaturation: 30\n\t\t\t\t}\n\t\t\t]\n\t\t}, {\n\t\t\tfeatureType: \"poi.business\",\n\t\t\t//elementType: \"labels\",\n\t\t\tstylers: [\n\t\t\t\t{\n\t\t\t\t\tvisibility: \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t];\n\n\t// Create a map object and specify the DOM element for display.\n\tvar map = new google.maps.Map(document.getElementById('g-map'), {\n\t\tcenter: center_position,\n\t\tscrollwheel: false,\n\t\t// Apply the map style array to the map.\n\t\tstyles: styleArray,\n\t\tzoom: 17,\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\tpanControl: false,\n\t\tzoomControl: true,\n\t\tmapTypeControl: false,\n\t\tscaleControl: false,\n\t\tstreetViewControl: true,\n\t\toverviewMapControl: false\n\t});\n\n//\tvar marker_position = new google.maps.LatLng(46.4047648, 30.7023735);\n\tvar marker = new google.maps.Marker({\n\t\tposition: marker_position,\n\t\tmap: map,\n\t\ttitle: \"INMER\",\n\t\ticon: \"/img/icon/map-marker.png\"\n\t});\n}", "title": "" }, { "docid": "9e19d92cf19112c3972b4657f905b1cd", "score": "0.6826009", "text": "constructor() {\n this.externalMaps = [];\n }", "title": "" }, { "docid": "e292668104b0184589d450ec0210282c", "score": "0.6825209", "text": "function initMap() {\r\n var self = this;\r\n \r\n map = new MyMap(); // Initiate Map\r\n \r\n var blueDot = 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png';\r\n var greenDot = 'http://maps.google.com/mapfiles/ms/icons/green-dot.png';\r\n \r\n model.lived.forEach(function(livedObject) {\r\n map.addMarker(livedObject, blueDot);\r\n });\r\n model.traveled.forEach(function(traveledObject) {\r\n map.addMarker(traveledObject, greenDot);\r\n });\r\n \r\n}", "title": "" }, { "docid": "5910aa19c3cc351c7314b7075a51cdef", "score": "0.681784", "text": "function initMap() {\n setDefaultMapSize(element);\n\n // empty the element to allow a refresh of the map\n element.empty();\n\n //create map element div element with default style.\n var el = document.createElement('div');\n el.style.width = '100%';\n el.style.height = '100%';\n element.prepend(el);\n\n var mapOptions = {\n center: {lat: 0, lng: 0},\n zoom: 15\n };\n\n // sets the attribute values on the scope and create the map option object.\n ['width', 'height', 'geocodingApiKey'].map(function (attrName) {\n scope[attrName] = attr[attrName];\n });\n\n ['options', 'routeOrigin', 'routeDestination', 'zoom', 'pin', 'center','mapStyles'].map(function (attrName) {\n scope[attrName] = scope.$eval(attr[attrName]);\n });\n if (scope.options) {\n angular.extend(mapOptions, scope.options);\n }\n applyAttributes(scope, mapOptions);\n\n //sets the default size values of the map.\n ['width', 'height'].map(function (p) {\n if (typeof mapOptions[p] !== 'undefined') {\n element.css(p, mapOptions[p]);\n }\n });\n\n\n //start be setting the center of the map if provided.\n //if not provided use Lat:0 Lng:0.\n if (mapOptions.center.address) {\n\n xmpMapAddressesService\n .getAddress(mapOptions.center.address, mapOptions.geocoding_api_key)\n .then(function (location) {\n angular.extend(mapOptions.center, location);\n createMap(mapOptions, el);\n });\n } else {\n createMap(mapOptions, el);\n }\n }", "title": "" }, { "docid": "489962c8a46abbbc095f158b99376264", "score": "0.68166846", "text": "function init() {\n preConfigureMap();\n createInstance();\n postConfigureMap();\n setupDraggableMarker();\n //setupGlobalEvents();\n detectCurrentPosition();\n retrieveCurrentGeoLocation();\n appearMap();\n addSearchField();\n addReDetectField();\n addFullView();\n }", "title": "" }, { "docid": "dda188c4e16fe541c4f2e5d62de5df57", "score": "0.6816065", "text": "static initMap() {\n // Constructor creates a new map - only center and zoom are required.\n const map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 52.5200066, lng: 13.404954},\n zoom: 13,\n mapTypeControl: false,\n });\n return map;\n }", "title": "" }, { "docid": "a6e262cfe95fae64cc1b5213b6522356", "score": "0.68085945", "text": "function initMap() {\n //Enabling new cartography and themes\n google.maps.visualRefresh = true;\n //Setting starting options of map\n var mapOptions = {\n center: new google.maps.LatLng(40, -100),\n zoom: 4,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n panControl: false,\n zoomControl: false,\n scaleControl: false,\n streetViewControl: false,\n mapTypeControl: false\n };\n //Getting map DOM element\n var mapElement = $('#polygon-map')[0];\n map = new google.maps.Map(mapElement, mapOptions);\n}", "title": "" }, { "docid": "4e0d188c8ef2fd1b4e210a1b6c98539e", "score": "0.6775596", "text": "function initMap() {\n return L.map(DOMStrings.map).setView([mapCenterLatitude, mapCenterLongitude], mapZoomLevel);\n}", "title": "" }, { "docid": "45870fd8fd54f61c01555624b59e96fc", "score": "0.6775533", "text": "function initMap() {\n \tmap = new google.maps.Map(document.getElementById('map'), {\n \tzoom: 4,\n \tcenter: {lat: 39.833, lng: -98.583},\n });\n\t}", "title": "" }, { "docid": "45870fd8fd54f61c01555624b59e96fc", "score": "0.6775533", "text": "function initMap() {\n \tmap = new google.maps.Map(document.getElementById('map'), {\n \tzoom: 4,\n \tcenter: {lat: 39.833, lng: -98.583},\n });\n\t}", "title": "" }, { "docid": "af9312f5dd7547bc1884ae121ddc575e", "score": "0.67555374", "text": "function initMap() {\n const map = new google.maps.Map(document.querySelector(\"#photoMap\"), {\n zoom: 9,\n center: {lat: 55.8617792, lng: -3.7054024}\n });\n setMarkers(map);\n}", "title": "" }, { "docid": "32ba5fb9a1c07238205bb2ab07262423", "score": "0.67524725", "text": "function initMap() {\n _ext.resize();\n _stack = new LayerStack(gui, el, _ext, _mouse);\n gui.buttons.show();\n\n if (opts.inspectorControl) {\n _inspector = new InspectionControl2(gui, _hit);\n _inspector.on('data_change', function(e) {\n // Add an entry to the session history\n gui.session.dataValueUpdated(e.id, e.field, e.value);\n // Refresh the display if a style variable has been changed interactively\n if (internal.isSupportedSvgStyleProperty(e.field)) {\n drawLayers();\n }\n });\n }\n\n if (gui.interaction) {\n initInteractiveEditing(gui, _ext, _hit);\n }\n\n _ext.on('change', function(e) {\n if (_basemap) _basemap.refresh(); // keep basemap synced up (if enabled)\n if (e.reset) return; // don't need to redraw map here if extent has been reset\n if (isFrameView()) {\n updateFrameExtent();\n }\n drawLayers('nav');\n });\n\n _hit.on('change', updateOverlayLayer);\n\n gui.on('resize', function() {\n position.update(); // kludge to detect new map size after console toggle\n });\n }", "title": "" }, { "docid": "dabd727a56d106088973c754145b1c09", "score": "0.6731939", "text": "function initMap(params) {\n var data = params.data;\n var mapId = params.mapId;\n var markerType = params.markerType;\n var templateEngine = params.templateEngine;\n var cbOnMapAction = params.cbOnMapAction;\n\n // Reassure that old map is remove\n delete(window.map);\n angular.element(\"#\" + mapId).remove();\n angular.element(\".map-container-parent\").prepend('<div id=\"' + mapId + '\"></div>');\n\n window.map = L.map(mapId).setView(new L.LatLng(5.3,-4.9), 2);\n var tweets = initMapPoints(data, templateEngine);\n L.tileLayer(tileLayerSrc, {\n maxZoom: 18,\n attribution: attribution,\n id: mapId\n }).addTo(window.map);\n\n addPointsToMap(window.map, tweets, markerType, cbOnMapAction);\n }", "title": "" }, { "docid": "2ce8cf0ec6125d733360a0969cffc795", "score": "0.6730481", "text": "function initMap() {\n // The location of Uluru\n const uluru = { lat: -25.344, lng: 131.036 };\n\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n }", "title": "" }, { "docid": "c08d4c2dc7e9fea80d6bc5cedf468b08", "score": "0.6728103", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 35.685175, lng: 139.7528},\n scrollwheel: false,\n zoom: gmapsDefaultZoom\n });\n google.maps.event.addListener(map, 'bounds_changed', fillMap);\n }", "title": "" }, { "docid": "b7b1ef2dda50e341e4b443c884307100", "score": "0.67172825", "text": "function InitMap() {\n for (var k in displayPlans) {\n if (displayPlans[k].location) {\n CreateMarker(displayPlans[k].category.icon_url, displayPlans[k].title, displayPlans[k].id, displayPlans[k].location);\n } else if (displayPlans[k].points) {\n var points = displayPlans[k].points;\n\n for (var i in points) {\n CreateMarker(displayPlans[k].category.icon_url, displayPlans[k].title, displayPlans[k].id, points[i].location);\n }\n }\n }\n }", "title": "" }, { "docid": "7889e1d46b599d4eeac1bb76847ed940", "score": "0.6715303", "text": "function initMap() {\r\n // Constructor creates a new map - only center and zoom are required.\r\n 'use strict';\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: 29.9592427, lng: 31.2573508},\r\n zoom: 16,\r\n mapTypeControl: false\r\n });\r\n\r\n map.setOptions({styles: lightDreamStyle}); // use map style\r\n\r\n\r\n // add markers from data file\r\n var i;\r\n for (i = 0; i < locations.length; i += 1) {\r\n markers.push(new Place(locations[i]));\r\n }\r\n}", "title": "" }, { "docid": "b9a844d46fc732057a7cc0488ebb5a88", "score": "0.6706402", "text": "function blue_plaques_map()\n{\n\trun_on_load(init_blue_plaques_map);\n}", "title": "" }, { "docid": "84d8c87a6ad484c6213ec7c62a4bc7cc", "score": "0.67062783", "text": "function initMap() {\n\n\t\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\t\tzoom: 5,\n\t\t\tcenter: {lat: -41.0, lng: 172.0 }\n\t\t});\n\n\t\tmap.addListener('click', function(e) {\n \t\tplaceMarkerAndPanTo(e.latLng, map);\n \t\tlocation.latitude = e.latLng.H;\n \t\tlocation.longitude = e.latLng.L;\n \t\t});\n\t}", "title": "" }, { "docid": "212f674bbc4747d117829f256cc5e407", "score": "0.6696967", "text": "function initMap() {\n exports.map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 11,\n center: {\n lat: 35.6894,\n lng: 139.692\n },\n mapTypeId: \"hybrid\"\n });\n exports.infoWindow = new google.maps.InfoWindow();\n exports.maxZoomService = new google.maps.MaxZoomService();\n exports.map.addListener(\"click\", showMaxZoom);\n }", "title": "" }, { "docid": "e8aeaaaec80df0874d6d2c0849e57700", "score": "0.66920406", "text": "async initAMap() {\n const {\n locaVersion,\n protocol,\n version,\n appKey,\n uiVersion,\n } = this.props;\n\n if (window.AMap === void 0) {\n await AMap.requireAMap({ protocol, version, appKey });\n await AMap.requireAMapUI({ protocol, version: uiVersion });\n await AMap.requireLoca({ protocol, appKey, version: locaVersion });\n }\n\n this.map = new window.AMap.Map(this.mapContainer, {\n ...this.mapOptions,\n });\n\n // Due to the fact that createEventCallback is a closure,\n // therefore this.map must be initialised before executing closure.\n this.eventCallbacks = this.parseEvents();\n\n this.bindEvents(this.map, this.eventCallbacks);\n\n this.setState({\n map: this.map,\n });\n }", "title": "" }, { "docid": "fc2c4a583d43f8cf9aeb15b3d195e4b1", "score": "0.6691591", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: { lat: 6.465422, lng: 3.406448 }\n });\n\n geocoder = new google.maps.Geocoder();\n infowindow = new google.maps.InfoWindow();\n }", "title": "" }, { "docid": "0a3e1c6b759e4b29eba99e9c7d1c9bc2", "score": "0.66892487", "text": "function initialize() {\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: initialCenter,//where the map centers initially\n\t\t\tzoom: 14\n\t\t});\n\t}", "title": "" }, { "docid": "83cd5902c0b66dca98b9c95978b54df8", "score": "0.6688881", "text": "function initMap() {\n\n /**\n * Dummy data\n */\n var dummyData = initData();\n\n /**\n * Output city data\n */\n dummyData.cities.Vladivostok.output('div.sidebar.container');\n\n /**\n * Create map with center at Vladivostok\n */\n map = dummyData.cities.Vladivostok.createMap('#map');\n\n /**\n * Filling places data\n */\n var $placesBlock = $('section.grid#places div.overview-block div.row').empty();\n\n dummyData.cities.Vladivostok.getPlaces().map(function(place) {\n\n /**\n * Create place marker\n */\n var marker = place.createMarker(map, {\n icon: 'img/pins/' + place.data('type') + '-color.png',\n }).on('click', function() {\n window.location.href = 'open_places.html';\n });\n\n /**\n * Output place tags\n */\n var $tagsSection = $('<section/>', {\n 'class': 'tags'\n });\n\n place.data('tags').map(function(tag) {\n\n $tagsSection.append(\n $('<span/>', {\n 'class': 'tags__item',\n 'html': tag\n })\n );\n\n });\n\n $placesBlock.append(\n $('<div/>', {\n 'class': 'grid-item grid-item--big clearfix col-md-12'\n }).append(\n $('<img/>', {\n 'class': 'grid-item__img'\n }).attr('alt', place.data('name')).attr('src', 'img/places/' + place.data('code') + '.png')\n ).append(\n $('<div/>', {\n 'class': 'grid-item-wrapper'\n }).append(\n $('<a/>', {\n 'class': 'grid-item__title',\n 'html': place.data('name'),\n 'href': 'open_places.html'\n })\n ).append(\n $('<p/>', {\n 'class': 'grid-item__desc',\n 'html': place.data('description')\n })\n ).append(\n $tagsSection\n ).append(\n $('<section/>', {\n 'class': 'social-stats'\n }).append(\n $('<div/>', {\n 'class': 'social-stats__item social-stats-item',\n }).append(\n $('<span/>', {\n 'class': 'social-stats-item__icon fa fa-star'\n })\n ).append(\n $('<span/>', {\n 'class': 'social-stats-item__value',\n 'html': place.data('rating')\n })\n )\n ).append(\n $('<div/>', {\n 'class': 'social-stats__item social-stats-item',\n }).append(\n $('<span/>', {\n 'class': 'social-stats-item__icon fa fa-comment'\n })\n ).append(\n $('<span/>', {\n 'class': 'social-stats-item__value',\n 'html': place.data('comments')\n })\n )\n )\n )\n ).on('mouseover', function() {\n /**\n * Center map on place and show info window while mouseover\n */\n marker.infoWindow.show(map);\n map.panTo(place);\n /**\n * Highlight current place\n */\n // dummyData.cities.Vladivostok.getPlaces().map(function (place) {\n // place.marker.setIcon('img/pins/' + place.data('type') + '.png');\n // });\n // marker.setIcon('img/pins/' + place.data('type') + '-active.png');\n })\n );\n\n });\n\n /**\n * Filling vacancies data\n */\n var $vacanciesBlock = $('section.grid#vacancy div.overview-block div.row').empty();\n\n dummyData.cities.Vladivostok.getVacancies().map(function(vacancy) {\n\n /**\n * Create vacancy marker\n */\n var marker = vacancy.createMarker(map, {\n icon: 'img/pins/' + vacancy.company.data('type') + '-color.png',\n }).on('click', function() {\n window.location.href = 'open_vacancy.html';\n });\n\n /**\n * Output vacancy tags\n */\n var $tagsSection = $('<section/>', {\n 'class': 'tags'\n });\n\n vacancy.data('tags').map(function(tag) {\n\n $tagsSection.append(\n $('<span/>', {\n 'class': 'tags__item',\n 'html': tag\n })\n );\n\n });\n\n $vacanciesBlock.append(\n $('<div/>', {\n 'class': 'grid-item grid-item--big clearfix col-md-12'\n }).append(\n $('<img/>', {\n 'class': 'grid-item__img'\n }).attr('alt', vacancy.data('name')).attr('src', 'img/companies/' + vacancy.company.data('code') + '.png')\n ).append(\n $('<div/>', {\n 'class': 'grid-item-wrapper'\n }).append(\n $('<a/>', {\n 'class': 'grid-item__title grid-item__title--fire',\n 'html': vacancy.data('name'),\n 'href': 'open_vacancy.html'\n })\n ).append(\n $('<p/>', {\n 'class': 'pull-right price',\n 'html': vacancy.data('currency') + vacancy.data('salary')\n })\n ).append(\n $('<p/>', {\n 'class': 'grid-item__desc',\n 'html': vacancy.data('description')\n })\n ).append(\n $tagsSection\n )\n ).on('mouseover', function() {\n /**\n * Center map on vacancy and show info window while mouseover\n */\n marker.infoWindow.show(map);\n map.panTo(vacancy);\n /**\n * Highlight current vacancy\n */\n // dummyData.cities.Vladivostok.getVacancies().map(function (vacancy) {\n // vacancy.marker.setIcon('img/pins/' + vacancy.company.data('type') + '.png');\n // });\n // marker.setIcon('img/pins/' + vacancy.company.data('type') + '-active.png');\n })\n );\n\n });\n\n /**\n * Filling news data\n */\n var $newsBlock = $('section.grid#news div.overview-block div.row').empty();\n\n dummyData.cities.Vladivostok.getNews().map(function(news) {\n\n var marker;\n\n /**\n * Create news marker (only for news containing geo coordinates)\n */\n if (news.data('latitude') && news.data('longitude'))\n marker = news.createMarker(map).on('click', function() {\n window.location.href = 'open_news.html';\n });\n\n $newsBlock.append(\n $('<div/>', {\n 'class': 'grid-item grid-item--post clearfix col-sm-6'\n }).append(\n $('<a/>', {\n 'class': 'grid-item__title',\n 'href': 'open_news.html',\n 'html': news.data('title')\n })\n ).append(\n $('<p/>', {\n 'class': 'grid-item__desc',\n 'html': news.data('description')\n })\n ).append(\n $('<p/>', {\n 'class': 'grid-item__date',\n 'html': news.data('datetime')\n })\n ).on('mouseover', function() {\n /**\n * Center map on news and show info window while mouseover (only for news containing geo coordinates)\n */\n if (marker) {\n map.center(marker.position.latitude, marker.position.longitude);\n marker.infoWindow.show();\n /**\n * Highlight current news\n */\n dummyData.cities.Vladivostok.getNews().map(function(news) {\n if (news.marker)\n news.marker.setIcon('img/pins/route.png');\n });\n marker.setIcon('img/pins/route-active.png');\n };\n })\n );\n\n });\n\n /**\n * Filling events data\n */\n var $eventsBlock = $('section.grid#events div.overview-block div.row').empty();\n\n dummyData.cities.Vladivostok.getEvents().map(function(event) {\n\n /**\n * Create event marker\n */\n var marker = event.createMarker(map, {\n icon: 'img/pins/' + event.place.data('type') + '-color.png',\n }).on('click', function() {\n window.location.href = 'open_events.html';\n });\n\n /**\n * Output event tags\n */\n var $tagsSection = $('<section/>', {\n 'class': 'tags'\n });\n\n event.data('tags').map(function(tag) {\n\n $tagsSection.append(\n $('<span/>', {\n 'class': 'tags__item',\n 'html': tag\n })\n );\n\n });\n\n $eventsBlock.append(\n $('<div/>', {\n 'class': 'grid-item grid-item--big clearfix col-md-12'\n }).append(\n $('<img/>', {\n 'class': 'grid-item__img'\n }).attr('alt', event.data('name')).attr('src', 'img/places/' + event.place.data('code') + '.png')\n ).append(\n $('<div/>', {\n 'class': 'grid-item-wrapper'\n }).append(\n $('<a/>', {\n 'class': 'grid-item__title',\n 'html': event.data('name'),\n 'href': 'open_events.html'\n })\n ).append(\n $('<div/>', {\n 'class': 'pull-right price-wrapper'\n }).append(\n $('<p/>', {\n 'class': 'price',\n 'html': event.data('currency') + event.data('price')\n })\n ).append(\n $('<p/>', {\n 'class': 'grid-item__date-right'\n }).append(\n $('<img/>', {\n 'src': 'img/icons/calendar.png'\n })\n ).append(\n $('<span/>', {\n 'html': event.data('datetime')\n })\n )\n )\n ).append(\n $('<p/>', {\n 'class': 'grid-item__desc',\n 'html': event.data('description')\n })\n ).append(\n $tagsSection\n )\n ).on('mouseover', function() {\n /**\n * Center map on event and show info window while mouseover\n */\n marker.infoWindow.show(map);\n map.panTo(event);\n /**\n * Highlight current event\n */\n // dummyData.cities.Vladivostok.getEvents().map(function (event) {\n // event.marker.setIcon('img/pins/' + event.place.data('type') + '.png');\n // });\n // marker.setIcon('img/pins/' + event.place.data('type') + '-active.png');\n })\n );\n\n });\n\n /**\n * Filling excursions data\n */\n var $excursionsBlock = $('section.grid#excursions div.overview-block div.row').empty();\n\n dummyData.cities.Vladivostok.getExcursions().map(function(excursion) {\n\n /**\n * Create excursion route\n */\n var route = excursion.createRoute(map);\n\n /**\n * Output dummy rating (4 stars)\n */\n var $ratingSection = $('<div/>', {\n 'class': 'grid-item__rating'\n });\n\n for (var i = 0; i < 4; i++) {\n $ratingSection.append(\n $('<span/>', {\n 'class': 'star fa fa-star'\n })\n );\n };\n $ratingSection.append(\n $('<span/>', {\n 'class': 'start fa fa-star star--empty'\n })\n );\n\n $excursionsBlock.append(\n $('<div/>', {\n 'class': 'grid-item grid-item--big clearfix col-md-12'\n }).append(\n $('<a/>', {\n 'class': 'grid-item__title',\n 'href': 'open_exc.html',\n 'html': excursion.data('name')\n })\n ).append(\n $('<div/>', {\n 'class': 'pull-right price-wrapper'\n }).append(\n $('<p/>', {\n 'class': 'price',\n 'html': excursion.data('currency') + excursion.data('price')\n })\n ).append(\n $ratingSection\n )\n ).append(\n $('<p/>', {\n 'class': 'grid-item__desc',\n 'html': excursion.data('description')\n })\n ).append(\n $('<div/>', {\n 'class': 'overview-block overview-block--fluid'\n }).append(\n $('<div/>', {\n 'class': 'excursion',\n 'style': 'background-image: url(\"img/excursions/1.jpg\");'\n }).append(\n $('<div/>', {\n 'class': 'excursion__info'\n }).append(\n $('<div/>', {\n 'class': 'excursion-info-block'\n }).append(\n $('<img/>', {\n 'class': 'excursion-info-block__img'\n }).attr('src', 'img/guides/1.jpg').attr('alt', excursion.data('guide'))\n ).append(\n $('<div/>', {\n 'class': 'excursion-info-block-wrap'\n }).append(\n $('<p/>', {\n 'class': 'excursion-info-block__title',\n 'html': 'Guide:'\n })\n ).append(\n $('<a/>', {\n 'href': 'javascript:void(0);',\n 'html': excursion.data('guide')\n })\n )\n )\n ).append(\n $('<div/>', {\n 'class': 'excursion-info-block'\n }).append(\n $('<img/>', {\n 'class': 'excursion-info-block__img'\n }).attr('src', 'img/icons/globe.png').attr('alt', excursion.data('language'))\n ).append(\n $('<div/>', {\n 'class': 'excursion-info-block-wrap'\n }).append(\n $('<p/>', {\n 'class': 'excursion-info-block__title',\n 'html': 'Language'\n })\n ).append(\n $('<p/>', {\n 'html': excursion.data('language')\n })\n )\n )\n ).append(\n $('<div/>', {\n 'class': 'excursion-info-block'\n }).append(\n $('<img/>', {\n 'class': 'excursion-info-block__img'\n }).attr('src', 'img/icons/time.png').attr('alt', excursion.data('duration'))\n ).append(\n $('<div/>', {\n 'class': 'excursion-info-block-wrap'\n }).append(\n $('<p/>', {\n 'class': 'excursion-info-block__title',\n 'html': 'Duration'\n })\n ).append(\n $('<p/>', {\n 'html': excursion.data('duration')\n })\n )\n )\n )\n )\n )\n ).on('mouseover', function() {\n map.hideInfoWindows();\n /**\n * Output all routes with default color\n */\n map.routes.map(function(route) {\n route.update({\n markers: {\n icon: 'img/pins/route.png'\n },\n polylineOptions: {\n strokeColor: '#0A161E'\n }\n });\n });\n /**\n * And highlight current route as active\n */\n route.update({\n markers: {\n icon: 'img/pins/route-active.png'\n },\n polylineOptions: {\n strokeColor: 'red'\n }\n });\n })\n );\n\n });\n\n /**\n * Turn on zoom map to view all markers\n */\n map.autoZoom(true);\n\n /**\n * You can group markers after filling\n * For example, using 3rd-party script like OverlappingMarkerSpiderfier\n */\n jQuery.ajax({\n url: 'http://jawj.github.io/OverlappingMarkerSpiderfier/bin/oms.min.js',\n dataType: 'script',\n async: true,\n success: function() {\n var oms = new OverlappingMarkerSpiderfier(map.instance, {\n markersWontMove: true,\n markersWontHide: true,\n nearbyDistance: 20\n });\n map.markers.map(function(marker) {\n /**\n * Disable click event for marker before adding to OverlappingMarkerSpiderfier\n */\n oms.addMarker(marker.disableEvent('click').instance);\n });\n oms.addListener('click', function(marker) {\n /**\n * Run click event manually because we disable markers click event\n */\n marker._owner.executeEvent('click');\n });\n }\n });\n\n }", "title": "" }, { "docid": "4dcc74ee992a8b8e9dde56f27d6ae4ce", "score": "0.6675302", "text": "function addMaps(){\r\n var i;\r\n var j;\r\n for (i = 0;i<2;i++){\r\n for (j = 0; j<7; j++){\r\n map.add(rendered_layers[i][j]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d49e0e14ef2a46eceaffde0b903e9a8c", "score": "0.66750675", "text": "function initMap() {\r\n // [START maps_add_map_instantiate_map]\r\n\r\n const Toronto = {\r\n lat: 43.64870266670145,\r\n lng: -79.38019635675967\r\n };\r\n\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 17,\r\n center: Toronto,\r\n });\r\n // [END maps_add_map_instantiate_map]\r\n // [START maps_add_map_instantiate_marker]\r\n\r\n const marker = new google.maps.Marker({\r\n position: Toronto,\r\n map: map,\r\n });\r\n // [END maps_add_map_instantiate_marker]\r\n}", "title": "" }, { "docid": "65faaa865eb4a7c0de4935c8ad82adf4", "score": "0.6673233", "text": "function init(){\n\t\t\t\tvar\tmapOptions = {\n\t\t\t\t\tzoom: $scope.zoom,\n\t\t\t\t\tcenter: new google.maps.LatLng(33.7550, -84.3900)\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t$(mapElement).height($scope.height).width($scope.width);\n\n\t\t\t\tmap = new google.maps.Map(mapElement, mapOptions);\n\t\t\t}", "title": "" }, { "docid": "8892eb983c40a0d80b0c6642319a2257", "score": "0.66732115", "text": "function initMap() {// Fonction d'initialisation de la carte\n\t\n\tmacarte = L.map('map').setView([lat, lon], 11); // Créer l'objet \"macarte\" et l'insèrer dans l'élément HTML qui a l'ID \"map\"\t\n\n\tL.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', // Leaflet ne récupère pas les cartes (tiles) sur un serveur par défaut. Nous devons lui préciser où nous souhaitons les récupérer.Ici, openstreetmap.fr\n\t\t\t{attribution: 'données © <a href=\"//osm.org/copyright\">OpenStreetMap</a>/ODbL - rendu <a href=\"//openstreetmap.fr\">OSM France</a>',// Il est toujours bien de laisser le lien vers la source des données\n\t\t\tminZoom: 5,\n\t\t\tmaxZoom: 80})\n\t\t.addTo(macarte);\n}", "title": "" }, { "docid": "39ce8fb72e6a0e546bcbd651ee2d58fc", "score": "0.66657126", "text": "function Map() {\n this.exists = __bind(this.exists, this);\n this.data = {};\n }", "title": "" }, { "docid": "5465808c63bb863267e4922edb4c4f0d", "score": "0.66623586", "text": "function addBaseMap() {\n var basemap = trySetting('_tileProvider', 'CartoDB.Positron');\n // L.tileLayer.provider(basemap, {\n // maxZoom: 18\n // }).addTo(map);\n // L.control.attribution({\n // position: trySetting('_mapAttribution', 'bottomright')\n // }).addTo(map);\n }", "title": "" }, { "docid": "3535ed112d68d46dfc33ea8319823012", "score": "0.6661477", "text": "function gritting_map()\n{\n\trun_on_load(init_gritting_map);\n}", "title": "" }, { "docid": "512f02f387740bb83ede7af5842d92e6", "score": "0.6660114", "text": "function init() {\n axios.get('/data/StationMap')\n .then(function (response) {\n createMap(response.data);\n })\n .catch(function (error) {\n console.log('StationMapInit failed', error);\n });\n }", "title": "" }, { "docid": "b860b87f6b7a4a7481a2f8d59583fba1", "score": "0.66555035", "text": "function initMap(data, configObj,pathMap,props,props1) {\r\n\t\tvar configurations = configObj;\r\n\t\tvar stateKey = configObj.stateKey;\r\n\t\tif(!pathMap){\r\n\t\t\tpathMap = L.map('pathMap', {\r\n\t\t\t\tcenter : [ 39.300299, -95.727541 ],\r\n\t\t\t\tzoomControl : false,\r\n contextmenu: true,\r\n\t\t\t\tworldCopyJump : false\r\n\t\t\t});\r\n\t\t}\r\n\t\telse{\r\n\t\t\r\n\t\t}\r\n\t\tpathMap.options.minZoom = 2;\r\n\t\tpathMap._layersMaxZoom = 10;\r\n\t\tif (data && data.length > 0) {\r\n\t\t\tmapObj = createGeoMarker(data, pathMap, tile, configObj,props,props1);\r\n if(mapObj){\r\n mapLayers=mapObj.mapLayers; \r\n }\r\n \r\n\t\t}\r\n if(!mapObj){\r\n mapObj={};\r\n mapObj[\"Empty\"]=\"true\"; \r\n }\r\n\t\treturn mapObj;\r\n\t}", "title": "" }, { "docid": "de4100e7205414dfc2227f742c3f030b", "score": "0.6641918", "text": "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {lat:-27.468657, lng:153.023913},\n\t\tzoom: 13\n });\n\tcreateMarkers();\n}", "title": "" }, { "docid": "e1a27ddce21b557d223f84330a980767", "score": "0.6640657", "text": "function initMap() {\n const center = { lat: 0, lng: 0 };\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n center,\n zoom: 10,\n heading: 0.0,\n tilt: 0.0,\n // Map ID for a vector map.\n mapId: \"6ff586e93e18149f\",\n });\n const canvas = document.createElement(\"canvas\");\n const infoWindow = new google.maps.InfoWindow({\n content: \"\",\n ariaLabel: \"Raster/Vector\",\n position: center,\n });\n\n infoWindow.open({\n map,\n });\n map.addListener(\"renderingtype_changed\", () => {\n infoWindow.setContent(`${map.getRenderingType()}`);\n });\n}", "title": "" }, { "docid": "6cbdd5b984b7fac74b58bc6ba6312a35", "score": "0.66267794", "text": "function init() {\n\t\tlet tmpMap = L.map(\"map\", {\n\t\t\tzoomControl: false\n\t\t});\n\t\tlet osmTiles = \"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\";\n\t\tlet attribution = \"© OpenStreetMap\";\n\t\tL.Icon.Default.imagePath = \"../leaflet/images\";\n\n\t\tL.tileLayer(osmTiles, {\n\t\t\tmaxZoom: 18,\n\t\t\tattribution: attribution\n\t\t}).addTo(tmpMap);\n\t\ttmpMap.setView([13.374711, 3.140815], 12);\n\t\treturn tmpMap;\n\t}", "title": "" }, { "docid": "85df7de04645113309614bc5dcd472bf", "score": "0.6625068", "text": "initialize(context) {\n // actually set out map\n this.reset(context)\n }", "title": "" }, { "docid": "40ccda19095a08d159591ca8013fd889", "score": "0.66234994", "text": "function initMap() {\n\t'use strict';\n\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {lat: -22.9112728, lng: -43.4484478}, //Río LAT, LNG\n\t\tzoom: 8\n\t});\n}", "title": "" }, { "docid": "f521762e03407266804bda7e8afa0651", "score": "0.6621588", "text": "function initMap() {\n\n var mapDiv = document.getElementById('map');\n map = new google.maps.Map(mapDiv, {\n center: {lat: 42.359, lng: -71.062},\n zoom: 13\n });\n\n // we will only need one of these\n infoWindow = new google.maps.InfoWindow({});\n\n // ask the view model to deal with the map markers\n vm.createMapMarkers();\n return;\n}", "title": "" }, { "docid": "f2add1c70cfef7aea55cb3d5f3b6c0c7", "score": "0.6621423", "text": "function Map() {\n\t\n}", "title": "" }, { "docid": "5a151560386b78d7585abe4fc158d148", "score": "0.6617988", "text": "function initMap() {\n\tvar losAngeles = {\n\t\tlat: 34.06338,\n\t\tlng: -118.35808,\n\t};\n\tmap = new google.maps.Map(document.getElementById(\"map\"), {\n\t\tcenter: losAngeles,\n\t\tzoom: 11,\n\t\tmapTypeId: \"roadmap\",\n\t\tmapTypeControl: true\n\t});\n\n\t// Add a style-selector control to the map.\n\tvar styleControl = document.getElementById('style-selector-control');\n\tmap.controls[google.maps.ControlPosition.TOP_LEFT].push(styleControl);\n\n\t// Set the map's style to the initial value of the selector.\n\tvar styleSelector = document.getElementById('style-selector');\n\tmap.setOptions({\n\t\tstyles: mapStyles[styleSelector.value]\n\t});\n\n\t// Apply new JSON when the user selects a different style.\n\tstyleSelector.addEventListener('change', function () {\n\t\tmap.setOptions({\n\t\t\tstyles: mapStyles[styleSelector.value]\n\t\t});\n\t});\n\n\tinfoWindow = new google.maps.InfoWindow();\n\tsearchStores();\n}", "title": "" }, { "docid": "973d7c8ca4666d7efc3e227b0aed71ca", "score": "0.6610536", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: countries[\"address\"].zoom,\n center: countries[\"address\"].center,\n mapTypeControl: false,\n panControl: false,\n zoomControl: true,\n streetViewControl: false,\n styles: mapstyling,\n });\n}", "title": "" }, { "docid": "3f0ae5052a44786b8fd32f52fe68f426", "score": "0.6609264", "text": "function initMap()\n{\n timedLog(\"Init Canvas\");\n \n //THe map strucutre hold some map informations even frameRate infos\n var map = { \n ctx : '', \n width : 0, \n height:0,\n fps: 24,\n sliding_av_counter:0,\n av_dt:0\n } \n\n var canvas = document.getElementById(\"mapCanvas\"); \n map.ctx = canvas.getContext(\"2d\"); \n map.width = canvas.width;\n map.height = canvas.height;\n return map; \n}", "title": "" }, { "docid": "e844f3638d7ce15ef1ab8314f5fb058e", "score": "0.6604144", "text": "function addMap() {\n\tmapview.setAnnotations(annotations);\n\tmapview.setRegion({\n\t\tlatitude : annotations[0].latitude,\n\t\tlongitude : annotations[0].longitude,\n\t\tlatitudeDelta : 0.5,\n\t\tlongitudeDelta : 0.5\n\t});\n\t$.mapView.add(mapview);\n}", "title": "" }, { "docid": "29831147fd33714955e516b78484cdec", "score": "0.6601829", "text": "function initMap() {\n \n defaultIcon = makeMarkerIcon('0091ff');\n\t\thighlightedIcon = makeMarkerIcon('FFFF24');\n\t\tchosenIcon = makeMarkerIcon('FF4500');\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: {lat: 33.8793808, lng: -118.3200142}, \n\t\t\tzoom: 16,\n\t\t\tstyles: styles,\n\t\t\tmapTypeControl: false\n });\n\n\t\tinfoWindow = new google.maps.InfoWindow();\n\t\tko.applyBindings(new viewModel());\n }", "title": "" }, { "docid": "d061c01bb6891dc31e6c5af2b78730fd", "score": "0.65963846", "text": "constructor() { \n \n MapDetail.initialize(this);\n }", "title": "" } ]
64c6327c5937fc5a9c8dbb371fb716df
3b. Create a function that takes in the variable and returns the array with all the words capitalized. Expected output: ["Streetlamp", "Potato", "Teeth", "Conclusion", "Nephew", "Temperature", "Database"]
[ { "docid": "43acf0db4e645c9a93ccdab60260726d", "score": "0.7384858", "text": "function capitalLetter(array){\n let arrayUppercase = []\n for (let i=0; i < array.length; i++) {\n arrayUppercase.push(array[i].charAt(0).toUpperCase() + array[i].substr(1));\n }\n return arrayUppercase;\n}", "title": "" } ]
[ { "docid": "d13d8fdc8b20f6389eed533b288fd8b3", "score": "0.8002197", "text": "function capitalizedWords(arr) {\n\tlet result = [];\n\tif (arr.length === 0) {\n\t\treturn result;\n\t}\n\tresult.push(arr[0].toUpperCase());\n\treturn result.concat(capitalizedWords(arr.slice(1)));\n}", "title": "" }, { "docid": "d566e947f34516476693d9bce21a6f38", "score": "0.77132416", "text": "function capitalizeEachWord() {\n\n}", "title": "" }, { "docid": "9f35a4b52dda53b642fc6e6654e6d8f5", "score": "0.7675194", "text": "function capitalization(text) {\r\n const wordsArray = text.toLowerCase().split(\" \");\r\n\r\n const wordsCapitalized = wordsArray.map((word) => {\r\n return word[0].toUpperCase() + word.slice(1);\r\n });\r\n\r\n console.log(wordsCapitalized.join(\" \"));\r\n}", "title": "" }, { "docid": "2c7935fd69710a70b9b1723cd0e794c0", "score": "0.7536846", "text": "function capitalize(arr) {\n\n}", "title": "" }, { "docid": "6768c48014b426bde04e80bff2f9b026", "score": "0.75093126", "text": "function capitalizeAllWords(string) {\n//function w/ string param\nlet array = [];\n//create array for our output\nlet splitString = string.split(' ');\n//split strings into array of substrings w/ split method\nfor(let i = 0; i < splitString.length; i++){\n//loop thru our array of strings\narray.push((splitString[i].charAt(0).toUpperCase()) + (splitString[i].slice(1)));\n//capitalize first character, combine and use .slice and push into new array\n}\nreturn array.join(\" \");\n//return string of new values combined w/ spaces using.join method\n\n}", "title": "" }, { "docid": "c83f740d93533cc7f0fbb390801b39cd", "score": "0.74938416", "text": "function capSentence(text){\n let wordsArray = text.toLowerCase().split('')\n let capsArray = wordsArray.map(word=>{ // .map function to loop through every word in the array and excute the same function as before to create capsArray, which is an array of the capitalised words.\n return word[0].toUpperCase() + word.slice(1)\n })\n return capsArray.join('')\n}", "title": "" }, { "docid": "28d395e0cc8811da47b17b3d2128df40", "score": "0.74859875", "text": "function TitleCase(string) {\r\n const words = string.toLowerCase().split(' ');//setting variable words to the value of lowercase and splits the string at ' ' into an array\r\n let result = words.map(function (word) {// using map to create a new array after applying this function to all the array elements that are passed in\r\n // check map out here => https://www.w3schools.com/jsref/jsref_map.asp //\r\n return word.replace(word.charAt(0), word.charAt(0).toUpperCase()); \r\n //return each word after replacing the character at index 0 with the charecter at index 0 Uppercase\r\n });\r\n return result.join(' '); // joins the result array to make a string\r\n}", "title": "" }, { "docid": "e41d2bb05fd992176577fc7a90ae2ed8", "score": "0.74805444", "text": "function capitalizeWords (arr) {\n // add whatever parameters you deem necessary - good luck!\n \n if (arr.length === 1) return [ arr[0].toUpperCase() ];\n \n const result = capitalizeWords( arr.slice(0, -1) ); \n \n let elem = arr.slice(arr.length - 1 )[0].toUpperCase();\n \n result.push(elem)\n \n return result;\n }", "title": "" }, { "docid": "15be18bc13b1e795b2064b910a11fba8", "score": "0.7381408", "text": "function capitalizeWords(phrase) {}", "title": "" }, { "docid": "def84313c8832b84d3fc52816b90495e", "score": "0.73343766", "text": "function capitalize(word){\n return word.split(' ').map(function(element){\n var wordArray = element.split('')\n wordArray[0] = wordArray[0].toUpperCase()\n return wordArray.join('')\n }).join('')\n\n \n}", "title": "" }, { "docid": "84875540b6af9466d0ac9ae833b01029", "score": "0.73233294", "text": "capitaliseFirstLetter(words) {\r\n\r\n const dataCapitalisedArr = words.split(' ');\r\n\r\n const dataCapitalisedTemp = [];\r\n\r\n for (let i = 0; i < dataCapitalisedArr.length; i++) {\r\n dataCapitalisedTemp.push(dataCapitalisedArr[i].charAt(0).toUpperCase() + dataCapitalisedArr[i].slice(1))\r\n }\r\n return dataCapitalisedTemp.join(' ');\r\n }", "title": "" }, { "docid": "8bce92662de14a48bb452ddd7cf8e83b", "score": "0.7317389", "text": "function capitalizeWords(arr) {\n if (arr.length === 1) return [arr[0].toUpperCase()];\n const res = capitalizeWords(arr.slice(0, -1));\n res.push(arr.slice(arr.length - 1)[0].toUpperCase());\n return res;\n}", "title": "" }, { "docid": "bccb4c649f4e2ada53f4b666628e1ef4", "score": "0.730662", "text": "function titleCase(str) {\n wordsArray = [];\n\n // convert string to lowercase and split by word into an array\n var wordsArray = str.toLowerCase().split(\" \");\n \n // iterate over the array \n for ( var i in wordsArray) {\n wordsArray[i] = wordsArray[i].split(\"\"); // split words into letters creating subarrays containing letters\n wordsArray[i][0] = wordsArray[i][0].toUpperCase(); // convert first letter of each word into uppercase (convert index 0 of every subarray to uppercase)\n wordsArray[i] = wordsArray[i].join(\"\"); // join the letters back into words (join each contents of each subarray together)\n }\n str = wordsArray.join(\" \"); // join all the words together into a single string.\n console.log(str);\n return str; // returns the string with with the first letter of each word capitalized\n }", "title": "" }, { "docid": "2d946a4eece62fd79f9d1ff4616e528b", "score": "0.7258284", "text": "function capitalizeWords (array) {\n if (array.length === 1) {\n return [array[0].toUpperCase()];\n }\n let res = capitalizeWords(array.slice(0, -1));\n res.push(array.slice(array.length-1)[0].toUpperCase());\n return res;\n\n}", "title": "" }, { "docid": "21caf288c07b5bdcee956753fa69495d", "score": "0.72579116", "text": "function wordCapitalizer(scentence) {\r\n scentence = scentence.split(\" \");\r\n // console.log(str.length) = 3\r\n\r\n for (var i = 0, word = scentence.length; i < word; i++) {\r\n\r\n scentence[i] = scentence[i][0].toUpperCase() + scentence[i].substr(1);\r\n }\r\n console.log(scentence.join(\" \"));\r\n}", "title": "" }, { "docid": "259901d98131a32726a783cb5ed7f078", "score": "0.7254365", "text": "function capitalizeWords(input) {\n let result = input\n .split(' ')\n .map(w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase());\n return result.join(' ');\n}", "title": "" }, { "docid": "37408e8ee608af9c49ea11f477fb8b72", "score": "0.7249085", "text": "function capitalizeAllWords(string) {\n // create empty array\n let result = [];\n // create variable that is an array of string split at the space character\n let arr = string.split(' ');\n // for loop that loops through array\n for(let i = 0; i < arr.length; i++) {\n // create variable that is first character of i element of arr capitalized\n let current = arr[i][0].toUpperCase();\n // add rest of element to capitalized first character\n current += arr[i].slice(1);\n // pushes complete word into result array\n result.push(current);\n }\n // returns result array as a string joined by space character\n return result.join(' ');\n}", "title": "" }, { "docid": "c6396274f8ea68579628a52f89790f3f", "score": "0.7243719", "text": "function capitalizeWords(str){\n // splitting the string into an array of words, for each word capitalizing the first alphabet using the previously made custom function and then joining the words into a string.\n return str.split(\" \").map((val) => capitalize(val)).join(\" \");\n}", "title": "" }, { "docid": "8e44fb09b47e72e945396de570b8ca84", "score": "0.7223825", "text": "function capitalizeAllWords(string) {\n var strArr = string .toLowerCase().split(' ');// splits the words and lower cases them\n for (let i = 0; i < strArr.length; i ++) {// loop through the string \n strArr[i] = strArr[i].charAt(0).toUpperCase() + strArr[i].substring(1);\n }\n return strArr.join(' '); // returns all words in a string captialized \n}", "title": "" }, { "docid": "3c46072a43fa9a48ebca5284b1c59de9", "score": "0.7218302", "text": "function captialised(str){\n const words = [];\n for (let word of str.split(' ')){\n words.push(word[0].toUpperCase() + word.slice(1))\n }\n return words.join(' ');\n\n}", "title": "" }, { "docid": "2283a4cd4787c6f137e11082bde10708", "score": "0.72166127", "text": "function capitalizeWords(arr) {\n\tif (arr.length === 1) {\n\t\treturn [arr[0].toUpperCase()];\n\t}\n\tlet res = capitalizeWords(arr.slice(0, -1));\n\tres.push(arr[arr.length - 1].toUpperCase());\n\treturn res;\n}", "title": "" }, { "docid": "8fe95d4d0caa8f01be7c1eb02702eadb", "score": "0.7214377", "text": "function snack3_3()\n{\n let str=['pippo','PLUTO','PaPeRiNo'];\n console.log(\"\\narray di stringhe \"+str+\"\\narray di stringhe formattato \"+toUpperCaseFL(str)); \n\n function toUpperCaseFL(arrStr){ \n return arrStr.map((str)=>(str[0].toUpperCase()+str.substring(1).toLowerCase()));\n }\n }", "title": "" }, { "docid": "63ca1b7ab0bbca202a99779bf8982cea", "score": "0.7209856", "text": "function capitalizeWords(array) {\n if (array.length === 1) {\n return [array[0].toUpperCase()];\n }\n\n let result = capitalizeWords(array.slice(0, -1));\n\n result.push(array.slice(array.length - 1)[0].toUpperCase());\n\n return result;\n}", "title": "" }, { "docid": "84a780daa0be13a53f10cafa41f01120", "score": "0.7208473", "text": "function capitalizeAllWords(string) {\n //console.log(string);\n //turn string into array of words\n let myArray = string.split(' ');\n //console.log(myArray);\n //loop through array of strings to get access to each one\n for(let i = 0; i < myArray.length; i++){\n //console.log(myArray[i]);\n //capitalize the first letter of each word\n myArray[i] = myArray[i][0].toUpperCase() + myArray[i].slice(1);\n //console.log(myArray[i]);\n }\n //console.log(myArray.join(' '));\n return myArray.join(' ');\n}", "title": "" }, { "docid": "2547690274e27705ec1a4694a24d17c8", "score": "0.72026086", "text": "function capitalize(word) {\n return word.split(' ').map(function(element) {\n var wordArray = element.split('')\n wordArray[0] = wordArray[0].toUpperCase()\n return wordArray.join('')\n }).join(' ')\n}", "title": "" }, { "docid": "7643cb7135e2889a7bfb755474b23629", "score": "0.71379054", "text": "static capitalize(word){\n return word[0].toUpperCase() + word.split(\"\").slice(1).join(\"\")\n }", "title": "" }, { "docid": "926fcb88f9e2ebbb21784bc65076ace4", "score": "0.7128546", "text": "function capitalizeAllWords(string) {\n \n}", "title": "" }, { "docid": "f611bf928ceaebf550163da9f3d4c8a1", "score": "0.7126581", "text": "function titleCase(str) {\n // Split the string into an array of the words split by whitespace\n var array = str.split(\" \");\n \n // Loop through the words\n for (var i = 0; array.length > i; i++) {\n \n // Set the word to lowercase and split up the characters into an array \n array[i] = array[i].toLowerCase().split(\"\");\n \n // Set the first letter of the word to uppercase, then rejoin the word\n array[i][0] = array[i][0].toUpperCase();\n array[i] = array[i].join(\"\"); \n }\n \n // Rejoin the sentence\n return array.join(\" \");\n}", "title": "" }, { "docid": "4694a7d55b357f137227552b8a2f4ad1", "score": "0.7125862", "text": "function capitalize(str) {\n let wordsArray = str.split(\" \");\n let newwordsArr = [];\n\n for (let words of wordsArray) {\n words = words.slice(0, 1).toUpperCase() + words.slice(1);\n newwordsArr.push(words);\n }\n console.log(newwordsArr.join(\" \"));\n return newwordsArr.join(\" \");\n}", "title": "" }, { "docid": "7f9ec4f31dd3db1b78433224faf2cc7f", "score": "0.7105251", "text": "function capitalizeEach(string) {\n //your code here!\n var phrase = string.split(' ');\n var newSentence = [];\n phrase.forEach(function(word) {\n word = word.replace(word[0], word[0].toUpperCase());\n newSentence.push(word);\n })\n return newSentence.join(' ');\n}", "title": "" }, { "docid": "b2c7dc66ce5fca048c46bade651d0170", "score": "0.7095597", "text": "function titleCased(){\n// return the result of a .MAP transformation of the tutorials array\n return tutorials.map(tutorial => {\n // separate every word in each string by a comma\n tutorial = tutorial.split(' ')\n //iterate through every word. find the first character(and seprates it from the word) of the word located at index zero and\n // make it uppercase, then add the word back to the rest of letters\n for (var i = 0; i < tutorial.length; i++) {\n\n tutorial[i] = tutorial[i].charAt(0).toUpperCase() + tutorial[i].slice(1)\n }\n // after that work has been done, .join everything back to their original strings\n // with a comma in between each course name\n return tutorial.join(' ')\n })\n}", "title": "" }, { "docid": "2e2f3dfa759283520e90243d251093a0", "score": "0.70929706", "text": "static titleize(srtingOfTitle) {\n // let firstWord = srtingOfTitle.split(' ');\n let stopwords = [\"a\", \"an\", \"but\", \"of\", \"and\", \"for\", \"at\", \"by\", \"from\", \"the\"];\n\n let firstWord = srtingOfTitle.replace(/ .*/, \"\");\n firstWord = this.capitalize(firstWord);\n\n let otherWords = srtingOfTitle.split(\" \");\n otherWords.shift();\n // console.log(otherWords);\n\n let newArry = [];\n newArry.push(firstWord);\n\n for (let i = 0; i < otherWords.length; i++) {\n if (stopwords.includes(otherWords[i])) {\n newArry.push(otherWords[i]);\n }else {\n newArry.push(this.capitalize(otherWords[i]));\n }\n }\n return( newArry.join(' '))\n\n // console.log(firstWord)\n // capitalize first word\n // let firstWord = Formatter.capitalize(srtingOfTitle[0]);\n // let otherWords = srtingOfTitle.filter((word) =>\n // word.includes([\"a\", \"an\", \"but\", \"of\", \"and\", \"for\", \"at\", \"by\", \"from\"])\n // );\n // return firstWord + otherWords;\n }", "title": "" }, { "docid": "3daf0feddda4fab10124e7c6dab03a53", "score": "0.7089419", "text": "function titleCase(str) {\n var strLoAr= str.toLowerCase().split(\" \"); // lowercase all letters then arraize them \n var capped;\n var fixed;\n var titled = [];\n console.log(strLoAr); // [ 'i\\'m', 'a', 'little', 'tea', 'pot' ]\n for (var i = 0; i < strLoAr.length; i++) { // loops through strLoAr array with indexes \n fixed = strLoAr[i].slice(1); // removes first letter of each word\n capped = strLoAr[i][0].toUpperCase(); // extracts only the first letter from each word and captialize\n titled.push(capped + fixed); // add to new array, concatenate capped with fixed\n }\n return titled.join(\" \");\n}", "title": "" }, { "docid": "98c68c44f991ebe399f4c58f7444d9a1", "score": "0.70706147", "text": "function printArrayCapital(arr){\n var capitalizedArray = [];\n for(var i = 0; i < arr.length; i++){\n capitalizedArray[i] = arr[i].toUpperCase();\n //console.log(arr[i].toUpperCase());\n }\n return capitalizedArray;\n}", "title": "" }, { "docid": "da9f75c577464754ceb624001776f900", "score": "0.70641375", "text": "function myFunction (examplesss) {\n var example = examplesss.split('');\n console.log(example);\n for (var i = 0; i < example.length; i++) {\n if (example[i] === example[i].toLowerCase()) {\n example[i] = example[i].toUpperCase();\n console.log(example[i]);\n } else {\n example[i] = example[i].toLowerCase();\n console.log(example[i]);\n } \n} return example[i] = example.join(\"\");\n}", "title": "" }, { "docid": "f8e3b7c20bb946375eb403ef04ad54d5", "score": "0.70572805", "text": "function capitalizeAllWords(string) {\n //use capitalizeAllWords in the solution\n //use split method to separate string into an array of strings\n let capStrings = string.split(\" \"); \n \n //run a for loop and call function CapitalizeWord on each element in the array\n for(let i = 0; i < capStrings.length; i++){\n \n capStrings[i] = capitalizeWord(capStrings[i]);\n \n }\n //return string with .join method. \n return capStrings.join(\" \");\n}", "title": "" }, { "docid": "f01849d7c9ca71e1e0b7eaf4f72a43ef", "score": "0.70524937", "text": "function titleCase(str) {\n\n var words = str.toLowerCase().split(\" \"); //Split the string by the white space into an Arry\n\n for(var i = 0; i < words.length; i++){ // word.length holds the number of occurrences of the array\n var letters = words[i].split(\"\"); // splits the array occurrence into an array of letters\n letters[0] = letters[0].toUpperCase(); //Sets first letter to uppercase\n words[i] = letters.join(\"\"); //join together the letters back into words\n }\n\n return words.join(\" \"); // coverts back into a sentence\n}", "title": "" }, { "docid": "1d591a95945b7b2c6f90bd3634490680", "score": "0.7040896", "text": "function capitalFirstWord (value){\n\tconst splitWord = value.toLowerCase().split(' ');\n\treturn splitWord.map( w => w.substring(0,1).toUpperCase()+ w.substring(1)).join(' ');\n}", "title": "" }, { "docid": "467012bd99b05611bce75d5eab81c03e", "score": "0.7028696", "text": "function capitalize(str) {\n let wordArray = str.split(\" \");\n let output = [];\n for (let word of wordArray) {\n output.push(`${word[0].toUpperCase()}${word.slice(1)}`);\n }\n console.log(output.join(\" \"));\n return output.join(\" \");\n}", "title": "" }, { "docid": "82e72af7ee08c60c3f911af18644f828", "score": "0.70103204", "text": "function capitalizeNames(arr){\n // your code here\n return arr.map(function(cap){\n return cap.charAt(0).toUpperCase() + cap.slice(1).toLowerCase()\n })\n }", "title": "" }, { "docid": "c244fd93b9704998257c17959c2a1d51", "score": "0.7003225", "text": "function titleCase(str) {\n //As we also need to be sure that any other letter in the string is lowercased \n //it is useful to transform all the string in lowercased letters before splitting it\n const arr = str.toLowerCase().split(' ');\n //Now it is time to work on any word of the string\n //As we saw in another problem we can loop on an array with map function and at the same time\n //apply a callback function to any of its item \n const mappedArr = arr.map(item => {\n //JS gives us the replace method we saw before\n //we need to replace the first letter of any word in the array, with the same letter\n //uppercased.\n //to select any letter in a string we can use charAt() method, so charAr(0) is\n //what we are looking for.\n //replace method takes two parameters (what to be replaced, what is going to replace it)\n return item.replace(item.charAt(0), item.charAt(0).toUpperCase());\n });\n return mappedArr.join(' ');//last, we need to join() the array to get back our sentence\n}", "title": "" }, { "docid": "48736b0f2f2bfb1abb26c1d66b685ce9", "score": "0.70021105", "text": "function capitalize(phrase){\n \n var wordList = [];\n \n if (typeof phrase === 'string'){\n wordList = phrase.split(' ');\n \n wordList.forEach(function(element, index) {\n wordList[index] = element[0].toUpperCase() + element.substr(1).toLowerCase();\n });\n return wordList.join(' ');\n }\n else return 'capitalize requires a text input';\n}", "title": "" }, { "docid": "4630b51c500f0bb038d8940df1d97e2e", "score": "0.69962937", "text": "function capitalize(str) {\n\n // let result = [];\n str_arr = str.split(\" \")\n // console.log(str_arr)\n // // refactor using map callback function\n return str_arr.map(\n word => word[0].toUpperCase() + word.slice(1)\n ).join(\" \")\n // // refactor with forEach callback function\n // str_arr.forEach(\n // \tword => result.push(word[0].toUpperCase() + word.slice(1))\n // \t)\n // // using for of loop\n // for (let word of str_arr){\n // \tresult.push(word[0].toUpperCase() + word.slice(1))\n // }\n // return result.join(\" \");\n}", "title": "" }, { "docid": "5cf2c5a02452679565711e58c3c8e814", "score": "0.69943714", "text": "function titleCase(str) {\n // my code\n str = str.toLowerCase()\n let splitArr = str.split(\" \")\n for (let i = 0; i < splitArr.length; i++) {\n splitArr[i][0].toUpperCase();\n }\n return splitArr.join(' ')\n // my code\n}", "title": "" }, { "docid": "1f148c86e7654bd3e91aa362b89b847b", "score": "0.6987191", "text": "getAllPossibleWordsWithCapitals(inputStr) {\n return this.getAllPossibleWords(inputStr).map(capitalizeEachWord)\n }", "title": "" }, { "docid": "2c82d1892cfeaafa49f9a8a9c8a4887d", "score": "0.6962971", "text": "function capitalizeNames1(arr) {\n return arr.map(value => value.toUpperCase());\n\n}", "title": "" }, { "docid": "105702b9939ffd75749c56b4f535eea2", "score": "0.6960819", "text": "function capitalizeAllWords(string) {\n \n // I: takes a string\n // O: all wprds are capitilized\n \n // convert string into an array broken up by spaces for individual characters\n \n var strArray = string.split(' ');\n \n // for loop over the created array\n // start at first index\n // stop at the end of the array\n // increment by 1\n \n for (var i = 0; i < strArray.length; i++) {\n \n // asign string at index i to capitalized word\n // at every iteration of i, capitilize the first index\n // add the capitilized index to the rest of the word using .substr\n // .substr starts extraction of string at first index\n \n strArray[i] = strArray[i][0].toUpperCase() + strArray[i].substr(1);\n }\n \n // return capitilized words with a space between\n \n return strArray.join(' ');\n}", "title": "" }, { "docid": "ea57fb50952bb323e82bf4c84ea2b771", "score": "0.69573987", "text": "function capitalize(...args) {\n console.log(args);\n let newArray = [];\n args.forEach(element => {\n newArray.push(element.toUpperCase());\n });\n return newArray;\n}", "title": "" }, { "docid": "45d54d4603e1c11e8f5195675bcaf4c2", "score": "0.6956397", "text": "function titleCase(str) {\n str=str.split(' ');\n /*var i;\n for(i=0;i<str.length;i++){\n str[i]=str[i].substring(0,1).toUpperCase()+str[i].substring(1).toLowerCase();\n }*/\n str=str.map(function(item){\n return item.substring(0,1).toUpperCase()+item.substring(1).toLowerCase();\n });\n str=str.join(' ');\n return str;\n}", "title": "" }, { "docid": "1ba6a671e3dba08be9a4b11ac54f2b66", "score": "0.6950892", "text": "function capitalizeAll(sentence){\n var array= sentence.split(\" \");\n var newString= array.map(function(element){\n return element[0].toUpperCase()+ element.slice(1);\n });\n return newString.join(\" \");\n}", "title": "" }, { "docid": "b474176a300331f9bba882c04c35a1cc", "score": "0.6936595", "text": "function capitalizeWords (niz) {\n\n let brojac = niz.length-1;\n\n function helper(brojac){\n\n if(brojac<0){return}\n niz[brojac] = niz[brojac].toUpperCase();\n helper(brojac-1);\n \n }\n\n helper(brojac);\n return niz;\n\n}", "title": "" }, { "docid": "7e10b742fa32c0c074500f7f4167530a", "score": "0.6926111", "text": "function titleCase(str) {\n let strSplit = str.split(\" \")\n let newArr = [];\n strSplit.forEach(ele => {\n let len = ele.length;\n let newStr = \"\"\n newStr = ele[0].toUpperCase() + ele.slice(1,len).toLowerCase()\n newArr.push(newStr)\n })\n console.log(newArr.join(\" \"))\n return newArr.join(\" \")\n }", "title": "" }, { "docid": "86d205de4a7be732d4c33db6ed7da450", "score": "0.6922221", "text": "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(' ')\n \n let capsArray = wordsArray.map( word=>{\n return word.replace(word[0], word[0].toUpperCase())\n })\n \n return capsArray.join(' ')\n }", "title": "" }, { "docid": "74b916385fb6744b1615ecb9e891a782", "score": "0.692", "text": "function capitalize(word) {\n\n }", "title": "" }, { "docid": "e84e1b123228bed8c6e743e4876ffde2", "score": "0.6918687", "text": "function titleCase(sentence) {\r\n return sentence.toLowerCase().split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');\r\n}", "title": "" }, { "docid": "dda62fe4b99ae89492e96e3445890e70", "score": "0.69147724", "text": "function capitalizeWords(str) {\n var words = str.split(' ');\n var upperWords = words.map(function (word) { return capitalize(word); });\n return upperWords.join(' ');\n}", "title": "" }, { "docid": "b8dab8d2d5c39d1f267ca3cd156fe29a", "score": "0.690489", "text": "function textConvert(string){\n //convert the string to opject\n var oldArray= string.split(' ');\n //container for output loop \n var newArray = [];\n //loop on the string \n for (i = 0 ; i< oldArray.length; i++){\n //pust the loop resulat in the array and concatenat the opject \n newArray.push(oldArray[i].charAt(0).toUpperCase()+ oldArray[i].slice(1));\n }\n // return the funcation \n return newArray.join(\" \")\n}", "title": "" }, { "docid": "84a265a6f0cc8e0aaf8157f241e244e3", "score": "0.69018227", "text": "function breakAndCapitalise(rom) {\n return rom.toUpperCase().split('');\n}", "title": "" }, { "docid": "71ab6af0f59d60186aa7d08c5c0ec438", "score": "0.6901478", "text": "function capSentence(text){\n let wordsArray = text.toLowerCase().split('') // split used to divide the lowercase sentence into an array of words. Stored in the wordsArray\n let capsArray = []\n\n wordsArray.forEach((word) => { // iterating through each word to execute a function on it. The function takest he first word and turns it into a uppercase.\n // the remaining part of the word in lowercase we use the slice the string starting from positon 1 till the end\n capsArray.push(word[0].toUpperCase() + word.slice(1)) // splice is used on a string extracts a section of the string and returns it as a new string. It receives two arguments; the beginning index which is compulsory and the end index which is only optional\n });\n return capsArray.join('')\n}", "title": "" }, { "docid": "085c0dbe1f3609e2657b4d004b6df7c2", "score": "0.68816054", "text": "static capitalize(string){\n const words = string.split(' ')\n const titelizedWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n return titelizedWords.join(' ')\n }", "title": "" }, { "docid": "33daf33bf31c507ebc35e38e23096bc9", "score": "0.6876795", "text": "function titlecase(str){\r\n var convert=str.toLowerCase().split(\" \")\r\n var result=convert.map(function(val){\r\n return val.replace(val.charAt(0),val.charAt(0).toUpperCase());\r\n })\r\n return result\r\n }", "title": "" }, { "docid": "a3b517fcb1059f678420fcd6e672e64b", "score": "0.6867298", "text": "function toCaps(arr) {\n const newArr = [];\n for(let i = 0; i < arr.length; i++){\n newArr.push(arr[i].replace(arr[i].charAt(0), arr[i].charAt(0).toUpperCase()));\n }\n // console.log(newArr);\n return newArr;\n}", "title": "" }, { "docid": "32536ed63ce01c238e18fa55ca5236ac", "score": "0.6860102", "text": "static capitalize(word){\n return word[0].toUpperCase() + word.slice(1)\n }", "title": "" }, { "docid": "05f2544013c6d1613e60f0fa9a80b4af", "score": "0.6858814", "text": "function capitalize(sentence){\n // Get each word from sentence\n var word = sentence.split(' ');\n\n // for each word\n word.forEach(function(currentValue, index, arr){\n var firstLetter = currentValue[0];\n var restOfWord = currentValue.toLowerCase().split('').splice(1,currentValue.length);\n restOfWord.splice(0,0,firstLetter.toUpperCase());\n var capitalizedWord = restOfWord.join('');\n arr[index] = capitalizedWord;\n });\n\n var capitalizedSentence = word.join(' ');\n console.log(capitalizedSentence);\n return capitalizedSentence;\n}", "title": "" }, { "docid": "6b576785cc780afedf1c0e43cd82db8a", "score": "0.68542445", "text": "function capitalizeFirstLetterOfEachWord(words){\n let separateWord = words.toLowerCase().split(' ') //separate words\n for (let i = 0; i < separateWord.length; i++){ //Create a for loop to go through string and capitalize the letter in correct place value.\n separateWord[i] = separateWord[i].charAt(0).toUpperCase() + separateWord[i].substring(1); //takes the string and looks at index 0 of both words in the string (h and w) and changes them to uppercase.\n } \n return separateWord.join(' ');\n}", "title": "" }, { "docid": "69ecd9f6a66f03c2ec8227252ebbf5a2", "score": "0.685258", "text": "titleIt(str){\n str = str.split(' ')\n capStr = []\n for(let i=0; i<str.length; i++){\n capStr.push(str[i].charAt(0).toUpperCase() + str[i].substr(1).toLowerCase())\n }\n return capStr.join(' ')\n }", "title": "" }, { "docid": "8ea713bc6e7be1a54044326514beb8a7", "score": "0.68412536", "text": "function capitalize(str) {\n //initialize word arr\n //loop through the arr & take first letter of every word and .toUpperCase() and concat with .slice()\n //split str into arr of words \n //use .slice(beginIdex, endIndex) which means first letter(1) of first word(0) written .slice(0,1)\n //return the phrase\n let words = [];\n for(let word of str.split(' ')){\n //starts at index 0 and concats the rest of the word\n words.push(word[0].toUpperCase() + word.slice(1))\n }\n \n //join the phrase together \n return words.join(' ')\n \n \n}", "title": "" }, { "docid": "b9e0acfca64497add63810858e565c85", "score": "0.68373185", "text": "function capMe(names){\n return names.map(name => name.charAt(0).toUpperCase() + name.slice(1).toLowerCase());\n}", "title": "" }, { "docid": "d191ffc4be1212c6040fc62a37c4199b", "score": "0.6828527", "text": "function setFirstLetterUpperCase(word) {\n // Split the words by spaces between them and store in var lowerCaseWords\n var lowerCaseWords = word.toLowerCase().split(\" \");\n // Map lowerCaseWords in var stringResult\n var stringResult = lowerCaseWords.map(\n // Create a function that will get every word in lowerCaseWords \n function(stringValue) {\n // Return the first letter to upperCase \n return stringValue.replace(stringValue.charAt(0), stringValue.charAt(0).toUpperCase());\n });\n // Combine string result words by using .join(\" \") and add spaces.\n return stringResult.join(\" \");\n}", "title": "" }, { "docid": "2b0fd7c34964315c1ec07d1a98ed6abd", "score": "0.6824559", "text": "function capSentence(text){\n let wordsArray = text.toLowerCase().split('')\n let capsArray = wordsArray.map(word =>{\n\n return word[0].replace(word[0], word[0]).toUpperCase()\n /* .replace is used to create a new string with some or all matches of a pattern replaced by a replacement. The pattern and replacement are passed in as arguments when this methond is called\n We use word[0] twice because we want to select the replace letter and then select it again so we can capitalised it\n */\n })\n return capsArray.join('')\n}", "title": "" }, { "docid": "599335102e9f4e21b484dc4d93801b25", "score": "0.68224615", "text": "function snack1_3()\n{\n let str=['pippo', 'PLUTO', 'PaPeRiNo'];\n let strNew = (str.map((x)=>(x[0].toUpperCase()+x.substring(1).toLowerCase()) ) );\n console.log (\"vecchia stringa: \"+str,\"\\nnuova stringa: \"+strNew);\n \n \n}", "title": "" }, { "docid": "d1b26d687221ecada1ee1d3c3667d3cb", "score": "0.68214655", "text": "function titleCase(str) {\n let strArray = str.toLowerCase().split(' ');\n let newWords = [];\n for (var word of strArray) {\n let wordArray = word.split('');\n wordArray[0] = wordArray[0].toUpperCase();\n newWords.push(wordArray.join(''));\n }\n return newWords.join(' ');\n}", "title": "" }, { "docid": "de803030a3355236bebc0d1b2ffd64dc", "score": "0.6819199", "text": "function titleCase(str, words) {\n const splitString = str.split(\" \");\n return splitString\n .map((str) => {\n words.split(\" \").map((word, index) => {\n console.log(word);\n });\n })\n .join(\" \");\n}", "title": "" }, { "docid": "e5298d0b033611fc729a04bf273cb1cc", "score": "0.68120193", "text": "function func5(str) {\r\n return str\r\n .split(\" \")\r\n .map(word => word[0].toUpperCase() + word.slice(1))\r\n .join(\" \");\r\n}", "title": "" }, { "docid": "9048cca6ce498f21c82448692ce105c7", "score": "0.68047756", "text": "function LetterCapitalize(str) { \n return str.split(\" \").map(function(word){return word.charAt(0).toUpperCase()+ word.substr(1);} ).join(\" \"); \n}", "title": "" }, { "docid": "61218bd7ca50f0b0bb423661c178270b", "score": "0.68026435", "text": "function titleCase(str) {\n var convertToArray = str.toLowerCase().split(\" \");\n var result = convertToArray.map(function (val) {\n return val.replace(val.charAt(0), val.charAt(0).toUpperCase());\n });\n console.log(result.join(' '));\n return result.join(' ');\n}", "title": "" }, { "docid": "40935627d36ba8fd05135679c83a9c68", "score": "0.679442", "text": "function titleCase(str) {\r\n str = str.toLowerCase().split(' '); \r\n\r\n for(var i = 0; i < str.length; i++){ \r\n str[i] = str[i].split(''); \r\n str[i][0] = str[i][0].toUpperCase(); \r\n str[i] = str[i].join('');\r\n }\r\n console.log(str.join(\" \"));\r\n return str.join(' '); \r\n}", "title": "" }, { "docid": "0f75f7089207f23f501e21fd7d9d6ddd", "score": "0.67901427", "text": "function capitalizeWords(string) {\n let stringTemp = string.split(\" \");\n let result = \"\";\n for (str of stringTemp) {\n let strTemp = str.replace(str.charAt(0), str.charAt(0).toUpperCase());\n result += strTemp + \" \";\n }\n return result;\n}", "title": "" }, { "docid": "0bdb563b40204d55de2d0efa453179d6", "score": "0.6786926", "text": "function titleCase(str) {\n var strArray = str.split(\" \");\n return strArray.map(function(item){\n var firstEle = item[0];\n return item.split(\"\").map(function(eachCharacter, i){\n if (i === 0) {\n return eachCharacter.toUpperCase();\n } else {\n return eachCharacter.toLowerCase();\n }\n }).join(\"\");\n }).join(\" \");\n}", "title": "" }, { "docid": "eae67eef7ea0b8d8f47a4438bc47042a", "score": "0.67862046", "text": "function capitalizeAllWords(string) {\n let strArray = string.split(' ');\n let newStrArr = [];\n for (let i = 0; i < strArray.length; i++) {\n newStrArr.push(strArray[i][0].toUpperCase() + strArray[i].slice(1));\n }\n return newStrArr.join(' ');\n}", "title": "" }, { "docid": "cf022a2d89b89583a95450af31ebae3d", "score": "0.67852426", "text": "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(' ')\n let capsArray = wordsArray.map(word=>{\n return word[0].toUpperCase() + word.slice(1)\n })\n\n return capsArray.join(' ')\n}", "title": "" }, { "docid": "1d6c536f659f3d21d2d914364450c914", "score": "0.677871", "text": "function returnCaps(array, capObj) { // -> structure of array [ [\"j\", \"o\", ...], [], ...]\n\n // put the capitalization back in (using capitalization object information)\n for (var i = 0; i < capObj.length; i ++) {\n\n // -> Capitalize the stuff\n array[ capObj[i]['word'] ][capObj[i]['character'] ] = array[ capObj[i]['word'] ][capObj[i]['character'] ].toUpperCase(); \n }\n\n return array;\n}", "title": "" }, { "docid": "a9c66d6b907729f66bec42972cbb5678", "score": "0.67580825", "text": "titleCase(string) {\n const smallWords = /\\b(a|an|and|at|but|by|de|en|for|if|in|of|on|or|the|to|via|vs?\\.?)\\b/i;\n const internalCaps = /\\S+[A-Z]+\\S*/;\n const splitOnWhiteSpaceRegex = /\\s+/;\n const splitOnHyphensRegex = /-/;\n\n let doTitleCase;\n doTitleCase = (_string, hyphenated = false, firstOrLast = true) => {\n const titleCasedArray = [];\n const stringArray = _string.split(hyphenated ? splitOnHyphensRegex : splitOnWhiteSpaceRegex);\n\n for (let index = 0; index < stringArray.length; ++index) {\n const word = stringArray[index];\n if (word.indexOf('-') !== -1) {\n titleCasedArray.push(doTitleCase(word, true, (index === 0 || index === stringArray.length - 1)));\n continue;\n }\n\n if (firstOrLast && (index === 0 || index === stringArray.length - 1)) {\n titleCasedArray.push(internalCaps.test(word) ? word : Humanize.capitalize(word));\n continue;\n }\n\n if (internalCaps.test(word)) {\n titleCasedArray.push(word);\n } else if (smallWords.test(word)) {\n titleCasedArray.push(word.toLowerCase());\n } else {\n titleCasedArray.push(Humanize.capitalize(word));\n }\n }\n\n return titleCasedArray.join(hyphenated ? '-' : ' ');\n };\n\n return doTitleCase(string);\n }", "title": "" }, { "docid": "d60d788154b778712ad9dc26dafeb147", "score": "0.67569447", "text": "function titleCase(str) {\n var words = str\n .toLowerCase() // sets the input string to all lowercase letters\n .split(\" \") // splits the string, returning an array of words, all lowercased still\n .map(function (word) {\n // map through array and finding each individual word\n return word[0].toUpperCase() + word.slice(1); // takes the first word and the first letter([0]) and changes it to upper case. then splices the word from the 0 index and adds it to the uppercase letter at 0 index\n });\n return words.join(\" \"); // converts the array into a string\n}", "title": "" }, { "docid": "d0f1ad28c858860376f4f307678497b9", "score": "0.67511886", "text": "function wave(word) {\n let arr = [];\n if (word != null || word != undefined) {\n for (let i = 0; i < word.length; i++) {\n if (word.charAt(i) != \" \") {\n let wordArr = word.split(\"\");\n wordArr[i] = word.charAt(i).toUpperCase();\n arr.push(wordArr.join(\"\"));\n }\n }\n }\n return arr;\n}", "title": "" }, { "docid": "b82a4aacd6418465a6f969028fd0fa75", "score": "0.6742471", "text": "function titleCase(str) {\n \n}", "title": "" }, { "docid": "fc3f606085fce52863b6c8045cab3562", "score": "0.67411536", "text": "function titleCase(str){\n if (str === undefined) {\n return \"\";\n }\n // Converts string to a lower case and puts it into an array\n str = str.toLowerCase().split(' ');\n let final = [];\n // For each word in the string makes the first letter upper case\n for(let word of str){\n if (word) {\n final.push(word.charAt(0).toUpperCase()+ word.slice(1));\n } else {\n final.push('');\n }\n }\n return final.join(' ')\n}", "title": "" }, { "docid": "4011b2461c38e718e8760adc2b8cc1e0", "score": "0.67380637", "text": "function titleCase(str) {\n\n //split string into an array by the space btw the letters \n str = str.toLowerCase().split(\" \");\n //loop through array replacing each word's first character with a uppercase char\n for (var i = 0; i < str.length; i++) {\n str[i] = str[i].replace(str[i][0], str[i][0].toUpperCase());\n }\n //return and joined str with space\n return str.join(' ');\n\n}", "title": "" }, { "docid": "aee9a0cb3dca74135aac0bf73cf360b3", "score": "0.6734804", "text": "function titleCase(str) {\n\t// split the string into an array of words\n\tconst words = str.split(' ');\n\n\t// map through the words array and uppercase the first index of each word\n\t// and join them together\n\tconst newString = words\n\t\t.map(word => {\n\t\t\treturn word[0].toUpperCase() + word.slice(1).toLowerCase();\n\t\t})\n\t\t.join(' ');\n\tconsole.log(newString);\n\n\treturn newString;\n}", "title": "" }, { "docid": "6db50da05f327301ba4c96471f1be9e1", "score": "0.6734767", "text": "function titleCase(inputString) {\n return inputString.toLowerCase().split(' ').map(function(letter) {\n return (letter.charAt(0).toUpperCase() + letter.slice(1));\n }).join(' ');\n }", "title": "" }, { "docid": "515de01be3b3dbfa8d43568c48cc898a", "score": "0.6733586", "text": "function capitalizeAll (inputString) {\n return inputString.toLowerCase().split(' ').map(function(word) {\n return word[0].toUpperCase() + word.substr(1);\n })\n .join(' ');\n}", "title": "" }, { "docid": "887a6f8ce7dc290f45aa5befedee0386", "score": "0.6733145", "text": "function problem1()\n{\n let lowercaseString = prompt(\"type a sentence\");\n everyOtherUppercase(lowercaseString);\n function everyOtherUppercase(string)\n {\n let words = string.split(\" \");\n // return words\n for (var i=0;i<words.length;i++)\n {\n if(i%2===0)\n {\n console.log(words[i].toUpperCase());\n }\n else\n {\n console.log(words[i].toLowerCase());\n }\n }\n }\n\n}", "title": "" }, { "docid": "e0a6fa414c345ac2a6e32f18f4597bab", "score": "0.6730278", "text": "function titleCase() {\n let splitString = searchParam.split(' ');\n for (let i = 0; i < splitString.length; i++) {\n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].slice(1);\n }\n return splitString.join(' '); \n}", "title": "" }, { "docid": "8115435c56e386d01d26f9ac86164735", "score": "0.67277044", "text": "function titleCase(str) {\n let tempArr = str.split(\" \")\n let resultArr = []\n for(let elem in tempArr){\n tempArr[elem] = tempArr[elem].toLowerCase();\n resultArr.push(tempArr[elem].charAt(0).toUpperCase() + tempArr[elem].substring(1));\n \n }\n return resultArr.join(\" \");\n }", "title": "" }, { "docid": "bfbd9f3a7bdc9384ad39d1d7a63146da", "score": "0.67267287", "text": "function acronym(array){\n acro = '';\n array.forEach(function(item){\n acro += item.charAt(0).toUpperCase();\n });\n return acro;\n}", "title": "" }, { "docid": "bb2837986edf92707374b17c59bd17aa", "score": "0.6721999", "text": "function capitalizeNames(arr){\n return arr.map(name=> name.charAt(0).toUpperCase() + name.substring(1).toLowerCase())\n}", "title": "" }, { "docid": "1c4ee60a0d408cd84969492507f7d1ab", "score": "0.67143136", "text": "function MyCase(name) {\r\n var a = name.toLowerCase().split(' ');\r\n for (var j = 0; j < a.length; j++) {\r\n a[j] = a[j].charAt(0).toUpperCase() + a[j].slice(1);\r\n }\r\n return a.join(' ');\r\n }", "title": "" }, { "docid": "1c4ee60a0d408cd84969492507f7d1ab", "score": "0.67143136", "text": "function MyCase(name) {\r\n var a = name.toLowerCase().split(' ');\r\n for (var j = 0; j < a.length; j++) {\r\n a[j] = a[j].charAt(0).toUpperCase() + a[j].slice(1);\r\n }\r\n return a.join(' ');\r\n }", "title": "" }, { "docid": "dff9cab51cf16760b0833399063160ec", "score": "0.6702783", "text": "function titleCase(str) {\n // return str;\n let titleCaseSentenceArray = str.toLowerCase().split(\" \");\n let firstLetterUpperCased = titleCaseSentenceArray.map(str => str.charAt(0).toUpperCase() + str.slice(1));\n let finalString = firstLetterUpperCased.join(\" \");\n console.log(finalString);\n return finalString\n }", "title": "" }, { "docid": "1c7dbddc97cd373556dfe0440669c850", "score": "0.6698984", "text": "function titleCase(str) {\n let arr = str.split(\" \");\n let word; \n for (let i = 0; i < arr.length; ++i){\n word = \"\";\n word = arr[i][0].toUpperCase();\n let sub = arr[i].substring(1).toLowerCase(); \n word+=sub; \n arr[i] = word; \n }\n let ans = arr.join(\" \");\n return ans; \n}", "title": "" } ]
d9ddf50ef7ffd66a0d52574ce0c98496
If case matches one of each filter, push case number and case number tooltip to list of included columns
[ { "docid": "297d53855e8ee88110678a65d88fea59", "score": "0.5204095", "text": "function listFromResolution(values)\n{\t\n\tvar list = [0,1]; //Columns 0 and 1 are always included so there will always be enough to draw a graph\n\t\n\t//Iterate over all cases in CaseInfo\n\tfor (var caseNum in CaseInfo)\n\t{\t\n\t\t//match flag - make sure the case matches all active filters\n\t\tvar push = -1;\n\t\t\n\t\t//keys is the names of the properties (filters)\n\t\tvar keys = Object.keys(values);\n\t\t\n\t\t//iterate over keys\n\t\tfor (var i = 0; i < keys.length ; i++)\n\t\t{\n\t\t\t//property is the name of the filter we are checking\n\t\t\tvar property = keys[i];\n\t\t\t\n\t\t\t//filter is the values to check for - i.e. the checkboxes that have been selected\n\t\t\tvar filter = values[property];\n\t\t\t\n\t\t\t//Iterate over values to see if the case matches one\n\t\t\tfor (var j = 0; j < filter.length; j++)\n\t\t\t{\n\t\t\t\t//Special case for \"Other\" checkbox - checks for cases where the value is undefined\n\t\t\t\tif (typeof CaseInfo[caseNum][property] === 'undefined' && filter[j].slice(0,5) == \"Other\")\n\t\t\t\t{\n\t\t\t\t\t//console.log(caseNum + \" has no property: \" + property + \", matching 'Other'\");\n\t\t\t\t\t\n\t\t\t\t\t//Update push flag to i. If it falls behind the loop then the case has missed a filter\n\t\t\t\t\tpush = i;\n\t\t\t\t\t\n\t\t\t\t\t//No need to check the rest of the filter values after a match\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//If its not the \"Other\" checkbox then check the object property to see if it matches\n\t\t\t\telse if (CaseInfo[caseNum][property] == filter[j])\n\t\t\t\t{\n\t\t\t\t\t//console.log(caseNum + \" matched property: \" + property + \" = \" + filter[j]);\n\t\t\t\t\t\n\t\t\t\t\t//Update push flag to i. If it falls behind the loop then the case has missed a filter\n\t\t\t\t\tpush = i;\n\t\t\t\t\t\n\t\t\t\t\t//No need to check the rest of the filter values after a match\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (push != i) \n\t\t\t{\n\t\t\t\t//Case has gone through a whole filter of values without matching, filtered out.\n\t\t\t\t//console.log(caseNum + \" did not match property:\" + property);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//If the push flag is updated on every iteration of the loop the case passes the filter\n\t\tif (push == (keys.length - 1))\n\t\t{\n\t\t\t//Add to list of columns to include in the view\n\t\t\tlist.push(caseNum);\n\t\t\tlist.push(caseNum+'T'); //also push Tooltop column\n\t\t\tlist.push(caseNum+'S'); //also push Style column\n\t\t}\n\t}\n\t//console.log(list);\n\treturn list;\n}", "title": "" } ]
[ { "docid": "35b074ce1ed968720e5fb4cc21cc4bc9", "score": "0.55139685", "text": "applyFilters(inSummaries) {\n let summaries = JSON.parse(JSON.stringify(inSummaries));\n\n let filters = this.filterValue.join(\",\");\n\n let orgFilters = this.filterOrgValue.join(\",\");\n\n for (let isummary in summaries) {\n let summary = summaries[isummary];\n summaries[isummary].key = isummary;\n\n // Check whether this row (i.e. healthCheck) should be shown\n let showSummary = false;\n\n // check if the summary score is inside values\n let summaryScore = summary.healthCheck.Score__c;\n\n if (summaryScore >= 69) {\n showSummary = orgFilters.indexOf(\"Excellent\") != -1;\n } else if (summaryScore >= 54) {\n showSummary = orgFilters.indexOf(\"Good\") != -1;\n } else if (orgFilters.indexOf(\"Poor\") != -1) {\n showSummary = true;\n }\n\n summary.showHealthCheck = showSummary;\n\n if (summary.healthCheck != undefined && summary.healthCheck.Security_Health_Check_Risks__r) {\n for (let irisk in summary.healthCheck.Security_Health_Check_Risks__r) {\n let risk = summary.healthCheck.Security_Health_Check_Risks__r[irisk];\n\n risk.showrisk = filters.indexOf(risk.RiskType__c) != -1;\n summary.healthCheck.Security_Health_Check_Risks__r[risk] = risk;\n }\n if (summary.healthCheck.Security_Health_Check_Risks__r) {\n this.numberOfRows = summary.healthCheck.Security_Health_Check_Risks__r.length;\n }\n }\n summaries[isummary] = summary;\n }\n\n this.summaries = summaries;\n this.stopLoading(500);\n }", "title": "" }, { "docid": "5be51ebc18846596719e46fecfb63ed5", "score": "0.54796046", "text": "function myFilterTableFunction() {\n let input, filter, table, tr, td, i;\n searchFilterInput = document.getElementById(\"myfilter\");\n filter = searchFilterInput.value.toUpperCase();\n requestTable = document.getElementById(\"request-table\");\n tr = requestTable.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n byRequesterName = tr[i].getElementsByTagName(\"td\")[1];\n byRequestId = tr[i].getElementsByTagName(\"td\")[2];\n byTitle = tr[i].getElementsByTagName(\"td\")[3];\n byDescription = tr[i].getElementsByTagName(\"td\")[4];\n byPriority = tr[i].getElementsByTagName(\"td\")[5];\n if (byRequesterName || byRequestId || byTitle || byDescription || byPriority) {\n if (byRequesterName.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n }\n else if (byRequestId.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n }\n else if (byTitle.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n }\n else if (byDescription.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n }\n else if (byPriority.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n }\n else {\n tr[i].style.display = \"none\";\n }\n }\n\n\n\n\n }\n}", "title": "" }, { "docid": "1badb9f61fba77d5d976acd9a50d6c7e", "score": "0.54449874", "text": "function addColumnHeaderToolTips() {\n\n jQuery('span[class=cf_header]').each(function(e) {\n var params = { extraClasses: \"infoDiv\" };\n var id = '#cf_tooltip_' + jQuery(this).attr('id');\n var toolTipText = jQuery(id).html();\n new ToolTip(this, toolTipText, params);\n });\n}", "title": "" }, { "docid": "86f895a10cd74b6f41a26ac4376457ab", "score": "0.542067", "text": "function filter() {\n // Loop through each table row\n for (index = 0, rowsLength = rows.size(); index < rowsLength; index += 1) {\n var row = $(rows.get(index)),\n filters_count_matched = 0, // Count of matched filters within each table row\n filters_count = 0; // Count of all filters\n row.hide(); // Hide this current row\n\n // Loop through each filter\n $.each(options.filters, function(key, element) {\n var text = row.find('.' + key)[0].textContent, // Text from the table we want to match against\n value = element.val(),\n filiation = text.split(\" - \"); // User inputed filter text\n filters_count++;\n\n // If the user inputed text is found in this table cell\n if (value === filiation[0] || value === filiation[1] || (value.indexOf(\"Todos\") === 0)) {\n filters_count_matched++; // Add +1 to our matched filters counter\n }\n });\n\n // If the number of filter matches is equal to the number of filters, show the row\n if (filters_count_matched == filters_count) {\n row.show();\n }\n // });\n }\n }", "title": "" }, { "docid": "bdfc5c764de92035411dfb5977e886fd", "score": "0.53561383", "text": "function addFilterRow(el, header) {\n var filterRow = $('<tr class=\"es-filter-row\" />').appendTo(header);\n if (el.settings.responsive) {\n $('<td class=\"footable-toggle-col\"></td>').appendTo(filterRow);\n }\n $.each(el.settings.columns, function eachColumn(idx) {\n var td = $('<td class=\"col-' + idx + '\" data-field=\"' + this + '\"></td>').appendTo(filterRow);\n var title;\n var caption = el.settings.availableColumnInfo[this].caption;\n // No filter input if this column has no mapping unless there is a\n // special field function that can work out the query.\n if (typeof indiciaData.esMappings[this] !== 'undefined'\n || typeof indiciaFns.fieldConvertorQueryBuilders[this.simpleFieldName()] !== 'undefined') {\n if (indiciaFns.fieldConvertorQueryBuilders[this.simpleFieldName()]) {\n if (indiciaFns.fieldConvertorQueryDescriptions[this.simpleFieldName()]) {\n title = indiciaFns.fieldConvertorQueryDescriptions[this.simpleFieldName()];\n } else {\n title = 'Enter a value to find matches the ' + caption + ' column.';\n }\n } else if (indiciaData.esMappings[this].type === 'text' || indiciaData.esMappings[this].type === 'keyword') {\n title = 'Search for words which begin with this text in the ' + caption + ' column. Prefix with ! to exclude rows which contain words beginning with the text you enter.';\n } else {\n title = 'Search for a number in the ' + caption + ' column. Prefix with ! to exclude rows which match the number you enter or separate a range with a hyphen (e.g. 123-456).';\n }\n $('<input type=\"text\" title=\"' + title + '\">').appendTo(td);\n }\n });\n }", "title": "" }, { "docid": "65de5c21cebe28a818b366509250cedc", "score": "0.53259015", "text": "function updateMapTitleAndInfo(dataset, filter){\n var title = '';\n var info = '';\n\n switch(dataset) {\n case \"education\": title = \"Education\";\n switch(filter) {\n case \"female\":\n info = \"Percentage of female population (aged 25+) with at least some secondary education.\";\n break;\n case \"male\":\n info = \"Percentage of male population (aged 25+) with at least some secondary education.\";\n break;\n default:\n info = \"The % difference between the male population and the female population with at least some secondary education.\";\n }\n break;\n case \"employment\": title = \"Labour Force Rates\";\n switch(filter) {\n case \"female\":\n info = \"Percentage of female population (aged 15+) in the labor force.\";\n break;\n case \"male\":\n info = \"Percentage of male population (aged 15+) in the labor force.\";\n break;\n default:\n info = \"The % difference between the labour force participation rates of males and females.\";\n }\n break;\n default: title = \"Education vs. Employment\";\n switch(filter) {\n case \"female\":\n info = \"The % difference between the female population in the labour force and females with at least some secondary education.\";\n break;\n default:\n info = \"The % difference between the male population in the labour force and males with at least some secondary education.\";\n }\n }\n // Add text updates\n $('#data-name').text(title);\n $('#data-info').text(info);\n}", "title": "" }, { "docid": "fc692abb4750ad390410af373112c407", "score": "0.5322433", "text": "function createFilter() {\n\tvar table = getDatasetTableDiv();\n\tif(table) {\n\t\tvar th = table.getElementsByTagName(\"th\");\n\t\tvar select_column_div = document.getElementById(\"select-column\");\n\t\tcreateHeader(select_column_div,\"Please Select The Data Labels(Columns)\");\t\n\t\t\n\t\tlet view = new ViewableColumnConstant();\n\t\tlet schoolProfileInfoCols = view.schoolProfileInfo;\n\t\tvar concatVal = schoolProfileInfoCols.Categorical + \",\" + schoolProfileInfoCols.Numerical;\n\t\tvar schoolProfileInfoColsArr = concatVal.split(\",\");\n\t\t\n\t\tfor(i = 0; i < th.length; i++) {\n\t\t\tvar innerText = th[i].innerText.replace(/ /g,\"\");\n\t\t\tfor(var j=0;j<schoolProfileInfoColsArr.length;j++){\n\t\t\t\tif(innerText.indexOf(schoolProfileInfoColsArr[j]) == 0){\n\t\t\t\t\tcreateCheckbox(th[i].innerText,\"select-column\");\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\t\t\n\t\tcreateAddFilterButton(select_column_div);\n\t}\n}", "title": "" }, { "docid": "097d6c0acdaf0b7a69e7b07faf349197", "score": "0.5280223", "text": "function filter_function(){\n $('.filter-table tbody tr').hide(); //hide all rows\n \n var companyFlag = 0;\n var companyValue = $('#filter-company').val();\n var contactFlag = 0;\n var contactValue = $('#filter-contact').val();\n var rangeFlag = 0;\n var rangeValue = $('#filter-range').val();\n var rangeminValue = $('#filter-range').find(':selected').attr('data-min');\n var rangemaxValue = $('#filter-range').find(':selected').attr('data-max');\n \n //setting intial values and flags needed\n \n //traversing each row one by one\n $('.filter-table tr').each(function() { \n \n if(companyValue == 0){ //if no value then display row\n companyFlag = 1;\n }\n else if(companyValue == $(this).find('td.company').data('company')){ \n companyFlag = 1; //if value is same display row\n }\n else{\n companyFlag = 0;\n }\n \n \n if(contactValue == 0){\n contactFlag = 1;\n }\n else if(contactValue == $(this).find('td.contact').data('contact')){\n contactFlag = 1;\n }\n else{\n contactFlag = 0;\n }\n \n \n \n if(rangeValue == 0){\n rangeFlag = 1;\n }\n //condition to display rows for a range\n else if((rangeminValue <= $(this).find('td.range').data('min') && rangemaxValue > $(this).find('td.range').data('min')) || (\n rangeminValue < $(this).find('td.range').data('max') &&\n rangemaxValue >= $(this).find('td.range').data('max'))){\n rangeFlag = 1;\n }\n else{\n rangeFlag = 0;\n }\n \n console.log(rangeminValue +' '+rangemaxValue);\n console.log($(this).find('td.range').data('min') +' '+$(this).find('td.range').data('max'));\n \n \n if(companyFlag && contactFlag && rangeFlag){\n $(this).show(); //displaying row which satisfies all conditions\n }\n \n });\n \n }", "title": "" }, { "docid": "9ac49a2bf7693624141f83e6740d8ac4", "score": "0.52512646", "text": "individualFormatter(value, row) {\n if (!this.query?.individualId) {\n return \"-\";\n }\n // return value.map(individual => individual.genes[0].transcripts[0].variants[0].knockoutType)\n const typeToColor = {\n \"HOM_ALT\": \"#5b5bff\",\n \"COMP_HET\": \"blue\",\n \"DELETION_OVERLAP\": \"#FFB05B\"\n };\n /* const samplesTableData = this.samples.map(sample => ({id: sample.sampleId}));\n for (const {sampleId, variant} of row.data) {\n if (variant.id === row.id) {\n const c = samplesTableData.find(sample => sample.id === sampleId);\n c.knockoutType = variant.knockoutType;\n }\n }*/\n const filteredIndividualIDs = this.query.individualId.split(/[,;]/);\n // TODO FIXME at the moment it takes into account the first variant of the first transcript of the first gene\n return filteredIndividualIDs.map(individualId => {\n for (const individual of value) {\n if (individual.id === individualId) {\n const gene = individual.genes[0];\n const transcript = gene.transcripts[0];\n for (const variant of transcript.variants) {\n if (variant.id === row.id) {\n return `<a class=\"rga-individual-box\" style=\"background: ${typeToColor[variant.knockoutType] ?? \"#fff\"}\" tooltip-title=\"${individual.id}\" tooltip-text=\"${variant.knockoutType}\">&nbsp;</a>`;\n }\n }\n }\n }\n return `<a class=\"rga-individual-box\" style=\"background: '#fff' tooltip-title=\"${individualId}\" tooltip-text=\"no knockout\">&nbsp;</a>`;\n\n }).join(\"\");\n }", "title": "" }, { "docid": "aa8a731031308ad2d9aebb759dfbe681", "score": "0.5215732", "text": "function generateFilterHtmlForAxis ( xtab , hdr )\n{\n var html = \"\";\n // we intentionally want the counter from 1 to layer.length + 1 \n for (var m = 1; m <= hdr.layer.length; m++) {\n var filter = [];\n html += \"<div style=\\\"display:none;\\\" class=\\\"cf_dim_list\\\" id=\\\"crosstable_filter_\" + hdr.layer[m-1].dimndx + \"\\\">\\n\";\n html += \"<table>\\n\";\n for (var n = 0; n < hdr.header.length; n++) {\n var codendx = hdr.header[n][m].codendx;\n if (filter[codendx] == null) {\n filter[codendx] = xtab.code[codendx];\n html += \" <tr><td><input type=\\\"checkbox\\\" value=\\\"\" + codendx + \"\\\"></td><td>\" +\n xtab.code[codendx].disp +\n \"</td></tr>\\n\" ;\n }\n }\n html += \"</table>\\n\";\n html += \"</div>\\n\"\n }\n return html;\n}", "title": "" }, { "docid": "ce7e8b0538fd98f1297bcc715a20d744", "score": "0.51954055", "text": "function filter() {\n $(\".filter-field\").on(\"keyup\", function () {\n\n var value = $(this).val();\n $(\"#table .content-row\").each(function (index) {\n if (index !== 0) {\n var row = $(this);\n //filters tds that match indexOf check\n var matches = row.find('.table-content-cell').filter(function (ix, item) {\n var input = $(item).text().toUpperCase();\n return input.indexOf(value.toUpperCase()) > -1;\n });\n\n //if matches exist then show, else hide\n if (matches.length !== 0) {\n $(row).show();\n }\n else {\n $(row).hide();\n }\n }\n });\n });\n}", "title": "" }, { "docid": "7f82ee2434d2d8bdea7416029c744914", "score": "0.5185699", "text": "static tableDataResult(alarm) {\n const [ name, count, prio, source, first, latest ] = alarm;\n let prioClass;\n switch(prio){\n case '*** ALARM': prioClass = 'td-prio-one'; break;\n case '** ALARM': prioClass = 'td-prio-two'; break;\n case '* ALARM': prioClass = 'td-prio-three'; break;\n case '2 (critical': prioClass = 'td-prio-one'; break;\n case '3 (major)': prioClass = 'td-prio-two'; break;\n case '4 (minor)': prioClass = 'td-prio-three'; break;\n default : prioClass = ''; break;\n }\n\n let aaa, bbb;\n if (name !== \"\") aaa = name.substring(0, 50)\n else aaa = name;\n\n if (source) bbb = source.substring(0, 8)\n else bbb = source;\n\n let newAaa = aaa;\n let newBbb = bbb;\n let newFirst = first;\n let newLatest = latest;\n\n if (searchCond.searchText != '') {\n\n const regex = new RegExp(`${searchCond.searchText}`, 'gi');\n \n newFirst = first.replace( regex, (text) => {\n newAaa = `${aaa} <mark><u><b> >>> </b></u></mark>`;\n return `<mark><u><b>${text}</b></u></mark>`;\n });\n\n newLatest = latest.replace( regex, (text) => {\n newAaa = `${aaa} <mark><u><b> >>> </b></u></mark>`;\n return `<mark><u><b>${text}</b></u></mark>`\n });\n\n \n newAaa = newAaa.replace( regex, (text) => `<mark><u><b>${text}</b></u></mark>` );\n\n newBbb = newBbb.replace( regex, (text) => `<mark><u><b>${text}</b></u></mark>` );\n\n\n }\n\n\n return `\n <td class=\"td-mouse-over\">\n ${newAaa}\n <span class=\"my-pre-off\">\n \n ${newFirst}\n\n ${newLatest}\n </span>\n </td>\n <td>${count}</td>\n <td class=\"${prioClass}\">${prio}</td>\n <td>${newBbb}</td>\n `;\n \n}", "title": "" }, { "docid": "8b944322878e4865289527e217651850", "score": "0.51831794", "text": "setDisplayNames(entries)\n {\n let newEntry = entries.map(entry => {\n if (entry[0] === 'empId'){\n return ['Emp ID',entry[1]];\n }\n if (entry[0] === 'gender'){\n return ['Gender',entry[1]];\n }\n if (entry[0] === 'contactNum'){\n return ['Contact Number',entry[1]];\n }\n if (entry[0] === 'contactNum'){\n return ['Personal Mail',entry[1]];\n }\n if (entry[0] === 'personalMail'){\n return ['Personal Mail',entry[1]];\n }\n if (entry[0] === 'emailAddress'){\n return ['Office Mail',entry[1]];\n }\n if (entry[0] === 'level'){\n return ['Level',entry[1]];\n }\n if (entry[0] === 'post'){\n return ['Post',entry[1]];\n }\n if (entry[0] === 'joiningDate'){\n return ['Date of Joining',entry[1]];\n }\n if (entry[0] === 'dateOfBirth'){\n return ['Date of Birth',entry[1]];\n }\n if (entry[0] === 'bloodGroup'){\n return ['Blood Group',entry[1]];\n }\n if (entry[0] === 'basicPay'){\n return ['Basic Pay',entry[1]];\n }\n if (entry[0] === 'aadharCardNo'){\n return ['Aadhar Card Number',entry[1]];\n }\n if (entry[0] === 'address'){\n return ['Address',entry[1]];\n }\n })\n\n return newEntry.filter(e=>e!==undefined);\n }", "title": "" }, { "docid": "d2ae4e35f06e2a70957f9532cf1223f2", "score": "0.51608235", "text": "function filter(){\n // Get all of the filters available. \n var filters = $(\"*[data-search-filter]\");\n \n // Get all of the search contexts\n var contexts = $(\"*[data-search-context]\");\n \n // Loop through each context\n contexts.each(function(index, context){\n // Show the context\n $(context).show();\n \n // Loop through each filter\n filters.each(function(index, filter){\n \n // Get the text from the filter\n var filterText = $(filter).val()\n\n // If you got nothing from val() then try looking for a value attribute. \n if(filterText == undefined || filterText == \"\")\n {\n // Try and get the value attributes value.\n var value = $(filter).attr('value');\n\n // Check if it is valid\n if (typeof value !== typeof undefined && value !== false) \n {\n // Assign if it is valid. \n filterText = value;\n }\n }\n \n\n \n \n // Get the value of the data-search-filter attribute.\n var filterName = $(filter).attr(\"data-search-filter\");\n \n // Find any targets that match the filter attribute\n var targets = $(context).find(\"*[data-search-target='\" + filterName + \"']\");\n \n // Loop through each target.\n targets.each(function(index, target){\n \n // Get the value if case should be maintained.\n var keepCase = $(filter).attr(\"data-search-filter-noignorecase\");\n\n // Get the value of the target HTML.\n var targetText = $(target).html();\n\n // Set a few variables for use.\n var filterTextUpper = \"\";\n var targetTextUpper = \"\";\n\n // Check if case should be maintained.\n if (typeof keepCase !== typeof undefined && keepCase !== false) \n {\n filterTextUpper = filterText;\n targetTextUpper = targetText;\n\n console.log(\"keepcase\");\n }\n else\n {\n filterTextUpper = filterText.toUpperCase();\n targetTextUpper = targetText.toUpperCase();\n\n console.log(\"losecase\");\n }\n\n \n \n // Check if the text matches. \n if(targetTextUpper.indexOf(filterTextUpper) < 0)\n {\n // Hide it if it does not. \n $(context).hide();\n }\n });\n });\n });\n }", "title": "" }, { "docid": "1f64a1c6731dcf14a78b9d5c60de2a0f", "score": "0.51478094", "text": "function myFunction1() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"city\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[1];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "title": "" }, { "docid": "e88ad2921cdb37c652c34d34dec85c2b", "score": "0.51274246", "text": "computeDisplayRow(columns, row, rowIndex, filterList, searchText, dataForTableMeta) {\n let isFiltered = false;\n let isSearchFound = false;\n let displayRow = [];\n\n for (let index = 0; index < row.length; index++) {\n let columnDisplay = row[index];\n let columnValue = row[index];\n let column = columns[index];\n\n if (column.customBodyRenderLite) {\n displayRow.push(column.customBodyRenderLite);\n } else if (column.customBodyRender) {\n const tableMeta = this.getTableMeta(rowIndex, index, row, column, dataForTableMeta, {\n ...this.state,\n filterList: filterList,\n searchText: searchText,\n });\n\n const funcResult = column.customBodyRender(\n columnValue,\n tableMeta,\n this.updateDataCol.bind(null, rowIndex, index),\n );\n columnDisplay = funcResult;\n\n // drill down to get the value of a cell\n columnValue =\n typeof funcResult === 'string' || !funcResult\n ? funcResult\n : funcResult.props && funcResult.props.value\n ? funcResult.props.value\n : columnValue;\n \n displayRow.push(columnDisplay);\n } else {\n displayRow.push(columnDisplay);\n }\n\n const columnVal = columnValue === null || columnValue === undefined ? '' : columnValue.toString();\n\n const filterVal = filterList[index];\n const caseSensitive = this.options.caseSensitive;\n const filterType = column.filterType || this.options.filterType;\n if (filterVal.length || filterType === 'custom') {\n if (column.filterOptions && column.filterOptions.logic) {\n if (column.filterOptions.logic(columnValue, filterVal)) isFiltered = true;\n } else if (filterType === 'textField' && !this.hasSearchText(columnVal, filterVal, caseSensitive)) {\n isFiltered = true;\n } else if (\n filterType !== 'textField' &&\n Array.isArray(columnValue) === false &&\n filterVal.indexOf(columnValue) < 0\n ) {\n isFiltered = true;\n } else if (filterType !== 'textField' && Array.isArray(columnValue)) {\n //true if every filterVal exists in columnVal, false otherwise\n const isFullMatch = filterVal.every(el => {\n return columnValue.indexOf(el) >= 0;\n });\n //if it is not a fullMatch, filter row out\n if (!isFullMatch) {\n isFiltered = true;\n }\n }\n }\n\n if (\n searchText &&\n this.hasSearchText(columnVal, searchText, caseSensitive) &&\n column.display !== 'false' &&\n column.searchable\n ) {\n isSearchFound = true;\n }\n }\n\n const { customSearch } = this.props.options;\n\n if (searchText && customSearch) {\n const customSearchResult = customSearch(searchText, row, columns);\n if (typeof customSearchResult !== 'boolean') {\n console.error('customSearch must return a boolean');\n } else {\n isSearchFound = customSearchResult;\n }\n }\n\n if (this.options.serverSide) {\n if (customSearch) {\n console.warn('Server-side filtering is enabled, hence custom search will be ignored.');\n }\n\n return displayRow;\n }\n\n if (isFiltered || (searchText && !isSearchFound)) return null;\n else return displayRow;\n }", "title": "" }, { "docid": "e5550772444aa8e668960d6388f0f51f", "score": "0.5126746", "text": "_populateFilterSection() {\n const that = this;\n\n if (!that.dataSource || that.dataSource.length === 0) {\n return;\n }\n\n const value = that._validateValue(that.value),\n dataSource = value.order.length > 0 ? that._reorderDataSource(value.order) : that.dataSource,\n filteringData = value.filtering,\n criteriaOptionsArray = ['=', '<>', '>', '>=', '<', '<=', 'startswith', 'endswith', 'contains', 'notcontains', 'isblank', 'isnotblank'];\n\n that.$.allColumnsFiltering.$.container.innerHTML = '';\n that._filteringDetails = {};\n\n for (let i = 0; i < dataSource.length; i++) {\n const accordionItem = document.createElement('smart-accordion-item'),\n accordionItemInput = document.createElement('input'),\n accordionItemDropDownContainer = document.createElement('div'),\n accordionItemDropDownContainerText = document.createElement('span'),\n field = dataSource[i],\n fieldOptions = field.filteringOptions,\n criteriaOptions = (fieldOptions || criteriaOptionsArray).map((option) => ({ value: option, label: that.localize(option) }));\n let fieldData = filteringData.find(function (element) {\n return element.field === field[that.valueMember];\n });\n\n if (fieldData === undefined) {\n accordionItem.data = {\n options: criteriaOptions,\n field: field,\n criteria: fieldOptions ? fieldOptions[0] : 'contains',\n pattern: ''\n };\n }\n else {\n accordionItem.data = {\n options: criteriaOptions,\n field: fieldData.field,\n criteria: fieldData.criteria || fieldOptions[0] || 'contains',\n pattern: fieldData.pattern || ''\n };\n }\n\n accordionItem.label = field[that.displayMember];\n that.$.allColumnsFiltering.appendChild(accordionItem);\n\n accordionItemInput.className = 'smart-filter-input';\n accordionItemInput.name = accordionItem.data.field;\n accordionItemInput.value = accordionItem.data.pattern;\n\n accordionItemDropDownContainer.className = 'smart-filter-options-container';\n accordionItemDropDownContainer.label = that.localize(accordionItem.data.criteria),\n\n accordionItemDropDownContainerText.className = 'smart-filter-options-container-text';\n accordionItemDropDownContainerText.innerText = that.localize(accordionItem.data.criteria || 'contains');\n\n accordionItemDropDownContainer.appendChild(accordionItemDropDownContainerText);\n accordionItem.$.contentContainer.appendChild(accordionItemDropDownContainer);\n accordionItem.$.contentContainer.appendChild(accordionItemInput);\n\n that._filteringDetails[field[that.valueMember]] = {\n input: accordionItemInput,\n accordionItem: accordionItem,\n dropDownContainer: accordionItemDropDownContainer\n }\n }\n }", "title": "" }, { "docid": "0fc2edfdcdf84c933e26179d9249ee4c", "score": "0.50907284", "text": "function displayCity() {\n\n let input = document.getElementById(\"inputGroup_site\");\n\n if (input.value === \"Toutes les villes\") {\n filteredTrs = filteredTrs.map((tr) => {\n tr.style.display = 'table-row';\n return tr;\n });\n }\n else {\n filteredTrs = filteredTrs.map((tr) => {\n tr.style.display = 'table-row';\n let trLabel = tr.children[2].innerText;\n if (trLabel == input.value) {\n tr.style.display = 'table-row';\n } else {\n tr.style.display = 'none';\n }\n return tr;\n });\n }\n}", "title": "" }, { "docid": "c652a4f2961ee1783b71e0bc0c9c4a05", "score": "0.5082155", "text": "function onSelect()\n{\t\t\n\tclearTabs();\n\tvar selection = chart.getSelection();\t\t\t\n\t\n\tconsole.log(selection);\n\t\n\tif (selection == null || selection[0] == null)\n\t\treturn;\n\tif (selection[0].row == null)\n\t{\n\t\t//Legend clicked\n\t\tvar caseNumber = view.getColumnLabel(selection[0].column);\n\t\tdocument.getElementById(\"CaseLog\").innerHTML = \"<p><b>\" + caseNumber + \": \" + CaseInfo[caseNumber].description +\"</b><br>\" + CaseInfo[caseNumber].caseLog + \"<br></p>\";\n\t}\n\telse\n\t{\n\t\t// Point Clicked. This is non-trivial as multiple cases might have a point behind the one clicked,\n\t\t//but getSelection only returns the top one\n\n\t\tvar row = selection[0].row;\n\t\t\n\t\t//This must be the view rather than the DataTable as otherwise the column will likely be wrong\n\t\tvar val = view.getValue(row, selection[0].column);\n\t\t\n\t\t//loop limit\n\t\tvar limit = view.getNumberOfColumns();\n\t\t\n\t\tvar first = true;\n\t\t\n\t\t//document.getElementById(\"CaseLog\").innerHTML = \"<p>\";\n\t\t//If value in this row (week) is the same for another column(case) they share this point on the graph\n\t\t//+= 2 to skip over tooltip columns\n\t\tfor (i = 2; i < limit; i+=3)\n\t\t{\n\t\t\tif (val == view.getValue(row, i))\n\t\t\t{\n\t\t\t\tcaseNumber = view.getColumnLabel(i);\n\t\t\t\t//try\n\t\t\t\t//{\n\t\t\t\t\t//document.getElementById(\"CaseLog\").innerHTML += \"<span style='color:\" + CaseInfo[caseNumber].color + \"'><b>\" + caseNumber + \":</span> \" + CaseInfo[caseNumber].description +\"</b><br>\" + CaseInfo[caseNumber].caseLog + \"<br></p>\";\n\t\t\t\t\tnewTab(CaseInfo[caseNumber].color, caseNumber, CaseInfo[caseNumber].description, CaseInfo[caseNumber].caseLog, first);\n\t\t\t\t\tfirst = false\n\t\t\t\t//}\n\t\t\t\t//catch(err) {} //Sometimes tries to read from tooltip columns, not sure why\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9bf465f72cec65594b27521e323075fd", "score": "0.5081524", "text": "function doFiltering() {\n $(\".card-wrap\").hide();\n $(\".card-wrap.\" + numberOfDays + \"d.\" + peopleValue + \"p\").show();\n }", "title": "" }, { "docid": "3d74dcac65e0d1b9c472ce5307d60ba9", "score": "0.5078776", "text": "function showData(data, givenFilter) {\n\n // Function to filter the data according to the given filter\n function filterData(d) {\n var toReturn = true;\n if ((givenFilter.year !== \"\" && d.Year !== givenFilter.year) ||\n (givenFilter.gender !== \"\" && d.Gender !== givenFilter.gender) ||\n (givenFilter.sherpa !== \"\" && d.Sherpa !== givenFilter.sherpa) ||\n (givenFilter.nation !== \"\" && d.Nation !== givenFilter.nation) ||\n (givenFilter.reason !== \"\" && d.Reason !== givenFilter.reason)\n ) {\n toReturn = false;\n }\n return toReturn;\n }\n\n // Fatalities: Add new needed divs\n var selFatal = d3.select(\"#fatal\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason !== \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }));\n selFatal.enter()\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .append(\"span\")\n .select(function () {\n return this.parentNode;\n })\n .append(\"svg\")\n .attr(\"width\", 50)\n .attr(\"height\", 50)\n .append(\"svg:image\");\n\n // Fatalities: Set right text\n d3.select(\"#fatal\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason !== \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .select(\"span\")\n .attr(\"class\", \"tooltiptext\")\n .text(function (d) {\n return d.Lastname + \" | \" + d.Sherpa + \" \" + d.Nation + \" | \" + d.Reason + \" | \" + d.Year;\n });\n\n // Fatalities: Add right images\n d3.select(\"#fatal\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason !== \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .select(\"svg\")\n .select(\"image\")\n .attr(\"xlink:href\", function (d) {\n if (d.Gender === \"f\") {\n return \"images/stickwoman.svg\";\n } else {\n return \"images/stickman.svg\";\n }\n });\n\n // Fatalities: Remove unnecessary divs\n d3.select(\"#fatal\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason !== \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .exit().remove();\n\n\n // Climbers: Add new needed divs\n var selClimbers = d3.select(\"#climbers\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason === \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }));\n selClimbers.enter()\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .append(\"span\")\n .select(function () {\n return this.parentNode;\n })\n .append(\"svg\")\n .attr(\"width\", 50)\n .attr(\"height\", 50)\n .append(\"svg:image\");\n\n // Climbers: Set right text\n d3.select(\"#climbers\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason === \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .select(\"span\")\n .attr(\"class\", \"tooltiptext\")\n .text(function (d) {\n return d.Lastname + \" | \" + d.Sherpa + \" \" + d.Nation + \" | \" + d.Year;\n });\n\n // Climbers: Add right images\n d3.select(\"#climbers\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason === \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .select(\"svg\")\n .select(\"image\")\n .attr(\"xlink:href\", function (d) {\n if (d.Gender === \"f\") {\n return \"images/stickwoman.svg\";\n } else {\n return \"images/stickman.svg\";\n }\n });\n\n // Climbers: Remove unnecessary divs\n d3.select(\"#climbers\")\n .select(\"td\")\n .selectAll(\"div\")\n .data(data.filter(function (d) {\n if (d.Reason === \"\") {\n var toReturn = filterData(d);\n if (toReturn) {\n return d;\n }\n }\n }))\n .exit().remove();\n\n // Show active buttons\n showActiveButtons();\n}", "title": "" }, { "docid": "bca8a40f51bf2c481f31be1b23aab077", "score": "0.5075793", "text": "function myFunction3() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"country\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[3];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "title": "" }, { "docid": "466cdffac38de0107e40cb70a1cf902e", "score": "0.5075293", "text": "function apply_filter (filter_id ){\n var applied_filters = []\n for (var i = 0; i < filter_items.length; i++) {\n var select_name = filter_items[i]\n var selectedOptionValue = $(\"#\"+filter_id+\" #\" + select_name + \" option:selected\")\n //make sure at least one option is selected\n if (selectedOptionValue.length == 0) {\n alert(\"You need to select at least one item for: \" + select_name)\n return false\n }\n //gather the options selected\n var single_filter = {\n 'item_name': select_name,\n 'selected_options' : []\n }\n for (var j = 0; j < selectedOptionValue.length; j++) {\n single_filter.selected_options.push(selectedOptionValue[j].value)\n }\n applied_filters.push(single_filter)\n }\n //if there are no filters to apply, exit\n if (applied_filters.length == 0) {\n return\n }\n //filter the rows\n //get the interm table\n switch(filter_id) {\n case 'baseball-players-filter':\n interm_table = player_table;\n break;\n case 'baseball-pitchers-filter':\n interm_table = pitcher_table;\n break;\n default:\n alert('apply_filter() switch error')\n }\n\n //build the search string\n for (var i = 0; i < applied_filters.length; i++){\n var search_column_name = applied_filters[i].item_name.concat(':name')\n var search_column_string = '(^'.concat(applied_filters[i].selected_options[0])\n for(var x = 1; x < applied_filters[i].selected_options.length; x++) {\n search_column_string = search_column_string.concat('$|^')\n search_column_string = search_column_string.concat(applied_filters[i].selected_options[x])\n }\n search_column_string = search_column_string.concat('$)')\n //apply the search string to the table\n interm_table = interm_table.column(search_column_name).search(search_column_string, true, false)\n }\n //draw the table with the new searches applied\n interm_table.draw()\n \n}", "title": "" }, { "docid": "bac50a195351f8e8759048de71c6a5ad", "score": "0.5075016", "text": "function addFilter() {\n\t\tvar filter,\n\t\t//hiddenPeople = $('<div>'), // A place to keep the rows that \"hide\" from the table\n\t\tform = $('<form><label for=friFilter>Filter by department and emphasis: <select id=friFilter></select></label></form>');\n\t\tfilter = form.find('select');\n\t\t\n\t\t$.each([{\n\t\t\tlabel: '-- Show All --',\n\t\t\tfilter: function () {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: 'Department of Counseling, Clinical & School Psychology',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Departments', 'CCSP');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Clinical Psychology',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Clinical Psychology');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; School Psychology Credential',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'School Psychology Credential');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Counseling Psychology',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Counseling Psychology');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: 'Department of Education',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Departments', 'EDUC');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Culture and Development',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Culture and Development');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Language and Literacy',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Language and Literacy');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Learning, Culture and Technology Studies',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Learning, Culture and Technology Studies');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Policy, Leadership and Research Methods',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Policy, Leadership and Research Methods');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Science and Mathematics Education',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Science and Mathematics Education');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Special Education, Disabilities &amp; Risk Studies',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Special Education, Disabilities & Risk Studies');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Teacher Education and Professional Development',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Teacher Education and Professional Development');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: 'Teacher Education Program',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Departments', 'TEP');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Multiple Subject',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Multiple Subject');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Single Subject',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Single Subject');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Special Education Credential',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Special Education Credential');\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: ' &nbsp; &nbsp; Science/Math Initiative',\n\t\t\tfilter: function () {\n\t\t\t\treturn personHas($(this), 'Emphases', 'Science/Math Initiative');\n\t\t\t}\n\t\t}], function () {\n\n\t\t\t// Attach the filter function to the <option> object and append the\n\t\t\t// <option> to the <select>\n\t\t\tfilter.append(\n\t\t\t$('<option>' + this.label + '</option>').data('filter', this.filter));\n\t\t});\n\n\t\t// Insert the filter before the tables\n\t\t$('#formFilter').append(form);\n\n\t\t/* When an option is selected, move all of the rows into the hidden table,\n\t\t * then bring back the ones that match the filter defined by the option.\n\t\t * Afterwards, we sort the table by Name by marking the header as unsorted\n\t\t * (removing the sorted and rsorted classes) and then clicking it.\n\t\t */\n\t\tfilter.change(function () {\n\t\t\tvar func = filter.find('option:selected').data('filter');\n\n\t\t\tif (func) {\n\t\t\t\t// Move all people back into the hiddenPeople section\n\t\t\t\t//hiddenPeople.append(people.find('.person'));\n\t\t\t\thidden_people.append(people_senate.find('.person'));\n\t\t\t\thidden_people.append(people_lacts.find('.person'));\n\t\t\t\thidden_people.append(people_researchers.find('.person'));\n\n\t\t\t\t//create list based selection filter\n\t\t\t\tvar filtered = hidden_people.find('.person').filter(func).mergeSort(function (left, right) {\n\t\t\t\t\tleft = $(left).find('h3 .surname').text();\n\t\t\t\t\tright = $(right).find('h3 .surname').text();\n\t\t\t\t\tif (left < right) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else if (left === right) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//people.append(filtered);\n\t\t\t\tpeople_senate.append(filtered.filter(function () {\n\t\t\t\t\treturn personHas($(this), 'Category', 'Academic Senate Faculty')\n\t\t\t\t}));\n\t\t\t\tpeople_lacts.append(filtered.filter(function () {\n\t\t\t\t\treturn personHas($(this), 'Category', 'Lecturer-Academic Coordinator-Teacher Supervisor')\n\t\t\t\t}));\n\t\t\t\tpeople_researchers.append(filtered.filter(function () {\n\t\t\t\t\treturn personHas($(this), 'Category', 'Researcher')\n\t\t\t\t}));\n\n\t\t\t\t//Show/hide headings depending on whether the divs are populated.\n\t\t\t\tcheckHeading(\"facultyListingSenate\");\n\t\t\t\tcheckHeading(\"facultyListingLACTS\");\n\t\t\t\tcheckHeading(\"facultyListingResearchers\");\n\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5cdd20009c6f9ab8b55b0c3c0be73c1a", "score": "0.50692886", "text": "filterTable(e){\n const word = e.target.value;\n this.filteredPeople = this.people.filter(item => {\n if(item.fname.indexOf(word) > -1 ||\n item.surname.indexOf(word) > -1 ||\n item.kanton.indexOf(word) > -1) {\n return true;\n }\n return false;\n });\n this.renderTable(this.filteredPeople);\n }", "title": "" }, { "docid": "176278cec54c3a6ba9457c0f902652c8", "score": "0.50646865", "text": "function t_SetExtendedFilterDict(el, col_index, filter_dict, event_key) {\n //console.log( \"===== t_SetExtendedFilterDict ========= \");\n //console.log( \"col_index \", col_index, \"event_key \", event_key);\n // filter_dict = [ [\"text\", \"m\", \"\"], [\"number\", 180, \"gt\"] ]\n\n // filter_dict[col_index] = [filter_tag, filter_value, mode]\n // modes are: 'blanks_only', 'no_blanks', 'lte', 'gte', 'lt', 'gt'\n\n// --- get filter tblRow and tblBody\n let tblRow = t_get_tablerow_selected(el);\n const filter_tag = get_attr_from_el(el, \"data-filtertag\")\n //console.log( \"filter_tag \", filter_tag);\n\n const col_count = tblRow.cells.length\n //console.log( \"col_count \", col_count);\n let mode = \"\", filter_value = null, skip_filter = false;\n// --- skip filter row when clicked on Shift, Control, Alt, Tab. Filter is set by the other key that is pressed\n if ([\"Shift\", \"Control\", \"Alt\", \"Tab\"].includes(event.key)) {\n skip_filter = true\n// --- reset filter row when clicked on 'Escape'\n // PR2020-09-03 don't use event.which = 27. Is deprecated. Use event_key === \"Escape\" instead\n } else if (event_key === \"Escape\") {\n filter_dict = {};\n for (let i = 0, len = tblRow.cells.length; i < len; i++) {\n let el = tblRow.cells[i].children[0];\n if(el){ el.value = null};\n }\n } else if ( filter_tag === \"toggle\") {\n let arr = (filter_dict && filter_dict[col_index]) ? filter_dict[col_index] : \"\";\n const old_value = (arr && arr[1] ) ? arr[1] : 0;\n // subtract 1, to get order V, X, -\n let new_value = old_value - 1;\n if(new_value < 0) { new_value = 2};\n filter_dict[col_index] = [filter_tag, new_value];\n } else if ( filter_tag === \"inactive\") {\n let arr = (filter_dict && filter_dict[col_index]) ? filter_dict[col_index] : \"\";\n const old_value = (arr && arr[1] ) ? arr[1] : 0;\n // subtract 1, to get order V, X, -\n let new_value = old_value - 1;\n if(new_value < 0) { new_value = 1};\n filter_dict[col_index] = [filter_tag, new_value];\n\n } else if ( [\"boolean\", \"toggle\", \"toggle_2\", \"toggle_3\"].includes(filter_tag)) {\n // //filter_dict = [ [\"boolean\", \"1\"] ];\n // toggle value \"0\" / \"1\" when boolean\n let arr = (filter_dict && filter_dict[col_index]) ? filter_dict[col_index] : null;\n const value = (arr && arr[1] ) ? arr[1] : \"0\";\n let new_value = \"0\";\n if ( [\"boolean\", \"toggle\", \"toggle_2\"].includes(filter_tag)) {\n new_value = (value === \"0\") ? \"1\" : \"0\";\n } else if ( [\"inactive\", \"activated\", ].includes(filter_tag)) {\n new_value = (value === \"0\") ? \"1\" : (value === \"1\") ? \"2\" : \"0\";\n }\n if (!new_value){\n if (filter_dict[col_index]){\n delete filter_dict[col_index];\n }\n } else {\n filter_dict[col_index] = [filter_tag, new_value]\n }\n } else {\n let filter_dict_value = (filter_dict && filter_dict[col_index]) ? filter_dict[col_index] : \"\";\n let el_value_str = (el.value) ? el.value.toString() : \"\";\n let filter_text = el_value_str.trim().toLowerCase();\n if (!filter_text){\n if (filter_dict_value){\n delete filter_dict[col_index];\n }\n } else if (filter_text !== filter_dict_value) {\n // filter text is already trimmed and lowercase\n if(filter_text === \"#\"){\n mode = \"blanks_only\";\n } else if(filter_text === \"@\" || filter_text === \"!\"){\n mode = \"no_blanks\";\n } else if (filter_tag === \"text\") {\n // employee/rosterdate and order columns, no special mode on these columns\n filter_value = filter_text;\n } else if (filter_tag === \"number\") {\n // lt and gt sign must be followed by number. Skip filter when only lt or gt sign is entered\n if ( [\">\", \">=\", \"<\", \"<=\"].includes(filter_text) ) {\n skip_filter = true;\n }\n if(!skip_filter) {\n const first_two_char = filter_text.slice(0, 2);\n const remainder = filter_text.slice(2);\n mode = (first_two_char === \"<=\" && remainder) ? \"lte\" : (first_two_char === \">=\" && remainder) ? \"gte\" : \"\";\n if (!mode){\n const first_char = filter_text.charAt(0);\n const remainder = filter_text.slice(1);\n mode = (first_char === \"<\" && remainder) ? \"lt\" : (first_char === \">\" && remainder) ? \"gt\" : \"\";\n }\n // remove \"<\" , \"<=\", \">\" or \">=\" from filter_text\n let filter_str = ([\"lte\", \"gte\"].includes(mode)) ? filter_text.slice(2) :\n ([\"lt\", \"gt\"].includes(mode)) ? filter_text.slice(1) : filter_text;\n filter_value = 0;\n const value_number = Number(filter_str.replace(/\\,/g,\".\"));\n filter_value = (value_number) ? value_number : null;\n\n //console.log( \"filter_tag \", filter_tag);\n //console.log( \"filter_str \", filter_str);\n //console.log( \"value_number \", value_number);\n\n }\n }; // other\n if (!skip_filter) {\n filter_dict[col_index] = [filter_tag, filter_value, mode]\n };\n }\n }\n //console.log( \"filter_dict \", filter_dict);\n return skip_filter;\n } // t_SetExtendedFilterDict", "title": "" }, { "docid": "77971fa81a2a4568a8f05fc594cb573a", "score": "0.5063867", "text": "function myFunction4() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"shape\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[4];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "title": "" }, { "docid": "fd5556c7da0f2e05cf1c04229acfc990", "score": "0.50618005", "text": "function autoHighlightColumns(){\n // Show/hide columns based on the active tab type (from localStorage)\n const activeTabId = store.get('dashboard').activeTab;\n const columns = store.get('dashboard-filters')[activeTabId].columns;\n let columnId;\n\n // Reset any previously selected columns (from a different tab group)\n [...document.querySelectorAll('.ui-filters__toggle')].forEach((toggleElem) => {\n toggleElem.classList.remove('ui-filters__toggle--disabled');\n });\n\n // Now toggle the state of the columns related to the active tab\n [...document.querySelectorAll('.ui-filters__toggle')].forEach((toggleElem) => {\n columnId = toggleElem.getAttribute('data-column-id');\n\n if(!columns.includes(columnId)){\n toggleElem.classList.add('ui-filters__toggle--disabled');\n }\n });\n\n sendLog('[dashboard/ui-filters.js](autoHighlightColumns)');\n }", "title": "" }, { "docid": "aeb12d1c886c176e629e3c93563e0a53", "score": "0.5031737", "text": "function filter_table()\n{ var flag=0;\n var input = document.getElementById(\"search_table\");\n var upper_case = input.value.toUpperCase();\n var tables = document.getElementsByClassName(\"filter\");\n var block = document.getElementsByClassName(\"table\");\n document.getElementById(\"alert1\").style.display = \"none\";\n for (i = 0; i < tables.length; i++) {\n if (tables[i]) {\n if (tables[i].innerHTML.toUpperCase().indexOf(upper_case) > -1) {\n block[i].style.display = \"\";\n flag=1;\n } else {\n block[i].style.display = \"none\";\n }\n } \n }\n if(flag===0)\n {\n document.getElementById(\"alert1\").style.display = \"\";\n }\n\n}", "title": "" }, { "docid": "ee545852f2493aa66e14ff953974ecc0", "score": "0.5023562", "text": "function col_prof_details(col_ix) {\n\n var s = '';\n var s2 = '';\n var ix;\n\n if(ds.columns[col_ix].types.length == 1) {\n switch(ds.columns[col_ix].types[0].type) {\n // Numeric type\n case 'numeric':\n s = '<div class=\"row\">' +\n '<div class=\"col-4\">' +\n '<table id=\"col-num-stats-\"' + col_ix + '\" class=\"table table-borderless table-condensed table-hover\">' +\n '<tbody id=\"col-num-stats-tbody-' + col_ix + '\">' +\n '<tr><td class=\"caption\" style=\"width:25%\">Mean:</td><td>' + ds.columns[col_ix].sum_stats.mean.toFixed(2).toLocaleString('en') + '</td><td class=\"caption\" style=\"width:25%\">Mode:</td><td></td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">SD:</td><td>' + ds.columns[col_ix].sum_stats.sd.toFixed(2).toLocaleString('en') + '</td><td class=\"caption\" style=\"width:25%\">MAD:</td><td></td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">Min:</td><td>' + ds.columns[col_ix].sum_stats.min.toFixed(2).toLocaleString('en') + '</td><td class=\"caption\" style=\"width:25%\">Q1:</td><td>' + ds.columns[col_ix].sum_stats.q1.toFixed(2).toLocaleString('en') + '</td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">Max:</td><td>' + ds.columns[col_ix].sum_stats.max.toFixed(2).toLocaleString('en') + '</td><td class=\"caption\" style=\"width:25%\">Q2:</td><td>' + ds.columns[col_ix].sum_stats.q2.toFixed(2).toLocaleString('en') + '</td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">Range:</td><td>' + ds.columns[col_ix].sum_stats.range.toFixed(2).toLocaleString('en') + '</td><td class=\"caption\" style=\"width:25%\">Q3:</td><td>' + ds.columns[col_ix].sum_stats.q3.toFixed(2).toLocaleString('en') + '</td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">Unique values:</td><td>' + ds.columns[col_ix].sum_stats.values.length.toLocaleString('en') + ' (' + ((ds.columns[col_ix].sum_stats.values.length / ds.row_num) * 100).toFixed(2) + '%)</td><td class=\"caption\" style=\"width:25%\"></td><td></td></tr>' +\n '</tbody>' +\n '</table>' +\n '</div>' +\n '<div class=\"col-8\" id=\"chart-col-' + col_ix + '\">' +\n '<p class=\"caption\"><i class=\"fa fa-spinner fa-spin\"></i> Building charts</p>' +\n '</div>' +\n '</div>';\n return s;\n break;\n\n // Date-time type\n case 'date-time':\n for(ix = 0; ix < ds.columns[col_ix].sum_stats.values.length; ix++) {\n s2 += '<tr class=\"data-type-' + infer_data_type_class(ds.columns[col_ix].sum_stats.values[ix].value) + '\">' + \n '<td style=\"width:60%\">' + ds.columns[col_ix].sum_stats.values[ix].value + '</td>' +\n '<td style=\"width:40%\">' + ds.columns[col_ix].sum_stats.values[ix].delta +' </td>' +\n '</tr>';\n }\n s = '<div class=\"row\">' +\n '<div class=\"col-4\">' +\n '<table id=\"col-num-stats-\"' + col_ix + '\" class=\"table table-borderless table-condensed table-hover\">' +\n '<tbody id=\"col-num-stats-tbody-' + col_ix + '\">' +\n '<tr><td class=\"caption\" style=\"width:25%\">Start:</td><td>' + ds.columns[col_ix].sum_stats.start + '</td><td class=\"caption\" style=\"width:25%\"></td><td></td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">End:</td><td>' + ds.columns[col_ix].sum_stats.end + '</td><td class=\"caption\" style=\"width:25%\"></td><td></td></tr>' +\n '<tr><td class=\"caption\" style=\"width:25%\">Interval:</td><td>' + col_intervals_sum(col_ix, true) + '</td><td class=\"caption\" style=\"width:25%\"></td><td></td></tr>' +\n //'<tr><td class=\"caption\" style=\"width:25%\">Unique values:</td><td>' + ds.columns[col_ix].sum_stats.values.length.toLocaleString('en') + ' (' + ((ds.columns[col_ix].sum_stats.values.length / ds.row_num) * 100).toFixed(2) + '%)</td><td class=\"caption\" style=\"width:25%\"></td><td></td></tr>' +\n '</tbody>' +\n '</table>' +\n '</div>' +\n '<div class=\"col-4\">' +\n '<p><span class=\"caption\">Unique values: </span>' + ds.columns[col_ix].sum_stats.values.length.toLocaleString('en') + ' (' + ((ds.columns[col_ix].sum_stats.values.length / ds.row_num) * 100).toFixed(2) + '%)</p>' +\n '<table id=\"col-num-stats-2-\"' + col_ix + '\" class=\"table table-borderless table-condensed table-hover table-col-prof-det\">' +\n '<thead id=\"col-num-stats-2-head-' + col_ix + '\">' +\n '<tr>' +\n '<th style=\"width:60%\">Value</th>' +\n '<th style=\"width:40%\">Interval</th>' +\n '</tr>' +\n '</thead>' +\n '<tbody id=\"col-num-stats-2-tbody-' + col_ix + '\">'+ s2 + '</tbody>' +\n '</table>' +\n '</div>' +\n '<div class=\"col-4\"></div>' +\n '</div>';\n return s;\n break;\n\n // Other types\n default:\n return s;\n break;\n }\n } else {\n for(ix = 0; ix < ds.columns[col_ix].sum_stats.values.length; ix++) {\n s2 += '<tr class=\"data-type-' + infer_data_type_class(ds.columns[col_ix].sum_stats.values[ix].value) + '\">' + \n '<td style=\"width:60%\">' + ds.columns[col_ix].sum_stats.values[ix].value + '</td>' +\n //'<td style=\"width:60%\">' + infer_data_type(ds.columns[col_ix].sum_stats.values[ix].value) + '</td>' +\n '<td style=\"width:40%\">' + ds.columns[col_ix].sum_stats.values[ix].count.toLocaleString('en') + ' (' + ((ds.columns[col_ix].sum_stats.values[ix].count / ds.row_num) * 100).toFixed(2) + '%)</td>' +\n '</tr>';\n }\n s = '<div class=\"row\">' +\n '<div class=\"col-4\">' +\n '<p><span class=\"caption\">Unique values: </span>' + ds.columns[col_ix].sum_stats.values.length.toLocaleString('en') + ' (' + ((ds.columns[col_ix].sum_stats.values.length / ds.row_num) * 100).toFixed(2) + '%)</p>' +\n '<table id=\"col-num-stats-\"' + col_ix + '\" class=\"table table-borderless table-condensed table-hover table-col-prof-det\">' +\n '<thead id=\"col-num-stats-head-' + col_ix + '\">' +\n '<tr>' +\n '<th style=\"width:60%\">Value</th>' +\n '<th style=\"width:40%\">Count</th>' +\n '</tr>' +\n '</thead>' +\n '<tbody id=\"col-num-stats-tbody-' + col_ix + '\">'+ s2 + '</tbody>' +\n '</table>' +\n '</div>' +\n '<div class=\"col-8\"></div>' +\n '</div>';\n return s;\n }\n}", "title": "" }, { "docid": "001c03d54dc09eb9775c86e527b8ac1c", "score": "0.5018929", "text": "function myFunction() {\n var input, filter, table, tr, td, i;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"main-content\");\n tr = table.getElementsByTagName(\"div\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"span\")[0];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n }\n }\n}", "title": "" }, { "docid": "e561a3bdc206d3a67b79939850ecfdc9", "score": "0.5017237", "text": "function updateFilterHeader() {\n\n var statusDescriptions = getCheckboxDescriptions(\"graduationStatus\", false);\n var certLevelDescriptions = getCheckboxDescriptions(\"certificationLevels\", true);\n var gradLevelDescriptions = getGradLevelDescriptions();\n var sectionDescriptions = getSectionDescriptions();\n\n var newText = statusDescriptions + \" \" + certLevelDescriptions + \" \" + sectionDescriptions + \" \" + gradLevelDescriptions;\n\n if(newText.trim() == 'students students'){\n newText = 'Students';\n }\n\n $(\"#picklist-fancy-filter_filters-title-text\").text(\"Filters: \" + newText);\n}", "title": "" }, { "docid": "9178cd56cd82f99425bc68bf3ac574a5", "score": "0.50161713", "text": "function generateFilterHtmlForAxisList ( xtab , hdr )\n{\n var html = \"\";\n \n for (var n = 0; n < hdr.layer.length; n++) {\n html += \"<div class=\\\"cf_dim\\\" onclick=\\\"showFilterLayer(this,\" + hdr.layer[n].dimndx + \")\\\">\";\n html += xtab.dimension[hdr.layer[n].dimndx].disp;\n html += \"</div>\\n\" \n }\n return html;\n}", "title": "" }, { "docid": "7648c23315841ecced7d8a262e4fa2d7", "score": "0.5013047", "text": "function filter(d){\n // Prevent default(submit) behavior of the filter button\n d.preventDefault();\n\n // Reference to input search terms\n const searchDate = document.getElementById('datetime').value;\n const searchCity = document.getElementById('city').value.toLowerCase();\n const searchState = document.getElementById('state').value.toLowerCase();\n const searchCountry = document.getElementById('country').value.toLowerCase();\n // Get selected value in dropdown list\n //https://stackoverflow.com/a/1085810\n const s = document.getElementById('shape');\n const searchShape = s.options[s.selectedIndex].text.toLowerCase();\n\n // Loop through table rows\n tbodyRows.forEach(tbodyRow => {\n // Declare column variables in each row\n let ufoDate = tbodyRow.children[0].textContent;\n let ufoCity = tbodyRow.children[1].textContent;\n let ufoState = tbodyRow.children[2].textContent;\n let ufoCountry = tbodyRow.children[3].textContent;\n let ufoShape = tbodyRow.children[4].textContent;\n\n // Declare boolean values for empty search terms. default true\n let dateFilter = true;\n let cityFilter = true;\n let stateFilter = true;\n let countryFilter = true;\n let shapeFilter = true;\n\n // Check whether search term exist and if it exists, match it with table row value and set it true or false accordingly.\n if (searchDate != '') {\n //console.log(`${searchDate}:${ufoDate}`);\n dateFilter = searchDate == ufoDate ? true:false;\n //console.log(dateFilter);\n }\n if (searchCity != '') {\n cityFilter = searchCity == ufoCity;\n }\n if (searchState != '') {\n stateFilter = searchState == ufoState;\n }\n if (searchCountry != '') {\n countryFilter = searchCountry == ufoCountry;\n }\n if (searchShape != 'choose...') { // 'choose...' is a placeholder\n shapeFilter = searchShape == ufoShape;\n }\n\n // Hide those with false boolean values\n if (dateFilter && cityFilter && stateFilter && countryFilter && shapeFilter) {\n tbodyRow.style.display = 'table-row';\n } else {\n tbodyRow.style.display = \"none\";\n }\n\n });\n}", "title": "" }, { "docid": "452ece62da3be3b7fdd7f9f285f6fc7f", "score": "0.5003222", "text": "function col_title(col_ix) {\n\n // Column name\n var s = '<span class=\"col-name\">' + ds.columns[col_ix].name + '</span>';\n\n // Data ml type\n s += '<p class=\"data-table-header-info\">' + col_ml_type(col_ix) + '</p>';\n\n // Nulls values\n s += '<p class=\"data-table-header-info\">' + col_nulls(col_ix) + ' Nulls</p>';\n\n // Data types\n if(ds.columns[col_ix].types.length == 1) {\n s += '<p class=\"data-table-header-info\"><i class=\"fa fa-check\" style=\"color:green\"></i> Homogeneous type</p>' +\n '<p style=\"margin-left:15px\" class=\"data-table-header-info data-type-' + ds.columns[col_ix].types[0].type + '\">'+\n ds.columns[col_ix].types[0].type + ' | ' + \n ds.columns[col_ix].types[0].subtype + \n '</p>';\n } else {\n s += '<p class=\"data-table-header-info\"><i class=\"fa fa-exclamation-triangle\" style=\"color:orange\"></i> Mixed types</p>';\n for(var col_type_ix = 0; col_type_ix < ds.columns[col_ix].types.length; col_type_ix++) {\n s += '<p style=\"margin-left:15px\" class=\"data-table-header-info data-type-' + ds.columns[col_ix].types[col_type_ix].type + '\">' +\n ds.columns[col_ix].types[col_type_ix].type + ' | ' + \n ds.columns[col_ix].types[col_type_ix].subtype + \n '</p>';\n } \n }\n\n // Interval info for date-time columns\n if(ds.columns[col_ix].types.length == 1 && ds.columns[col_ix].types[0].type == 'date-time') {\n if(ds.columns[col_ix].sum_stats.intervals.length == 2) {\n s += '<p class=\"data-table-header-info\"><i class=\"fa fa-check\" style=\"color:green\"></i> Unique interval</p>';\n } else {\n s += '<p class=\"data-table-header-info\"><i class=\"fa fa-exclamation-triangle\" style=\"color:orange\"></i> ' + \n ds.columns[col_ix].sum_stats.intervals.length + ' different intervals';\n }\n }\n\n return s;\n}", "title": "" }, { "docid": "6757fa62aa3185b8ab100a976d3b0f33", "score": "0.4976897", "text": "function GroupCommonFields(d) {\n var newData = [];\n // EditHistory FirstNotification ImageDataInfo SecondNotification GUID\n var result = $.grep(d, function (i) { return (i.tableName == \"CirData\" || i.tableName == \"ComponentInspectionReport\" || i.tableName == \"TurbineData\") });\n $.each(result, function (x, i) {\n if (i.columnName == \"Guid\") {\n }\n else {\n i.mainTableName = i.tableName;\n i.tableName = \"Common\";\n i.sortOrder = 0;\n newData.push(i);\n }\n });\n\n $.each(d, function (x, i) {\n if (i.tableName == \"Common\" ||\n i.tableName == \"EditHistory\" || i.tableName == \"FirstNotification\" || i.tableName == \"ImageDataInfo\" ||\n // i.tableName == \"ComponentInspectionReportSkiiPFailedComponent\" || i.tableName == \"ComponentInspectionReportSkiiPNewComponent\" ||\n i.tableName == \"SecondNotification\" || i.columnName == \"Guid\") {\n //if(i.tableName == \"Common\")\n //{\n // i.mainTableName = i.tableName;\n // i.tableName = \"Common\";\n //}\n }\n else {\n i.mainTableName = i.tableName;\n i.tableName = i.tableName.replace(\"ComponentInspectionReport\", \"\");\n if (i.tableName == \"SkiiPFailedComponent\") i.tableName = \"Skiipack\";\n if (i.tableName == \"SkiiPNewComponent\") i.tableName = \"Skiipack\";\n if (i.tableName == \"SkiiP\") i.tableName = \"Skiipack\";\n \n i.sortOrder = 1;\n newData.push(i);\n }\n });\n return newData;\n\n}", "title": "" }, { "docid": "285d5a420bbe9e74de58e0573bad70f8", "score": "0.4965499", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n //var filterData = people.filter(function(person) {\n // return person.datetime === inputValue;\n // });\n console.log(\"user input value\");\n console.log(inputValue);\n //var inlineFilter = tableData.filter(person =>person.datetime == inputValue);\n\n console.log(\"selTitle option chosen chosen value\");\n console.log(selTitle.property(\"value\"));\n\n var chosenVal = selTitle.property(\"value\");\n var inlineFilter = [];\n if (chosenVal == \"city\")\n inlineFilter = tableData.filter(person =>person.city.toUpperCase() == inputValue.toUpperCase());\n else if (chosenVal == \"state\")\n inlineFilter = tableData.filter(person =>person.state.toUpperCase() == inputValue.toUpperCase());\n else if (chosenVal == \"country\")\n inlineFilter = tableData.filter(person =>person.country.toUpperCase() == inputValue.toUpperCase());\n else if (chosenVal == \"shape\")\n inlineFilter = tableData.filter(person =>person.shape.toUpperCase() == inputValue.toUpperCase());\n else \n inlineFilter = tableData.filter(person =>person.datetime == inputValue);\n \n console.log(inlineFilter);\n\n var list = d3.select(\"tbody\");\n\n list.html(\"\");\n /*\n \n inlineFilter.forEach(([datetime, city, state, country, shape, durationMinutes, comments]) => {\n var rd = list.append(\"tr\");\n rd.append(\"td\").text(datetime);\n rd.append(\"td\").text(city);\n rd.append(\"td\").text(state);\n rd.append(\"td\").text(country);\n rd.append(\"td\").text(shape);\n rd.append(\"td\").text(durationMinutes);\n rd.append(\"td\").text(comments);\n});\n*/\n\nfor (i =0; i<inlineFilter.length; i++) {\n var rd = list.append(\"tr\");\n rd.append(\"td\").text(inlineFilter[i].datetime);\n rd.append(\"td\").text(inlineFilter[i].city);\n rd.append(\"td\").text(inlineFilter[i].state);\n rd.append(\"td\").text(inlineFilter[i].country);\n rd.append(\"td\").text(inlineFilter[i].shape);\n rd.append(\"td\").text(inlineFilter[i].durationMinutes);\n rd.append(\"td\").text(inlineFilter[i].comments);\n\n}\n\n // Set the span tag in the h1 element to the text\n // that was entered in the form\n //d3.select(\"h1>span\").text(inputValue);\n\n}", "title": "" }, { "docid": "8aace5ce06041818171584157d3862f8", "score": "0.4958961", "text": "function myFunction2() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"state\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[2];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "title": "" }, { "docid": "bff0868898ca72c6d125fbbc91cb1f82", "score": "0.49541515", "text": "function filter_manager_function() {\n $(\"table tbody tr\").hide(); //hide all rows\n\n var positionFlag = 0;\n var positionValue = $(\"#position_filter\").val();\n var homelandFlag = 0;\n var homelandValue = $(\"#homeland_filter\").val();\n\n //setting intial values and flags needed\n\n //traversing each row one by one\n $(\"table tr\").each(function () {\n if (positionValue == 0) {\n //if no value then display row\n positionFlag = 1;\n } else if (positionValue == $(this).find(\"td.position\").data(\"position\")) {\n positionFlag = 1; //if value is same display row\n } else {\n positionFlag = 0;\n }\n\n if (homelandValue == 0) {\n homelandFlag = 1;\n } else if (homelandValue == $(this).find(\"td.homeland\").data(\"homeland\")) {\n homelandFlag = 1;\n } else {\n homelandFlag = 0;\n }\n\n if (positionFlag && homelandFlag) {\n $(this).show(); //displaying row which satisfies all conditions\n }\n });\n}", "title": "" }, { "docid": "f7933c24993bf9acdb03f0b3cb900627", "score": "0.49534318", "text": "function renderColumnFilter(col, status, colname) {\n str = \"<div>\";\n if (status) {\n str += \"<input id='\" + colname + \"_\" + col + \"' type='checkbox' checked onchange='myTable.toggleColumn(\\\"\" + col + \"\\\")'>\"\n str += \"<label for='\" + colname + \"_\" + col + \"'>\" + colname + \"</label>\";\n } else {\n str += \"<input id='\" + colname + \"_\" + col + \"' type='checkbox' onchange='myTable.toggleColumn(\\\"\" + col + \"\\\")'>\"\n str += \"<label for='\" + colname + \"_\" + col + \"'>\" + colname + \"</label>\";\n }\n str += \"</div>\";\n\n return str;\n}", "title": "" }, { "docid": "de8162da5172751f0c7d987255cc9f92", "score": "0.4952153", "text": "function flc_comp_search(elem)\n{\n\tvar searchStr = jQuery(elem).val().toLowerCase();\n\tvar callerTable = jQuery(elem).parent().parent().parent().parent().parent().parent().parent().parent();\n\n\tif(searchStr == '')\n\t{\n\t\tjQuery(callerTable).parent().find('[name=\"restorePagingButton\"]').click();\n\n\t\t//get all tr\n\t\tvar tr = jQuery(callerTable).find('tr');\n\n\t\tfor(var x=3; x < tr.length; x++)\n\t\t{\n\t\t\tvar td = jQuery(tr[x]).find('td');\n\t\t\tjQuery(td[0]).css('color','#000000');\n\n\t\t\tjQuery(tr[x]).show();\n\t\t}\n\t}\n\telse\n\t{\n\t\tjQuery(callerTable).parent().find('[name=\"showAllButton\"]').click();\n\n\t\t//get all tr\n\t\tvar tr = jQuery(callerTable).find('tr');\n\n\t\tfor(var x=3; x < tr.length; x++)\n\t\t{\n\t\t\tvar td = jQuery(tr[x]).find('td');\n\t\t\tvar tdLength = td.length;\n\t\t\tvar trShowFlag = false;\n\n\t\t\tfor(var y=0; y < tdLength; y++)\n\t\t\t{\n\t\t\t\t//if first column, the running no\n\t\t\t\tif(y==0)\n\t\t\t\t\tjQuery(td[0]).css('color','#e0e0e0');\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(jQuery(td[y]).html().toLowerCase().indexOf(searchStr) != -1)\n\t\t\t\t\t\ttrShowFlag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(trShowFlag === true)\n\t\t\t\tjQuery(tr[x]).show();\n\t\t\telse\n\t\t\t\tjQuery(tr[x]).hide();\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "f6a39ad638e143155ab93fda736a56b8", "score": "0.49371532", "text": "function filteredTable() {\n filteredData.forEach((filtered) => {\n var row = tbody.append(\"tr\");\n Object.entries(filtered).forEach(([key, value]) => {\n var cell = tbody.append(\"td\");\n cell.text(value);\n });\n });\n \n }", "title": "" }, { "docid": "56e53be6b2fa4a8087f42d39f6a6bfb1", "score": "0.4917554", "text": "function updateTooltipInfo() {\n land = selection.data()[0].properties.LAN_ew_GEN;\n cases = Math.round(getInzidenzForBL(land));\n\n for (let [key, value] of iterate_object(rulesAndMeasures)) {\n rulesAndMeasures[key] = selection.attr(\"\" + key);\n }\n}", "title": "" }, { "docid": "ff1e0049f86cb98b564ff01ffb5c4ea1", "score": "0.49164343", "text": "function update_filter(filter, trips) {\n console.log(filter);\n let filtered_trips = [];\n for (let i = 0, len = trips.length; i < len; i++) {\n let trip = trips[i];\n let has = true;\n Object.keys(filter).forEach(function (attribute) {\n if (filter[attribute].indexOf(trip[attribute]) < 0) {\n has = false;\n }\n });\n if (has) {\n filtered_trips.push(trip);\n }\n }\n\n //$('#dataview-summary').html(display_summary);\n\n // Draw map here\n vis_draw_histogram(filtered_trips);\n Object(_map__WEBPACK_IMPORTED_MODULE_1__[\"map_show_filtered_trips\"])(filtered_trips);\n vis_model_cases(filtered_trips, 'model-cases-body');\n\n return;\n }", "title": "" }, { "docid": "7306b9a9e4cd5d96a6568ae611aa42ff", "score": "0.49159732", "text": "showTable (title, dataList, colTransforms, filter, sorter) {\n\t\tconst {$modal} = UiUtil.getShowModal({\n\t\t\tisWidth100: true,\n\t\t\tisHeight100: true,\n\t\t\tisUncappedWidth: true,\n\t\t\tisUncappedHeight: true,\n\t\t\tisEmpty: true,\n\t\t});\n\n\t\tconst $pnlControl = $(`<div class=\"split my-3\"/>`).appendTo($modal);\n\t\tconst $pnlCols = $(`<div class=\"flex\" style=\"align-items: center;\"/>`).appendTo($pnlControl);\n\t\tObject.values(colTransforms).forEach((c, i) => {\n\t\t\tconst $wrpCb = $(`<label class=\"flex-${c.flex || 1} px-2 mr-2 no-wrap flex-inline-v-center\"><span class=\"mr-2\">${c.name}</span></label>`).appendTo($pnlCols);\n\t\t\tconst $cbToggle = $(`<input type=\"checkbox\" data-name=\"${c.name}\" ${c.unchecked ? \"\" : \"checked\"}>`)\n\t\t\t\t.click(() => {\n\t\t\t\t\tconst toToggle = $modal.find(`.col_${i}`);\n\t\t\t\t\tif ($cbToggle.prop(\"checked\")) {\n\t\t\t\t\t\ttoToggle.show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoToggle.hide();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.appendTo($wrpCb);\n\t\t});\n\t\tconst $pnlBtns = $(`<div/>`).appendTo($pnlControl);\n\t\tfunction getAsCsv () {\n\t\t\tconst headers = $pnlCols.find(`input:checked`).map((i, e) => $(e).data(\"name\")).get();\n\t\t\tconst rows = $modal.find(`.data-row`).map((i, e) => $(e)).get().map($e => {\n\t\t\t\treturn $e.children().filter(`td:visible`).map((j, d) => $(d).text().trim()).get();\n\t\t\t});\n\t\t\treturn DataUtil.getCsv(headers, rows);\n\t\t}\n\t\tconst $btnCsv = $(`<button class=\"btn btn-primary mr-3\">Download CSV</button>`).click(() => {\n\t\t\tDataUtil.userDownloadText(`${title}.csv`, getAsCsv());\n\t\t}).appendTo($pnlBtns);\n\t\tconst $btnCopy = $(`<button class=\"btn btn-primary\">Copy CSV to Clipboard</button>`).click(async () => {\n\t\t\tawait MiscUtil.pCopyTextToClipboard(getAsCsv());\n\t\t\tJqueryUtil.showCopiedEffect($btnCopy);\n\t\t}).appendTo($pnlBtns);\n\t\t$modal.append(`<hr class=\"hr-1\">`);\n\n\t\tif (typeof filter === \"object\" && filter.generator) filter = filter.generator();\n\n\t\tlet stack = `<div class=\"overflow-y-auto w-100 h-100 flex-col\"><table class=\"table-striped stats stats--book stats--book-large\" style=\"width: 100%;\"><thead><tr>${Object.values(colTransforms).map((c, i) => `<th class=\"col_${i} px-2\" colspan=\"${c.flex || 1}\" style=\"${c.unchecked ? \"display: none;\" : \"\"}\">${c.name}</th>`).join(\"\")}</tr></thead><tbody>`;\n\t\tconst listCopy = JSON.parse(JSON.stringify(dataList)).filter((it, i) => filter ? filter(i) : it);\n\t\tif (sorter) listCopy.sort(sorter);\n\t\tlistCopy.forEach(it => {\n\t\t\tstack += `<tr class=\"data-row\">`;\n\t\t\tstack += Object.keys(colTransforms).map((k, i) => {\n\t\t\t\tconst c = colTransforms[k];\n\t\t\t\treturn `<td class=\"col_${i} px-2\" colspan=\"${c.flex || 1}\" style=\"${c.unchecked ? \"display: none;\" : \"\"}\">${c.transform === true ? it[k] : c.transform(k[0] === \"_\" ? it : it[k])}</td>`;\n\t\t\t}).join(\"\");\n\t\t\tstack += `</tr>`;\n\t\t});\n\t\tstack += `</tbody></table></div>`;\n\t\t$modal.append(stack);\n\t}", "title": "" }, { "docid": "570127ebda945eea96ca9819896af945", "score": "0.49086595", "text": "function myFunction(event) {\n \n var input=document.getElementById(\"mysearch\");\n\n var filter=input.value.toLowerCase();\n // console.log(filter);\n var table=document.getElementById(\"tblrecord\");\n // console.log(table);\n var tr=table.getElementsByTagName(\"tr\");\n \n\n\n \n // console.log(tr);\n\n \n for (var i = 0; i < tr.length; i++) {\n\n var td=tr[i].getElementsByTagName(\"td\");\n if (event.which==8 && filter=='') {\n tr[i].style.display=\"\";\n }\n else if (event.which==13 || event.type==\"click\" || event.type==\"change\" ) {\n // debugger;\n if (event.type==\"change\") {\n // debugger;\n filter=role.toLowerCase();\n console.log(filter);\n } \n // console.log(td.length -1 );\n var TDLength=td.length;\n // console.log(TDLength);\n //newtd=TD-1;\n if(tr[i].parentNode.nodeName!='THEAD'){\n tr[i].style.display=\"none\";\n }\n\n if (td) {\n // debugger;\n for (var j = 0; j < TDLength; j++) {\n var updatedtd=td[j];\n console.log(filter);\n // debugger;\n if (updatedtd.innerHTML.toLowerCase().indexOf(filter)>-1) {\n// debugger;\n console.log(filter);\n updatedtd.parentElement.style.display=\"\";\n \n }\n\n }\n\n }\n\n }\n\n }\n }", "title": "" }, { "docid": "c8160af131083f2c08d9c8984621252a", "score": "0.4894049", "text": "function filterData() {\n top.frames['obo'].document.getElementById('myObo').innerHTML = \"\";\n var records = myDataTable.getRecordSet().getRecords();\n var recordsShown = 0;\n\n var filtersAmount = top.frames['controls'].document.getElementById(\"filtersAmount\").options[top.frames['controls'].document.getElementById(\"filtersAmount\").selectedIndex].value;\t\n\t\t\t\t\t\t\t\t\t\t// the amount of filters chosen\n for (var i = 0; i < records.length; i++) {\t\t\t\t\t// for each record (table row)\n var recordIndex = myDataTable.getRecordIndex(records[i]);\n var show = 0;\t\t\t\t\t\t\t\t// show is an integer to compare to amount of filters\n for (var filterCount = 1; filterCount <= filtersAmount; filterCount++) {\t// for each filter\n var filterTypeId = 'filterType' + filterCount;\n var filterValueId = 'filterValue' + filterCount;\n filterType = top.frames['controls'].document.getElementById(filterTypeId).value;\n filterValue = top.frames['controls'].document.getElementById(filterValueId).value;\n queryValue = filterValue.toLowerCase();\n var filterTypes = [];\t\t\t\t\t\t\t// field types to filter for\n if (filterType !== \"all\") { filterTypes.push(filterType); }\t\t// just one type\n else { filterTypes = myFields; }\t\t\t\t\t// all the fields \n for (var j in filterTypes) {\t\t\t\t\t\t// for each filterType (all or a specific one)\n if (records[i].getData(filterTypes[j]) === null) { top.frames['obo'].document.getElementById('myObo').innerHTML += \"ERROR null value in recordIndex : \" + recordIndex + \" \" + i + \" \" + j + \" \" + filterTypes[j] + \" <br/> \"; }\t\n\t\t\t\t\t\t\t\t\t\t// give error message if a record value is null\n var recordCellData = records[i].getData(filterTypes[j]).toLowerCase();\n if ((new RegExp(queryValue)).test(recordCellData)) { show++; break; }\t// found a match, this filter passes and should show, no need to look at all other data in record cells. this allows regular expressions to work for ^ and $\n// if (recordCellData.indexOf(queryValue) !== -1) { show++; break; }\t// found a match, this filter passes and should show, no need to look at all other data in record cells\n } // for (var j in filterTypes)\n } // for (var filterCount = 1; filterCount <= filtersAmount; filterCount++)\n if (show >= filtersAmount) { recordsShown++; myDataTable.getTrEl(recordIndex).style.display = \"\"; }\n else { myDataTable.getTrEl(recordIndex).style.display = \"none\"; }\n } // for (var i = 0; i < records.length; i++)\n top.frames['obo'].document.getElementById('myObo').innerHTML += recordsShown + \" records match.<br/> \";\n}", "title": "" }, { "docid": "081a34b73c9f59e121a9aa2a2004e2fd", "score": "0.4890726", "text": "function handleSearchButtonClick() {\n console.log(document.getElementById(\"mySelect\").value.trim().toLowerCase());\n\n var filterType = document.getElementById(\"mySelect\").value.trim().toLowerCase();\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterText = $filterInput.value.trim().toLowerCase();\n\n if (filterType === \"datetime\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function (data) {\n var dataDatetime = data.datetime.toLowerCase();\n\n // If true, add the address to the filteredAddresses, otherwise don't add it to filteredAddresses\n return dataDatetime === filterText;\n });\n }\n\n if (filterType === \"city\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function (data) {\n var dataCity = data.city.toLowerCase();\n\n // If true, add the address to the filteredAddresses, otherwise don't add it to filteredAddresses\n return dataCity === filterText;\n });\n }\n\n if (filterType === \"state\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function (data) {\n var dataState = data.state.toLowerCase();\n\n // If true, add the address to the filteredAddresses, otherwise don't add it to filteredAddresses\n return dataState === filterText;\n });\n }\n\n if (filterType === \"country\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function (data) {\n var dataCountry = data.country.toLowerCase();\n\n // If true, add the address to the filteredAddresses, otherwise don't add it to filteredAddresses\n return dataCountry === filterText;\n });\n }\n\n if (filterType === \"shape\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function (data) {\n var dataShape = data.shape.toLowerCase();\n // If true, add the address to the filteredAddresses, otherwise don't add it to filteredAddresses\n return dataShape === filterText;\n });\n }\n\n if (filterType === \"all\") {\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet\n }\n\n renderTable();\n}", "title": "" }, { "docid": "d074aff91a54c20cf5c7b5489a0e231e", "score": "0.4888541", "text": "@action defaultFilter(row) {\n const { filter } = this;\n let show = true;\n const qnodeIds = this.getQNodeIds();\n qnodeIds.forEach((qnodeId) => {\n row._original[qnodeId].forEach((knode) => {\n if (knode.id && !filter[qnodeId][knode.id]) {\n show = false;\n return show;\n }\n });\n });\n return show;\n }", "title": "" }, { "docid": "3d1d605c09b11f768b99791a7b5f0a3d", "score": "0.4871804", "text": "function HandleFilterStatus(el_input) {\n console.log( \"===== HandleFilterStatus ========= \");\n console.log( \"el_input\", el_input);\n\n // - get col_index from el_input\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n // because data-colindex goes wrong with hidden columns\n // was: const col_index = get_attr_from_el(el_input, \"data-colindex\")\n const col_index = el_input.parentNode.cellIndex;\n\n // - get filter_tag from el_input\n const filter_tag = get_attr_from_el(el_input, \"data-filtertag\")\n const field_name = get_attr_from_el(el_input, \"data-field\")\n console.log( \" col_index\", col_index);\n console.log( \" field_name\", field_name);\n console.log( \" filter_dict\", filter_dict);\n\n // - get current value of filter from filter_dict, set to '0' if filter doesn't exist yet\n const filter_array = (col_index in filter_dict) ? filter_dict[col_index] : [];\n const filter_value = (filter_array[1]) ? filter_array[1] : 0;\n\n console.log( \"filter_array\", filter_array);\n console.log( \"filter_value\", filter_value);\n\n //let icon_class = \"diamond_3_4\", title = \"\";\n // default filter triple '0'; is show all, '1' is show not fully approved, '2' show fully approved / submitted '3' show blocked\n\n// - toggle filter value\n let value_int = (Number(filter_value)) ? Number(filter_value) : 0;\nconsole.log( \"......filter_value\", filter_value);\n value_int += 1;\n if (value_int > 8 ) { value_int = 0};\n\n // convert 0 to null, otherwise \"0\" will not filter correctly\n let new_value = (value_int) ? value_int.toString() : null;\n console.log( \"new_value\", new_value);\n\n// - get new icon_class\n// - get new icon_class\n const icon_class = (new_value === \"8\") ? \"diamond_1_4\" : // blocked - full red diamond\n (new_value === \"7\") ? \"diamond_0_4\" : // submitted - full blue diamond\n (new_value === \"6\") ? \"diamond_3_3\" : // all approved - full black diamond\n\n (new_value === \"5\") ? \"diamond_1_3\" : // not approved by second corrector\n\n (new_value === \"4\") ? \"diamond_2_3\" : // not approved by examiner\n (new_value === \"3\") ? \"diamond_3_1\" : // not approved by secretary\n (new_value === \"2\") ? \"diamond_3_2\" : // not approved by chairperson\n (new_value === \"1\") ? \"diamond_0_0\" : // none approved - outlined diamond\n \"tickmark_0_0\";\n const title = (new_value === \"8\") ? loc.grade_status[\"8\"] : // blocked - full red diamond\n (new_value === \"7\") ? loc.grade_status[\"7\"] : // submitted - full blue diamond\n (new_value === \"6\") ? loc.grade_status[\"6\"] : // all approved - full black diamond\n\n (new_value === \"5\") ? loc.grade_status[\"5\"] : // not approved by second corrector\n\n (new_value === \"4\") ? loc.grade_status[\"4\"] : // not approved by examiner\n (new_value === \"3\") ? loc.grade_status[\"3\"] : // not approved by secretary\n (new_value === \"2\") ? loc.grade_status[\"2\"] : // not approved by chairperson\n (new_value === \"1\") ? loc.grade_status[\"1\"] : // none approved - outlined diamond\n \"tickmark_0_0\";\n //icon_class = (new_value === 3) ? \"diamond_1_4\" : (new_value === 2) ? \"diamond_3_3\" : (new_value === 1) ? \"diamond_1_1\" : \"diamond_3_4\";\n //const title = (new_value === 3) ? loc.Show_blocked :\n //(new_value === 2) ? loc.Show_fully_approved : (new_value === 1) ?loc.Show_not_fully_approved : \"\";\n\n el_input.className = icon_class;\n el_input.title = title\n console.log( \"icon_class\", icon_class);\n\n// - put new filter value in filter_dict\n filter_dict[col_index] = [filter_tag, new_value]\n console.log( \"filter_dict\", filter_dict);\n\n t_Filter_TableRows(tblBody_datatable, filter_dict, selected, loc.Subject, loc.Subjects);\n\n }", "title": "" }, { "docid": "55a1eeca672123c35b62d9b22c68ba6f", "score": "0.48655948", "text": "function filterAupDisplay() {\n\n var selIndex = $('#vo_VoHeader_aup_type').val();\n\n switch (selIndex) {\n case 'File':\n $('#aup_url_block').hide();\n $('#vo_VoHeader_aupUrl').removeAttr(\"required\");\n\n $('#aup_text_block').hide();\n $('#vo_VoHeader_aupText').removeAttr(\"required\");\n\n $('#aup_file_block').show();\n $('#vo_VoHeader_aupFile_name').attr(\"required\",\"required\");\n\n break;\n case 'Url':\n $('#aup_text_block').hide();\n $('#vo_VoHeader_aupText').removeAttr(\"required\");\n\n $('#aup_file_block').hide();\n $('#vo_VoHeader_aupFile_name').removeAttr(\"required\");\n\n $('#aup_url_block').show();\n $('#vo_VoHeader_aupUrl').attr(\"required\",\"required\");\n\n break;\n case 'Text':\n $('#aup_url_block').hide();\n $('#vo_VoHeader_aupUrl').removeAttr(\"required\");\n\n $('#aup_file_block').hide();\n $('#vo_VoHeader_aupfile_name').removeAttr(\"required\");\n\n $('#aup_text_block').show();\n $('#vo_VoHeader_aupText').attr(\"required\",\"required\");\n if ( $('#vo_VoHeader_aupText').text() == '') {\n $('#vo_VoHeader_aupText').text(\n \"This Acceptable Use Policy applies to all members of [VoName] Virtual Organisation, \\n\" +\n \"hereafter referred to as the [VO], with reference to use of the EGI Infrastructure. \\n\" +\n \"The [owner body] owns and gives authority to this policy. \\n\" +\n \"Goal and description of the [VONAME] VO \\n\" +\n \"--------------------------------------------------------------------- \\n\" +\n \"[TO be completed] \\n\" +\n \"Members and Managers of the [VO] agree to be bound by the Acceptable Usage Rules, [VO] Security Policy and other relevant EGI Policies, and to use the Infrastructure only in the furtherance of the stated goal of the [VO].\"\n );\n }\n\n break;\n }\n}", "title": "" }, { "docid": "ad455e613c6399d71d888af528701267", "score": "0.4859907", "text": "function buildWinnersByAge(fishByAge, ageGroup, ageTable){\r\n\tvar unfilteredAgeGroup = [];\r\n\tfishByAge.forEach(function(currentValue){\r\n\t\tcurrentValue.forEach(function(cV2){\r\n\t\t\t// if(fishByAge.indexOf(currentValue) === 0){\r\n\t\t\t// \tcV2.species = 'Catfish';\r\n\t\t\t// }\r\n\t\t\t// if(fishByAge.indexOf(currentValue) === 1){\r\n\t\t\t// \tcV2.species = 'Crappie';\r\n\t\t\t// }\r\n\t\t\t// if(fishByAge.indexOf(currentValue) === 2){\r\n\t\t\t// \tcV2.species = 'Perch';\r\n\t\t\t// }\r\n\t\t\t// if(fishByAge.indexOf(currentValue) === 3){\r\n\t\t\t// \tcV2.species = 'Bluegill';\r\n\t\t\t// }\r\n\t\t\tageGroup.push(cV2);\r\n\t\t\tunfilteredAgeGroup.push(cV2);\r\n\t\t});\r\n\t})\r\n\t// ageGroup = unfilteredAgeGroup.filter(function(elem, pos){\r\n\t// \treturn unfilteredAgeGroup.indexOf(elem) == pos;\r\n\t// });\r\n\tconsole.log(ageGroup);\r\n\tvar s = '';\r\n\tageGroup.forEach(function(row) {\r\n\t\t\ts += \"<tr>\";\r\n\t\t\tfor(var field in row){\r\n\t\t\t\ts += \"<td>\" + row[field] + \"</td>\";\r\n\t\t\t}\r\n\t\t\ts += \"</tr>\";\r\n\t\t});\r\n\t\tdocument.querySelector(\"#Data\"+ ageTable).innerHTML = s;\r\n}", "title": "" }, { "docid": "05f37c2aa05c3b008b1dc29c97dcb939", "score": "0.4857504", "text": "function matchFilterProcess() {\r\n var isThereAnyFilter = true;\r\n var filteredList = []\r\n filteredList = matchList.filter((elem) => {\r\n return matchFilterPerformed(elem);\r\n })\r\n if (filteredList.length == 0) {\r\n isThereAnyFilter = false;\r\n matchFilterValues.forEach((e)=>{\r\n if(e != \"\"){\r\n isThereAnyFilter = true;\r\n }\r\n })\r\n }\r\n if (isThereAnyFilter) {\r\n displayMatchDetailsInTable(filteredList);\r\n }\r\n else {\r\n displayMatchDetailsInTable(matchList);\r\n }\r\n}", "title": "" }, { "docid": "882da49acd62ffdc47eddd116e5877cb", "score": "0.48552355", "text": "function HandleFilterSelect(el_input) {\n //console.log( \"===== HandleFilterSelect ========= \");\n //console.log( \"el_input\", el_input);\n\n // - get col_index and filter_tag from el_input\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n // because data-colindex goes wrong with hidden columns\n // was: const col_index = get_attr_from_el(el_input, \"data-colindex\")\n const col_index = el_input.parentNode.cellIndex;\n //console.log( \"col_index\", col_index);\n\n // - get filter_tag from el_input\n const filter_tag = get_attr_from_el(el_input, \"data-filtertag\")\n const field_name = get_attr_from_el(el_input, \"data-field\")\n //console.log( \"filter_tag\", filter_tag);\n //console.log( \"field_name\", field_name);\n\n // - get current value of filter from filter_dict, set to '0' if filter doesn't exist yet\n const filter_array = (col_index in filter_dict) ? filter_dict[col_index] : [];\n const filter_value = (filter_array[1]) ? filter_array[1] : \"0\";\n //console.log( \"filter_array\", filter_array);\n //console.log( \"filter_value\", field_name);\n\n let new_value = \"0\", html_str = null;\n\n // default filter triple '0'; is show all, '1' is show tickmark, '2' is show without tickmark\n// - toggle filter value\n new_value = (filter_value === \"1\") ? \"0\" : \"1\";\n// - set el_input.innerHTML\n el_input.innerHTML = (new_value === \"1\") ? \"&#9658;\" : null\n if (new_value === \"1\") {\n // set all visible students selected\n let filter_toggle_elements = tblBody_datatable.querySelectorAll(\"tr:not(.display_hide:not(.tsa_tr_selected)\");\n //console.log(\"filter_toggle_elements\", filter_toggle_elements);\n let count = 0;\n for (let i = 0, tr, el; tr = filter_toggle_elements[i]; i++) {\n tr.classList.add(cls_selected)\n el = tr.cells[0].children[0];\n if (el){ el.innerHTML = \"&#9658;\"};\n count += 1;\n }\n //console.log(\"made se;lected: count\", count);\n\n } else {\n // unselect all visible student\n // set all visible students selected\n //let filter_toggle_elements = tblBody_datatable.querySelectorAll(\"tr.tsa_tr_selected\");\n let filter_toggle_elements = tblBody_datatable.querySelectorAll(\"tr:not(.display_hide).tsa_tr_selected\");\n //console.log(\"filter_toggle_elements\", filter_toggle_elements);\n let count = 0;\n for (let i = 0, tr, el; tr = filter_toggle_elements[i]; i++) {\n tr.classList.remove(cls_selected)\n el = tr.cells[0].children[0];\n if (el){ el.innerHTML = null};\n count += 1;\n }\n //console.log(\"removed selected: count\", count);\n }\n // - put new filter value in filter_dict\n // filter_dict = { 0: ['select', '2'], 2: ['text', 'f', ''] }\n\n filter_dict[col_index] = [filter_tag, new_value]\n //console.log( \"filter_dict\", filter_dict);\n\n Filter_TableRows();\n\n }", "title": "" }, { "docid": "189a6e3a504b00f9c00ea8a0dde70c5e", "score": "0.48480195", "text": "function activateCrosstableFilter ( aDiv )\n{\n /*\n * Get the containing div and insert the filter HTML \n */\n\n var e = document.getElementById(aDiv)\n if (e == null) {\n throw \"div \" + aDiv + \" not found\"\n }\n e.innerHTML = generateFilterHtml(crosstable.Crosstable);\n\n /*\n * Position the containing div in the center of the browser window\n */\n\n e.style.zIndex = 4000;\n var f = document.getElementById(\"gho_client\");\n e.style.position = \"fixed\";\n// e.style.left = ((window.clientWidth - e.clientWidth)/2) + \"px\";\n// e.style.top = ((window.clientHeight - e.clientHeight)/2) + \"px\";\n e.style.left = (((window.innerWidth ||\n document.documentElement.clientWidth ||\n document.body.clientWidth) - e.clientWidth)/2) + \"px\";\n e.style.top = (((window.innerHeight ||\n document.documentElement.clientHeight ||\n document.body.clientHeight) - e.clientHeight)/2) + \"px\";\n e.style.display = \"none\";\n\n /*\n * Grab the first dimension in the filter list, select it and show the \n * corresponding set of codes that the user can select. Note that index is\n * 1 because the five we're interested in is actually the second one (the\n * first contains a title)\n */\n\n x = document.getElementById(\"cf_main\");\n y = x.getElementsByTagName(\"DIV\");\n showFilterLayer(y[1],crosstable.Crosstable.Horizontal.layer[0].dimndx);\n return;\n}", "title": "" }, { "docid": "83238ae7e3404ac18ab8ebecf61597f4", "score": "0.4840815", "text": "function filterDateWiseResult(grid_id) {\n var sfilter_grid = $(\"#\" + grid_id);\n sfilter_grid[0].triggerToolbar();\n}", "title": "" }, { "docid": "949538a112f68bdec93967d7a862d9e2", "score": "0.4838466", "text": "function annotateAndFilterSearchResults(data) {\n console.log(\"TGWF:search:ecosia:annotateAndFilterSearchResults\")\n\n $(\".result\").not('.card-relatedsearches .result').each(function () {\n var loc = getUrl($(this).find('a').first().attr('href'));\n\n if (data[loc]) {\n\n const greenlink = $(this).find('.TGWF').first()\n\n // replace with text, prepending our green/grey smiley\n greenlink.html(getResultNode(data[loc]))\n\n // add the tooltip to the link\n addToolTip(greenlink)\n }\n });\n}", "title": "" }, { "docid": "00d3365b46b0a89d007d29a695c54505", "score": "0.48368987", "text": "function filter() {\n\t\t\t\t// All non-blank filters will get placed here\n\t\t\t\tvar filters = new Object();\n\n\t\t\t\t// Loop through each filter\n\t\t\t\t$.each(options.filters, function(index, element) {\n\t\t\t\t\t// If this filter is not blank\n\t\t\t\t\tif ( $(element).val() !== '') {\n\t\t\t\t\t\t// Add to filters object\n\t\t\t\t\t\tfilters[index] = element;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Loop through each table row\n\t\t\t\t$(rows).each(function() {\n\t\t\t\t\tvar row = $(this);\n\t\t\t\t\tvar filters_count_matched = 0; // Count of matched filters within each table row\n\t\t\t\t\tvar filters_count = 0; // Count of all filters\n\t\t\t\t\t$(row).hide(); // Hide this current row\n\n\t\t\t\t\t// Loop through each filter\n\t\t\t\t\t$.each(filters, function(index, element) {\n\t\t\t\t\t\tvar text = $.trim( $(row).find('.' + index).text().toUpperCase() ); // Text from the table we want to match against\n\t\t\t\t\t\tvar filter = $.trim( $(element).val().toUpperCase() ); // User inputed filter text\n\t\t\t\t\t\tfilters_count++;\n\n\t\t\t\t\t\t// If the user inputed text is found in this table cell\n\t\t\t\t\t\tif (text.indexOf(filter) >= 0) {\n\t\t\t\t\t\t\tfilters_count_matched++; // Add +1 to our matched filters counter\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// If the number of filter matches is equal to the number of filters, show the row\n\t\t\t\t\tif (filters_count_matched == filters_count) {\n\t\t\t\t\t\t$(row).show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "37c702f83ff2e99a09434bd408a65f50", "score": "0.4834356", "text": "function col_name(col_ix) {\n\n return '<i class=\"fa fa-search\" style=\"cursor:pointer\" onclick=\"toggle_col_prof_details(' + col_ix + ')\" title=\"Show/hide profiling details\"></i>&nbsp;&nbsp;<span class=\"col-name\">' + ds.columns[col_ix].name + '</span>';\n}", "title": "" }, { "docid": "60463ea158e1199a40bd8572d39264d3", "score": "0.48342863", "text": "function filterList(){ \n var filterText = $(\"#filter\").val().toLowerCase();\n var name,content;\n $(\".snippet\").each(function(){\n name = $(this).text();\n content = snippets[name];\n var match = name.toLowerCase().indexOf(filterText) > -1 || \n content.toLowerCase().indexOf(filterText) > -1;\n if (match) $(this).show();\n else $(this).hide();\n });\n}", "title": "" }, { "docid": "2e8db26ba24bec8c8eacf9c2598f0536", "score": "0.48289394", "text": "function createRowFilters() {\n\t//show filter div\n\tdocument.getElementById(\"filter-row\").hidden=false;\n\t\n\tvar selectedRecords = getSelectedRecords();\n\tvar categorisedColumnsSet = getAllCategorisedValue();\n\t\n\t//for each categorical value in set build checkbox\n\tfor (const value of categorisedColumnsSet) {\n\t\tcreateCheckbox(value,\"categorical-filter\");\n\t}\n\t\n\t//build categorical filter div\n\tvar categoricalFilterDiv = document.getElementById('categorical-filter');\n\t\t\n\t\n\t//build numerical condition div\n\tvar numericalConditionDiv = document.getElementById('numerical-condition');\n\t\n\t//build numerical value div\n\tvar numericalValueDiv = document.getElementById('numerical-value');\n\tdocument.getElementById('numericalFilter').classList.remove(\"input\");\n\t\n}", "title": "" }, { "docid": "041afcc3344be23700f16e54b6782b0a", "score": "0.48206154", "text": "function displaySearchValue() {\n\n let inputValue = document.getElementById(\"inputGroup_nom\").value;\n\n trs.forEach((tr) => {\n filteredTrs = filteredTrs.map((tr) => {\n tr.style.display = 'table-row';\n if (inputValue) {\n if (tr.children[0].textContent.toLocaleLowerCase().includes(inputValue.toLocaleLowerCase())) {\n tr.style.display = 'table-row';\n } else {\n tr.style.display = 'none';\n }\n }\n return tr;\n });\n });\n}", "title": "" }, { "docid": "80afa14e89ad5478fed0cf2c8b4f1f9c", "score": "0.48177588", "text": "function t_Filter_TableRow_Extended(filter_dict, tblRow, data_inactive_field) {\n //console.log( \"===== t_Filter_TableRow_Extended\");\n //console.log( \"filter_dict\", filter_dict);\n //console.log( \"data_inactive_field\", data_inactive_field);\n // filter_dict = {2: [\"text\", \"r\", \"\"], 4: [\"text\", \"y\", \"\"] }\n // filter_row = [empty × 2, \"acu - rif\", empty, \"agata mm\"]\n\n // PR2020-11-20 from https://thecodebarbarian.com/for-vs-for-each-vs-for-in-vs-for-of-in-javascript\n // - With the other two constructs, forEach() and for/of, you get access to the array element itself.\n // With forEach() you can access the array index i, with for/of you cannot.\n // - for/in will include non-numeric properties. (Assign to a non-numeric property: arr.test = 'bad')\n // - Avoid using for/in over an array unless you're certain you mean to iterate over non-numeric keys and inherited keys.\n // - forEach() and for/in skip empty elements, also known as \"holes\" in the array, for and for/of do not.\n // - Generally, for/of is the most robust way to iterate over an array in JavaScript.\n // - It is more concise than a conventional for loop and doesn't have as many edge cases as for/in and forEach().\n\n // PR223-04-22 --- in userpage: put filter of column 1 (username in filterrow, because filter stays when tab btn changes PR223-04-22\n // doesnt work because index refers to diferent columns in different tabs. filter_dict must use fieldname instead of index\n // TODO use fieldnames in filterdict instead of index. Check if that is much slower, because you must get fieldname from attribute data-field\n\n\n let hide_row = false;\n\n// --- show all rows if filter_dict is empty - except for inactive ones\n if (tblRow){\n\n// --- PR2021-10-28 new way of filtering inactive rows: (for now: only used in mailbox - deleted)\n // - set filter inactive before other filters, inactive value is stored in tblRow, \"data-inactive\", skip when data_inactive_field is null\n // - filter_dict has key 'showinactive', value is integer.\n // values of showinactive are: '0'; is show all, '1' is show active only, '2' is show inactive only\n if (data_inactive_field){\n const filter_showinactive = (filter_dict && filter_dict.showinactive != null) ? filter_dict.showinactive : 1;\n const is_inactive = !!get_attr_from_el_int(tblRow, data_inactive_field);\n\n hide_row = (filter_showinactive === 1) ? (is_inactive) :\n (filter_showinactive === 2) ? (!is_inactive) : false;\n //console.log(\" filter_showinactive\", filter_showinactive)\n //console.log(\" is_inactive\", is_inactive)\n //console.log(\" >>> hide_row\", hide_row)\n };\n\n if (!hide_row && !isEmpty(filter_dict)){\n // --- loop through filter_dict key = index_str, value = filter_arr\n for (const [index_str, filter_arr] of Object.entries(filter_dict)) {\n\n // --- skip column if no filter on this column, also if hide_row is already true\n if(!hide_row && filter_arr){\n // filter text is already trimmed and lowercase\n const col_index = Number(index_str);\n const filter_tag = filter_arr[0];\n const filter_value = filter_arr[1];\n const filter_mode = filter_arr[2];\n\n const cell = tblRow.cells[col_index];\n //console.log(\" ===> cell\", cell);\n if(cell){\n const el = cell.children[0];\n if (el){\n const cell_value = get_attr_from_el(el, \"data-filter\")\n/*\n console.log(\" filter_tag\", filter_tag)\n console.log(\" filter_value\", filter_value, typeof filter_value)\n console.log(\" cell_value\", cell_value, typeof cell_value)\n*/\n if (filter_tag === \"grade_status\"){\n\n // PR2023-02-21 in page grades\n // filter_values are: '0'; is show all, 1: not approved, 2: auth1 approved, 3: auth2 approved, 4: auth1+2 approved, 5: submitted, TODO '6': tobedeleted '7': locked\n // filter_array = ['grade_status', '1']\n if (filter_value === \"1\") {\n hide_row = (cell_value && cell_value !== \"diamond_0_0\"); // none approved - outlined diamond\n } else if (filter_value === \"2\") { // filter_value === \"2\") ? \"diamond_3_2\" : // not approved by chairperson\n hide_row = ![\"diamond_0_0\", \"diamond_0_2\",\n \"diamond_1_0\", \"diamond_1_2\",\n \"diamond_2_0\", \"diamond_2_2\",\n \"diamond_3_0\", \"diamond_3_2\"].includes(cell_value);\n } else if (filter_value === \"3\") { // filter_value === \"3\": not approved by secretary\n hide_row = ![\"diamond_0_0\", \"diamond_0_1\",\n \"diamond_1_0\", \"diamond_1_1\",\n \"diamond_2_0\", \"diamond_2_1\",\n \"diamond_3_0\", \"diamond_3_1\"].includes(cell_value);\n } else if (filter_value === \"4\") { // filter_value === \"4\": // not approved by examiner\n hide_row = ![\"diamond_0_0\", \"diamond_0_1\", \"diamond_0_2\", \"diamond_0_3\",\n \"diamond_2_0\", \"diamond_2_1\", \"diamond_2_2\", \"diamond_2_3\"].includes(cell_value);\n\n } else if (filter_value === \"5\") { // filter_value === \"5\": // not approved by second corrector\n hide_row = ![\"diamond_0_0\", \"diamond_0_1\", \"diamond_0_2\", \"diamond_0_3\",\n \"diamond_1_0\", \"diamond_1_1\", \"diamond_1_2\", \"diamond_1_3\"].includes(cell_value);\n\n } else if (filter_value === \"6\") { // filter_value === \"6\": all approved - full black diamond\n hide_row = cell_value !== \"diamond_3_3\";\n\n } else if (filter_value === \"7\") { // filter_value === \"7\": // submitted - full blue diamond\n hide_row = cell_value !== \"diamond_0_4\"; // submitted - full blue diamond\n\n } else if (filter_value === \"8\") { // filter_value === \"8\": // blocked - full red diamond\n hide_row = cell_value !== \"diamond_1_4\";\n };\n\n } else if (filter_tag === \"status\"){\n // PR2023-02-21 in page studsubj\n // filter_values are: '0'; is show all, 1: not approved, 2: auth1 approved, 3: auth2 approved, 4: auth1+2 approved, 5: submitted, TODO '6': tobedeleted '7': locked\n\n // default filter status '0'; is show all, '1' is show tickmark, '2' is show without tickmark\n hide_row = (filter_value && Number(filter_value) !== Number(cell_value));\n\n } else if (filter_tag === \"toggle\"){\n // default filter toggle '0'; is show all, '1' is show tickmark, '2' is show without tickmark\n if (filter_value === \"2\"){\n // only show rows without tickmark\n if (cell_value === \"1\") { hide_row = true };\n } else if (filter_value === \"1\"){\n // only show rows with tickmark\n if (cell_value !== \"1\") { hide_row = true };\n };\n/*\n console.log(\"filter_tag\", filter_tag);\n console.log(\"filter_value\", filter_value, typeof filter_value);\n console.log(\"cell_value\", cell_value, typeof cell_value);\n console.log(\"hide_row\", hide_row);\n*/\n } else if(filter_tag === \"multitoggle\"){ // PR2021-08-21\n if (filter_value){\n hide_row = (cell_value !== filter_value);\n };\n } else if(filter_mode === \"blanks_only\"){ // # : show only blank cells\n if (cell_value) { hide_row = true };\n } else if(filter_mode === \"no_blanks\"){ // # : show only non-blank cells\n if (!cell_value) {hide_row = true};\n } else if( filter_tag === \"text\") {\n // hide row if filter_value not found or when cell is empty\n if (cell_value) {\n if (!cell_value.includes(filter_value)) { hide_row = true };\n } else {\n hide_row = true;\n };\n } else if( filter_tag === \"number\") {\n // numeric columns: make blank cells zero\n/*\n console.log( \"filter_value\", filter_value, typeof filter_value);\n console.log( \"Number(filter_value)\", Number(filter_value), typeof Number(filter_value));\n console.log( \"cell_value\", cell_value, typeof cell_value);\n console.log( \"Number(cell_value)\", Number(cell_value), typeof Number(cell_value));\n*/\n if(!Number(filter_value)) {\n // hide all rows when filter is not numeric\n hide_row = true;\n } else {\n const filter_number = Number(filter_value);\n const cell_number = (Number(cell_value)) ? Number(cell_value) : 0;\n //console.log( \"cell_number\", cell_number, typeof cell_number);\n if ( filter_mode === \"lte\") {\n if (cell_number > filter_number) {hide_row = true};\n } else if ( filter_mode === \"lt\") {\n if (cell_number >= filter_number) {hide_row = true};\n } else if (filter_mode === \"gte\") {\n if (cell_number < filter_number) {hide_row = true};\n } else if (filter_mode === \"gt\") {\n if (cell_number <= filter_number) {hide_row = true};\n } else {\n if (cell_number !== filter_number) {hide_row = true};\n }\n }\n\n } else if( filter_tag === \"status\") {\n\n // TODO\n if(filter_value === 1) {\n if(cell_value){\n // cell_value = \"status_1_5\", '_1_' means data_has_changed\n const arr = cell_value.split('_')\n hide_row = (arr[1] && arr[1] !== \"1\")\n }\n }\n }\n }\n }; // if(cell)\n }; // if(filter_arr)\n }; // for (const [index_str, filter_arr] of Object.entries(filter_dict))\n } // if (!isEmpty(filter_dict)\n } // if (tblRow)\n //console.log(\"hide_row\", hide_row);\n return !hide_row\n }", "title": "" }, { "docid": "ee3245e51398d20600c870fbd1ddf2ae", "score": "0.48108378", "text": "function cellFormatter(value, row, index, header) {\n var numbers = 1 + (index);\n $scope.selectedLocation = row.location_id;\n if (header.name === '#') return '<div class=\"text-center\" style=\"width:43px;height:23px!important;\" >' +\n '<span class=\"text-info text-capitalize\">' + numbers + '</span></div>';\n\n return ['<a class=\"clickLink\"',\n 'title=\" \" data-toggle=\"tooltip\"',\n 'data-placement=\"top\"',\n 'href=\"javascript:void(0)\" >' + value + '</a>'\n ].join('');\n }", "title": "" }, { "docid": "16ef4d8e0fe1cd3c773eece4139b855f", "score": "0.47991273", "text": "function details_table(objid,theme) {\n if (theme === undefined) theme = 'logdetails table-bordered';\n\n obj = window.resultjson.hits.hits[objid];\n obj_fields = get_object_fields(obj);\n str = \"<table class='\"+theme+\"'>\" +\n \"<tr><th>Field</th><th>Action</th><th>Value</th></tr>\";\n\n var field = '';\n var field_id = '';\n var value = '';\n var orig = '';\n var buttons = '';\n\n var i = 1;\n for (index in obj_fields) {\n field = obj_fields[index];\n field_id = field.replace('@', 'ATSYM');\n value = get_field_value(obj,field);\n buttons = \"<i class='jlink icon-large icon-search' id=findthis_\"+objid+\"_\"+field_id+\"></i> \" +\n \"<i class='jlink icon-large icon-ban-circle' id=notthis_\"+objid+\"_\"+field_id+\"></i> \";\n\n if (isNaN(value)) {\n try {\n var json = JSON.parse(value);\n value = JSON.stringify(json,null,4);\n buttons = \"\";\n } catch(e) {\n }\n }\n\n trclass = (i % 2 == 0) ? 'class=alt' : '';\n str += \"<tr \" + trclass + \">\" +\n \"<td class='firsttd \" + field_id + \"_field'>\" + field + \"</td>\" +\n \"<td style='width: 60px'>\" + buttons + \"</td>\" +\n '<td>' + xmlEnt(wbr(value, 10)) + \"<span style='display:none'>\" +\n xmlEnt(value) + \"</span>\" +\n \"</td></tr>\";\n i++;\n\n $(\"body\").delegate(\n \"#findthis_\"+objid+\"_\"+field_id, \"click\", function (objid) {\n mSearch(\n $(this).parents().eq(1).find('.firsttd').text(),\n $(this).parents().eq(1).find('span').text()\n );\n });\n\n $(\"body\").delegate(\n \"#notthis_\"+objid+\"_\"+field_id, \"click\", function (objid) {\n mSearch(\n \"NOT \" + $(this).parents().eq(1).find('.firsttd').text(),\n $(this).parents().eq(1).find('span').text()\n );\n });\n\n }\n str += \"</table>\";\n return str;\n}", "title": "" }, { "docid": "144adf0f2fd8ddd95170ea8d5deb4309", "score": "0.4792306", "text": "function searchLists(e) {\n if (searchType === 'name'){\n let filter = this.value.toUpperCase()\n Array.from(document.querySelector('.list').children).forEach(el => {\n let txtValue = el.children[1].children[0].textContent || el.children[1].children[0].innerHTML\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n el.style.display = \"\";\n } else {\n el.style.display = \"none\";\n }\n })\n } else if (searchType === 'country-based'){\n let filter = this.value.toUpperCase()\n Array.from(document.querySelector('.list').children).forEach(el => {\n let txtValue = el.children[1].children[3].textContent || el.children[1].children[3].innerHTML\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n el.style.display = \"\";\n } else {\n el.style.display = \"none\";\n }\n })\n } else if (searchType === 'country-helped'){\n let filter = this.value.toUpperCase()\n Array.from(document.querySelector('.list').children).forEach(el => {\n let txtValue = el.children[1].children[4].textContent || el.children[1].children[4].innerHTML\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n el.style.display = \"\";\n } else {\n el.style.display = \"none\";\n }\n })\n \n }\n}", "title": "" }, { "docid": "71dabb91df853e0529401fcaae9072e4", "score": "0.47917497", "text": "handleKeyUp(evt) {\n \tthis.clearStartDate();\n this.clearEndDate();\n this.clearValue();\n\n \tthis.queryTerm = evt.target.value;\n \tlet tableData = this.casedata,\n term = this.queryTerm,\n results = tableData, regex;\n try {\n regex = new RegExp(term, \"i\");\n // filter checks each row, constructs new array where function returns true\n results = tableData.filter(\n \trow => \n\t \tregex.test(row.title) ||\n\t \tregex.test(row.case_number.toString()) ||\n\t \tregex.test(row.opened_date.toString()) ||\n\t \tregex.test(row.status) ||\n\t \tregex.test(row.system) ||\n\t \tregex.test(row.product) ||\n\t \tregex.test(row.contract) ||\n\t \tregex.test(row.ticket_priority) ||\n\t \tregex.test(row.plant_part)\n );\n } catch(e) {\n \tconsole.error(\"error while searching\");\n console.log(e);\n }\n this.filteredData = results;\n }", "title": "" }, { "docid": "e280ebebcb9cb717f85adae0d1b1c5dc", "score": "0.47897148", "text": "function HandleFilterKeyup(el, event) {\n //console.log( \"===== HandleFilterKeyup ========= \");\n // skip filter if filter value has not changed, update variable filter_text\n\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n // because data-colindex goes wrong with hidden columns\n // was: const col_index = get_attr_from_el(el_input, \"data-colindex\")\n const col_index = el.parentNode.cellIndex;\n //console.log( \"col_index\", col_index, \"event.key\", event.key);\n\n const skip_filter = t_SetExtendedFilterDict(el, col_index, filter_dict, event.key);\n //console.log( \"filter_dict\", filter_dict);\n\n if (!skip_filter) {\n t_Filter_TableRows(tblBody_datatable, filter_dict, selected, loc.Subject, loc.Subjects);\n }\n }", "title": "" }, { "docid": "a32fda7dde9b8273a3a969f15bf8414c", "score": "0.4781226", "text": "function t_ShowTableRow(tblRow, tblName, filter_dict, filter_show_inactive, has_ppk_filter, selected_ppk) { // PR2019-09-15\n //console.log( \"===== t_ShowTableRow ========= \", tblName);\n //console.log(\"filter_show_inactive\", filter_show_inactive);\n //console.log(\"tblRow\", tblRow);\n\n // function filters by inactive and substring of fields\n // also filters selected customer pk in table order\n // - iterates through cells of tblRow\n // - skips filter of new row (new row is always visible) -> 'data-addnew' = 'true'\n // - filters on parent-pk -> 'data-ppk' = selected_ppk\n // - if filter_name is not null:\n // - checks tblRow.cells[i].children[0], gets value, in case of select element: data-value\n // - returns show_row = true when filter_name found in value\n // filters on blank when filter_text = \"#\"\n // - if col_inactive has value >= 0 and hide_inactive = true:\n // - checks -> 'data-inactive' = 'true'\n // - hides row if inactive = true\n // gets value of :\n // when tag = 'select': value = selectedIndex.text\n // when tag = 'input': value = el.value\n // else: (excl tag = 'a'): value = el.innerText\n // when not found: value = 'data-value'\n let hide_row = false;\n if (tblRow){\n\n// 1. skip new row\n // check if row is_addnew_row. This is the case when pk is a string ('new_3'). Not all search tables have \"id\" (select customer has no id in tblrow)\n const is_addnew_row = (get_attr_from_el(tblRow, \"data-addnew\") === \"true\");\n if(!is_addnew_row){\n\n // show only rows of selected_ppk, only if selected_ppk has value\n if(has_ppk_filter){\n if(!selected_ppk){\n hide_row = true;\n } else {\n const ppk_str = get_attr_from_el(tblRow, \"data-ppk\")\n //console.log(\"ppk_str\", ppk_str);\n if(!ppk_str){\n hide_row = true;\n } else if (ppk_str !== selected_ppk.toString()) {\n hide_row = true;\n }\n }\n }\n //console.log( \"hide_row after selected_ppk: \", has_ppk_filter, selected_ppk, hide_row);\n\n// hide inactive rows if filter_show_inactive\n //console.log(\"filter_show_inactive\", filter_show_inactive);\n if(!hide_row && !filter_show_inactive){\n const inactive_str = get_attr_from_el(tblRow, \"data-inactive\")\n //console.log(\"inactive_str\", inactive_str);\n if (inactive_str && (inactive_str.toLowerCase() === \"true\")) {\n hide_row = true;\n }\n }\n //console.log( \"hide_row after filter_show_inactive: \", hide_row);\n\n// show all rows if filter_name = \"\"\n //console.log(\"filter_dict\", filter_dict);\n if (!hide_row && !isEmpty(filter_dict)){\n //Object.keys(filter_dict).forEach(function(key) {\n for (const [key, value] of Object.entries(filter_dict)) {\n // key = col_index\n // filter_dict is either a dict of lists ( when created by t_SetExtendedFilterDict)\n // filter_dict[col_index] = [filter_tag, filter_value, mode] modes are: 'blanks_only', 'no_blanks', 'lte', 'gte', 'lt', 'gt'\n // otherwise filter_dict is a dict of strings\n const filter_text = (Array.isArray(value)) ? value[1] : value;\n\n //console.log(\"key\", key);\n //console.log(\"filter_text\", filter_text);\n const filter_blank = (filter_text === \"#\")\n const filter_non_blank = (filter_text === \"@\")\n let tbl_cell = tblRow.cells[key];\n if (tbl_cell){\n let el = tbl_cell.children[0];\n if (el) {\n // skip if no filter on this colums\n if(filter_text){\n // get value from el.value, innerText or data-value\n const el_tagName = el.tagName.toLowerCase()\n //console.log(\"el_tagName\", el_tagName);\n let el_value = null;\n if (el_tagName === \"select\"){\n el_value = el.options[el.selectedIndex].innerText;\n } else if (el_tagName === \"input\"){\n el_value = el.value;\n } else if (el_tagName === \"a\"){\n // skip\n } else {\n el_value = el.innerText;\n }\n if (!el_value){el_value = get_attr_from_el(el, \"data-value\")}\n //console.log(\"el_value\", el_value);\n\n // PR2020-06-13 debug: don't use: \"hide_row = (!el_value)\", once hide_row = true it must stay like that\n if (filter_blank){\n if (el_value){hide_row = true};\n } else if (filter_non_blank){\n if (!el_value){hide_row = true};\n } else if (!el_value){\n hide_row = true;\n } else {\n const el_value_lc = el_value.toLowerCase() ;\n //console.log(\"el_value_lc\", el_value_lc);\n // hide row if filter_text not found\n if (!el_value_lc.includes(filter_text)) {hide_row = true};\n }\n } // if(!!filter_text)\n } // if (!!el) {\n } // if (!!tbl_cell){\n }; // Object.keys(filter_dict).forEach(function(key) {\n } // if (!hide_row)\n //console.log( \"hide_row after filter_dict: \", hide_row);\n } // if(!is_addnew_row){\n } // if (!!tblRow)\n return !hide_row\n }", "title": "" }, { "docid": "b9098fcaa3c242f487ef10c58858a6a9", "score": "0.47809973", "text": "function adjustGridItems( filterBy ) {\n $('.work__container section').each(function(index, value) {\n\n $(this).removeClass( 'filterByThis' );\n\n var role = $(this).data( 'role' );\n var match = $( '.work__container section[data-role*=' + filterBy + ']' );\n\n match.addClass( 'filterByThis' );\n\n });\n }", "title": "" }, { "docid": "d07223b9583c075353d770a9dc3828d3", "score": "0.47800812", "text": "function filterGeneralCode () {\n \t\tjq('#customerList').DataTable().search(\n \t\tjq('#customerList_filter').val()\n \t\t).draw();\n }", "title": "" }, { "docid": "b514c203f2b3e2bed0b2886b9555c032", "score": "0.4778991", "text": "function filteredDataFunction(userChoice){\n switch (userChoice) {\n case \"dateFilter\":\n\n var userInput = $filterInput.value;\n // trim and lower case the users city input\n var filterDate = userInput;\n // filter the data with cities\n filteredData = dataSet.filter(function(choice)\n {\n var dataDate = choice.datetime;\n return dataDate === filterDate;\n }); \n break;\n case \"cityFilter\":\n var userInput = $filterInput.value;\n // trim and lower case the users city input\n var filterCity = userInput.trim().toLowerCase();\n // filter the data with cities\n filteredData = dataSet.filter(function(choice)\n {\n var dataCity = choice.city.toLowerCase();\n return dataCity === filterCity;\n });\n break;\n\n case \"stateFilter\":\n var userInput = $filterInput.value;\n // trim and lower case the users city input\n var filterState = userInput.trim().toLowerCase();\n // filter the data with cities\n filteredData = dataSet.filter(function(choice)\n {\n var dataState = choice.state.toLowerCase();\n return dataState === filterState;\n });\n break;\n \n case \"countryFilter\":\n var userInput = $filterInput.value;\n // trim and lower case the users city input\n var filterCountry = userInput.trim().toLowerCase();\n // filter the data with cities\n filteredData = dataSet.filter(function(choice)\n {\n var dataCountry = choice.country.toLowerCase();\n return dataCountry === filterCountry;\n });\n break;\n \n case \"shapeFilter\":\n var userInput = $filterInput.value;\n // trim and lower case the users city input\n var filterShape = userInput.trim().toLowerCase();\n // filter the data with cities\n filteredData = dataSet.filter(function(choice)\n {\n var dataShape = choice.shape.toLowerCase();\n return dataShape === filterShape;\n });\n break;\n \n case \"resetFilter\":\n location.reload();\n\n break;\n \n } \n}", "title": "" }, { "docid": "f280090e541cbb11864f8fad33df2819", "score": "0.47768268", "text": "function filterData() {\n\n // get the date value for the filter\n var dateValue = filterDatetime.property('value');\n var cityValue = filterCity.property('value');\n var stateValue = filterState.property('value');\n var countryValue = filterCountry.property('value');\n var shapeValue = filterShape.property('value');\n\n var bolFilter = false;\n var filteredData = tableData;\n\n // if the filter is not empty, proceed\n if (dateValue != '') {\n \n // create a filtered dataset, matching on date\n filteredData = filteredData.filter(ufo => ufo.datetime === dateValue);\n bolFilter = true;\n \n } \n \n // city\n if (cityValue != '') {\n\n // create a filtered dataset, matching on date\n filteredData = filteredData.filter(ufo => ufo.city === cityValue);\n bolFilter = true;\n\n } \n \n // state filter\n if (stateValue != '') {\n\n filteredData = filteredData.filter(ufo => ufo.state === stateValue);\n bolFilter = true;\n }\n\n // country\n if (countryValue != '') {\n\n filteredData = filteredData.filter(ufo => ufo.country === countryValue);\n bolFilter = true;\n\n }\n\n // shapes\n if (shapeValue != '') {\n\n filteredData = filteredData.filter(ufo => ufo.shape === shapeValue);\n bolFilter = true;\n\n }\n // if any of the filters were used, create the table from the filter data set\n if (bolFilter) {\n \n // render the table with the filtered data\n renderTable(filteredData);\n\n } else {\n \n // render table with original data\n renderTable(tableData);\n\n }\n}", "title": "" }, { "docid": "29f7b04a8708da680b7d1d7fa2750248", "score": "0.47762972", "text": "insertWidgetStatistic(filter) {\n var self = this;\n var rows = '';\n var statsArr = self.widgetStatistic.rows;\n var len = statsArr.length;\n\n for (var i = 0; i < len; i++) {\n var item = statsArr[i];\n var date = message.formatDate(item.time);\n var percentage = 0;\n \n if(filter){\n switch (filter) {\n case 'views':\n percentage = (+item.views * 100) / +self.widgetStatistic.maxViews;\n break;\n case 'viewsUnique':\n percentage = (+item.viewsUnique * 100) / +self.widgetStatistic.maxViewsUnique;\n break;\n case 'clicks':\n percentage = (+item.clicks * 100) / +self.widgetStatistic.maxClicks;\n break;\n case 'clicksUnique':\n percentage = (+item.clicksUnique * 100) / +self.widgetStatistic.maxClicksUnique;\n break;\n case 'requests':\n percentage = (+item.requests * 100) / +self.widgetStatistic.maxRequests;\n break;\n case 'ctr':\n percentage = (+item.ctr * 100) / +self.widgetStatistic.maxCtr;\n }\n }\n\n rows +=\n '<div class=\"body-row\">\\\n <div class=\"row-content-part\">\\\n <div class=\"left-content-info\">\\\n <div class=\"table-row-item company-name\" data-time=\"' + item.time + '\">' + date.day + '</div>\\\n </div>\\\n <div class=\"right-content-fill\">\\\n <div class=\"filler\" style=\"width: '+ percentage +'%\"></div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n '+ svg.requests +'\\\n </div>\\\n <div class=\"item-number\">' + +item.requests + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.eye + '\\\n </div>\\\n <div class=\"item-number views\">' + +item.views + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.aim + '\\\n </div>\\\n <div class=\"item-number\">' + +item.viewsUnique + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.pointerArrow + '\\\n </div>\\\n <div class=\"item-number\">' + +item.clicks + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.pointerArrowInCircle + '\\\n </div>\\\n <div class=\"item-number\">' + +item.clicksUnique + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.pointerFinger + '\\\n </div>\\\n <div class=\"item-number ctr\">' + +item.ctr + '</div>\\\n </div>\\\n <div class=\"table-row-item\">\\\n <div class=\"item-ico\">\\\n ' + svg.coinSmall + '\\\n </div>\\\n <div class=\"item-number price\">0</div>\\\n </div>\\\n </div>\\\n </div>\\\n </div>';\n }\n\n $('#banner-table').html(rows);\n }", "title": "" }, { "docid": "fdabee0ab23706341bee5ffa94e935f2", "score": "0.47710767", "text": "function indiaFilter() {\n\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"indiainput\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"indiaTable\");\n tr = table.getElementsByTagName(\"tr\");\n\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "title": "" }, { "docid": "2f09fcf48d78087c8b147b771e16445e", "score": "0.47696194", "text": "function rs(event){\n console.log(event.target.value);\n var filtered = data.filter(correctData);\n setSourceData(filtered);\n console.log('new data', sourceData);\n if(event.target.value == \"\" || event.target.value == undefined){\n setSourceData(data);\n console.log(\"redefined\", sourceData);\n }\n function correctData(data, eq) {\n console.log(filterSelected);\n if(filterSelected == \"name\"){\n console.log(event.target.value.toLowerCase());\n return data.terminalName.toLowerCase().includes(event.target.value.toLowerCase());\n }\n else if(filterSelected == \"sitecode\"){\n console.log(\"code\");\n return data.code.toLowerCase().includes(event.target.value.toLowerCase());\n \n }\n else if(filterSelected == \"city\"){\n console.log(\"city\");\n return data.city.toLowerCase().includes(event.target.value.toLowerCase());\n \n }\n else if(filterSelected == \"country\"){\n console.log(\"country\");\n return data.country.toLowerCase().includes(event.target.value.toLowerCase());\n \n }\n else if(filterSelected == \"region\"){\n console.log(\"region\");\n return data.region.toLowerCase().includes(event.target.value.toLowerCase());\n \n }\n \n }\n \n }", "title": "" }, { "docid": "b523827ef0968958a0fc06dbe740b04b", "score": "0.4763734", "text": "function run_switch_case(row, declared_variable){\n return answer[row].includes(declared_variable.toLowerCase());\n\n}", "title": "" }, { "docid": "3ec899b90e58a75e8b9d331a1916d0c6", "score": "0.47636458", "text": "function HandleFilterKeyup(el, event) {\n //console.log( \"===== HandleFilterKeyup ========= \");\n // skip filter if filter value has not changed, update variable filter_text\n\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n // because data-colindex goes wrong with hidden columns\n // was: const col_index = get_attr_from_el(el_input, \"data-colindex\")\n const col_index = el.parentNode.cellIndex;\n //console.log( \"col_index\", col_index, \"event.key\", event.key);\n\n const skip_filter = t_SetExtendedFilterDict(el, col_index, filter_dict, event.key);\n //console.log( \"filter_dict\", filter_dict);\n\n if (!skip_filter) {\n Filter_TableRows();\n }\n }", "title": "" }, { "docid": "86eee415a2177fe6b2fc73181f4632b7", "score": "0.47608665", "text": "function getSourceDataInternal(filter, cols, whereExtra, options) {\r\n const collName = filter.type === 'actions' ? columnNames.actionFlag : columnNames._1;\r\n if (!options) { // init config objects.\r\n options = {};\r\n }\r\n const deferred = $q.defer();\r\n const config = {};\r\n config.nonEmpty = true;\r\n config.FROM = `[${CognosService.getMainCubeName()}]`;\r\n config.COLUMNS = cols;\r\n config.parent = false;\r\n config.isRevenue = true;\r\n config.headers = { 'X-IBP-cache': '1 hour' };\r\n\r\n config.WHERE = [\r\n `[${dimentions.timeQuarters}].[${filter.quarter}]`,\r\n `[${dimentions.timeYears}].[${filter.year}]`,\r\n `[${dimentions.approvals}].[${filter.node}]`,\r\n ];\r\n if (whereExtra) {\r\n config.WHERE.push(whereExtra);\r\n }\r\n\r\n if (filter.viewLevel === 'details') {\r\n config.WHERE.push(`[${dimentions.accounts}].[${filter.account}]`);\r\n }\r\n\r\n if (filter.serviceLine == serviceLines.activeSL) {\r\n config.ROWS = `filter(CROSSJOIN([${dimentions.serviceLines}].[${filter.serviceLine}],` +\r\n `{[${dimentions.accounts}].[${filter.account}]}),` +\r\n `([${CognosService.getMainCubeName()}].(` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])>=1 ) )`;\r\n } else {\r\n config.ROWS = `filter(` +\r\n `{[${dimentions.accounts}].[${filter.account}]},` +\r\n `([${CognosService.getMainCubeName()}].(` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])>=1 ) )`;\r\n config.WHERE.push(`[${dimentions.serviceLines}].[${filter.serviceLine}]`);\r\n }\r\n\r\n\r\n config.successCallback = (data) => {\r\n const options = {\r\n hierarchies: true,\r\n cellHierarchies: true,\r\n };\r\n const processedData = CognosResponseService.processJSON(data, options);\r\n updateSourceDataSetNames(processedData);\r\n if (filter.serviceLine != serviceLines.activeSL) {\r\n addSlFromFilter(processedData, filter);\r\n }\r\n if (filter.viewLevel === 'account') {\r\n addAcountLevelExtras(processedData, filter);\r\n }\r\n deferred.resolve(processedData.data);\r\n };\r\n config.errorCallback = deferred.reject;\r\n\r\n if (CognosService.CognosConfigService.prop.COV_ID_FLAG === true) {\r\n config.ROWS = 'FILTER(nonempty( ';\r\n if (filter.serviceLine === serviceLines.activeSL) {\r\n config.ROWS += `nonempty([${dimentions.serviceLines}].[${filter.serviceLine}], ` +\r\n '{(' +\r\n `[${dimentions.timeYears}].[${filter.year}],` +\r\n `[${dimentions.timeQuarters}].[${filter.quarter}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])})` +\r\n ' * ';\r\n }\r\n // Extra where with SL was added in top code.\r\n config.ROWS +=\r\n `nonempty({TM1FILTERBYLEVEL({TM1DRILLDOWNMEMBER({[${dimentions.approvals}].[${filter.node}]}, ALL , RECURSIVE)},0)},` +\r\n '{(' +\r\n `[${dimentions.timeYears}].[${filter.year}],` +\r\n `[${dimentions.timeQuarters}].[${filter.quarter}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.serviceLines}].[${serviceLines.totalServiceLines}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])})`;\r\n if (filter.serviceLine === serviceLines.activeSL) {\r\n config.ROWS +=\r\n ` * nonempty({TM1FILTERBYLEVEL( {TM1SUBSETALL( [${dimentions.accounts}] )}, 0)},` + // CROSSJOIN here\r\n '{(' +\r\n `[${dimentions.timeYears}].[${filter.year}],` +\r\n `[${dimentions.timeQuarters}].[${filter.quarter}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.serviceLines}].[${serviceLines.totalServiceLines}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])}), `;\r\n } else {\r\n config.ROWS +=\r\n `, {[${dimentions.accounts}].[${filter.account}]}, `;\r\n }\r\n config.ROWS +=\r\n '{(' +\r\n `[${dimentions.timeYears}].[${filter.year}],` +\r\n `[${dimentions.timeQuarters}].[${filter.quarter}],` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.riskCategories}].[${filter.riskCategory}],` +\r\n `[${dimentions.measures}].[${collName}])}) ` +\r\n ',' +\r\n `([${CognosService.getMainCubeName()}].(` +\r\n `[${dimentions.timeWeeks}].[${filter.week}],` +\r\n `[${dimentions.versions}].[${filter.version}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])>=1 ) ) `;\r\n }\r\n if (filter.viewLevel === 'account') { // Account Level. This is posiible in Account RDM ONLY\r\n config.ROWS = `${'nonempty(' +\r\n '{TM1SORT({FILTER({TM1SUBSETALL( ['}${dimentions.accounts}] )}, [${dimentions.accounts}].[Is Account] = ${getIsAccountFlag()})}, ASC)}, ` +\r\n '{(' +\r\n `[${dimentions.timeYears}].[${filter.year}],` +\r\n `[${dimentions.timeQuarters}].[${filter.quarter}],` +\r\n `[${dimentions.riskCategories}].[${riskCategories.bestCanDo}],` +\r\n `[${dimentions.measures}].[${collName}])})`;\r\n }\r\n config.WHERE = CognosService.addRoadmapItemTypeConditionIfRequired(config.WHERE);\r\n if (utilsService.isPreviousQuarter(filter.year, filter.quarter)) utilsService.addCacheHeader(config, '1 day');\r\n CognosService.mdxQueryInSandbox(config, filter.sandbox, config.successCallback, config.errorCallback);\r\n return deferred.promise;\r\n\r\n function updateSourceDataSetNames(processedData) {\r\n const setAliases = [];\r\n processedData.data.forEach((line) => {\r\n line.sourceData = {};\r\n processedData.columns._setAliases.forEach((set, index) => {\r\n let mapping = setAliases[index];\r\n if (!mapping) {\r\n mapping = getSourceDataOjtName(line[set + '_props']);\r\n setAliases[index] = mapping;\r\n }\r\n line.sourceData[mapping] = line[set];\r\n delete line[set];\r\n delete line[set + '_props'];\r\n });\r\n });\r\n processedData.columns._setAliases = setAliases;\r\n }\r\n function getSourceDataOjtName(props) {\r\n if (!props) {\r\n throw new Error('Invalid properties obj');\r\n }\r\n let ret = '';\r\n const riskCategoryId = options.exposeRiskCat === true ? filter.riskCategory.replace(/ +/g, '') : '';\r\n props.forEach((el) => {\r\n ret += el.Name.replace(/ +/g, '').replace('check', 'Check').replace('ClosingWk', 'CurrentWeek');\r\n })\r\n return ret + riskCategoryId;\r\n }\r\n }", "title": "" }, { "docid": "b9d9224130e06f39281adb39eba62764", "score": "0.47560918", "text": "function displayElementInfo(numbers, where) {\n // sanity check\n if(numbers.length === 0 || Math.max.apply(Math, numbers) > 118 || Math.max.apply(Math, numbers) < 1) {\n where.html(\"\"); // clear table\n return;\n }\n\n var table = $('<table></table>');\n var tbody = $('<tbody></tbody>')\n .append($('<tr></tr>')\n .addClass('header-row')\n .append($('<th></th>').html('Property'))\n .append($('<th></th>')\n .html('Value')\n .prop('colspan', numbers.length)\n )\n );\n\n var properties = [];\n var elementGroups = [];\n\n for(n in numbers) {\n var elementType = $('#e' + numbers[n]).prop('class').split(' ', 2)[1];\n elementGroups.push(elementType);\n\n $('#e' + numbers[n]).children('.data').children('input[data-label]').each(function() {\n if(properties.indexOf($(this).data('label')) === -1) // ensure uniqueness\n properties.push($(this).data('label'));\n });\n }\n\n for(p in properties) {\n var row = $('<tr></tr>');\n var tdLabel = $('<th></th>').html(properties[p]);\n\n row.append(tdLabel);\n\n for(n in numbers) {\n var tdData = $('<td></td>', {\n class: elementGroups[n]\n });\n var data = $('#e' + numbers[n]).children('.data');\n\n if(data.children('input[data-label=\"' + properties[p] + '\"]').length) {\n tdData.html(data.children('input[data-label=\"' + properties[p] + '\"]').val());\n }\n else {\n tdData.html('--');\n }\n\n row.append(tdData);\n }\n\n tbody.append(row);\n }\n\n // add column styles\n /*\n var colgroup = $('<colgroup></colgroup>').append($('<col />')); // add initial column\n for(e in elementGroups) {\n var className = elementGroups[e];\n var col = $('<col />')\n .addClass(className);\n colgroup.append(col);\n }\n\n table.append(colgroup);\n */\n\n table.append(tbody);\n where.html(table);\n}", "title": "" }, { "docid": "b83870bc2c119759a1de59c928a70f49", "score": "0.4753929", "text": "function runListShow() {\n $(\"table.js-dataTooltip.tableList > tbody > tr\").each(function(){\n var tr = $(this);\n var title = getListShowTitle(tr);\n var author = getListShowAuthor(tr);\n\n var onSearchSuccess = function(url, linkHtml) {\n // show it below the overdrive section\n $(linkHtml + \"<br/>\").insertBefore(tr.find(\"td\").eq(2).find(\"span.greyText.smallText.uitext\"));\n };\n\n search(title, author, onSearchSuccess);\n });\n}", "title": "" }, { "docid": "6e07c3f64454d749e3078954bf83be3a", "score": "0.47536847", "text": "function filterTable() {\n\n // Grab data\n var filteredData = tableData;\n // console.log(filteredData);\n\n // Run through filter object and filter data accordingly\n Object.entries(filter).forEach(([key, value]) => {\n\n if (key === \"staff_pick\") {\n if (value === \"false\") {\n value = Boolean(false);\n }\n else {\n value = Boolean(true);\n }\n \n filteredData = filteredData.filter(id => id[key] === value);\n }\n else {\n filteredData = filteredData.filter(id => id[key] === value);\n }\n // console.log(key);\n // console.log(value);\n });\n\n // console.log(filteredData);\n\n // Find number of results\n var num_results = filteredData.length;\n // console.log(num_results);\n\n // Append search number of search results\n search_results.append(\"p\").text(`Number of results: ${num_results}`);\n\n // Take data and append results to each row\n filteredData.forEach(id => {\n \n // Append a row to the tbody\n var row = tbody.append(\"tr\");\n \n Object.entries(id).forEach(([key, value]) => {\n // console.log(key, value);\n \n var data_cell = row.append(\"td\").text(value);\n });\n });\n\n return filteredData;\n}", "title": "" }, { "docid": "54ae45493416dcee7851d01bf68aae45", "score": "0.47536418", "text": "function addEvent(mytable, arr, search_url)\n{ \n //alert(arr.length);\n var maxAllow = arr.length;\n var tbl = document.getElementById(mytable);\n var lastRow = tbl.rows.length;\n\n if (lastRow >= maxAllow) {\n alert (\"WARNING: Only \" + maxAllow + \" columns should be allowed to filter !\")\n return 0;\n }\n\n // if there's no header row in the table, then iteration = lastRow + 1\n var iteration = lastRow + 1;\n var row = tbl.insertRow(lastRow);\n\n // left cell\n var cell = row.insertCell(0);\n\n if (iteration == 1) {\n var div_match = document.createElement('div');\n div_match.setAttribute(\"id\", 'divmatch');\t\t\t\t\t\t\n div_match.style.visibility = \"hidden\";\n\n var textNode = document.createTextNode(\"Matching : \");\n var sel = document.createElement('select');\n sel.setAttribute(\"id\", 'selmatch'); \n sel.name = 'selmatch';\n sel.options[0] = new Option('Any', 'OR');\n sel.options[1] = new Option('All', 'AND');\n sel.style.visibility = \"hidden\";\n div_match.appendChild(textNode);\n div_match.appendChild(sel);\t\n cell.appendChild(div_match);\n }\n\n if (iteration > 1) {\n document.getElementById('divmatch').style.visibility = \"visible\"\n document.getElementById('selmatch').style.visibility = \"visible\"\n }\n\n var cellRight = row.insertCell(1);\n\n var textNode = document.createTextNode(\" Filter : \");\t\n cellRight.appendChild(textNode); \n \n var sel = document.createElement('select');\n sel.setAttribute(\"id\", \"sel_actions\");\t\n sel.name = \"sel_actions\";\n for (var i=0;i<arr.length;i++) {\n var disname = arr[i].split(\":\");\n sel.options[i] = new Option(disname[0], disname[1]);\n //sel[i].selected = true;\n } \t\t\t\t\n //sel.onClick = selEvent;\t\t\t\t\n cellRight.appendChild(sel);\n\n var textNode = document.createTextNode(\" Containing Text : \");\t\t\t\t\n cellRight.appendChild(textNode);\n\n var cellRight = row.insertCell(2);\n\n var txtSearch = document.createElement('input');\n txtSearch.type = 'text';\t\t\t\t\t\n txtSearch.setAttribute(\"id\", 'txtsearch');\n txtSearch.setAttribute(\"name\", 'txtsearch');\n txtSearch.setAttribute(\"size\", '20');\n\n var div_sel = document.createElement('div');\n div_sel.setAttribute(\"id\", 'div_sel');\n div_sel.appendChild(txtSearch);\t\t\t\t\t\t\n cellRight.appendChild(div_sel);\n\n var cellRight = row.insertCell(3);\n\n var el = document.createElement('input');\n el.type = 'button';\n el.name = 'btnRemove' + iteration;\n el.id = 'btnRemove' + iteration;\n el.value = \"Remove\";\n el.mytable = mytable;\n el.search_url = search_url; \n el.onclick = removeEvent;\n cellRight.appendChild(el);\n\n var totRow = lastRow + 1; \n addRemoveSearch(totRow, cellRight, search_url)\n return 0;\n}", "title": "" }, { "docid": "8d7c2a48b79d9949bbaa246d4d81702b", "score": "0.47489023", "text": "function filter(selector, query) {\r\n query = $.trim(query); //trim white space\r\n query = query.replace(/ /gi, '|'); //add OR for regex\r\n $(selector).each(\r\n function() {\r\n \t$(\"td:contains('\"+query+\"')\").css(\"text-decoration\", \"underline\");\r\n ($(this).text().search(new RegExp(query, \"i\")) < 0) ? $(this).closest('tr').hide().removeClass('visible') : $(this).closest('tr').show().addClass('visible');\r\n });\r\n\t}", "title": "" }, { "docid": "c08cc9d796f32545eefd0900d2a1027a", "score": "0.47433224", "text": "function mapColumnHeaders(column) {\n // console.log(gameData.gameMapList);\n // we need to create a sub-array of games that match this column ID\n let gamesByColumn = gameData.gameMapList.filter(x=> x.columnID == column.id )\n\n //we then use that sub array to populate our games with our column div\n return `\n <div class=\"map_column\" id=\"map_column_${column.id}\">\n <div class=\"map_heading\">\n ${column.name}<br/>\n <small>BAN: ${column.maxBan} &nbsp; SELECT: ${column.maxSelection}</small>\n </div>\n ${gamesByColumn.map(mapSelectionTemplate).join(\"\")}\n\n </div>`\n}", "title": "" }, { "docid": "5b2510d9bfba1897006a4da9a92102d5", "score": "0.47430614", "text": "getData(){\n //get 2-dimentional array of athletes cols => data in each column\n //first column in array has 'checkboxes/athlete name' \n let columns = [], rows = [];\n this.athletes.forEach((ath, i) => { \n rows.push({select: this.getSelectStat(0, i), name: ath.name, group: ath.group, position: ath.position, \n statGroup: ath.statGroup, id:ath.id});\n }); \n columns.push({title: 'header', type: ColumnType.Other, show: true, data: rows});\n this.athletes.forEach(ath => { \n let periods = [];\n ath.periods.forEach((p, i) => {\n let show = true;\n if (p.type.toLowerCase() === 'trim' && i !== 0) {\n show = false; //initially only the first trim period is shown, rest arent..\n }\n const colType = p.type.toLowerCase() === 'trim'? ColumnType.Trim : ColumnType.Split;\n if(!periods.find(period => period.title === p.name )){\n periods.push({ title: p.name, type: colType, show: show, status: ColumnStatus.Idle });\n } \n }); //get unique period names...\n //3. add new column into column list.. \n periods.forEach((p,i) => {\n if (!columns.find((c) => c.title === p.title))\n columns.push({title: p.title, type: p.type, show: this.getColumnShowStat(i, p.type), status: p.status, data: [] }); //get the unique columns, ignore existing columns and its status??\n });\n });\n \n \n //add data to each column after header column\n columns.filter((c, i) => i>0).forEach((c, i)=>{\n c.data = this.getColumnData(c.title, i);\n });\n this.data = columns; \n }", "title": "" }, { "docid": "6fadb05e268b63485aad168d171ad5e1", "score": "0.47418112", "text": "function renderFilterFieldsWithAnswers_savedReports_outPut(divId,filter_data){\nvar tableId = renderFilterFieldsWithOutRows_savedReports_outPut(divId,filter_data);\n\n\t\n\t\n\tjQuery.post(\"dynamicReport_populateAvailableColumns.action\", {}, function(availabeColumns) {\n\t\n\t\tvar filterRowCount = 1;\n\t\t\n\t\tjQuery.each(filter_data, function(index, tableRow_filter) {\n\t\t\t/*console.log(tableRow_filter.fieldName)\n\t\t\tconsole.log(tableRow_filter.expression)\n\t\t\tconsole.log(tableRow_filter.val)\n\t\t\tconsole.log(tableRow_filter.and_or)\n\t\t\tconsole.log(\"------------------------------\")*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\tvar table = document.getElementById(tableId);\n\t\t\t\n\t\t\tvar newRow = table.insertRow(table.rows.length);\n\t\t\tnewRow.id = tableId+\"$\"+((table.rows.length));\n\t\t\t\n\t\t\tvar fieldNameCell = newRow.insertCell(0);\n\t\t\tvar jsonArr = jQuery.parseJSON(availabeColumns);\n\t\t\tvar selectHtmlString = \"<select class='select2' onchange ='populateExpressionDropDown(this.value,$(this).parent().parent());'><option value=''>Select </option>\";\n\t\t\tfor(var i = 0;i<jsonArr.length;i++){\n\t\t\t\t\n\t\t\t\tif(jsonArr[i].columnLabel == tableRow_filter.fieldName){\n\t\t\t\t\tselectHtmlString = selectHtmlString+\"<option value='\" +jsonArr[i].columnName+\"%\"+jsonArr[i].columnType+ \"' selected>\"+ jsonArr[i].columnLabel + \"</option>\"\n\t\t\t\t}else{\n\t\t\t\t\tselectHtmlString = selectHtmlString+\"<option value='\" +jsonArr[i].columnName+\"%\"+jsonArr[i].columnType+ \"'>\"+ jsonArr[i].columnLabel + \"</option>\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tselectHtmlString = selectHtmlString+'</select>';\n\t\t\tfieldNameCell.innerHTML = selectHtmlString;\n\t\t\t\n\t\t\t\n\t\t\tvar conditionCell = newRow.insertCell(1);\n\t\t\tvar conditions = [];\n\t\t\t\n\t\t\tif(tableRow_filter.fieldDataType.includes(\"varchar\")){\n\t\t\t\t conditions = ['Equal to','Not Equal to','Contains','Not Contains','Is empty','Is not empty'];\n\t\t\t}else if(tableRow_filter.fieldDataType.includes(\"date\")){\n\t\t\t\t conditions = ['Equal to','Not Equal to','Greater than','Greater than or equal to','Less than','Less than or equal to','Between','Is empty','Is not empty'];\n\t\t\t}else{\n\t\t\t\t conditions = ['Equal to','Not Equal to','Greater than','Greater than or equal to','Less than','Less than or equal to','Is empty','Is not empty'];\n\t\t\t}\n\t\t\t\n\t\t\tvar select_expression = createDropDown_FilterExpression_withDefaultValue(conditions,tableRow_filter.expression);\n\t\t\tconditionCell.innerHTML = $(select_expression).prop('outerHTML');\n\t\t\tif(tableRow_filter.fieldDataType.includes(\"date\")){\n\t\t\t\tif(tableRow_filter.expression == \"Between\"){\n\t\t\t\t\tvar dateArray = (tableRow_filter.val).split(\"and\");\n\t\t\t\t\tdateArray[0] = dateArray[0].replace('\"', \"\");\n\t\t\t\t\tdateArray[1] = dateArray[1].replace('\"', \"\");\n\t\t\t\t\tdateArray[0] = dateArray[0].replace('\"', \"\");\n\t\t\t\t\tdateArray[1] = dateArray[1].replace('\"', \"\");\n\t\t\t\t\tdateArray[0] = dateArray[0].trim();\n\t\t\t\t\tdateArray[1] = dateArray[1].trim();\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t\tvar textBox1 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : dateArray[0]\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar textBox2 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : dateArray[1]\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalueCell.innerHTML = $(textBox1).prop('outerHTML')+\"&nbsp to &nbsp\"+$(textBox2).prop('outerHTML');\n\t\t\t\t\t\n\t\t\t\t}else if(tableRow_filter.expression == \"Is empty\" || tableRow_filter.expression == \"Is not empty\" ){\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\t\t\n\t\t\t\t\tvar textBox1 = $('<input/>').attr({\n\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\tclass:'datePickerTextBox',\n\t\t\t\t\t\tvalue : tableRow_filter.val\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvalueCell.innerHTML = $(textBox1).prop('outerHTML');\n\t\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('.datePickerTextBox').datepicker({ \n\t\t\t autoclose: true, \n\t\t\t todayHighlight: true,\n\t\t\t format: 'yyyy/mm/dd',\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}else{\n\n\t\t\tif(tableRow_filter.expression == \"Is empty\" || tableRow_filter.expression == \"Is not empty\" ){\n\t\t\t\t\n\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t \n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tvar valueCell = newRow.insertCell(2);\n\t\t\t\tvar textBox = $('<input/>').attr({\n\t\t\t\t\ttype : 'text',\n\t\t\t\t\tvalue : tableRow_filter.val\n\t\t\t\t});\n\t\t\t\tvalueCell.innerHTML = $(textBox).prop('outerHTML');\n\t\t\t\t \n\t\t\t}\n\t\t\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(filter_data.length > 1){\n\t\t\t\tvar and_or_cell = newRow.insertCell(3);\n\t\t\t\tif( filterRowCount < filter_data.length){\n\t\t\t\t\t\n\t\t\t\t\tvar and_or_value = tableRow_filter.and_or;\n\t\t\t\t\t\n\t\t\t\t\tif(and_or_value == \"AND\"){\n\t\t\t\t\t\tand_or_cell.innerHTML =\t'<select class=\"select2\" ><option value=\"AND\" selected>AND </option><option value=\"OR\">OR </option></select>';\n\t\t\t\t\t}else if(and_or_value == \"OR\"){\n\t\t\t\t\t\tand_or_cell.innerHTML =\t'<select class=\"select2\" ><option value=\"AND\" >AND </option><option value=\"OR\" selected>OR </option></select>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar controlBtn;\n\t\t\tif(filter_data.length > 1){\n\t\t\t\tcontrolBtn = newRow.insertCell(4);\n\t\t\t}else{\n\t\t\t\tcontrolBtn = newRow.insertCell(3);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvar del_btn = $('<button/>').attr({\n\t\t\t\ttype : 'button',\n\t\t\t\tclass : 'btn btn-sts',\n\t\t\t\tonclick : 'deleteRowAndValidateParentRow($(this).parent().parent(),\"filterTable_savedReports_outPut\");',\n\t\t\t\tstyle : 'margin-top:15px',\n\t\t\t});\n\t\t\t$(del_btn).text(\"Delete\");\n\t\t\tcontrolBtn.innerHTML = $(del_btn).prop('outerHTML');\n\t\t\t\n\t\t\t$('.select2').select2();\n\t\t\tfilterRowCount = filterRowCount+1;\n\t\t\n\t\t});\n\t\t});\n}", "title": "" }, { "docid": "d5e9056a1cd5c72f296a73b53e4902e8", "score": "0.4741716", "text": "function HandleFilterToggle(el_input) {\n console.log( \"===== HandleFilterToggle ========= \");\n //console.log( \"el_input\", el_input);\n\n // - get col_index and filter_tag from el_input\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n // because data-colindex goes wrong with hidden columns\n // was: const col_index = get_attr_from_el(el_input, \"data-colindex\")\n const col_index = el_input.parentNode.cellIndex;\n\n // - get filter_tag from el_input\n const filter_tag = get_attr_from_el(el_input, \"data-filtertag\");\n const field_name = get_attr_from_el(el_input, \"data-field\");\n const is_status_field = (field_name && field_name.includes(\"status\"))\n\n console.log( \"col_index\", col_index);\n console.log( \"filter_tag\", filter_tag);\n console.log( \"field_name\", field_name);\n console.log( \"is_status_field\", is_status_field);\n\n // - get current value of filter from filter_dict, set to '0' if filter doesn't exist yet\n const filter_array = (col_index in filter_dict) ? filter_dict[col_index] : [];\n const filter_value = (filter_array[1]) ? filter_array[1] : \"0\";\n\n console.log( \"filter_array\", filter_array);\n console.log( \"filter_value\", field_name);\n\n let new_value = \"0\", icon_class = \"tickmark_0_0\", title = \"\";\n if(filter_tag === \"toggle\") {\n // default filter triple '0'; is show all, '1' is show tickmark, '2' is show without tickmark\n// - toggle filter value\n new_value = (filter_value === \"2\") ? \"0\" : (filter_value === \"1\") ? \"2\" : \"1\";\n console.log( \"new_value\", new_value);\n\n// - get new icon_class\n if (field_name === \"note_status\"){\n icon_class = (new_value === \"2\") ? \"tickmark_2_1\" : (new_value === \"1\") ? \"note_0_1\" : \"tickmark_0_0\";\n\n } else if (is_status_field){\n icon_class = (new_value === \"2\") ? \"diamond_3_3\" : (new_value === \"1\") ? \"diamond_0_0\" : \"tickmark_0_0\";\n title = (new_value === \"2\") ? loc.Show_fully_approved : (new_value === \"1\") ?loc.Show_not_fully_approved : \"\";\n };\n };\n el_input.className = icon_class;\n el_input.title = title\n console.log( \"icon_class\", icon_class);\n\n// - put new filter value in filter_dict\n filter_dict[col_index] = [filter_tag, new_value]\n console.log( \"filter_dict\", filter_dict);\n\n t_Filter_TableRows(tblBody_datatable, filter_dict, selected, loc.Subject, loc.Subjects);\n\n }", "title": "" }, { "docid": "0b8969555d8a2dcb23625b889e2f4248", "score": "0.4740368", "text": "function populateCases(cases) {\n\t // Create a searchable, sortable list using list.js and d3\n\t var options = {\n\t valueNames: ['name', 'count', 'class']\n\t };\n\t var scale = d3.scale.linear().domain([0, d3.max(cases, function (d) {\n\t return d.set().count();\n\t })]).range([0, 100]);\n\t\n\t // Populate the list of samples\n\t var items = _caseList.select('.list').selectAll('li').data(cases);\n\t var newItems = items.enter().append('li').on('mouseenter', function (d) {\n\t callListeners('mouseenter.case', _obj, d);\n\t }).on('mouseleave', function (d) {\n\t callListeners('mouseleave.case', _obj, d);\n\t });\n\t\n\t newItems.append('span').classed('name', true).html(function (d) {\n\t return d.label();\n\t });\n\t newItems.append('span').classed('count', true).classed('hidden', true).html(function (d) {\n\t return d.set().count();\n\t });\n\t newItems.append('div').classed('bar', true).style('width', function (d) {\n\t return scale(d.set().count()) + \"%\";\n\t });\n\t newItems.append('button').attr('title', \"Add\").html(\"+\").on('click', function (d) {\n\t callListeners('add.case', _obj, d);\n\t });\n\t\n\t // It appears that list.js is storing some things when a List\n\t // object is created, preventing things from working correctly if\n\t // you attempt to just re-create a List object where there was an\n\t // old one. Therefore, we must only create the List object once,\n\t // but we are free to completely replace the HTML with the original\n\t // values when the 'Def.' button is clicked\n\t if (!_caseListObj) {\n\t _caseListObj = new _list2.default('samples', options);\n\t _caseList.select('.clear-sort').on('click', function (d) {\n\t d3.selectAll('#samples .sort').classed('asc', false).classed('desc', false);\n\t d3.selectAll('#samples .list li').remove();\n\t populateCases(cases);\n\t });\n\t\n\t var matching = _caseListObj.matchingItems;\n\t var str = matching.length + \" sample\" + (matching.length == 1 ? \"\" : \"s\");\n\t _caseCount.text(str);\n\t\n\t _caseListObj.on('searchComplete', function () {\n\t var matching = _caseListObj.matchingItems;\n\t var str = matching.length + \" sample\" + (matching.length == 1 ? \"\" : \"s\");\n\t _caseCount.text(str);\n\t callListeners('searched.cases', _obj, matching);\n\t });\n\t }\n\t }", "title": "" }, { "docid": "3e0cbb59552ccebbbfb6f85f9052affd", "score": "0.47394282", "text": "function filterTable(filters,arr) {\n // to not mutated original data\n let filteredData = arr.map(item=>item)\n // transform filters object into array of arrays \n Object.entries(filters).forEach(([key,val]) => {\n // check if users input filter\n if(val){\n // using dinamic key value\nfilteredData=filteredData.filter(row => row[key] === val);\n }\n });\n buildTable(filteredData);\n\n \n}", "title": "" }, { "docid": "a16237366e7fcb26d5880e67a66b1d97", "score": "0.47368848", "text": "function collectFilters(data) {\n\n var cases = [];\n var specifications = [];\n var reporters = [];\n var comments = [];\n var status = [];\n var resolvers = [];\n\n for (var i = 0, max = data.comments.length; i < max; i++) {\n if (cases.indexOf(data.comments[i].caseTitle) < 0) {\n cases.push(data.comments[i].caseTitle);\n }\n if (specifications.indexOf(data.comments[i].specificationTitle) < 0) {\n specifications.push(data.comments[i].specificationTitle);\n }\n if (reporters.indexOf(data.comments[i].authorDisplayName) < 0) {\n reporters.push(data.comments[i].authorDisplayName);\n }\n if (status.indexOf(data.comments[i].resolution) < 0) {\n status.push(data.comments[i].resolution);\n }\n if (SynergyUtils.definedNotNull(data.comments[i].resolverDisplayName) && resolvers.indexOf(data.comments[i].resolverDisplayName) < 0) {\n resolvers.push(data.comments[i].resolverDisplayName);\n }\n if (comments.indexOf(data.comments[i].commentText) < 0) {\n comments.push(data.comments[i].commentText);\n }\n }\n\n var sortFnc = function (a, b) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n if (a === b) {\n return 0;\n }\n return a > b ? 1 : -1;\n };\n\n cases.sort(sortFnc);\n cases.push(\"All\");\n specifications.sort(sortFnc);\n specifications.push(\"All\");\n reporters.sort(sortFnc);\n reporters.push(\"All\");\n comments.sort(sortFnc);\n comments.push(\"All\");\n status.sort(sortFnc);\n status.push(\"All\");\n resolvers.sort(sortFnc);\n resolvers.push(\"All\");\n $scope.filters = {\n \"cases\": cases,\n \"specifications\": specifications,\n \"reporters\": reporters,\n \"comments\": comments,\n \"status\": status,\n \"resolvers\": resolvers\n };\n }", "title": "" }, { "docid": "24c3f6ece161a71d083cb543ea9d3748", "score": "0.47308078", "text": "function filterTable() {\n \n // 8. Set the filtered data to the tableData.\n let filteredData = tableData;\n \n \n // 9. Loop through all of the filters and keep any data that\n // matches the filter values\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n Object.entries(filters).forEach(([id, value]) => {\n filteredData = filteredData.filter(row =>row[id] === value); \n }); \n // 10. Finally, rebuild the table using the filtered data\n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n // Build the table when the page loads\n buildTable(filteredData); \n }", "title": "" }, { "docid": "c133eba621c5667bb7194a3a2e607d74", "score": "0.47292778", "text": "function renderSortOptions(col, status, colname) {\n str = \"\";\n if (status == -1) {\n\n if (col == \"ccode\" || col == \"class\" || col == \"credits\" || col == \"start_period\" || col == \"end_period\" || col == \"study_program\" || col == \"tallocated\") {\n str += \"<span onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"</span>\";\n } else {\n str += \"<span onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"</span>\";\n }\n } else {\n if (col == \"ccode\" || col == \"cname\" || col == \"class\" || col == \"credits\" || col == \"start_period\" || col == \"end_period\" || col == \"study_program\" || col == \"tallocated\") {\n if (status == 0) {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",1)'>\" + colname + \"&#x25b4;</div>\";\n } else {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"&#x25be;</div>\";\n }\n } else {\n if (status == 0) {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",1)'>\" + colname + \"&#x25b4;</div>\";\n } else {\n str += \"<div onclick='myTable.toggleSortStatus(\\\"\" + col + \"\\\",0)'>\" + colname + \"&#x25be;</div>\";\n }\n }\n }\n\n return str;\n}", "title": "" }, { "docid": "5a0d2da7ae4f1d2139e6ff3c21869e73", "score": "0.47264493", "text": "function showFeatureTable(feature, sourceData, mapvis) {\n function rowsInArray(array, classStr) {\n return '<table>' + \n Object.keys(feature)\n .filter(key => \n array === undefined || array.indexOf(key) >= 0)\n .map(key =>\n `<tr><td ${classStr}>${key}</td><td>${feature[key]}</td></tr>`)\n .join('\\n') + \n '</table>';\n }\n\n if (feature === undefined) {\n // Called before the user has selected anything\n feature = {};\n sourceData.textColumns.forEach(c => feature[c] = '');\n sourceData.numericColumns.forEach(c => feature[c] = '');\n sourceData.boringColumns.forEach(c => feature[c] = '');\n\n } else if (sourceData.shape === 'polygon') { // TODO check that this is a block lookup choropleth\n feature = sourceData.getRowForBlock(feature.block_id, feature.census_yr); \n }\n\n\n\n document.getElementById('features').innerHTML = \n '<h4>Click a field to visualise with colour</h4>' +\n rowsInArray(sourceData.textColumns, 'class=\"enum-field\"') + \n '<h4>Click a field to visualise with size</h4>' +\n rowsInArray(sourceData.numericColumns, 'class=\"numeric-field\"') + \n '<h4>Other fields</h4>' +\n rowsInArray(sourceData.boringColumns, '');\n\n\n document.querySelectorAll('#features td').forEach(td => \n td.addEventListener('click', e => {\n mapvis.setVisColumn(e.target.innerText) ; // TODO highlight the selected row\n }));\n}", "title": "" }, { "docid": "c01d62fbd169e291ff914f6d5f792795", "score": "0.47258067", "text": "function PesquisaTableByExactValues(Categoria){\r\n\r\n var filter = pesquisabarra.value.toUpperCase();\r\n var tr = tbody.getElementsByTagName(\"tr\");\r\n var found;\r\n\r\n for(let i = 0;i < tr.length; i++){\r\n var td = tr[i].getElementsByClassName(Categoria);\r\n\r\n for (let j = 0; j < td.length; j++){\r\n if(td[j].innerHTML.toUpperCase() == filter){ // Dados coencidem com valores da tabela\r\n found = true;\r\n }\r\n }\r\n\r\n if(found){\r\n tr[i].style.display=\"\";\r\n found=false;\r\n }\r\n\r\n else{\r\n tr[i].style.display=\"none\"; \r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "d76867b413f0033f45658cfbf7ce3e1e", "score": "0.47220272", "text": "function displayConflicts(conflicts, element, mode){\n if (typeof conflicts === \"undefined\")\n return;\n var list = null;\n if (mode == \"conflict\")\n list = Conflicts.constraintsSeverityList;\n else if (mode == \"preference\")\n list = Conflicts.preferencesSeverityList;\n else if(mode == \"chair\")\n list = Conflicts.chairSeverityList;\n\n element.html(\"\");\n $.each(list, function(index, severity){\n var filteredArray = []; \n if (mode == \"conflict\" || mode == \"preference\")\n filteredArray = conflicts.filter(function(x){return getSeverityByType(x.type)==severity});\n else if (mode == \"chair\")\n filteredArray = conflicts.filter(function(x){return (getSeverityByType(x.type)==severity) && (x.type in CCOps.chairConstraints) });\n\n if (filteredArray.length > 0){\n var html = \"\";\n var i; \n for (i=0; i<filteredArray.length; i++) {\n html += \"<span class='conflict-display'></span>\";\n }\n var $palette = $(html).addClass(\"cell-conflict-\" + severity)\n\n element.append(filteredArray.length).append($palette);\n var palette_title = \"\";\n if (severity == \"good\")\n palette_title = \"preferences met\";\n else\n palette_title = severity + \" severity conflicts\";\n \n var palette_content = filteredArray.map(function(co) {\n // if (co.type == constraint.type)\n return \"<li class='hover-description'>\"+co.description+\"</li>\";\n }).join(\"\");\n $palette.popover({\n html:true,\n placement: \"bottom\",\n trigger: \"hover\",\n title:function(){\n return palette_title;\n },\n content:function(){\n return palette_content;\n }\n });\n }\n });\n }", "title": "" }, { "docid": "0a72670b7c8fa5a770a1136d12053781", "score": "0.47182697", "text": "function do_case(case_name, entail_case, number) {\n const a_store = new RDFTripleStore(entail_case.target);\n const b_store = new RDFTripleStore(entail_case.source);\n\n const { output: mapping } = simple_bnode_mapping(a_store, b_store);\n\n const mapping_store = new RDFTripleStore(\n Array.from(mapping, ([bnode, term]) => [bnode, n(\"def:mapsTo\"), term])\n );\n\n // HACK: Put everything into one store. This only works because the test\n // data takes pains to avoid overlap of bnode labels between the two graphs.\n // But they are supposed to be separate spaces (is the whole point).\n\n const store = new RDFTripleStore();\n store.into(entail_case.target);\n store.into(entail_case.source);\n store.into(mapping_store);\n\n return show.store(store, {\n annotate: [\n {\n construct: prep(\n `?e dot:color \"#FF00FF88\"`,\n \"?e dot:constraint false\",\n \"?e dot:penwidth 5\",\n `?e dot:label \"\"`\n ),\n where: prep(`?e def:represents ?t`, \"?t rdf:predicate def:mapsTo\"),\n },\n ],\n });\n }", "title": "" }, { "docid": "a1e8f6b2e9100c4dbfd34b76cc91d849", "score": "0.47162318", "text": "function updateUiFromSearch(query) {\n switch (filterSwitch) {\n case 'filter-all':\n updateUI(contactArr.filter(contact => {\n return contact.name.toLowerCase().includes(query) || contact.surname.toLowerCase().includes(query) || contact.phoneNumber.includes(query) || contact.address.toLowerCase().includes(query);\n }));\n break;\n case 'filter-name':\n updateUI(contactArr.filter(contact => {\n return contact.name.toLowerCase().includes(query);\n }));\n break;\n case 'filter-surname':\n updateUI(contactArr.filter(contact => {\n return contact.surname.toLowerCase().includes(query);\n }));\n break;\n case 'filter-phoneNumber':\n updateUI(contactArr.filter(contact => {\n return contact.phoneNumber.includes(query);\n }));\n break;\n case 'filter-address':\n updateUI(contactArr.filter(contact => {\n return contact.address.toLowerCase().includes(query);\n }));\n break;\n }\n}", "title": "" }, { "docid": "8b970231aabedab5d9c56b561a54e251", "score": "0.471382", "text": "function filterResults(data){\n\n $('div#results').empty(); //erase previous search results from results div\n\n if(data.length > 0){ //check that an empty array has not been passed\n \n let dataFilter = [];\n \n //if any filters are present only include data entries with all of the filter words in the description\n if (checkboxFilter.length > 0 ){\n dataFilter = data.filter(function (e){\n return (checkboxFilter.every(word => e.description.includes(word)))\n })\n //if no filters are present use the entire data response\n }else{\n dataFilter = data;\n }\n \n if (dataFilter.length > 0){ //check if any results are left after filter\n\n for (i = 0; i < dataFilter.length; i++){\n \n const resultDiv = document.createElement(\"div\"); //create new div for each result entry and populate\n $('div#results').append(resultDiv);\n $(resultDiv).attr('id', 'result-'+dataFilter[i].id);\n $(resultDiv).addClass('result');\n $(resultDiv).append(\"<div class='result-beer-image-container'><img alt='result-beer-image' class='beer-photo' src='\"+dataFilter[i].image_url+\"' height='328px' width='auto';/></div>\");\n \n const textDiv = document.createElement(\"div\"); //create another div to make styling the image and text easier\n $(textDiv).addClass('result-text');\n $(resultDiv).append(textDiv);\n $(textDiv).append(\"<p class='result-name'>\"+dataFilter[i].name+\"</p>\");\n $(textDiv).append(\"<p class='result-tagline'>\"+dataFilter[i].tagline+\"</p>\");\n $(textDiv).append(\"<p class='result-ibu'><span class='result-ibu-label'>IBU</span>\"+dataFilter[i].ibu.toFixed(1)+\"</p>\"); //show first decimal of ibu\n $(textDiv).append(\"<p class='result-abv'><span class='result-abv-label'>ABV</span>\"+dataFilter[i].abv.toFixed(1)+\"</p>\"); //show first decimal of abv\n $(textDiv).append(\"<p class='result-description'>\"+dataFilter[i].description+\"</p>\");\n\n const newList = document.createElement( \"ul\" );\n $(newList).addClass('result-food-pairing-list');\n $(textDiv).append(newList);\n \n const foodPairings = dataFilter[i].food_pairing;\n for (f = 0; f < foodPairings.length; f++){\n $(newList).append(\"<li>\"+dataFilter[i].food_pairing[f]+\"</li>\");\n }\n }\n }\n else{\n $('div#results').append(\"<p class='results-no-results'>No results found.</p>\");\n }\n \n }\n}", "title": "" }, { "docid": "9435f459448fef05a6294d61ebec3b50", "score": "0.47128555", "text": "_filterTable() {\n alert(\"filter data for ##--##\" + this.state.inputSearch + \"##--##\" + this.state.pickerSearch);\n //this._onFetch(1)\n }", "title": "" } ]
5ce3d5bf6f0e33577109560a083ddbf3
Create a new object with selected properties. Also allows property renaming and transform functions.
[ { "docid": "3697b1282aab78eb08b3bbecd58ecfe3", "score": "0.59761137", "text": "function pick(obj, properties) {\n if (_typeof(obj) !== 'object') {\n return {};\n }\n\n return properties.reduce(function (newObj, prop, i) {\n if (typeof prop === 'function') {\n return newObj;\n }\n\n var newProp = prop;\n var match = prop.match(/^(.+?)\\sas\\s(.+?)$/i);\n\n if (match) {\n prop = match[1];\n newProp = match[2];\n }\n\n var value = obj[prop];\n\n if (typeof properties[i + 1] === 'function') {\n value = properties[i + 1](value, newObj);\n }\n\n if (typeof value !== 'undefined') {\n newObj[newProp] = value;\n }\n\n return newObj;\n }, {});\n}", "title": "" } ]
[ { "docid": "0c45300bdfc42dbe730f774aa46b848b", "score": "0.59893465", "text": "function _transform(props, deprecated) {\n var shape = props.shape,\n container = props.container,\n multiple = props.multiple,\n filterBy = props.filterBy,\n overlay = props.overlay,\n safeNode = props.safeNode,\n noFoundContent = props.noFoundContent,\n others = (0, _objectWithoutProperties3.default)(props, ['shape', 'container', 'multiple', 'filterBy', 'overlay', 'safeNode', 'noFoundContent']);\n\n\n var newprops = others;\n if (shape === 'arrow-only') {\n deprecated('shape=arrow-only', 'hasBorder=false', 'Select');\n newprops.hasBorder = false;\n }\n if (container) {\n deprecated('container', 'popupContainer', 'Select');\n newprops.popupContainer = container;\n }\n if (multiple) {\n deprecated('multiple', 'mode=multiple', 'Select');\n newprops.mode = 'multiple';\n }\n if (filterBy) {\n deprecated('filterBy', 'filter', 'Select');\n newprops.filter = filterBy;\n }\n if (overlay) {\n deprecated('overlay', 'popupContent', 'Select');\n newprops.popupContent = overlay;\n newprops.autoWidth = false;\n }\n\n if (noFoundContent) {\n deprecated('noFoundContent', 'notFoundContent', 'Select');\n newprops.notFoundContent = noFoundContent;\n }\n\n if (safeNode) {\n deprecated('safeNode', 'popupProps={safeNode}', 'Select');\n newprops.popupProps = {\n safeNode: safeNode\n };\n }\n\n return newprops;\n}", "title": "" }, { "docid": "7dad78032a234c84077dc12b161120a6", "score": "0.5951746", "text": "function _transform(props, deprecated) {\n var shape = props.shape,\n container = props.container,\n multiple = props.multiple,\n filterBy = props.filterBy,\n overlay = props.overlay,\n safeNode = props.safeNode,\n noFoundContent = props.noFoundContent,\n others = (0, _objectWithoutProperties3.default)(props, ['shape', 'container', 'multiple', 'filterBy', 'overlay', 'safeNode', 'noFoundContent']);\n\n var newprops = others;\n if (shape === 'arrow-only') {\n deprecated('shape=arrow-only', 'hasBorder=false', 'Select');\n newprops.hasBorder = false;\n }\n if (container) {\n deprecated('container', 'popupContainer', 'Select');\n newprops.popupContainer = container;\n }\n if (multiple) {\n deprecated('multiple', 'mode=multiple', 'Select');\n newprops.mode = 'multiple';\n }\n if (filterBy) {\n deprecated('filterBy', 'filter', 'Select');\n newprops.filter = filterBy;\n }\n if (overlay) {\n deprecated('overlay', 'popupContent', 'Select');\n newprops.popupContent = overlay;\n newprops.autoWidth = false;\n }\n\n if (noFoundContent) {\n deprecated('noFoundContent', 'notFoundContent', 'Select');\n newprops.notFoundContent = noFoundContent;\n }\n\n if (safeNode) {\n deprecated('safeNode', 'popupProps={safeNode}', 'Select');\n newprops.popupProps = {\n safeNode: safeNode\n };\n }\n\n return newprops;\n}", "title": "" }, { "docid": "5b7db7f87c483158cf4f3cc44b22862b", "score": "0.57804435", "text": "function assignProperties([key1, value1, key2, value2, key3, value3]){\n let obj = {};\n obj = {\n [key1]: value1,\n [key2]: value2,\n [key3]: value3\n };\n return obj;\n}", "title": "" }, { "docid": "96ce65abd7262114a7fe748201677179", "score": "0.5718763", "text": "function Transform(props) {\n for(var key in props) {\n this[key] = props[key];\n }\n }", "title": "" }, { "docid": "b962e12d4b74a9c8dc201455e850f888", "score": "0.55337775", "text": "@computed get properties() {\n const obj = {};\n const selected = this.selected;\n\n selected.textProps.forEach(prop => {\n obj[prop] = this.propertyMap.get(prop);\n });\n\n selected.bools.forEach(prop => {\n obj[prop] = this.boolMap.get(prop);\n });\n\n return obj;\n }", "title": "" }, { "docid": "15ec9c8f1b376c7b9e112f7962e8fbfd", "score": "0.55324626", "text": "function createObjWithProp(name1, name2, val1, val2) {\n return {\n [name1]: val1,\n [name2]: val2,\n };\n}", "title": "" }, { "docid": "5dd5dbbbc846ffb20ac8a74591a2d1b5", "score": "0.54781675", "text": "load(properties) {\n \n let p = Object.create(null);\n \n Object.keys(properties).forEach(function(v) {\n \n p[v] = properties[v];\n \n });\n \n this.properties = p;\n \n return this;\n \n }", "title": "" }, { "docid": "67c537ab9a981a1d75948c170e8dfb07", "score": "0.5458933", "text": "function createOneMoreCar(property, value) {\n return {\n [property]: value,\n ['_' + property]: value,\n [property.toUpperCase()]: value,\n ['get' + property]() {\n return this[property];\n }\n };\n}", "title": "" }, { "docid": "0179e9f1ce65ca0f7ed3ca9dc42a44c1", "score": "0.54532135", "text": "transform() {\n // add feilds to be selected\n const fields = [\n 'id',\n 'name',\n 'manager',\n 'homeGround',\n 'leaguePosition',\n 'homeWin',\n 'homeLoss',\n 'awayWin',\n 'awayLoss',\n 'goalDifference',\n 'win',\n 'loss',\n 'draw',\n 'points',\n 'goals',\n 'conceded',\n 'isDeleted'\n ];\n return pick(fields, this);\n }", "title": "" }, { "docid": "d67062b499a4006513c60419ec9c1f6c", "score": "0.5442123", "text": "function propertiesObject() {\n let propObj = {\n weight: \"\", \n height: \"\", \n eyeColor: \"\"\n };\n return propObj;\n}", "title": "" }, { "docid": "3e71387596de7cc0398f5a357bb8e925", "score": "0.5399018", "text": "function newObject(x,y){\n return ({\"title\": x, \"genre\": y});\n}", "title": "" }, { "docid": "efb0fce59e348f1e6840ef1c9030b41a", "score": "0.5384793", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (true) {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "62ef933d010913204696f6a8051c2d8e", "score": "0.5370529", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (\"production\" !== process.env.NODE_ENV) {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "62ef933d010913204696f6a8051c2d8e", "score": "0.5370529", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (\"production\" !== process.env.NODE_ENV) {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "7357f6ccaa80809bcce9c6be8c096365", "score": "0.53467095", "text": "constructor(properties, options) {\n\t\trules.object.validate(properties);\n\n\t\tconst packs = [];\n\t\tforOwnKeysOf(properties, (properties, key) => {\n\t\t\tconst subKey = key;\n\t\t\tconst test = properties[key];\n\t\t\tpacks.push([key, subKey, test]);\n\t\t});\n\n\t\tsuper(packs, options);\n\t}", "title": "" }, { "docid": "988b4543d2c075762ebfa3ba856da7e8", "score": "0.5334693", "text": "createProperty( obj, name, value, post=null, priority=0, transform=null, isPoly=false ) {\n obj[ '__' + name ] = { \n value,\n isProperty:true,\n sequencers:[],\n tidals:[],\n mods:[],\n name,\n\n fade( from=0, to=1, time=4 ) {\n Gibber[ obj.type ].createFade( from, to, time, obj, name )\n return obj\n }\n }\n\n Gibber.addSequencing( obj, name, priority, value, '__' )\n\n Object.defineProperty( obj, name, {\n configurable:true,\n get: Gibber[ obj.type ].createGetter( obj, name ),\n set: Gibber[ obj.type ].createSetter( obj, name, post, transform, isPoly )\n })\n }", "title": "" }, { "docid": "da9ec544781d096fd53a643781fad616", "score": "0.5326731", "text": "function createPropertyStructure( rawProperties, classMap, propertyMap ){\n var properties = [];\n // Set default values\n rawProperties.forEach(function ( property ){\n property.visible(true);\n });\n \n // Connect properties\n rawProperties.forEach(function ( property ){\n var domain,\n range,\n domainObject,\n rangeObject,\n inverse;\n \n /* Skip properties that have no information about their domain and range, like\n inverse properties with optional inverse and optional domain and range attributes */\n if ( (property.domain() && property.range()) || property.inverse() ) {\n \n var inversePropertyId = findId(property.inverse());\n // Look if an inverse property exists\n if ( inversePropertyId ) {\n inverse = propertyMap[inversePropertyId];\n if ( !inverse ) {\n console.warn(\"No inverse property was found for id: \" + inversePropertyId);\n property.inverse(undefined);\n }\n }\n \n // Either domain and range are set on this property or at the inverse\n if ( typeof property.domain() !== \"undefined\" && typeof property.range() !== \"undefined\" ) {\n domain = findId(property.domain());\n range = findId(property.range());\n \n domainObject = classMap[domain];\n rangeObject = classMap[range];\n } else if ( inverse ) {\n // Domain and range need to be switched\n domain = findId(inverse.range());\n range = findId(inverse.domain());\n \n domainObject = classMap[domain];\n rangeObject = classMap[range];\n } else {\n console.warn(\"Domain and range not found for property: \" + property.id());\n }\n \n // Set the references on this property\n property.domain(domainObject);\n property.range(rangeObject);\n \n // Also set the attributes of the inverse property\n if ( inverse ) {\n property.inverse(inverse);\n inverse.inverse(property);\n \n // Switch domain and range\n inverse.domain(rangeObject);\n inverse.range(domainObject);\n }\n }\n // Reference sub- and superproperties\n referenceSubOrSuperProperties(property.subproperties());\n referenceSubOrSuperProperties(property.superproperties());\n });\n \n // Merge equivalent properties and process disjoints.\n rawProperties.forEach(function ( property ){\n processEquivalentIds(property, propertyMap);\n processDisjoints(property);\n \n attributeParser.parsePropertyAttributes(property);\n });\n // Add additional information to the properties\n rawProperties.forEach(function ( property ){\n // Properties of merged classes should point to/from the visible equivalent class\n var propertyWasRerouted = false;\n \n if ( property.domain() === undefined ) {\n console.warn(\"No Domain was found for id:\" + property.id());\n return;\n }\n \n if ( wasNodeMerged(property.domain()) ) {\n property.domain(property.domain().equivalentBase());\n propertyWasRerouted = true;\n }\n if ( property.range() === undefined ) {\n console.warn(\"No range was found for id:\" + property.id());\n return;\n }\n if ( wasNodeMerged(property.range()) ) {\n property.range(property.range().equivalentBase());\n propertyWasRerouted = true;\n }\n // But there should not be two equal properties between the same domain and range\n var equalProperty = getOtherEqualProperty(rawProperties, property);\n \n if ( propertyWasRerouted && equalProperty ) {\n property.visible(false);\n \n equalProperty.redundantProperties().push(property);\n }\n \n // Hide property if source or target node is hidden\n if ( !property.domain().visible() || !property.range().visible() ) {\n property.visible(false);\n }\n \n // Collect all properties that should be displayed\n if ( property.visible() ) {\n properties.push(property);\n }\n });\n return properties;\n }", "title": "" }, { "docid": "19786b739a3a14cc5dab069dc6c8f11e", "score": "0.53189886", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (\"production\" !== \"development\") {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "407660fa53992402bc2b9130c2402203", "score": "0.5293737", "text": "function copyProperties(obj, a, b, c, d, e, f) {\n\t obj = obj || {};\n\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t if (f) {\n\t throw new Error('Too many arguments passed to copyProperties');\n\t }\n\t }\n\n\t var args = [a, b, c, d, e];\n\t var ii = 0, v;\n\t while (args[ii]) {\n\t v = args[ii++];\n\t for (var k in v) {\n\t obj[k] = v[k];\n\t }\n\n\t // IE ignores toString in object iteration.. See:\n\t // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n\t if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n\t (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n\t obj.toString = v.toString;\n\t }\n\t }\n\n\t return obj;\n\t}", "title": "" }, { "docid": "bf949b028f5191f5a72928f1b460302c", "score": "0.5286162", "text": "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "title": "" }, { "docid": "8960990d4505b10997e8931e5c477437", "score": "0.52848446", "text": "function extend(target, properties) {\n\n if (!target) {\n target = {};\n }\n\n for (var prop in properties) {\n target[prop] = properties[prop];\n }\n\n return target;\n }", "title": "" }, { "docid": "b29c84fd432c565329da0f8e33a740ec", "score": "0.5279295", "text": "constructor(properties) {\n for (i in properties) {\n this[properties[i]] = \n }\n }", "title": "" }, { "docid": "fbccb1ea4d131ac22656ba1fc2fe9856", "score": "0.52772427", "text": "static from(obj) {\r\n\t\tlet point = null;\r\n\t\tif(obj.position){\r\n\t\t\tpoint = new Point(obj.position.x, obj.position.y);\r\n\t\t}\r\n\t\tlet newObj = new this(point, obj.stats);\r\n\r\n\t\tlet exempt = [\"lifebar\", \"position\", \"inventory\", \"equipment\"];\r\n\r\n\t\tfor (let key in obj) {\r\n\t\t\tif (!exempt.includes(key)) {\r\n\t\t\t\tnewObj[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t\tnewObj.inventory = [];\r\n\t\tfor(let key in obj.inventory){\r\n\t\t\tnewObj.inventory[key] = (eval(obj.inventory[key].type)).from(obj.inventory[key]);\r\n\t\t}\r\n\t\tnewObj.equipment = [];\r\n\t\tfor(let key in obj.equipment){\r\n\t\t\tnewObj.equipment[key] = (eval(obj.equipment[key].type)).from(obj.equipment[key]);\r\n\t\t}\r\n\t\t\r\n\t\treturn newObj;\r\n\t}", "title": "" }, { "docid": "95aded65c7b5d60a76cff45a283f3624", "score": "0.52677643", "text": "function createAnonymousObject(propertyList) {\n var entity = blank();\n return {\n entity: entity,\n triples: propertyList.map(function (t) { return extend(triple(entity), t); })\n };\n }", "title": "" }, { "docid": "95aded65c7b5d60a76cff45a283f3624", "score": "0.52677643", "text": "function createAnonymousObject(propertyList) {\n var entity = blank();\n return {\n entity: entity,\n triples: propertyList.map(function (t) { return extend(triple(entity), t); })\n };\n }", "title": "" }, { "docid": "95aded65c7b5d60a76cff45a283f3624", "score": "0.52677643", "text": "function createAnonymousObject(propertyList) {\n var entity = blank();\n return {\n entity: entity,\n triples: propertyList.map(function (t) { return extend(triple(entity), t); })\n };\n }", "title": "" }, { "docid": "3972c2bb193b7e49bfb492a790938744", "score": "0.5251745", "text": "function createAnonymousObject(propertyList) {\n var entity = blank();\n return {\n entity: entity,\n triples: propertyList.map(function(t) {\n return extend(triple(entity), t);\n })\n };\n }", "title": "" }, { "docid": "ed017ba10e8ebaf49da795c6bccf5caf", "score": "0.5241016", "text": "static copyProperties(target, source, someKeys=null) {\n const isNumberField=(property)=>{\n let keyIndex=-1;\n if (target.parentNode && target.parentNode.childtablekeys && target.parentNode.childtablekeys.length>0) keyIndex=target.parentNode.childtablekeys.indexOf(property);\n if (keyIndex!==-1) return target.parentNode.childtablekeysinfo[keyIndex]['Type'].includes(\"int\") || target.parentNode.childtablekeysinfo[keyIndex]['Type'].includes(\"decimal\");\n }\n let sourceProps=source;\n if (source.props) sourceProps=source.props;\n for (const key in sourceProps) {\n if (Array.isArray(someKeys) && !someKeys.includes(key)) continue;\n let value=sourceProps[key];\n if (isNumberField(key)) {\n if (isNaN(parseNumber(sourceProps[key]))) continue;\n value=parseNumber(sourceProps[key]);\n }\n let targetProps=target;\n if (target.props) targetProps=target.props;\n if (typeof value==\"string\" || typeof value==\"number\") targetProps[key]=value;\n if (typeof value==\"object\" && value instanceof Date) targetProps[key]=value.toLocaleString();\n }\n }", "title": "" }, { "docid": "1ccba7ea7f0124410af0e2f5805b3ecb", "score": "0.523013", "text": "assignProperties(target, ...sources) {\n if(Object.assign) {\n Object.assign(target, ...sources);\n return target;\n }\n\n for (var index = 0; index < sources.length; index++) {\n var source = sources[index];\n if (source != null) {\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n }\n return target;\n }", "title": "" }, { "docid": "d64eea26f0ac3fc6bec1c6ba193c1906", "score": "0.5224987", "text": "function pick(object, props) {\n const result = {};\n for (const propName of props) {\n if (object.hasOwnProperty(propName)) {\n result[propName] = object[propName];\n }\n }\n return result;\n}", "title": "" }, { "docid": "d64eea26f0ac3fc6bec1c6ba193c1906", "score": "0.5224987", "text": "function pick(object, props) {\n const result = {};\n for (const propName of props) {\n if (object.hasOwnProperty(propName)) {\n result[propName] = object[propName];\n }\n }\n return result;\n}", "title": "" }, { "docid": "d64eea26f0ac3fc6bec1c6ba193c1906", "score": "0.5224987", "text": "function pick(object, props) {\n const result = {};\n for (const propName of props) {\n if (object.hasOwnProperty(propName)) {\n result[propName] = object[propName];\n }\n }\n return result;\n}", "title": "" }, { "docid": "6133eaf02438e5504ee34d61ebd9d576", "score": "0.52022123", "text": "function MakePerson(name, age){\n return {\n name,\n age\n }\n}", "title": "" }, { "docid": "886abe27e5cb1fc872fe78f8c535538e", "score": "0.51869583", "text": "constructor(properties, options) {\n\t\trules.object.validate(properties);\n\n\t\tconst packs = [];\n\t\tforOwnKeysOf(properties, (properties, key) => {\n\t\t\tconst subKey = Symbol(key); // Create a symbol subKey instead.\n\t\t\tconst test = properties[key];\n\t\t\tpacks.push([key, subKey, test]);\n\t\t});\n\n\t\tsuper(packs, options);\n\t}", "title": "" }, { "docid": "b51e46c59583328450aca1887598c7d8", "score": "0.5180285", "text": "function makeClassMate(name, age, passion, favoriteFood, sex){\n\treturn {\n\t\tname : name,\n\t\tage :age,\n\t\tpassion : passion,\n\t\tfavoriteFood : favoriteFood,\n\t\tsex : sex\n\t};\n}", "title": "" }, { "docid": "90d14146210217395c6b1fadd6d76a92", "score": "0.5179097", "text": "function extendProperties( source, properties ) {\n for (var property in properties) {\n if (properties.hasOwnProperty(property)) {\n source[property] = properties[property];\n }\n }\n return source;\n }", "title": "" }, { "docid": "5ad6c7aecd0d8b9668bacc2403ae6272", "score": "0.51442635", "text": "function pick(obj,prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = {};\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n result[pn] = obj[pn];\r\n }\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "5ad6c7aecd0d8b9668bacc2403ae6272", "score": "0.51442635", "text": "function pick(obj,prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = {};\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n result[pn] = obj[pn];\r\n }\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "5ad6c7aecd0d8b9668bacc2403ae6272", "score": "0.51442635", "text": "function pick(obj,prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = {};\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n result[pn] = obj[pn];\r\n }\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "de8734f71b00a96af56b1ef5184f4a00", "score": "0.5123014", "text": "function createElement(_properties, groupable){\n if (_properties.constructor === Array && _properties.length >= 1) { //check if the _properties is an array and if there is at least one property name\n var obj = {};\n for (var i = 0; i < _properties.length; i+=2) {\n obj[_properties[i]]=_properties[i+1];\n };\n debugLog(\">>>Temporary object created: \" + obj[_properties[0]])\n if (_properties.length == 1) {\n debugLog(\"\\t>>WARNING: Only 1 argument in properties ( \" + _properties[0] + \" )\");\n };\n obj.hidden = false; //set as default after creation\n obj.children = [];\n\n if (groupable) {\n obj.groupable = true;\n }else{\n obj.groupable = false;\n };\n\n return obj;\n } else {\n debugLog(\"\\t>>Create element: wrong properties!\");\n };\n\n}", "title": "" }, { "docid": "c40d2a469fa20283d6e7da465492f82c", "score": "0.51194453", "text": "function property(name, age, height) {\n this.name = name;\n this.age = age;\n this.height = height;\n}", "title": "" }, { "docid": "4f9e4bb46efc57e3fda2fcb05c3de3a9", "score": "0.5114387", "text": "function newObject(){\n this.value1=1;\n this.value2=2;\n this.value3=3;\n}", "title": "" }, { "docid": "1a3ca0b1cba6d0f35da05fe0fd206f14", "score": "0.51062834", "text": "function translateProperties(extProperties) {\n if (typeof extProperties !== \"object\") {\n throw new Error(errors.invalid_members);\n }\n var members = {};\n\n Object.keys(extProperties)\n .forEach(function forEachKey(key) {\n members[key] = self(extProperties[key]);\n });\n\n return members;\n }", "title": "" }, { "docid": "65a4e91852f9cfe5578237641c91542a", "score": "0.5097265", "text": "_assembleNewProfile() {\n // create and populate newProfile object\n const newProfile = _.cloneDeep(this.get('profile')) || {};\n const { name, columnGroup, columnGroupView, metaGroup } = this.getProperties('name', 'columnGroup', 'columnGroupView', 'metaGroup');\n newProfile.name = name?.trim();\n newProfile.columnGroup = columnGroup;\n newProfile.columnGroupView = columnGroupView;\n newProfile.metaGroup = metaGroup;\n newProfile.preQuery = this._getPreQueryString();\n\n // if profile is missing contentType property, set it to PUBLIC\n if (!newProfile.hasOwnProperty('contentType')) {\n newProfile.contentType = CONTENT_TYPE_PUBLIC;\n }\n\n return newProfile;\n }", "title": "" }, { "docid": "31d7e478e6fcf53ec2e296157f8e4dae", "score": "0.5095835", "text": "function MyConstructor(pMake,pModel,pYear,pColor){\n //this.propertyName creates the property of propertyName for the object that we will create\n this.make = pMake\n this.model = pModel\n this.year = pYear\n this.color = pColor\n}", "title": "" }, { "docid": "96486f46ae9111c18497298b09c48239", "score": "0.5089686", "text": "function createProperties(el) {\n\tvar properties = {};\n\n\tif (!el.hasAttributes()) {\n\t\treturn properties;\n\t}\n\n\tvar ns;\n\tif (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {\n\t\tns = el.namespaceURI;\n\t}\n\n\tvar attr;\n\tfor (var i = 0; i < el.attributes.length; i++) {\n\t\t// use built in css style parsing\n\t\tif(el.attributes[i].name == 'style'){\n\t\t\tattr = createStyleProperty(el);\n\t\t}\n\t\telse if (ns) {\n\t\t\tattr = createPropertyNS(el.attributes[i]);\n\t\t} else {\n\t\t\tattr = createProperty(el.attributes[i]);\n\t\t}\n\n\t\t// special case, namespaced attribute, use properties.foobar\n\t\tif (attr.ns) {\n\t\t\tproperties[attr.name] = {\n\t\t\t\tnamespace: attr.ns\n\t\t\t\t, value: attr.value\n\t\t\t};\n\n\t\t// special case, use properties.attributes.foobar\n\t\t} else if (attr.isAttr) {\n\t\t\t// init attributes object only when necessary\n\t\t\tif (!properties.attributes) {\n\t\t\t\tproperties.attributes = {}\n\t\t\t}\n\t\t\tproperties.attributes[attr.name] = attr.value;\n\n\t\t// default case, use properties.foobar\n\t\t} else {\n\t\t\tproperties[attr.name] = attr.value;\n\t\t}\n\t};\n\n\treturn properties;\n}", "title": "" }, { "docid": "dec7cc803395c0a77dbcacafefd9f490", "score": "0.5083685", "text": "static RetrieveCustomProperties(object) {\r\n if(object.properties) { //Check if the object has custom properties\r\n if(Array.isArray(object.properties)) { //Check if from Tiled v1.3 and above\r\n object.properties.forEach(function(element){ //Loop through each property\r\n this[element.name] = element.value; //Create the property in the object\r\n }, object); //Assign the word \"this\" to refer to the object\r\n } else { //Check if from Tiled v1.2.5 and below\r\n for(var propName in object.properties) { //Loop through each property\r\n object[propName] = object.properties[propName]; //Create the property in the object\r\n }\r\n }\r\n delete object.properties; //Delete the custom properties array from the object\r\n }\r\n return object; //Return the new object w/ custom properties\r\n }", "title": "" }, { "docid": "14d5c43113f8550f15fdb2766fc7b28e", "score": "0.5070834", "text": "constructor(object, property, computed = false, doubtful = false) {\n super();\n\n this.object = object;\n this.property = property;\n this.computed = computed;\n this.doubtful = doubtful;\n }", "title": "" }, { "docid": "aea5f40b3d2e990577579e6f495a5739", "score": "0.5061964", "text": "function createSelectionObject(values) {\n values = values || {};\n\n return {\n selecting: false,\n startRow: values.startRow || 0,\n startCell: values.startCell || 0,\n endRow: values.endRow || 0,\n endCell: values.endCell || 0\n };\n }", "title": "" }, { "docid": "dee9f5266b9e0749a52771ca7edf31f3", "score": "0.5057496", "text": "function createPersonObject(name, age){\n return {\n name: name,\n age: age\n };\n}", "title": "" }, { "docid": "f8ba3db4a9923dff370e2aa4e7af6359", "score": "0.5055571", "text": "newBasicProp(...args){\n let newProp = new BasicProperty(...args);\n this.addProperty(newProp);\n }", "title": "" }, { "docid": "02d03bacb8e0455174bbf3cb9acd73bc", "score": "0.50156856", "text": "function createProperty(attr) {\n\tvar name, value, isAttr;\n\n\t// using a map to find the correct case of property name\n\tif (propertyMap[attr.name]) {\n\t\tname = propertyMap[attr.name];\n\t} else {\n\t\tname = attr.name;\n\t}\n\t// special cases for data attribute, we default to properties.attributes.data\n\tif (name.indexOf('data-') === 0 || name.indexOf('aria-') === 0) {\n\t\tvalue = attr.value;\n\t\tisAttr = true;\n\t} else {\n\t\tvalue = attr.value;\n\t}\n\n\treturn {\n\t\tname: name\n\t\t, value: value\n\t\t, isAttr: isAttr || false\n\t};\n}", "title": "" }, { "docid": "6d3c67fddefab6795d760d83394384e4", "score": "0.5008184", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}", "title": "" }, { "docid": "f386c8e74bf93b55fd1fc6e19226a473", "score": "0.5004245", "text": "_upgradeProperties(props) {\n props.forEach(prop => {\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n });\n }", "title": "" }, { "docid": "bcfd53c16418e0d2be8236a1ab587e8f", "score": "0.49971312", "text": "function ensurePropertyFunctions (opts) {\n let properties = opts.properties;\n let names = Object.keys(properties || {});\n return names.reduce(function (descriptors, descriptorName) {\n descriptors[descriptorName] = opts.properties[descriptorName];\n if (typeof descriptors[descriptorName] !== 'function') {\n descriptors[descriptorName] = propertiesInit(descriptors[descriptorName]);\n }\n return descriptors;\n }, {});\n}", "title": "" }, { "docid": "82d83b772fd55c8a16d653152c1b7700", "score": "0.49906427", "text": "function populate (src, properties) {\n const dest = {}\n R.forEach(fillProp_(dest, src), properties)\n return dest\n}", "title": "" }, { "docid": "b36000601c55b27fadd3a817c1c17f23", "score": "0.49887046", "text": "function createMenuItem(itemName, itemPrice, itemCategory){\n // decalre a new object with the three properties\n // changed parameter names to not match the property names\n const anotherItem = {name: itemName, price: itemPrice, category: itemCategory};\n // return whatever is now stored in the object\n return anotherItem;\n}", "title": "" }, { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.49795127", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.49795127", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "f828fa69c7d67bf9e2d8c3f175af5df9", "score": "0.49761528", "text": "pick(propNamesToPick) {\n const toPick =\n propNamesToPick instanceof PropDefs\n ? propNamesToPick.propTypes()\n : propNamesToPick;\n\n return this._cloneWith({\n propTypes: pick(this._propTypes, toPick),\n defaultProps: pick(this._defaultProps, toPick),\n });\n }", "title": "" }, { "docid": "48c0e4fec90575c4cddf71ff84d2aed4", "score": "0.49739996", "text": "function pickWith(test, obj) {\n var copy = {},\n props = keys(obj), prop, val;\n for (var idx = 0, len = props.length; idx < len; idx++) {\n prop = props[idx];\n val = obj[prop];\n if (test(val, prop, obj)) {\n copy[prop] = val;\n }\n }\n return copy;\n }", "title": "" }, { "docid": "96ec7dbf0584c100cff698ca3c621d2f", "score": "0.49681193", "text": "pick(options = {}) {\n const {\n additionalProperties = false,\n id = this.id,\n properties = [],\n required,\n } = options;\n return new JSONSchemaResource({\n additionalProperties,\n id,\n properties: pick(this.properties, properties),\n required: isUndefined(required) ? intersection(this.required, properties) : required,\n type: 'object',\n });\n }", "title": "" }, { "docid": "88aa3b43715f12a91eb2941976a626bb", "score": "0.49543363", "text": "function propertyToSelector(propertyName) {\n switch (propertyName) {\n case \"title\":\n return { objectName: \"title\", propertyName: \"visible\" };\n case \"xAxis\":\n return { objectName: \"categoryAxis\", propertyName: \"visible\" };\n case \"yAxis\":\n return { objectName: \"valueAxis\", propertyName: \"visible\" };\n case \"legend\":\n return { objectName: \"legend\", propertyName: \"visible\" };\n case \"titleText\":\n return { objectName: \"title\", propertyName: \"titleText\" };\n case \"titleAlign\":\n return { objectName: \"title\", propertyName: \"alignment\" };\n case \"titleSize\":\n return { objectName: \"title\", propertyName: \"textSize\" };\n case \"titleColor\":\n return { objectName: \"title\", propertyName: \"fontColor\" };\n }\n}", "title": "" }, { "docid": "4dda7a15b305411ea8c9a5b20fd76db5", "score": "0.49532154", "text": "function pick(obj) {\n var args = Array.prototype.slice.call(arguments);\n args.shift();\n\n if (args.length === 1 && Array.isArray(args[0])) {\n args = args[0];\n }\n\n var result = {};\n\n args.forEach(function(name) {\n if (obj.hasOwnProperty(name)) {\n result[name] = obj[name];\n }\n });\n\n return result;\n}", "title": "" }, { "docid": "beae37a71ea92266e11404d7d04ee24d", "score": "0.493697", "text": "function createCar(property, value) {\n var car = {};\n car[property] = value;\n\n return car;\n}", "title": "" }, { "docid": "dfaee6a3681f3a920e8e609ca1ce9cd0", "score": "0.4934342", "text": "function createPropertyView(options) {\n switch(options.type) {\n case 'string': return new StringPropertyView(options.title,options.property,options.multilingual,options.multivalue,options.editable,false);\n case 'text' : return new StringPropertyView(options.title,options.property,options.multilingual,options.multivalue,options.editable,true);\n case 'uri' : return new UriPropertyView(options.title,options.property,options.multivalue,options.editable);\n case 'concept' : return new ConceptPropertyView(options.title,options.property,options.droppable,options.editable);\n }\n }", "title": "" }, { "docid": "87f41bb979bc5f9f8c02deca4c246952", "score": "0.49309784", "text": "function creator (obj, array, newValue, options, modifier, index) {\n var n = array.length\n var base = obj\n var i = index\n var key = array[i]\n for (++i; i < n; ++i) {\n var prevKey = key\n key = array[i]\n base = base[prevKey] = _.isNumber(key) ? [] : {}\n }\n\n return modifier(base, key, newValue, base[key], false, options)\n}", "title": "" }, { "docid": "6212ec83e16aebfb367088a2d27f4d11", "score": "0.4927747", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnScenePropsFromCloudFormation(resourceProperties);\n const ret = new CfnScene(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "75312860fbd5f792036fc5ba45dcba84", "score": "0.4926123", "text": "function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n }", "title": "" }, { "docid": "75312860fbd5f792036fc5ba45dcba84", "score": "0.4926123", "text": "function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n }", "title": "" }, { "docid": "75312860fbd5f792036fc5ba45dcba84", "score": "0.4926123", "text": "function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n }", "title": "" }, { "docid": "75312860fbd5f792036fc5ba45dcba84", "score": "0.4926123", "text": "function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n }", "title": "" }, { "docid": "75312860fbd5f792036fc5ba45dcba84", "score": "0.4926123", "text": "function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n }", "title": "" }, { "docid": "8d25c3dc16be4bd6761ef873990476d9", "score": "0.49255922", "text": "constructor(properties) {\n\t\tthis.properties = properties;\n\t}", "title": "" }, { "docid": "8b90edd42695be0aa001d9aff7beb244", "score": "0.49127275", "text": "build() {\n return cloneDeep(pickBuiltProperties(this.properties));\n }", "title": "" }, { "docid": "cd36f4d031c496139f12e3d8a16fc3e4", "score": "0.49116763", "text": "function translate(properties)\n\t{\n\t\tvar translated = {};\n\t\tvar property;\n\t\t\n\t\tfor (property in properties)\n\t\t{\n\t\t\tswitch (property)\n\t\t\t{\n\t\t\t\tcase 'label':\n\t\t\t\tcase 'required':\n\t\t\t\tcase 'minlength':\n\t\t\t\tcase 'maxlength':\n\t\t\t\t\t// these properties are the same so just copy\n\t\t\t\t\ttranslated[property]=properties[property];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'minvalue': translated['min']=properties[property];break;\n\t\t\t\tcase 'maxvalue': translated['max']=properties[property];break;\n\t\t\t\tcase 'mask': translated['regex']=properties[property];break;\n\t\t\t\tcase 'type':\n\t\t\t\t\tswitch (properties[property].toLowerCase())\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'short':\n\t\t\t\t\t\tcase 'int':\n\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\tcase 'long':\n\t\t\t\t\t\t\ttranslated['int']=true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'float':\n\t\t\t\t\t\tcase 'double':\n\t\t\t\t\t\tcase 'bigdecimal':\n\t\t\t\t\t\t\ttranslated['float']=true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t\ttranslated['date']='m/d/yy';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'typeConverter':\n\t\t\t\t\tswitch (properties[property])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'CreditCardTypeConverter':translated['creditCard']=true;break;\n\t\t\t\t\t\tcase 'EmailTypeConverter':translated['email']=true;break;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn translated;\n\t}", "title": "" }, { "docid": "52a515969e242d6711eae3e12efcdecb", "score": "0.4910553", "text": "setProperties(properties) {\n this.wrapped.properties = Object.assign({}, properties);\n return this;\n }", "title": "" }, { "docid": "65b99f190cf9eff78a6209b2895fe548", "score": "0.4902622", "text": "function fR(a){return function(b,c){b.constructor.hasOwnProperty(\"properties\")||Object.defineProperty(b.constructor,\"properties\",{value:{}});b.constructor.properties[c]=Object.assign(Object.assign({},b.constructor.properties[c]),a)}}", "title": "" }, { "docid": "c88aa3228f33ceb77a2bcea6002aa218", "score": "0.48995286", "text": "function newProp() {\n if( gPropertyHash == null || gPropertyHash.length < 1 ) {\n \t/* propArray might be null if we have no properties in the system */\n \tdoNoPropsWarning();\n }else{\n \tvar innerNew = function (){\n var newP = {};\n \tnewP.domainClass = gEntity.vClassId;\n \tnewP.subjectName = gEntity.name;\n \tnewP.subjectEntURI = gEntity.URI;\n\n \tfillForm( newP );\n \teditingNewProp = true;\n \tfillRangeVClassList();\n \tvar table = dwr.util.byId(\"propbody\");\n var tr = table.insertRow(0);\n \ttr.id = \"newrow\";\n \tappendPropForm( tr, tableMaxColspan( table ) );\n\n //table.insertBefore(tr, table.rows[0]);\n \t};\n \tupdateTable( innerNew );\n }\n}", "title": "" }, { "docid": "f15edbac4ba9e1cff01eeeab75195fac", "score": "0.4898487", "text": "function util_processProps(props) {\n var title = props.title,\n label = props.label,\n key = props.key,\n value = props.value;\n\n var cloneProps = es_util_objectSpread({}, props); // Warning user not to use deprecated label prop.\n\n\n if (label && !title) {\n if (!warnDeprecatedLabel) {\n warning_default()(false, \"'label' in treeData is deprecated. Please use 'title' instead.\");\n warnDeprecatedLabel = true;\n }\n\n cloneProps.title = label;\n }\n\n if (!key) {\n cloneProps.key = value;\n }\n\n return cloneProps;\n}", "title": "" }, { "docid": "28725e8cbdcd40fda29bcd796cf3051a", "score": "0.48821414", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnMemberPropsFromCloudFormation(resourceProperties);\n const ret = new CfnMember(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "2604117ed57a9b0edd7a250babd77f28", "score": "0.48806968", "text": "function selectProperties({ query, model, queryHandler, selectProps, options }) {\n const { mode, distinct } = options;\n const { tableName, objectMap, arrayMap } = model;\n return new Promise((resolve, reject) => {\n getWhereStatement(model, query)\n .then((where) => {\n const text = `\n SELECT${distinct ? ' DISTINCT' : '' } ${selectProps.join(', ')}\n FROM ${tableName}\n ${ where ? 'WHERE ' + where : '' };`;\n \n function mapResults(results) {\n if (mode === 'object') {\n return objectMap(results);\n } else {\n return arrayMap(results);\n }\n }\n \n return queryHandler({ text, rowMode: 'array' })\n .then(mapResults)\n .then(resolve);\n })\n .catch(reject);\n });\n}", "title": "" }, { "docid": "a351db5fc6b9de4aebf9d1ea323f0d81", "score": "0.48732853", "text": "function makeUserShorthand(name, age) {\n return {\n name,\n age\n };\n}", "title": "" }, { "docid": "9cb28ebe4d4830b538fffd9f3e60b698", "score": "0.4871967", "text": "computed(target) {\n\n for (let i = 1; i < arguments.length; i += 3) {\n\n let desc = Object.getOwnPropertyDescriptor(arguments[i + 1], \"_\");\n mergeProperty(target, arguments[i], desc, true);\n\n if (i + 2 < arguments.length)\n mergeProperties(target, arguments[i + 2], true);\n }\n\n return target;\n }", "title": "" }, { "docid": "1f6cb28680ff12932c2f4021f7407c59", "score": "0.48703402", "text": "function Make () {\n //Properties \n}", "title": "" }, { "docid": "1f6cb28680ff12932c2f4021f7407c59", "score": "0.48703402", "text": "function Make () {\n //Properties \n}", "title": "" }, { "docid": "1f6cb28680ff12932c2f4021f7407c59", "score": "0.48703402", "text": "function Make () {\n //Properties \n}", "title": "" }, { "docid": "2c5547ec6ae98ce2d23f022775e4c681", "score": "0.48621532", "text": "static initialize(obj, field, operator, predicates) { \n obj['field'] = field;\n obj['operator'] = operator;\n obj['predicates'] = predicates;\n }", "title": "" }, { "docid": "43e28ecc28a227e907e0f711ad6c1fab", "score": "0.48589635", "text": "function ConstructObjects(name,age,gender)\r\n {\r\n this.name = name;\r\n this.age = age;\r\n this.gender = gender;\r\n }", "title": "" }, { "docid": "be63cd8a86a7461e25104bd6bb1ddbec", "score": "0.48589057", "text": "function ensurePropertyFunctions(opts) {\n var props = opts.properties;\n var names = Object.keys(props || {});\n return names.reduce(function (descriptors, descriptorName) {\n descriptors[descriptorName] = opts.properties[descriptorName];\n if (typeof descriptors[descriptorName] !== 'function') {\n descriptors[descriptorName] = (0, _property2['default'])(descriptors[descriptorName]);\n }\n return descriptors;\n }, {});\n }", "title": "" }, { "docid": "fd395ec8dac589d55362feca0dddda91", "score": "0.48555982", "text": "setProperties(properties) {\n\n var changes = [];\n\n for (var key in properties) {\n var newValue = properties[key];\n var oldValue = this[key];\n\n // note that type=delete is NOT supported\n // since it requires properties to actually be deleted. This\n // is not something we want to do since it causes uneccessary GC cycles\n if (oldValue == void 0) {\n this._addChange({\n type: 'add',\n object: this,\n name: key\n });\n } else {\n this._addChange({\n type: 'update',\n object: this,\n name: key,\n oldValue: oldValue\n });\n }\n }\n\n Object.assign(this, properties);\n }", "title": "" }, { "docid": "a11929e40181c809ca4210aa39beb17d", "score": "0.48532662", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "30a99cab40688582f81b16aa50e7d667", "score": "0.48523736", "text": "function initializeProperties(initialProperties, userData, fields){\n fields.split(' ').forEach(function(fieldName){\n initialProperties[fieldName] = userData[fieldName];\n });\n}", "title": "" }, { "docid": "bf2f453baa37651902b213c9c56a4a8b", "score": "0.4847204", "text": "function assign() {\n var args = Array.prototype.slice.call(arguments, 0);\n var to = Object(args[0]);\n\n if(args.length !== 1) {\n var sources = args.slice(1);\n var nextSource, keys, from, nextKey, propValue;\n\n for(var i = 0; i < sources.length; i++) {\n nextSource = sources[i];\n from = Object(nextSource);\n\n if(typeof nextSource === 'undefined' || nextSource === null) {\n keys = [];\n } else {\n keys = Object.keys(from);\n }\n\n for(var j = 0; j < keys.length; j++) {\n nextKey = keys[j];\n propValue = from[nextKey];\n if(typeof propValue !== 'undefined' && from.propertyIsEnumerable(nextKey)) {\n to[nextKey] = propValue;\n }\n }\n }\n }\n\n return to;\n}", "title": "" }, { "docid": "21c6ceea84fd1eaa67b622a9335d0d0b", "score": "0.48442882", "text": "constructor(props) {\n this.setName(props.name);\n this.setSections(props.sections);\n this.setTemplate(props.template);\n\n this.setCreatedAt(props.created_at);\n this.setUpdatedAt(props.updated_at);\n }", "title": "" }, { "docid": "9a49ccaa62e1cbc122dc4f79578a0ae6", "score": "0.48411715", "text": "copy(source) {\n // Given that all source and this params are always defined:\n this.m_params.fontName = source.fontName;\n this.m_params.fontSize = Object.assign({}, source.fontSize);\n this.m_params.fontStyle = source.fontStyle;\n this.m_params.fontVariant = source.fontVariant;\n this.m_params.rotation = source.rotation;\n this.m_params.color.copy(source.color);\n this.m_params.backgroundColor.copy(source.backgroundColor);\n this.m_params.opacity = source.opacity;\n this.m_params.backgroundOpacity = source.backgroundOpacity;\n return this;\n }", "title": "" }, { "docid": "9a49ccaa62e1cbc122dc4f79578a0ae6", "score": "0.48411715", "text": "copy(source) {\n // Given that all source and this params are always defined:\n this.m_params.fontName = source.fontName;\n this.m_params.fontSize = Object.assign({}, source.fontSize);\n this.m_params.fontStyle = source.fontStyle;\n this.m_params.fontVariant = source.fontVariant;\n this.m_params.rotation = source.rotation;\n this.m_params.color.copy(source.color);\n this.m_params.backgroundColor.copy(source.backgroundColor);\n this.m_params.opacity = source.opacity;\n this.m_params.backgroundOpacity = source.backgroundOpacity;\n return this;\n }", "title": "" }, { "docid": "a10e901832df6edb183f8a17d20c6f0c", "score": "0.48377004", "text": "function create(prototype, props) {\r\n var result = baseCreate(prototype);\r\n if (props) extendOwn(result, props);\r\n return result;\r\n }", "title": "" }, { "docid": "a10e901832df6edb183f8a17d20c6f0c", "score": "0.48377004", "text": "function create(prototype, props) {\r\n var result = baseCreate(prototype);\r\n if (props) extendOwn(result, props);\r\n return result;\r\n }", "title": "" }, { "docid": "c2df0088115ad0eae2f8045d0ff561e2", "score": "0.48359898", "text": "constructor(target, propertyName) {\n this.target = target;\n this.propertyName = propertyName;\n }", "title": "" } ]
022422020b05ca854b3310bc135a5260
Sets selection bar width to be all visible elements + 20px on load and resize.
[ { "docid": "17e2f959b1f044e7d12f78bce38faa3a", "score": "0.0", "text": "function fixHeaderWidth() {\r\n var width;\r\n var slide = $('.selection-nav .scroll-fix');\r\n if (slide.length) {\r\n width = 20;\r\n $(slide[0]).children().not('.nav-hidden, .nav-unpublished').each(function () {\r\n width += $(this).outerWidth(true);\r\n });\r\n slide.width(width);\r\n\r\n var selectionnav = $('.selection-nav');\r\n //Toggles scroll buttons\r\n if (width > selectionnav.outerWidth()) {\r\n if (!selectionnav.hasClass('show')) {\r\n selectionnav.addClass('show');\r\n }\r\n }\r\n else {\r\n if (selectionnav.hasClass('show')) {\r\n selectionnav.removeClass('show');\r\n }\r\n }\r\n }\r\n\r\n slide = $('.nav-nav .scroll-fix');\r\n if (slide.length) {\r\n width = 20;\r\n $(slide[0]).children().not('.nav-hidden, .nav-unpublished').each(function () {\r\n width += $(this).outerWidth(true);\r\n });\r\n slide.width(width);\r\n\r\n var navnav = $('.nav-nav');\r\n //Toggles scroll buttons\r\n if (width > navnav.outerWidth()) {\r\n if (!navnav.hasClass('show')) {\r\n navnav.addClass('show');\r\n }\r\n }\r\n else {\r\n if (navnav.hasClass('show')) {\r\n navnav.removeClass('show');\r\n }\r\n }\r\n }\r\n}", "title": "" } ]
[ { "docid": "97e24ba5047e121509076b4741630bc0", "score": "0.63265127", "text": "function setOptionsElementWidth() {\n optionsElement.style.width = getScreenSizeDelta() > 1.0000001 ? '150.4px' : '165px';\n}", "title": "" }, { "docid": "c7f50100c6463e54993bed78e4feb614", "score": "0.6312633", "text": "function set_dropdown_width() {\n\n if ( window.screen.availWidth > 500 ) {\n $('#ddhistory').css('width', 'auto');\n }else{\n $('#ddhistory').css('width', window.screen.availWidth - 20);\n }\n\n}", "title": "" }, { "docid": "d705ecf361c6fe1324f57c14b99263da", "score": "0.62738794", "text": "function onResize(reflow) {\n $.each($(\".zselect\"), function (k, v) {\n $(v).find(\"ul\").attr('style', 'width:' + $(v).outerWidth() + 'px!important;');\n });\n\n }", "title": "" }, { "docid": "65fc7eda0a3c9b5594117f4ba7c39282", "score": "0.62607306", "text": "function setSVGSize() {\n\n const display = this._select.style(\"display\");\n this._select.style(\"display\", \"none\");\n\n let [w, h] = getSize(this._select.node().parentNode);\n w -= parseFloat(this._select.style(\"border-left-width\"), 10);\n w -= parseFloat(this._select.style(\"border-right-width\"), 10);\n h -= parseFloat(this._select.style(\"border-top-width\"), 10);\n h -= parseFloat(this._select.style(\"border-bottom-width\"), 10);\n this._select.style(\"display\", display);\n\n if (this._autoWidth) {\n this.width(w);\n this._select.style(\"width\", `${this._width}px`).attr(\"width\", `${this._width}px`);\n }\n if (this._autoHeight) {\n this.height(h);\n this._select.style(\"height\", `${this._height}px`).attr(\"height\", `${this._height}px`);\n }\n\n }", "title": "" }, { "docid": "0cc849e011af65d4bb8ce03da768942e", "score": "0.62253326", "text": "function multiSelectAreaSet(){\r\n var bestWidth = 1380;\r\n\r\n if ($(\"#costReportsPage\").length > 0) {\r\n bestWidth = 1340;\r\n }\r\n\r\n var width = $(window).width();\r\n if($('.filterContainer').length>0){\r\n if(width < bestWidth){\r\n $('.filterContainer').removeClass('filterContainer1400');\r\n }else{\r\n $('.filterContainer').addClass('filterContainer1400');\r\n }\r\n $('.rightFilterContent').width($('.filterContainer').width()-$('.leftFilterContent').width() - 10);\r\n }\r\n}", "title": "" }, { "docid": "c10520bbfb26b3f551daff1e5f26b798", "score": "0.60902745", "text": "function setScrollBar() {\n if (treeSvg.width() < SvgNodePane.getWidth()) {\n treeSvg.css('overflow-x', 'auto');\n }\n else {\n treeSvg.css('overflow-x', 'hidden');\n }\n }", "title": "" }, { "docid": "c2fb81cdad91641dde3fc571d3c8b8eb", "score": "0.6045061", "text": "function setSizes() {\n knobSize = windowWidth / 10;\n barWidth = windowWidth / 4;\n barHeight = windowHeight / 40;\n}", "title": "" }, { "docid": "62952e28cba8b59da76a4572beb4694d", "score": "0.6006422", "text": "function setWidths() {\n tl.itemWidth = tl.wrap.offsetWidth / tl.settings.visibleItems;\n tl.items.forEach(function (item) {\n item.style.width = \"\".concat(tl.itemWidth, \"px\");\n });\n tl.scrollerWidth = tl.itemWidth * tl.items.length;\n tl.scroller.style.width = \"\".concat(tl.scrollerWidth, \"px\");\n } // Set height of items and viewport", "title": "" }, { "docid": "d9b6c616fd986eeb9374786c5edcd3b7", "score": "0.59884423", "text": "function adjustSelectWidth() {\n var inputWidth = $(\"#body form .form-group>div>div\").outerWidth();\n\n $(\"#body form .form-group>div>div>button\").css({\n \"width\": inputWidth + \"px\"\n });\n }", "title": "" }, { "docid": "85a392a58abdc51cb3014a6b59e3dfc9", "score": "0.59875774", "text": "function loadChatWidth() {\n var select = d.querySelector('#boostChatWidth');\n var sidebar = d.querySelector('#rechtespalte');\n var container = sidebar.parentNode.querySelectorAll(':scope > div:not(#rechtespalte):not(#boostSettingContainer)');\n var size = 1;\n for(size; size <= 12; size++) {\n if(sidebar.classList.contains('col-md-' + size.toString())) {\n\n sidebar.classList.remove('col-md-' + size.toString());\n sidebar.classList.add(getValue('chatWidth'));\n\n var invertedSize = 12 - size;\n var mainWidth = getValue('chatWidth').match(/col\\-md\\-([0-9]{1,2})/);\n var invertedSettingSize = 12 - parseInt(mainWidth[1]);\n for(var c = 0; c < container.length; c++) {\n container[c].classList.remove('col-md-' + invertedSize.toString(),'hide');\n if(invertedSettingSize > 0) {\n container[c].classList.add('col-md-' + invertedSettingSize.toString());\n } else {\n container[c].classList.add('hide');\n }\n }\n\n break;\n }\n }\n select.value = getValue('chatWidth');\n }", "title": "" }, { "docid": "18587778b53b4ceaaffcc8a75fc14964", "score": "0.59806436", "text": "updateWidth () {\n if (!!this.isVisible || this.model.expanded) {\n this.getView().style.visibility = 'visible'\n this.getView().style.pointerEvents = 'auto'\n } else {\n this.getView().style.visibility = 'hidden'\n this.getView().style.pointerEvents = 'none'\n }\n if (!!this.isVisible && (this.shouldRedraw || this.modelUpdated)) {\n let w = this.edRect.right - RESULT_OFFSET - 10 - this.left\n if (w < MIN_RESULT_WIDTH) w = MIN_RESULT_WIDTH\n if (this.edRect.width > 0 && this.left + RESULT_OFFSET + w > this.edRect.right) {\n this.getView().style.left = (this.edRect.right - w - 10 - this.left) + 'px'\n this.getView().style.opacity = 0.75\n } else {\n this.getView().style.left = RESULT_OFFSET + 'px'\n this.getView().style.opacity = 1.0\n }\n this.getView().parentElement.style.maxWidth = (this.winWidth - RESULT_OFFSET - 10 - this.left) + 'px'\n this.getView().style.maxWidth = w + 'px'\n this.modelUpdated = false\n }\n }", "title": "" }, { "docid": "461ce42abfb9e7a1e46018e86dabe21f", "score": "0.59804004", "text": "setSlideWidths() {\n let itemWidths = 100 / this.slideCount;\n this.slidertrack.children().css('width', itemWidths + \"%\");\n }", "title": "" }, { "docid": "2c1840e3c71834562482b282561ef097", "score": "0.59341687", "text": "scaleHistogramWidth() {\n this.$node.selectAll('.bar')\n .style('width', (d) => {\n if (ChangeTypes.TYPE_ARRAY.filter((ct) => ct.type === d.ct.type)[0].isActive) {\n return this.histogramScale(d.value) + 'px';\n }\n return 0; // shrink bar to 0 if change is not active\n });\n }", "title": "" }, { "docid": "fdb9d0f23e66b562d8a9d954acfe8b84", "score": "0.5917129", "text": "function updateSideBarSize(){\r\n\r\n // sideBar.style.width = (window.innerWidth - mainCanvas.width - 20) + \"px\";\r\n // // 20px cus sometimes we have the scroll bar on right and that takes ~20px\r\n // sideBar.style.height = window.innerHeight + \"px\";\r\n }", "title": "" }, { "docid": "1bf998fc6495248b6e793909daac35a1", "score": "0.5911764", "text": "function setListSize() {\n\t\tvar percentage = 100.0 / progressBarDots.length;\n\t\t$(progressBarDots).each(function() {\n\t\t\t$(this).css('width', percentage + '%');\n\t\t});\n\t}", "title": "" }, { "docid": "69ccd85a89c9542b2764b29ac3d37b00", "score": "0.5907085", "text": "function setTabWidth(){\r\nvar totalTabs = $('.ms-widget ul.x620').children().length;\r\nif(totalTabs >= 6){\r\n var tabWidth = Number((100/totalTabs).toString().match(/^\\d+(?:\\.\\d{0,2})?/));\r\n $('.ms-widget ul.x620 li').css('width',tabWidth+'%');\r\n $('.ms-widget ul.x620 li .selBg').css('width',tabWidth+'%');\r\n $('.ms-widget ul.x620 li .tabHead').css('width',tabWidth+'%'); \r\n}\r\n \r\n}", "title": "" }, { "docid": "ead21699369d1091b06b38607359868a", "score": "0.58910745", "text": "function updateSliderWidths() {\n\t$(\".ui-slider.range-from-centre\").each(function() {\n\t\t$(\".ui-slider-range div\", this).css(\"max-width\", $(this).width() / 2 + \"px\");\n\t});\n}", "title": "" }, { "docid": "b042f1f57206d4b17ad2d61c13418ee2", "score": "0.5875677", "text": "function barsResize() {\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n // Main svg width\n container.attr(\"width\", width);\n\n // Width of appended group\n svg.attr(\"width\", width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n // Chart elements\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x',\n function (d, i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "f3cc0aee93eeba59800945fd2ecc7656", "score": "0.58715194", "text": "function dropdownWidthController() {\n\tjQuery('#primarynav .sub-menu').each(function(){\n\t\tvar bigWidth = 100;\n\t\t\tif ( jQuery(this).children().width() > bigWidth ) {\n\t\t\t\tbigWidth = jQuery(this).children().width();\n\t\t\t}\n\t\tjQuery(this).css('width', bigWidth+15 + 'px');\n\t});\n} //end dropdownWidthController()", "title": "" }, { "docid": "42c7ee8e556568965e129757a45eee0f", "score": "0.5853739", "text": "function barsResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width);\n\n // Width of appended group\n svg.attr(\"width\", width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n\n // Chart elements\n // -------------------------\n\n // Bars\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x', function(d,i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "42c7ee8e556568965e129757a45eee0f", "score": "0.5853739", "text": "function barsResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width);\n\n // Width of appended group\n svg.attr(\"width\", width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n\n // Chart elements\n // -------------------------\n\n // Bars\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x', function(d,i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "169f546caeafecc3d7bd02d00b085db4", "score": "0.58450645", "text": "function barsResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width);\n\n // Width of appended group\n svg.attr(\"width\", width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n\n // Chart elements\n // -------------------------\n\n // Bars\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x', function(d,i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "a66306f837dac87cbae4d25657660980", "score": "0.5834894", "text": "function VwdCmsSplitterBar_setTargetWidth(sbar)\n{\n\tif ( sbar == null )\n\t{\n\t\tsbar = VwdCmsSplitterBar.getCurrent();\n\t}\n\tif ( sbar )\n\t{\n\t\tvar width = 0;\n\t\t// get the primary target ( the first one in LeftResizeTargets)\n\t\tvar target = sbar.primaryResizeTarget; // sbar.leftResizeTargets[0];\n\t\tif ( target )\n\t\t{\t\t\n\t\t\t// calculate the width based on the splitterbar's location\n\t\t\twidth = getInt(sbar.splitterBar.style.left);\n\t\t\twidth -= getInt(sbar.offsetLeft);\n\t\t\twidth -= getInt(target.style.borderLeftWidth);\n\t\t\twidth -= getInt(target.style.borderRightWidth);\n\t\t\t// do not set the width to 0, 1 is the minimum\n\t\t\tif ( width < 1 ) { width = 1; }\n\n\t\t\t// set the width of the target element\n\t\t\ttarget.style.width = width + \"px\";\n\t\t\t\n\t\t\t// set the width value to the hidden field hdnWidth\n\t\t\tif ( sbar.hdnWidth )\n\t\t\t{\n\t\t\t\tsbar.hdnWidth.value = width + \"px\";\n\t\t\t}\n\t\t\t\n\t\t\t// set the width value to the saveWidthToElement\n\t\t\tif ( sbar.saveWidthToElement )\n\t\t\t{\n\t\t\t\tvar elmWidth = document.getElementById(sbar.namingContainerId + sbar.saveWidthToElement);\n\t\t\t\tif ( elmWidth == null )\n\t\t\t\t{\n\t\t\t\t\telmWidth = document.getElementById(sbar.saveWidthToElement);\n\t\t\t\t}\n\t\t\t\tif ( elmWidth ) \n\t\t\t\t{\n\t\t\t\t\telmWidth.value = width + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// output some debugging info\n\t\t\tif ( sbar.debug ) \n\t\t\t{ \n\t\t\t\tsbar.debug.value = sbar.id + \".leftResizeTargets[0].style.width='\" \n\t\t\t\t+ target.style.width + \"'\\r\\n\" + sbar.debug.value;\n\t\t\t}\n\t\t\t\n\t\t\t// resize any other LeftResizeTarget elements\n\t\t\tif ( sbar.leftResizeTargets && sbar.leftResizeTargets.length > 1 )\n\t\t\t{\n\t\t\t\tfor (var i = 1; i < sbar.leftResizeTargets.length; i++)\n\t\t\t\t{\n\t\t\t\t\ttarget = sbar.leftResizeTargets[i];\n\t\t\t\t\ttarget.style.width = width + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// resize the RightResizeTarget elements\n\t\t\t// Note: this calculation requires that the TotalWidth property is \n\t\t\t// set so we can determine the width of the RightResizeTarget elements\n\t\t\tif ( sbar.totalWidth > 0 && sbar.rightResizeTargets \n\t\t\t\t&& sbar.rightResizeTargets.length > 0 )\n\t\t\t{\n\t\t\t\twidth = sbar.totalWidth - width - sbar.splitterWidth; \n\t\t\t\tfor (var i = 0; i < sbar.rightResizeTargets.length; i++)\n\t\t\t\t{\n\t\t\t\t\ttarget = sbar.rightResizeTargets[i];\n\t\t\t\t\ttarget.style.width = width + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// always reconfigure when not in IE because\n\t\t\t// we don't get enough resize events\n\t\t\tif ( !_isIE )\n\t\t\t{\n\t\t\t\tVwdCmsSplitterBar.reconfigure();\n\t\t\t}\n\t\t\t\n\t\t\t// fire the onResize event\n\t\t\tif ( sbar.onResize )\n\t\t\t{\n\t\t\t\tsbar.onResize(sbar, width);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a26a021e5fa43a9f7f7b6bce37e21b03", "score": "0.5814864", "text": "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Axes\n // -------------------------\n\n // Horizontal range\n x.range([0, width]);\n\n // Horizontal axis\n svg.selectAll('.d3-axis-horizontal').call(xAxis);\n\n\n // Chart elements\n // -------------------------\n\n // Bar rect\n svg.selectAll('.d3-bar rect').attr(\"width\", x);\n\n // Bar text\n svg.selectAll('.d3-bar text').attr(\"x\", function (d) {\n return x(d) - 12;\n });\n }", "title": "" }, { "docid": "c7107dfecae7455b0b12db5cfed06adc", "score": "0.5789556", "text": "function setSize(selection) {\n selection\n .attr(\"width\", function(d) {return d.size[0]; })\n .attr(\"height\", function(d) {return d.size[1]; });\n}", "title": "" }, { "docid": "30dfd60ce2c012bcf0ce0e44b709dcb7", "score": "0.5788266", "text": "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "9ec8826b12951834da2392c81a94874c", "score": "0.5772778", "text": "function setProgressBarWidth(progressBar, widthChangeSize) {\n progressBar.displayWidth += parseInt(widthChangeSize);\n if(progressBar.displayWidth < 0)\n {\n progressBar.displayWidth = 0;\n progressBar.width = progressBar.displayWidth;\n }\n else if(progressBar.displayWidth >= 0 && progressBar.displayWidth <= 100)\n {\n progressBar.width = progressBar.displayWidth;\n progressBar.className = \"inner-progress-barB\";\n }\n else if(progressBar.displayWidth > 100)\n {\n progressBar.width = 100;\n progressBar.className = \"inner-progress-barR\";\n }\n }", "title": "" }, { "docid": "50c911a50ea01dc3518ebde38a53c919", "score": "0.5764577", "text": "function setSubMenuWidth () {\n\t\t\tvar W = header_main_menu.css('width');\n\t\t\tmenu_game_list.css('width', W);\n\t\t}", "title": "" }, { "docid": "4bacee92580f50cde2dd7555bc15e793", "score": "0.575872", "text": "resize() {\n const borderTotal = borderSize * data.length;\n // defaults to grabbing dimensions from container element\n width = $sel.node().offsetWidth - marginLeft - marginRight;\n height =\n $sel.node().offsetHeight - marginTop - marginBottom - borderTotal;\n\n scaleX.range([0, width]);\n scaleY.range([0, height]);\n scaleH.range([0, width]);\n\n maxFontSize = Math.floor(width * 0.0825);\n\n return Chart;\n }", "title": "" }, { "docid": "b4987083db7b2b8095bb049bda283610", "score": "0.5757151", "text": "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.width(s[0]).height(s[1]).update();\n}", "title": "" }, { "docid": "28587e65a41fb561f419a4931983c418", "score": "0.574991", "text": "function resizeOutputList(event) {\n\t\t\t\t\tselectedList.width(autocompleter.outerWidth()).offset({left: autocompleter.offset().left});\n\t\t\t\t}", "title": "" }, { "docid": "783ddfec31d60d1b9138d298705e3671", "score": "0.5748408", "text": "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "ecdf1f6873f9ad911d6929a6987b5372", "score": "0.574235", "text": "function setSelectSize(selElm)\r\n{\r\n\tpmxAddClass(selElm, (selElm.id == 'pmxallcats' ? 'singleddabs' : 'singledd'));\r\n\tselElm.onmousedown = function(){};\r\n\r\n\toptH = parseInt($('.dropdown option').css('height'));\r\n\tif(isNaN(optH))\r\n\t\toptH = parseInt($('option').css('height'));\r\n\tselElm.optH = optH;\r\n\r\n\tif(selElm.childElementCount > 10)\r\n\t{\r\n\t\taniheight = (10 * selElm.optH) + 6;\r\n\t\tselElm.size = 10;\r\n\t}\r\n\telse\r\n\t{\r\n\t\taniheight = (selElm.childElementCount * selElm.optH) + 6;\r\n\t\tselElm.size = selElm.childElementCount;\r\n\t}\r\n\t$(selElm).animate({height: aniheight},{duration: 50, easing: 'linear', complete: function(){selElm.scrollTop = (selElm.selectedIndex * selElm.optH)}});\r\n\tselElm.onclick = function(){firstClick(selElm)};\r\n\tselElm.scrollTop = (selElm.selectedIndex * selElm.optH);\r\n}", "title": "" }, { "docid": "775b711cf29c967f91f04aa2e5412af7", "score": "0.57281137", "text": "fillMultipleThumbInnerBar() {\r\n this.innerBar.style.left = this.minThumbNode.style.left;\r\n this.innerBar.style.width = `${(parseInt(this.maxThumbNode.style.left, 10) - parseInt(this.minThumbNode.style.left, 10))}px`;\r\n }", "title": "" }, { "docid": "326fc32a7fac840cf685f0e42dbe011a", "score": "0.57172745", "text": "_updateGraphSplitPaneResize () {\n this._updateGraphSize (this._graphSplitPane.current.pane1.offsetWidth);\n }", "title": "" }, { "docid": "63b9c95be4954077cee287ff897fe930", "score": "0.5708976", "text": "updateDimensions() {\n let left = this.element.offsetLeft;\n // this is the true current width\n // it is used to calculate the ink bar position\n let currentWidth = this.element.offsetWidth;\n this.setProperties({ left, currentWidth });\n }", "title": "" }, { "docid": "f5e42db07b1dacba5f2a85be9653eda3", "score": "0.5705077", "text": "function setProgressBar() {\n console.log($(\"#controls\").outerWidth());\n if ($(\"#controls\").outerWidth() < 500) {\n volumeBar.css(\"display\", \"none\");\n volumeBar.width(0);\n\n } else {\n var newWidth = parseInt($(\"#controls\").outerWidth() / 8);\n volumeBar.width(newWidth);\n volumeBar.css(\"display\", \"block\");\n }\n let width = 0;\n $(\"#controls\").children().each(function () {\n let x = $(this).outerWidth(true);\n width += x;\n });\n width = width - $(\"#progress-bar\").outerWidth() + 10;\n let progressBarWidth = ($(\"#controls\").outerWidth() - width) + \"px\";\n progressBar.css(\"width\", progressBarWidth);\n}", "title": "" }, { "docid": "1b65c749a36808a2de8733264725e92c", "score": "0.5702246", "text": "function sizeScrollbar() {\n var remainder = scrollContent.width() - scrollPane.width();\n var proportion = remainder / scrollContent.width();\n var handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\n scrollbar.find( \".ui-slider-handle\" ).css({\n width: handleSize,\n \"margin-left\": -handleSize / 2\n });\n handleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\n }", "title": "" }, { "docid": "8f881f93a21def75b1123d3a096fd6f9", "score": "0.5690344", "text": "function VwdCmsSplitterBar_reconfigure()\n{\n\tfor ( var i = 0; i < _vwdCmsSplitterBars.length; i++ )\n\t{\n\t\t_vwdCmsSplitterBars[i].configure();\n\t}\t\n}", "title": "" }, { "docid": "7ea13de5ea1377676c8b5b5554a221d5", "score": "0.56882113", "text": "function resizeMenus(){\n if($(window).width()>=800){\n let menus = $('.main-pick-menu');\n let corner = $('.main-pick-options');\n menus.css(\"width\", corner.css(\"width\"));\n }\n}", "title": "" }, { "docid": "031035589367990445b963f6a7a35319", "score": "0.5686665", "text": "function ajustProcessBarContainerLength(barContainerSelector, processBarSelector, processValSelector){\n \n $(document).ready(function() {\n \tcalc(barContainerSelector, processValSelector);\n });\n\n $(window).on('resize', function () {\n \tcalc(barContainerSelector, processValSelector);\n });\n\n function calc(barContainerSelector, processValSelector){\n \tvar barContainerWidth = $(barContainerSelector).width();\n \tvar barContainerParentWidth = $(barContainerSelector).parent().width();\n var processValWidth = $(processValSelector).width();\n console.log('ajustProcessBarContainerLength - barContainerWidth: ' + barContainerWidth + ', barContainerParentWidth: ' + barContainerParentWidth + ', processValWidth: ' + processValWidth);\n $(barContainerSelector).width(barContainerParentWidth-processValWidth-2+'px');\n }\n}", "title": "" }, { "docid": "1d51a324a93ea9a325fd37b80eaed4de", "score": "0.56828487", "text": "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "title": "" }, { "docid": "86d57326f91e5ef565b4dbd4bc1c6c1d", "score": "0.5682427", "text": "function afterCalculation() {\n if (_self.initialWidth < 0.4)\n _self.initialWidth = 0.4;\n else if (_self.initialWidth > 0.95)\n _self.initialWidth = 1.0;\n _self.calculatePositions();\n apf.layout.forceResize(tabEditors.parentNode.$ext);\n }", "title": "" }, { "docid": "bcea7401f416c84812ba61d38482b167", "score": "0.56793773", "text": "setFixedBarsSizeAndPosition() {\n\t\tconst fixedBars = this.bars.filter(b=> b.bar.isFixed === true && window.getComputedStyle(b.bar.element).visibility !== 'hidden');\n\t\tconst win = {\n\t\t\ttitleBarEl: {offsetHeight: 0},\n\t\t\tdefaultBorderSize: 0,\n\t\t\t_currentTop: 0,\n\t\t\t_currentBottom: 0,\n\t\t\t_currentLeft: 0,\n\t\t\t_currentWidth: window.innerWidth,\n\t\t\t_currentHeight: window.innerHeight,\n\t\t};\n\t\tthis.setWindowBarsSizeAndPosition(fixedBars, win, this, false);\n\t}", "title": "" }, { "docid": "9e5a44d6c2a2e3f6847bb6911f0c9eda", "score": "0.56792796", "text": "function setSize() {\n\n // Disable overflow scrolling (hack)\n d3.select('body').style('position', 'relative');\n // update variables\n width = document.getElementById(container).offsetWidth;\n height = document.getElementById(container).offsetHeight;\n diameter = getDiameter();\n\n // reset the sizes\n d3.select('#'+container)\n .select('svg')\n .style('width',width+'px')\n .style('height',height+'px')\n .select('g')\n .attr('transform', 'translate('+(width/2)+','+((height/2)+(margin/2))+')'); // centering\n\n d3.select(self.frameElement)\n .style(\"height\", diameter + \"px\");\n\n // Apply overflow scrolling hack for iOS\n d3.select('body').style('position', 'fixed');\n\n setSidebarContentHeight();\n }", "title": "" }, { "docid": "0910542f4c8f4b4529e54cc60f8ecae2", "score": "0.56770545", "text": "function update_selection_counter(selection_size) {\n $(\"#filtered-items\").text(selection_size);\n}", "title": "" }, { "docid": "c5ddfb4706eb86f30cca794d888b02c3", "score": "0.5670796", "text": "function updateWidths(){\n\t\t\t\tvar itemsContainStyle = $itemsContain.attr( \"style\" );\n\t\t\t\t$itemsContain.attr( \"style\", \"\" );\n\t\t\t\tvar itemStyle = $items.eq(0).attr( \"style\" );\n\t\t\t\t$items.eq(0).attr( \"style\", \"\" );\n\t\t\t\tvar sliderWidth = $slider.width();\n\t\t\t\tvar itemWidth = $items.eq(0).width();\n\t\t\t\tvar computed = w.getComputedStyle( $items[ 0 ], null );\n\t\t\t\tvar itemLeftMargin = parseFloat( computed.getPropertyValue( \"margin-left\" ) );\n\t\t\t\tvar itemRightMargin = parseFloat( computed.getPropertyValue( \"margin-right\" ) );\n\t\t\t\tvar outerItemWidth = itemWidth + itemLeftMargin + itemRightMargin;\n\t\t\t\t$items.eq(0).attr( \"style\", itemStyle );\n\t\t\t\t$itemsContain.attr( \"style\", itemsContainStyle );\n\t\t\t\tvar parentWidth = numItems / Math.round(sliderWidth / outerItemWidth) * 100;\n\t\t\t\tvar iPercentWidth = itemWidth / sliderWidth * 100;\n\t\t\t\tvar iPercentRightMargin = itemRightMargin / sliderWidth * 100;\n\t\t\t\tvar iPercentLeftMargin = itemLeftMargin / sliderWidth * 100;\n\t\t\t\tvar outerPercentWidth = iPercentWidth + iPercentLeftMargin + iPercentRightMargin;\n\t\t\t\tvar percentAsWidth = iPercentWidth / outerPercentWidth;\n\t\t\t\tvar percentAsRightMargin = iPercentRightMargin / outerPercentWidth;\n\t\t\t\tvar percentAsLeftMargin = iPercentLeftMargin / outerPercentWidth;\n\t\t\t\t$itemsContain.css( \"width\", parentWidth + \"%\");\n\t\t\t\t$items.css( \"width\", 100 / numItems * percentAsWidth + \"%\" );\n\t\t\t\t$items.css( \"margin-left\", 100 / numItems * percentAsLeftMargin + \"%\" );\n\t\t\t\t$items.css( \"margin-right\", 100 / numItems * percentAsRightMargin + \"%\" );\n\t\t\t}", "title": "" }, { "docid": "bac0834d9eaebb91cdede76d7d22d2ae", "score": "0.56542414", "text": "getLineWidth(selected, hover) {\r\n if (selected === true) {\r\n return Math.max(this.selectionWidth, 0.3 / this._body.view.scale);\r\n }\r\n else if (hover === true) {\r\n return Math.max(this.hoverWidth, 0.3 / this._body.view.scale);\r\n }\r\n else {\r\n return Math.max(this.options.width, 0.3 / this._body.view.scale);\r\n }\r\n }", "title": "" }, { "docid": "49c3cf064da8ede609957f4e406f2bfa", "score": "0.5652307", "text": "setSliderWidth() {\n let sliderWidth = this.slideCount * 100;\n this.slidertrack.css('width', `${sliderWidth}%`);\n }", "title": "" }, { "docid": "f87f72c1b3216bf884a4836f0836b402", "score": "0.564203", "text": "function ChoiceScrollbox_MinWidth()\n{\n\treturn 73; // To leave room for the navigation text in the bottom border\n}", "title": "" }, { "docid": "bf8c431485029e66420b15061de10fb7", "score": "0.56405157", "text": "function addwidth(value) {\n // if dropdown select value is 0,1,2,3 based on that change the bar value\n let v = parseInt(document.getElementById(\"ddlSelectBar\").value);\n let a = document.getElementById(\"idlbl\" + v).innerHTML;\n // add current value of bar + button current value of selected bar\n value = parseInt(value) + parseInt(a);\n // if value is greater than 100 & above change the color red\n if (value >= 100) {\n document.getElementById(\"idBar\" + v).style.backgroundColor = \"red\";\n document.getElementById(\"idBar\" + v).style.width = \"100%\";\n document.getElementById(\"idlbl\" + v).innerHTML = value + \"%\";\n }\n //if value is less than 100 and greater than 0 than select same green color;\n else if (value <= 100 && value > 0) {\n document.getElementById(\"idBar\" + v).style.backgroundColor =\n \"rgb(151, 238, 173)\";\n document.getElementById(\"idBar\" + v).style.width = value + \"%\";\n document.getElementById(\"idlbl\" + v).innerHTML = value + \"%\";\n }\n // if value is less than or equal to 0 than set value and with of bar equal to 0\n else if (value <= 0) {\n document.getElementById(\"idBar\" + v).style.width = \"0%\";\n document.getElementById(\"idlbl\" + v).innerHTML = \"0%\";\n }\n}", "title": "" }, { "docid": "e3609ba3cdaf22d1f3438a312b3f957a", "score": "0.5639298", "text": "function sizeBySeverity() {\n sizeOption = 'cvss'; \n redraw(); \n}", "title": "" }, { "docid": "3a52a0ace52c348ff94ea7cd1b31a590", "score": "0.56380165", "text": "function updateWidth() {\n if (isNaN(attrs.width)) {\n element.css('width', attrs.width);\n } else {\n element.css('width', attrs.width + 'px');\n }\n }", "title": "" }, { "docid": "0168cbf1f8bbbf908ebf002a697f71e7", "score": "0.56329185", "text": "function updateWidth() {\n if (isNaN(attrs.width)) {\n element.css('width', attrs.width);\n } else {\n element.css('width', attrs.width + 'px');\n }\n }", "title": "" }, { "docid": "4e4ad3f1717991bacdf07110106ec291", "score": "0.5632239", "text": "getAndSetDimensions() {\n\t\tthis.width = this.$el.outerWidth();\n\t\tthis.margin = parseInt(this.items.eq(0).css('margin-right'), 10);\n\t\tthis.thumbWidth = this.width / this.numVisible - this.margin;\n\t\tthis.wrapper.css('width', this.width);\n\t\tthis.items.css('width', this.thumbWidth);\n\n\t\t// this.thumbHeight = this.getSlideHeight(); // get max height of slides\n\t\t// this.setSlideHeight(this.thumbHeight); // set height to each slide element\n\n\t\tthis.ribbon.css({\n\t\t\t'width': this.getRibbonWidth()\n\t\t});\n\t}", "title": "" }, { "docid": "5e471a6aad6b5674be4d37178ca45f05", "score": "0.5611062", "text": "updateWidth() {\n\t\tthis.canvas.setAttribute(\"width\", this.canvasContainer.offsetWidth);\n\t}", "title": "" }, { "docid": "41f4a0894afae7ae5e4793d7753f1615", "score": "0.56069386", "text": "_setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }", "title": "" }, { "docid": "e24195050f3c6aea81c8e343d9bad68b", "score": "0.56058055", "text": "function setTabWidths(w) {\n if (!isNaN(w) && w !== \"\") {\n w = w + \"px\";\n }\n $(this).each(function(){\n if ($(this).hasClass(\"tabLink\")) {\n var firstChild = (this).children(\":first-child\")[0];\n if (firstChild) {\n firstChild.style.maxWidth = w;\n firstChild.style.width = w || \"auto\";\n firstChild.style.minWidth = w;\n //$(this).children(\":first-child\").css({\"maxWidth\": w, \"width\": w || \"auto\", \"minWidth\": w});\n }\n } else {\n $(this).css(\"width\",\"\");\n $(this).css(\"minWidth\",\"\");\n $(this).css(\"maxWidth\",\"\");\n this.style.maxWidth = w;\n this.style.width = w || \"auto\";\n this.style.minWidth = w;\n //$(this).css({\"maxWidth\":w, \"width\": w || \"auto\", \"minWidth\": w});\n }\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.56029737", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.56029737", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.56029737", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.56029737", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "8932796e4bfaa1f81741cb152ec9ee97", "score": "0.56029737", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "909b65aeb631a50aff95585fa86534ec", "score": "0.55927825", "text": "adjustRootChildrenSize() {\n const { holder } = this.clone.wtTable;\n const { selections } = this.wot;\n const facade = this.facadeGetter();\n const selectionCornerOffset = Math.abs(selections?.getCell().getBorder(facade).cornerCenterPointOffset ?? 0);\n\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n holder.style.height = holder.parentNode.style.height;\n // Add selection corner protruding part to the holder total width to make sure that\n // borders' corner won't be cut after horizontal scroll (#6937).\n holder.style.width = `${parseInt(holder.parentNode.style.width, 10) + selectionCornerOffset}px`;\n }", "title": "" }, { "docid": "42334230ba7300b32b33d24f7c6c7f87", "score": "0.5587783", "text": "function changeSize() {\n if (canDraw)\n setupCanvas(columnSlider.value(), rowSlider.value());\n}", "title": "" }, { "docid": "31ffc368592e634fb05223be29576c01", "score": "0.5577818", "text": "exposeItemWidth() {\n const item = this.selectedDocument.node.querySelector(config.selector.item);\n const itemOuterWidth = getOuterWidth(item);\n\n if (this.itemWidth !== itemOuterWidth) {\n this._itemWidth = itemOuterWidth;\n\n this.node.style.setProperty('--sh-page-outer-width', this.itemWidth + 'px');\n }\n }", "title": "" }, { "docid": "74934f125eaaea02b65948c979fd470e", "score": "0.5574921", "text": "function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "197b88a2fbccb48949d454e7cbf9fe1c", "score": "0.55720806", "text": "function fitToParentWidth(selection) {\n fit(selection, 'width')\n}", "title": "" }, { "docid": "5ccff3edf2d74340b13c8cb4e3beb413", "score": "0.557177", "text": "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\t// width = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\t// height = $sel.node().offsetHeight - marginTop - marginBottom;\n\t\t\t\t// $svg.at({\n\t\t\t\t// \twidth: width + marginLeft + marginRight,\n\t\t\t\t// \theight: height + marginTop + marginBottom\n\t\t\t\t// });\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "e1dcccd428fef608fbd10359b341d539", "score": "0.55657893", "text": "function sizeScrollbar() {\n\n\t\t\t\t\tlet remainder = $scrollContent.width() - $scrollPane.width();\n\t\t\t\t\tif (remainder < 0) {\n\t\t\t\t\t\tremainder = 0;\n\t\t\t\t\t}\n\t\t\t\t\tlet proportion = remainder / $scrollContent.width();\n\t\t\t\t\tlet handleSize = $scrollPane.width() - (proportion * $scrollPane.width());\n\t\t\t\t\t$scrollbar.parent().find('.ui-slider-handle').css({\n\t\t\t\t\t\twidth: handleSize,\n\t\t\t\t\t\t'margin-left': -handleSize / 2\n\t\t\t\t\t});\n\t\t\t\t\thandleHelper.width('').width($scrollbar.width() - handleSize);\n\t\t\t\t}", "title": "" }, { "docid": "5921e81edfbed43fb84bca580fcdc0c6", "score": "0.5558413", "text": "updateWidth() {\n if (this.svg != null) {\n this.svg.attr(\"width\", this.options.width);\n }\n return this;\n }", "title": "" }, { "docid": "3469c16f7b1fb50955759a2952c5d92f", "score": "0.55535847", "text": "styleElements() {\n this.sliderWidth = this.mainElement.offsetWidth;\n this.slideWidth = this.sliderWidth / this._settings.showElements;\n for (let i = 0; i < this.trackElement.children.length; i++) {\n this.trackElement.children[i].style.width = this.slideWidth;\n }\n this.trackElement.style.width = Math.ceil(this.trackElement.children.length / this._settings.rowsCount) * this.slideWidth + 100;\n this.mainElement.style.height = this.trackElement.offsetHeight;\n }", "title": "" }, { "docid": "eb907f6daef68ef01d4c9564a392b48b", "score": "0.5546931", "text": "_resizeHandler() {\n const that = this;\n\n //Refresh the Multiline Trimming\n that._wrapRefresh();\n\n if (that.resizeMode === 'none') {\n that._calculateDropDownSize();\n that._setDropDownSize();\n }\n\n that._trim();\n }", "title": "" }, { "docid": "52ce7820dee9bf18ff467a62b9f29f09", "score": "0.55427235", "text": "function uiUpdate(){\r\n uiEl.style.width = uiElSettings.sidebarMaxWidth + \"px\";\r\n uiEl.style.height = window.innerHeight + \"px\";\r\n }", "title": "" }, { "docid": "18172730704c44fbe967bbe6e30da233", "score": "0.553783", "text": "function updateSideBar() {\n\tselectionChanged(true);\n}", "title": "" }, { "docid": "7b18dc1f6052444d19b91013cdfd263a", "score": "0.55355036", "text": "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Axes\n // -------------------------\n\n // Horizontal range\n x.range([0, width]);\n\n // Horizontal axis\n svg.selectAll('.d3-axis-horizontal').call(xAxis);\n\n\n // Chart elements\n // -------------------------\n\n // Line path\n svg.selectAll('.d3-line').attr(\"d\", line);\n\n // Crosshair\n svg.selectAll('#transition-clip rect').attr(\"width\", width);\n }", "title": "" }, { "docid": "f47443ff2dfc38c6a961a8ae6e445952", "score": "0.5533245", "text": "adjustRootChildrenSize() {\n let scrollbarWidth = getScrollbarWidth();\n\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';\n }", "title": "" }, { "docid": "acd1bd6b8dffadc37629533a2e62aa61", "score": "0.55312717", "text": "function setBarSize(size) {\n /* jshint validthis:true */\n var barMinSize = this.barMinSize || 20;\n\n if (size > 0 && size < barMinSize) {\n size = barMinSize;\n }\n\n if (this.bar) {\n $(this.bar).css(this.origin.size, parseInt(size, 10) + 'px');\n }\n }", "title": "" }, { "docid": "dae82ff9742c187536f6f7eac12ad5c8", "score": "0.5529775", "text": "function update () {\r\n\t\t\t_panelItem.style.minWidth = _width + 'px';\r\n\t\t}", "title": "" }, { "docid": "d521e1f03086d3aac42627df62c9af93", "score": "0.55221236", "text": "_adjustWidgetsInSelection() {\n var editor = this.editor,\n sel_className = 'CodeMirror-selectedtext';\n\n // Clear any previously marked widgets\n $(editor.getWrapperElement()).find(`.CodeMirror-widget.${sel_className}`)\n .removeClass(sel_className);\n\n // Locate selection mark and adjust widgets contain therein\n var selmark = editor.findMarksAt(editor.getCursor())\n .filter(m => m.className == sel_className)[0], selmark_at;\n\n if (selmark && (selmark_at = selmark.find()))\n this._markWidgetsAsWell(selmark_at.from, selmark_at.to, selmark);\n }", "title": "" }, { "docid": "8b04a4109c8baca11b633200a5c2eb53", "score": "0.55160165", "text": "function handleWindowResize () {\r\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\r\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\r\n $mdUtil.nextTick(function () {\r\n ctrl.updateInkBarStyles();\r\n updatePagination();\r\n });\r\n }", "title": "" }, { "docid": "2c35cf184750ff2f74e5a4158c9b5ff4", "score": "0.5514224", "text": "function updatePagingWidth(){var elements=getElements();if(shouldStretchTabs()){angular.element(elements.paging).css('width','');}else{angular.element(elements.paging).css('width',calcPagingWidth()+'px');}}", "title": "" }, { "docid": "68d9119fd0d42a1a6c2b06194b40907b", "score": "0.551371", "text": "lazySetContainerWidth() {\n // Get the total width of the current table\n // Calculates the width of the other columns except the check box and operation columns.\n // The total width of the table - the width of the operation column - the width of the check box - the padding width on both sides of the check box.\n if (this.refs.list) {\n let containerWidth = this.refs.list.offsetWidth - ACTION_ITEM_WIDTH - CHECKBOX_WIDTH - 2 * PADDING_WIDTH - 40;\n this.setState({\n windowWidth: containerWidth\n }, () => {\n this.refreshCellWidth();\n });\n }\n }", "title": "" }, { "docid": "23e64bb9a154b9ea267bb549d97fea8b", "score": "0.5510979", "text": "@action setScrollBarWide(exp) { \n // account for rounding error\n this.props.GridStore.scrollBarWide = exp.scrollbarWidth+2; \n }", "title": "" }, { "docid": "658dea891ec151b490178290790a369e", "score": "0.5507079", "text": "setStyles(contentElement, selectFit) {\n super.setStyle(contentElement, selectFit.targetRect, selectFit.contentElementRect, selectFit);\n contentElement.style.width = `${selectFit.styles.contentElementNewWidth}px`; // manage container based on paddings?\n this.global_styles.contentElementNewWidth = selectFit.styles.contentElementNewWidth;\n }", "title": "" }, { "docid": "52c5fa87c9f5e965af7d0e974a25e758", "score": "0.550457", "text": "function handleWindowResize() {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function() {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }", "title": "" }, { "docid": "bff7e901bad1a5c83da2d9e854cd7f75", "score": "0.5503953", "text": "function resizeChart(newWidth) {\n var psize = ws.dom.size(splitter.bottom);\n\n lastSetWidth = newWidth;\n\n ws.dom.style(wsChartContainer, {\n /*left: newWidth + 'px',*/\n width: '28%',\n height: '37%'\n });\n\n if (fixedSize) {\n // Update size after the animation is done\n setTimeout(function() {\n sizeChart(fixedSize.w, fixedSize.h);\n }, 400);\n return;\n }\n/*\n ws.dom.style(chartContainer, {\n width: psize.w - newWidth - 100 + 'px',\n height: psize.h - 100 + 'px'\n });*/\n\n chartPreview.resize();\n }", "title": "" }, { "docid": "beb36cfb8747022531a4163ae3e42ad0", "score": "0.55017704", "text": "function setWidths() {\n slide = $('.slide');\n slideLength = slide.length;\n slideWrapWidth = 100 * slideLength + '%';\n sliderWrapper.css('width', slideWrapWidth);\n slide.css('width', 'calc(100% / ' + slideLength);\n }", "title": "" }, { "docid": "3c0f9ef61572e8387a57ef96121de1df", "score": "0.54957217", "text": "function resize(){\n elm.style.width = ((elm.value.length + 1) * factor) + 'px'\n }", "title": "" }, { "docid": "a62212bb502c060c99232024067ce426", "score": "0.5493139", "text": "function setSize() {\n var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;\n if (width < 768) {\n var editor_height = $(window).height();\n $('div.navbar-collapse').addClass('collapse');\n } else {\n editor_height = $(window).height() - 110;\n $('div.navbar-collapse').removeClass('collapse');\n }\n $(\"#editor-container\").css(\"height\", editor_height);\n $(\"#md-container\").css(\"height\", editor_height);\n $(\"#file-list\").css(\"max-height\", editor_height - 100);\n var filesWidth = $(window).width() - 22;\n if (filesWidth < 768) {\n $('.list-width').css('width', filesWidth);\n } else {\n $('.list-width').css('width', '228');\n }\n}", "title": "" }, { "docid": "bc3d47bfba9db61a8a9b72bd14813468", "score": "0.5491441", "text": "function setSubMenuWidth() {\n var mainMenuWidth = $(\"#humberger-main-menu\").css(\"width\");\n $(\"ul.humberger-sub-menu\").css({\"min-width\" : mainMenuWidth});\n}", "title": "" }, { "docid": "0c16efe9905cdd154333ef96b0985f46", "score": "0.54877883", "text": "function sizeScrollbar_v() {\n\n var remainder = scrollContent.height() - scrollPane.height();\n var proportion = remainder / scrollContent.height();\n var handleSize = scrollPane.height() - ( proportion * scrollPane.height() );\n\n scrollbar.find(\".ui-slider-handle\").css({\n\n height: handleSize,\n width: \"10px\",\n \"margin-bottom\": (-handleSize / 2) - 4,\n \"margin-left\": \"-6.5px\"\n });\n\n $(scroll_bar_v).height(parseInt($(scrollbar.parent()).height() - handleSize - 4));\n $(scroll_bar_v).css({top: parseInt(handleSize / 2) + \"px\"});\n $(scroll_bar_v).find(\".ui-icon\").css({top: parseInt(handleSize / 2) - 8 + \"px\"});\n\n }", "title": "" }, { "docid": "e81b072c9c517c7081745a6c0c96b47f", "score": "0.5484463", "text": "function calculateOnResize() {\n\tcalculateTimelineWidth();\n\tcalculateCategoryWidth();\n}", "title": "" }, { "docid": "08d0d394c908805f62488e4ea56088e1", "score": "0.54804933", "text": "function setWidth() {\n\t\t\t\tvar style, width;\n\t\t\t\t\n\t\t\t\tif ('getComputedStyle' in window) {\n\t\t\t\t\tstyle = window.getComputedStyle(ta);\n\t\t\t\t\twidth = ta.getBoundingClientRect().width;\n\n\t\t\t\t\t$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){\n\t\t\t\t\t\twidth -= parseInt(style[val],10);\n\t\t\t\t\t});\n\n\t\t\t\t\tmirror.style.width = width + 'px';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// window.getComputedStyle, getBoundingClientRect returning a width are unsupported and unneeded in IE8 and lower.\n\t\t\t\t\tmirror.style.width = Math.max($ta.width(), 0) + 'px';\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "e5eb34343502f6857d96bde80c5ee702", "score": "0.5478842", "text": "function setSizing () {\n bounds = d3.select('#unidirectplot').node().getBoundingClientRect()\n svgSize = {\n width: bounds.width - margin.left,\n height: 700\n }\n\n graphSize = {\n width: svgSize.width - margin.right - margin.left,\n height: svgSize.height - margin.bottom - margin.top\n }\n\n helper.setCanvasSize(svgSize.width, svgSize.height)\n }", "title": "" }, { "docid": "59c092293cb759b45788254c1bb89f15", "score": "0.54759836", "text": "function update_viewer_size_fixed() {\n var is_checked = jq(global.html.id.viewer_size_fixed).prop(\"checked\");\n if (is_checked) {\n jq(\"tree-div\").attr(\"style\", \"overflow: scroll; display: block; height: \" + (verge.viewportH() * 0.8) + \"px;\");\n }\n else {\n jq(\"tree-div\").attr(\"style\", null);\n }\n}", "title": "" }, { "docid": "d3e218658e844d497b8be9f13cf2d151", "score": "0.54734886", "text": "function setElementWidths(){\n\n\t\tif( $( '.js-mobile-fill-screen' ).length > 0 ){\n\n\t\t\tif( $( window ).width() < 767 ){\n\n\t\t\t\t$( '.js-mobile-fill-screen' ).outerWidth( $( window ).width() );\n\n\t\t\t}\n\n\t\t\t//Make sure we reset width when dragging from <767px to >767px\n\t\t\t$( window ).resize( function(){\n\n\t\t\t\tif( $( window ).width() < 767 ){\n\n\t\t\t\t\t$( '.js-mobile-fill-screen' ).outerWidth( $( window ).width() );\n\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t$( '.js-mobile-fill-screen' ).css( 'width', '100%' );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "c2589c7c87ac3fca348ef983eec2cca5", "score": "0.5470565", "text": "set fixedWidth(value) {}", "title": "" }, { "docid": "a43275b9c2c85847d2eef100e65d3ae0", "score": "0.5465997", "text": "ResizeControls() { }", "title": "" }, { "docid": "a667960a17fed9d2acde069d3372b682", "score": "0.5463812", "text": "function getSelectWidth() {\n $(\".select-wrapper\").css(\"width\", $(\"#container_form\").width() / 2);\n $(\".materialize-textarea\").css(\"width\", $(\"#container_form\").width() / 2);\n $(\".file-path.validate\").css(\"width\", $(\"#container_form\").width() / 2);\n}", "title": "" }, { "docid": "2a35ad035c32d14577566cbd661d0643", "score": "0.545688", "text": "function setCategoryWidths() {\n $('.bar').each(function() {\n var bar = $(this);\n var index = bar.attr('data-index');\n var relevantStats = _.findWhere(ourArray, { 'id': index })['stats'];\n var barTotal = _.reduce(_.pluck(relevantStats, 'value'), function(memo, num) {\n return memo + num\n });\n $.each($(this).find('.stat'), function(stat_id, stat) {\n $(stat).css({ 'width': $(stat).attr('data-value') / barTotal * 100 + \"%\" });\n })\n })\n}", "title": "" } ]
c5fc2f38243bf52d743214d7c29c016f
Config the localStorage backend, using options set in the config.
[ { "docid": "2870fcd48058da553a8d4c17991fd5e2", "score": "0.58252937", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = dbInfo.name + '/';\n\n if (dbInfo.storeName !== self._defaultConfig.storeName) {\n dbInfo.keyPrefix += dbInfo.storeName + '/';\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" } ]
[ { "docid": "2e6b506bcde4d357b68bd0b733f61e5c", "score": "0.6889927", "text": "saveConfig() {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(this.config));\n }", "title": "" }, { "docid": "a543de5f7ecc34a0b4dab213a6511dc3", "score": "0.66031283", "text": "loadConfig() {\n let config;\n\n if (Storage) {\n // Proceed if storage supported\n if (localStorage.getItem(LOCAL_STORAGE_KEY) !== null) {\n config = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)); // load saved config from localStorage if it exists.\n\n // run config validity checks\n this.checkConfig(config);\n }\n\n // Legacy import\n if (localStorage.getItem(\"customCommands\") !== null) {\n this.importLegacyLinks();\n localStorage.removeItem(\"customCommands\");\n }\n }\n\n this.config = Object.assign({}, config || DEFAULT_CONFIG);\n }", "title": "" }, { "docid": "be5fd7690b981f56809c79f9072c1dbd", "score": "0.6524885", "text": "saveOptions() {\n\n // if (this.app.options == null) { this.app.options = {}; }\n this.app.options = Object.assign({}, this.app.options);\n\n if (this.app.CHROME == 1) {\n chrome.storage.local.set({'options': JSON.stringify(this.app.options)});\n return;\n }\n\n //\n // servers\n //\n if (this.app.BROWSER == 0) {\n try {\n fs.writeFileSync(`${__dirname}/../config/options`, JSON.stringify(this.app.options), null, 4);\n } catch (err) {\n // this.app.logger.logError(\"Error thrown in storage.saveOptions\", {message: \"\", stack: err});\n console.error(err);\n return;\n }\n\n //\n // browsers\n //\n } else {\n if (typeof(Storage) !== \"undefined\") {\n localStorage.setItem(\"options\", JSON.stringify(this.app.options));\n }\n }\n }", "title": "" }, { "docid": "cc99c3897e17eff640a651d47988f1e9", "score": "0.645582", "text": "function setConfig(config){\n chrome.storage.sync.set({config: config});\n}", "title": "" }, { "docid": "aca741c0cd47659721523c5d9d7a4e7b", "score": "0.6421928", "text": "function _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n } // Config the localStorage backend, using options set in the config.", "title": "" }, { "docid": "2f567eec6a79245f88158dd665df34a9", "score": "0.6394073", "text": "setOptions(o) {\n this.options = o;\n browser.storage.local.set({options: this.options});\n }", "title": "" }, { "docid": "80191323c32858a6ab79e60b64791f44", "score": "0.6063917", "text": "function loadConfig(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,b=localStorage[CFG_STORE_KEY]||{};return a?b[a]||{}:b}", "title": "" }, { "docid": "d96fd0068d534d3316fad8b881b890a0", "score": "0.6053672", "text": "set store(store) {\n this.config.store = store;\n }", "title": "" }, { "docid": "724202c53611e15035a3b6f9324eca95", "score": "0.60093296", "text": "function setLocalStorage(settings) {\n localStorage.setItem('settings', JSON.stringify(settings));\n allocateSettings(settings);\n}", "title": "" }, { "docid": "4decc7860919f99d59740425c6fe996a", "score": "0.6001303", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = dbInfo.name + '/';\n\n if (dbInfo.storeName !== self._defaultConfig.storeName) {\n dbInfo.keyPrefix += dbInfo.storeName + '/';\n }\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "7a64ec6723deb48fcdee90b4efdddee7", "score": "0.5970385", "text": "function write() {\n\t\twindow.localStorage.setItem(\"config\",JSON.stringify(this.config));\n\t}", "title": "" }, { "docid": "983680cb31ae55a7f1d6db99c3b95de9", "score": "0.5947107", "text": "function saveOptions() {\n\t\t\tif (supported('localStorage') && options.saving) {\n\t\t\t\tlocalStorage.setItem('ADI.options', JSON.stringify(options));\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "558ae46fcc1f765d29e917adb8763f5b", "score": "0.592878", "text": "loadOptions() {\n browser.storage.local.get(\"options\").then(res => {\n if (Object.getOwnPropertyNames(res).length != 0) {\n this.options = res.options;\n } else {\n this.options = DEFAULT_OPTIONS;\n }\n });\n }", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "f68297ee4e50206d55abb133685a8f6b", "score": "0.5919746", "text": "function _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}", "title": "" }, { "docid": "3228998095ecc8b70091bc215d19b501", "score": "0.5900622", "text": "function changed() {\n // Save it\n localStorage.setItem(PHPUNITGEN_LS_CONFIG, JSON.stringify(config));\n }", "title": "" }, { "docid": "2a170ca3ca8cc03b06c7a87d06e76a7b", "score": "0.590026", "text": "constructor(config) {\r\n if(config) {\r\n this.config = config; \r\n this.initial = config.initial;\r\n this.current = this.initial;\r\n this.history = [this.initial]; \r\n this.length = 0; \r\n this.localStorage = [];\r\n }\r\n else \r\n throw new Error();\r\n }", "title": "" }, { "docid": "94f638a70a8e2d6baa94dbb10ca7e95f", "score": "0.58902144", "text": "sync() {\n if (window.localStorage[this.name]) {\n try {\n this.__settings = JSON.parse(window.localStorage[this.name]);\n } catch (e) {\n console.log(e);\n }\n }\n }", "title": "" }, { "docid": "6e0365459a590d5dec5804a7b3441bb6", "score": "0.58356464", "text": "function initLocalStorage() {\n let settings = localStorage.getItem('settings');\n if (settings) { // fetches from local storage\n settings = JSON.parse(settings);\n }\n else { // adds default settings to local storage\n settings = default_settings;\n localStorage.setItem('settings', JSON.stringify(settings));\n }\n return settings;\n}", "title": "" }, { "docid": "a38bcdb89df0a87a326d5cd1ff05d0c6", "score": "0.582806", "text": "function _initStorage$2(options) {\n\t var self = this;\n\t var dbInfo = {};\n\t if (options) {\n\t for (var i in options) {\n\t dbInfo[i] = options[i];\n\t }\n\t }\n\n\t dbInfo.keyPrefix = dbInfo.name + '/';\n\n\t if (dbInfo.storeName !== self._defaultConfig.storeName) {\n\t dbInfo.keyPrefix += dbInfo.storeName + '/';\n\t }\n\n\t self._dbInfo = dbInfo;\n\t dbInfo.serializer = localforageSerializer;\n\n\t return Promise$1.resolve();\n\t}", "title": "" }, { "docid": "a38bcdb89df0a87a326d5cd1ff05d0c6", "score": "0.582806", "text": "function _initStorage$2(options) {\n\t var self = this;\n\t var dbInfo = {};\n\t if (options) {\n\t for (var i in options) {\n\t dbInfo[i] = options[i];\n\t }\n\t }\n\n\t dbInfo.keyPrefix = dbInfo.name + '/';\n\n\t if (dbInfo.storeName !== self._defaultConfig.storeName) {\n\t dbInfo.keyPrefix += dbInfo.storeName + '/';\n\t }\n\n\t self._dbInfo = dbInfo;\n\t dbInfo.serializer = localforageSerializer;\n\n\t return Promise$1.resolve();\n\t}", "title": "" }, { "docid": "a736e62a9cc74152d5d6862649e688d9", "score": "0.5779591", "text": "writeLocalStorage(filename, config = null) {\n if(!this.storageAvailable('localStorage')) {\n return;\n }\n\n if (null === config) {\n config = this.configToSave;\n }\n\n let contents = JSON.stringify(config);\n localStorage.setItem( filename, contents );\n }", "title": "" }, { "docid": "8f58e36d5693d7155f2bd68f9bd05c34", "score": "0.5742749", "text": "function loadSettingsFromStorage() {\n // Set default localStorage if first time load\n if (Object.keys(localStorage).length != Object.keys(DEFAULT_SETTINGS).length) {\n deepCopy(DEFAULT_SETTINGS, localStorage);\n }\n deepCopy(localStorage, settings);\n prices = settings['prices'].split(',');\n upgrades = settings['upgrades'].split(',').map((v) => v === 'true' ? true : false);\n }", "title": "" }, { "docid": "5e1bda84d7ae7c719dad47cbac1a7d12", "score": "0.5738656", "text": "function reloadConfig() {\n saveConfig(true);\n if (typeof localStorage !== \"undefined\") {\n _drawMode.selectedObject = undefined;\n config = localStorage.getItem(\"config\");\n loadConfig(new Blob([config], {type: \"text/plain;charset=utf-8\"}));\n }\n}", "title": "" }, { "docid": "7591ff780298a7815870a2cdd25f7f37", "score": "0.5731601", "text": "_settingsSet(settings) {\n window.localStorage.setItem('storageClass', settings.storageClass);\n window.localStorage.setItem('ACL', settings.ACL);\n window.localStorage.setItem('encryption', settings.encryption);\n window.localStorage.setItem('bucket', settings.bucket);\n window.localStorage.setItem('folder', settings.folder);\n window.localStorage.setItem('isSetupCorrectly', true);\n\n IpcService.saveConfig({\n ACL: settings.ACL,\n storageClass: settings.storageClass,\n encryption: settings.encryption,\n bucket: settings.bucket,\n folder: settings.folder,\n });\n\n this.setState({\n ACL: settings.ACL,\n bucket: settings.bucket,\n folder: settings.folder,\n isSettingsSet: true,\n storageClass: settings.storageClass,\n });\n }", "title": "" }, { "docid": "b8063566b9ef729313c2a17138bdd549", "score": "0.57282716", "text": "constructor() {\n /** Name of the storage file (without extension). */\n this.storeFileName = 'andrews-desktop-config'\n // Initialize store.\n this.store = new ElectronStore({\n defaults: Config.defaultOptions,\n name: this.storeFileName\n })\n }", "title": "" }, { "docid": "8ff45e9e50966909c7afd7a81a7c406c", "score": "0.5715297", "text": "_saveSettings()\r\n {\r\n browser.storage.local.set({settings: this._settings})\r\n .then(() => console.log(\"Settings saved\"))\r\n .catch(e => this._handleError(\"Saving settings failed\", e));\r\n }", "title": "" }, { "docid": "5c19ec2c0aeba7ca3ab11cc86e807b4d", "score": "0.57016397", "text": "getLocalConfig() {\n let storage = sessionStorage\n if (this.config.session) {\n storage = localStorage\n }\n let config = storage.getItem(LOCAL_CONFIG_KEY)\n if (config) {\n return JSON.parse(config)\n }\n }", "title": "" }, { "docid": "3340ea0f3021a775bf9dcf8752019a8a", "score": "0.56790614", "text": "function _initStorage(options) {\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n keyPrefix = dbInfo.name + '/';\n\n return Promise.resolve();\n }", "title": "" }, { "docid": "82075b4a84c34b8541cbf497268b21d3", "score": "0.5668698", "text": "function storeConfig(storedConfiguration) {\n configuration = storedConfiguration;\n setUI(configuration[\"configuration\"]);\n }", "title": "" }, { "docid": "e4742091823e7f5cfd6b8cdfe66296ac", "score": "0.5649588", "text": "componentDidMount() {\n try {\n const json = localStorage.getItem('options')\n const options = JSON.parse(json)\n if (options) {\n this.setState(() => ({ options }))\n }\n } catch (error) {\n\n }\n }", "title": "" }, { "docid": "d2d000f5957992315b913606032d9ca0", "score": "0.56448483", "text": "function configureStorage(){\n if (!window.localStorage) {\n // hide all\n // Show error div\n window.console.log(\"localStorage is not supported by this browser.\");\n return false;\n } \n\n return true;\n }", "title": "" }, { "docid": "776072cbde8c92f1e9de900e4648dcb0", "score": "0.56389624", "text": "function LokiLocalStorageAdapter() {}", "title": "" }, { "docid": "776072cbde8c92f1e9de900e4648dcb0", "score": "0.56389624", "text": "function LokiLocalStorageAdapter() {}", "title": "" }, { "docid": "005e5747f6bd9096925525178ab3592d", "score": "0.56359273", "text": "setConfig (extConfig) {\n // Add extended configuration if present.\n if (typeof extConfig === 'object' && extConfig !== null) {\n const keys = Object.keys(extConfig)\n const values = Object.values(extConfig)\n keys.forEach((key, i) => {\n this[key] = values[i]\n })\n }\n\n // Lock config so it can't be changed during the lifetime of the app.\n Object.freeze(Config)\n }", "title": "" }, { "docid": "c566ab16f5921ff6b819e4712fe8db71", "score": "0.55735725", "text": "function saveOptions(e) {\n e.preventDefault();\n storageInstance.set({\n host: document.querySelector(\"#host\").value\n });\n}", "title": "" }, { "docid": "61d8471f728dfac78a618bea51d733f3", "score": "0.5571485", "text": "function getConfigData() {\n \t// Construct the dictionary to pass back to the watch\n var options = {\n 'modeID': selectObjMode.options[selectObjMode.selectedIndex].value,\n\t'routeID': selectObjRoute.options[selectObjRoute.selectedIndex].value,\n 'directionID': selectObjDirection.options[selectObjDirection.selectedIndex].value,\n\t'allStops': allStops, \n\t'limit': 3 /* hard coded for now */\n };\n\n // Clear existing local storage and save for next launch\n\tlocalStorage.clear();\n\t\n\tlocalStorage.setItem('options', JSON.stringify(options));\n\tlocalStorage.setItem('options_list_mode', JSON.stringify(objectifyOptions(selectObjMode)));\n\tlocalStorage.setItem('options_list_route', JSON.stringify(objectifyOptions(selectObjRoute)));\n\tlocalStorage.setItem('options_list_direction', JSON.stringify(objectifyOptions(selectObjDirection)));\n\n console.log('Got options: ' + JSON.stringify(options));\n return options;\n}", "title": "" }, { "docid": "d612e41a4ffd6489ff9e7c9fba41b8ce", "score": "0.557112", "text": "function _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof(options[i]) !== 'string' ?\n options[i].toString() : options[i];\n }\n }\n\n var serializerPromise = new Promise(function(resolve/*, reject*/) {\n // We allow localForage to be declared as a module or as a\n // library available without AMD/require.js.\n if (moduleType === ModuleType.DEFINE) {\n require(['localforageSerializer'], resolve);\n } else if (moduleType === ModuleType.EXPORT) {\n // Making it browserify friendly\n resolve(require('./../utils/serializer'));\n } else {\n resolve(globalObject.localforageSerializer);\n }\n });\n\n var dbInfoPromise = new Promise(function(resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version),\n dbInfo.description, dbInfo.size);\n } catch (e) {\n return self.setDriver(self.LOCALSTORAGE).then(function() {\n return self._initStorage(options);\n }).then(resolve).catch(reject);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function(t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName +\n ' (id INTEGER PRIMARY KEY, key unique, value)', [],\n function() {\n self._dbInfo = dbInfo;\n resolve();\n }, function(t, error) {\n reject(error);\n });\n });\n });\n\n return serializerPromise.then(function(lib) {\n serializer = lib;\n return dbInfoPromise;\n });\n }", "title": "" }, { "docid": "db5916888602cbc7f70a43bb0c1de4ff", "score": "0.5565226", "text": "function saveSetting() {\n localStorage.setItem(\"config_search_method\", g_search_method);\n localStorage.setItem(\"config_path_to_database_root\", g_path_to_database_root);\n localStorage.setItem(\"config_database_zip_url\", g_database_zip_url);\n localStorage.setItem(\"config_database_root\", g_database_root);\n localStorage.setItem(\"config_data_xml_path\", g_data_xml_path);\n localStorage.setItem(\"config_keep_awake\", g_keep_awake);\n localStorage.setItem(\"config_opc_da_server_url\", g_opc_da_server_url);\n // ons.notification.toast('Settings saved.', { timeout: 300, animation: 'fall' });\n}", "title": "" }, { "docid": "e7a25ce88ff94da2fd4f17d75eebfb68", "score": "0.55616266", "text": "function setStorage() {\n window.localStorage.setItem(\"todoStorage\", JSON.stringify(todoStorage));\n }", "title": "" }, { "docid": "82d9e3497f254256d475aa544bfed43d", "score": "0.55535305", "text": "function save_options()\r\n{\r\n\t\r\n\tif(!checkLocalStorage()) return;\r\n\r\n\tbg.reload();\r\n\r\n\tlocalStorage.clear();\r\n\r\n \tvar options =\r\n\t{\r\n\t\tversion : getVersion(),\r\n\t\trate : element.rate.value,\r\n\t\tirate : element.irate.value,\r\n\t\tvoice : element.voice.value,\r\n\t\tivoice : element.ivoice.value,\r\n\t\tpitch : element.pitch.value,\r\n\t\tenqueue : element.enqueue.checked,\r\n\t\tspeechinput : element.speechinput.checked,\r\n\t\tlogo : element.logo.checked,\r\n\t\tcontext: element.context.checked,\r\n\t\thotkeys: element.hotkey,\r\n\t\tvolume : parseFloat(element.volume.value/100)\r\n\t}\r\n\r\n\tlocalStorage.setItem(\"options\", JSON.stringify(options));\r\n\tbg.setVolume(parseFloat(element.volume.value/100));\r\n}", "title": "" }, { "docid": "e5dd5f34144df830af677b7df95cd23d", "score": "0.5545491", "text": "function options ( ) {\r\n var opts = [ ].slice.call(arguments).pop( );\r\n if (opts) {\r\n window.localStorage.setItem('cgmPebble', JSON.stringify(opts));\r\n } else {\r\n opts = JSON.parse(window.localStorage.getItem('cgmPebble'));\r\n }\r\n return opts;\r\n}", "title": "" }, { "docid": "e9fd1b42a1ee7035699f97e4367e5166", "score": "0.5544414", "text": "function setLayoutConfig(inKey){\r\n if (typeof(Storage) !== \"undefined\") {\r\n // Web storage is supported\r\n try {\r\n gKeylayout=inKey;\r\n localStorage.setItem('TPBankUserLayout', inKey);\r\n }\r\n catch (err) {\r\n logInfo('Browser not support local store');\r\n }\r\n }\r\n else {\r\n // Web storage is NOT supported\r\n logInfo('Browser not support local store');\r\n }\r\n}", "title": "" }, { "docid": "599be13536c3987683d2430bec1e9eb0", "score": "0.5541179", "text": "function read() {\n\t\tvar cf = JSON.parse(window.localStorage.getItem(\"config\"));\n\t\tif (cf == null) {\n\t\t\tthis.config = this.default_config;\n\t\t\tthis.write();\n\t\t}\n\t\telse\n\t\t\tthis.config = cf;\n\t}", "title": "" }, { "docid": "3e7d03f5298e694d6b3d6855b1124772", "score": "0.55280256", "text": "function save_options() {\n var options = {};\n options.url = $('input[name=\"url\"]').val().trim();\n while(options.url.charAt(options.url.length - 1) === '/')\n options.url = options.url.substr(0, options.url.length - 1);\n\n options.mode = $('input[name=\"mode\"]:checked').val();\n\n options.autoUrl = $('input[name=\"autoUrl\"]').prop('checked');\n\n console.log(options);\n chrome.storage.local.set({\n setting_options: options\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n }", "title": "" }, { "docid": "05775b5756eb91d2f63a21c60c4ef099", "score": "0.55233055", "text": "function _initStorage(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = dbInfo.name + '/';\n\n self._dbInfo = dbInfo;\n\n var serializerPromise = new Promise(function(resolve/*, reject*/) {\n // We allow localForage to be declared as a module or as a\n // library available without AMD/require.js.\n if (moduleType === ModuleType.DEFINE) {\n require(['localforageSerializer'], resolve);\n } else if (moduleType === ModuleType.EXPORT) {\n // Making it browserify friendly\n resolve(require('./../utils/serializer'));\n } else {\n resolve(globalObject.localforageSerializer);\n }\n });\n\n return serializerPromise.then(function(lib) {\n serializer = lib;\n return Promise.resolve();\n });\n }", "title": "" }, { "docid": "004bfeff935a5a3d5d118c9ad0bcc2b7", "score": "0.5514623", "text": "function LocalStorageManager() {\n this.bestScoreKey = \"bestScore\";\n this.gameStateKey = \"gameState\";\n\n var supported = this.localStorageSupported();\n this.storage = supported ? window.localStorage : window.fakeStorage;\n}", "title": "" }, { "docid": "adcb4811a36306c90fa5a51a8260abb1", "score": "0.5506262", "text": "init(storeConfig) {\n this[config] = thorin.util.extend({\n debug: {\n create: true,\n read: true,\n update: true,\n delete: true,\n measure: true // should we measure ms\n },\n path: {\n formlets: path.normalize(thorin.root + '/app/formlets') // the formlet definition files\n },\n domain: null, // the domain to use for all formlet namespaces\n dropCreate: false, // set to true to perform drop-create. WARNING: removes ALL data.\n host: process.env.FORMLET_HOST || 'https://formlet.io',\n key: process.env.FORMLET_KEY || ''\n }, storeConfig);\n if (storeConfig.debug === false) {\n this[config].debug = false;\n }\n this[instance] = new formlet(this[config]);\n /* read up all models. */\n loadFormlets.call(this, this[config]);\n thorin.config('store.' + this.name, this[config]);\n }", "title": "" }, { "docid": "b410b91e55f48469bdab038cf571be8a", "score": "0.5461731", "text": "initStorage() {\n //options\n this.options.stack = Storage.getStack();\n this.options.type = Storage.getType();\n\n //global settings & startover\n this.settings.dropProgram = Storage.getCutProgramDuration();\n this.settings.startOverDetectAd = Storage.getStartOverRangeAd();\n this.settings.startOverDetectSharpStart = Storage.getStartOverRangeSharpStart();\n this.settings.windowSize = Storage.getWindowInitSize();\n this.windowSizeTemp = this.settings.windowSize;\n this.dropProgramTemp = this.settings.dropProgram;\n\n //filter date\n this.date.startDate = Storage.getStartDate();\n this.date.endDate = Storage.getEndDate();\n\n //mode\n this.mode = Storage.getMode();\n\n //flow chart opacity\n this.flowChartOpacity = Storage.getFlowChartOpacity();\n\n //startover\n this.startoverType = Storage.getStartOverType();\n }", "title": "" }, { "docid": "291e5bab9c953c5707c55dd84a426114", "score": "0.54557025", "text": "function initLocalStorage(){\n if (!localStorage.hasOwnProperty('closeLoginWarning')){\n localStorage['closeLoginWarning'] = false;\n }\n \n if (!localStorage.hasOwnProperty('list')){\n localStorage['list'] = JSON.stringify([DEFAULT_ITEM]);\n }\n \n if (!localStorage.hasOwnProperty('loginStatus')){\n localStorage['loginStatus'] = false;\n }\n}", "title": "" }, { "docid": "58c085841d68c59fe975e14f6d7b4f3f", "score": "0.54455376", "text": "function _initStorage$1(options) {\n\t var self = this;\n\t var dbInfo = {\n\t db: null\n\t };\n\n\t if (options) {\n\t for (var i in options) {\n\t dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n\t }\n\t }\n\n\t var dbInfoPromise = new Promise$1(function (resolve, reject) {\n\t // Open the database; the openDatabase API will automatically\n\t // create it for us if it doesn't exist.\n\t try {\n\t dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n\t } catch (e) {\n\t return reject(e);\n\t }\n\n\t // Create our key/value table if it doesn't exist.\n\t dbInfo.db.transaction(function (t) {\n\t t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n\t self._dbInfo = dbInfo;\n\t resolve();\n\t }, function (t, error) {\n\t reject(error);\n\t });\n\t });\n\t });\n\n\t dbInfo.serializer = localforageSerializer;\n\t return dbInfoPromise;\n\t}", "title": "" }, { "docid": "58c085841d68c59fe975e14f6d7b4f3f", "score": "0.54455376", "text": "function _initStorage$1(options) {\n\t var self = this;\n\t var dbInfo = {\n\t db: null\n\t };\n\n\t if (options) {\n\t for (var i in options) {\n\t dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n\t }\n\t }\n\n\t var dbInfoPromise = new Promise$1(function (resolve, reject) {\n\t // Open the database; the openDatabase API will automatically\n\t // create it for us if it doesn't exist.\n\t try {\n\t dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n\t } catch (e) {\n\t return reject(e);\n\t }\n\n\t // Create our key/value table if it doesn't exist.\n\t dbInfo.db.transaction(function (t) {\n\t t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n\t self._dbInfo = dbInfo;\n\t resolve();\n\t }, function (t, error) {\n\t reject(error);\n\t });\n\t });\n\t });\n\n\t dbInfo.serializer = localforageSerializer;\n\t return dbInfoPromise;\n\t}", "title": "" }, { "docid": "7fd3bf6ff76a31526048dd823abc7b43", "score": "0.5441936", "text": "function save_options() {\n\t/* save destination options */\n\tvar destinationAddress = document.getElementById('destination.address').value;\n\tif(!destinationAddress || destinationAddress.length == 0) {\n\t\tlocalStorage['destination.address'] = '127.0.0.1';\n\t} else {\n\t\tlocalStorage['destination.address'] = destinationAddress;\n\t}\n\n\t/* enable/disable controls */\n\tvar doubleclickSet = document.getElementById('controls.doubleclick').checked;\n\tvar acceleratorSet = document.getElementById('controls.accelerator').checked;\n\tvar contextmenuQSet = document.getElementById('controls.contextmenu.queue').checked;\n\tvar contextmenuGSet = document.getElementById('controls.contextmenu.grabber').checked;\n\n\tlocalStorage['controls.doubleclick'] = doubleclickSet;\n\tlocalStorage['controls.contextmenu.queue'] = contextmenuQSet;\n\tlocalStorage['controls.contextmenu.grabber'] = contextmenuGSet;\n\tlocalStorage['controls.accelerator'] = acceleratorSet;\n\n\t/* save accelerator keys */\n\tlocalStorage['accelerator.alt'] = accelerator.alt;\n\tlocalStorage['accelerator.ctrl'] = accelerator.ctrl;\n\tlocalStorage['accelerator.shift'] = accelerator.shift;\n\tlocalStorage['accelerator.key'] = accelerator.key;\n\n\t/* save autostart option */\n\tlocalStorage['other.autostart'] = document.getElementById('other.autostart').checked;\n}", "title": "" }, { "docid": "464b5650b1f6dfa24e9944a633dc5a03", "score": "0.5439803", "text": "onConfig(config) {\n this.store.commit('Main/SET_CONFIG', config);\n }", "title": "" }, { "docid": "703e4caa8a059afbcbbca57cd133adcb", "score": "0.54337007", "text": "_sync() {\n if (this._dirty) {\n window.localStorage.setItem('francy.settings', JSON.stringify(this.object));\n }\n }", "title": "" }, { "docid": "b9fd7e28b62fa8c51ca90462fc364a5a", "score": "0.5430384", "text": "function _init() {\n /* Check if browser supports localStorage */\n var localStorageReallyWorks = false;\n if ('localStorage' in window) {\n try {\n window.localStorage.setItem('_tmptest', 'tmpval');\n localStorageReallyWorks = true;\n window.localStorage.removeItem('_tmptest');\n } catch (BogusQuotaExceededErrorOnIos5) {\n // Thanks be to iOS5 Private Browsing mode which throws\n // QUOTA_EXCEEDED_ERRROR DOM Exception 22.\n }\n }\n\n if (localStorageReallyWorks) {\n try {\n if (window.localStorage) {\n _storage_service = window.localStorage;\n _backend = 'localStorage';\n _observer_update = _storage_service.jStorage_update;\n }\n } catch (E3) { /* Firefox fails when touching localStorage and cookies are disabled */ }\n }\n /* Check if browser supports globalStorage */\n else if ('globalStorage' in window) {\n try {\n if (window.globalStorage) {\n if (window.location.hostname == 'localhost') {\n _storage_service = window.globalStorage['localhost.localdomain'];\n } else {\n _storage_service = window.globalStorage[window.location.hostname];\n }\n _backend = 'globalStorage';\n _observer_update = _storage_service.jStorage_update;\n }\n } catch (E4) { /* Firefox fails when touching localStorage and cookies are disabled */ }\n }\n /* Check if browser supports userData behavior */\n else {\n _storage_elm = document.createElement('link');\n if (_storage_elm.addBehavior) {\n\n /* Use a DOM element to act as userData storage */\n _storage_elm.style.behavior = 'url(#default#userData)';\n\n /* userData element needs to be inserted into the DOM! */\n document.getElementsByTagName('head')[0].appendChild(_storage_elm);\n\n try {\n _storage_elm.load('jStorage');\n } catch (E) {\n // try to reset cache\n _storage_elm.setAttribute('jStorage', '{}');\n _storage_elm.save('jStorage');\n _storage_elm.load('jStorage');\n }\n\n var data = '{}';\n try {\n data = _storage_elm.getAttribute('jStorage');\n } catch (E5) {}\n\n try {\n _observer_update = _storage_elm.getAttribute('jStorage_update');\n } catch (E6) {}\n\n _storage_service.jStorage = data;\n _backend = 'userDataBehavior';\n } else {\n _storage_elm = null;\n return;\n }\n }\n\n // Load data from storage\n _load_storage();\n\n // remove dead keys\n _handleTTL();\n\n // start listening for changes\n _setupObserver();\n\n // initialize publish-subscribe service\n _handlePubSub();\n\n // handle cached navigation\n if ('addEventListener' in window) {\n window.addEventListener('pageshow', function(event) {\n if (event.persisted) {\n _storageObserver();\n }\n }, false);\n }\n }", "title": "" }, { "docid": "013c399c41c4df673c9dd94c8c8d8912", "score": "0.5429279", "text": "function storePref () {\n localStorage.setItem('pref', JSON.stringify(pref));\n}", "title": "" }, { "docid": "af69d052f2d7d116b5148a824231365f", "score": "0.54124385", "text": "function save_options() {\n var enable = document.getElementById('enable').checked;\n var block_60fps = document.getElementById('block_60fps').checked;\n var block_vp8 = document.getElementById('block_vp8').checked;\n var block_vp9 = document.getElementById('block_vp9').checked;\n var block_av1 = document.getElementById('block_av1').checked;\n browser.storage.local.set({\n enable: enable,\n block_60fps: block_60fps,\n block_vp8: block_vp8,\n block_vp9: block_vp9,\n block_av1: block_av1,\n });\n}", "title": "" }, { "docid": "ba012035e006e3dec080452df6c9633f", "score": "0.53981686", "text": "function load_options() {\n\t/* load destination option */\n\tdocument.getElementById('destination.address').value = localStorage['destination.address'];\n\n\t/* load doubleclick option */\n\tdocument.getElementById('controls.doubleclick').checked = localStorage['controls.doubleclick'] == 'true';\n\tdocument.getElementById('controls.accelerator').checked = localStorage['controls.accelerator'] == 'true';\n\tdocument.getElementById('controls.contextmenu.queue').checked = localStorage['controls.contextmenu.queue'] == 'true';\n\tdocument.getElementById('controls.contextmenu.grabber').checked = localStorage['controls.contextmenu.grabber'] == 'true';\n\n\t/* load accelerator */\n\taccelerator = {\n\t\t\talt: localStorage['accelerator.alt'] == 'true',\n\t\t\tctrl: localStorage['accelerator.ctrl'] == 'true',\n\t\t\tshift: localStorage['accelerator.shift'] == 'true',\n\t\t\tkey: localStorage['accelerator.key']\n\t\t};\n\twriteAccelerator();\n\n\t/* load autostart option */\n\tdocument.getElementById('other.autostart').checked = localStorage['other.autostart'] == 'true';\n}", "title": "" }, { "docid": "8906f210a5cbaa89cd853a757e20468b", "score": "0.5397738", "text": "function storageLoadConfig(name, defValue = null, useLog = true, storeBack = false) {\n let str_value = localStorage.getItem(name);\n let value = null;\n let isLoaded = false;\n let isReplaced = false;\n let isDefault;\n if (str_value) {\n isLoaded = true;\n value = JSON.parse(str_value);\n }\n if (value === null || (defValue !== null && value.version !== defValue.version)) {\n if (isLoaded)\n isReplaced = true;\n isLoaded = false;\n isDefault = true;\n if (defValue !== null)\n value = Object.assign({}, defValue);\n } else {\n isDefault = dataEquals(value, defValue);\n }\n if (useLog) {\n console.log('Used %s %s', value !== null ? (isDefault ? 'default' : 'custom') : 'null', name);\n }\n if (value !== null && (isReplaced || (storeBack && !isLoaded)))\n localStorage.setItem(name, JSON.stringify(value));\n return value;\n}", "title": "" }, { "docid": "9651f2adcc4778511098d466a21a4d4e", "score": "0.5392634", "text": "function loadOptions() {\n\tif (localStorage.token) {\n\t\t$(\"#token\").val(localStorage.token);\n\t\t$(\"#limit\").val(localStorage.limit);\n\t\t$(\"#interval\").val(localStorage.interval);\n\t\t$(\"#comopt\").val(localStorage.comopt);\n\t\tif (localStorage.autoplay === 1) {\n\t\t\t$(\"#autoplay\").attr(\"checked\", \"checked\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c281a9876e5d8581fe9f1288567e4224", "score": "0.5391562", "text": "setStorage (name, content) {\n if (!name) return\n if (typeof content !== 'string') {\n content = JSON.stringify(content)\n }\n window.localStorage.setItem(name, content)\n }", "title": "" }, { "docid": "17d21fa2a74fe560aef4130a98a426c9", "score": "0.53878945", "text": "function LocalStorage(){\n var opts = arguments[0] || {};\n this._key = opts.key || \"_terraformer\";\n }", "title": "" }, { "docid": "063b5cbbfc5ed7ccc2b809ac6535ea7d", "score": "0.5383151", "text": "function setAdminPreferenceLocal(grid_id) {\n if (!isLocalStorageAllow()) {\n return false;\n }\n var gridInfo = {}, grid = $('#' + grid_id);\n gridInfo.sortname = grid.jqGrid('getGridParam', 'sortname');\n gridInfo.sortorder = grid.jqGrid('getGridParam', 'sortorder');\n gridInfo.page = grid.jqGrid('getGridParam', 'page');\n gridInfo.rowNum = grid.jqGrid('getGridParam', 'rowNum');\n gridInfo.postData = grid.jqGrid('getGridParam', 'postData');\n setLocalStore(el_grid_settings.enc_location + '_sh', JSON.stringify(gridInfo), true);\n}", "title": "" }, { "docid": "9e7f6655e76927af7285593ee3be45f4", "score": "0.5382165", "text": "function loadSetting() {\n if (localStorage.getItem(\"config_search_method\"))\n g_search_method = localStorage.getItem(\"config_search_method\");\n else\n g_search_method = SearchMethod.BY_ID;\n\n if (localStorage.getItem(\"config_path_to_database_root\"))\n g_path_to_database_root = localStorage.getItem(\"config_path_to_database_root\");\n else\n g_path_to_database_root = '';\n\n if (localStorage.getItem(\"config_database_zip_url\"))\n g_database_zip_url = localStorage.getItem(\"config_database_zip_url\");\n else\n g_database_zip_url = '';\n\n if (localStorage.getItem(\"config_database_root\"))\n g_database_root = localStorage.getItem(\"config_database_root\");\n else\n g_database_root = '';\n\n if (localStorage.getItem(\"config_data_xml_path\"))\n g_data_xml_path = localStorage.getItem(\"config_data_xml_path\");\n else\n g_data_xml_path = '';\n\n if (localStorage.getItem(\"config_keep_awake\"))\n g_keep_awake = localStorage.getItem(\"config_keep_awake\");\n else\n g_keep_awake = BOOL_STR.true_t;\n\n if(localStorage.getItem(\"config_opc_da_server_url\"))\n g_opc_da_server_url = localStorage.getItem(\"config_opc_da_server_url\");\n else\n g_opc_da_server_url = '';\n}", "title": "" }, { "docid": "56c0450094d92f755f03716ad40dd7d0", "score": "0.53757054", "text": "setLocalStorage(inObject) {\n\n localStorage.setItem(this.LOCAL_STORAGE_ITEM, JSON.stringify(inObject));\n\n }", "title": "" }, { "docid": "1329619c46eb3344f5e11672d9db0284", "score": "0.53739476", "text": "constructor() {\n super(localStorage);\n }", "title": "" }, { "docid": "1936e249ffc54e1b1b10c17ecf7c9294", "score": "0.5373093", "text": "function createDeviceStorage(){\n\n deviceStorage = new Persist.Store('Pricing App Storage', {\n\n about: \"Data Storage to enhance Offline usage\",\n path: location.href\n });\n }", "title": "" }, { "docid": "66412ac860ee2c43872ca122d0015076", "score": "0.5371662", "text": "componentDidMount(){\n try {\n const json = localStorage.getItem('options');\n const options = JSON.parse(json);\n \n if(options){\n this.setState(()=>({options}));\n }\n }\n catch(e)\n {\n\n }\n \n\n //console.log('componentDidMount');\n }", "title": "" }, { "docid": "e91db8b5e4f76b4f27698592d2c30939", "score": "0.53677446", "text": "function LocalStorage(storageMap) {\n this.storageMap = storageMap;\n }", "title": "" }, { "docid": "cc985ef69d17f4fdcbc773f7c8f9f5d9", "score": "0.5367073", "text": "async function saveSettings() {\n let settings = {}\n for (const key of Object.keys(DEFAULT_SETTINGS)) {\n if (this.state[key] == null || this.state[key] == undefined) continue\n if (this.state[key] instanceof Object) settings[key] = JSON.parse(JSON.stringify(this.state[key]))\n else settings[key] = this.state[key]\n }\n await browser.storage.local.set({ settings })\n}", "title": "" }, { "docid": "a256f464c07c92fc2224781aa1510431", "score": "0.53668207", "text": "init() {\n let localStore = model.getLocalStore();\n if (_.isNull(localStore)) {\n localStorage.setItem('vanillaPress', JSON.stringify(jsonData));\n localStore = model.getLocalStore();\n }\n }", "title": "" }, { "docid": "558fb15c845068a50628535442b954de", "score": "0.53609586", "text": "function LocalStorage( ) {\n this.$storage = window.localStorage;\n }", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "126328724cdd2c254332b4c246f71275", "score": "0.53544635", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' (id INTEGER PRIMARY KEY, key unique, value)', [], function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}", "title": "" }, { "docid": "b18d6128c52ac03d620801ffdcc87695", "score": "0.5351231", "text": "function _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n } // Create our key/value table if it doesn't exist.\n\n\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n }", "title": "" }, { "docid": "86127578cd2c9dabdb9ef8f19947e354", "score": "0.53493446", "text": "function save_options() {\n localStorage[\"extensions\"] = document.getElementById(\"extensions\").checked;\n localStorage[\"history\"] = document.getElementById(\"history\").checked;\n localStorage[\"downloads\"] = document.getElementById(\"downloads\").checked;\n localStorage[\"bookmarks\"] = document.getElementById(\"bookmarks\").checked;\n localStorage[\"settings\"] = document.getElementById(\"settings\").checked;\n\n localStorage[\"network\"] = document.getElementById(\"network\").checked;\n localStorage[\"dns\"] = document.getElementById(\"dns\").checked;\n localStorage[\"plugins\"] = document.getElementById(\"components\").checked;\n localStorage[\"cache\"] = document.getElementById(\"cache\").checked;\n localStorage[\"sync\"] = document.getElementById(\"sync\").checked;\n localStorage[\"histograms\"] = document.getElementById(\"histograms\").checked;\n localStorage[\"labs\"] = document.getElementById(\"flags\").checked;\n\n localStorage[\"appcache-internals\"] = document.getElementById(\"appcache-internals\").checked;\n localStorage[\"apps\"] = document.getElementById(\"apps\").checked;\n\n localStorage[\"about\"] = document.getElementById(\"about\").checked;\n localStorage[\"version\"] = document.getElementById(\"version\").checked;\n localStorage[\"credits\"] = document.getElementById(\"credits\").checked;\n\n // Update status to let user know options were saved.*/\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options saved.\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 1000);\n}", "title": "" }, { "docid": "e720b0554c968af8a18759359e3cb49f", "score": "0.53441495", "text": "function restore_options() {\n var local_server_id = localStorage[\"local_server_id\"];\n var remote_server_id = localStorage[\"remote_server_id\"];\n var path_id = localStorage[\"path_id\"];\n var width_id = localStorage[\"width_id\"];\n var height_id = localStorage[\"height_id\"];\n \n if(local_server_id){\n $(\"#localserverid\").val(local_server_id);\n }\n if (remote_server_id) {\n $(\"#remoteserverid\").val(remote_server_id);\n }\n if(path_id){\n $(\"#pathid\").val(path_id);\n }\n if(width_id){\n $(\"#widthid\").val(width_id);\n }\n if(height_id){\n $(\"#heightid\").val(height_id);\n }\n}", "title": "" }, { "docid": "0641cd49962fff078d914b872300fcdf", "score": "0.5339693", "text": "function setDefaultOptions()\n{\n function defaultOptionValue(opt, val)\n {\n if(!(opt in localStorage))\n localStorage[opt] = val;\n }\n\n defaultOptionValue(\"shouldShowIcon\", \"true\");\n defaultOptionValue(\"shouldShowBlockElementMenu\", \"true\");\n\n removeDeprecatedOptions();\n}", "title": "" }, { "docid": "0d6c20bcc404baccb2edd299285a2549", "score": "0.53321934", "text": "persistData(key, val, config) {\n val = JSON.stringify(val);\n\n // TODO: refactor `this.getConfig(config)`???\n switch (this.getConfig(config).storage) {\n case 'localStorage':\n window.localStorage.setItem(key, val);\n break;\n\n default:\n Cookies.set(key, val, {\n expires: this.getConfig(config).cookieExpiry,\n path: this.getConfig(config).cookiePath,\n });\n break;\n }\n }", "title": "" }, { "docid": "99397abb15d0679b58868ad6bae7204a", "score": "0.5332009", "text": "componentDidMount(){\n try { // for some reason stored data is invalid/badly formatted\n let string = localStorage.getItem(\"options\");\n let optionsFromLocalStorage = JSON.parse(string)\n \n if (optionsFromLocalStorage) { // since the first time page is rendered, no options in local storage \n this.setState(() => ({ \n options: optionsFromLocalStorage\n }))\n }\n } catch(error){\n // Do nothing here, the options array is set to be an empty array in the constructor\n }\n }", "title": "" }, { "docid": "3a2a70f312d9e233aa8e840405004d99", "score": "0.5330316", "text": "function recordOpts (newOpt) {\n var oldOpt = getCachedOpts()\n localStorage.setItem(\n cacheKey,\n JSON.stringify(Object.assign({}, oldOpt, newOpt))\n )\n}", "title": "" }, { "docid": "fb8c958a5f36b007b6a150e88a89d3f0", "score": "0.5330043", "text": "function _init(){\n /* Check if browser supports localStorage */\n var localStorageReallyWorks = false;\n if(\"localStorage\" in window){\n try {\n window.localStorage.setItem('_tmptest', 'tmpval');\n localStorageReallyWorks = true;\n window.localStorage.removeItem('_tmptest');\n } catch(BogusQuotaExceededErrorOnIos5) {\n // Thanks be to iOS5 Private Browsing mode which throws\n // QUOTA_EXCEEDED_ERRROR DOM Exception 22.\n }\n }\n\n if(localStorageReallyWorks){\n try {\n if(window.localStorage) {\n _storage_service = window.localStorage;\n _backend = \"localStorage\";\n _observer_update = _storage_service.jStorage_update;\n }\n } catch(E3) {/* Firefox fails when touching localStorage and cookies are disabled */}\n }\n /* Check if browser supports globalStorage */\n else if(\"globalStorage\" in window){\n try {\n if(window.globalStorage) {\n _storage_service = window.globalStorage[window.location.hostname];\n _backend = \"globalStorage\";\n _observer_update = _storage_service.jStorage_update;\n }\n } catch(E4) {/* Firefox fails when touching localStorage and cookies are disabled */}\n }\n /* Check if browser supports userData behavior */\n else {\n _storage_elm = document.createElement('link');\n if(_storage_elm.addBehavior){\n\n /* Use a DOM element to act as userData storage */\n _storage_elm.style.behavior = 'url(#default#userData)';\n\n /* userData element needs to be inserted into the DOM! */\n document.getElementsByTagName('head')[0].appendChild(_storage_elm);\n\n try{\n _storage_elm.load(\"jStorage\");\n }catch(E){\n // try to reset cache\n _storage_elm.setAttribute(\"jStorage\", \"{}\");\n _storage_elm.save(\"jStorage\");\n _storage_elm.load(\"jStorage\");\n }\n\n var data = \"{}\";\n try{\n data = _storage_elm.getAttribute(\"jStorage\");\n }catch(E5){}\n\n try{\n _observer_update = _storage_elm.getAttribute(\"jStorage_update\");\n }catch(E6){}\n\n _storage_service.jStorage = data;\n _backend = \"userDataBehavior\";\n }else{\n _storage_elm = null;\n return;\n }\n }\n\n // Load data from storage\n _load_storage();\n\n // remove dead keys\n _handleTTL();\n\n // start listening for changes\n _setupObserver();\n\n // initialize publish-subscribe service\n _handlePubSub();\n\n // handle cached navigation\n if(\"addEventListener\" in window){\n window.addEventListener(\"pageshow\", function(event){\n if(event.persisted){\n _storageObserver();\n }\n }, false);\n }\n }", "title": "" } ]
9724625a49dbc72a6b38cdf99ab803e4
Gets the initial question and answer
[ { "docid": "7741f8f6d3f812cedd1f1254bfd4678f", "score": "0.0", "text": "function userInput(){\ninquirer.prompt([\n {\n name: \"question\",\n message: \"Please enter the full question with the answer: \"\n },\n {\n name: \"answer\",\n message: \"Please enter the answer(case sensitive): \"\n }\n]).then(function(answers){\n // Save the two answers to variables\n fullQuestion = answers.question;\n answer = answers.answer.toString();\n \n // Creates a new object by passing the answers as arguments to the constructor \n var firstPresidentCloze = new ClozeCard(fullQuestion, answer);\n \n // Calls the init function which starts the data analysis and subsequent function calls\n clozeCardObj.init(fullQuestion, answer);\n // Only executes if the user has correctly answer the fields\n if (theTerminator){\n // Inquirer module for the final question: cloze, partial, full question\n inquirer.prompt([\n {\n name: \"finalQuestion\",\n message: \"What would you like to see (cloze, partial, full question)?\",\n type: \"list\",\n choices: [\"Cloze\", \"Partial\", \"Full Question\"]\n }\n ]).then(function(answer){\n \n answer = answer.finalQuestion;\n // Calls a function that will display a string based upon what the user chose\n clozeCardObj.printClozePartialFull(answer, firstPresidentCloze);\n });\n }\n});\n}", "title": "" } ]
[ { "docid": "603a8bd5e77de98c7c132f3a6f6de644", "score": "0.6727693", "text": "function init() {\n return inquirer.prompt(questions);\n}", "title": "" }, { "docid": "c26fecf0542bb948d889bb8da1f43eba", "score": "0.6661947", "text": "getQuestion(){\n\t\treturn String(this.QA.q1) + \" x ? = \" + String(this.QA.q2);\n\t}", "title": "" }, { "docid": "b803fcea8207a1d09f0ae9d175928cb4", "score": "0.6618954", "text": "function getQuestion() {\n \n \n }", "title": "" }, { "docid": "b4524cfbddb13b8d1d73d7d2d28f481b", "score": "0.6556067", "text": "function getQ1Answers() {\n q1FinalAnswer = q1Answers.value; // Set a final answer variable to hold the final submitted response\n if (q1FinalAnswer == \"false\") {\n // if the answer is false...\n timePenalty = 10; // ...Set the timePenalty var to 10 (the number of seconds to be deducted)\n }\n}", "title": "" }, { "docid": "367d9ebd64d1dfa2e7421f406194cc47", "score": "0.6534338", "text": "function firstQuestion() {\n var quest = questions[runningQuestion];\n question.textContent = quest.question;\n answer1.textContent = quest.answer1;\n answer2.textContent = quest.answer2;\n answer3.textContent = quest.answer3;\n answer4.textContent = quest.answer4;\n }", "title": "" }, { "docid": "8888f22a78e2bc947ae734258b1b9774", "score": "0.65132076", "text": "function question(){\n\t//this.operationName = \"\";\n\tthis.operation = \"\";\n\tthis.part1 = 0;\n\tthis.part2 = 0;\n\tthis.answer = 0;\n\tthis.time = 0;\n\tthis.correct = false;\n}", "title": "" }, { "docid": "bdc4322b9fe488e84b179527c9351631", "score": "0.6477839", "text": "function init(questions) {\n return inquirer.prompt(questions);\n}", "title": "" }, { "docid": "730ba8f2eba741d1ee856f42f58ef605", "score": "0.6435328", "text": "parseCurrentQuestion() {\r\n this.question = this.triviaBlocks[this.qIndex].question;\r\n this.correctAnswer = this.triviaBlocks[this.qIndex].correct_answer;\r\n }", "title": "" }, { "docid": "8d67a2e33a6cec168689cba5083d486c", "score": "0.63977087", "text": "getCorrectAnswer() {\n\treturn this.progress.currentQuestion.correctAnswer\n }", "title": "" }, { "docid": "3aed05e8072469e87b942fa2f1c26f6a", "score": "0.63824135", "text": "function getPreTestQuestion(){\n\t\t$.ajax({\n\t\t\turl: \"/home\",\n\t\t\tdata: {\n\t\t\t\t\"getPreQuestion\": \"\"\n\t\t\t}\n\t\t}).done(function(result){\n\t\t\tpreTestQuestionPrompt.setValue(result, 0);\n\t\t\tpreTestResponseEditor.clearSelection();\n\t\t}).fail(function(){\n\t\t\tpreTestResponseEditor.setValue(\"Pre Test Question Could Not be Loaded due to a server error.\", 0);\n\t\t\tpreTestResponseEditor.clearSelection();\n\t\t});\n\t}", "title": "" }, { "docid": "8fb55858418a0af2df086f52a7992bdc", "score": "0.6348896", "text": "function answerIsCorrect() {\n document.currentQuestion;\n}", "title": "" }, { "docid": "910edfd0cfbe7c094d8ebf358900e563", "score": "0.63470924", "text": "function getQuestions(){\n return inquirer.prompt(questions);\n // returning questions\n}", "title": "" }, { "docid": "80e238db05db171b470c9ced8601bbb6", "score": "0.6316898", "text": "function findQ2Answer () {\n if (radio1.checked) {\n answer2 = radio1.value;\n \n } else if (radio2.checked) {\n answer2 = radio2.value;\n \n } else if (radio3.checked) {\n answer2 = radio3.value;\n }\n}", "title": "" }, { "docid": "186dd043d9140df6d3a0317630be0b3c", "score": "0.6302459", "text": "askQuestions() {\n return inquirer.prompt(this.prompt).then((answers) => {\n return answers['prompt'];\n })\n }", "title": "" }, { "docid": "8c7ee2a73c16a2f7e0f9e88b80a78c23", "score": "0.630081", "text": "function init() {\n askQuestion();\n // const allanswers = askQuestion;\n // writeReadMe(readmeAnswers)\n}", "title": "" }, { "docid": "a57ee884b8e9e6fa3e5b2bac4e995f3b", "score": "0.6299166", "text": "function given_answer() {\n return userAnswer.value;\n}", "title": "" }, { "docid": "6d6dd1a098ea1460dff8e9431d970a4b", "score": "0.6281488", "text": "function getQuestion() {\n\t// define a variable that selects random options\n\tconst answers = questions[currentQuestionIndex].option;\n\t// for each input display questions\n\tquestionContainer.textContent =\n\t\tcurrentQuestionIndex + 1 + '. ' + questions[currentQuestionIndex].question;\n\tconsole.log(questionContainer.textContent);\n\tselectedOption.forEach(function (input, i) {\n\t\t// Set radio button check value\n\t\tinput.value = answers[i];\n\t\t//reset value\n\t\tinput.checked = false;\n\t\t// Display the options text\n\t\tlet ansContainer = input.nextElementSibling;\n\t\tansContainer.textContent = answers[i];\n\t});\n}", "title": "" }, { "docid": "3d7b89a1f2fd320c2d4c0990abe122e8", "score": "0.6215327", "text": "function init() {\n inquirer.prompt(questions)\n \n}", "title": "" }, { "docid": "c5ec85cdf8c08ff675c40b85d4c8a644", "score": "0.61565816", "text": "function getRightAnswers() {\n}", "title": "" }, { "docid": "29b2df4bcd034cea6b93542ecd6ec193", "score": "0.6138455", "text": "function init() {\n return inquirer.prompt(managerQuestions);\n}", "title": "" }, { "docid": "e0485c9b033f758326ffc6b791a8f688", "score": "0.6111996", "text": "function initialPrompt() {\n console.log(\"\\nLet's play some scrabble!\");\n \n let word = input.question(\"\\nEnter a word to score: \");\n return word;\n}", "title": "" }, { "docid": "7d11ee2b285255090441f9f92cd51ed2", "score": "0.6108007", "text": "function initialPrompt() {\n word = input.question(\"Let's play some scrabble! Enter a word: \");\n // score = oldScrabbleScorer(word);\n // console.log(score);\n return word;\n}", "title": "" }, { "docid": "9cc8650d6430bd04a640ff7ec22b78f6", "score": "0.60984397", "text": "function initialPrompt() {\n userWord = input.question(\"Let's play some scrabble! Enter a word to score: \");\n // console.log(oldScrabbleScorer(userWord))\n // console.log(simpleScore(userWord))\n return userWord\n}", "title": "" }, { "docid": "b73cdcfc00bef02c9c15b26712402b66", "score": "0.6091201", "text": "function initialPrompt() {\n let wordInput = input.question(\"Let's play Scrabble! \\n Enter a word to score: \");\n return wordInput;\n}", "title": "" }, { "docid": "853830fa2360e9bf20fa352bdb8a104c", "score": "0.60665923", "text": "function ask(){\n return inquirer.prompt(questions) \n }", "title": "" }, { "docid": "645735665cd482c654e2d9871e1aae2d", "score": "0.6066385", "text": "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n let currentWord = input.question(\"Enter a word:\");\n // let score = oldScrabbleScorer(currentWord);\n // console.log(score);\n\n return currentWord;\n}", "title": "" }, { "docid": "d0b3f3a4a90449a930c8a117a71dccab", "score": "0.6061992", "text": "function getQuestion()\n{\n\tif( questionStack.length == 0 )\n\t\tinitQuestions();\n\n\treturn questions[ questionStack[currentScreenNo-1] ];\n}", "title": "" }, { "docid": "6541c53ae158d95f2d2f4652089e1489", "score": "0.60366744", "text": "async prompting() {\n\t\tthis.answers = {};\n\t}", "title": "" }, { "docid": "61b67cf41492d16f18db39a74cde2017", "score": "0.6011404", "text": "function startQuestions() {\n // Shows the question\n allQuestion = questions[questionArray];\n questionElement.textContent = allQuestion.question;\n\n // Show the answer choices\n answer1.textContent = allQuestion.choices[0];\n answer2.textContent = allQuestion.choices[1];\n answer3.textContent = allQuestion.choices[2];\n answer4.textContent = allQuestion.choices[3];\n}", "title": "" }, { "docid": "df4828d911385c789c06f4084640d5d4", "score": "0.59999645", "text": "function getCurrentQuestion() {\n return allQuestionWithAnswersArr[scope.vm.currentSlide];\n }", "title": "" }, { "docid": "79ba1a9bb4c7a2d8fcd747c42fa18e96", "score": "0.5989557", "text": "function getQuestion() {\n\tlet getQuestion = questions[questionsIndex];\n\tdocument.getElementById('current-question').innerHTML = getQuestion.title;\n\n\tlet options = getQuestion.options;\n\tfor (let i = 0; i < options.length; i++) {\n\t\tdocument.querySelector(`#answer-button-${i}`).innerHTML = options[i];\n\t\tdocument.querySelector(`#answer-button-${i}`).setAttribute('value', options[i]);\n\t}\n}", "title": "" }, { "docid": "94dd182452868a2cdaef43323bce3662", "score": "0.5985059", "text": "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n return (input.question('Enter a word to score: '));\n \n}", "title": "" }, { "docid": "f6a327efc16e2238f18cb9dcafa03d37", "score": "0.595842", "text": "function initialPrompt() {\n let userSelection = input.question(`Which scoring algorithm would you like to use?\\n0 - Scrabble: The traditional scoring algorithm.\\n1 - Simple Score: Each letter is worth 1 point.\\n2 - Bonus Vowels: Vowels are worth 3 pts, and consonants are 1 pt.\\nEnter 0, 1, or 2: `);\n\n while(userSelection > 2 || userSelection < 0){\n userSelection = input.question(`Please enter 0, 1, or 2`);\n }\n return scoringAlgorithms[userSelection];\n}", "title": "" }, { "docid": "5ac510a8330eac31a0f5db1c649d4a69", "score": "0.59561175", "text": "getCorrect( )\n {\n return this.correctAnswer;\n }", "title": "" }, { "docid": "309f898756453623491a580c9966e190", "score": "0.5953462", "text": "getCurrentQuestion() {\n return this.currentQuestion;\n }", "title": "" }, { "docid": "cf5a6b5cb20f8a298948bc36023844e3", "score": "0.5937707", "text": "function init() {\n //user will see the first quest\n inquirer.prompt(questions).then((data) => {\n //figure out how to take those responses from the user and write them to a file\n writeToFile(\"README.md\", generateMarkdown(data));\n });\n}", "title": "" }, { "docid": "3500e3dbabec2f72aaf23012d95bc346", "score": "0.5930401", "text": "initialProb() {\n const ptype = this.state.problemsToDo[0];\n const difficulty = _.get(this.state.difficulties, `${ptype}`);\n const [question, answer] = genProblem(ptype, difficulty);\n\n this.setState(initQuestion(ptype, question, answer));\n this.setState(addQuestion(ptype, question, answer));\n }", "title": "" }, { "docid": "4896d1533e65224dd47fd25d068080ba", "score": "0.5904984", "text": "async function askQuestions() {\n\n const questions = [\n {\n type: 'input',\n name: 'repoURL',\n message: \"URL of repo?\",\n default: 'https://github.com/kschang77/READMEnator'\n },\n {\n type: 'input',\n name: 'title',\n message: 'Project title? ',\n default: 'abc'\n },\n {\n type: 'input',\n name: 'description',\n message: 'Short description?',\n default: 'def'\n },\n {\n type: 'input',\n name: 'usage',\n message: 'How to use it?',\n default: 'ghi'\n },\n {\n type: 'input',\n name: 'deployURL',\n message: \"URL of deployed? \",\n default: 'https://nowhere.url'\n }\n\n ];\n\n\n // the remaining fields will be parsed in next module\n const answers = await inquirer.prompt(questions)\n var x = answers.repoURL.substring(answers.repoURL.lastIndexOf('/') + 1)\n answers.reponame = x\n // console.info('Answers:', answers);\n return answers\n}", "title": "" }, { "docid": "24622ca4c2148ece6956a3d3978d4718", "score": "0.5903684", "text": "function getPrompt() {\n //what is rl\n //what is .question\n var handleTheAnswer = function(a,b,c,lksdjfldskf){\n var translatedword = pigLatin(a);\n console.log( translatedword );\n getPrompt();\n };\n\n rl.question('please type in a word to translate to pig latin ', handleTheAnswer );\n}", "title": "" }, { "docid": "98306b43e84cbe0c86b5df72d36c7605", "score": "0.58948493", "text": "function init() {\n inquirer.prompt(initQuestions).then((mainAnswers) => {\n roleBasedQuestions(mainAnswers);\n });\n}", "title": "" }, { "docid": "9a5fc78ea5999c564c6e20e3306bcc95", "score": "0.58891803", "text": "function init() {\n inquirer.prompt(questions).then(function(answers) {\n console.log('Answers from prompt', answers);\n writeReadMe(\"newReadMe.md\", generateMarkdown(answers));\n });\n}", "title": "" }, { "docid": "aa51642aec3af33f327ab4df7e30ffb0", "score": "0.5888326", "text": "function init() {\n askQuestions();\n}", "title": "" }, { "docid": "312b4e68931b475d678d30110514bb99", "score": "0.5886194", "text": "async function main() {\n\n // ask the intial questions\n let a = await inquirer.prompt(q.initialQuestion);\n\n //decide the next prompt and return it\n sendToNextPrompt(a.choice);\n\n // // ask the new prompt\n // let add = await inquirer.prompt(questions);\n\n // // this is the object with the answers to the specific prompt \n // console.log(add);\n}", "title": "" }, { "docid": "61156dacacbf9a3fd7b8d1a0bbae6005", "score": "0.58454764", "text": "function getQuestion() {\n\tvar question;\n\tif (stack.length<=3){\n\t\tquestion=base.winners[Math.floor(Math.random()*base.numWinners)];\n\t}else{\n\t\tif (Math.random()<=base.difficulty){\n\t\t\tquestion=base.lossers[Math.floor(Math.random()*base.numLossers)];\n\t\t}else{\n\t\t\tquestion=base.winners[Math.floor(Math.random()*base.numWinners)];\n\t\t}\n\t\tbase.difficulty=stack.length/100;\n\t}\n\treturn question;\n}", "title": "" }, { "docid": "3e3382e4d1e597130d8cb85182fd6373", "score": "0.5845047", "text": "async function init() {\n inquirer.prompt(questions).then(answers =>{\n const response = generateMarkdown(answers);\n console.log(answers);\n })\n\n \n \n\n}", "title": "" }, { "docid": "cd72b741615a5132e8a9da406ced3bde", "score": "0.58311176", "text": "prompt(answers) {\n\n }", "title": "" }, { "docid": "a0671fb795ec5e52f3e7937aaf461e6b", "score": "0.5825976", "text": "function askQuestions() {\n // use inquirer to prompt the questions and (return) the answers\n return inquirer.prompt(questions);\n}", "title": "" }, { "docid": "d99ed1a26e6f0aa68237b8b84ac7c502", "score": "0.5819678", "text": "function ExamQuestion(){\n\tthis.mc = undefined;\t// multi-choice (if true) or plain text (if false)\n\tthis.text = \"\";\n\tthis.answers = [];\n\t\n\treturn this;\n}", "title": "" }, { "docid": "e85f8681adf32fe9a9911ef7300d0f5b", "score": "0.5808278", "text": "start(question) {\n\tthis.started = true;\n\tthis.qAnswered = 0;\n\tthis.qCorrect = 0;\n\tthis.qCorrectRow = 0;\n\tthis.gotoQuestion(question);\n }", "title": "" }, { "docid": "1f464b714fc15467fb6aa3e40a9f8dd6", "score": "0.5801551", "text": "function prompt(){\n console.log(\"\\nNEW QUESTION\");\n console.log(\"------------\")\n inquirer.prompt([\n {\n name: \"answer\",\n message: basicData[count].front\n }\n ]).then(function(result){\n\n // turns the user's answers to lowercase\n answer = result.answer.toLowerCase()\n\n // if user's answers match the 'back' data of the current basicData[count].front\n if(answer === basicData[count].back){\n console.log(\"\\nyou got it right!\")\n count ++;\n correct ++\n startBasicQuiz();\n } else {\n console.log(\"\\nyou got it wrong!\")\n count ++\n incorrect ++\n startBasicQuiz();\n }\n });\n}", "title": "" }, { "docid": "e8bfe9e5fe89b8c38dc702fced0abea4", "score": "0.5789913", "text": "function initialPrompt() {\n prompt = input.question(\"Let's play some scrabble! Enter a word: \");\n}", "title": "" }, { "docid": "71e2a96c3e5b1119a6c4a56e1f72636b", "score": "0.57801723", "text": "function getDefaultAnswer1(vArgument) {\n targetId = vArgument[0];\n var result = [];\n result[0] = \"\";\n result[0] = $('input[name=\"' + targetId + '_answer_1\"]:checked').val();\n return result;\n}", "title": "" }, { "docid": "b326e8d6ed0a94bcf2b120bdc082386b", "score": "0.5776317", "text": "function getResults(){\n\n // question 1, option 1\n if (selections[0] === \"0\"){\n\n if (selections[1] === \"1\"){\n return 3;\n }\n if (selections[1] === \"2\"){\n return 6;\n }\n if (selections[1] === \"3\"){\n return 8;\n }\n }\n //question 1, option 2\n if (selections[0] === \"1\"){\n\n if (selections[1] === \"0\"){\n return 2;\n }\n if (selections[1] === \"1\"){\n return 4;\n }\n if (selections[1] === \"2\"){\n return 9;\n }\n }\n //question 1, option 3\n if (selections[0] === \"2\"){\n\n if (selections[1] === \"0\"){\n return 1;\n }\n if (selections[1] === \"1\"){\n return 5;\n }\n if (selections[1] === \"2\"){\n return 7;\n }\n }\n}", "title": "" }, { "docid": "303dee14c29b1b431fbadb372f3c8ece", "score": "0.57719624", "text": "getQuestion(text, defaultValue) {\n return text + ' ' + this.getExample(defaultValue);\n }", "title": "" }, { "docid": "f96aef8ad3074163a286fe643eb39050", "score": "0.57688195", "text": "function init() {\ninquirer.prompt(questions)\n.then(function(answer){\n writeToFile(\"generatedREADME.md\", generateMarkdown(answer))\n console.log(answer)\n})\n}", "title": "" }, { "docid": "f481e7441bd08cabe6ccb61d51d05770", "score": "0.576754", "text": "function correct() {\n getQuestions();\n}", "title": "" }, { "docid": "1bfbb089b7069dbd35616579eece5183", "score": "0.5752401", "text": "function init() {\n\n inquirer.prompt(questions).then(function(answers){\n console.log(answers);\n writeToFile(\"readMe.md\", generateMarkdown(answers))\n })\n\n}", "title": "" }, { "docid": "622556a7ca72a36eab9c98e66653eac4", "score": "0.57412326", "text": "function questionResult() {\n \n currentQuestion++;\n nextQuestion();\n \n }", "title": "" }, { "docid": "4c2005e2b396b6b0dc790fe8018bc1c0", "score": "0.57381964", "text": "function firstQuestion() {\n //add question text and write to screen\n questionText = \"JavaScript is a type of \";\n questionWrite();\n // write to list items that will show possible answers\n answerStore = [\"Object Oriented Programming\", \"Functional Programming\"];\n correctIndex = 0;\n answerRender();\n}", "title": "" }, { "docid": "caa9856974a6ed348a8df257c3ce6215", "score": "0.57372665", "text": "function initQuestion()\n\t{\n//\t\tdrawList.setParam('question', 'numberText', app.curProblem + 1);\n\n\t\tvar q = problem.get('q');\n\n\t\t// Append instructions to \"paper\" questions. This is a\n\t\t// temporary measure!\n\t\tif (layout.qType === 'paper')\n\t\t\tq = \"<b>Please submit your answer on paper.</b><br/><br/>\" + q;\n\n\t\tdrawList.setParam('question', 'text', q);\n\t\tdrawList.setParam('question', 'instruct', problem.get('q_prefix'));\n\t}", "title": "" }, { "docid": "d79509c1a801e77d0e44c772c9621b29", "score": "0.573317", "text": "function evalQuestion(){\n if(answer == resp){\n corr = 1;\n }\n\n else {\n corr = 0;\n }\n}", "title": "" }, { "docid": "02bb940c14523a8cf73d22e12afe47d4", "score": "0.5730253", "text": "function question1() { \n\t\tvar answer = $('input[name=\"radio-1\"]:checked').val(); \n\t\tif (answer === \"correct\") {\n\t\t\tcorrectAnswerCounter++;\n\t\t\tunansweredCounter--;\n\t\t} \n\t\telse if (answer === \"incorrect\") {\n\t\t\tincorrectAnswerCounter++;\n\t\t\tunansweredCounter--;\n\t\t}\n\n\t\tconsole.log(answer);\n\t}", "title": "" }, { "docid": "e35c73e84ada1e111b7dba59e69c35f0", "score": "0.5728499", "text": "getNewQuestion() {\n return this.client.getQuestion().then((result) => {\n this.setState({\n data: result.data[0],\n });\n console.log(this.state.data.answer);\n });\n }", "title": "" }, { "docid": "e35c73e84ada1e111b7dba59e69c35f0", "score": "0.5728499", "text": "getNewQuestion() {\n return this.client.getQuestion().then((result) => {\n this.setState({\n data: result.data[0],\n });\n console.log(this.state.data.answer);\n });\n }", "title": "" }, { "docid": "5d4c92c797c382b1f696628f852b020a", "score": "0.5718572", "text": "function getPrompt() {\n game.board.viewGrid();\n rl.question('which piece?: ', (whichPiece) => {\n rl.question('to where?: ', (toWhere) => {\n game.moveChecker(whichPiece, toWhere);\n getPrompt();\n });\n });\n}", "title": "" }, { "docid": "a48aa1ab99f7013fcf88ef914cb95b74", "score": "0.57182837", "text": "nextQuestion(choice){\n\t\tclearLocalNotifications().then(setLocalNotification);\n\t\tthis.setState((state)=>{\n\t\t\tconsole.log(state.currQuestion);\n\n\t\t\treturn {\n\t\t\t\tcurrQuestion: state.questions.length-1 == state.currQuestion? state.currQuestion : state.currQuestion+1,\n\t\t\t\tcorrectAnswer: choice === 'correct'? ++state.correctAnswer:state.correctAnswer,\n\t\t\t\tshowScore: state.questions.length-1 == state.currQuestion? true:false\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "ca6205266b979dcd567993497174d4f6", "score": "0.57169884", "text": "getNewQuestion() {\n return this.client.getQuestion().then(result => {\n this.setState({\n data: result.data[0]\n })\n console.log(this.state.data.answer)\n })\n }", "title": "" }, { "docid": "4c29786c7a7ecfc24534867000485423", "score": "0.57144165", "text": "function getQuestion() {\n return localStorage.getItem('question');\n}", "title": "" }, { "docid": "9e9dac9dd958bce939b5a7f995e4018d", "score": "0.57094747", "text": "function getTheCorrectAnswer() {\r\n for (var i = 0; questionsArray[onThisQuestionNumber].Answers.length; i++) {\r\n if (questionsArray[onThisQuestionNumber].Answers[i].IsCorrect == true) {\r\n return questionsArray[onThisQuestionNumber].Answers[i].Text \r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "a28cdb103a90828a14b002bc75380a3c", "score": "0.5708557", "text": "function initAnswer()\n\t{\n\t\tif (!layout.ansInput)\n\t\t\treturn;\n\n\t\tdrawList.setParam('answerInput', 'type', layout.qType);\n\n\t\tif (layout.qType === 'multi')\n\t\t\tdrawList.setParam('answerInput', 'text', problem.get('a'));\n\t\telse if (layout.qType === 'radio' || layout.qType === 'check')\n\t\t\tdrawList.setParam('answerInput', 'choices', problem.get('choices'));\n\t\telse if (layout.qType === 'graphPlot' || layout.qType === 'graphConst')\n\t\t{\n\t\t\tdrawList.setParam('answerInput', 'eq', problem.get('graphequations'));\n\t\t\tdrawList.setParam('answerInput', 'axis', problem.get('graphparms'));\n\t\t}\n\t\telse if (layout.qType === 'equation')\n\t\t{\n\t\t\tdrawList.setParam('answerInput', 'pre', problem.get('ansPrefix'));\n\t\t\tdrawList.setParam('answerInput', 'post', problem.get('ansSuffix'));\n\t\t}\n\t}", "title": "" }, { "docid": "6ce3908d733a2733f473f2b99274105a", "score": "0.57048076", "text": "function init() {\n\tinquirer.prompt(questions).then((response) => {\n\t\tconsole.log(response);\n\t\tinquirer.prompt(addQuestions).then((response2) => {\n\t\t\tconsole.log(response2);\n\t\t\tswitch (response2.addChoice) {\n\t\t\t\tcase \"employee\":\n\t\t\t\t\temployee();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"role\":\n\t\t\t\t\trole();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"department\":\n\t\t\t\t\tdepartment();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t// code block\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c19e90458f1383d82006fa4f2b9984d6", "score": "0.5696249", "text": "_getChoiceResponse(step, text) {\n\t const choice = txt.conversation[step].answer_choice.find((choice) => choice.text === text);\n return choice ? choice.response : '';\n }", "title": "" }, { "docid": "60209c2bca06792a75bdb4fa42033abd", "score": "0.56956434", "text": "function getQuestion() {\n questionEl = document.createElement(\"h3\"); \n playAreaEl.append(questionEl);\n playAreaEl.append(answerDiv);\n\n var currentQuestionIndex = 0; // Index into the qeustions array for the current question\n\n // Randomly choose a question that has not yet been asked\n do {\n currentQuestionIndex = getRandomInt(questions.length); \n } while (indicesOfQuestionsAlreadyAsked.indexOf(currentQuestionIndex) >= 0);\n\n questionEl.textContent = questions[currentQuestionIndex].title;\n\n for (var k = 0; k < questions[currentQuestionIndex].choices.length; k++) {\n var answerEl = document.createElement(\"div\");\n answerEl.textContent = (k + 1) + \" \" + questions[currentQuestionIndex].choices[k];\n answerEl.setAttribute(\"data-question-id\", currentQuestionIndex);\n answerEl.setAttribute(\"data-answer-id\", k);\n\n answerDiv.append(answerEl);\n }\n\n // Record that we already asked this question\n indicesOfQuestionsAlreadyAsked.push(currentQuestionIndex);\n\n // Increment number of questions asked\n numQuestionsAsked++;\n\n playAreaEl.append(resultDiv);\n }", "title": "" }, { "docid": "9868731ec69bbf5f8de6c785fe2223a3", "score": "0.5685725", "text": "function init() {\n inquirer\n .prompt(questions)\n .then((answers) => {\n // Use user feedback for... whatever!!\n console.log(answers)\n \n \n \n \n writeToFile('README.md', generateMarkdown(answers))\n })\n \n}", "title": "" }, { "docid": "74c9f664e13a303e978288fec3f2c535", "score": "0.5668073", "text": "function initInquire(){\n id++\n inquirer\n .prompt(questions.employeeQuestions)\n .then(data =>{\n // based on role, ask additional questions and read data\n checkRole(data);\n })\n .catch(err =>{\n console.log(err);\n })\n}", "title": "" }, { "docid": "d5c6bf686ebbc999bd9d6129e497d8e4", "score": "0.56665415", "text": "function getQA(){\n q = arrQAH[count].Question;\n a = arrQAH[count].Answer;\n h = arrQAH[count].Hint;\n count += 1;\n question.textContent = q;\n}", "title": "" }, { "docid": "d677173e6be37d6f559ad4f91a1f774b", "score": "0.56647015", "text": "function questions() {\n return inquirer\n .prompt([\n {\n type: \"input\",\n name: \"title\",\n message: \"What is the title of your project?\"\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Please write a breif description of your project.\"\n },\n {\n type: \"input\",\n name: \"usage\",\n message: \"What is the usage of your project?\"\n },\n {\n type: \"input\",\n name: \"installation\",\n message: \"Please describe what intallation process did you use for your project.\"\n },\n {\n type: \"checkbox\",\n name: \"license\",\n message: \"Please choose the appropriate license for your project.\",\n choices: [\"Academic\", \"GNU\", \"ISC\", \"Open\"]\n },\n {\n type: \"input\",\n name: \"contributing\",\n message: \"Who are the contributors to this project?\"\n },\n {\n type: 'list', \n message: 'What is your preferred method of communication?',\n name: 'contact',\n choices: ['email', 'github', 'slack']\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"Please enter your email: \"\n },\n {\n type: \"input\",\n name: \"username\",\n message: \"Please enter your GitHub username: \"\n },\n {\n type: \"input\",\n name: \"tests\",\n message: \"Were there any tests included in this project?\"\n }\n ]);\n}", "title": "" }, { "docid": "cc5dfdeb4b437f9aae4613cb6a81f7a2", "score": "0.5662661", "text": "function init() {\n inquirer.prompt(questions).then(function(answers) {\n console.log(answers);\n writeToFile(generateMarkdown(answers));\n })\n}", "title": "" }, { "docid": "5c5d5ec368435394f93fcd2b037fe1ea", "score": "0.566207", "text": "function getQ1() {\r\n var q1 = prompt('Is it true that I\\'ve lived in Hawaii? (y/n)');\r\n if (q1.toLowerCase().charAt(0) === 'y'){\r\n alert('Correct! I lived there for a couple of years. Mahalo for taking this quiz!');\r\n console.log('Question 1 Correct Answer: ' + q1);\r\n correctAnswers++;\r\n }\r\n else {\r\n alert('Incorrect! I lived in Hawaii for a couple of years!');\r\n console.log('Question 1 Incorrect Answer: ' + q1);\r\n }\r\n }", "title": "" }, { "docid": "617476d1c7faf1bceffc4b27f59b8bbc", "score": "0.565994", "text": "displayQuestion() {\r\n this.parseCurrentQuestion();\r\n this.shuffleAnswers();\r\n }", "title": "" }, { "docid": "a69badb35b47581d9b6e142355e89ac5", "score": "0.56589395", "text": "function startquestions() {\n inquirer\n .prompt({\n type: \"list\",\n name: \"startQ\",\n message: \"What would you like to do?\",\n choices: [\n \"view all employees\",\n \"view all roles\",\n \"view all departments\",\n \"add employee\",\n \"add department\",\n \"add role\",\n \"update employee role\",\n \"remove employee\"\n ]\n })\n\n .then(function(answer) {\n console.log(answer);\n // start of switch statment for user choice\n switch (answer.startQ) {\n case \"view all employees\":\n viewallemployees();\n break;\n\n case \"view all roles\":\n viewallroles();\n break;\n\n case \"view all departments\":\n viewalldepartments();\n break;\n\n case \"add employee\":\n addEmployee();\n break;\n\n case \"update employee role\":\n updateEmpRole();\n break;\n\n case \"add department\":\n addDepartment();\n break;\n\n case \"add role\":\n addRole();\n break;\n }\n });\n}", "title": "" }, { "docid": "68874c21a1f66a5f5ea5afe490119abd", "score": "0.5647943", "text": "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n console.log();\n candidateWord = input.question('Enter a word to score: ');\n //console.log(oldScrabbleScorer(candidateWord));\n\n}", "title": "" }, { "docid": "89b93ed4d5b0b07e5b300cba756c1a5e", "score": "0.56438977", "text": "async function getTriviaQuestion(initial, tokenChannel, tokenRetry, isFirstQuestion, category, typeInput, difficultyInput) {\n var length = global.questions.length;\n var toReturn;\n\n // Check if there are custom arguments\n var isCustom = false;\n if(typeof category !== \"undefined\" || typeof typeInput !== \"undefined\" || typeof difficultyInput !== \"undefined\") {\n isCustom = true;\n }\n\n // To keep the question response quick, the bot always stays one question ahead.\n // This way, we're never waiting for the database to respond.\n if(typeof length === \"undefined\" || length < 2 || isCustom) {\n // We need a new question, either due to an empty cache or because we need a specific category.\n var options = {};\n options.category = category; // Pass through the category, even if it's undefined.\n\n if(isCustom || Config.databaseURL.startsWith(\"file://\")) {\n options.amount = 1;\n }\n else {\n options.amount = getConfigVal(\"database-cache-size\");\n }\n\n options.type = typeInput;\n options.difficulty = difficultyInput;\n\n // Get a token if one is requested.\n var token;\n if(typeof tokenChannel !== \"undefined\") {\n try {\n token = await Database.getTokenByIdentifier(tokenChannel.id);\n\n if(getConfigVal(\"debug-mode\")) {\n Trivia.send(tokenChannel, void 0, `*Token: ${token}*`);\n }\n } catch(error) {\n // Something went wrong. We'll display a warning but we won't cancel the game.\n console.log(`Failed to generate token for channel ${tokenChannel.id}: ${error.message}`);\n Trivia.send(tokenChannel, void 0, {embed: {\n color: 14164000,\n description: `Error: Failed to generate a session token for this channel. You may see repeating questions. (${error.message})`\n }});\n }\n\n if(typeof token !== \"undefined\" && (isCustom || Config.databaseURL.startsWith(\"file://\")) ) {\n // Set the token and continue.\n options.token = token;\n }\n }\n\n var json = {};\n var err;\n try {\n json = await Database.fetchQuestions(options);\n\n if(getConfigVal(\"debug-database-flush\") && !tokenRetry && typeof token !== \"undefined\") {\n err = new Error(\"Token override\");\n err.code = 4;\n throw err;\n }\n } catch(error) {\n if(error.code === 4 && typeof token !== \"undefined\") {\n // Token empty, reset it and start over.\n if(tokenRetry !== 1) {\n try {\n await Database.resetToken(token);\n } catch(error) {\n console.log(`Failed to reset token - ${error.message}`);\n throw new Error(`Failed to reset token - ${error.message}`);\n }\n\n if(!isFirstQuestion) {\n if(typeof category === \"undefined\") {\n Trivia.send(tokenChannel, void 0, \"You've played all of the available questions! Questions will start to repeat.\");\n }\n else {\n Trivia.send(tokenChannel, void 0, \"You've played all of the questions in this category! Questions will start to repeat.\");\n }\n }\n\n // Start over now that we have a token.\n return await getTriviaQuestion(initial, tokenChannel, 1, isFirstQuestion, category, typeInput, difficultyInput);\n }\n else {\n if(isFirstQuestion) {\n err = new Error(\"There are no questions available under the current configuration.\");\n err.code = -1;\n throw err;\n }\n else {\n // This shouldn't ever happen.\n throw new Error(\"Token reset loop.\");\n }\n }\n }\n else {\n console.log(\"Received error from the trivia database!\");\n console.log(error);\n console.log(json);\n\n // Delete the token so we'll generate a new one next time.\n // This is to fix the game in case the cached token is invalid.\n if(typeof token !== \"undefined\") {\n delete Database.tokens[tokenChannel.id];\n }\n\n // Author is passed through; Trivia.send will handle it if author is undefined.\n throw new Error(`Failed to query the trivia database with error code ${json.response_code} (${Database.responses[json.response_code]}; ${error.message})`);\n }\n }\n finally {\n global.questions = json;\n }\n }\n\n if(!initial) {\n // Just in case, check the cached question count first.\n if(global.questions.length < 1) {\n throw new Error(\"Received empty response while attempting to retrieve a Trivia question.\");\n }\n else {\n toReturn = global.questions[0];\n\n delete global.questions[0];\n global.questions = global.questions.filter((val) => Object.keys(val).length !== 0);\n\n return toReturn;\n }\n }\n}", "title": "" }, { "docid": "effea36f1667b7380a3b1a30dc83439a", "score": "0.56429744", "text": "function firstQ() {\n inquirer\n .prompt([\n {\n type: \"list\",\n message: \"Would you like to add, view, or modify an employee?\",\n name: \"firstQChoice\",\n choices: [\"add\", \"view\", \"modify\"],\n },\n ])\n .then(function (deptAnswers) {\n if (deptAnswers.firstQChoice === \"add\") {\n addWhat(deptAnswers);\n } else if (deptAnswers.firstQChoice === \"view\") {\n viewWhat(deptAnswers);\n } else {\n modifyWhat(deptAnswers);\n }\n });\n}", "title": "" }, { "docid": "8044a9b2effaadf993054068d5f657e2", "score": "0.5638774", "text": "async function ans () {\n try {\n var a = ask.question(nq);\n if (typeof a == 'object'){\n console.log(typeof a);\n } else {\n console.log (\"There was an error\");\n }\n } catch (e){\n console.log(e);\n }\n return a;\n}", "title": "" }, { "docid": "19e862c330421f80481623f69bd4e63d", "score": "0.5634609", "text": "function ask(question) {\n update($question,quiz.question + question);\n return prompt(\"Enter your answer:\");\n}", "title": "" }, { "docid": "3e7cec257292a9bfafad75435344a5be", "score": "0.5631456", "text": "function setNextQuestion() {}", "title": "" }, { "docid": "ab1c70ff95f3c14bfc246e5b3ed2ee05", "score": "0.5627373", "text": "function answer1 () {\n\t//the answer should be \"yes\" or \"no\"\n\treturn \"no\"\n}", "title": "" }, { "docid": "bf4ff290d0e3cfbc2503f6a68b2680d0", "score": "0.56259483", "text": "initialize() {\n const choices = this.initalChoices.map((k, i) => ({ name: k, value: i }))\n const message = createList('Initate Request', choices)\n const callBacks = [this.selectKingdom, this.run]\n askQuestion(message).then(ans => {\n const [key] = Object.values(ans)\n const callback = callBacks[key]\n return callback ? callback() : false\n })\n }", "title": "" }, { "docid": "5dac838f10a1fd96667ddd9b9fc7fbb4", "score": "0.5620647", "text": "function init() {\n inquirer.prompt(questions)\n .then((responses) => {\n console.log('inquiry response: ', responses);\n writeToFile('generatedREADME.md', generateMarkdown({...responses}));\n })\n\n}", "title": "" }, { "docid": "cfef7aabf45cc2f505dab85aa7421cc0", "score": "0.56203705", "text": "function init() {\n let readMeStr = \"\";\n inquirer.prompt(questions)\n .then((answers) => {\n console.log(\"GOing to handle answers...\");\n readMeStr = generateMarkdown(answers);\n if (readMeStr.length > 0) writeToFile('ReadmeEx.md', readMeStr)\n else console.log(\"An error occured when generating the text for the Readme.\");\n });\n}", "title": "" }, { "docid": "2352b48784a5ec598b348cfa44906724", "score": "0.5613246", "text": "get answers() {return getRandomAnswers(4, this.correctAnswer)}", "title": "" }, { "docid": "1d6789e93fc8d1a1babd1f15c50f3309", "score": "0.56121624", "text": "get correct(){ return(\n this.#correctIdx === undefined\n ? <i>&mdash; ei oikeaa tai v&auml;&auml;r&auml;&auml; vastausta</i> // ...no correct answer at all...\n : this.#text[this.#text.length-1]==='=' // question ends with '='?\n ? this.#answers[this.#correctIdx] // ...if so, don't alter\n : ': '+this.#answers[this.#correctIdx] // ...but if not, fiddle with it a bit.\n )}", "title": "" }, { "docid": "542bd5a053917f3c7036f2d76de175b9", "score": "0.5607006", "text": "function init() {\n inquirer\n .prompt(questions)\n .then(answers => {\n const fileName = `README.md`;\n writeToFile(fileName, answers);\n console.log(answers);\n })\n}", "title": "" }, { "docid": "3dfdca6403461b1891846f117313ef74", "score": "0.5602681", "text": "function retieveAnswers (){\n\n}", "title": "" }, { "docid": "fc263f4eb4c551d2c2d41c4a2734c5a1", "score": "0.559855", "text": "function getPlayerInitials() {\n var loops = window.prompt(\"Introduce your initials\", \" (Max. 3)\");\n if (loops != null) {\n return loops;\n }\n}", "title": "" }, { "docid": "8586d0bd017bfe424d1921518c179f00", "score": "0.55968195", "text": "function quizAnswer(){\n if (quiz[i].ans == 1){\n quizAns = quiz[i].choice1;\n }else if (quiz[i].ans == 2){\n quizAns = quiz[i].choice2;\n }else if (quiz[i].ans == 3){\n quizAns = quiz[i].choice3;\n }if (quiz[i].ans == 4){\n quizAns = quiz[i].choice4;\n }\n console.log(quizAns);\n \n return quizAns;\n }", "title": "" }, { "docid": "f6b602e3d7975d8e256631f38dad690a", "score": "0.55938584", "text": "function askUser(){\n if(prov == 0)\n inquirer.prompt([questions]).then(answers => {choiceMade(answers.whatToDo)});\n else\n inquirer.prompt([questions1]).then(answers => {choiceMade(answers.whatToDo1)});\n }", "title": "" }, { "docid": "da21c8965b8ede2cc61dc56ded818a18", "score": "0.55933887", "text": "function getPickedQuestion(){\n if(options.length > 0){\n randomIndex = Math.floor(Math.random() * options.length); \n var question = options[randomIndex]; \n return question;\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "db4f826ef830c36cf54d7e38c8e8df0d", "score": "0.5593302", "text": "function qGrabber() {\n let num = store.questionNumber;\n let q = store.questions[num].question;\n let a = store.questions[num].answers; // a will be an array of 4 strings\n return [q,a];\n}", "title": "" }, { "docid": "508bc08db229a2356eb0c96251a44f24", "score": "0.5584442", "text": "function getQuestion() {\n\tconsole.log(\"the getQuestion function was called\");\n\tm = Math.floor((Math.random() * 10) + 0); //figure out how to set this var to min = 0, max = trivia.length so that I can add more questions without having to change this\n\tconsole.log(\"Question #\" + m);\n\tquestionsUsed.push(m);\n\tchoiceA = trivia[m].choices[0];\n\tchoiceB = trivia[m].choices[1];\n\tchoiceC = trivia[m].choices[2];\n\tchoiceD = trivia[m].choices[3];\n\tcorrectAnswer = trivia[m].validAnswer;\n\tanswerImg = trivia[m].images;\n\t$('#spanQuestion').text(trivia[m].question); \n\t$('#guess0').text(choiceA);\n\t$('#guess1').text(choiceB);\n\t$('#guess2').text(choiceC);\n\t$('#guess3').text(choiceD);\n\tconsole.log(\"The correct answer is \" + correctAnswer);\n\ttimer();\n}", "title": "" } ]
227d9cb355a03229b633557550c5a74d
saveDiff(pcID, releaseID, diff, userID, connection, callback) saves the diff to the layout specified by (pcID, releaseID) and stores the ID of the user currently editing the pathway. Returns a promise unless a callback is provided to be executed
[ { "docid": "43df2d100a0ebe29419f0bbc82caf52d", "score": "0.8401892", "text": "function saveDiff(pcID, releaseID, diff, userID, connection, callback) {\n // Check if this is a new user submitting a layout and act accordingly.\n return handleUserInfo(pcID, releaseID, userID, connection).then(() => {\n // Once that is dealt with, update the layout to contain the new diff.\n return updateLayout(pcID, releaseID, diff, connection, callback);\n });\n}", "title": "" } ]
[ { "docid": "1d3a39bafa8c89e209f2576c1cd67db1", "score": "0.70302016", "text": "function submitDiff(pcID, releaseID, diff, userID) {\n return db.connect().then((connection) => {\n return diffSaver.saveDiff(pcID, releaseID, diff, userID, connection);\n }).catch((e) => {\n logger.error(e);\n });\n}", "title": "" }, { "docid": "e458309e03457fb6b2f55a86fb289bc8", "score": "0.53645116", "text": "function updateLayout(pcID, releaseID, diff, connection, callback) {\n let result = db.queryRoot(pcID, releaseID, config)\n .concatMap(function (version) { return version('layout_ids'); })\n .eqJoin(function (id) { return id; }, r.db(config.databaseName).table('layout'))\n .zip()\n .orderBy(r.desc('date_added'))\n .pluck('id')\n .run(connection)\n .then((cursor) => {\n return cursor.next(); // returns the most recent layout\n }).then((activeLayout) => {\n return r.db(config.databaseName).table('layout').get(activeLayout.id)\n .update({ positions: { [diff.nodeID]: diff.bbox } })\n .run(connection);\n\n });\n\n return db.handleResult(result, callback);\n}", "title": "" }, { "docid": "41f17777a30b628ad5729e82cae0207b", "score": "0.51861316", "text": "function submitLayout(pcID, releaseID, layout, userID) {\n //Get the requested layout\n return db.connect().then((connection) => {\n update.saveLayout(pcID, releaseID, layout, userID, connection);\n return 'Layout was updated.';\n\n }).catch((e) => {\n logger.error(e);\n return 'ERROR: Something went wrong in submitting the layout';\n });\n}", "title": "" }, { "docid": "81b4384e552240b225eecc0c5a4dfcaf", "score": "0.47344604", "text": "updatePass(newPass, applicnatId) {\n logger.info('updatePass() initiated');\n return new Promise((resolve, reject) => {\n let sql = sqlObj.settings.update;\n let sqlQuery = format(sql, newPass, applicnatId, utils.getGMT());\n\n db.doRead(sqlQuery).then(result => {\n logger.info('updatePass() execution completed');\n resolve(result);\n })\n .catch(err => {\n logger.info('updatePass() execution failed');\n reject(new Error(err));\n })\n })\n }", "title": "" }, { "docid": "016cffd98331ee94bc5cbbc9c088da69", "score": "0.46345463", "text": "save() {\n const { userProfileId, problemLabel, systemLabel } = this.data;\n if (!userProfileId || !problemLabel || !systemLabel) {\n const error = \n `Can't save() userCommitment. Missing either 'userProfileId', 'problemLabel', and/or 'systemLabel'. Use set() to set them first.`;\n return new Promise((resolve, reject)=>reject(error));\n }\n return wrapper.create(userProfileId, problemLabel, systemLabel);\n }", "title": "" }, { "docid": "7eebb732dca0f9bee98e03ad7f3130c7", "score": "0.45819345", "text": "function handleUserInfo(pcID, releaseID, userID, connection, callback) {\n\n let result = db.queryRoot(pcID, releaseID, config).run(connection)\n .then((cursor) => {\n return cursor.next();\n }).then((version) => {\n\n if (version.users.indexOf(userID) >= 0) {\n return Promise.resolve();\n }\n\n let numUsers = version.users.length;\n let addUserProm = addUser(version, userID, connection);\n\n if (numUsers) {\n return addUserProm;\n } else {\n let writeLayout = createNewLayout(version, connection);\n return Promise.all([addUserProm, writeLayout]);\n }\n });\n\n return db.handleResult(result, callback);\n}", "title": "" }, { "docid": "ab256384de9d6c946008706b1d27e985", "score": "0.45319906", "text": "function saveProcedure() {\r\n\tvar sidebarBundle = document.getElementById(\"bundle-coscripter-sidebar\")\r\n\tvar overwriteQuestion = sidebarBundle.getString(\"overwriteQuestion\")\r\n\tvar saveACopyQuestion = sidebarBundle.getString(\"saveACopyQuestion\")\r\n\r\n\t// TL: this is no longer exposed in the UI; we always assume true\r\n\t// We should probably remove this because it does some unpredictable\r\n\t// rewriting of the script on save\r\n\tvar saveData = true;\r\n\t// this needs to be synced more permanently with the\r\n\t// currentProcedure data but here's definitely a good \r\n\t// point for a snapshot\r\n\tcurrentProcedure.setTitle(getProcedureTitle());\r\n\tcurrentProcedure.setBody(getProcedureTextForWiki(saveData));\r\n\tcurrentProcedure.setPrivate(isProcedurePrivate());\r\n\r\n\t// A change message to be logged along with this save\r\n\tvar changemsg = \"\";\r\n\r\n\t// If it's a new procedure, then we save it to the wiki as usual. (But\r\n\t// there should be a dialog box that pops up warning us that we are\r\n\t// saving to a public repository, if it's not a private script. Maybe\r\n\t// that should be combined with this dialog?)\r\n\t//\r\n\t// However if it's not a new procedure, we need to ask the user whether\r\n\t// they want to overwrite the existing procedure, or save a new copy.\r\n\t//\r\n\tif ( !localP() && !isNewProcedure() ) {\r\n\t\t// If it's my script, then don't prompt me to overwrite or save a\r\n\t\t// copy; always overwrite\r\n\t\tif (currentProcedure.getSessionUser() !=\r\n\t\t\tcurrentProcedure.getCreator()) {\r\n\t\t\t\r\n\t\t\t// Use this params hash to pass arguments to/from the dialog\r\n\t\t\tvar params = { inn: { 'title' : currentProcedure.getTitle(),\r\n\t\t\t\t'owner' : currentProcedure.getCreatorName() },\r\n\t\t\t\tout: null};\r\n\t\t\twindow.openDialog(\"chrome://coscripter/content/coscripter-save-dialog.xul\",\r\n\t\t\t\t\"\", \"chrome, dialog, modal, resizable=yes\",\r\n\t\t\t\tparams).focus();\r\n\t\t\tif (params.out) {\r\n\t\t\t\t// Check which option was selected\r\n\t\t\t\tif (!params.out.overwrite) {\r\n\t\t\t\t\t// If you get here, it means \"make copy\" was selected\r\n\t\t\t\t\t// If they selected \"make copy\", set the id of the current\r\n\t\t\t\t\t// procedure to null, indicating that it is a new procedure\r\n\t\t\t\t\tcurrentProcedure.setId(null);\r\n\t\t\t\t\t// And use the title they specified\r\n\t\t\t\t\tcurrentProcedure.setTitle(params.out.newtitle);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// If you get here, \"overwrite\" was selected\r\n\t\t\t\t\t// Extract the changelog entry if there was one\r\n\t\t\t\t\tchangemsg = params.out.changemsg;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// User clicked Cancel\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t//if ( isProcedurePrivate() ) {\r\n\t//\tsaveProcedureLocal(currentProcedure);\r\n\t//}\r\n\t//else {\r\n\r\n\tif (!localP()){\r\n\t\tif (!saveProcedureToWiki(currentProcedure, false, changemsg)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t//}\r\n\t\r\n\tif (localP() || contextP()) {\r\n\t\tif (currentProcedure && currentCoScript){\r\n\t\t\t// we need to keep track of whether an externally loaded script has ever been explicitly saved:\r\n\t\t\t//debug(\"saveProcedure setting savedP to true\")\r\n\t\t\tcurrentCoScript.savedP = true;\r\n\t\t\tsaveCurrentCoScriptLocally()\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar sidebarBundle = document.getElementById(\"bundle-coscripter-sidebar\")\r\n\tvar scriptSaved = sidebarBundle.getString(\"scriptSaved\")\r\n\tsetStatus(scriptSaved);\r\n\tedited = false;\r\n\tsetProcedureTitle(currentProcedure.getTitle());\r\n\tshowToWikiButton(true);\r\n\treturn true;\r\n}\t// end of saveProcedure", "title": "" }, { "docid": "b177e2a77e05ff21bd33787a0e00c2b3", "score": "0.4511012", "text": "function submitGraph(pcID, releaseID, newGraph) {\n return db.connect().then((connection) => {\n return update.updateGraph(pcID, releaseID, newGraph, connection);\n }).catch((e) => {\n logger.error(e);\n });\n}", "title": "" }, { "docid": "e31dc93370f78814cc7d596ccbfab453", "score": "0.44317657", "text": "function syncTreeApplyUserMerge(syncTree,path,changedChildren,writeId){// Record pending merge.\nwriteTreeAddMerge(syncTree.pendingWriteTree_,path,changedChildren,writeId);const changeTree=ImmutableTree.fromObject(changedChildren);return syncTreeApplyOperationToSyncPoints_(syncTree,new Merge(newOperationSourceUser(),path,changeTree));}", "title": "" }, { "docid": "11d045ce191d831f546e3ba1f66e0120", "score": "0.4425078", "text": "function saveProcedureToWiki(procedure, doNotReplaceCurrentProcedure,\r\n\tchangeMsg) {\r\n\tvar sidebarBundle = document.getElementById(\"bundle-coscripter-sidebar\")\r\n\tvar warningTitleMessage = sidebarBundle.getString(\"warningTitleMessage\")\r\n\tvar saveWikiWarningMessage = sidebarBundle.getString(\"saveWikiWarningMessage\")\r\n\tvar dontShowWarningMessage = sidebarBundle.getString(\"dontShowWarningMessage\")\r\n\tvar warningSavingToPrimary = sidebarBundle.getString(\"warningSavingToPrimary\")\r\n\tvar errorSavingScriptExclamation = sidebarBundle.getString(\"errorSavingScriptExclamation\")\r\n\tvar serverReturnedErrorCode = sidebarBundle.getString(\"serverReturnedErrorCode\")\r\n\tvar notLoggedIn = sidebarBundle.getString(\"notLoggedIn\")\r\n\r\n\tvar params = {};\r\n\tparams['title'] = procedure.getTitle();\r\n\tparams['body'] = procedure.getBody();\r\n\tparams['private'] = procedure.isPrivate();\r\n\tif ( procedure.getId() ) {\r\n\t\tparams['id'] = procedure.getId();\r\n\t}\r\n\tif (typeof(changeMsg) != \"undefined\") {\r\n\t\tparams['changelog'] = changeMsg;\r\n\t}\r\n\t\t\r\n\tif ( !procedure.isPrivate() && warnOnSaveP() ) {\r\n\t\tvar discontinueWarning = {};\r\n\t\tvar buttonFlags = promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_SAVE + promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_CANCEL\t// Show 2 buttons, with the specified button titles\r\n\t\tvar result = promptService.confirmEx(components.utils().getMainChromeWindow(window), \r\n\t\t\t\t\t\t\t\t\t\t\t\t warningTitleMessage, \r\n\t\t\t\t\t\t\t\t\t\t\t\t saveWikiWarningMessage, \r\n\t\t\t\t\t\t\t\t\t\t\t\t buttonFlags, null, null, null, \r\n\t\t\t\t\t\t\t\t\t\t\t\t dontShowWarningMessage, discontinueWarning)\r\n\t\tvar coscripterPrefs = components.utils().getCoScripterPrefs();\r\n\t\tif (discontinueWarning.value) \r\n\t\t\tcoscripterPrefs.setBoolPref(\"warnOnSaveP\", false)\r\n\t\telse\r\n\t\t\tcoscripterPrefs.setBoolPref(\"warnOnSaveP\", true)\t\r\n\t\t\t\t\r\n\t\tif (result == 1) {\r\n\t\t\treturn false;\r\n\t\t} \r\n\t}\r\n\t\r\n\tvar saveURL = procedure.getSaveUrl();\r\n\tif (saveURL == null || procedure.getId() == null) {\r\n\t\t// if there's no save url or if it's a new script, save it back to the primary server\r\n\t\tsaveURL = components.utils().getKoalescenceAPIFunction('savescript')\r\n\t\tif (procedure.getId() != null) {\r\n\t\t\t// Ideally we will never get here but it's good to check\r\n\t\t\talert(warningSavingToPrimary);\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n\tvar ret = components.utils().post(saveURL, params);\r\n\t\r\n\ttry {\r\n\t\tif (ret == null) {\r\n\t\t\talert(errorSavingScriptExclamation);\r\n\t\t\treturn false;\r\n\t\t} else if (ret[0] >= 200 && ret[0] < 300) {\r\n\t\t\tvar newProcedure = null;\r\n\t\t\tvar procedureToAssociate = null;\r\n\t\t\tif ( isNewProcedure()) {\r\n\t\t\t\tvar scriptdata = nativeJSON.decode( ret[1]);\r\n\t\t\t\tnewProcedure = new Procedure(scriptdata);\r\n\t\t\t\tprocedureToAssociate = newProcedure;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tprocedureToAssociate = currentProcedure;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If there is a current Vegemite table, associate the script with that table\r\n\t\t\tif (spreadsheetP() && window.top.coscripter.scratchSpaceUI && window.top.coscripter.scratchSpaceUI.isVisible()) {\r\n\t\t\t\tvar scratchSpaceUI = window.top.coscripter.scratchSpaceUI;\r\n\t\t\t\tvar editor = scratchSpaceUI.getEditor();\r\n\t\t\t\tvar table = scratchSpaceUI.getScratchSpace().getTables()[editor.getCurrentTableIndex()];\r\n\t\t\t\tvar scriptInfo = {url: procedureToAssociate.scriptjson[\"json-url\"], title: procedureToAssociate.getTitle()}; \r\n\t\t\t\tif (table.getScriptIndex(scriptInfo) == -1) {\r\n\t\t\t\t\ttable.addScript(scriptInfo);\r\n\t\t\t\t\ttable.logAction(new ScratchSpaceTable.RunScriptAction(procedureToAssociate.getId()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tprocedure.setId(procedureToAssociate.getId());\r\n\t\t\t\r\n\t\t\tif (newProcedure != null && !doNotReplaceCurrentProcedure) {\r\n\t\t\t\tcurrentProcedure = newProcedure;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif (ret[0] == \"401\") {\r\n\t\t\t\talert(errorSavingScriptExclamation + \" \" + notLoggedIn);\r\n\t\t\t} else {\r\n\t\t\t\talert(errorSavingScriptExclamation + \" \" + serverReturnedErrorCode + \" \" + ret[0]);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\talert(errorSavingScriptExclamation + \": \" + e);\r\n\t\treturn false;\r\n\t}\r\n\t// Should not get here\r\n\treturn false;\r\n}", "title": "" }, { "docid": "155f1cda532589d15e3812d3957f5b13", "score": "0.4306605", "text": "function saveAsProgramToServer() {\n $formSingleModal.validate();\n if ($formSingleModal.valid()) {\n $('.modal').modal('hide'); // close all opened popups\n var progName = $('#singleModalInput').val().trim();\n var xmlProgram = Blockly.Xml.workspaceToDom(blocklyWorkspace);\n var xmlProgramText = Blockly.Xml.domToText(xmlProgram);\n var isNamedConfig = !GUISTATE_C.isConfigurationStandard() && !GUISTATE_C.isConfigurationAnonymous();\n var configName = isNamedConfig ? GUISTATE_C.getConfigurationName() : undefined;\n var xmlConfigText = GUISTATE_C.isConfigurationAnonymous() ? GUISTATE_C.getConfigurationXML() : undefined;\n var userAccountName = GUISTATE_C.getUserAccountName();\n LOG.info('saveAs program ' + GUISTATE_C.getProgramName());\n PROGRAM.saveAsProgramToServer(progName, userAccountName, xmlProgramText, configName, xmlConfigText, GUISTATE_C.getProgramTimestamp(), function (result) {\n if (result.rc === 'ok') {\n LOG.info('saved program ' + GUISTATE_C.getProgramName() + ' as ' + progName);\n result.name = progName;\n result.programShared = false;\n GUISTATE_C.setProgram(result, userAccountName, userAccountName);\n MSG.displayInformation(result, 'MESSAGE_EDIT_SAVE_PROGRAM_AS', result.message, GUISTATE_C.getProgramName());\n }\n else {\n if (result.cause === 'ORA_PROGRAM_SAVE_AS_ERROR_PROGRAM_EXISTS') {\n //show replace option\n //get last changed of program to overwrite\n var lastChanged = result.lastChanged;\n var modalMessage = Blockly.Msg.POPUP_BACKGROUND_REPLACE || 'A program with the same name already exists! <br> Would you like to replace it?';\n $('#show-message-confirm').oneWrap('shown.bs.modal', function (e) {\n $('#confirm').off();\n $('#confirm').onWrap('click', function (e) {\n e.preventDefault();\n PROGRAM.saveProgramToServer(progName, userAccountName, xmlProgramText, configName, xmlConfigText, lastChanged, function (result) {\n if (result.rc === 'ok') {\n LOG.info('saved program ' + GUISTATE_C.getProgramName() + ' as ' + progName + ' and overwrote old content');\n result.name = progName;\n GUISTATE_C.setProgram(result, userAccountName, userAccountName);\n MSG.displayInformation(result, 'MESSAGE_EDIT_SAVE_PROGRAM_AS', result.message, GUISTATE_C.getProgramName());\n }\n else {\n LOG.info('failed to overwrite ' + progName);\n MSG.displayMessage(result.message, 'POPUP', '');\n }\n });\n }, 'confirm modal');\n $('#confirmCancel').off();\n $('#confirmCancel').onWrap('click', function (e) {\n e.preventDefault();\n $('.modal').modal('hide');\n }, 'cancel modal');\n });\n MSG.displayPopupMessage('ORA_PROGRAM_SAVE_AS_ERROR_PROGRAM_EXISTS', modalMessage, Blockly.Msg.POPUP_REPLACE, Blockly.Msg.POPUP_CANCEL);\n }\n }\n });\n }\n }", "title": "" }, { "docid": "b81085d7f80cbbe48d0f2e3c9d0ebc4e", "score": "0.4278151", "text": "function syncTreeApplyUserOverwrite(syncTree,path,newData,writeId,visible){// Record pending write.\nwriteTreeAddOverwrite(syncTree.pendingWriteTree_,path,newData,writeId,visible);if(!visible){return[];}else{return syncTreeApplyOperationToSyncPoints_(syncTree,new Overwrite(newOperationSourceUser(),path,newData));}}", "title": "" }, { "docid": "5def9a4710e81afeaf07b1ad40f8c4e7", "score": "0.42705694", "text": "createFromCommit(optionsOrCommitID={}, context={}) {\n if (_.isObject(optionsOrCommitID)) {\n console.assert(optionsOrCommitID.commitID);\n console.warn('RB.ReviewRequest.createFromCommit was called ' +\n 'using callbacks. Callers should be updated to ' +\n 'use promises instead.');\n return RB.promiseToCallbacks(optionsOrCommitID, context, () =>\n this.createFromCommit(optionsOrCommitID.commitID));\n }\n\n console.assert(optionsOrCommitID);\n console.assert(this.isNew());\n\n this.set('commitID', optionsOrCommitID);\n\n return this.save({ createFromCommit: true });\n }", "title": "" }, { "docid": "91a32a51109feac5847507987108f803", "score": "0.42019603", "text": "function saveToServer() {\n $('.modal').modal('hide'); // close all opened popups\n var xmlProgram = Blockly.Xml.workspaceToDom(blocklyWorkspace);\n var xmlProgramText = Blockly.Xml.domToText(xmlProgram);\n var isNamedConfig = !GUISTATE_C.isConfigurationStandard() && !GUISTATE_C.isConfigurationAnonymous();\n var configName = isNamedConfig ? GUISTATE_C.getConfigurationName() : undefined;\n var xmlConfigText = GUISTATE_C.isConfigurationAnonymous() ? GUISTATE_C.getConfigurationXML() : undefined;\n PROGRAM.saveProgramToServer(GUISTATE_C.getProgramName(), GUISTATE_C.getProgramOwnerName(), xmlProgramText, configName, xmlConfigText, GUISTATE_C.getProgramTimestamp(), function (result) {\n if (result.rc === 'ok') {\n GUISTATE_C.setProgramTimestamp(result.lastChanged);\n GUISTATE_C.setProgramSaved(true);\n GUISTATE_C.setConfigurationSaved(true);\n LOG.info('save program ' + GUISTATE_C.getProgramName());\n }\n MSG.displayInformation(result, 'MESSAGE_EDIT_SAVE_PROGRAM', result.message, GUISTATE_C.getProgramName());\n });\n }", "title": "" }, { "docid": "c444e745c9a7da7d84ebaee21876f3ff", "score": "0.41395575", "text": "function syncTreeApplyUserMerge(syncTree, path, changedChildren, writeId) {\r\n // Record pending merge.\r\n writeTreeAddMerge(syncTree.pendingWriteTree_, path, changedChildren, writeId);\r\n const changeTree = ImmutableTree.fromObject(changedChildren);\r\n return syncTreeApplyOperationToSyncPoints_(syncTree, new Merge(newOperationSourceUser(), path, changeTree));\r\n}", "title": "" }, { "docid": "fd6a2ec1f58afb8dfeba1e90284d7da4", "score": "0.41270593", "text": "function save(nodename, path, data) {\n\t//var endpoint = \"/\"+path+\"?name=\"+nodename;\n\tvar endpoint = \"/repo-editor?operation=save_wsc&path=\" + path + \"&name=\" + nodename;\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: endpoint,\n\t\tdata: JSON.stringify(data),\n\t\tcontentType: \"application/json; charset=utf-8\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tlog(JSON.stringify(data));\n\t\t},\n\t\tfailure: function(errMsg) {\n\t\t\talert(errMsg);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8daeea1742f5e0a3c27e0596067f5723", "score": "0.41143262", "text": "updateWorkout(id, payload, callback) {\n\t\t// This funciton does not push updates to DB, it just marks workouts that need to be pushed upon save.\n\t\tthis.workouts[id] = payload;\n\t\tthis.workouts[id].creationType = creationTypes.OWNER;\n\t\t// \"Modified\" workouts are workouts that have already been pushed to DB.\n\t\tif (!(this.modified.includes(id))) {\n\t\t\tthis.modified.push(id);\n\t\t}\n\t\tcallback(this.generateDisplayWorkouts());\n\t}", "title": "" }, { "docid": "5b625d5a4db0f99c9ccd0a6ff56b8b17", "score": "0.40944806", "text": "function writeGraph (graph, resource, root, serverUri) {\n debug('PATCH -- Writing patched file')\n return new Promise((resolve, reject) => {\n const resourceSym = graph.sym(resource.url)\n const serialized = $rdf.serialize(resourceSym, graph, resource.url, resource.contentType)\n\n // First check if we are above quota\n overQuota(root, serverUri).then((isOverQuota) => {\n if (isOverQuota) {\n return reject(error(413,\n 'User has exceeded their storage quota'))\n }\n\n fs.writeFile(resource.path, serialized, { encoding: 'utf8' }, function (err) {\n if (err) {\n return reject(error(500, `Failed to write file after patch: ${err}`))\n }\n debug('PATCH -- applied successfully')\n resolve('Patch applied successfully.\\n')\n })\n }).catch(() => reject(error(500, 'Error finding user quota')))\n })\n}", "title": "" }, { "docid": "5a75d95f61e50b164dc7fdfd66eee846", "score": "0.40828702", "text": "function doSaveProjectToServer_step (step) {\n if (step == \"start\") {\n statusbar.value = 0;\n statusbar.mode = \"undetermined\";\n statusbar.collapsed = false;\n statusmsg.value = gApp.getText(\"SavingStudioProgressMsg\");\n cancelbtn.collapsed = false;\n statusbox.collapsed = false;\n\n setTimeout(doSaveProjectToServer_step, 0, \"checkVersion\");\n }\n else if (step == \"checkVersion\") {\n if (! wsref) {\n setTimeout(doSaveProjectToServer_step, 0, \"getCommitMessage\");\n return;\n }\n\n var xhr = new XMLHttpRequest();\n var projuri = getCeltxService().workspaceURI + \"/project/\" + wsref;\n xhr.open(\"GET\", projuri, true);\n xhr.onerror = function () {\n gPendingSaveRequest = null;\n innercb.failed(xhr.status + \" \" + xhr.statusText);\n };\n xhr.onreadystatechange = function () {\n // There is no \"aborted\" signal for XMLHttpRequest, but you can tell\n // if it was cancelled because it transitions to readyState=4, then\n // silently transitions to readyState=0.\n if (xhr.readyState == 1) {\n gPendingSaveRequest = xhr;\n }\n else if (xhr.readyState == 4) {\n gPendingSaveRequest = null;\n setTimeout(function () {\n if (xhr.readyState == 0) innercb.cancelled();\n }, 0);\n }\n };\n xhr.onload = function () {\n if (xhr.status < 200 || xhr.status >= 300) {\n innercb.failed(xhr.statusText);\n return;\n }\n\n try {\n var projdata = JSON.parse(xhr.responseText);\n if (wsref != projdata.latest) {\n // Disabled for 1.1 release\n /*\n var ps = getPromptService();\n var confirmed = ps.confirm(window,\n gApp.getText(\"OverwriteWithOlderTitle\"),\n gApp.getText(\"OverwriteWithOlderMsg\"));\n if (! confirmed) {\n innercb.cancelled();\n return;\n }\n */\n wsref = projdata.latest;\n }\n doSaveProjectToServer_step(\"getCommitMessage\");\n }\n catch (ex) {\n innercb.failed(ex);\n }\n };\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.send(null);\n }\n else if (step == \"getCommitMessage\") {\n var rdfsvc = getRDFService();\n var msgarc = rdfsvc.GetResource(Cx.NS_CX + \"commitMessage\");\n\n var pref = getPrefService().getBranch(\"celtx.server.\");\n if (! pref.getBoolPref(\"promptForCommitMessage\")) {\n setTimeout(doSaveProjectToServer_step, 0, \"sendModel\");\n return;\n }\n\n var msg = { value: \"\" };\n var shouldprompt = { value: true };\n var ps = getPromptService();\n\n var confirmed = ps.prompt(window, gApp.getText(\"SaveCommentTitle\"),\n gApp.getText(\"SaveCommentPrompt\"), msg,\n gApp.getText(\"SaveCommentCheckbox\"), shouldprompt);\n if (! confirmed) {\n innercb.cancelled();\n return;\n }\n\n if (! shouldprompt.value)\n pref.setBoolPref(\"promptForCommitMessage\", false);\n\n setTimeout(doSaveProjectToServer_step, 0, \"sendModel\", msg.value);\n }\n else if (step == \"sendModel\") {\n var commitmsg = arguments.length > 1 ? arguments[1] : \"\";\n saveProjectToServer(wsref, commitmsg, innercb);\n }\n }", "title": "" }, { "docid": "3ebdea1554962f4e883832cb2aa28563", "score": "0.40796557", "text": "function writeDoc(wr_opts) {\n\t\t\tt.otcc.writeDoc(wr_opts, wr_opts.doc, (err, resp) => {\n\t\t\t\tif (err) {\n\t\t\t\t\terr.backend_context = 'problem updating user preferences in the PUT /api/v1/user/preferences route';\n\t\t\t\t\tlogger.error('[user] changing user preferences - failure', err);\n\t\t\t\t\treturn cb(err);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.info('[user] changing user preferences - success');\n\t\t\t\t\treturn cb(null, resp);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "27a60e1523cb78656aa96b6d074a7dbc", "score": "0.40787417", "text": "_onUpdateDiffClicked() {\n const reviewRequest = this.model.get('reviewRequest');\n const updateDiffView = new RB.UpdateDiffView({\n model: new RB.UploadDiffModel({\n changeNumber: reviewRequest.get('commitID'),\n repository: reviewRequest.get('repository'),\n reviewRequest: reviewRequest,\n }),\n });\n\n updateDiffView.render();\n\n return false;\n }", "title": "" }, { "docid": "1329416fc5f310ed600794e6af466a97", "score": "0.40745163", "text": "function checkpointRollTo(g_id, diff) {\n // grab history from cookie\n const history = getCheckpointHistory(g_id);\n\n const update_queue = [];\n const direction = Math.sign(diff);\n let pointer = history[0];\n\n // clamp to bounds\n if (pointer + diff < 1) {\n diff = 1 - pointer;\n }\n if (pointer + diff >= history.length) {\n diff = history.length - 1 - pointer;\n }\n\n // if redoing and pointer is on an old_score, move pointer to next new_score\n if (direction>0 && pointer%2) {\n pointer += 1;\n diff -= direction;\n update_queue.push(history[pointer]);\n }\n // if undoing and pointer is on an new_score, move pointer to next old_score\n else if (direction<0 && !(pointer%2)) {\n pointer -= 1;\n diff -= direction;\n update_queue.push(history[pointer]);\n }\n\n // incrementally move snapshot and set states to update, incrementing by old_scores if direction < 0, new_scores if dir > 0\n while (diff !== 0) {\n pointer += (2*direction);\n update_queue.push(history[pointer]);\n diff -= direction;\n }\n\n // update buttons\n $('#checkpoint-undo').prop('disabled', false);\n $('#checkpoint-redo').prop('disabled', false);\n if (pointer <= 1) {\n $('#checkpoint-undo').prop('disabled', true);\n }\n if (pointer >= history.length-1) {\n $('#checkpoint-redo').prop('disabled', true);\n }\n\n //write new cookie\n history[0] = pointer;\n setCheckpointHistory(g_id, history);\n\n // update cells for each snapshot\n update_queue.forEach((snapshot) => {\n // get elems from studentID\n const elems = $(`tr[data-user='${snapshot[0]}'] .cell-grade`);\n updateCheckpointCells(elems, snapshot[1], true);\n });\n}", "title": "" }, { "docid": "31ac9eb8aad3de61b6ca44d0459e831d", "score": "0.40699038", "text": "function addGameReview(userId, gameId, userReview, userRating, callback) {\n\n // Check your input is not null\n if (userId == undefined) {\n callback({\"success\": false, \"message\": \"userId was not supplied, but is required\"});\n return;\n }\n if (gameId == undefined) {\n callback({\"success\": false, \"message\": \"gameId was not supplied, but is required\"});\n return;\n }\n\n if (userReview == undefined) {\n callback({\"success\": false, \"message\": \"userReview was not supplied, but is required\"});\n return;\n }\n if (userRating == undefined) {\n callback({\"success\": false, \"message\": \"userRating was not supplied, but is required\"});\n return;\n }\n\n // Get and start SQL Connection\n db.connect(db.MODE_DEVELOPMENT);\n var query = \"INSERT INTO review(user_id, game_id, review_text, review_score)\" +\n \"VALUES (\" + userId + \", \" + gameId + \", \" + userReview + \", \" + userRating + \");\";\n db.get().query(query, function (err, rows) {\n if (err) {\n console.log(err);\n callback({\"success\": false, \"message\": \"something went wrong in the db.\"});\n return;\n }\n db.get().end();\n callback({\"success\": true});\n });\n// \n}", "title": "" }, { "docid": "dff9308d0f392d86d76dfafcbdf70d3c", "score": "0.40653253", "text": "function savePropertie(keyPath, newVal, noCallback){\n assign(refined, keyPath, newVal);\n //write the new data in the json file\n jsonfile.writeFileSync(__dirname+'/refined.json', refined, {spaces: 2});\n\n console.log(\"Value of \"+keyPath+\" is now \"+newVal);\n\n // noCallback = event sended by the client, no need to have a response\n if(!noCallback){\n ipc.emit(\"refinedInfos\", {refined : refined});\n }\n\n}", "title": "" }, { "docid": "38562a60b9c40c9654824088b76db4ed", "score": "0.4062159", "text": "handleSave(event) {\n event.preventDefault();\n var saved = this.props.itinerary;\n var payload = this.state;\n //payload.user = this.props.user.id;\n //console.log(payload.user);\n // If nothing has been saved to the store or store has not been sent to DB\n // console.log('payload in component-->', payload);\n // if ((saved === null) || (!(saved._id))) {\n // // Save state to store & send info to DB\n // this.props.saveItineraryDB(payload);\n // }\n // else {\n // this.props.saveItineraryDBById(payload);\n // }\n this.props.saveItineraryDB(payload)\n .then((result) => {\n this.props.history.push(`/event-editor/${result.data._id}`)\n alert('Your Itinerary was created! You can now start editing your schedule and adding events.')\n })\n .catch((err) => {\n console.log(err);\n })\n }", "title": "" }, { "docid": "94747fac1197a2c112a03c57a6ce492e", "score": "0.40335703", "text": "function saveChanges() {\n\t// build the GET string\n\tvar getString = '?id=' + loadedIssue.id + '&status=' + $('#status').text() + '&firstname=' + $('#callerName').val().split(' ')[0] + '&lastname=' + $('#callerName').val().split(' ')[1] + '&email=' + $('#callerEmail').val() + '&specialist=' + $('#assignedSpecialist').val() + '&type=' + $('#problemClassification').val() + '&problemtype=' + $('#problem-type').val() + '&summary=' + $('#problemSummary').val() + '&details=' + $('#problemDetail').val() + '&hwserial=' + $('#serialNumber').val() + '&osname=' + $('#operatingSystem').val() + '&swname=' + $('#softwareName').val() + '&swversion=' + $('#softwareVersion').val() + '&swlicense=' + $('#softwareLicense').val() + '&archived=' + archived;\n\t\n\t// update the ticket entry in the database via update.php\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", '/php/update.php' + getString, false);\n\txmlHttp.send(null);\n\tlocation.reload();\n}", "title": "" }, { "docid": "524e7adb5cc83ff6e4b767180bfa7efd", "score": "0.4032289", "text": "function saveTestingBot(uid, challengeID, languageID, sourceCode, botName, botDescription, callback) {\n var retval;\n var botToInsert = { uid: uid, challenge_id: challengeID, default_version: 1, name: botName, description: botDescription };\n \n // Column names: bot_id, uid, challenge_id, default_version, name, creation_date, description, public\n db.query('INSERT INTO user_bots SET ?', botToInsert, function (err, rows) {\n if (err) { // Error with the database\n retval = 'error';\n callback(retval); // Send the result\n } else {\n var botID = rows.insertId; // Get the bot_id of the newly inserted row \n var botVersionToInsert = { bot_id: botID, version: 1, language_id: languageID, comments: 'none', source_code: sourceCode };\n\n // Column names: bot_id, version, creation_date, language_id, comments, errors, warnings, error_messages, warning_messages, source_code\n db.query('INSERT INTO user_bots_versions SET ?', botVersionToInsert, function (err, rows) {\n if (err) { // Error with the database \n retval = 'error';\n } else {\n retval = botID.toString();\n }\n callback(retval); // Send the result\n });\n }\n });\n}", "title": "" }, { "docid": "820eb717121af19fc2835e5aab92f774", "score": "0.4016092", "text": "developWorkPackage(userRole, userContext, wpToDevelopId){\n\n // Client validation\n let result = WorkPackageValidationApi.validateDevelopWorkPackage(userRole, userContext.userId, wpToDevelopId);\n\n if(result !== Validation.VALID){\n\n // Business validation failed - show error on screen\n store.dispatch(updateUserMessage({messageType: MessageType.ERROR, messageText: result}));\n return {success: false, message: result};\n }\n\n // Set the current context\n this.setWorkPackage(userContext, wpToDevelopId);\n\n // Get new View...\n let view = ViewType.SELECT;\n if(userContext.designUpdateId === 'NONE') {\n view = ViewType.DEVELOP_BASE_WP;\n } else {\n view = ViewType.DEVELOP_UPDATE_WP;\n }\n\n store.dispatch(setCurrentView(view));\n\n return {success: true, message: ''};\n\n }", "title": "" }, { "docid": "fd02ae189e8a5748824877a517e13b1e", "score": "0.40151662", "text": "function menuSaveProfileAs() {\n // Open a file dialog\n let oldValue = activeProfilePath;\n activeProfilePath = dialog.showSaveDialog();\n if (typeof activeProfilePath === \"undefined\") {\n activeProfilePath = oldValue;\n return;\n }\n if (activeProfilePath === \"\") {\n activeProfilePath = oldValue;\n return;\n }\n\n return menuSaveFileCallback();\n // Save the profile to the path specified\n}", "title": "" }, { "docid": "97f6a3581ac16a9d1eeb08431597979b", "score": "0.40150625", "text": "static saveRestaurantReview(review) {\r\n dbPromise.then(db => {\r\n let tx = db.transaction('reviews', 'readwrite');\r\n tx.objectStore('reviews').put(review);\r\n return tx.complete;\r\n })\r\n // store a copy in the offline db to be synced by serviceworker \r\n dbPromise.then(db => {\r\n let tx = db.transaction('offlineUpdates', 'readwrite');\r\n tx.objectStore('offlineUpdates').put({\r\n createdAt: (new Date).getTime(),\r\n type: 'addReview',\r\n data: review\r\n })\r\n return tx.complete;\r\n }) \r\n }", "title": "" }, { "docid": "259c915b7ffe8578528b5ebd4f20fd9f", "score": "0.40033272", "text": "static saveReviewToLocalDb(review, dbPromise, callback) {\n if(dbPromise === null) return;\n\n return dbPromise.then(db => {\n const tx = db.transaction('reviews', 'readwrite');\n const reviewsStore = tx.objectStore('reviews');\n callback(null, null);\n\n return reviewsStore.put(review);\n })\n .catch(e => callback(e, `Save to local database failed.`));\n }", "title": "" }, { "docid": "89158360826f392f023494266d8fb2e9", "score": "0.40024894", "text": "submitNodeChange(uri, version, nodeId, bbox) {\n socket.emit('submitDiff', {\n uri: uri,\n version: version.toString(),\n diff: {\n nodeID: nodeId,\n bbox: bbox\n }\n });\n }", "title": "" }, { "docid": "e72d07ebaf481f0e2c45d5643608097d", "score": "0.39788246", "text": "function save(strEncNote, callbackDone) {\n\n xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n \t if (xmlhttp.readyState==4 && xmlhttp.status==200) {\n \tjsonObjResponse = JSON.parse(xmlhttp.responseText);\n \tif(jsonObjResponse.bSuccess) {\n callbackDone(jsonObjResponse.strId);\n \t} else {\n callbackDone(\"\");\n \t} \n \t }\n \t}\n\txmlhttp.open(\"POST\", m_serverPath + \"SaveSNote.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\txmlhttp.send(\"snoteHandle=\" + encodeURIComponent(m_strId) + \n\t\t\"&snote=\" + strEncNote);\n }", "title": "" }, { "docid": "356dae3d1d9e17a45f0e6b5b44b50a9e", "score": "0.39779153", "text": "async function handleSubmission() {\n const submission = await promisify(cb => DevContest.submissions(userAccount, cb))\n const hasSubmitted = await promisify(cb => DevContest.hasSubmitted(userAccount, cb))\n\n if(userAccount == submission[0]) {\n const proposal = await promisify(cb => DevContest.submissions(submission[0], cb))\n const name = web3.toUtf8(proposal['2'])\n const description = web3.toUtf8(proposal['3'])\n const url = web3.toUtf8(proposal['4'])\n $('#submit').html('EDIT PROPOSAL')\n $('#validationCustom01').attr('value', name)\n $('#validationCustom02').html(description)\n $('#validationCustom03').attr('value', url)\n }\n /* Submitting a proposal */\n $('#buttonRegister').click(() => {\n if(!hasSubmitted && $('#validationCustom01').val().length != 0 && $('#validationCustom01').val().length <= 32\n && $('#validationCustom02').val().length >= 32 && $('#validationCustom02').val().length <= 256\n && $('#validationCustom03').val().length != 0 && $('#validationCustom03').val().length <= 32) {\n registerSubmission()\n } else if($('#validationCustom01').val().length != 0 && $('#validationCustom01').val().length < 32\n && $('#validationCustom02').val().length >= 32 && $('#validationCustom02').val().length <= 256\n && $('#validationCustom03').val().length != 0 && $('#validationCustom03').val().length <= 32) {\n editSubmission()\n }\n })\n}", "title": "" }, { "docid": "da96b3808e49d71c2879cf4138bfe369", "score": "0.39640647", "text": "function storeAfterSketchDiagram(json){\n\tgetOuterDivHeight();\n\tsessionStorage.setItem(\"as2View\",\"H\");\n\tsessionStorage.setItem(\"pageSequence\", 5);\n\tvar timeSpent = getTotalTimeSpent();\n\tvar outerDivHeight = document.getElementById('pageWrapCopy').style.height;\n\tvar outerDivWidth = document.getElementById('pageWrapCopy').style.width;\t\n\tvar element = document.getElementById(\"outderDiv\");\n\tcloseAllCrossForBlockDiv();\n\thtml2canvas(element, {\n\t\tonrendered: function(canvas) {\n var snapShotURL = canvas.toDataURL(\"image/png\"); //get's image string\n openAllCrossForBlockDiv();\n \n var isEdit = \"N\";\n if (sessionStorage.getItem(\"bsEdit\")) {\n \tisEdit = \"Y\";\n }\n \n var afterSketchModel = Spine.Model.sub();\n afterSketchModel.configure(\"/user/saveAfterSketchDiagram\", \"createdBy\", \"jsonString\", \"jobReferenceString\", \n \t\t\"snapShot\", \"jobTitle\", \"roleJson\", \"divHeight\", \"divWidth\", \"totalCount\", \"divInitialVal\", \n \t\t\"timeSpents\", \"isCompleteds\" , \"profileId\", \"positionJson\", \"isEdits\", \"linkClicked\", \n \t\t\"rowId\", \"initialSave\", \"isPrevious\", \"jctUserId\", \"elementOutsideRoleJson\");\n afterSketchModel.extend( Spine.Model.Ajax );\n var isCompleted = \"N\";\n if(sessionStorage.getItem(\"isLogout\") == \"Y\"){\n \tisCompleted = \"Y\";\n }\n //Populate the model with data to transfer\n \tvar modelPopulator = new afterSketchModel({ \n \t\tcreatedBy: sessionStorage.getItem(\"jctEmail\"), \n \t\tjsonString: json,\n \t\tjobReferenceString: sessionStorage.getItem(\"jobReferenceNo\"),\n \t\tsnapShot: snapShotURL,\n \t\tjobTitle: sessionStorage.getItem(\"jobTitle\"),\n \t\troleJson: jQuery.parseJSON(sessionStorage.getItem(\"define_role\").replace(/\\?/g, \";_;\")),\n \t\tdivHeight: outerDivHeight,\n \t\tdivWidth: outerDivWidth,\n \t\ttotalCount: sessionStorage.getItem(\"total_count\"),\n \t\tdivInitialVal: JSON.parse(sessionStorage.getItem(\"div_intial_value\")),\n \t\ttimeSpents : timeSpent,\n \t\tisCompleteds: isCompleted,\n \t\tprofileId: sessionStorage.getItem(\"profileId\"),\n \t\tpositionJson: sessionStorage.getItem(\"position_json\"),\n \t\tisEdits: isEdit,\n \t\tlinkClicked: sessionStorage.getItem(\"linkClicked\"),\n \t\trowId: sessionStorage.getItem(\"rowIdentity\"),\n \t\tinitialSave: \"N\",\n \t\tisPrevious: \"N\",\n \t\tjctUserId: sessionStorage.getItem(\"jctUserId\"),\n \t\telementOutsideRoleJson: jQuery.parseJSON(sessionStorage.getItem(\"element_outside_role\").replace(/\\?/g, \";_;\"))\n \t});\n \tmodelPopulator.save(); //POST\n \tafterSketchModel.bind(\"ajaxError\", function(record, xhr, settings, error) {\n \t\t$(\".loader_bg\").fadeOut();\n \t $(\".loader\").hide();\n \t});\n \t\n \tafterSketchModel.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\n \t\tvar jsonStr = JSON.stringify(xhr);\n \t\t\tvar obj = jQuery.parseJSON(jsonStr);\n \t\t\tif(sessionStorage.getItem(\"isLogout\") == \"N\"){\n \t\t\t\t\tremovePresentSessionItems();\n \t\t\t\tif (isEdit == \"Y\") {\n \t\t\t\t\tsessionStorage.setItem(\"pageSequence\", 8);\n \t\t\t\t\twindow.location = \"finalPage.jsp\";\n \t\t\t\t} else {\n \t \t\t\t\tsessionStorage.setItem(\"snapShotURLS\", obj.snapShot);\n \t \t\t\t\tsessionStorage.setItem(\"isCompleted\", 1);\n \t \t\t\t\twindow.location = \"actionPlan.jsp\";\n \t\t\t\t}\n \t\t\t} else { //It is logout\n \t\t\t\t//Create a model\n \t\t\t\tvar LogoutVO = Spine.Model.sub();\n \t\t\t\tLogoutVO.configure(\"/user/auth/logout\", \"jobReferenceString\", \"rowId\", \"lastActivePage\");\n \t\t\t\tLogoutVO.extend( Spine.Model.Ajax );\n \t\t\t\t//Populate the model with data to transder\n \t\t\t\tvar logoutModel = new LogoutVO({ \n \t\t\t\t\tjobReferenceString: sessionStorage.getItem(\"jobReferenceNo\"),\n \t\t\t\t\trowId: sessionStorage.getItem(\"rowIdentity\"),\n \t\t\t\t\tlastActivePage: \"/user/view/afterSketch2.jsp\"\n \t\t\t\t});\n \t\t\t\tlogoutModel.save(); //POST\n \t\t\t\tLogoutVO.bind(\"ajaxError\", function(record, xhr, settings, error) {\n \t\t\t\t\t$(\".loader_bg\").fadeOut();\n \t\t\t\t $(\".loader\").hide();\n \t\t\t\t\talertify.alert(\"Unable to connect to the server.\");\n \t\t\t\t});\n \t\t\t\t\n \t\t\t\tLogoutVO.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\n \t\t\t\t\tsessionStorage.clear();\n \t\t\t\t\twindow.location = \"../signup-page.jsp\";\n \t\t\t\t});\n \t\t\t} \t\t\t\n \t});\n }\n });\n}", "title": "" }, { "docid": "64517705a158320ad2f4ab28b6216fa3", "score": "0.396339", "text": "function editDisplayViaPopup(data) {\n\n //token == password\n var password = prompt(\"EDIT PASSWORD - If you want a new password, simply enter the new password. If you don't want to change anything, leave it empty.\");\n\n if (password != null) {\t// if Cancel Button isn't clicked\n\n var location = prompt(\"EDIT LOCATION - If you want to change the location: '\" + data.location + \"' simply enter the new location. If you don't want to change anything, leave it empty.\");\n\n if (location != null) {\t// if Cancel Button isn't clicked\n\n var xCoordinate = prompt(\"EDIT X-COORDINATE - If you want to change the x-coordinate: '\" + data.coordinateX + \"' simply enter the new x-coordinate. If you don't want to change anything, leave it empty.\");\n\n if (xCoordinate != null) {\t// if Cancel Button isn't clicked\n\n var yCoordinate = prompt(\"EDIT Y-COORDINATE - If you want to change the y-coordinate: '\" + data.coordinateY + \"' simply enter the new y-coordinate. If you don't want to change anything, leave it empty.\");\n\n if (yCoordinate != null) {\t// if Cancel Button isn't clicked\n\n //nothing has been changed\n if (password == \"\" && location == \"\" && xCoordinate == \"\" && yCoordinate == \"\") {\n alert(\"You didn't change anything.\");\n }\n //something has been changed\n else {\n var newIdentification = data.identification, newPassword = data.token, newLocation = data.location, newX = data.coordinateX, newY = data.coordinateY;\n\n if (password != \"\") {\n newPassword = password;\n }\n if (location != \"\") {\n newLocation = location;\n }\n if (xCoordinate != \"\") {\n newX = xCoordinate;\n }\n if (yCoordinate != \"\") {\n newY = yCoordinate;\n }\n\n var updateDisplay = new PublicDisplay(newIdentification, newPassword, newLocation, newX, newY);\n alert(\"DISPLAY: Id - \" + newIdentification + \", pas - \" + newPassword + \", loc - \" + newLocation + \", X - \" + newX + \", Y - \" + newY);\n doTask(\"DISPLAY_UPDATE\", updateDisplay, function (event) {\n alert(\"The display (name: \" + data.identification + \") has been modified.\");\n window.location.reload();\n });\n }\n }\n }\n\n }\n }\n\n\n}", "title": "" }, { "docid": "925533d78fa2621274f8c5e600383b13", "score": "0.3949283", "text": "function updateConvoInterpreter(interpreterUserId, ConvoId, callback) {\n\tconsole.log(\"Invoked: updateConvoInterpreter\");\n\n\t//Check your input is not null\n\tif(interpreterUserId == undefined) {\n\t\tcallback({ \"success\": false, \"message\": \"interpreterUserId was not supplied, but is required\" });\n\t\treturn;\n\t}\n\tif(ConvoId == undefined) {\n\t\tcallback({ \"success\": false, \"message\": \"ConvoId was not supplied, but is required\" });\n\t\treturn;\n\t}\n\n\t//Get and start SQL Connection\n\tdb.connect(db.MODE_DEVELOPMENT);\n\n\t//Check your input is valid with the DB\n\tdb.get().query('SELECT COUNT(*) AS isGood FROM user WHERE user_id = ? AND is_interpreter = 1', interpreterUserId, function(err, rows){\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t\tcallback({ \"success\": false, \"message\": \"something went wrong in the db.\" });\n\t\t\treturn;\n\t\t}\n\t\t//Check interpreterUserId user id is valid\n\t\tif(rows[0].isGood == 0) {\n\t\t\tcallback({ \"success\": false, \"message\": \"Given interpreterUserId cannot be found or is not a interpreter user.\" });\n\t\t\treturn;\n\t\t} else {\n\t\t\tdb.get().query('SELECT COUNT(*) AS isGood FROM convo WHERE convo_id = ? AND interpreter_user_id = ?', [ConvoId, interpreterUserId] , function(err,rows){\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tcallback({ \"success\": false, \"message\": \"something went wrong in the db.\" });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//Check interpreter user id is valid\n\t\t\t\tif(rows[0].isGood == 0) {\n\t\t\t\t\tcallback({ \"success\": false, \"message\": \"Given ConvoId cannot be found or did not belong to the given interpreter user.\" });\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tdb.get().query('UPDATE convo SET last_updated_hoh = NOW() WHERE convo_id = ?', ConvoId, function(err, res){\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\tcallback({ \"success\": false, \"message\": \"something went wrong in the db.\" });\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.get().end();\n\t\t\t\t\t\tcallback({ \"success\": true, \"convo_id\": ConvoId });\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t});\n\tconsole.log(\"Finished: updateConvoInterpreter\");\n}", "title": "" }, { "docid": "138dbb4d3538ecbed8dfbf8c2d5925dd", "score": "0.39451197", "text": "function saveChanges(op){alert('DEAD')}", "title": "" }, { "docid": "77e58de59fbf7352df9ef01f59ccb9c5", "score": "0.39339423", "text": "function synchronous_saveBugField(bugId, fieldName, newValue, comment) {\n var json_params = \"\";\n if(comment && comment != \"\") {\n json_params = '{ \"method\": \"Bug.update\", \"params\": {\"ids\" : [ {\"' + bugId + '\": { \"' + fieldName + '\": \"' + newValue + '\", \"comment\": \"' + comment + '\"} } ] }, \"id\" : 0 }';\n }\n else {\n json_params = '{ \"method\": \"Bug.update\", \"params\": {\"ids\" : [ {\"' + bugId + '\": { \"' + fieldName + '\": \"' + newValue + '\"} } ] }, \"id\" : 0 }'; \n }\n $.ajax({\n async: false,\n url: 'page.cgi?id=EnhancedTreeView_ajax.html',\n data: {\n schema: 'bug',\n action: 'update',\n data: json_params\n },\n success: saveResponse\n });\n }", "title": "" }, { "docid": "46b1877b6ed087f5e61246254798fb07", "score": "0.3928536", "text": "function handleCommit() {\n // Create an order to send to database\n const order = {\n student_id: props.finalID,\n student_name: props.finalName,\n order_details: cookies.get('order_details')\n }\n\n console.log(order);\n // Fire an alert to confirm the commit\n Swal.fire({\n icon: 'warning',\n title: \"Are you sure you want to update the database?\",\n showDenyButton: true,\n showCloseButton: true,\n confirmButtonText: \"Yes\",\n denyButtonText: \"No\",\n }).then((res) => {\n // If the user clicked Confirm\n if (res.isConfirmed) {\n // Update to the database\n update(order, (response, status) => {\n // If the query failed, pop up an alert to let user know\n if (status === \"fail\") {\n Swal.fire({\n icon: \"error\",\n title: \"Something went wrong\",\n text: \"Please check your order again.\",\n showConfirmButton: false\n })\n // else remove the cookies\n } else if (status === \"success\") {\n // Remove the cookies after finish commiting\n cookies.remove('order_details');\n cookies.remove('prevID');\n cookies.remove('prevName');\n\n // Pop up to let the user know the action is completed\n Swal.fire({\n icon: 'success',\n title: \"Database updated.\",\n text: \"What would you want to do next?\",\n showCloseButton: true,\n showDenyButton: true,\n confirmButtonText: `Return to homepage`,\n denyButtonText: `Sign Out`,\n }).then((result) => {\n window.location = \"/\";\n /* Read more about isConfirmed, isDenied below */\n if (result.isConfirmed) {\n Swal.fire({\n icon: 'info',\n title: 'Redirecting to homepage...',\n showConfirmButton: false,\n timer: 1500\n })\n } else if (result.isDenied) {\n cookies.remove('currentID');\n Swal.fire('Signed Out', '', 'info');\n }\n })\n }\n })\n }\n })\n\n }", "title": "" }, { "docid": "db41c24bea155c43b668741500a394d5", "score": "0.39209333", "text": "function upsert(db, docId, diffFun) {\n return new Promise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "db41c24bea155c43b668741500a394d5", "score": "0.39209333", "text": "function upsert(db, docId, diffFun) {\n return new Promise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "db41c24bea155c43b668741500a394d5", "score": "0.39209333", "text": "function upsert(db, docId, diffFun) {\n return new Promise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "db41c24bea155c43b668741500a394d5", "score": "0.39209333", "text": "function upsert(db, docId, diffFun) {\n return new Promise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "13e1082b24d995915bba224503abca7c", "score": "0.39132756", "text": "function savePolicy(policy_uid, data, callback, err_call) {\n requestService.updateData([prefix, policy_uid], data, callback, err_call);\n }", "title": "" }, { "docid": "c0c0576efdbda0b668fc295a191637d0", "score": "0.39088747", "text": "function patchState(id, diff) {\n return function ( dispatch, getState ) {\n return new Promise(resolve => {\n return resolve(dispatch({ type: actions.PatchEditorState, id, diff }));\n })\n .then(_ => getState().editorHistories[id].present);\n }\n}", "title": "" }, { "docid": "39c1654da97b645692119a04c40a2dd7", "score": "0.39086524", "text": "save(outputPath, callback) {\n this.write(fs.writeFile, outputPath, (err) => {\n if (err != null) {\n callback(err);\n return;\n }\n if (this.hasDraft) {\n fs.writeFile(path.join(outputPath, \"draft.txt\"), this.pub.draft, { encoding: \"utf8\" }, callback);\n }\n else {\n // delete the draft.txt file if there is no draft to save and the file exists\n fs.unlink(path.join(outputPath, \"draft.txt\"), (err) => {\n if (err != null && err.code !== \"ENOENT\") {\n callback(err);\n return;\n }\n callback(null);\n });\n }\n });\n }", "title": "" }, { "docid": "a102f1b85b0fea8f08eb8f7151ff54b8", "score": "0.39051518", "text": "function saveZipcode(zipcodeToAdd, userId, res) {\n zipcodeToAdd.save((error, savedZipcode) => {\n if (error) {\n console.log('error on post zipcode', error);\n res.sendStatus(500);\n } else {\n associateToUser(savedZipcode, userId, res);\n }\n });\n}", "title": "" }, { "docid": "18810775cef1f1fe4c20da94b9dbf216", "score": "0.39028957", "text": "async function editGoalHandler(event) {\n event.preventDefault();\n\n // Edit Goal Object\n const editGoal = {\n title: $('#goal-title-edit').val(),\n description: $('#goal-description-edit').val(),\n due_date: $('#due-date-edit').val(),\n is_public: getEditIsPublic(),\n user_id: $(\"#edit-goal-form\").attr(\"user-id\"),\n completed: false\n }\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n // Verifies that the goal was edited, if not throws error\n if (objDiff(ogGoal, editGoal).length > 0) {\n if (editGoal.title || editGoal.description || editGoal.due_date || editGoal.user_id || editGoal.completed) {\n const response = await fetch(`/api/goals/${id}`, {\n method: 'PUT',\n body: JSON.stringify(editGoal),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n\n if (response.ok) {\n // Create System Note for Edits made\n const editedKeys = objDiff(ogGoal, editGoal);\n const updateNote = updateNotes(editedKeys, editGoal)\n const noteObj = {\n text: updateNote,\n goal_id: $(\"#goal-title\").attr(\"data-goal-id\")\n }\n createNoteHandler(noteObj)\n location.reload();\n } else {\n alert(response.statusText);\n }\n }\n } else {\n $(\"#req-update\").remove()\n $(\"#edit-modal-header\").append(\n `<div class=\"alert alert-danger\" id=\"req-update\" role=\"alert\">\n At least one field needs to be changed in order to update the goal.\n </div>`\n )\n }\n}", "title": "" }, { "docid": "1ce6cc639b65f76942afe241f0e01998", "score": "0.38976848", "text": "publish(action,storageRelativePath,url,desc) {\n console.log(storageRelativePath,desc);\n\n const saveAction = (commentId) => SaveActions.execSave(\n this.state.editorState,\n action,\n storageRelativePath,\n this.state.author,\n commentId,\n this.state.doc,\n desc,\n url\n );\n\n const doSave = (id) => saveAction(id).then(()=>{\n WrioActions.busy(false);\n this.setState({\n error: false\n });\n }).catch((err)=> {\n WrioActions.busy(false);\n this.setState({\n error: true\n });\n console.log(err);\n });\n\n let commentID = this.state.commentID;\n\n if (this.state.commentID) { // don't request comment id, if it already stored in the document\n if (!WrioStore.areCommentsEnabled()) {\n commentID = ''; // delete comment id if comments not enabled\n }\n doSave(commentID);\n } else {\n WrioActions.busy(true);\n WrioStore.requestCommentId(url,(err,id) => {\n doSave(id);\n });\n }\n }", "title": "" }, { "docid": "b84618c48f24f3188dd3229033c72004", "score": "0.389204", "text": "function saveNewCourse(user_instance_node_id,other_user_name,user_count) {\n \t$(\"#add-text\").blur();\n \tvar node_type = $('.new_untitled_wrap').find('.dropMenuCourse').text();\n \tif(node_type =='New') {\n \t\tvar course_value = $('.new_untitled_wrap .course-new-drop').find('.course_info').val();\n \t\tvar dialogue_instance_node_id = '';\n \t\tvar course_title = $('.new_untitled_wrap .course-new-drop').find('.course_info').val();\n \t\tvar dialogue_title \t= \t$('.new_untitled_wrap .ref_mini_input_box').find('.dialogue_info').val();\n \t} else {\n \t\tvar course_value = $('.new_untitled_wrap .existing_user_titlefield').find('.course_info').data('id');\n \t\tvar dialogue_instance_node_id = $('.new_untitled_wrap .new_add_wrap').find('.ref_add_title_id').text();\n \t\tvar course_title = $('.new_untitled_wrap .existing_user_titlefield').find('.course_info').val();\n \t\tMiniDialogueContextMenu();\n \t\tvar dialogue_title \t= \t$('.new_untitled_wrap .existing_user_titlefield').find('.dialogue_info').val();\n \t}\n \tvar dialog_data = {\n\t \tcourse_value: course_value,\n\t \tdialogue_title: dialogue_title,\n\t \tdialogue_instance_node_id: dialogue_instance_node_id,\n\t \tcourse_title:course_title,\n\t \tsave_type:node_type,\n\t \tcreator_instance_node_id:setUserID,\n\t \tuser_instance_node_id:user_instance_node_id,\n\t \tuser_name :setUsername,\n\t \tother_user_name: other_user_name\n \t};\n \tJSON.stringify(dialog_data);\n \tif(course_value!='' && course_value != undefined) {\n \t\t$('.save_course_detail').attr('disabled', 'disabled');\n \t\t$('.new_untitled_wrap .course-new-drop').find('.course_req').addClass('hide');\n \t\t$(\".new_untitled_wrap .course_info\").removeClass('required_border');\n \t\t$('.new_untitled_wrap').find('.course_req').addClass('hide');\n \t\t$('.mini-overlay-wrapper').removeClass('hide');\n \t\t$.ajax({\n \t\t\turl: domainUrlApi+'code.php',\n \t\t\ttype: 'post',\n \t\t\tdata: {'dialog_data':dialog_data,'action':'chat','type':'saveNewDialog'},\n \t\t\tsuccess: function(data) {\n\t \t\t\tif(data) {\n\t \t\t\t\t$('.new_untitled_wrap .course-new-drop').find('.course_info').val('');\n\t \t\t\t\t$('.new_untitled_wrap .existing-search').find('.course_info').data('');\n\t \t\t\t\t$('.new_untitled_wrap .existing-search').find('.course_info').val('');\n\t \t\t\t\t$('.new_untitled_wrap .ref_mini_input_box').find('.dialogue_info').val('');\n\t \t\t\t\t$('.new_untitled_wrap .existing_user_titlefield').find('.dialogue_info').val('')\n\t \t\t\t\t$('.ref_add_new_title_bar').replaceWith(data);\n\t \t\t\t\t$(\".ref_top_head_box\").hide();\n\t \t\t\t\t$('.new_user_list').remove();\n\t \t\t\t}\n \t\t\t},\n \t\t\tcomplete: function() {\n\t\t\t\t$(\"#add-text\").focus();\n\t\t\t\t$('.mini-overlay-wrapper').addClass('hide');\n\t\t\t\t$(\".right-bar-tab.ref_add_right_tab\").css(\"display\",\"none\");\n\t\t\t\t$(\".ref-min-center-dialogue .right-bar-tab.default-view-tab\").show();\n\t\t\t\tif($(\".right-bar-tab.default-view-tab\").css(\"display\",\"block\")) {\n\t\t\t\t\t$(\".expand-collapse-box\").click(function() {\n\t\t\t\t\t\t$(\".mini-type-textarea\").css(\"margin-top\",0+\"px\")\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tMiniDialogueContextMenu();\n\t\t\t\t$(\".ref-textarea-HT textarea\").height('');\n\t\t\t\tvar innerHt = $(\".mini-dialogue-flyout\").height();\n var rightTabHghtM = $(\".ref-min-center-dialogue .right-bar-tab:visible\").outerHeight();\n var totalHghtM = innerHt - rightTabHghtM;\n if($(\".expand-collapse-box\").hasClass(\"append-top\")) {\n $(\".mini-type-textarea\").css({\"height\": totalHghtM , \"border-top\":\"none\"});\n }\n\t\t\t\tvar user_instance_name = other_user_name;\n\t\t\t\tvar dialog_instance_node_id = $('.online_users.selected').attr(\"id\");\n\t\t\t\tvar user_node_id = user_instance_node_id;\n\t\t\t\tvar message = other_user_name;\n\t\t\t\tvar groupMessage = 1;\n\t\t\t\tvar action = 'addActor';\n\t\t\t\tvar user_node = user_node_id;\n\t\t\t\trunTimeNotification(dialog_instance_node_id,message,groupMessage,action,user_node);\n\t\t\t\t$('.new_view_wrapper').hide();\n\t\t\t\t$(\".mini-type-textarea .animate-div\").removeClass(\"manage-opacity\");\n\t\t\t\t$(\".tab-pane .ref-set-height\").removeClass('hide');\n\t\t\t}\n \t\t});\n \t} else {\n \t\t$('.new_untitled_wrap').find('.course_req').removeClass('hide');\n \t\t$(\".ref_add_right_tab .course_info\").addClass('required_border');\n \t}\n }", "title": "" }, { "docid": "7c977cc54805c903d68d30c067f8dcb8", "score": "0.38858834", "text": "function saveScreen() {\n\n if (departmentCode && courseID) {\n updateFirebase(departmentCode, courseID);\n } else {\n\n var submit = $(\"input[value='Submit to Database'][type='button']\"),\n dept = $(\"input[class='department']\"),\n courseNum = $(\"input[class='courseNum']\"),\n domain = $(\"input[class='domain']\");\n\n $(\".shade\").css({\n \"display\": \"block\"\n });\n $(\".saveScreen\").css({\n \"display\": \"block\"\n });\n\n submit.click(function () {\n\n var name = dept.val().split(\" \")[0].trim().toUpperCase(),\n num = courseNum.val().trim(),\n dom = domain.val().trim().toLowerCase();\n\n departmentCode = name;\n courseID = num;\n\n if (departmentCode && courseID && dom) {\n saveToFire(departmentCode, courseID, dom);\n $(\".shade\").css({\n \"display\": \"none\"\n });\n } else {\n $(\"#saveScreenError\").html('');\n $(\"#saveScreenError\").append('You must fill out each box in order to save.');\n }\n\n });\n\n var cancel = $(\"input[value='Cancel'][type='button']\");\n\n cancel.click(function (e) {\n var modalParent = e.currentTarget.parentElement;\n $(modalParent).css({\n \"display\": \"none\"\n });\n $(\".shade\").css({\n \"display\": \"none\"\n });\n });\n\n var warning = $(\"<p><strong>Warning: </strong>You don't have any banners uploaded. They will not be saved to the database.</p>\");\n\n if ($(\".header\").children().length < 1) {\n $(\".saveScreen\").append(warning);\n }\n\n // Disable undo/redo shortcut keys\n /*undoRedoEnabled is set in app.js*/\n undoRedoEnabled = false;\n }\n}", "title": "" }, { "docid": "408564a410403b913d71d4181a6c3505", "score": "0.38848013", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db\n .addLevelDBData(height, JSON.stringify(block).toString())\n .then((blockModified) => {\n resolve(blockModified);\n })\n .catch((err) => {\n console.log(err); reject(err)\n });\n });\n }", "title": "" }, { "docid": "97f68dbbb5760b6dfa0d5fdfff5bd022", "score": "0.3883922", "text": "function save(req, res){\n let name = req.user.name\n User.findOne({name: name})\n .then(person=>{\n let port = person.portfolio.id(req.params.id)\n port.set(req.body)\n person.save(()=>{\n res.redirect(`/users/${req.params.id}`)\n })\n })\n}", "title": "" }, { "docid": "811b6ad76d5416acff2cd8d0c8bb6d3c", "score": "0.38688865", "text": "static saveReview(review) {\n this.dbPromise.then(db => {\n return db\n .transaction(this.REVIEWS_STORE, \"readwrite\")\n .objectStore(this.REVIEWS_STORE)\n .put(review);\n });\n }", "title": "" }, { "docid": "811b6ad76d5416acff2cd8d0c8bb6d3c", "score": "0.38688865", "text": "static saveReview(review) {\n this.dbPromise.then(db => {\n return db\n .transaction(this.REVIEWS_STORE, \"readwrite\")\n .objectStore(this.REVIEWS_STORE)\n .put(review);\n });\n }", "title": "" }, { "docid": "ff22780a4d30734bfe9fe63d08ecc84e", "score": "0.38681018", "text": "function saveChiefComplaint() {\r\n\tvar complaint1 = $('#chief_complaint_1 option:selected').val();\r\n\tvar complaint1_other = $('#chief_complaint_1_other').val();\r\n\tvar complaint2 = $('#chief_complaint_2').val();\r\n\tvar diff_breathing = $('#cc_diff_breathing').data('status');\r\n\tvar chest_pain = $('#cc_chest_pain').data('status');\r\n\tvar nausea = $('#cc_nausea').data('status');\r\n\tvar vomiting = $('#cc_vomiting').data('status');\r\n\tvar diarrhea = $('#cc_diarrhea').data('status');\r\n\tvar dizziness = $('#cc_dizziness').data('status');\r\n\tvar headache = $('#cc_headache').data('status');\r\n\tvar loc = $('#cc_loc').data('status');\r\n\tvar numb_tingling = $('#cc_numb_tingling').data('status');\r\n\tvar weakness = $('#cc_gal_weakness').data('status');\r\n\tvar lethargy = $('#cc_lethargy').data('status');\r\n\tvar neck_pain = $('#cc_neck_pain').data('status');\r\n//\tvar time = $('#chief_complaint_time option:selected').val();\r\n\tdb.transaction(\r\n\t\tfunction(transaction) {\r\n\t\t\ttransaction.executeSql(\r\n\t\t\t\t'UPDATE chief_complaint SET assessed=?, primary_complaint=?, primary_other=?, secondary_complaint=?, diff_breathing=?, chest_pain=?, nausea=?, ' +\r\n\t\t\t\t' vomiting=?, diarrhea=?, dizziness=?, ' +\r\n\t\t\t\t' headache=?, loc=?, numb_tingling=?, gal_weakness=?, lethargy=?, neck_pain=?, time=? WHERE patient = ? ;',\r\n\t\t\t\t['true', complaint1, complaint1_other, complaint2, diff_breathing, chest_pain, nausea, vomiting, diarrhea, dizziness, headache, loc, numb_tingling, weakness, lethargy, neck_pain, getSystemTime(), getCurrentPatientId()], \r\n\t\t\t\tfunction(){\t\r\n\t\t\t\t\tjQT.goBack();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// on va a la page d'avant\r\n\t\t\t\t},\r\n\t\t\t\terrorHandler\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}", "title": "" }, { "docid": "40a1343e2967ba01d1461d2fc58c2925", "score": "0.38616127", "text": "function syncTreeAckUserWrite(syncTree,writeId,revert=false){const write=writeTreeGetWrite(syncTree.pendingWriteTree_,writeId);const needToReevaluate=writeTreeRemoveWrite(syncTree.pendingWriteTree_,writeId);if(!needToReevaluate){return[];}else{let affectedTree=new ImmutableTree(null);if(write.snap!=null){// overwrite\naffectedTree=affectedTree.set(newEmptyPath(),true);}else{each(write.children,pathString=>{affectedTree=affectedTree.set(new Path(pathString),true);});}return syncTreeApplyOperationToSyncPoints_(syncTree,new AckUserWrite(write.path,affectedTree,revert));}}", "title": "" }, { "docid": "393edd221d1f12f84955d4d6fe44b081", "score": "0.38597643", "text": "static storeNewReviewInDatabase(review) {\n\n dbPromise.then(db => {\n const tx = db.transaction(reviewStore, 'readwrite');\n tx.objectStore(reviewStore).put(review);\n })\n }", "title": "" }, { "docid": "db44954c860a5ea5f11fafc653c41fce", "score": "0.3858587", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block)).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "979cd1c12b18dd1349cf05c6a98a9f47", "score": "0.38538504", "text": "function saveProfileChanges() {\n if (editModeStatus) {\n document.querySelectorAll('.edited').forEach((el) => {\n switch (el.id) {\n case 'address':\n editedUserInfo[el.id] = {\n city: el.textContent.split(', ')[0],\n country: el.textContent.split(', ')[1],\n street: originalUserInfo.address.street,\n zipcode: originalUserInfo.address.zipcode,\n };\n break;\n\n default:\n editedUserInfo[el.id] = $(el).val() || $(el).html();\n break;\n }\n });\n\n // Send the data to the server\n fetch(`https://cv-mobile-api.herokuapp.com/api/users/${userID}`, {\n method: 'PUT',\n body: JSON.stringify(editedUserInfo),\n headers: { 'Content-Type': 'application/json; charset=utf-8' },\n }).then(res => res.json())\n .then((updatedUser) => {\n originalUserInfo = { ...updatedUser };\n sendNewPicture();\n closeEditMode();\n });\n }\n}", "title": "" }, { "docid": "a69c08c0a21f4a9c7ca25093d2a6bb55", "score": "0.3845945", "text": "function uploadRoomToRTDB(roomKey, roomName, roomDesc, themeURL) {\n // Get the currently logged in user.\n var currUser = firebase.auth().currentUser.uid;\n\n // Prepare data of room to send to room.html\n localStorage.setItem('roomName', roomName);\n localStorage.setItem('roomKey', roomKey);\n\n var updates = {};\n\n // Set roomName for roomId in 'users' database.\n updates['/users/' + currUser + '/rooms/' + roomKey] = roomName;\n\n // Set roomName for roomId in 'rooms' database.\n updates['/rooms/' + roomKey + '/name'] = roomName;\n\n // Set roomDesc for roomId in 'rooms' database if user had written a description.\n if (roomDesc == \"\") {\n updates['/rooms/' + roomKey + '/description'] = null;\n } else {\n updates['/rooms/' + roomKey + '/description'] = roomDesc;\n }\n\n // Set themeURL for roomId in 'rooms' database if user had uploaded a new theme.\n if (themeURL) updates['/rooms/' + roomKey + '/themeURL'] = themeURL;\n\n firebase.database().ref().update(updates).then(\n user => {\n // If edit mode is on, simply refresh the page to update the changes in the sessionStorage as well.\n if (editModeToggled) {\n document.location.reload(true);\n } else {\n window.location.href = \"room.html\";\n }\n });\n}", "title": "" }, { "docid": "f76e749de8945204b92668a25d8f0361", "score": "0.38426703", "text": "function mod_edit_graph ( kbURI ) {\n\n var message;\n localizedKB = kb;\n var newontoid = uuidv4();\n // localizedKBURI is either an edited draft graph (\"kb-...\") or a forked graph\n localizedKBURI = ((kbURI.substr(kbURI.lastIndexOf('/')+1).startsWith('kb-'))?kbURI:base+location.pathname.substring(1)+\"#/submitted/\"+\"kb-\"+newontoid);\n console.log( \"localized graph created: \"+localizedKBURI+\" (\"+localizedKB.length+\" triples)\" );\n if (localizedKBURI == kbURI) {\n\t// editing draft\n\tmessage = `<b>Success!</b> You are editing your model: &lt;`+localizedKBURI+`&gt;.<br/> <em>Remember:</em> You must <em>publish</em> your model to make it available to everybody!`;\n\tmod_display( localizedKB, message, \"success\" );\n } else {\n\t// forking published\n\tnew_model( 'fork' );\n }\n\n}", "title": "" }, { "docid": "316c5f73183e42caa2c96a86ce17d9c1", "score": "0.3841632", "text": "function editProject(id, title, description, fundgoal, category, user_location, callback) {\r\n\tvar category = parseInterests(category);\r\n\tvar location = parseLocations(user_location);\r\n\tProject.findOneAndUpdate({\r\n\t\t'_id': id\r\n\t},\r\n\t{\r\n\t\t$set: {\r\n\t\t\t'title': title,\r\n\t\t\t'description': description,\r\n\t\t\t'funds.goal': fundgoal,\r\n\t\t\t'category': category,\r\n\t\t\t'location': location\r\n\t\t}\r\n\t},\r\n\t{\r\n\t\tnew: true\r\n\t}, function(error, response) {\r\n\t\tif (error) {\r\n\t\t\tconsole.log(error);\r\n\t\t\tthrow error;\r\n\t\t} else {\r\n\t\t\tcallback(response);\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "11bcf13c1864122515c22d0323f30e73", "score": "0.3837467", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "75aae6c9f9ddbd7ae88fe12345d02ff5", "score": "0.38337845", "text": "function writeReview() {\n if (ratingSelected == 0) {\n alert(\"Please provide a rating score for this user.\");\n reloadProfile();\n return;\n }\n\n var review = document.getElementById(\"reviewWritten\").value;\n\n \n fetch(urlWriteReview, {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'content-type': 'application/json',\n 'Authorization': ('Bearer ' + JSON.parse(localStorage.token))\n },\n body: JSON.stringify({\n \"byUserID\": uID,\n \"UserID\": otheruserid,\n \"byUserName\": name,\n \"rating\": ratingSelected,\n \"review\": review\n })\n }).then(function (res) {\n console.log(\"Inside res function\");\n if (res.ok) {\n resetTokenProfile();\n res.json().then(function (data) {\n var json = data.response;\n if (json == null) {\n confirm(\"Unsuccessful: You have already posted a review for this user!\");\n reloadProfile();\n return;\n }\n else {\n confirm(\"Writing new review successful!\");\n\n reloadProfile();\n }\n }.bind(this));\n }\n else {\n alert(\"Error: Writing new review unsuccessful!\");\n if (res.status == '403') {\n window.location.href = \"./inactive.html\";\n }\n res.json().then(function (data) {\n console.log(data.message);\n }.bind(this));\n }\n }).catch(function (err) {\n alert(\"Error: No internet connection!\");\n console.log(err.message + \": No Internet Connection\");\n });\n}", "title": "" }, { "docid": "b11cf2416198238a8e8ee8e4264d5c62", "score": "0.38280675", "text": "function saveWorker() {\n // INPUT VALIDATION\n if (!validateWorkerInput()){\n $(\"#editWorkerModal .text-warning\").html(\"Only numbers are allowed\");\n return;\n }\n // PREPARE OBJECT FOR INSERT\n var dataWorker = {};\n if ($(\"#modal-table\").attr(\"data-planId\") != undefined) {\n dataWorker[\"id\"] = parseInt($(\"#modal-table\").attr(\"data-planId\"));\n }\n dataWorker[\"idWorker\"] = parseInt($(\"#modal-table\").attr(\"data-workerId\"));\n dataWorker[\"month\"] = parseInt($(\"#modal-table\").attr(\"data-month\"));\n dataWorker[\"year\"] = parseInt($(\"#modal-table\").attr(\"data-year\"));\n let month = dataWorker[\"month\"];\n let year = dataWorker[\"year\"];\n let workerId = dataWorker[\"idWorker\"];\n let mondays = getMondaysInMonth(month,year);\n for (let i = 1 ; i <= mondays.length; i++) {\n dataWorker[\"week\"+i] = {};\n dataWorker[\"week\"+i][\"available\"] = parseFloat($(\"#modal-table\" +\" [data-week='\"+i+\"'][data-type='available']\").text());\n dataWorker[\"week\"+i][\"vacation\"] = parseFloat($(\"#modal-table\" +\" [data-week='\"+i+\"'][data-type='vacation']\").text());\n dataWorker[\"week\"+i][\"assignedProjects\"] = []; \n $(\"#modal-table td[data-week='\"+i+\"'][data-type='projectAssignments']\").each(function(){ \n dataWorker[\"week\"+i][\"assignedProjects\"].push({projectID:$(this).attr(\"data-projectId\"),days: parseFloat($(this).text())}); \n });\n } \n db.plans.put(dataWorker).then(function(result){\n let parentTableId = $(\"#modal-table\").attr(\"data-parentTableId\");\n calcMonthParticipation(parentTableId,workerId, month, year).then(function (){\n let result = calcTotalMonthParticipation(month,parentTableId); \n $(parentTableId + \" th[data-type='teamUtilization'][data-month='\"+month+\"']\").text(result);\n });\n $(\"#editWorkerModal\").modal(\"hide\");\n $(\".modal-body table\").remove(); \n });\n \n}", "title": "" }, { "docid": "3fe121691c74e352968f5fa4a3e1fe56", "score": "0.38214317", "text": "function save(callback) {\n \n //Loop through fields and check for forced default fields\n checkDefaultValues();\n \n var id = $scope.data[$scope.action.options.key];\n uploadFiles($scope.data, function() {\n GeneralModelService.save($scope.model.name, id, $scope.data)\n .then(function(response) {\n// console.log(\"response = \" + JSON.stringify(response, null, ' '));\n// console.log(\"$scope.action.options.key = \" + $scope.action.options.key);\n// console.log(\"response[$scope.action.options.key] = \" + response[$scope.action.options.key]);\n if (callback) {\n callback();\n } else if ($scope.action.options && $scope.action.options.returnAfterEdit) {\n $window.history.back();\n } else {\n //reload data\n if (!$scope.section) {\n //No section identified, so likely not called from main navigation via config.json\n //Instead likely called from Modal Popup\n if (modalInstance) modalInstance.close();\n } else {\n $state.go(\"dashboard.model.action.edit\", { model: $scope.section.path, action: $scope.action.label, id:response[$scope.action.options.key] });\n }\n }\n if (modalInstance) modalInstance.close();\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 });\n }", "title": "" }, { "docid": "bda48d2777fa1ac16cd668037b498b2c", "score": "0.38163808", "text": "function newDept(){\n inquirer.\n prompt([\n {\n type:\"input\",\n message:\"Enter a name for the new department:\",\n name:\"dept\"\n },\n {\n type:\"input\",\n message:\"What are the anticipated overhead costs (in whole dollars)?\",\n name:\"costs\"\n }\n ]).then(function(itsNew){\n var insertQuery = \"INSERT INTO departments (department_name, over_head_costs) VALUES (?, ?);\"\n connection.query(insertQuery, [ itsNew.dept, itsNew.costs ], function(err, res) {\n if(err) throw err;\n\n var myNewDept = itsNew.dept.toUpperCase();\n console.log(oneLine);\n console.log(oneLine);\n console.log(\"You have successfully added a new department called \" + myNewDept + \" to your store.\");\n console.log(\"Here is the new record:\");\n \n });\n\n return itsNew.dept;\n\n // show that record was updated successfully by calling the viewDept function that just displays the record that was updated (in table format)\n }).then (function(dept){ \n viewDept(dept);\n });\n}", "title": "" }, { "docid": "fcd2bc84dafe4ca2fb7a0aaa90dc419b", "score": "0.38156575", "text": "function save() {\n\n programFormDialog.loading = true;\n\n $log.debug(\"Program Form Dialog saving to server\");\n\n programFormDialog.program.programAreas = programFormDialog.programAreas.filter(\n isProgramAreaSelected\n );\n\n if (!programFormDialog.otherProgramArea) {\n /* If \"Other\" not checked, don't save explanation field. */\n delete programFormDialog.program.otherProgramAreaExplanation;\n }\n\n return programFormDialog.program.$save().then(\n handleProgramSaveSuccess\n ).catch(\n handleProgramSaveError\n ).finally(\n function () {\n programFormDialog.loading = false;\n $log.debug(\"Program Form Dialog done saving to server\");\n }\n );\n }", "title": "" }, { "docid": "2698ec3de8b913472e873c7f8d986d66", "score": "0.38083577", "text": "function pushCommit(gitRepo, jsonid, res, callNumber){\n\t//make Directory\n\t\t//cd into it\n\n\t\tif(process.cwd().substring(process.cwd().length-13, process.cwd().length)!=='DMVHelperTest'){\n\t\t\tprocess.chdir('pushFolder/DMVHelperTest');\n\t\t}\n\n\t\t//write a file\n\t\tfs.readFile('src/main.lua', function read(err, data) {\n\t\t if (err) {\n\t\t throw err;\n\t\t }\n\t\t \n\t\t fs.writeFile(\"src/main.lua\", (\"\"+data).replace(/myJsonId = \\\"\\w*\\\"/g, \"myJsonId = \\\"\"+jsonid +\"\\\"\"), function(err) {\n\t\t\t if(err) {\n\t\t\t return console.log(err);\n\t\t\t }\n\t\t\t\tconsole.log(\"wrote\");\n\t\t\t\t//commit the file\n\t\t\t\t\n\t\t\t\trequire('simple-git')()\n\t\t\t\t.add('./*')\n\t\t\t\t.commit(\"first commit!\")\n\t\t\t\t.removeRemote('origin')\n\t\t \t .addRemote('origin', gitRepo, function(err, update){\n\t\t\t\t\t if(err){\n\t\t\t\t\t\t console.log(err);\n\t\t\t\t\t\t return;\n\t\t\t\t\t }\n\t\t\t\t\t require('child_process').exec('git push -f origin master');\n\t\t\t\t\t console.log(\"remote added!\");\n\t\t\t\t });\n\t\t\t\n\n\t\t\t\t\n\t\t\t\tres.send(callNumber);\n\t\t\t\t\n\t\t\t}); \n\t\t});\n}", "title": "" }, { "docid": "7b939d5248cf232462a1a70d72d9ec5d", "score": "0.38060135", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n this.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "b1a3b4f7d3eabbcdee06d24b5218aa8c", "score": "0.38056785", "text": "function upsert(db, docId, diffFun) {\n return new PouchPromise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "b1a3b4f7d3eabbcdee06d24b5218aa8c", "score": "0.38056785", "text": "function upsert(db, docId, diffFun) {\n return new PouchPromise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "b1a3b4f7d3eabbcdee06d24b5218aa8c", "score": "0.38056785", "text": "function upsert(db, docId, diffFun) {\n return new PouchPromise(function (fulfill, reject) {\n db.get(docId, function (err, doc) {\n if (err) {\n /* istanbul ignore next */\n if (err.status !== 404) {\n return reject(err);\n }\n doc = {};\n }\n\n // the user might change the _rev, so save it for posterity\n var docRev = doc._rev;\n var newDoc = diffFun(doc);\n\n if (!newDoc) {\n // if the diffFun returns falsy, we short-circuit as\n // an optimization\n return fulfill({updated: false, rev: docRev});\n }\n\n // users aren't allowed to modify these values,\n // so reset them here\n newDoc._id = docId;\n newDoc._rev = docRev;\n fulfill(tryAndPut(db, newDoc, diffFun));\n });\n });\n}", "title": "" }, { "docid": "c844c44e4a6ddedbb384c133b0d5547c", "score": "0.38025725", "text": "function SavePublishConnectionPrompt() {\n\n\n // dragItem is the reference to the Simulator\n let newDetails = new Map();\n // list of pairs: [index of message variable, index of simulator variable or -1 for default]\n $('#modalPublishDetailsSegment .dropdown').each(function () {\n //let j = parseInt($(this).dropdown('get value'))\n let j = $(this).dropdown('get value');\n\t\tnewDetails.set($(this).attr('varName'), { name: $(this).attr('varName'), value: j ? j : null })\n })\n\n\n let initial = $('input[name=radioPublishInitial]:checked').val()\n let timeDelta = parseInt($('input[name=textPublishDelta]').val())\n\t\n\t//console.log(\"SAVING PUBLISHED DETAIL: timeDelta should be = \" + timeDelta);\n\n let messageName = $('#modalPublishDetailsSegment .ui.blue.label').text()\n\n if (IsNull(editExistingObject)) {\n dragItem.publishedMessages.set(messageName, NewPublish(messageName, initial, parseInt(timeDelta), newDetails))\n } else {\n let pub = editExistingObject.publishedMessages.get(messageName)\n pub.details = newDetails;\n pub.initial = initial;\n pub.timeDelta = parseInt(timeDelta);\n\t\t//console.log(\"FINISHED SAVING PUBLISHED DETAIL: timeDelta = \" + pub.timeDelta);\n }\n ClosePublishConnectionPrompt();\n\tDrawAllArrowsOnCanvas();\n\t\n\tAddToUndoBuffer(\"Save details in publish connection for : \" + messageName);\n}", "title": "" }, { "docid": "fa68a585f17e69cfacda786c5598493e", "score": "0.3791315", "text": "function user_update_wallet(req, res) {\n\tlet msg = 'Failed to Update Wallet';\n\tlet walletData = req.swagger.params.wallet.value;\n\tlet walletId = req.swagger.params.id.value;\n\n\tlet user = new User(req.jwt.id);\n\tuser.validateWallet(walletId).then(() => {\n\t\tlet wallet = new Wallet(walletId);\n\t\twallet.update(walletData).then(() => {\n\t\t\twallet.get().then(wallet => {\n\t\t\t\tres.json(wallet);\n\t\t\t}).catch((err) => {\n\t\t\t\tif(!err) err = msg;\n\t\t\t\tError.response(res, err);\n\t\t\t});\n\t\t}).catch((err) => {\n\t\t\tif(!err) err = msg;\n\t\t\tError.response(res, err);\n\t\t});\n\t}).catch((err) => {\n\t\tif(!err) err = msg;\n\t\tError.response(res, 'Wallet Not Assigned to User', err);\n\t});\n}", "title": "" }, { "docid": "16dde1ab7f1f799e5cb6a6bb8649074b", "score": "0.37874904", "text": "update(values){validateWritablePath('OnDisconnect.update',this._path);validateFirebaseMergeDataArg('OnDisconnect.update',values,this._path,false);const deferred=new Deferred();repoOnDisconnectUpdate(this._repo,this._path,values,deferred.wrapCallback(()=>{}));return deferred.promise;}", "title": "" }, { "docid": "0dafb6dfc3887e47932128dc16ee2a99", "score": "0.3782679", "text": "saveFragment(fragment, payload, stats) {\n return new Promise((resolve) => {\n if(this.db === null) {\n resolve(true);\n return;\n }\n const transaction = this.db.transaction(this.plugin.options.storageFragmentsName, STORAGE_WRITE_MODE);\n const storage = transaction.objectStore(this.plugin.options.storageFragmentsName);\n const request = storage.add({\n ...fragment,\n payload,\n stats\n });\n\n request.onsuccess = function() {\n // console.group(\"cache-driver.js:17 - store - onsuccess\");\n // console.log(request);\n // console.groupEnd();\n };\n request.onerror = function() {\n // console.group(\"cache-driver.js:17 - store - onerror\");\n // console.warn(request);\n // console.groupEnd();\n };\n resolve(true);\n });\n }", "title": "" }, { "docid": "4826cc443fc09bdcdb7c71de991bcb4e", "score": "0.378192", "text": "function saveInvasiveAirway() {\r\n\tvar secured = $('#airway_secured').prop('checked');\r\n\tvar device = $('#airway_device option:selected').val();\r\n\tvar distance = $('#airway_distance').val();\r\n\tvar size = $('#airway_size').val();\r\n\tvar cuffed = $('#airway_cuffed').prop('checked');\r\n\tvar inflation = $('#airway_cuff_inflation').val();\r\n\tvar bvm = $('#airway_bvm').prop('checked');\r\n\tvar attempts = $('#airway_attempts').val();\r\n\tvar time = $('#invasive_airway_time').val();\r\n\tvar timeToUse = Date.parse(time);\r\n\t\r\n\tdb.transaction(\r\n\t\tfunction(transaction) {\r\n\t\t\ttransaction.executeSql(\r\n\t\t\t\t'UPDATE invasive_airway SET assessed=?, secured=?, device=?, distance=?, size=?, cuffed=?, inflation=?, bvm=?, attempts=?, time=? WHERE patient=?;',\r\n\t\t\t\t['true', secured, device, distance, size, cuffed, inflation, bvm, attempts, timeToUse, getCurrentPatientId()], \r\n\t\t\t\tfunction(){\t\r\n\t\t\t\t\tjQT.goBack();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t},\r\n\t\t\t\terrorHandler\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}", "title": "" }, { "docid": "3d15f2955242a49f4baf1bbe768b6d83", "score": "0.37803116", "text": "function saveLayout() {\n var bool = validateAll()\n if (bool == true) {\n console.log('All data valid.');\n }\n else {\n console.log('Some data are invalid.');\n return;\n }\n var generatedXML = generateXML();\n /*POST generatedXML here via AJAX and notify user in appropriate way.\n Remember, you need to use the Layout_Name entered by the user as an identifying key to save the generatedXML to the DB\n because we will be using that to build the URL when a user is editing a layout.*/\n\n /* The next three lines displays the generatedXML on a new tab. This is only for testing purposes.*/\n var prettyprint = String(generatedXML).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n var w = window.open();\n $(w.document.body).html(\"<p>\" + prettyprint + \"</p\");\n\n}", "title": "" }, { "docid": "479bceea8a663f375026e9151122a6ee", "score": "0.37791136", "text": "function signPlayer(){\n var playerContract = $('#playerContractInput').val();\n var playerLength = $('#playerLengthInput option:selected').index()+1;\n console.log(\"upon sign player, playerContractInput value: \"+ playerContract+\" and length: \"+playerLength);\n if(typeof playerName == 'undefined'){window.location.assign(\"freeagent.html\");}\n var qVerify = confirm(playerName+\" will be signed to your team? Please note that your team will be responsible for the cost of this players contract.\");\n if(qVerify == true){\n console.log(\"player signed to your team.\");\n if(typeof leagueArrayComplete == 'object'){\n userLeagueName = leagueArrayComplete.key();\n if(storageType ==\"local\"){ userTeamName = localStorage.localUserTeam; console.log(\"user team from local\");}\n if(typeof userTeamName != 'string'){userTeamName = (userArrayComplete.child(\"team\").val()); console.log(\"used userArrayComplete.child\");}\n var currentTeam, playerPresent;\n leagueArrayComplete.child(userTeamName).forEach(function(nameSnap){\n if (playerName == nameSnap.key()) {\n playerPresent=true;\n console.log(\"player found on your roster\");\n currentTeam = userTeamName;\n }\n });\n if(!playerPresent){\n currentTeam=\"team16\";\n console.log(\"player not present on user team. Changed to free agents.\");\n }\n var tempPlayer = leagueArrayComplete.child(currentTeam).child(playerName).val();\n playerContract =parseFloat(playerContract);\n userTeamSalary = parseFloat(userTeamSalary);\n if((playerContract+userTeamSalary)<= 300){\n console.log(\"the contract plus team salary: \"+(playerContract+userTeamSalary));\n var withComp = function(error){\n if(error){\n alert(\"ERROR 1551: Player was not added to server due to disconnect. try again.\");\n }\n else{\n fireRef.child(\"leagueArray\").child(userLeagueName).child(userTeamName).child(playerName).update({contract:playerContract, contractLength:playerLength});\n console.log(\"Data successfully\");\n window.location.assign(\"fbs3.html\");\n }\n };\n fireRef.child(\"leagueArray\").child(userLeagueName).child(userTeamName).child(playerName).set(tempPlayer,withComp);\n if(currentTeam == \"team16\"){\n fireRef.child(\"leagueArray\").child(userLeagueName).child(\"team16\").child(playerName).remove();\n }\n }else{alert(\"Your team does not have enough cap room to sign this player.\");}\n }\n else{alert(\"ERROR 1535: league object not available.\");}\n }\n}", "title": "" }, { "docid": "12515b4ac337bc49d81d0d517ee9806f", "score": "0.37778473", "text": "function sync(geo, projection, cb) {\n var id = geo.id;\n var gd = geo.graphDiv;\n var layout = gd.layout;\n var userOpts = layout[id];\n var fullLayout = gd._fullLayout;\n var fullOpts = fullLayout[id];\n\n var preGUI = {};\n var eventData = {};\n\n function set(propStr, val) {\n preGUI[id + '.' + propStr] = Lib.nestedProperty(userOpts, propStr).get();\n Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, preGUI);\n\n var fullNp = Lib.nestedProperty(fullOpts, propStr);\n if(fullNp.get() !== val) {\n fullNp.set(val);\n Lib.nestedProperty(userOpts, propStr).set(val);\n eventData[id + '.' + propStr] = val;\n }\n }\n\n cb(set);\n set('projection.scale', projection.scale() / geo.fitScale);\n gd.emit('plotly_relayout', eventData);\n}", "title": "" }, { "docid": "61cf4a394b98ae51bdf24db4b38efc74", "score": "0.3768912", "text": "saveUserProfile(callback) {\n var url = '/db/users/user/' + this.props.params.user;\n var data = this.stagedProfileEdits;\n data.userInfo = _map(data.userInfo, function(val){return val});\n data.sites = _map(data.sites, function(val){return val});\n RestHandler.Post(url, data, (err, res) => {\n if (err) {return err;}\n callback(res);\n });\n }", "title": "" }, { "docid": "d0a12d9882d7df7ba805bb0bd4b35522", "score": "0.3767307", "text": "function saveChanges(onlyIfDirty, tiddlers) {\n if (onlyIfDirty && !store.isDirty())\n return;\n clearMessage();\n// Get the URL of the document\n var originalPath = document.location.toString();\n// Check we were loaded from a file URL\n if (originalPath.substr(0, 5) != \"file:\") {\n alert(config.messages.notFileUrlError);\n if (store.tiddlerExists(config.messages.saveInstructions))\n story.displayTiddler(null, config.messages.saveInstructions);\n return;\n }\n var localPath = getLocalPath(originalPath);\n// Load the original file\n var original = loadFile(localPath);\n if (original == null) {\n alert(config.messages.cantSaveError);\n if (store.tiddlerExists(config.messages.saveInstructions))\n story.displayTiddler(null, config.messages.saveInstructions);\n return;\n }\n// Locate the storeArea div's\n var posDiv = locateStoreArea(original);\n if (!posDiv) {\n alert(config.messages.invalidFileError.format([localPath]));\n return;\n }\n saveBackup(localPath, original);\n saveRss(localPath);\n saveEmpty(localPath, original, posDiv);\n saveMain(localPath, original, posDiv);\n}", "title": "" }, { "docid": "80481e1536e406b061113e478d4cd4da", "score": "0.3767278", "text": "static saveComment(comment, postId, callback) {\n comment.parentId = postId;\n if (!comment.id) {\n comment.id = uuidv4();\n comment.timestamp = Date.now();\n }\n\n let headers = ReadableApi.getHeaders();\n headers.append('Content-type', 'application/json');\n return (dispatch) =>\n fetch(\"http://localhost:3001/comments\", {\n headers: headers,\n method: 'POST',\n body: JSON.stringify(comment)\n })\n .then(resp => resp.json())\n .then(post => {\n dispatch(commentsActionCreators.comment.addOne(post));\n if (callback) {\n callback(post);\n }\n })\n .catch(err => toast.error(err.message))\n }", "title": "" }, { "docid": "c5f71a859649bec3896a0a266a9ca4cd", "score": "0.3763398", "text": "function editProgress(userId, projectId, progress) {\n return new Promise((resolve, reject) => {\n users.findUserById(userId)\n .then(user =>\n getProjectsOwned(user._id)\n .then((count) => {\n if (count > user.maxProjects()) {\n throw errors.notEnoughProjectsOnPlan();\n }\n return user;\n }))\n .then(user =>\n Project.findById(projectId)\n .then(project => ({ user, project })))\n .then(({ user, project }) => {\n if (!project) {\n throw errors.noProjectFound();\n }\n if (project.progressEnabled === false) {\n throw errors.progressDisabled();\n }\n let authorized = false;\n if (project.owner.equals(user._id)) {\n authorized = true;\n }\n project.managers.forEach((manager) => {\n if (manager.equals(user._id)) {\n authorized = true;\n }\n });\n if (!authorized) {\n throw errors.notAuthorized();\n }\n return { user, project };\n })\n .then(({ user, project }) => {\n progress = parseInt(progress, 10);\n if (progress >= 0 && progress <= 100) {\n project.progress = progress;\n } else {\n throw errors.progressValueError();\n }\n\n return project.save()\n .then(resolve);\n })\n .catch(reject);\n });\n}", "title": "" }, { "docid": "4b3f1ab243234eec43d6037691991888", "score": "0.3762748", "text": "_modifyBlock (height, block) {\n let self = this\n return new Promise((resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString())\n .then(blockModified => {\n resolve(blockModified)\n })\n .catch(err => {\n console.log(err)\n reject(err)\n })\n })\n }", "title": "" }, { "docid": "a9c02ce83facdb135721806563552add", "score": "0.37617666", "text": "function saveReview(publish) {\n $.funcQueue(\"reviewForm\").clear();\n\n $(\".body-top, .body-bottom\").inlineEditor(\"save\");\n\n $(\".comment-editable\", dlg).each(function() {\n var editable = $(this);\n var comment = editable.data('comment');\n var issue = editable.next()[0];\n var issueOpened = issue ? issue.checked : false;\n\n if (editable.inlineEditor(\"dirty\") ||\n issueOpened != comment.issue_opened) {\n comment.issue_opened = issueOpened;\n $.funcQueue(\"reviewForm\").add(function() {\n editable\n .one(\"saved\", $.funcQueue(\"reviewForm\").next)\n .inlineEditor(\"save\");\n });\n }\n });\n\n $.funcQueue(\"reviewForm\").add(function() {\n review.set({\n shipIt: $(\"#id_shipit\", dlg)[0].checked,\n bodyTop: $(\".body-top\", dlg).text(),\n bodyBottom: $(\".body-bottom\", dlg).text(),\n public: publish\n });\n\n reviewRequestEditor.decr('editCount');\n\n review.save({\n buttons: buttons,\n success: $.funcQueue(\"reviewForm\").next,\n error: function() {\n console.log(arguments);\n }\n });\n });\n\n $.funcQueue(\"reviewForm\").add(function() {\n var reviewBanner = RB.DraftReviewBannerView.instance;\n\n dlg.modalBox(\"destroy\");\n\n if (publish) {\n reviewBanner.hideAndReload();\n } else {\n reviewBanner.show();\n }\n });\n\n $.funcQueue(\"reviewForm\").start();\n }", "title": "" }, { "docid": "ba57c5ff7f810dc80d7272f1f48f574a", "score": "0.37609956", "text": "function onSaveActivity(){\n\t// build an object of review data to submit\n\tvar activity = { \n\t\tactivity_id: jQuery(\"#id_activity_id\").val(),\n\t\tname: jQuery(\"#id_name\").val(),\n\t\tstart_date:jQuery(\"#id_start_date\").val(),\n\t\tstart_time: jQuery(\"#id_start_time\").val(),\n\t\tcategory: jQuery(\"#id_category\").val(),\n\t\taddress: jQuery(\"#id_address\").val(),\n\t\tdescription: jQuery(\"#id_description\").val(),\n\t\tphoto: jQuery('#id_activity_photo a img.activity-photo-selected').attr('src'),\n\t\treference: jQuery(\"#id_reference\").val(),\n\t\tslug: jQuery(\"#id_slug\").val() };\n\t// make request, process response\n\tjQuery.post(\"/trip/add_activity/\", activity,\n\t\tfunction(response){\n\t\t\tif(response.success == \"True\"){\n\t\t\t\t//TODO:maintain order within that div\n\t\t\t\tjQuery(\"#createActivity\").modal('hide');\n\t\t\t\t//TODO:add handling for case when activity is edited (change its content or move it to a different date)\n\t\t\t\tif(response.edited == \"False\") {\n\t\t\t\t\tjQuery(response.activities_div_id).prepend(response.html);\n\t\t\t\t\t//Discussion setup\n\t\t\t\t\tjQuery('.activity_summary_content').carousel({interval : false});\n\t\t\t\t\tjQuery(\".discussion_link\").click(function (e) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvar activity_id = $(this).data( \"activity-id\" );\n\t\t\t\t\t\tvar carousel_id = '#'+activity_id+'_activity_summary_content';\n\t\t\t\t\t\tjQuery(carousel_id).carousel('next');\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(\".comment_post\").click(function () {\n\t\t\t\t\t\tvar activity_id = $(this).data( \"activity-id\" );\n\t\t\t\t\t\tonSaveComment(activity_id);\n\t\t\t\t\t});\n\t\t\t\t\tonPlaceOnMap(activity['name'], activity['address']);\n\t\t\t\t\tjQuery(\".show-on-map\").click(function () {\n\t\t\t\t\t\tvar name = $(this).data( \"name\" );\n\t\t\t\t\t\tonShowOnMap(name);\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(response.no_activities_div_id).remove();\n\t\t\t\t\tjQuery(response.activities_div_id).collapse('show');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//TODO:Add in error cases, show errors in form!\n\t\t\t}\n\t\t}, \"json\");\n}", "title": "" }, { "docid": "57cbd0be676cc62df6efd870825c1023", "score": "0.3760795", "text": "syncPortfolio(portfolio, userId) {\n // check if there is portfolio state created\n console.log('syncPortfolio start');\n if (portfolio.userId === '') {\n // there is no userId, should be first time log in\n // sync with backend\n console.log('syncPortfolio no portfolio found');\n restApi.createPortfolio(userId, (savedPortfolio) => {\n console.log('syncPortfolio return from createPortfolio', savedPortfolio);\n store.dispatch({ type: SYNC_PORTFOLIO, payload: savedPortfolio });\n });\n } else {\n // there is an existing portfolio\n // update the backend obj\n console.log('syncPortfolio update portfolio');\n restApi.updatePortfolio(portfolio, (savedPortfolio) => {\n console.log('syncPortfolio return from updatePortfolio', savedPortfolio);\n store.dispatch({ type: SYNC_PORTFOLIO, payload: savedPortfolio });\n });\n }\n }", "title": "" }, { "docid": "89ed1531a9f42b216026aa59378d7801", "score": "0.37581387", "text": "_timeConflict(tClient, model, options) {\n let tDisk = new Date(model.last_modified);\n console.warn(`Last saving performed ${tClient} ` +\n `while the current file seems to have been saved ` +\n `${tDisk}`);\n let body = `\"${this.path}\" has changed on disk since the last time it ` +\n `was opened or saved. ` +\n `Do you want to overwrite the file on disk with the version ` +\n ` open here, or load the version on disk (revert)?`;\n let revertBtn = dialog[\"a\" /* Dialog */].okButton({ label: 'Revert' });\n let overwriteBtn = dialog[\"a\" /* Dialog */].warnButton({ label: 'Overwrite' });\n return Object(dialog[\"b\" /* showDialog */])({\n title: 'File Changed',\n body,\n buttons: [dialog[\"a\" /* Dialog */].cancelButton(), revertBtn, overwriteBtn]\n }).then(result => {\n if (this.isDisposed) {\n return Promise.reject(new Error('Disposed'));\n }\n if (result.button.label === 'Overwrite') {\n return this._manager.contents.save(this._path, options);\n }\n if (result.button.label === 'Revert') {\n return this.revert().then(() => {\n return model;\n });\n }\n return Promise.reject(new Error('Cancel')); // Otherwise cancel the save.\n });\n }", "title": "" }, { "docid": "9b6acb01ae97f55cbac83235ef97f355", "score": "0.37441695", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "39f31824904fabb548ecb9b1e40e8bff", "score": "0.37380382", "text": "function savePressed() {\n\n return function (dispatch, getState) {\n\n dispatch(networkActions.networkAccess(`saving submission`));\n const nodes = getState().nodes.nodesById;\n const ports = getState().ports.linksById;\n const tabsById = getState().workspace.tabsById;\n const repos = getState().repos;\n\n const jsonnodes = Object.keys(nodes).map((key) => {\n const node = nodes[key];\n return Object.assign({}, convertNode(node, Object.keys(ports).map((k) => ports[k])));\n });\n\n const tabs = getState().workspace.tabs.map((key) => {\n return {\n id: tabsById[key].id,\n label: tabsById[key].name,\n type: 'tab'\n }\n });\n\n\n const { name, description, commit } = getState().repos.tosave;\n\n const app = Object.keys(repos.loaded.sha).length > 0 ? getState().workspace.app : repos.tosave;\n const appname = Object.keys(repos.loaded.sha).length > 0 ? repos.loaded.name : repos.tosave.name;\n\n const submission = {\n\n name,\n description,\n commit,\n flows: [\n ...tabs,\n ...jsonnodes\n ],\n\n manifest: _generateManifest({ ...app, id: getID() }, appname, extractPackages(getState()), jsonnodes, getState().repos.currentuser),\n }\n\n request\n .post(`${config.root}/github/repo/new`)\n .send(submission)\n .set('Accept', 'application/json')\n .type('json')\n .end(function (err, res) {\n if (err) {\n console.log(err);\n //dispatch(submissionError(err));\n dispatch(networkActions.networkError('error saving app'));\n } else {\n\n dispatch(networkActions.networkSuccess('successfully saved app'));\n dispatch(receivedSHA(res.body.repo, res.body.sha));\n dispatch(requestRepos());\n //dispatch(submissionResponse(res.body));\n //dispatch(receivedCommit(res.body.commit))\n }\n });\n }\n}", "title": "" }, { "docid": "1a98304c1fb3abdc8875ddccf18b2163", "score": "0.37290654", "text": "function saveNote() {\r\n\r\n let title = document.getElementById('tentative-title').value;\r\n let contents = editor.getValue();\r\n let responseJSON = {\"Title\": title, \"Contents\": contents};\r\n let request = new XMLHttpRequest();\r\n let saveNoteId = selectedNoteId;\r\n\r\n if (saveNoteId) {\r\n \r\n request.open('POST', '/notes/'.concat(saveNoteId), true);\r\n request.setRequestHeader(\"Content-Type\", \"application/json\");\r\n\r\n request.onload = function() {\r\n \r\n if (title) {\r\n // edit the note title in the page to reflect the changes\r\n let toEdit = document.getElementById(saveNoteId).getElementsByClassName('note-title')[0];\r\n toEdit.textContent = title;\r\n }\r\n\r\n };\r\n\r\n request.send(JSON.stringify(responseJSON));\r\n\r\n } else {\r\n\r\n request.open('POST', '/notes/null', true);\r\n request.setRequestHeader(\"Content-Type\", \"application/json\");\r\n\r\n request.onload = function() {\r\n\r\n let data = JSON.parse(this.responseText);\r\n if (request.status == 200) {\r\n // render the new note in the page and mark it as the currently selected one\r\n renderData(data);\r\n selectedNoteId = data._id['$oid'];\r\n document.getElementById(selectedNoteId).style.background = \"#d9fc9f\"; \r\n }\r\n\r\n };\r\n\r\n request.send(JSON.stringify(responseJSON));\r\n }\r\n}", "title": "" }, { "docid": "118940db92b856ae4530f9313cbaadf1", "score": "0.3727951", "text": "function editsave()\n{\n\tvar diffid = $('#diffid').val();\n\tvar fileuploaded = $(\"#fileuploaded\").val()?$(\"#fileuploaded\").val():$(\"#temp_fileuploaded\").val();\n\tif(fileuploaded==\"\")\n\t{\n\t\t$(\"#drop\").attr('style',\"width:105%;height:150px; border: 2px dashed #FF0000 !important;\");\n\t}\n\telse\n\t{\n\t\tvar imgArray = [\"gif\",\"png\"];\n\t\tvar img_type = fileuploaded.slice(-3);\n\t\tvar availableimgExt = $.inArray(img_type, imgArray);\n\t\tif(availableimgExt < 0)\n\t\t{\n\t\t\t$(\"#drop\").attr('style',\"width:105%;height:150px; border: 2px dashed #FF0000 !important;\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#drop\").attr('style',\"width:105%;height:150px; border: 2px dashed #999999 !important;\");\n\t\t\t$.ajax({ //Make the Ajax Request\n\t\t\t\ttype: \"POST\", \n\t\t\t\turl: \"../ajax_diffeditstep3\",\n\t\t\t\tdata: \"diffid=\"+diffid+\"&decal=\"+fileuploaded,\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\tif(response=='1')\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.location = \"../difficulties?edited\";\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fe0376e1c0f9f02376e39a0e778578d5", "score": "0.37198576", "text": "function git_post_commit(post_path, msg, noedit) {\n // NOTE `git commit` can have multiple `-m` each is a paragraph on its own\n let paragraphs = msg.split(/\\n+/);\n // NOTE `--verbose` will include post diff at the end of prepopulated comment.\n // Believed to be useful, so non-configurable for now\n let git_args = ['commit', '--verbose'];\n let spawn_opts = { stdio: 'pipe' };\n\n if ( !noedit ) {\n git_args.push('--edit');\n spawn_opts.stdio = 'inherit';\n }\n\n for (let para of paragraphs) {\n git_args.push('-m', para);\n }\n\n git_args.push('--', post_path);\n spawn_sync('git', git_args, spawn_opts);\n}", "title": "" }, { "docid": "f94e4c2b6543819db8dfa968955f733f", "score": "0.37068778", "text": "function save() {\r\n var source = encodeURIComponent ( myDiagram.model.toJson() );\r\n var id = document.getElementById(\"strategyId\").value;\r\n if (id > 1) {\r\n ajax.requestFile = \"index.php?page=admin&session=\"+session+\"&mode=BotEdit\";\r\n ajax.runResponse = whenSaved;\r\n ajax.execute = true;\r\n ajax.setVar(\"action\", \"save\");\r\n ajax.setVar(\"strat\", id);\r\n ajax.setVar(\"source\", source);\r\n ajax.runAJAX();\r\n }\r\n }", "title": "" }, { "docid": "e6283ed04b2a1110e700522a43867367", "score": "0.37045705", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err) });\n });\n }", "title": "" }, { "docid": "e6283ed04b2a1110e700522a43867367", "score": "0.37045705", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err) });\n });\n }", "title": "" } ]
f6fa83ccaeeca5d74c695865d5d31049
1 2 3 4 5 6 7 8 9 10 11
[ { "docid": "0f08a4daafa8c5c4289cc3d2455f8f94", "score": "0.0", "text": "function jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8601_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n if (match[9]) {\n tzHour = int(match[9] + match[10]);\n tzMin = int(match[9] + match[11]);\n }\n dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));\n var h = int(match[4]||0) - tzHour;\n var m = int(match[5]||0) - tzMin;\n var s = int(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 }\n return string;\n }", "title": "" } ]
[ { "docid": "a4b18405e3b042fdc56ca149d3f11975", "score": "0.64278847", "text": "function range(n) { \n var L=[]\n for (var i=0;i<n;i++) {\n L[i]=i+1\n }\n return L\n}", "title": "" }, { "docid": "2c48505fe5408d9437191b9bfb9a6a43", "score": "0.6419433", "text": "function range(i,d){\r\nvar a=[];\r\n var j=0;\r\nwhile(i<=d){\r\na[j]=i;\r\ni++;\r\nj++;\r\n}\r\n}", "title": "" }, { "docid": "eaea9afcac3aa38bedfdb979b00d60d8", "score": "0.63615006", "text": "function range(start, count) {\n \treturn Array.apply(0, Array(count + 1))\n \t\t.map(function (element, index) { \n \t\treturn index + start; \n \t});\n }", "title": "" }, { "docid": "678c5e12937d7dfa5abd0bd69ecbd4c2", "score": "0.626835", "text": "function range(a, b, c){\n const nums = [];\n for(let i = 1; i<=a; i++){\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "1078fa1d226b03822f8ea8a6f60664a4", "score": "0.62179625", "text": "function oneThroughTwenty() {\n let numeros=[]\n for (let sequencia=1; sequencia<=20; sequencia++){\n if(sequencia>=1){\n numeros.push(sequencia)\n }\n } \n return numeros;\n}", "title": "" }, { "docid": "16167b83f2bd96e2c64da67022f8892a", "score": "0.6163734", "text": "function rng (first,last){\n var ans=[];\n for (let i=first; i<=last;i++){\n ans.push(i + \"<br>\");\n }\n document.write (ans)\n}", "title": "" }, { "docid": "40cd66346e872f67d976370a16034963", "score": "0.6121299", "text": "function rangeBetween(numero1, numero2){\n var resultado = []\n for(var i = numero1; i<= numero2; i++){\n resultado.push(i)\n }\n return resultado\n\n}", "title": "" }, { "docid": "8e0d6ea1af1f6755b0951fdd868753bb", "score": "0.6117499", "text": "function range(n, m) {\n let ret = []\n for (let i=n; i < m; i++) {\n ret.push(i)\n }\n return ret\n}", "title": "" }, { "docid": "1d5ee64d38e76be9b3e7f3b8991272fb", "score": "0.61163294", "text": "function range(start, end) {\n let sequence = [];\n for(let i = start; i <= end; i++){\n // pushes the next number in the squence into the array.\n sequence.push(i); \n }\n return sequence;\n}", "title": "" }, { "docid": "500ce56224d83ba0c63d9573ae483e98", "score": "0.60885984", "text": "function range(a,b){\n\tvar tab = new Array();\n\tif(a<b){\n\t\tfor(var i=a;i<b+1;i++){\n\t\t\ttab.push(i);\n\t\t}\n\t}\n\telse{\n\t\tfor(var i=b;i<a+1;i++){\n\t\t\ttab.push(i);\n\t\t}\n\t}\n\n\treturn tab;\n}", "title": "" }, { "docid": "a4e6a66093b685e785044a5bbf597c94", "score": "0.6071294", "text": "function range(from, to) {\n var result = [];\n for (var n = from; n < to; n += 1) result.push(n);\n return result;\n }", "title": "" }, { "docid": "39be22cd154528129e37f8d2953d222d", "score": "0.6055656", "text": "function range(a, b){\n var arr = [];\n for(var i = a; i < b; i++){\n arr.push(i);\n }\n return arr;\n }", "title": "" }, { "docid": "358f9294932b34fa7df444cf995dfa03", "score": "0.6043239", "text": "function printEvenNumers() {\n let result = [];\n for (let i = 2; i <= 10; i += 2) {\n result.push(i);\n }\n\n return result;\n}", "title": "" }, { "docid": "13a3a4f4364b8f8581b0326a832ad224", "score": "0.6033597", "text": "function incrementer(num) { \n return num.map((a,i)=>(a+i+1) % 10);\n}", "title": "" }, { "docid": "7f95934f525549525687e026b7f145b9", "score": "0.60277444", "text": "function range(start, end){\n var arr=[];\n for(var count=start; count<=end; count++){\n arr.push(count)\n } \n return arr;\n}", "title": "" }, { "docid": "7f95934f525549525687e026b7f145b9", "score": "0.60277444", "text": "function range(start, end){\n var arr=[];\n for(var count=start; count<=end; count++){\n arr.push(count)\n } \n return arr;\n}", "title": "" }, { "docid": "bf71ead0dea6a9e78fd20692585b70a8", "score": "0.60236037", "text": "function multiples(){\n for ( var i = -300; i < -8; i += 3){\n console.log(i)\n } \n}", "title": "" }, { "docid": "796b2a003a7c6402210dc6bdf09cdc05", "score": "0.60014474", "text": "function pipeFix(numbers){\n let min = Math.min(...numbers);\n let max = Math.max(...numbers);\n let res =[];\n for(let i=min; i<=max; i++){\n res.push(i);\n }\n return res;\n}", "title": "" }, { "docid": "6aa3baa60b26820ff8fcce7c224615a0", "score": "0.59887755", "text": "function changeNextThreeToValue(start, arr, num) {\n let i = start;\n while ( i < start + 3 ){\n arr [i] = num;\n i = i + 1\n }\n \n}", "title": "" }, { "docid": "2f8f9c6d1150706496710aa61d68d62f", "score": "0.5987746", "text": "function range (a, b, c=1){\n const n1 = b === undefined ? 1 : a;\n const n2 = b === undefined ? a : b;\n const nums = [];\n for(let i = n1; i <=n2; i += c){\n nums.push(i)\n }\n return nums;\n}", "title": "" }, { "docid": "382d7b619434fbdf41d01ee2df9e376c", "score": "0.5967004", "text": "function numbers() {\n for (let i = 1; i < 11; i++) {\n console.log(i); \n } \n}", "title": "" }, { "docid": "60f13e1032c6eec9ab9bfe8c28f9695b", "score": "0.5943086", "text": "function sequence(integer) {\n\tvar result = [];\n\tfor (var i = 1; i <= integer; i += 1) {\n\t\tresult.push(i);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "f1bb8fbad7cc343852a4de2798201e9b", "score": "0.593304", "text": "static arrayMakeRange(range,step=1){let index;let higherBound;if(range.length===1){index=0;higherBound=parseInt(range[0],10)}else if(range.length===2){index=parseInt(range[0],10);higherBound=parseInt(range[1],10)}else return range;const result=[index];while(index<=higherBound-step){index+=step;result.push(index)}return result}", "title": "" }, { "docid": "327064f847cf07d09575a3f72d74e9b4", "score": "0.5926692", "text": "range(number)\n {\n return new Array(number).fill().map((e, i) => i);\n }", "title": "" }, { "docid": "b9f6087050e923e3fffcdab8197470da", "score": "0.59085435", "text": "function range(n) {\n const ret = [];\n for (let i = 0; i < n; i++) {\n ret.push(i);\n }\n return ret;\n}", "title": "" }, { "docid": "a50034c1f522facdca403d113fa108f7", "score": "0.59046906", "text": "function range(n) {\n var a = Array.apply(null, new Array(n));\n return a.map(function (_, i) { return i; });\n}", "title": "" }, { "docid": "692bd1f7f455288efa5913cf761af70c", "score": "0.58906627", "text": "function sequence(count, startingNum) {\n let resultArr = [];\n for (let idx = 1; idx <= count; idx++) {\n resultArr.push(startingNum * idx);\n }\n return resultArr;\n}", "title": "" }, { "docid": "17f88c5de8c0da90779342811d26428d", "score": "0.5889314", "text": "function threeNPlusOneGenerator (num) {\n const sequence = [];\n\n let i = 2;\n while (sequence.length<num){\n sequence.push(i);\n i+=3\n }\n\n return sequence;\n}", "title": "" }, { "docid": "9625ffaf67652ff5b785aeee1941ad73", "score": "0.5878272", "text": "function range(e,n,o){if(void 0===n&&(n=e,e=0),void 0===o&&(o=1),o>0&&e>=n||o<0&&e<=n)return[];for(var t=[],r=e;o>0?r<n:r>n;r+=o)t.push(r);return t}", "title": "" }, { "docid": "91b79e19b5c0031c09436a67854d3c63", "score": "0.5876792", "text": "function range(start, count) {\n if (arguments.length === 1) {\n count = start;\n start = 0;\n }\n\n var foo = [];\n for (var i = 0; i < count; i++) {\n foo.push(start + i);\n }\n return foo;\n}", "title": "" }, { "docid": "7074ffa3b19ee9df74f87b7d91e29569", "score": "0.5867681", "text": "function ex_10_I(a,n){\n\tvar array = [];\n\tvar i = 0;\n\twhile(i<n){\n \tarray.push(a);\n i++;\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "43633ea316405a3e847c1f058403eb5c", "score": "0.5854762", "text": "function pItem(n) {\n var cur = 0;\n for(var i = 0; i < n; i++) {\n cur += pInt();\n pWS();\n }\n return cur;\n}", "title": "" }, { "docid": "f475a51c63fe1ce0d88cf2c67361bdcb", "score": "0.58533335", "text": "function utilsGetSeq(num) {\n var nums = [];\n for (var i = 0; i < num; i++) {\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "78bdfecd51b4a7aa3e0c5a6cb6544e45", "score": "0.5850833", "text": "function range(x) {\n const a = [];\n for (let i = 0; i < x; ++i)\n a.push(i);\n return a;\n}", "title": "" }, { "docid": "85e851604463a71e640fc167cf4d5c0f", "score": "0.58415", "text": "function range (a, b, c){\n const n1 = b === undefined ? 1 : a;\n const n2 = b === undefined ? a : b;\n const nums = [];\n for(let i = n1; i <=n2; i++){\n nums.push(i)\n }\n return nums;\n}", "title": "" }, { "docid": "4049f5ebcdb29c4874eda046227c9c57", "score": "0.5839147", "text": "function mg_mapNum(num, less, plus, max, cycle) {\n var arr = [];\n for (var i = -less; i <= plus; i++) {\n if (num + i < max || cycle) { // here if num>max we put null because the item doesn't exist, except with cycle\n if (num + i < 0 && cycle) {\n arr.push(max - (-num - i));\n } else if (num + i >= max && cycle) {\n arr.push(num + i - max);\n } else {\n arr.push(num + i);\n }\n } else {\n arr.push(null);\n }\n }\n return arr;\n}", "title": "" }, { "docid": "9d2cf40e6bfa1b81747288a0c5df6756", "score": "0.5830953", "text": "function example4(n) {\n if (n === 0) return;\n\n for (var i = 1; i <= 23; i++) { \n }\n\n example4(n - 1)\n}", "title": "" }, { "docid": "a111698b7d0cf78fde90a4b2340ecfb7", "score": "0.5825387", "text": "function createRange(num,input) {\n var result = [];\n for (i = 0; i < num; i++) {\n result.push(input)\n }\n return result\n}", "title": "" }, { "docid": "01335c53eff08881fd15887e6cc06caa", "score": "0.5816319", "text": "function pipeFix(numbers){\nvar newArr = [];\nvar counter = numbers[0];\n\n while(counter != numbers[numbers.length -1] + 1){\n newArr.push(counter);\n counter++;\n }\n return newArr;\n}", "title": "" }, { "docid": "b87b6ec955128fce71ea02f15608b2de", "score": "0.58079517", "text": "getRange(min, max, step) {\n step = step || 1;\n var input = [];\n for (var i = min; i <= max; i += step) {\n input.push(i);\n }\n return input;\n }", "title": "" }, { "docid": "c785a30d48e0af44093c99587098b18b", "score": "0.5807354", "text": "function pares(x, y){ var a=[], b=0;\r\n\tfor(var i=x; i<y ;i++){\r\n\t\tif(i%2===0){ a[b]=i; b++;}\r\n\t}\r\n\treturn a;\r\n}", "title": "" }, { "docid": "2a2a1de5eb75aed51caa1763ed2d6d51", "score": "0.58010507", "text": "function sequence(count, number) {\n let result = [];\n let finalNumber = number;\n for (let idx = 1; idx <= count; idx += 1) {\n result.push(finalNumber);\n finalNumber += number;\n }\n return result;\n}", "title": "" }, { "docid": "864345d1ce9d7a41eb0878f94b51bd8b", "score": "0.58005357", "text": "function tri(n){return n*(n+1)/2;}", "title": "" }, { "docid": "4af4bac128dd0b6577308bc8a9a0c585", "score": "0.57998556", "text": "function range(start, end, step) {\n let arr = [];\n \tif (step == \"\") {\n let incr = 1;\n } else {\n let incr = step;\n };\n \n for (let i = start; i < end; i+incr) {\n arr.push(i);\n };\n return arr;\n}", "title": "" }, { "docid": "8ecfff6eae32a5df37ea05412f2da38e", "score": "0.5797877", "text": "function getNumberRange(start, finish) {\n var arr = [];\n var i = start;\n while (i < finish) {\n arr.push(i++);\n }\n return arr;\n }", "title": "" }, { "docid": "5707c8f89fcc647a5301e6c1f841745c", "score": "0.57968074", "text": "function i(n){return n}", "title": "" }, { "docid": "5707c8f89fcc647a5301e6c1f841745c", "score": "0.57968074", "text": "function i(n){return n}", "title": "" }, { "docid": "ad223d600b8684754f51b0b8ebddaa5a", "score": "0.5779792", "text": "function iterativePattern(startVal, endVal){\nconst arr = [];\nfor (let i = startVal; i <= endVal; i++){\narr.push(i)\n }\nreturn arr\n}", "title": "" }, { "docid": "78f143df7b67cfcef245e6ac7fbaa167", "score": "0.5769166", "text": "function sequence(n) {\n var result = [];\n for (var i = 1; i <= n; i++) {\n result.push(i);\n }\n\n return result;\n}", "title": "" }, { "docid": "dde92eac066df42ab6b4c7a0f03e839a", "score": "0.57635456", "text": "function range(start, count, step) {\n if (step === void 0) { step = 1; }\n var ret = [];\n for (var i = start; i < start + (count * step); i += step) {\n ret.push(i);\n }\n return ret;\n}", "title": "" }, { "docid": "eb5953c6c576f660b1e6400c2e59bf93", "score": "0.5760697", "text": "function between(a, b) {\n let newArr = []; //create a new array\n for(i=a; i<=b; i++){ //run a for-loop between both placeholders\n newArr.push(i); //push the index to the new array\n }\n return newArr //return array\n}", "title": "" }, { "docid": "008e59ddc0cf9221a69a851ca4edb306", "score": "0.57554495", "text": "function range(n) {\n a = [];\n for(var i = 0; i < n; ++i) {\n a[i] = i;\n }\n return a;\n}", "title": "" }, { "docid": "58c23d19075a85bad60417c22c9386f5", "score": "0.57552904", "text": "function findSequences(n) {\r\n let res = []\r\n let range = [...Array(n).keys()]\r\n for (let i = 1; i < range.length / 2; i++) {\r\n let sum = 0\r\n for (let j = i; sum < n; j++) {\r\n sum += j\r\n if (sum == n) res.push(range.slice(i, j + 1))\r\n }\r\n }\r\n return res.reverse()\r\n}", "title": "" }, { "docid": "d50c146e4d74257f745be09562d35b73", "score": "0.5750991", "text": "function printRange(start, end, step = 1) { \n if (end == undefined) {\n end = start;\n start = 0;\n }\n result = [];\n for(var i = start; i < end; i += step) {\n result.push(i);\n }\n return result;\n}", "title": "" }, { "docid": "d1ae69ef19da5ecb78a31bdf0d5aaa09", "score": "0.5748613", "text": "function four(i) {\n for(let j = 0; j < 4; j++) {\n set(j, i, (j+1) * (j+1));\n }\n }", "title": "" }, { "docid": "beb85f1995765b8b5dbae2265fdeef7b", "score": "0.57320094", "text": "function range (a, b, c = 1){\n const n1 = b === undefined ? 1 : a;\n const n2 = b === undefined ? a : b;\n const step = n1 <= n2 ? Math.abs(c) : -Math.abs(c);\n const nums = [];\n for(let i = n1; n1 <= n2 ? i <=n2 : i >= n2; i+=step){\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "beb85f1995765b8b5dbae2265fdeef7b", "score": "0.57320094", "text": "function range (a, b, c = 1){\n const n1 = b === undefined ? 1 : a;\n const n2 = b === undefined ? a : b;\n const step = n1 <= n2 ? Math.abs(c) : -Math.abs(c);\n const nums = [];\n for(let i = n1; n1 <= n2 ? i <=n2 : i >= n2; i+=step){\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "db0677414bc35a0083eecce4725d4e27", "score": "0.57312506", "text": "function listNum(x) {\n for (let i = 0; i < x; i++){\n console.log(i + 1);\n }\n}", "title": "" }, { "docid": "544f5149b496a4be62d987e88b5d0c09", "score": "0.5727491", "text": "function range(start, stop, step)\r\n{\r\n var result = new Array()\r\n for (var idx = start; idx <= stop; idx += step) {\r\n result.push(idx)\r\n }\r\n return result\r\n}", "title": "" }, { "docid": "53986caf9a3021415123b1c56c224209", "score": "0.57274336", "text": "function nums2() {\n for (let i = 10; i <= 40; i+=2) {\n console.log(i);\n }\n}", "title": "" }, { "docid": "5f4934fc1abb31828fbc0b14ba6c3530", "score": "0.5722452", "text": "function range(start_num, end_num) {\n\n if(end_num - start_num === 2){\n return [start_num + 1];\n }\n else {\n var list = range(start_num, end_num-1);\n list.push(end_num-1);\n return list;\n }\n}", "title": "" }, { "docid": "5712d6d38c29e7eba98a70bc93f67465", "score": "0.5722207", "text": "function ex_2_I(n){\n var somma = 0;\n\tvar numeroDispari = 1;\n\tfor (var i = 0; i < n; i++) {\n\t\tsomma += numeroDispari;\n\t\tnumeroDispari += 2;\n\t};\n\treturn somma;\n}", "title": "" }, { "docid": "33a95e8ab4e12ef26ac5a5ed6ad25cf3", "score": "0.5721524", "text": "function range(count) {\n return _.range(count);\n}", "title": "" }, { "docid": "3e537bb2da0fa6b342183507ea32b73a", "score": "0.57206976", "text": "function multByNine(){\n for(var i = 0; i < 11; i++){\n var result = i * 9;\n console.log(i + \" * 9 = \" + result);\n }\n}", "title": "" }, { "docid": "c6f41424214911c67abc4a0ae21c8977", "score": "0.57199556", "text": "function range (n) {\n var arr = Array(n);\n for (var i = 0; i < n; i++) {\n arr[i] = i + 1;\n }\n return arr;\n}", "title": "" }, { "docid": "dcf82c655fd18884d2728866c674a3aa", "score": "0.57177126", "text": "function seq(to, from = 0, step = 1) {\n var result = [];\n var count = 0;\n if (to > from) for (let i = from; i < to; i += step) result[count++] = i;\n else for (let i = from; i > to; i -= step) result[count++] = i;\n\n return result;\n}", "title": "" }, { "docid": "131e9c859ec38b051ce39a658373e87e", "score": "0.5713811", "text": "function rangeFinder() {\n for(var i =0;i<=input;i++){\n numbers.push(i);\n }\n }", "title": "" }, { "docid": "292ff6fc370d5dadd61ec6d64793a1dc", "score": "0.5713709", "text": "function takeNumber(num){\n\tfor (var i = 1; i <= num; i++) {\n\t\tif (!(i % 3) && !(i % 7)) {\n\t\t\tconsole.log(i)\n\t\t\tconsole.log(new Array(6).join('*'))\n\t\t};\n\t};\n}", "title": "" }, { "docid": "92b66fed1a53e6fa6a07ffeb13996fe7", "score": "0.570795", "text": "function range(start, count) {\n\treturn Array.apply(0, Array(count))\n\t\t.map(function (element, index) {\n\t\t\treturn index + start;\n\t\t});\n}", "title": "" }, { "docid": "7a4ffa223efd5958353dbc04b1e30f88", "score": "0.57057524", "text": "function rangeFromKeys(n){\n return Array.from(Array(n).keys())\n .map(function(i){\n return i + 1;\n }); \n}", "title": "" }, { "docid": "5f89194b9d096cda36cb81176fdac532", "score": "0.5703045", "text": "function seq(n) {\n return Array.apply(null, new Array(n))\n .map(function(x, i) { return i; });\n}", "title": "" }, { "docid": "86bd86a97ba9701ea74148ab638fd616", "score": "0.5691684", "text": "function rowWithNumbers(input) {\r\n let n = Number(input.shift());\r\n\r\n let k = 1;\r\n\r\n while (k <= n) {\r\n console.log(k);\r\n k = 2 * k + 1;\r\n }\r\n}", "title": "" }, { "docid": "95b3b025ef53a01d55455c722e33f101", "score": "0.56778944", "text": "function multipleThirteen() {\n for(var i = 0; i <= 730; i+=13) {\n console.log(i);\n }\n}", "title": "" }, { "docid": "ccaec583273779cb78f8aa795a718b11", "score": "0.56774896", "text": "function range(start, end,inc) {\r\n if(start === end) return [start];\r\n return [start, ...range(start + inc, end,inc)];\r\n}", "title": "" }, { "docid": "f198c1a8906ace435ee6fbcb4fd2a7a8", "score": "0.5672591", "text": "function sequence(start, finish) {\n\tvar inc = finish > start ? 1 : -1;\n\tvar points = [];\n\tfor (i = start; i <= finish; i += inc) {\n\t\tpoints[i] = i;\n\t}\n\treturn points;\n}", "title": "" }, { "docid": "d4b5c23331050bf1504948b1d9a955d6", "score": "0.56698185", "text": "function oneToTen(){\n for(let i = 0; i <= 10; i++){\n console.log(i);\n }\n}", "title": "" }, { "docid": "565ceb5c2f1d5a04922d4d49e280b0f1", "score": "0.56680185", "text": "function incremental(n) {\n return n + 1;\n}", "title": "" }, { "docid": "9633c39a04d77fc04ab456ea9c61713b", "score": "0.565095", "text": "function logItems(n){\n for(let i =0; i<n;i++){\n console.log(i)\n }\n for(let j =0; j<n;j++){\n console.log(j)\n }\n}", "title": "" }, { "docid": "9d64f2b9cfff32ae00f39627ef1f1e20", "score": "0.565001", "text": "function ordinateArray(num){\n var anArray=[]\n for(i=1; i<=num; i++){\n anArray.push(i)\n }\n return(anArray)\n}", "title": "" }, { "docid": "428d79eaf300443f752ba56b45570d2c", "score": "0.564609", "text": "function aliquotSequence(base, n) {\n var finalArray = [base];\n for (var j = 1; j < n; j++) {\n var counter = 0;\n for (var i = 1; i < base; i++) {\n\n if (base % i === 0) {\n counter += i;\n }\n }\n finalArray.push(counter);\n base = counter;\n }\n\n return finalArray;\n}", "title": "" }, { "docid": "e3579a9aca78909497f947bf43adfab9", "score": "0.5644632", "text": "function range(x) {\n return Array.apply(null, new Array(x)).map(function (_, i) { return i; });\n}", "title": "" }, { "docid": "89d13d585b46d71ab248c3da4391e987", "score": "0.564255", "text": "function sequentialSize(val)\r\n {\r\n var answer = \"\";\r\n switch (val)\r\n {\r\n case 1:\r\n case 2:\r\n case 3:\r\n answer = \"low\";\r\n break;\r\n\r\n case 4:\r\n case 5:\r\n case 6:\r\n answer = \"mid\";\r\n break;\r\n\r\n case 7:\r\n case 8:\r\n case 9:\r\n answer = \"high\";\r\n break;\r\n \r\n }\r\n return answer;\r\n }", "title": "" }, { "docid": "2c7c8bb8359e176237b6b76dd03022ee", "score": "0.5640857", "text": "function kata4() {\n let arr = []\n for (let i = 25; i>0; i--){\n arr.push(i*-1)\n }\n showResults(`KATA 4 : [ ${arr} ]`)\n}", "title": "" }, { "docid": "ada363ee5f233cca7288cbb98186e3c5", "score": "0.56398183", "text": "function createRange(num, value) {\r\n var endArr = [];\r\n for (var i = 0; i < num; i++) {\r\n endArr.push(value);\r\n }\r\n return endArr;\r\n\r\n}", "title": "" }, { "docid": "3b56d7433100487ec3015008aa448cf7", "score": "0.56384945", "text": "function range(start, end){\r\n\r\n // Loop die van het opgegeven start nummer tot het eind nummer loopt\r\n for(var i = start; i <= end; i++){\r\n\r\n // Elk nummer binnen de loop word in de array gepusht\r\n numbers.push(i);\r\n \r\n }\r\n \r\n // Hevulde array wordt gereturnd\r\n return numbers;\r\n}", "title": "" }, { "docid": "a53fb1c02fe5f88ba7dc9056edd96eaa", "score": "0.563678", "text": "function subTracts(ten, one){\n return 10 - 1\n}", "title": "" }, { "docid": "51b6b29a65cdceffca411e0887bcd704", "score": "0.5636335", "text": "function arithmeticSequenceElements(a,r,n) {\n let arr = []\n for (let i=0; i<n; i++){\n arr.push(a+(r*i)) \n }\n return arr.join(', ')\n }", "title": "" }, { "docid": "8ffaccf461ec4d64b37712e0ba85ddcd", "score": "0.56359345", "text": "function patternProg() {\n\n let x = [];\n for (let i = 0; i <= 5; i++) { \n x += [i]; \n console.log(x);\n } \n}", "title": "" }, { "docid": "3fe1485adbbab6a1045fd16cf800906e", "score": "0.5633795", "text": "function createList(start, finish, increments) {\n var result = [];\n\n for(var i = parseInt(start); i <= parseInt(finish); i += parseInt(increments)) {\n result.push(i);\n };\n\n return result.toString().replace(/,/g, ' ');\n}", "title": "" }, { "docid": "b7ea5f57e01a7501aac0453aaf24806c", "score": "0.5632136", "text": "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "title": "" }, { "docid": "0d9ea7b0e1dc501ff120b64fde995139", "score": "0.5630649", "text": "function printNumbers(start, end) {\n var counter = start; \n while (counter <= end) {\n console.log(counter);\n counter++;\n }\n}", "title": "" }, { "docid": "798de2d8aed05f63a09191e44fe98fd7", "score": "0.56252176", "text": "function range(start, end) {\n r = [];\n for (var i = start; i < end; i++) {\n r.push(i);\n }\n return r;\n}", "title": "" }, { "docid": "05879efe8514f9f31be4ff38c4d40550", "score": "0.5624195", "text": "function range(startNum, endNum) {\n if (endNum - startNum === 2) return [startNum + 1];\n else {\n let list = range(startNum, endNum - 1);\n list.push(endNum - 1);\n // do hàm range() gọi tới range() cuối cùng rồi mới thực hiên\n // nên các hàm range() trước đó phải chờ \n // vì thế nên mới có phương thức push đẩy vào cuối \n console.log(endNum - 1, list);\n return list;\n }\n}", "title": "" }, { "docid": "c2bae93cce5a14a00824dd62894007d4", "score": "0.5622848", "text": "function range(a, b)\n{\n if(b - a === 2)\n {\n return [a + 1];\n }\n else\n {\n var list = range(a, b - 1);\n list.push(b - 1);\n return list;\n }\n}", "title": "" }, { "docid": "0d5e90532d124f7197de0bfa9e377794", "score": "0.5621585", "text": "function rangeMaker(start, end) {\n let arr = [];\n for (let i=0; i<=end+1; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "5b3646ff92f0c1e50c15943824631769", "score": "0.562027", "text": "function getOneTo10(){\n var oneLength =3;\n var twoLength =3;\n var threeLength =5;\n var fourLength =4;\n var fiveLength =4; \n var sixLength =3;\n var sevenLength =5;\n var eightLength =5;\n var nineLength =4;\n // just add them all together\n return oneLength + twoLength + threeLength + fourLength + fiveLength + sixLength + sevenLength + eightLength + nineLength;\n }", "title": "" }, { "docid": "1b9cf65f51b3b58b3fc6fb572fe7900b", "score": "0.5618709", "text": "function main(m, n) {\r\n for (let i = m; i >= n; i--) {\r\n console.log(i);\r\n }\r\n}", "title": "" }, { "docid": "09d8ad8e71fc7012d458bcf14e726589", "score": "0.56185126", "text": "range () {\n\n let n = 0;\n let elect = this.head;\n\n while (elect) {\n elect = elect.next;\n n += 1;\n }\n\n return n;\n\n }", "title": "" }, { "docid": "8f6c3243c02f3cd367413a05eacd0a70", "score": "0.56170326", "text": "function numbers(num1, num2){\n for(var i = num1; i <= num2; i++) {\n console.log(i);\n }\n}", "title": "" }, { "docid": "707fbbb4a594c547104850055e4e4441", "score": "0.5616981", "text": "function range(start,end){\n if (start === end){\n return [start];\n }\n \n return [start].concat(range(start + 1, end));\n}", "title": "" }, { "docid": "9c8049fb9a989dbcaf2b9e51daf7aa52", "score": "0.5613827", "text": "function myApp() {\n var total = 5;\n var output = '';\n for (var i = 1; i <= total; i++) {\n for (var j = 1; j <= i; j++) {\n output += j + ' ';\n }\n console.log(output);\n output = '';\n\n }\n}", "title": "" } ]
bc0770f2bed08df1335b23e616b68851
this is used for updating the progress bar
[ { "docid": "56850902c948927315488c58677b51f5", "score": "0.71564376", "text": "function updateProgIndicator(n) {\n var percentprogress = Math.round(n/($(\".tab\").length) * 100); \n var style = \"width: \" + percentprogress.toString() + \"%\"; \n $(\".progress-bar\").attr({\n \"style\": style, \n \"aria-valuenow\": percentprogress.toString(),\n });\n $(\".progress-bar\").html(percentprogress.toString() + \"%\"); \n}", "title": "" } ]
[ { "docid": "db9e4abf2cb401c61aea20a82bea0d67", "score": "0.8411498", "text": "function updateProgressBar() {\n if (progress < 100) {\n progress = progress += updateVal; //13 calls\n $rootScope.$broadcast('loading-bar-updated', progress, map);\n }\n }", "title": "" }, { "docid": "ac268cf15d19e48e591d6cf21ffa3ba1", "score": "0.8270256", "text": "function updateProgressBar(){\n\t\tif(progress < 100){\n\t\t\tprogress = progress + 7.7; //13 calls\n \t\t$rootScope.$broadcast('loading-bar-updated', progress);\n\t\t}\n }", "title": "" }, { "docid": "f70f4015d05e7f4b577b5fea403d9d34", "score": "0.8265647", "text": "function updateProgressBar(){\n\t\tpercentComplete++;\n\t\t$('#progressBar').css({'top': percentComplete + '%', 'height':3});\n\t\t//console.log('progressBar top: ' + $('#progressBar').css('top'));\n\t\tif (percentComplete > 100){\n\t\t\tpanelChanger();\n\t\t}\n\t}", "title": "" }, { "docid": "eb66d093cbe822cb931fa1e7155c1a51", "score": "0.82161546", "text": "function updateProgress() {\n var progress = 0,\n currentValue = $scope.curVal,\n maxValue = $scope.maxVal,\n // recompute overall progress bar width inside the handler to adapt to viewport changes\n progressBarWidth = progressBarBkgdElement.prop('clientWidth');\n\n if ($scope.maxVal) {\n // determine the current progress marker's width in pixels\n progress = Math.min(currentValue, maxValue) / maxValue * progressBarWidth;\n }\n\n // set the marker's width\n progressBarMarkerElement.css('width', progress + 'px');\n }", "title": "" }, { "docid": "5a02b57f47db7ca3200c57d9994dd283", "score": "0.81896675", "text": "function updateProgress() {\n\n\t\t\t// Update progress if enabled\n\t\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "b60c12fb787bfba166eb1a29b5b31510", "score": "0.8177063", "text": "function updateProgressBar() {\r\n\t\t$(\"#progressBar\").css(\"width\", _progress + \"%\");\r\n\t}", "title": "" }, { "docid": "c2a7897ecde48899b9a441245bcfda90", "score": "0.816804", "text": "function updateProgress() {\n\n\t\t// Update progress if enabled\n\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "c2a7897ecde48899b9a441245bcfda90", "score": "0.816804", "text": "function updateProgress() {\n\n\t\t// Update progress if enabled\n\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "6cc4b4160b6121aca22e73945a879002", "score": "0.80252665", "text": "function updateProgressBar(){\n\t\tif(progress < 100){\n\t\t\tprogress = progress + loadPercent;\n \t\t$rootScope.$broadcast('overworld-loading-bar-updated', progress);\n\t\t}\n }", "title": "" }, { "docid": "57a058758a9b4d58cd034a012c4ec3d3", "score": "0.800772", "text": "function updateProgress() {\n let progress = (questionIndex/QUESTION_IDS[branch_id].length) * 100;\n console.log('updateProgress() is called. Current percentage is ' + progress + '%.');\n document.querySelector('#progress-bar').MaterialProgress.setProgress(progress);\n\n $('#percentage').html(progress.toFixed(2) + \"%\");\n\n changeColour();\n}", "title": "" }, { "docid": "ff8f7b04bdd4c481116b4a6d2c8c5795", "score": "0.7974329", "text": "updateProgressBar() {\r\n console.debug(\"in updateProgressBar\");\r\n const percent =\r\n (this.percentage - this._min) / (this._max - this._min) * 100;\r\n this.progressBarInner.style.width = percent + \"%\";\r\n\r\n let text = \"\" + this.percentage + \"%\";\r\n this.progressBarText.innerText = text;\r\n }", "title": "" }, { "docid": "3228a4202fbb458983338114cc092e5a", "score": "0.79732156", "text": "function updateProgress() {\n\tprogBar.setAttribute(\"value\", shotDelay / 100);\n}", "title": "" }, { "docid": "48e4d1ca328fdabf0694c5e8202b18a9", "score": "0.7941302", "text": "function progressUpdate() {\n //the percentage loaded based on the tween's progress\n loadingProgress = Math.round(progressTl.progress() * 100);\n //we put the percentage in the screen\n $('.txt-perc').text(loadingProgress + '%');\n }", "title": "" }, { "docid": "b44451161228b2464dbcd7ff3dcd45ef", "score": "0.7827235", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "b44451161228b2464dbcd7ff3dcd45ef", "score": "0.7827235", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "c62527c2a7739c72609354f201f84c2f", "score": "0.78130215", "text": "function progressUpdate() {\n //the percentage loaded based on the tween's progress\n loadingProgress = Math.round(progressTl.progress() * 100);\n\n //we put the percentage in the screen\n $(\".txt-perc\").text(loadingProgress + '%');\n\n }", "title": "" }, { "docid": "1818cf30548e7171131fb719098acd5b", "score": "0.7792912", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((getCurrentTime() / getTotalLength()) * 10000);\n}", "title": "" }, { "docid": "e1a0ff428e821291457f83d7d81b9dee", "score": "0.7786641", "text": "function progressUpdate()\n\t{\n\t\t//the percentage loaded based on the tween's progress\n\t\tloadingProgress = Math.round(progressTl.progress() * 100);\n\n\t\t//we put the percentage in the screen\n\t\t$(\".preloader-percentage\").text(loadingProgress + '%');\n\n\t}", "title": "" }, { "docid": "665d237551409d8b0508d592d12dec40", "score": "0.7744362", "text": "update_display() {\n const outPct = Math.round(100 * Math.min(this._nsteps,this._status) / this._nsteps);\n // need to keep width style attribute and 'aria-valuenow' tag attribute in sync\n let pbar = document.getElementById(this._id);\n pbar.style.width = `${outPct}%`;\n pbar.setAttribute('aria-valuenow',outPct);\n pbar.innerHTML = outPct >= 100 ? 'Complete!' : `${outPct}%`;\n }", "title": "" }, { "docid": "eb08512a11847b208c5927277a410eb9", "score": "0.7742761", "text": "function progressBar() {\r\n // build progress bar elements\r\n buildProgressBar();\r\n\r\n // start counting\r\n start();\r\n }", "title": "" }, { "docid": "14309f98b8b9f919fca13c66e6bbb8f5", "score": "0.7732257", "text": "function progressBar(){ \n // build progress bar elements\n buildProgressBar();\n\n // start counting\n start();\n }", "title": "" }, { "docid": "47c08bf5b7967e7196b8bdbed1c4983a", "score": "0.77199256", "text": "function updateProgress(){\n progressWindow.labelCurrentLayerName.text = 'Processing group: ' + currentLayerset.name;\n progressWindow.text = 'processing '+ loopCounter +\" of \"+ totalLayerSets +\" layer groups. Yet extracted \"+ assetIndex +\" asset(s).\";\n progressWindow.bar.value = loopCounter/totalLayerSets*100;\n progressWindow.center();\n progressWindow.update();\n app.refresh();\n }", "title": "" }, { "docid": "a7b2c6ec0ecb0752afd634db197fdff2", "score": "0.77178407", "text": "function update() {\n var t = timeline.time();\n var d = timeline.duration();\n var p = Math.round( (t/d) * (rangeBg.offsetWidth) );\n var offset = p-2 + \"px\";\n\n // update the progress bar\n seekFill.style.width = offset;\n // update the drag position\n seekDrag.style.left = offset;\n // update the time display\n updateTime();\n }", "title": "" }, { "docid": "3842f13b02bdddba43ca87f689aebd09", "score": "0.7657793", "text": "function update() {\n var progress = document.getElementById(\"myprogressBar\");\n progress.style.width = \"0%\";\n progress.innerHTML = \"0%\";\n var currentWidth = 0;\n if (totalAmount() > 0) {\n var width = Math.round((completedAmount() / totalAmount()) * 100);\n var id = setInterval(frame, 30);\n function frame() {\n if (currentWidth >= width) {\n clearInterval(id);\n } else {\n currentWidth++;\n progress.style.width = currentWidth + \"%\";\n progress.innerHTML = width + \"%\";\n }\n }\n }\n }", "title": "" }, { "docid": "9f729fa1e8254f1d933e66185dc250af", "score": "0.7651019", "text": "function updateProgress() {\n progress = Math.floor((currentQuestion / questionsArray.length) * 100);\n var styleStr = String(\"width: \" + progress + \"%; height: 100%;\");\n progressBar.firstElementChild.setAttribute(\"style\", styleStr);\n progressBar.firstElementChild.textContent = progress + \" %\";\n correctScore = Math.floor((correctAnswers / questionsArray.length) * 100);\n}", "title": "" }, { "docid": "981785c9ed0060308a69d81b837b009a", "score": "0.76509994", "text": "updateProgress() {\n this.progress = (this.progress + this.rotationsPerMinute / (this.framesPerSecond * 60)) % 1;\n }", "title": "" }, { "docid": "d537611641c3508d67b4d9f382d8ef21", "score": "0.7647297", "text": "function updateProgress (oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n moveBar(percentComplete);\n } else {\n moveBar(0);\n }\n }", "title": "" }, { "docid": "f2cf91129f3b938089a968f96fcc5c21", "score": "0.7638895", "text": "function updateProgressBar() {\n\n\t\t//If there's only 1 attempt left, makes the bar red\n\t\t//If used half your attempts, makes the bar yellow\n\t\tif (maxAttempts - prevGuessedLetters.length === 1) {\n\t\t\tprogressBar.style.backgroundColor = \"red\";\n\t\t}\n\t\telse if (prevGuessedLetters.length / maxAttempts > 0.5) {\n\t\t\tprogressBar.style.backgroundColor = \"orange\";\n\t\t}\n\t\t//Updates the percent of the progress bar\n\t\tprogressBar.style.width = (prevGuessedLetters.length / maxAttempts * 100) + \"%\";\n\t}", "title": "" }, { "docid": "75807e649be9159ca95b20ddd0ee7fa5", "score": "0.76234674", "text": "function updateProgress() {\n // Update progress if enabled\n const progressbar = state.dom.progressbar;\n if (config.progress && progressbar) {\n const wrapper = state.dom.wrapper;\n const totalCount = state.dom.slides.length;\n const pastCount = state.activeSlideIndex;\n const progress = pastCount / (totalCount - 1);\n\n style(progressbar)('width', progress * wrapper.offsetWidth + 'px')\n }\n }", "title": "" }, { "docid": "e526bf6d8c9d14b3a4224b927416cf66", "score": "0.7609813", "text": "function progressBar(){ \r\n\t\t// build progress bar elements\r\n\t\tbuildProgressBar();\r\n\r\n\t\t// start counting\r\n\t\tstart();\r\n\t}", "title": "" }, { "docid": "1975d64adceaf7dc5eefeb1bd799fcb1", "score": "0.75582623", "text": "function update_progress_bar(pb_id, progress)\n{\n $(\"#pb_\" + pb_id).stop().css(\"width\", $(\"#pb_\" + pb_id).width()).animate(\n {\n width: (progress * 100) + '%',\n easing: 'linear'\n },\n {\n duration: progress_bar_animation_duration,\n start: function(promise)\n {\n // Set text\n if (progress * $(\"#pb_\" + pb_id + \"_container\").width() != 0)\n {\n $(this).text(Math.round(progress * 100) + '%');\n }\n }\n });\n}", "title": "" }, { "docid": "7ea18addf88bf0801343297a76ff7514", "score": "0.7544452", "text": "function updateProgressBar() {\n\tconst totalDuration = video.duration;\n\tconst currentTime = video.currentTime;\n\tconst progress = (currentTime / totalDuration) * 100;\n\tprogressBarFill.style.flexBasis = `${progress}%`;\n}", "title": "" }, { "docid": "0453ddfa0eb2d627c019650403aaf858", "score": "0.75291693", "text": "function updateProgress() {\r\n\t\t\t\tvar progress = ((new Date()).getTime() - startTime.getTime()) / duration * 100;\r\n\t\t\t\tprogressBar.css(\"width\", \"\" + progress + \"%\");\r\n\t\t\t\t\r\n\t\t\t\t// We're at 100 %, close modal\r\n\t\t\t\tif (progress >= 100) {\r\n\t\t\t\t\tclearInterval(interval);\r\n\t\t\t\t\tmodal.modal(\"hide\");\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "65fc91196e8718022733751f8118f9ed", "score": "0.7528264", "text": "function updateProgress()\n\t{\n\t\t$(\"#warlc-progressbox\").attr('aria-valuenow', Math.round(((100 / cLinksTotal) * cLinksProcessed)));\n\t\tif (cLinksTotal) // some links were detected on page\n\t\t{\n\t\t\tvar percProgress = Math.round(((100 / cLinksTotal) * cLinksProcessed));\n\t\t\tvar $progressItems = $('#warlc-progressbox > .warlc-progressitem');\n\t\t\t\n\t\t\t$(\".warlc-progressbar\").progressbar('option', 'value', percProgress);\n\t\t\t\t\n\t\t\t\t\t\tif ((cLinksTotal - cLinksProcessed) == 0)\n\t\t\t{\n\t\t\t\t$progressItems.first().text(cLinksAlive)\n\t\t\t\t\t\t\t.next().text(cLinksDead)\n\t\t\t\t\t\t\t.next().text(cLinksUnava)\n\t\t\t\t\t\t\t.next().text(cLinksprem)\n\t\t\t\t\t\t\t.next().remove();\n\t\t\t\t$('#warlc-progressbox').html($('#warlc-progressbox').html().substr(0,$('#warlc-progressbox').html().lastIndexOf(\">\")+1));\n\t\t\t\t$('#warlc-progressbox div:first-child').remove();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$progressItems.first().text(cLinksAlive)\n\t\t\t\t\t\t\t.next().text(cLinksDead)\n\t\t\t\t\t\t\t.next().text(cLinksUnava)\n\t\t\t\t\t\t\t.next().text(cLinksprem)\n\t\t\t\t\t\t\t.next().text(cLinksTotal - cLinksProcessed);\n\t\t\t}\t\t\t\n\t\t}\t\n\t}", "title": "" }, { "docid": "30313ff3b54b3bc16236a096a2238ea9", "score": "0.75203204", "text": "function updateProgress() {\n progress.style.width = `${index * 100 / (sections.length - 1)}%`;\n }", "title": "" }, { "docid": "76dfa1be805be96edf1d344f926cce6a", "score": "0.74833906", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "ff86d405529c5161b0ceda424c5ef9de", "score": "0.74676317", "text": "function updateProgress(e){\n\t\tvar progress = document.getElementsByClassName('progress')[i];\n\n\t\tif(!audio.ended){\n\t\t\tvar positionP = e.pageX - bar.offsetLeft -135;\n\t\t\tvar percentage = 100 * positionP / bar.offsetWidth;\n\t\t\tconsole.log();\n\t\t\tvar newtime = positionP*audio.duration/75;\n\t\t\t\n\t\t\taudio.currentTime = percentage * audio.duration /100;\n\t\t\tprogress.style.width = positionP + 'px';\n\t\t}\n\t}", "title": "" }, { "docid": "0f8de9a8d64067395d1bc6def0f9792e", "score": "0.7452261", "text": "function updateProgress() {\n const minsElapsed = (Date.now() - startTime) / 60000;\n const minsRemaining = (minsElapsed / currentNum) * (total - currentNum);\n document.title = `${currentNum.toLocaleString()}/${total.toLocaleString()} (${(currentNum / total * 100).toFixed(1)}%)`;\n preview.text(document.title + `. ${Math.floor(minsElapsed)} mins elapsed, ${Math.round(minsRemaining)} mins remaining`);\n }", "title": "" }, { "docid": "ce6dd55d1a35054b19625769294deed5", "score": "0.7447551", "text": "function updateProgress() {\n if (audio.currentTime == audio.duration) {\n pauseAudio();\n resetAudio();\n }\n progressBar.value = audio.currentTime / audio.duration;\n currentTime.innerHTML = formatTime(audio.currentTime);\n totalTime.innerHTML = formatTime(audio.duration);\n\n // Save progress to local storage\n localStorage.setItem(filename, audio.currentTime);\n }", "title": "" }, { "docid": "cea1344dc6563ab24d28a2fa233039e9", "score": "0.7435312", "text": "function OnProgress(event, position, total, percentComplete)\n {\n \tprogressbar.width(percentComplete + '%') //update progressbar percent complete\n \tstatustxt.html(percentComplete + '%'); //update status text\n }", "title": "" }, { "docid": "1a5e7662fcf8acff16374ee5602362ca", "score": "0.7411592", "text": "updateLoadingBar() {\n let loadBarMsg = document.getElementById(\"loadingBarMsg\");\n let n1 = this.currentLoadedImages;\n let n2 = this.totalImages;\n let pc = (100 * n1 / n2).toFixed(2) + '%';\n loadBarMsg.innerHTML = `Cargando: ${pc} (${n1}/${n2})`;\n let loadBar = document.getElementById(\"loadingBarPercent\");\n loadBar.style.width = pc;\n }", "title": "" }, { "docid": "7526d545bafebaaf53373fe257add0fa", "score": "0.73996377", "text": "_updateProgress(t) {\n this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\n }", "title": "" }, { "docid": "0b17879d72199736ce9a5ddd6824c335", "score": "0.73959875", "text": "updateProgress() {\n if (this.width === 0 || this.width === 100 || !this.options.timeOut) {\n return;\n }\n const now = new Date().getTime();\n const remaining = this.hideTime - now;\n this.width = (remaining / this.options.timeOut) * 100;\n if (this.options.progressAnimation === 'increasing') {\n this.width = 100 - this.width;\n }\n if (this.width <= 0) {\n this.width = 0;\n }\n if (this.width >= 100) {\n this.width = 100;\n }\n }", "title": "" }, { "docid": "0b17879d72199736ce9a5ddd6824c335", "score": "0.73959875", "text": "updateProgress() {\n if (this.width === 0 || this.width === 100 || !this.options.timeOut) {\n return;\n }\n const now = new Date().getTime();\n const remaining = this.hideTime - now;\n this.width = (remaining / this.options.timeOut) * 100;\n if (this.options.progressAnimation === 'increasing') {\n this.width = 100 - this.width;\n }\n if (this.width <= 0) {\n this.width = 0;\n }\n if (this.width >= 100) {\n this.width = 100;\n }\n }", "title": "" }, { "docid": "0b17879d72199736ce9a5ddd6824c335", "score": "0.73959875", "text": "updateProgress() {\n if (this.width === 0 || this.width === 100 || !this.options.timeOut) {\n return;\n }\n const now = new Date().getTime();\n const remaining = this.hideTime - now;\n this.width = (remaining / this.options.timeOut) * 100;\n if (this.options.progressAnimation === 'increasing') {\n this.width = 100 - this.width;\n }\n if (this.width <= 0) {\n this.width = 0;\n }\n if (this.width >= 100) {\n this.width = 100;\n }\n }", "title": "" }, { "docid": "0b17879d72199736ce9a5ddd6824c335", "score": "0.73959875", "text": "updateProgress() {\n if (this.width === 0 || this.width === 100 || !this.options.timeOut) {\n return;\n }\n const now = new Date().getTime();\n const remaining = this.hideTime - now;\n this.width = (remaining / this.options.timeOut) * 100;\n if (this.options.progressAnimation === 'increasing') {\n this.width = 100 - this.width;\n }\n if (this.width <= 0) {\n this.width = 0;\n }\n if (this.width >= 100) {\n this.width = 100;\n }\n }", "title": "" }, { "docid": "da3a716656150a057f4d79b16d45cef2", "score": "0.73875904", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "da3a716656150a057f4d79b16d45cef2", "score": "0.73875904", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "da3a716656150a057f4d79b16d45cef2", "score": "0.73875904", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "da3a716656150a057f4d79b16d45cef2", "score": "0.73875904", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "b5e365bd81c0c2727beed679a21606f0", "score": "0.73754704", "text": "function updateProgressBar(callback, bar, value){\r\n bar.width(value.toFixed(2)+'%');\r\n if (value>=99) {\r\n clearInterval(callback);\r\n }\r\n\r\n bar.text(value.toFixed(2)+'%');\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "2e3b98f62eb4f76f273d3e974c707838", "score": "0.7374458", "text": "function updateProgressBarGUI(bytesTransferred) { \r\n\t\t//if (bytesTransferred > lastUploadedSize) {\r\n\t\tvar now = new Date().getTime() / 1000.0; // seconds\r\n\t\tvar uploadTransferRate = bytesTransferred / (now - uploadStartTime);\r\n\t\tvar timeRemaining = (totalFileSize - lastUploadedSize) / uploadTransferRate;\r\n\t\t\r\n\t\t//if (totalFileSize > 5242880) //if greater than 5 megabytes - slow down checks to every 5 seconds\r\n\t\t//\tcurrentRate = 500;\r\n\t\t\r\n\t \r\n\t\tlastUploadedSize = bytesTransferred;\r\n\t\tlastProgressUpdate = now;\r\n\t\tvar progress = (0.0 + lastUploadedSize) / totalFileSize;\r\n\t\tvar percentComplete = Math.round(100 * progress);\r\n\t\t\r\n\t\tvar timeLeft = timeRemaining;\r\n\t\t\r\n\t\t/*\r\n\t\t * This modifies the server connection frequency based on the progress rate of the upload\r\n\t\t * So for large files it will slow down progress update checks - or for network glitches which\r\n\t\t * slow and speed up transfer, it will adjust the rate accordingly.\r\n\t\t */\r\n\t\tvar rateModifier = 3;\r\n\t\tif(previousPercentComplete > 0) {\r\n\t\t\tif( (percentComplete - previousPercentComplete) < rateModifier ) {\r\n\t\t\t\t//If less than 3% change - slow down the checks\r\n\t\t\t\tupdateRate += 500;\t\r\n\t\t\t}else if( ((percentComplete - previousPercentComplete) > rateModifier) && (updateRate > 1000) ) {\r\n\t\t\t\tupdateRate -= 500;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpreviousPercentComplete = percentComplete;\r\n\t\r\n\t\t//jQuery(\"#errorlog\").text(updateRate);\r\n\t\t\r\n\t\tvar totalStr = Math.round(totalFileSize / 1024); //changed to kilobytes\r\n\t\t\r\n\t\tif(progress && progress > 0) {\r\n\t\r\n\t\t\tprogressBarGraphic.width(barwidth * progress);\r\n\t\t}\r\n\t\t\t\r\n\t\tvar ptext = percentComplete + '% completed (' +\r\n\t\t\t\t\t\tformatSize(lastUploadedSize) + ' of ' +\r\n\t\t\t\t\t\tformatSize(totalFileSize) + ')';\r\n\t\t\r\n\t\tptext += '<br>Estimated time remaining: ' + formatTime(timeLeft);\r\n\t\tptext += '<br>Transfer rate: ' + formatSize(uploadTransferRate) + \" / second \";\r\n\t\t\r\n\t\tprogressBarTextDiv.html(ptext);\r\n\t}", "title": "" }, { "docid": "0b2c2fbd0cc270b6786e2dbb74709246", "score": "0.7361931", "text": "function updateProgressBar() {\n // Work out how much of the media has played via the duration and currentTime parameters\n var percentage = Math.floor((100 / player.duration) * player.currentTime);\n // Update the progress bar's value\n progressBar.value = percentage;\n // Update the progress bar's text (for browsers that don't support the progress element)\n progressBar.innerHTML = percentage + '% played';\n }", "title": "" }, { "docid": "69f170ada92c4e6fe084a7a341c11692", "score": "0.7351402", "text": "_onProgressUpdate() {\n\n }", "title": "" }, { "docid": "3abf2e6cdbe8852677ea52cc57f37a66", "score": "0.7337262", "text": "function updateProgressBar (currentT, durationT) {\n \n bar = (currentT*($('.timeLine').width()))/durationT; \n $('.playHead').css(\"width\", + bar + \"px\");\n \n }", "title": "" }, { "docid": "95fa89e05852ed538cdb7c1c1181bad9", "score": "0.73191077", "text": "update() {\n\n\t\t// Update progress if enabled\n\t\tif( this.Reveal.getConfig().progress && this.bar ) {\n\n\t\t\tlet scale = this.Reveal.getProgress();\n\n\t\t\t// Don't fill the progress bar if there's only one slide\n\t\t\tif( this.Reveal.getTotalSlides() < 2 ) {\n\t\t\t\tscale = 0;\n\t\t\t}\n\n\t\t\tthis.bar.style.transform = 'scaleX('+ scale +')';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "759f835184f5810e3aa3d8b8ce639735", "score": "0.7308453", "text": "function update_browse_progress_bar(current, max) {\n current += 1;\n let perc = Number(Math.round((current / max) * 100));\n // changes length of highlighted part of bar\n $(\"#positive_progress\").attr(\"style\", \"width: \" + perc + \"%\");\n // writes which card is shown inside the bar\n $(\"#positive_progress\").text(current + \" / \" + max);\n}", "title": "" }, { "docid": "47cb1d2c36358960d95a9f6e671428e6", "score": "0.72963613", "text": "function onProgress(currentTime) {\n\t// Update the progress bar\n\t$(\".progress-bar\").attr(\"aria-valuenow\", currentTime);\n\t$(\".progress-bar\").css(\"width\", currentTime * $(\".progress\").width() / $(\".progress-bar\").attr(\"aria-valuemax\"));\n\n}", "title": "" }, { "docid": "82365af859f867a79ac7074adb1cec7a", "score": "0.7292129", "text": "function run_progress_update() {\n // early exit if and instance of the update function is already running.\n if (session.updating_progress) {\n return;\n }\n\n session.updating_progress = true;\n while (session.progress_queue.length) {\n progress = session.progress_queue[0];\n session.progress_queue.shift();\n\n // Functions defined in view/progress.js\n progress_update_bar(progress);\n progress_update_table(progress);\n progress_update_det_summary(progress);\n }\n session.updating_progress = false;\n}", "title": "" }, { "docid": "e0eca3ffe1f5688bf7b5e300aab4c8fd", "score": "0.72831404", "text": "onProgressUpdate(progress) {\n this.progress = ~~(progress * (this.width - (this.padding * 2)));\n this.invalidate = true;\n }", "title": "" }, { "docid": "1d46887b67da00ed17e5990771750276", "score": "0.7280441", "text": "function updateProgress( evt )\n {\n // evt is an ProgressEvent.\n if ( evt.lengthComputable )\n {\n var percentLoaded = Math.round( ( evt.loaded / evt.total ) * 100 );\n // Increase the progress bar length.\n if ( percentLoaded < 100 )\n {\n progress.style.width = percentLoaded + '%';\n progress.textContent = percentLoaded + '%';\n }\n }\n }", "title": "" }, { "docid": "a5c2adb10280555dc58c71c2bd669511", "score": "0.7276584", "text": "function updateProgressBar(e){\n console.log(e);\n}", "title": "" }, { "docid": "641b2d2a454f3a035319de19113d1a80", "score": "0.72674644", "text": "function updateBar(){\n\tif(player){\n\t\tif(player.getPlayerState()==1){\n\t\t\tvar playerTime\t\t= (player.getCurrentTime()*100)/player.getDuration();\n\t\t\tdocument.getElementsByClassName(\"playerViewed\")[0].style.width\t= playerTime+\"%\";\n\t\t\tdocument.getElementsByClassName(\"playerProgressTime\")[0].innerHTML\t= fancyTimeFormat(player.getCurrentTime().toFixed(0));\n\t\t\tsetTimeout(updateBar, 500);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5343ae71ff150d9d244e80373322ae51", "score": "0.72667354", "text": "function updateProgress()\r\n\t{\r\n\t\tvar currentsize = 0;\r\n\t\tvar totalsize = 0;\r\n\t\tvar pt = $(\"#dnd_progresstotal\");\r\n\r\n\r\n\t\tif ( uploadAborted != true )\r\n\t\t{\r\n\t\t\tfor ( var i = 0, fileItem; fileItem = fileArray[i]; i++ )\r\n\t\t\t{\r\n\t\t\t\tcurrentsize += fileItem[FA_LOADED];\r\n\t\t\t\ttotalsize += fileItem[FA_TOTALSIZE];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// this happens on a full abort, see IE10 support\r\n\t\t\ttotalsize = 1;\r\n\t\t\tcurrentsize = 1;\r\n\t\t}\r\n\r\n\t\tif ( totalsize != 0 )\r\n\t\t{\r\n\t\t\t// Dont reset the total size if the value is 0 since it prematurely\r\n\t\t\t// trigger the status dialog.\r\n\t\t\tpt.progressbar({ max: totalsize });\r\n\t\t}\r\n\t\tpt.progressbar('value', currentsize);\r\n\t}", "title": "" }, { "docid": "89256d6730bac4cdbd764fccd2b9740e", "score": "0.72472405", "text": "function updateProgress() {\n var trackPos;\n var progressPos;\n\n trackPos = sound.seek() || 0;\n progressPos = (((trackPos / sound.duration()) * 100) || 0);\n\n document.getElementById('progressbar-two').style.width = progressPos + '%';\n document.getElementById('time-left').innerHTML = convertTime(trackPos);\n\n if(sound.playing() == true) {\n requestAnimationFrame(updateProgress);\n }\n}", "title": "" }, { "docid": "f9ff34a1cb803f4bc203a4a56aa009c4", "score": "0.72409856", "text": "function updateProgressBar(e) {\n const { duration, currentTime } = e.srcElement;\n const progressPercentage = (currentTime / duration) * 100;\n progress.style.width = `${progressPercentage}%`;\n}", "title": "" }, { "docid": "e9f511bc9d68d27f5fa1597657062074", "score": "0.72365564", "text": "function update_progress(index, total){\n var percent = ((index) / total) * 100;\n percent = Math.round(percent);\n document.getElementById(\"progress_bar\").style.width = percent + \"%\";\n document.getElementById(\"progress_bar\").textContent = percent + \"%\";\n}", "title": "" }, { "docid": "cb64ada535e331849257679d39c7f29c", "score": "0.72319293", "text": "function updateProgress(evt) {\n\t\t// evt is a ProgressEvent.\n\t\tif (evt.lengthComputable) {\n\t\t\tvar percentLoaded = Math.round((evt.loaded / evt.total) * 100);\n\t\t\t\n\t\t\t// Increase the progress bar length.\n\t\t\tif (percentLoaded < 100) {\n\t\t\t\tprogress.style.width = percentLoaded + '%';\n\t\t\t\tprogress.textContent = percentLoaded + '%';\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3aa05e837d5ac258afef2281d817960a", "score": "0.7221692", "text": "function progressBar( elem ) {\n\t\t\t$elem = elem;\n\t\t\t//build progress bar elements\n\t\t\tbuildProgressBar();\n\t\t\t//start counting\n\t\t\tstart();\n\t\t}", "title": "" }, { "docid": "fa61042ad05cab8001ee0eaacf83a196", "score": "0.7209982", "text": "function updateProgress(){\r\n //Target progress bar element to change it's with dinamicaly usong the resulting\r\n // percentage of deviding the videos current time by its duration.\r\n progressBar.style.width =`${(video.currentTime / video.duration) * 100}%`\r\n let time = video.currentTime;\r\n currentTime.textContent = `${displayTime(time)} /`;\r\n duration.textContent = `${displayTime(video.duration)}`;\r\n}", "title": "" }, { "docid": "3e8240bc244de20b3a61f164db5530f1", "score": "0.7184573", "text": "function progressUpdate()\n{\n //the percentage loaded based on the tween's progress\n loadingProgress = Math.round(progressTl.progress() * 100);\n \n //we put the percentage in the screen\n $(\".txt-perc\").text(loadingProgress + '%');\n \n}", "title": "" }, { "docid": "a21ff86cfb884d669ac6c6ee95933142", "score": "0.7184065", "text": "function updateProgessBar(e) {\n if (isPlaying) {\n const { duration, currentTime } = e.srcElement;\n\n // Updaate progress bar width\n const progressPercent = (currentTime / duration) * 100;\n progress.style.width = `${progressPercent}%`;\n // Calculate display for duration\n const durationMinutes = Math.floor(duration / 60);\n //delay switching duation element to avoid nan\n let durationSeconds = Math.floor(duration % 60);\n if (durationSeconds < 10) {\n durationSeconds = `0${durationSeconds}`;\n }\n if (durationSeconds) {\n durationEl.textContent = `${durationMinutes}:${durationSeconds}`;\n }\n //calculate display for current\n const currentMinutes = Math.floor(currentTime / 60);\n let currentSeconds = Math.floor(currentTime % 60);\n if (currentSeconds < 10) {\n currentSeconds = `0${currentSeconds}`;\n }\n currentTimeEl.textContent = `${currentMinutes}:${currentSeconds}`;\n }\n}", "title": "" }, { "docid": "c7f7d29b43c52eea91562a06028c8638", "score": "0.71782607", "text": "function updateProgress(){\n var percentProgress = Math.ceil((ClickCount / noOfImages)*100);\n var remaining = noOfImages - ClickCount; //Math.round(((ClickCount / noOfImages)*100)*100)/100;\n document.getElementById(\"testProgressBar\").style.width = percentProgress+\"%\";\n document.getElementById(\"testProgressBarLabel\").innerHTML = percentProgress+\"% Complete. \"+ClickCount+\"/\"+noOfImages+\" (\"+remaining+\" remaining)\"\n}", "title": "" }, { "docid": "503a0059070032ab9123c0168957543a", "score": "0.71751106", "text": "function update_upload_progress (upload_progress) {\n var percentage = upload_progress.percentage;\n if (percentage <= 0) {\n $('.progress-bar').css(\"width\", percentage + \"%\").text(\"Starting\");\n } else {\n $('.progress-bar').css(\"width\", percentage + \"%\").text(\"Uploading: \" + percentage + \" %\");\n }\n}", "title": "" }, { "docid": "9e9b29b929a54e441ed4fd758c14f1e6", "score": "0.7164199", "text": "function updateProgress() {\n progressBar.style.width = `${(video.currentTime / video.duration) * 100}%`;\n\n currentTime.textContent = displayTime(video.currentTime);\n duration.textContent = displayTime(video.duration);\n}", "title": "" }, { "docid": "3361564f4b1ac5d69763c68a03f1f740", "score": "0.7163199", "text": "function UpdateVideoProgressBarData(){\n data.videoPlayOutTimeText = VideoController.getPlayoutTime(VideoController.getListOfVideoContents()[0].vid.currentTime);\n data.playScaleX = updatePlayProgressScale();\n data.sliderPositionX = updateSliderPosition();\n data.playPositionX = updatePlayProgressPosition();\n }", "title": "" }, { "docid": "943bd1b2bd63c1a6a6ea948c812c5f7f", "score": "0.7156626", "text": "function progressUpdate()\n{\n //the percentage loaded based on the tween's progress\n loadingProgress = Math.round(progressTl.progress() * 100);\n //we put the percentage in the screen\n $(\".txt-perc\").text(loadingProgress + '%');\n\n}", "title": "" }, { "docid": "d42e3475afe274fedd4bf5231b3ca0b1", "score": "0.71558696", "text": "updatePieProgress(amount) {\n\n }", "title": "" }, { "docid": "bc5e540c628c0466c208b0dc7eec95b3", "score": "0.7154874", "text": "function updateProgress(){\r\n d3.select('#totalProgress').attr('value', currentBranch+1);\r\n d3.select('#subProgress').attr('value', currentScore);\r\n}", "title": "" }, { "docid": "8a490e827edfd16498e8bcaaef0bf363", "score": "0.7140783", "text": "function updateAnimationProgressmeter() {\n\tif(!scenes[CM_ACTIVEID]._anim)\n\t\treturn;\n\t\n\tvar p = scenes[CM_ACTIVEID].getAnimationPosition();\n\t$(\"#ap-progress\").width((document.getElementById(\"ap-wrapper\").clientWidth - 1)/100*p + \"px\");\n\t\n\tif(p < 100)\n\t\twindow.requestAnimationFrame(updateAnimationProgressmeter);\n\telse {\n\t\tif(scenes[CM_ACTIVEID].replayOnFinishAnimation) {\n\t\t\t$(\"#ap-progress\").width(0 + \"px\");\n\t\t\tscenes[CM_ACTIVEID].setAnimationPosition(0);\n\t\t\tscenes[CM_ACTIVEID].playAnimation();\n\t\t\twindow.requestAnimationFrame(updateAnimationProgressmeter);\n\t\t}\n\t\telse\n\t\t\tpauseAnimation();\n\t}\n}", "title": "" }, { "docid": "8c16b719f5b0f759f63e8f02dbd09dbe", "score": "0.71360135", "text": "function progressBar() {\n\tvar oAudio = document.getElementById('myaudio');\n\t// get current time in seconds\n\tvar elapsedTime = Math.round(oAudio.currentTime);\n\tdocument.getElementById('songtime').textContent = secondToTime(elapsedTime)\n\t\t\t+ \"/\" + audioList[currentIndex].songTime;\n\t// update the progress bar\n\tif (canvas.getContext) {\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\t// clear canvas before painting\n\t\t// ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n\t\tctx.fillStyle = \"rgb(230,230,230)\";\n\t\tctx.fillRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n\t\tctx.fillStyle = \"rgb(250,0,0)\";\n\t\tvar fWidth = (elapsedTime / oAudio.duration) * (canvas.clientWidth);\n\t\tif (fWidth > 0) {\n\t\t\tctx.fillRect(0, 0, fWidth, canvas.clientHeight);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e4d7a429539e40e361903ed8ef34d23", "score": "0.71322536", "text": "function progress() {\n progressBar.innerHTML = Math.round((doneCount/totalCount) * 100) + \"% complete!\";\n}", "title": "" }, { "docid": "335da8424c82b6724f6d9cfedf684ba6", "score": "0.71234155", "text": "function progressBar(elem){\n $elem = elem;//build progress bar elements\n buildProgressBar();\n start();//start counting\n }", "title": "" }, { "docid": "13084d30d92b5705f32dbde484848ee7", "score": "0.71135545", "text": "function updateProgressValue() {\n progressBar.max = song.duration;\n progressBar.value = song.currentTime;\n document.querySelector('.currentTime').innerHTML = (formatTime(Math.floor(song.currentTime)));\n if (document.querySelector('.durationTime').innerHTML === \"NaN:NaN\") {\n document.querySelector('.durationTime').innerHTML = \"0:00\";\n } \n else {\n document.querySelector('.durationTime').innerHTML = (formatTime(Math.floor(song.duration)));\n }\n}", "title": "" }, { "docid": "4100f436c7d358bb544f7c20f47c1ade", "score": "0.71009827", "text": "function updateProgress(currentStep) {\r\n var percentage = ((currentStep * 100) / sizeOfForm);\r\n var result = Math.floor(percentage);\r\n $('.progress-bar').css('width', result + '%').attr('aria-valuenow', result);\r\n document.getElementById(\"progress-number\").innerHTML = result + \"%\";\r\n //console.log(\"Passo \" + currentStep + \": \" + result);\r\n}", "title": "" }, { "docid": "199982bd26f368ca8c0110e0b208566f", "score": "0.7099917", "text": "function progressBar() {\n //Data reload progress bar style behavior initialization\n NProgress.configure({ \n ease: 'ease', \n trickleRate: 0.02,\n trickleSpeed: 50,\n showSpinner: false,\n minimum: 0.3,\n });\n }", "title": "" }, { "docid": "14ecb761952e54abe58394e01f10bb77", "score": "0.70970315", "text": "__update () {\r\n const percentage = Math.round((this.trackingValue/this.goalValue) * 100) + '%';\r\n this.fillElem.style.width = percentage;\r\n this.valueElem.textContent = percentage;\r\n }", "title": "" }, { "docid": "bb37e2df873f2e04176081331577d908", "score": "0.7088444", "text": "function progressFunc() {\r\nlet timeProgress = song.currentTime / song.duration;\r\nfillBar.style.width = timeProgress * 100 + '%';\r\ncurrTime.firstChild.nodeValue = timeFormatted(song.currentTime); //\r\nremainTime.firstChild.nodeValue = timeFormatted(song.duration-song.currentTime); // \r\n}", "title": "" }, { "docid": "d0d72eec46111e11d796c2ee405ed7be", "score": "0.7086006", "text": "function updateProgress(){\n progressBar.style.width = `${(video.currentTime/video.duration)*100}%`;\n console.log('currentTime', video.currentTime, 'duration', video.duration);\n currentTime.textContent = `${displayTime(video.currentTime)} / `;\n duration.textContent = `${displayTime(video.duration)}`;\n}", "title": "" }, { "docid": "9c2377b935803aad52881825c76fc8d9", "score": "0.7082232", "text": "function progressBar(elem){\n\t\t $elem = elem;\n\t\t //build progress bar elements\n\t\t buildProgressBar();\n\t\t //start counting\n\t\t start();\n\t\t}", "title": "" }, { "docid": "9068137f096e6dd17a96a989bf457f4c", "score": "0.7074863", "text": "function updateImpact(progress) {\n\n }", "title": "" }, { "docid": "91e2db3bfc5012ee33b547bf6615ca2b", "score": "0.70634085", "text": "function progressBar(elem) {\n\t\t\t$elem = elem;\n\t\t\t//build progress bar elements\n\t\t\tbuildProgressBar();\n\t\t\t//start counting\n\t\t\tstart();\n\t\t}", "title": "" }, { "docid": "42125e9022866ad5e1071072bba207ec", "score": "0.7062935", "text": "animateProgressBar() {\n const self = this;\n const loadingBar = document.getElementById('hg-progress');\n if (loadingBar !== null) {\n const percentage = self.state.currentFrame / self.state.amountFrames * 100;\n loadingBar.setAttribute('width', percentage + '%');\n }\n }", "title": "" }, { "docid": "7f98ea15d7f09b018ccb8d1dbf1a63cb", "score": "0.70589024", "text": "function updateProgress(e){\r\n \r\n const currentTime = e.srcElement.currentTime;\r\n const totalTime = e.srcElement.duration;\r\n \r\n const progressPercent = (currentTime/totalTime)*100;\r\n progress.style.width = `${progressPercent}%`; \r\n \r\n }", "title": "" }, { "docid": "470c0f9e477100bfcdb3330f2ae0c54d", "score": "0.70426977", "text": "progress() {\n\t}", "title": "" }, { "docid": "589c7e9d2bd8c38f426be7255996e961", "score": "0.703739", "text": "function updateDownloadProgress() {\n if (progress < 100) {\n // update progress in steps of 25\n progress += 25;\n $progressBar.css('width', progress + '%');\n\n // continue the animation\n setTimeout(updateDownloadProgress, 800);\n } else {\n // deck is now owned by user\n deck.owned = true;\n\n // force angular to update the search results\n $scope.$apply();\n\n // hide the progress bar\n $progressBar.parent().hide();\n\n /// change title of modal\n $downloadModal.find('#title').html('Download Complete');\n\n // hide the modal after 1.5s\n setTimeout(function() {\n $downloadModal.modal('hide');\n $progressBar.css('width', '0%');\n }, 1500);\n }\n }", "title": "" }, { "docid": "4e132313b2abb870d483bba38c20abd4", "score": "0.7032052", "text": "function updateProgressBar(event) {\n var currentTime = parseInt(player.currentTime, 10);\n currentTimeContainer.innerText = secToTime(currentTime);\n // Work out how much of the media has played via the duration and currentTime parameters\n var percentage = Math.floor((100 / player.duration) * player.currentTime);\n if (!percentage) {\n return;\n }\n // Update the progress bar's value\n progressBar.value = percentage;\n // Update the progress bar's text (for browsers that don't support the progress element)\n // progressBar.innerHTML = progressBar.title = percentage + '% played';\n }", "title": "" }, { "docid": "64828f6b1f7843fc3b36e40ed85b320f", "score": "0.7031817", "text": "function handleProgress() {\n\t$('.percentIndicator').css('width',Math.round(loader.progress/1*98)+'%');\n}", "title": "" }, { "docid": "c150f160201febe0013233dac4698a2f", "score": "0.702956", "text": "function updateProgress(e) {\n if (e.lengthComputable) {\n document.getElementById('pro').setAttribute('value', e.loaded);\n document.getElementById('pro').setAttribute('max', e.total);\n };\n }", "title": "" }, { "docid": "59887bb0ef46213b03acb599d85e657d", "score": "0.70187694", "text": "function barProgression() {\n \n // Variable created for slider reference \n sliderCounter = sliderCounter + 1;\n \n if (width < 100) {\n width = width + 5; \n }\n if (width > 100) {\n width = 100;\n }\n \n bar.style.width = width + '%'; \n bar.innerHTML = width * 1 + '%';\n }", "title": "" } ]
d7408b3380e2761b070629a63207a854
changes value of lives on screen, when lives is equal to zero end game
[ { "docid": "af35e75bbd53081f5e132e05e86aa35f", "score": "0.7539447", "text": "function lose_life() {\n var lives_element = get_lives() - 1\n $(\".lives_value\").text(lives_element)\n\n if (lives_element === 0) {\n end_game()\n }\n}", "title": "" } ]
[ { "docid": "bcdeb31e7cf42d567c0a05baca279c9d", "score": "0.7597096", "text": "function livesCont(){\n document.getElementById('lives').innerHTML = lives; // displaying the lives to the canvas\n \n if(ball.y > canvas.height - ball.r){\n lives -= 1;\n console.log(\"Lives left: \" + lives);\n } // decrements lives if the ball hits the bottom of the canvas\n \n if(lives === 0){\n clear();\n }\n}", "title": "" }, { "docid": "5a047cf58b4b6104433533090fbd2f06", "score": "0.71493316", "text": "function subtractLife(){\n\t\tlives--;\n\n\t\t//displays on screen. Refer to visuals.js\n\t\tupdateLives(lives);\n\t}", "title": "" }, { "docid": "fffdfab5b817602d6a8dc7ca26577f00", "score": "0.7041745", "text": "lifeLost() {\n if (gameInstance.currentGameMode.mode === 'multi') {\n this.isFreeze = true;\n }\n this.lives -= 1;\n this.lifeLostFlag = true;\n }", "title": "" }, { "docid": "e400a974f626ff5429fcf09194aaf851", "score": "0.70075667", "text": "function updateLives(lives) {\n lives -= 1;\n $(\"#lives\").text(lives + \" lives left!\");\n\n return lives;\n}", "title": "" }, { "docid": "fc81c25fbdddc33a1da63783153d1252", "score": "0.70002407", "text": "death() {\n this.x = 200;\n this.y = 380;\n stats.lives = stats.lives - 1;\n\n if (stats.lives === 0) {\n stats.endGame(\"gameover\");\n }\n }", "title": "" }, { "docid": "ed48bcb9287cc92461a0edb65fceb31c", "score": "0.69423693", "text": "function hasLives() {\n lives && --lives;\n !lives && gameOver();\n resetBallAndPaddle();\n}", "title": "" }, { "docid": "e7caef3d2b3c2f1d65fb5c3b0f0b0c3f", "score": "0.69383764", "text": "update() {\n if (this.checkIfPicked()) {\n menuStats.livesNumber ++;\n document.getElementById('livesNumber').textContent = menuStats.livesNumber;\n\n menuStats.score += this.points;\n document.getElementById('score').textContent = menuStats.score;\n\n this.onscreen = false;\n }\n }", "title": "" }, { "docid": "e35b5a4482a608949518e92442e6312c", "score": "0.68942577", "text": "function livesLost() {\n console.log(lives)\n for(let x = 0; x < alienMissile.position.length; x++) {\n if (alienMissile.position[x] === ship.position) {\n playExplosion.play()\n lives = lives - 1\n $('#lives').text('Lives: ' + lives)\n\n alienMissile.position.splice(x, 1)\n\n if (lives === 0) {\n clearInterval(alienTimer)\n clearInterval(missileTimer)\n clearInterval(alienAttackTimer)\n gameOver = true\n $('#game-over-score').text(score)\n $('.game').hide()\n $('.game-over').css('display', 'flex')\n }\n return\n }\n }\n }", "title": "" }, { "docid": "f348122a23706cc87e1472f88a022ea3", "score": "0.68177676", "text": "function checkPlayerDie(){\n if(gameChar_y > height + 70\n && gameChar_y < height + 75)\n {\n lives -= 1;\n \n if(lives < 1){\n isPlummeting = false;\n lives = 0;\n game_over = true;\n }\n else if(lives >= 1){\n console.log('lost life: -1'); \n startGame();\n }\n }\n}", "title": "" }, { "docid": "190ab4df75a049e7ba231029a852a7b8", "score": "0.6802164", "text": "function loseLife() {\n state.lives -= 1;\n }", "title": "" }, { "docid": "424f9bec85b7c726bb3fdc2a7206b1b8", "score": "0.67896974", "text": "function remainingLives(){\n life--;\n if (life < 1) {\n gameReset();\n }\n}", "title": "" }, { "docid": "a61a8c063dfa8354dbc06ccad64f8650", "score": "0.67446446", "text": "function decrement_life() {\n life--;\n life_span.text(life);\n if(life < 0) {\n life_span.text('0');\n }\n}", "title": "" }, { "docid": "359cd583f0fe9d67cd511485b25f103a", "score": "0.6685417", "text": "function checkPlayerDie() {\n fill(255);\n\n // player lost a life \n if (gameChar_y > height + 70) {\n lives -= 1;\n\n if (lives > 0) {\n startGame();\n }\n }\n if (lives < 0) {\n fill(255, 0, 0);\n textSize(40);\n text(\"GAME OVER. Press space to continue.\", width / 2 - 300, height / 2);\n return;\n }\n}", "title": "" }, { "docid": "6e6dc55858bc8b8b9a729f2f3096da0e", "score": "0.6584774", "text": "function newGame() {\n //removing startMenu screen\n startMenuElement.classList.add('hide')\n //removing GameOver screen\n gameOverElement.classList.remove('show')\n //resetting game\n car.score = 0;\n car.x = 0;\n car.y = 0;\n car.xSpeed = 0;\n car.ySpeed = 0;\n ctx.clearRect(0,0, canvas.width, canvas.height);\n car.lives = 3;\n lifeCounter();\n bonusliveschance = 0;\n enemiesbonuschance = 0;\n enemiesbonuschance2 = 0;\n //relaunching game\n SETUP;\n\n //checking lives reset\n console.log(car.lives)\n}", "title": "" }, { "docid": "2b557c8094ea1d96df6a17f87edc830c", "score": "0.6583115", "text": "function checkLevel2Life() {\n if (life <= 0) {\n\n $(\"#GameOverScreen\").fadeIn();\n $('#Level2').remove();\n $('#WelcomeScreen').fadeIn();\n $('.license').remove();\n $('.button_start').remove();\n $(\".score_display\").text(score);\n }\n }", "title": "" }, { "docid": "d8f05e4142432a56221bef5f8487df85", "score": "0.65646964", "text": "function perder_vida(lives){\r\n gameState.vida-=1;\r\n gameStateDino.vida=35;\r\n gameStateDino.vivo=true;\r\n\r\n gameState.scoreText.setText(`Score: ${gameState.score}`);\r\n gameStatePredator.vida=20; \r\n gameState.vidaText.setText(`Vida: ${gameState.vida}`);\r\n var array_live=lives.getChildren();\r\n var invader = Phaser.Utils.Array.RemoveAt(array_live,array_live.length-1);\r\n if (invader)\r\n {\r\n gameState.incredible.stop();\r\n invader.destroy();\r\n socket.emit(\"pierde-vida\");\r\n }\r\n}", "title": "" }, { "docid": "616f6ff818bc33121e6a983dbd51586a", "score": "0.6558207", "text": "function enemyCollision() {\n gamePause = true;\n menuStats.livesNumber --;\n document.getElementById('livesNumber').textContent = menuStats.livesNumber;\n setTimeout(checkIfGameover, 500);\n }", "title": "" }, { "docid": "73c30c2dec212b47213e942cec16778a", "score": "0.6551665", "text": "function loseLife() {\n lose--;\n $('.lose').html(`${lose}`);\n if (lose === 0) {\n $gameOver.show();\n }\n }", "title": "" }, { "docid": "65ad74c9a172b580bcabf0821d428c34", "score": "0.65362275", "text": "function decrement_life() {\n life--;\n life_span.text(life);\n}", "title": "" }, { "docid": "289f1df36f00a54a83799d090d6c58ea", "score": "0.65107", "text": "function decrementLives() {\r\n // Modifier l'image du coeur plein en coeur vide\r\n document.getElementById(\"life\" + lives).style.visibility = \"hidden\";\r\n\r\n // Decrementer le nombre de vies\r\n lives--;\r\n}", "title": "" }, { "docid": "c8617913537ef1da041f627d800f1158", "score": "0.6472095", "text": "function ballLeaveScreen() {\r\n // Decrease lives every time the ball leaves the canvas\r\n lives--;\r\n // If lives are NOT zero\r\n if (lives) {\r\n // Update lives text to show current number of lives\r\n livesText.setText(\"Lives: \" + lives);\r\n // Display life lost text\r\n lifeLostText.visible = true;\r\n // Reset ball and paddle position\r\n ball.reset(game.world.width * 0.5, game.world.height - 25);\r\n paddle.reset(game.world.width * 0.5, game.world.height - 5);\r\n // On next input, click or touch, the life lost text will be hidden\r\n // and the ball will start to move again\r\n game.input.onDown.addOnce(function () {\r\n lifeLostText.visible = false;\r\n ball.body.velocity.set(150, -150);\r\n }, this);\r\n } else {\r\n // Else number of lives is zero, game is over, and game over alert message is shown\r\n alert(\"You lost, game over!\");\r\n // When user clicks on resulting alert, the page will be reloaded so they can play again\r\n location.reload();\r\n }\r\n}", "title": "" }, { "docid": "5b04af5160a8f6c36624176d7ebcbbb2", "score": "0.6467965", "text": "function gameLoop() {\n stats.update();\n checkControls();\n stage.update();\n if (livesValue == 0 || livesValue < 0) {\n livesValue = 5;\n liveslabel.text = \"LIVES: \" + livesValue;\n scene.remove(player);\n player.position.set(0, 5, 10);\n scene.add(player);\n }\n // render using requestAnimationFrame\n requestAnimationFrame(gameLoop);\n // render the scene\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "ae8c573ee1eac9faa32b7ddb0310a795", "score": "0.64612484", "text": "function SubtractLife(){\n\tlives -= 1;\r\n}", "title": "" }, { "docid": "0e54c253f8016bd0efd0b61d1a9c05c3", "score": "0.6442789", "text": "function drawLives() {\n document.getElementById(\"vidas\").innerHTML = \" \" + lives;\n}", "title": "" }, { "docid": "d90f842b5bf9fbbe24251ee1e6d64e67", "score": "0.6436061", "text": "function checkLife() {\n\n if (life == 0) {\n clearInterval(level1Completed);\n //remove current game\n $('#Level1').remove();\n $('#WelcomeScreen').fadeIn();\n $('.license').remove();\n $('.button_start').remove();\n $(\".score_display\").text(score);\n //display game over screen\n $('#GameOverScreen').fadeIn();\n }\n}", "title": "" }, { "docid": "abf23b54ee91eda5a844eac52b0a076b", "score": "0.64306694", "text": "function totalLife (startingLife) {\n life = startingLife;\n }", "title": "" }, { "docid": "26adbe50d6c6a39df2274379100e35d2", "score": "0.64273256", "text": "function badLoseLife() {\r\n if (score<=-100) {\r\n score += 100;\r\n //scoreColor(score);\r\n vies--;\r\n }\r\n}", "title": "" }, { "docid": "ba285a5feeda51309ec93a69974c2588", "score": "0.64020354", "text": "decreaseLife(){\n if (this.state.life - 1 < 0){\n this.setState({gameState: \"gameover\"});\n }\n this.setState({life: this.state.life - 1});\n }", "title": "" }, { "docid": "2cef6fd88eed471bee737dd560ecdc05", "score": "0.63981545", "text": "reduceLives() {\n if (this.canPlay()) {\n this.update(setLives(this.state, this.state.lives - 1));\n }\n }", "title": "" }, { "docid": "c2b99423465bfa39445432f923c8e6a8", "score": "0.63926107", "text": "setScore (points){\n this.gameState.score += points; \n }", "title": "" }, { "docid": "684da1ad80fca68d2bca4caef91b2d04", "score": "0.6386224", "text": "function setlifeText(life){\nif (life==0){\ngameover.text=\"Game Over\";\nyield WaitForSeconds(1);\nApplication.LoadLevel (Application.loadedLevel);\n}\nlifetext.text=\"Life: \"+life.ToString();\n\n\t}", "title": "" }, { "docid": "70c826e63a1a1ffd1811ae86034a4194", "score": "0.6375867", "text": "function BonusLife(){\n\tif((score % 10000) == 0 && frog.lives < 5){\n\t\tfrog.lives++;\n\t}\n}", "title": "" }, { "docid": "c07a892ac49f21b448322a21af4e3c6a", "score": "0.63644457", "text": "function loseLives() {\n player.lives--;\n updateLives();\n if (player.lives === 0) {\n gameEnded = true;\n reset();\n }\n }", "title": "" }, { "docid": "b35a0bbc652343334af93bf899bdbeb9", "score": "0.63616776", "text": "function checkLost() {\n if (lives <= 0) {\n document.getElementById(\"messageBox\").innerHTML = \"You have LOST! Press PLAY!\";\n losses++;\n setState = \"dead\";\n }\n }", "title": "" }, { "docid": "4ced8ee35a9a3c4a4536dd5b169cffb2", "score": "0.6361242", "text": "function main() {\n\t\t\n\t\tdocument.getElementById(\"lives\").innerHTML= \"Remaining Lives: \" + lives;\n\t\tdocument.getElementById(\"score\").innerHTML= \"Score: \" + totalScore;\n\t\tdocument.getElementById(\"bacteria\").innerHTML= \"Remaining Bacteria: \" + bacteriaLeft;\n\t\t//If game isn't won and player still has lives, game continues \n\t\tif(!win() && lives > 0) {\n\t\t\tfor (let i in bacteria) {\n\t\t\t\tbacteria[i].refreshState();\n\t\t\t\t//if player has no more lives, bacteria left is set to 0 and loop breaks \n\t\t\t\t\tif (loss()) {\n\t\t\t\t\t\tbacteriaLeft = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tloss();\n\t\t\t}\n\t\tdrawSurface(0,0,0.8,[0.6, 0.8, 1.0, 1.0]);\n\t\trequestAnimationFrame(main);\n\t}", "title": "" }, { "docid": "6f821a9140adcf0ab425a5f28839ae0e", "score": "0.6342958", "text": "function hitTombstone (player, stone) {\r\n player.body.velocity.x = player.body.velocity.x * -1;\r\n player.body.velocity.y = player.body.velocity.y * -1;\r\n playerLives = playerLives - 1;\r\n livesText.text = \"Lives: \" + playerLives;\r\n if (playerLives == 0) {\r\n game.state.restart();\r\n }\r\n}", "title": "" }, { "docid": "d8b98dbe6d48f54fd14eebe5c2bbeae0", "score": "0.6338674", "text": "function updateCounter()\n {\n maxEnemies += 2;\n \n }", "title": "" }, { "docid": "b31ddd3568a0b4dd55dbf8d17e9347f2", "score": "0.6320961", "text": "loseOneLife() {\n this.sendHome();\n this.livesLeft--;\n scoreboard.render();\n\n // if he lost his last life, game over\n if (this.livesLeft <= 0) {\n sfxGameOver.playIfNotMuted();\n endGame();\n } else {\n sfxZap.playIfNotMuted();\n }\n }", "title": "" }, { "docid": "65dc52e4664feadbf06536ec86499580", "score": "0.631268", "text": "function checkLives(){\r\n\tif(lives == 0){\r\n\t\tplaying = false;\r\n\t\tnoLives = true;\r\n\t}\r\n}", "title": "" }, { "docid": "3d2465bcde725b8c94aa38c1a655d93c", "score": "0.63072705", "text": "function checkEnd(){\n if(alienArray.length === 0 ){\n clearInterval(gameTimerId)\n if(level<=7)delay -= 70\n level++\n startGame()\n }else if(lives <=0){\n endGame()\n }else{\n alienArray.forEach((elem)=>{\n if(elem.alienIndex+1 > div.length-(width*2)){\n endGame()\n }\n })\n }\n //userLives.innerText = lives\n }", "title": "" }, { "docid": "ee79b663c5999dbecea6e0cc1b0c10b2", "score": "0.6303621", "text": "loseLife() {\n console.log(\"You've been hit!\");\n this.lives--;\n\n this.srcX = this.explodingImgX;\n this.srcY = this.explodingImgY;\n this.srcWidth = this.explodingImgWidth;\n this.srcHeight = this.explodingImgHeight;\n this.explodingTick++;\n\n playSounds(explosion);\n if (this.lives === 0) {\n console.log(ded);\n gameOver = true;\n }\n }", "title": "" }, { "docid": "552b09dea4810d0cc939d37cd28b8f7d", "score": "0.6299964", "text": "gameOver(){\n for (var i = 0; i<this.remoteNum+1; i++){\n this.remotelist[i].active = false; \n }\n for (var k = 0; k<this.Eggnum; k++){\n this.egglist[k].active = false; \n }\n this.timelabel.string = \"\";\n this.camera.setPosition(0,0);\n \n this.button.active = true;\n this.finalscore.enabled = true;\n this.leaderboard.enabled = false;\n }", "title": "" }, { "docid": "01bcf929e512e721ed3ba916523635f7", "score": "0.6269374", "text": "function set_score( value ){\n\n // If it is zero\n if( value != 0 ){\n\n // The game continues and the score is set\n score.current += value;\n score.total += value;\n\n } else { // The game starts anew\n\n // Resets the score\n score.current = 0;\n score.total = 0;\n\n }\n\n}", "title": "" }, { "docid": "994ec4347a60565096375405c0bd35c3", "score": "0.62685686", "text": "function playerLifeCounter() {\n fill(190);\n rect(25, 25, 125, 40, 5);\n \n fill(0);\n textSize(25);\n text(\"Life : \" + playerLives, 30, 55);\n}", "title": "" }, { "docid": "456bd20685e69ca459e948950353691e", "score": "0.6268351", "text": "checkDeath() {\n if(this.lives <= 0) {\n this.isDead = true;\n this.knight.bossIsDead = true;\n }\n }", "title": "" }, { "docid": "4acc1eb4db114810cf8464f5fdc99e65", "score": "0.62625766", "text": "endOfLevel1(){\n stealer.pos.x = 100;\n livesCounter = 3;\n }", "title": "" }, { "docid": "f8e6c1ef07c0b83e844b2e217c678639", "score": "0.6261743", "text": "function updateLives(){\n\tif(lives == 0){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"hidden\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"hidden\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"hidden\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"hidden\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"hidden\";\n\t\tendGame();\n\t\tsetTimeout(function(){window.alert(\"Loser!\")},250);\n\t}\n\tif(lives==1){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"visible\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"hidden\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"hidden\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"hidden\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"hidden\";\n\t}\n\telse if(lives==2){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"visible\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"visible\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"hidden\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"hidden\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"hidden\";\n\t}\n\telse if(lives==3){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"visible\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"visible\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"visible\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"hidden\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"hidden\";\n\t}\n\telse if(lives==4){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"visible\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"visible\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"visible\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"visible\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"hidden\";\n\t}\n\telse if(lives==5){\n\t\tvar live1 = document.getElementById('heart1');\n\t\tlive1.style.visibility=\"visible\";\n\t\tvar live2 = document.getElementById('heart2');\n\t\tlive2.style.visibility=\"visible\";\n\t\tvar live3 = document.getElementById('heart3');\n\t\tlive3.style.visibility=\"visible\";\n\t\tvar live4 = document.getElementById('heart4');\n\t\tlive4.style.visibility=\"visible\";\n\t\tvar live5 = document.getElementById('heart5');\n\t\tlive5.style.visibility=\"visible\";\n\t}\n}", "title": "" }, { "docid": "091a7d7436905605f8d6e6f02d6d8636", "score": "0.6252955", "text": "function livesFunc() {\n\t\t\t--lives;\n\t\t\tlet aliveHead = document.querySelectorAll('.aliveHead');\n\t\t\tlet torso = document.querySelectorAll('.torso');\n\t\t\tlet deadHead = document.querySelectorAll('.deadHead');\n\t\t\tlet legs = document.querySelectorAll('.legs');\n\t\t\tswitch(lives) {\n\t\t\t\tcase 4:\n\t\t\t\t\tfor(let i = 0; i < aliveHead.length; i++) {\n\t\t\t\t\t\taliveHead[i].style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\tfor(let i = 0; i < deadHead.length; i++) {\n\t\t\t\t\t\tdeadHead[i].style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\tfor(let i = 0; i < torso.length; i++) {\n\t\t\t\t\t\ttorso[i].style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\tfor(let i = 0; i < legs.length; i++) {\n\t\t\t\t\t\tlegs[i].style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\tlives = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tfor(let i = 0; i < aliveHead.length; i++) {\n\t\t\t\t\t\taliveHead[i].style.display = \"initial\";\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(nextQuestion, 500);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tfor(let i = 0; i < aliveHead.length; i++) {\n\t\t\t\t\t\taliveHead[i].style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\tfor(let i = 0; i < deadHead.length; i++) {\n\t\t\t\t\t\tdeadHead[i].style.display = \"initial\";\n\t\t\t\t\t}\n\t\t\t\t\tfor(let i = 0; i < torso.length; i++) {\n\t\t\t\t\t\ttorso[i].style.display = \"initial\";\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(nextQuestion, 500);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0:\n\t\t\t\t\tfor(let i = 0; i < legs.length; i++) {\n\t\t\t\t\t\tlegs[i].style.display = \"initial\";\n\t\t\t\t\t}\n\t\t\t\t\tclearInterval(timerInterval);\n\t\t\t\t\tclearInterval(inputInterval);\n\t\t\t\t\tgameLose.play();\n\t\t\t\t\tsetTimeout(function() {myAlert((\"You Lost \" + player.name + \"!\"), (\"You Score: \" + player.score + \"<p>Time Left: \" + timeSpan.innerHTML.split(\" \")[1]));}, 500);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cfbf5777b768b9cac5654f111e870e54", "score": "0.6236959", "text": "kill(){\n this.lives--;\n if(this.lives<0){\n this.gameOver = true;\n }else{\n resetBoard();\n }\n }", "title": "" }, { "docid": "418e21c15ce380977218cfe1642e45b7", "score": "0.62218773", "text": "setVisibility(game){\n if(this.dummyY < BALL_Y_DEAD){\n this.visible = true;\n this.y = this.dummyY;\n this.x = this.dummyX;\n game.ballsCounter--;\n }\n }", "title": "" }, { "docid": "9b1195da420aa1b33ea96a34b940eb87", "score": "0.6218873", "text": "update() {\n if (this.checkIfPicked()) {\n\n menuStats.gemsNumber ++;\n document.getElementById('gemsNumber').textContent = menuStats.gemsNumber;\n\n menuStats.score += this.points;\n document.getElementById('score').textContent = menuStats.score;\n\n this.onscreen = false;\n }\n }", "title": "" }, { "docid": "1d1a34d7e48fbfef02bb43d884597aba", "score": "0.6216284", "text": "update() { \r\n this.ship1.update();\r\n this.ship2.update();\r\n this.ship3.update();\r\n \r\n this.bgScene2.tilePositionY -= 0.5; //scroll effect\r\n\r\n let allLives=0;\r\n var allPlayers = this.players.getChildren();\r\n allPlayers.forEach((player)=>{\r\n player.update(); //update all players\r\n allLives += player.lives; //count all lives \r\n });\r\n \r\n if (allLives==0) {\r\n this.scene.start(\"GameOver\");\r\n }\r\n\r\n //update all the beams\r\n var beams = this.projectiles.getChildren(); //return array\r\n beams.forEach((beam) => { \r\n beam.update();\r\n });\r\n }", "title": "" }, { "docid": "6022bce23f33175770c2f2626686071d", "score": "0.6208857", "text": "update() {\r\n // Water reached?\r\n if (this.y <= 0) {\r\n this.reset(INITIAL_X, INITIAL_Y); // Go back to the start\r\n alertify.alert('You win!', 'Congratulations!<br>You got Catgirl to the water!');\r\n score += 1; // Score goes up\r\n $('#score').text(score);\r\n }\r\n }", "title": "" }, { "docid": "7ea07af446a44923527a731f4feecad8", "score": "0.6204515", "text": "function updateLives(){\n $('#playerOneLife').html(playerOneLives);\n $('#playerTwoLife').html(playerTwoLives);\n }", "title": "" }, { "docid": "fc65d229b50dd54020b116108cf76a1d", "score": "0.6199197", "text": "function die() {\n numLives--;\n if( numLives > 0 ) {\n adventureManager.changeState(\"Home\");\n }\n else {\n adventureManager.changeState(\"Home\");\n }\n}", "title": "" }, { "docid": "c68e8735b7cda6fb33daca1fdf3e2cf7", "score": "0.6196582", "text": "removeLife() {\n if (game.missed <= 4) {\n document.getElementById('scoreboard').children[0].children[4-game.missed].children[0].src = 'images/lostHeart.png';\n }\n if (game.missed === 5) {\n game.gameOver();\n } else {\n game.missed += 1;\n }\n }", "title": "" }, { "docid": "810b53729d2f1eaadb406e4b301570ca", "score": "0.61957234", "text": "die() {\n this.lives -= 1;\n game.drawer.drawLives(this.lives);\n this.resetPosition();\n this.agentDirection = 0;\n }", "title": "" }, { "docid": "57bc3b0f930b66272e6d389fae3ba175", "score": "0.6195369", "text": "function loss(){\n\t\tif(lives <= 0) {\n\t\t\tdocument.getElementById(\"status\").innerHTML=\"Game Over!\";\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "8065428441925683439e3e859fc28775", "score": "0.61836225", "text": "function updateGameArea(){\n\t\tif(myGameArea.running){\n\t\t\tmyGameArea.clear();\n\t\t\tmyGameArea.allCircles.forEach((circle) => circle.update());\n\t\t\t\n\t\t\t//highscore und lifes anpassen\n\t\t\tdocument.getElementById(\"lifes\").innerHTML = \"Lifes: \"+myGameArea.lifes;\n\t\t\tdocument.getElementById(\"highscore\").innerHTML = \"Points: \"+myGameArea.highscore;\n\t\t\t\n\t\t\t//Check for Game Over\n\t\t\tif(myGameArea.lifes <= 0){\n\t\t\t\tmyGameArea.running = false;\n\t\t\t\tclearInterval(myGameArea.intervalTimer);\n\t\t\t\t//clearInterval(myGameArea.intervalGame);\n\t\t\t\t//alert(\"Game over! Score: \"+myGameArea.highscore);\n\t\t\t\t\n\t\t\t\tshowPopUp();\n\t\t\t\tdocument.getElementById(\"scoreInput\").value = myGameArea.highscore;\n\t\t\t\tdocument.getElementById(\"canvasArea\").innerHTML = \"\";\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "18142d0b6001be3d042bb6b60909bab7", "score": "0.61646646", "text": "shielded(){\n if(this.lives === 1){\n this.lives++;\n this.shield.setVisible(true);\n\n }\n }", "title": "" }, { "docid": "949a58db9cfde5b681ea3129ed0f11f1", "score": "0.6153423", "text": "function nextLive() {\n\n tweenPlayerDead.stop();\n \n setupPlayer();\n player.dead = false; // turn on collision test with NPC\n \n myhealth = 100;\n $('#healthbar').css( { left: WIDTH/4 } ); // restore health bar\n $('#healthbar').css( { width: WIDTH/2 } );\n\n playerDead.pause();\n gameMusic.currentTime = 0;\n gameMusic.play();\n gameMusic.volume = 0.5;\n}", "title": "" }, { "docid": "62f5269677f73a9f411e82cfb8ab415d", "score": "0.61503935", "text": "function clickInMain() {\n $score -= 10;\n $life--;\n \n if ($life < 0) gameOver();\n else menu();\n}", "title": "" }, { "docid": "81cec8f319a53c9b815ca5c703b8e285", "score": "0.61349225", "text": "function resetLifeAmount() {\n\tcurrentLife = startingLifeAmount;\n\t$.currentLifeLabel.text = currentLife;\n}", "title": "" }, { "docid": "5f0dd01e61876e4c05df769df9cb4fd4", "score": "0.61325115", "text": "function lifeBarLevel() {\n if (life===-1) {life=0}\n lifeCursor.style.top = 100-life*10 + '%'\n}", "title": "" }, { "docid": "168fc00e6bceead502e665555bad500b", "score": "0.6128858", "text": "function AddLife(player, spanner)\r\n{\r\n spanner.kill()\r\n if(life<MaxLife){\r\n life+=1 // add life to player\r\n LifeAudio.play()\r\n turnHUDGreen(this) // flash HUD green\r\n lifeText.text = ' ' + life\r\n //Bulltype ++\r\n}\r\n}", "title": "" }, { "docid": "b91a96be87fac0a8493b83377701b87d", "score": "0.61231923", "text": "CheckAllLivesLost(){\r\n\t\t\r\n\t\tlet stats = this.state;\r\n\t\t\r\n\t\tif(stats.currentLives == 0){\r\n\t\t\t\r\n\t\t\twindow.alert(\"All lives are lost!\");\r\n\t\t\twindow.alert(\"Game over!\");\r\n\t\t\t\r\n\t\t\tstats.gameIsOn = false;\r\n\t\t\t\r\n\t\t\tthis.setState(stats);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "a436995b368809981310f178be05b0d9", "score": "0.61116135", "text": "function checkLoss() {\n if (torpedoesLeft === 0) { //Use all torpedoes = lose\n losses = losses + 1;\n $(\"#scoreLoss\").text(losses);\n $(\"#message\").text(\"You Lose!\");\n $(\"#resetBtn\").show();\n reveal();\n }\n}", "title": "" }, { "docid": "172e93cc5350fcec484c5c5fc77d085c", "score": "0.61025494", "text": "function loseLifeCheck(livesBeginning) {\n\t if (livesBeginning > frogger.startLifes && frogger.startLifes != 0) {\n\t stopGameFlag = true;\n\t pauseDeadFlag = false;\n\t loseLifeScreen.style.display = 'block';\n\t pauseBackground.style.display = 'block';\n\t }\n\t}", "title": "" }, { "docid": "98e9bca88a32fd2119f17b09a0c9cbae", "score": "0.60879093", "text": "function playerLife() {\n var lifeEl = document.getElementById('life');\n lifeEl.innerHTML = 'Lives: ' + playerLives.join(\"\");\n if (playerLives == false) {\n gameOver();\n }\n}", "title": "" }, { "docid": "98e9bca88a32fd2119f17b09a0c9cbae", "score": "0.60879093", "text": "function playerLife() {\n var lifeEl = document.getElementById('life');\n lifeEl.innerHTML = 'Lives: ' + playerLives.join(\"\");\n if (playerLives == false) {\n gameOver();\n }\n}", "title": "" }, { "docid": "316013642996fc75164640c3b056f36d", "score": "0.6085122", "text": "function staff() {\n enemy[enemyIndex].health -= 5;\n enemy[enemyIndex].hits++;\n enemy[enemyIndex].health += addMods();\n displayHealth();\n displayHits();\n disableButtons();\n}", "title": "" }, { "docid": "404ef71c2123730006d5a7794dff1ca3", "score": "0.60832995", "text": "function clickInMonster() {\n $score += 20;\n $life++;\n monsterIsOut();\n}", "title": "" }, { "docid": "5329e4a71b01ae9779034f340d35288c", "score": "0.608084", "text": "update(time, delta) {\n super.update(time); //Get rid of super since we will be using some new stuff only for tutorial\n //console.log(\"Enemy count: \",this.enemyGroup.getChildren().length, \"lessonStep: \",this.lessonStep);\n for(var i = 0; i < this.enemyGroup.getChildren().length; i++){\n //console.log(this.enemyGroup.getChildren()[i].enemyType);\n if(this.enemyGroup.getChildren()[i].class.enemyType == \"SLIME\"){\n this.slimeFound = true; //This needs to be reset somewhere\n break;\n }\n else{\n this.slimeFound = false;\n }\n }\n if(this.enemyGroup.getChildren().length == 0){\n this.slimeFound = false; //This is the reset counter\n }\n \n\n if(!this.clearTasks){ this.tasks(time); }\n else{\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.DUNGEON1,{\"money\":0});\n this.scene.stop();\n }\n \n\n\n\n if (this.player.sprite && this.player.sprite.body && !this.player.active && time - (this.lastDamaged + 400) >= 0) {\n //console.log(\"hello\");\n this.player.active = true;\n this.player.sprite.body.setVelocity(0, 0);\n }\n if (this.allThreeDead() && this.timeOfDeath == null) { //Kill the player and get the time of death\n this.player.active = false;\n this.player.sprite.destroy();\n this.timeOfDeath = time;\n //console.log(time);\n //console.log(Math.floor(this.timeOfDeath/1000));\n\n } else if (this.allThreeDead() && Math.floor((time / 1000)) - Math.floor(this.timeOfDeath / 1000) >= this.deathSceneLength) {\n //Shows the game going without the Player for x amount of seconds before it sends the game to the main menu\n this.timeOfDeath = null;\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.TUTORIAL, 'dead'); //Doens't work because calling super class\n this.scene.stop();\n } else {\n //cheats\n if(this.input.keyboard.keys[50].isDown){\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.DUNGEON2, {\n \"money\": this.money,\n \"level\": 4\n });\n this.scene.stop();\n }else if(this.input.keyboard.keys[51].isDown){\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.DUNGEON3, {\n \"money\": this.money,\n \"level\": 5\n });\n this.scene.stop();\n }else if(this.input.keyboard.keys[52].isDown){\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.NIGHT, {\n \"money\": this.money,\n \"level\": 1\n });\n this.scene.stop();\n }else if(this.input.keyboard.keys[53].isDown){\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.NIGHT, {\n \"money\": this.money,\n \"level\": 2\n });\n this.scene.stop();\n }else if(this.input.keyboard.keys[54].isDown){\n this.music.pause();\n this.scene.stop(SCENES.DAY_OVERLAY);\n this.scene.start(SCENES.NIGHT, {\n \"money\": this.money,\n \"level\": 3\n });\n this.scene.stop();\n }\n }\n }", "title": "" }, { "docid": "a458f938ab9bf7a472a604facc43bad8", "score": "0.6077999", "text": "update() {\n if (this.checkIfPicked()) {\n\n enemyStats.speedMax += enemyStats.speedDecrmStar;\n enemyStats.speedMin -= enemyStats.speedDecrmStar;\n allEnemies.forEach(function(enemy) {\n enemy.speed -= enemyStats.speedDecrmStar;\n });\n\n menuStats.starsNumber ++;\n document.getElementById('starsNumber').textContent = menuStats.starsNumber;\n\n menuStats.score += this.points;\n document.getElementById('score').textContent = menuStats.score;\n\n this.onscreen = false;\n }\n }", "title": "" }, { "docid": "ccb3fa34d464163ac920ecd03f63e92a", "score": "0.6068337", "text": "function changeFPS() {\n pauseGameOfLife();\n if (paused == UNPAUSED) {\n startGameOfLife();\n }\n}", "title": "" }, { "docid": "f8867eba646a81a00514602541196fb1", "score": "0.60673046", "text": "update(){\n //everytime update is called the score goes up\n this.score++;\n document.getElementById('score').innerHTML = 'Current Score: ' + (this.score*.001).toFixed(0);\n \n //gravity \"pulls\" down on velocity\n this.velocity += this.gravity*this.resistance;\n \n //if bird doesn't \"fly\" to keep velocity up, this.y is reduced by 1\n this.y += this.velocity\n}", "title": "" }, { "docid": "d0a998ef773ce87e220146c8ec83a5d0", "score": "0.6046779", "text": "function lostSoul() {\n if (livesCount === 2) {\n liveShip1.classList.add('hidden')\n console.log(liveShip1)\n } else if (livesCount === 1) {\n liveShip2.classList.add('hidden')\n } else if (livesCount === 0) {\n liveShip3.classList.add('hidden')\n }\n }", "title": "" }, { "docid": "cff78dacd9575f42248614553d2860ae", "score": "0.6046374", "text": "function displayScore() {\n // Checks if the game was lost\n if(gameLost()) {\n // Sets the score to 0 if the game was lost and deactivates the game squares\n score = 0;\n deactivateSquares();\n };\n scoreBoard.textContent = score;\n}", "title": "" }, { "docid": "7a85a497e6abe0f8d3bc3f1c51b81c81", "score": "0.6042207", "text": "function lossUpdate () {\n losses ++;\n //change the value on the html\n $(\"#losses\").html(\"Losses: \" + losses);\n \n }", "title": "" }, { "docid": "8b4b7313628d1a968f27b856849f2d8d", "score": "0.6040901", "text": "function checkGameOver() {\r\n if (gGame.lives > 0) {\r\n gGame.lives--;\r\n gHearts = gHearts.substring(0, gHearts.length - 1);\r\n document.querySelector('.lives span').innerText = gHearts;\r\n if (!gGame.lives) return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "f6c42cac18d9330246a03dda9b79ac57", "score": "0.60341525", "text": "function reviveCount()\r\n{\r\n\r\n reviveCounter -= 1;\r\n scoreText.text = \"Revive in \" + reviveCounter + \" sec...\";\r\n\r\n player = characters[userID].player;\r\n\r\n if(reviveCounter == 0)\r\n {\r\n player.revive();\r\n player.x = lastPlatformX + 150;\r\n player.y = game.height / 2;\r\n player.body.velocity.y = 0;\r\n\r\n game.time.events.remove(reviveEvent);\r\n scoreText.text = \"Score: 0\";\r\n\r\n game.camera.follow(characters[userID].player, Phaser.Camera.FOLLOW_LOCKON, 0.05, 0.1);\r\n }\r\n}", "title": "" }, { "docid": "ac08f2477370ab8ded41381653f13eeb", "score": "0.60295427", "text": "function livescount() {\n for (let l = 0; l < lives; l++) {\n fill(\"pink\");\n ellipse(90 - (l * 30), 60, 30, 30);\n }\n}", "title": "" }, { "docid": "f200b67f6d027d1712fd95538ae0d3d1", "score": "0.6028232", "text": "function enemyHit (player){\n \n // playerAp--; \n player.tint = 0xff0000;\n\n setInterval(\n function(){ player.tint = 0xffffff; },\n 400\n );\n \n //End game\n if( enemyAp < 1 || playerAp < 1)\n {\n game.scene.start('SceneTitle');\n }\n}", "title": "" }, { "docid": "f719b760de69a45f9c3c94ed979b4a2b", "score": "0.60221773", "text": "update() {\n this.x = this.x;\n this.y = this.y;\n\n if (this.y === -20) {\n stats.score();\n stats.timer = stats.timer + 3;\n alertText(\"You scored!\");\n }\n }", "title": "" }, { "docid": "34c362f6aa682f09009c75157d455319", "score": "0.6016263", "text": "function Update () \n { GetComponent.<GUIText>().text = \"Attempts: \"+Counter; \n // how it will react \nif (Counter<0){\n\nDebug.Log(\"zerod\");\nvar GameOver = true;\n\nif (GameOver)\n Pause.active = true;\n Replay.active = true;\n MainM.active = true;\n }\n }", "title": "" }, { "docid": "2986f70be1c2ca22b1de2ab35a9dc5cf", "score": "0.6015664", "text": "function gameStatus() {\n console.log(\"gameStatus\");\n // her definerer man hvornår man dør, når der er x antal liv tilbage\n if (life <= 0) {\n gameOver();\n } else if (timeLeft == 0) {\n levelCompleted();\n }\n\n}", "title": "" }, { "docid": "9b7a6fb226f36eb63b59f9ccbecae281", "score": "0.6014634", "text": "function handleUserLosses(userGuess) {\n\n //If lives hits 0, updates losses\n for (var i = 0; i < lazyRappers.currentWord.length; i++) {\n if(lazyRappers.livesRemaining == 0) {\n lazyRappers.currentWord -= 1;\n console.log(\"end round\");\n\n lazyRappers.losses++;\n $('.losses').html(lazyRappers.losses + \" Losses\");\n console.log(\"added losses\");\n }\n } \n} //end handleUserLosses function", "title": "" }, { "docid": "550f4c8b7ee83351c741d814f8701010", "score": "0.600941", "text": "update () {\n if (60 > Math.abs(this.y - collectable.y) && 60 > Math.abs(this.x - collectable.x)) {\n collectable.y = Math.random() * (425 - 0) + 1;\n collectable.x = Math.random() * (425 - 0) + 1;\n this.score += 1;\n if(this.score >= 10)\n {\n alert(\"You saved \" + this.score + \" babies!\");\n window.location.reload(true);\n }\n }\n for (let enemy of allEnemies) {\n if (this.y === enemy.y && (enemy.x + enemy.sideways / 2 > this.x && enemy.x < this.x + this.sideways / 2)) {\n this.health -= 1;\n if (this.health === 0) {\n alert(\"Done did die!!\");\n window.location.reload(true);\n }\n alert(\"You lost a life! You have \" + this.health + \" left!\");\n this.reset();\n }\n }\n }", "title": "" }, { "docid": "ef35d6b807a5a142e87fb79baf7bdbf1", "score": "0.60083854", "text": "removeLife(){\n //let span = document.createElement(\"span\");//create span for 'lives' counter\n let span = document.getElementById(\"heart-span\")\n let scoreboard = document.getElementById(\"scoreboard\").appendChild(span)\n span.style.display = \"none\"\n let x = 5;\n\n if(this.missed < 4){\n const liveHearts = document.getElementsByClassName('tries')\n //converts liveHearts HTML collection to array\n let arrLive = [...liveHearts];\n //sets arrLive index equal to this.missed count\n let firstLive = arrLive[this.missed];\n this.missed += 1;\n let string = firstLive.innerHTML\n let replace = string.replace(\"liveHeart\", \"lostHeart\");\n //replaces innerHTML of arrLive element at specified index\n firstLive.innerHTML = `${replace}`;\n\n //dislays 'lives' counter to scoreboard\n span.style.display = \"block\"\n span.textContent = (x - this.missed + \" live(s) left \") //setting text\n } \n else {\n this.gameOver(false);\n } \n }", "title": "" }, { "docid": "de002413d844a821e0d4218a242a8cb2", "score": "0.6008218", "text": "function Start() {\n\tEnemiesAlive = 0;\n}", "title": "" }, { "docid": "43cdb14af1cbdfc72ab576ed4c38eb68", "score": "0.6007728", "text": "function updatePoints(){\r\n\tvar pts = playerObj.availPoints - pointCounter;\r\n\r\n\tif(pts < 0){\r\n\t\tpts = 0;\r\n\t}\r\n\r\n\t$(\"#availPoints\").html(\"Available Points: \" + pts);\r\n\r\n}", "title": "" }, { "docid": "2add2fd9919a26a5e78aa55825fd6e33", "score": "0.6007237", "text": "function checkForCollisions() {\n for (var i = 0; i < allEnemies.length; i++) {\n if (player.a < allEnemies[i].a + allEnemies[i].wMove &&\n player.a + player.wMove > allEnemies[i].a &&\n player.b < allEnemies[i].b + allEnemies[i].hMove &&\n player.b + player.hMove > allEnemies[i].b) {\n player.a = 200;\n player.b = 300;\n stats.setNewLives(1);\n document.getElementById('lives').innerHTML = stats.getLives();\n if (stats.getLives() === 0) {\n alert('Wanna try again?');\n location.reload();\n }\n }\n }\n\n}", "title": "" }, { "docid": "7b38624865beff00a7661bc3c180b5a9", "score": "0.60071456", "text": "update() {\n if(this.checkCollisions()) {\n this.resetStartPosition();\n //If the player doesnt have enough lives a heart will be available so he/she can increase the lives amount\n if(this.lives <= Math.ceil(Math.random()*2+1) && allHearts.length === 0)\n allHearts.push(new Bonus('heart'));\n }\n if(this.reachedWater()) this.levelPassed();\n if(this.checkReachStar()) this.reachedStar();\n if(this.checkReachHeart()) this.reachedHeart();\n }", "title": "" }, { "docid": "0aef56f5f7aafe44833d6261f0e46d00", "score": "0.60062784", "text": "function enemyCollision() {\n lives--;\n stopTimedLoop();\n if (lives < 1) {\n hideElement(\"winImage\");\n showElement(\"smileImage\");\n setScreen(\"gameOverScreen\");\n if (highScores[0] == 0) {\n highScores = [moveCount, moveCount, moveCount, moveCount, moveCount];\n setText(\"recentScore1\", moveCount);\n setText(\"recentLevel1\", levelCount);\n setText(\"recentScore2\", moveCount);\n setText(\"recentLevel2\", levelCount);\n setText(\"recentScore3\", moveCount);\n setText(\"recentLevel3\", levelCount);\n setText(\"recentScore4\", moveCount);\n setText(\"recentLevel4\", levelCount);\n setText(\"recentScore5\", moveCount);\n setText(\"recentLevel5\", levelCount);\n }\n for (var i = 0; i < highScores.length; i++) {\n if (moveCount > highScores[i]) {\n highScores[i] = moveCount;\n setText(\"recentScore\" + (i + 1), moveCount);\n setText(\"recentLevel\" + (i + 1), levelCount);\n setText(\"overLabel\", \"High Score!\");\n setProperty(\"gameOverScreen\", \"background-color\", \"orange\");\n hideElement(\"smileImage\");\n showElement(\"winImage\");\n i = 10;\n }\n }\n setText(\"scoreNumOver\", moveCount);\n setText(\"levelNumOver\", levelCount);\n } else {\n setPosition(\"player\", 140, 410);\n hideElement(\"heart\" + (3 - lives));\n moveEnemy(\"cartEnemy\", \"truckEnemy\", \"motorcycleEnemy\");\n }\n}", "title": "" }, { "docid": "f5c80987c998cc3b9150ce5327da0657", "score": "0.6003387", "text": "function gameOver () {\n lives--;\n if(lives < 1) {\n alert(\"Game Over\");\n lives = 3;\n document.location.reload();\n }\n else {\n x = canvas.width/2;\n y = canvas.height-30;\n dx = 4;\n dy = -4;\n paddleX = (canvas.width-paddleWidth)/2;\n}\n}", "title": "" }, { "docid": "c05f7be298a2be9d51e7d931c1c29fef", "score": "0.60003126", "text": "function checkPlayerDie() {\n\tif (gameChar_y > height) {\n\t\tlives -= 1;\n\t\tif (lives > 0) {\n\t\t\tstartGame_level01();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3e45350747a05a1c7ceb585899baf656", "score": "0.60002667", "text": "hitflower(player,flowers) {\r\n flowers.disableBody(true, true);\r\n this.pencilCount -= 1;\r\n console.log('Hit element, deduct lives, balance is',this.pencilCount);\r\n \r\n // Default is 3 lives\r\n if ( this.pencilCount === 2) {\r\n this.whipSnd.play();\r\n this.cameras.main.shake(100);\r\n this.pencil3.setVisible(false);\r\n } else if ( this.pencilCount === 1) {\r\n this.whipSnd.play();\r\n this.cameras.main.shake(100);\r\n this.pencil2.setVisible(false);\r\n } else if ( this.pencilCount === 0) {\r\n this.whipSnd.play();\r\n this.cameras.main.shake(500);\r\n this.pencil1.setVisible(false);\r\n this.isDead = true;\r\n }\r\n\r\n // No more lives, shake screen and restart the game\r\n if ( this.isDead ) {\r\n console.log(\"Player is dead!!!\")\r\n // delay 1 sec\r\n this.time.delayedCall(1000,function() {\r\n // Reset counter before a restart\r\n this.isDead = false;\r\n this.pencilCount = 3;\r\n this.scene.stop(\"level2\");\r\n this.scene.start(\"gameoverScene\");\r\n },[], this);\r\n }\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "4a13a53032572f7a21b19dcbc5089a57", "score": "0.59999806", "text": "function addScore() {\r\n\t\tif (gameAlive === true && points.giveScore === true){\r\n\t\t\tscore += 5;\r\n\t\t\tupdateScore();\r\n\t\t\tpoints.giveScore = false;\r\n\t\t\tpoints.visible = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1e7bfaf752818110f67a7cf708bb5873", "score": "0.5979861", "text": "function pacDotEaten() {\n\t\tif (squares[pacmanCurrentIndex].classList.contains(\"pac-dot\")){\n\t\t\tscore++;\n\t\t\ttoWin++;\n\t\t\tsquares[pacmanCurrentIndex].classList.remove(\"pac-dot\");\n\t\t}\n\t\tscoreDisplay.innerHTML = score;\n\t}", "title": "" }, { "docid": "8148985075a53f65f5d3966a375312a8", "score": "0.59772754", "text": "function randomLife(){\n\tfor (var i = 0; i < gameLength; i++){\n\t\tfor(var j = 0; j < gameLength; j++){\n\t\t\tvar num = (Math.floor(Math.random() * 1.4)); //how many random cells are generated\n\t\t\tif(num)\n\t\t\t\tmyLifeGame.setAlive(i,j);\n\t\t\telse\n\t\t\t\tmyLifeGame.setDead(i,j);\n\t\t}\n\t\t\n\t}\n\tupdateCells();\n}", "title": "" } ]
21bafb109cf4af13011bfdfde6f861a0
ajax function which makes api call to randomfamousquoteapi
[ { "docid": "9d3c79023c9be417127a751e72e0cd4d", "score": "0.6808332", "text": "function getRandomQuote(){\n let color = ['#F64747','#663399','#4183D7','#22313F','#9A12B3','#03A678'];\n let index=color[Math.floor(Math.random()*color.length)];\n /* Make ajax call here */\n $.ajax({\n url: 'https://quota.glitch.me/random',\n type: 'GET',\n dataType: 'json',\n success: function(data){\n // alert(JSON.stringify(data));\n // alert(`${data.quoteText} -${data.quoteAuthor}`);\n let quote = data.quoteText;\n let author = data.quoteAuthor;\n $('.quote #data').html(quote);\n $('quote h4').html('-'+author);\n $('body').css('background-color', index);\n $('.col').css('background-color', index);\n $('.socialmedia a').css('background-color', index);\n $('#newquote').css('color', 'white');\n $('.color').css('color', index);\n $('#twitter').attr('href', \"https://twitter.com/intent/tweet?text=\"+quote+\" \"+author);\n },\n error: function(err){\n $('.quote #data').html(\"Oops something went wrong\");\n }\n });\n}", "title": "" } ]
[ { "docid": "77ea05b7249af78cde0908e8b7ec55bb", "score": "0.7886693", "text": "function randomQuote() {\r\n $.ajax({\r\n url: \"http://api.forismatic.com/api/1.0/\",\r\n jsonp: \"jsonp\",\r\n dataType: \"jsonp\",\r\n data: {\r\n method: \"getQuote\",\r\n lang: \"en\",\r\n format: \"jsonp\"\r\n },\r\n //callback object to use data\r\n success: function( response ) {\r\n quote = response.quoteText;\r\n author = response.quoteAuthor;\r\n $(\"#quote\").text(quote);\r\n if (author) {\r\n $(\"#author\").text(\"- \" + author);\r\n } else {\r\n $(\"#author\").text(\"- Unknown\");\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "b2ab39ce335932100b10a394bf726639", "score": "0.75327355", "text": "function requestQuote() {\n\t\tvar apiUrl = apiUrlBase + '?' + Math.round(new Date().getTime() / 1000);\n\t\tvar request = new XMLHttpRequest();\n\t\tvar data;\n\t\trequest.open('GET', apiUrl, true);\n\t\trequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n\t\trequest.onreadystatechange = function() {\n\t\t\tif (request.readyState === 4 && request.status === 200) {\n\t\t\t\tdata = JSON.parse(request.response)[0];\n\t\t\t\tloadQuote(scrubQuote(data));\n\t\t\t}\n\t\t};\n\t\trequest.onerror = function() {\n\t\t\tconsole.log(request);\n\t\t\trandomQuote = backupQuotes[Math.floor(Math.random() * backupQuotes.length)];\n\t\t\tloadQuote(scrubQuote(randomQuote));\n\t\t\tloadError();\n\t\t};\n\t\trequest.send();\n\t}", "title": "" }, { "docid": "375c312c92d5d79075a7da91da166fc3", "score": "0.7390225", "text": "function getNewQuote(){\n $.ajax({\n url:'http://api.forismatic.com/api/1.0/',\n jsonp: 'jsonp',\n dataType: 'jsonp',\n data: {\n method: 'getQuote',\n lang: 'en',\n format: 'jsonp'\n },\n success: function(response){\n quote = response.quoteText;\n author = response.quoteAuthor;\n $('#quote').text(quote);\n if (author){\n $('#author').text('- ' + author);\n }else {\n $('#author').text('- unknown');\n }\n }\n });\n// making an API request above\n }", "title": "" }, { "docid": "36ed12fe20a431aac3ccbc4659fec080", "score": "0.72589856", "text": "function quoteOfTheDayAjax() {\n $.ajax({\n url: `https://quote-garden.herokuapp.com/api/v2/quotes/random`,\n method: \"GET\",\n }).then((response) => {\n console.log(response);\n let quoteAuthor = $(\"<strong>\")\n .text(`${response.quote.quoteAuthor} :`)\n .css({\n \"margin-right\": \"10px\",\n });\n let quoteGenre = $(\"<span>\").text(response.quote.quoteGenre);\n let quoteText = $(\"<span>\").text(response.quote.quoteText);\n\n let quoteDiv = $(\"<div>\");\n quoteDiv.append(quoteText);\n quoteDiv.prepend(quoteAuthor);\n\n // $('.results').prepend(quoteDiv);\n $(\".quoteDiv\").prepend(quoteDiv);\n });\n }", "title": "" }, { "docid": "2ebc924f2fd65dc190dc10c3d14150dd", "score": "0.7134693", "text": "function getQuote(e) {\r\n//loome request objekti\r\n const xhr = new XMLHttpRequest();\r\n//avame requesti koos api aadressi ja numbriga\r\n//http://quotesondesign.com/api/3.0/api-3.0.json\r\n//xhr.open('GET', `quoteTEST.json`, true);\r\n\r\n\t//xhr.open('GET', `http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1`, true);\r\nxhr.open('GET','https://random-quote-generator.herokuapp.com/api/quotes/random',true);\r\n xhr.onload = function() {\r\n\t\t//kontrollime staatust\r\n if(this.status === 200) {\r\n\t\t\t//loome muutuja päringu vastusega\r\n const response = JSON.parse(this.responseText);//.slice(1,-1));\r\n//muutuja, mille sisestame HTMLi\r\n let output = '';\r\n //output += `<li>${response.content}</li><li>${response.title}</li>`;\r\n\t \r\n\t output += `<blockquote class=\"blockquote text-right\">\r\n <p class=\"mb-0\">${response.quote}</p>\r\n <footer class=\"blockquote-footer\"><cite title=\"Source Title\">${response.author}</cite></footer>\r\n</blockquote>`;\r\n\t \r\n\t \r\n\r\n//sisestame muutuja HTMLi\r\n document.getElementById('tsitaat').innerHTML = output;\r\n }\r\n }\r\n//saadame päringu\r\n xhr.send();\r\n//takistame vormi submiti\r\n e.preventDefault();\r\n}", "title": "" }, { "docid": "7425127171105614cc5923f8e0e92c60", "score": "0.7131027", "text": "function quote(){\n \n $.ajax({\n url: 'https://api.forismatic.com/api/1.0/',\n jsonp: \"jsonp\",\n dataType: \"jsonp\",\n data: {\n method: \"getQuote\",\n lang: \"en\",\n format: \"jsonp\"\n } \n }).done(function(response){\n $(\"#quote\").html(response.quoteText);\n \n if(response.quoteAuthor)\n $(\"#quote-author\").html( response.quoteAuthor );\n else\n $(\"#quote-author\").html( \"unkown\");\n \n }); \n return true;\n}", "title": "" }, { "docid": "7bc3dfd106164695613d324ace646472", "score": "0.70999974", "text": "function api() {\n let quotesDiv = document.getElementById('quotes')\n\n let max = 6;\n let whichQuote = Math.floor(Math.random() * max);\n\n fetch(\"https://stormy-harbor-45590.herokuapp.com/https://quiet-earth-90814.herokuapp.com/quotes/\" + whichQuote)\n .then(res => res.json())\n .then(quote => {\n quotesDiv.innerHTML += `<p> ${quote.text} </p>`\n })\n}", "title": "" }, { "docid": "74b6ee77aad8d3c7506b1ff6e2fc63fc", "score": "0.6863168", "text": "function displayQuote() {\n\n let xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", \"https://type.fit/api/quotes\", true);\n xhttp.setRequestHeader('Content-Type', 'application/json');\n \n xhttp.onreadystatechange = function () {\n if (xhttp.readyState === XMLHttpRequest.DONE) {\n var status = xhttp.status;\n if (status === 0 || status >= 200 && status < 400) {\n let allQuotes = JSON.parse(xhttp.responseText); //there are A LOT of quotes, this is really bad\n let quotesLength = allQuotes.length;\n let randomQuote = allQuotes[Math.floor(Math.random()*quotesLength)];\n quoteAuthor.innerHTML = randomQuote.author;\n quote.innerHTML = randomQuote.text;\n } else {\n console.log(\"Something went wrong\");\n }\n }\n }\n\n xhttp.send();\n \n}", "title": "" }, { "docid": "d9fb1f917fcc7b9e8c40a889a7a840a3", "score": "0.68496513", "text": "function newQuote() {\n \n // Note: The Forismatic call currently only works in Firefox.\n if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){\n var apiData = $.getJSON(\"http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?\")\n .done(externalQuote)\n .fail(localQuote);\n } else {\n localQuote();\n }\n}", "title": "" }, { "docid": "71e07213b2fadd90b0c7bb178936bb20", "score": "0.6834218", "text": "function getQuote (){\n $.ajax ({\n method: \"GET\",\n url : \"https://got-quotes.herokuapp.com/quotes\",\n success: function (response) { // response can be anything, it's an argument\n $(\"#quote\").text(response.quote); //to put the quote in website\n // document.getElementById(\"quote\").innerHTML = response.quote;\n $(\"#character\").text(response.character);\n // document.getElementById(\"character\").innerHTML = response.character;\n }\n })\n }", "title": "" }, { "docid": "26d3678f145e3642f7e5d3bf9b2e9deb", "score": "0.6810143", "text": "function getQuote() {\n \n var url = \"https://api.forismatic.com/api/1.0/?method=getQuote&&lang=en&format=jsonp&jsonp=?\";\n \n \n \n $.getJSON(url).done(parseQuote).fail(handleErr);\n}", "title": "" }, { "docid": "c9a6924b58d5be4c41ab5b5c9c77225f", "score": "0.6792976", "text": "async function getQuotes() {\n loading();\n const ApiURL ='https://type.fit/api/quotes';\n try {\n // quoteText.textContent=\"loading\";\n // authorText.textContent=\"loading\";\n\n const response = await fetch(ApiURL)\n apiQuotes = await response.json();\n console.log(Math.floor(Math.random()*apiQuotes.length));\n console.log ('quotes', apiQuotes[Math.floor(Math.random()*apiQuotes.length)])\n newQuote( )\n complete();\n \n\n } catch (error){\n // handle error here (alert or pass the error shere it could be useful)\n }\n}", "title": "" }, { "docid": "1b1a6abede838e79dae4767a68dd89bb", "score": "0.67916", "text": "function getWeather() {\n console.log(\"getWeather() called\");\n $.ajax({\n url: \"http://api.openweathermap.org/data/2.5/weather?id=\"+ cityid + \"&appid=35820b267950a823e277551555efda9b&units=metric\",\n method:\"POST\",\n dataType: \"json\",\n success: function(data) {\n console.log(\"success\");\n var city = data.name;\n var description = data.weather[0].description\n var temp = data.main.temp;\n var feels_like = data.main.feels_like;\n var iconcode = data.weather[0].icon\n var iconurl = \"http://openweathermap.org/img/w/\" + iconcode + \".png\";\n $('#city').html('<b>'+ city +'</b>');\n $('#wicon').attr('src', iconurl);\n $('#description').html('<b>' + description + '</b>');\n $('#temp').html('<b>Temp: </b>' + temp);\n $('#feels_like').html('<b>Feels Like: </b>' + feels_like);\n }, \n error: function (e) {\n console.log(\"error: \" + e);\n }\n });\n\n $.ajax({\n url: 'https://api.quotable.io/random',\n method: 'get',\n dataType: 'json',\n success: function (data) {\n $('#quote').html(data.content + '<br> - ' + data.author);\n },\n error: function (e) {\n console.log('error: ' + e);\n }\n });\n\n}", "title": "" }, { "docid": "37a28dacd3cda78126c6bba658ad1a81", "score": "0.6779237", "text": "function importQuote() {\n $.ajax({\n url: 'https://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?',\n data: {},\n dataType: 'json',\n //only gets quote/auther if successful\n success: function(data) {\n //grabs the quote from the quoteText object\n theQuote = data.quoteText;\n //stores the author in theAuthor var\n theAuthor = data.quoteAuthor;\n /* output quote and author to IDs quoteOut and AuthorOut*/\n document.getElementById('quoteOut').innerHTML = theQuote;\n if (theAuthor != \"\") {\n document.getElementById('authorOut').innerHTML = theAuthor;\n } else {\n document.getElementById('authorOut').innerHTML = \"Unknown\";\n }\n },\n //if not successful getting quote/author from website, writes that there was error\n error: function(){\n $(\"#quoteOut\").text(apiError);\n }\n })// end of ajax\n } //end of importQuote function", "title": "" }, { "docid": "1172687e750c6f627bc341fbbbf3bc94", "score": "0.6751635", "text": "function getQuote(){\n\n //YOUR CODE HERE, Add a GET request\n $.ajax({\n url: 'http://localhost:8080/quote',\n type: 'GET',\n data: JSON.stringify(quote),\n contentType: 'application/json',\n success: console.log('Made Contact!'),\n error: function(error) {\n console.error('Failed to GET', error)\n }\n });\n\n\n }", "title": "" }, { "docid": "c68eeeb6cda2f5a6a8868695fa756f39", "score": "0.6736261", "text": "function generateQuoteAndMovieInfo() {\n $.ajax({\n type: \"POST\",\n headers: {\n \"X-Mashape-Key\": \"OivH71yd3tmshl9YKzFH7BTzBVRQp1RaKLajsnafgL2aPsfP9V\"\n },\n dataType: 'json',\n url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies'\n }).then(function(res) {\n var quote = res.quote; //local variable that holds value of the key \"quote\" in the response object\n var movie = res.author; //local variable that holds value of the key \"author\" (which happens to be the movie the quote is from) in the response object\n $('#search').val('');\n $(\"#divForQuote\").empty();\n $(\"<h2>\").text('\"' + quote + '\"').appendTo(\"#divForQuote\");\n retrieveDetailedMovieInfoFromTMDB(movie);\n retrieveMovieTrailerFromYouTube(movie);\n retrieveMusicFromITunes(movie);\n })\n}", "title": "" }, { "docid": "fb4095f4f7326bd8ead7936f13fd783c", "score": "0.67283547", "text": "function randomQuote() {\n if (dataArr.length !== 0) {\n // dataArr = response.data;\n dataArrLen = dataArr.length;\n $(\"#random_quote\").text(\"\");\n $(\"#random_author\").text(\"\");\n txt_str = dataArr[0];\n dataArr.shift()\n if (txt_str === undefined || txt_str === '')\n txt_str = '我最大的缺点,就是缺点钱。';\n showText(\"#random_quote\", txt_str, 10, function () {\n })\n } else {\n //Using the Forsimatic API\n $.ajax({\n url: \"./data/api&p=\" + Math.ceil(Math.random() * 220),\n dataType: \"json\",\n type: \"GET\",\n //If succesful does function\n success: function (response) {\n //Clear previous random quote\n if (response !== undefined && response.data !== undefined && response.data.length > 0) {\n $(\"#random_quote\").text(\"\");\n $(\"#random_author\").text(\"\");\n\n dataArr = response.data;\n dataArrLen = dataArr.length;\n\n txt_str = dataArr[Math.ceil(Math.random() * dataArrLen)];\n // console.log('txt_str', txt_str);\n if (txt_str === undefined || txt_str === '')\n txt_str = '我最大的缺点,就是缺点钱。';\n showText(\"#random_quote\", txt_str, 10, function () {\n // showText(\"#random_author\", '-' + response.quoteAuthor, 10, function () {\n // //Appending blinking div after author\n // });\n })\n } else {\n console.log('接口异常无数据');\n }\n\n }\n });\n }\n\n}", "title": "" }, { "docid": "10c4f4ef4e63e1581581b0970eac31bc", "score": "0.67231345", "text": "function getRandom(req, res){\n console.log(apiKey);\n \trequest('https://quotes.rest/quote/random.json?api_key='+apiKey, function(err, response, body){\n \t\t///this send stuff to the front end...\n \t\tvar parsedQ = JSON.parse(body);\n \t\t\n\t\tvar apiObject = {\n \t\t\tquote: parsedQ.contents.quote,\n \t\t\tauthor: parsedQ.contents.author\n \t\t};\n\n \t\tres.send(apiObject);\n \t\t\n \t});\n\n}", "title": "" }, { "docid": "83dbccf0e735ae2c41002c408f1f1d9d", "score": "0.6706478", "text": "function call_api(stockCompany,finishedAPI){\nrequest(`https://cloud.iexapis.com/stable/stock/${stockCompany}/quote?token=pk_e1a77b24867d49ef95420ddaf23bab2f`,\n {json:true},(err,res,body)=>{\n if(err){\n console.log(err);\n } \n if(res.statusCode === 200){ \n finishedAPI(body);\n }\n});\n}", "title": "" }, { "docid": "f6446dc2a5e98893f33d46cd6c63113d", "score": "0.6702565", "text": "function getRandomQuote() {\n\n // forismatic URL to get Quote as JSON\n var forismaticUrl = \"https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?\";\n\n // Reads the JSON and asigns the readed value to the variables and html\n $.getJSON(forismaticUrl, function(data) {\n\n // getting the info from the JSON\n randomQuote = data.quoteText;\n randomAuthor = data.quoteAuthor;\n\n // setting the info into the html\n $(\"#quote\").html('<i class=\"fa fa-quote-left\"></i> ' + randomQuote + ' <i class=\"fa fa-quote-right\"></i>');\n $(\"#author\").html('-' + randomAuthor);\n });\n\n }", "title": "" }, { "docid": "a2c59d32b4aa9a3f65307a254416ec1d", "score": "0.6701565", "text": "function getQuote() {\n $.ajax({\n url: 'https://api.quotable.io/random',\n type: 'GET',\n success: function (data) {\n console.log(data);\n $('#quote').html('\"' + data['content'] + '-by ' + data['author'] + '\"');\n $('#quote').attr('data-clipboard-text', '\"' + data['content'] + '-by ' + data['author'] + '\"');\n },\n error: function (e) {\n console.log(e);\n }\n })\n }", "title": "" }, { "docid": "e922481128b7669359f4ec8da116ccad", "score": "0.6665183", "text": "function addQuote() {\n var newRequest = new Request();\n newRequest['type'] = \"POST\";\n newRequest['url'] = \"http://harryquotes-216807.apse1.nitrousbox.com:8080/quotes\";\n newRequest['data'] = {\n 'quote': {\n 'quote': $('#new-quote').val(),\n 'author': $('#author').val()\n }\n }\n newRequest[\"success\"] = function(response){\n getAllQuote();\n $('#new-quote').val('');\n $('#author').val('');\n }\n\n $.ajax(newRequest);\n }", "title": "" }, { "docid": "bbe93d7f9b3a4a60133fb8ff2cf19596", "score": "0.6607504", "text": "function generateQuoteClicked() {\n // This function will trigger every time the \"Generate Quote\" button is clicked\n // Make your API request here to get a random quote: https://github.com/pprathameshmore/QuoteGarden#get-a-random-quote\n // Have a look at https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n // The section that reads \"A basic fetch request is really simple to set up\" will help you with this\n fetch(/* TODO */)\n .then(resp => resp.json()) \n .then(resp => {\n // resp is what we're getting back from the API call we make\n // It should match the API Documentation we read \n // Take a look at the resp in your browser console, then use setQuote to set the quote\n console.log(resp);\n })\n .catch(error => console.log('error: ', error)) // What would you show to the user in case of error?\n }", "title": "" }, { "docid": "3e28c1cbdba3de92222bb43d801cf655", "score": "0.6586051", "text": "async function getQuotes() {\n // Show loader\n loading();\n\n // Make a request to the quotes' site API\n const apiURL = 'https://type.fit/api/quotes';\n try {\n const response = await fetch(apiURL);\n apiQuotes = await response.json();\n newQuote();\n }\n catch (err) {\n alert(err);\n }\n}", "title": "" }, { "docid": "7f7777426bc4c0c54daa38c12956f4bf", "score": "0.6572645", "text": "function getQuotes() {\n var url = \"https://type.fit/api/quotes\"\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n //sends data to be parsed and displayed\n displayQuote(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n }", "title": "" }, { "docid": "4df01c8e97f503a16b9faaa052af13b7", "score": "0.65388215", "text": "function displayQuote(xhttp) {\n const quotes = JSON.parse(xhttp.response);\n\n //Generates a seed using todays date thus the quote is the same throughout the day\n var random = rand_from_seed(Math.floor((new Date)/86400000)) % 1600;\n\n //displays quote\n document.getElementById(\"quote\").innerHTML = '\"' + quotes[random][\"text\"] + '\"';\n document.getElementById(\"author\").innerHTML = quotes[random][\"author\"];\n }", "title": "" }, { "docid": "0ac6a245608a26ea87775fa2c44dc2bf", "score": "0.65218365", "text": "function call_api(finishedAPI,ticker='fb'){\n request(`https://cloud.iexapis.com/stable/stock/${ticker}/quote?token=pk_9947e79595994364a927215a26c20f96`,{json:true},(err,res,body) => {\n if(err) {\n return console.log(err);\n }\n if(res.statusCode === 200){\n finishedAPI(body);\n }\n });\n}", "title": "" }, { "docid": "b7bb98e8ec93d5ac594794dfa9d2a816", "score": "0.6519659", "text": "async function getQuotes(){\n loading();\n //build an api url\n const apiurl = \"https://type.fit/api/quotes\";\n //\n try {\n const response = await fetch(apiurl);\n quotes = await response.json();\n singleQuote();\n } catch (error) {\n alert(error);\n }\n}", "title": "" }, { "docid": "af28bde5a12a6a54425779a8734af746", "score": "0.6519362", "text": "async function getQuotes(){\r\n loading();\r\nconst apiUrl='https://type.fit/api/quotes';\r\ntry{\r\nconst response=await fetch(apiUrl);\r\napiQuotes=await response.json();\r\nnewQuote();\r\n}\r\ncatch(error){\r\n//catch the error\r\n}\r\n}", "title": "" }, { "docid": "965db548c2a651f179604d2a1bf2a1e7", "score": "0.65179306", "text": "function call_api(userId, token) {\n var api_response;\n $.ajax({\n url: \"https://api.fitbit.com/1.2/user/\" + userId + \"/sleep/list.json?beforeDate=2019-02-18&sort=desc&offset=0&limit=1\",// 'https://api.fitbit.com/1/user/'+ userId+ '/sleep/date/2019-02-16.json',\n method: \"GET\",\n async: false,\n headers: {\n \"Authorization\" : \"Bearer \" + token\n },\n success: function(response) {\n // $(\"#response-code\").html(JSON.stringify(response, null, 2));\n // Prism.highlightAll();\n api_response = JSON.stringify(response, null, 2);\n }\n });\n return api_response\n \n }", "title": "" }, { "docid": "ba5531f72e4d44ac85aec81e1bcf379c", "score": "0.65117323", "text": "async function getQuote() {\n endpoints = ['famous', 'movies']\n endpoint = endpoints[Math.floor(Math.random(2))]\n options = {\n url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=' + endpoint + '&count=1',\n json: true,\n\n headers: {\n 'X-Mashape-Key': 'jLowL9VQ9CmshLR1eNzx8hVKJIxKp1RVGp7jsn3gcL8xqPRolM',\n 'Accept': 'application/json'\n }\n }\n json = await request(options)\n return {\n text: json[0].quote + ' ... ' + json[0].author\n }\n}", "title": "" }, { "docid": "8b134d4c1ba21f204e4e2ab8cc75937d", "score": "0.6508764", "text": "function getRandomQuote(){\n $.ajax({\n url: 'https://api.icndb.com/jokes/random?escape=javascript',\n type: 'GET',\n dataType: 'json'\n })\n .done(function(data) {\n var quoteO = data.value;\n\n setTimeout(function() {\n var quote = '\"' + quoteO.joke + '\"';\n $('.share').attr('href', 'https://twitter.com/intent/tweet?text=' + quote)\n $('#quote').text(quote);\n $('.quote-container').removeClass('animated hinge');\n\n splashColor(); // change the color of everything!\n }, 1800);\n })\n .fail(function() {\n console.log('error');\n $('#quote').text('\"Chuck Norris will never have a heart attack. His heart isn\\'t nearly foolish enough to attack him.\"');\n alert('Sorry the Chuck Norris API is down, Chuck Norris Down!? No he just has better things to do.');\n })\n .always(function() {\n console.log('complete');\n });\n}", "title": "" }, { "docid": "9a9f42db3e009515bbb99b0af8580d60", "score": "0.64962876", "text": "function getQuotes() {\n /* \n * Source: https://forum.freecodecamp.org/t/free-api-inspirational-quotes-json-with-code-examples/311373 \n */\n\n // Allows quotes to be retrieved\n const settings = {\n async: true,\n crossDomain: true,\n url: \"https://type.fit/api/quotes\",\n method: \"GET\"\n };\n\n // Gets quotes\n $.ajax(settings).done(function (response) {\n quotes = JSON.parse(response)\n .filter(r => Boolean(r.author));\n displayQuotes();\n });\n}", "title": "" }, { "docid": "6460826866ac205f5d48e9e26b6b0b45", "score": "0.6476385", "text": "function requestApi() {\n $.ajax({\n dataType: 'json',\n url: getUrl(),\n success: (data) => chosenRechipe(data.recipes),\n error: () => console.log(\"Cannot get data\"),\n })\n}", "title": "" }, { "docid": "6f3ac5cf50430f94cb79c263cf944b58", "score": "0.6468014", "text": "getRandomQuote() {\r\n\r\n // need to figure out how to get quotes from API\r\n fetch(\"https://andruxnet-random-famous-quotes.p.rapidapi.com/?cat=famous\", {\r\n \"method\": \"GET\",\r\n \"headers\": {\r\n }\r\n })\r\n .then(res => res.json())\r\n .then(data => {\r\n const div = document.getElementById('word-container')\r\n let output = '';\r\n data.forEach(element => {\r\n output += `<h5>${element.quote}</h5>`;\r\n });\r\n // dynamically add quotes to html doc\r\n document.getElementById('quote').innerHTML = output;\r\n div.style.width = '300px';\r\n div.style.border = '15px solid';\r\n div.style.padding = '50px';\r\n div.style.margin = '20px';\r\n div.style.float = 'right';\r\n div.style.marginTop = '-300px';\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n });\r\n }", "title": "" }, { "docid": "f60a6ca20eafd81b810514eddcf5be00", "score": "0.645053", "text": "async function getQuotes() {\n loading()\n const proxyURL = 'https://quiet-fjord-23740.herokuapp.com/'\n // const apiURL = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&formnat=json'\n const apiURL = `https://type.fit/api/quotes`\n\n try {\n const response = await fetch(proxyURL + apiURL)\n apiQuotes = await response.json()\n newQuote()\n } catch (error) {\n console.log(error)\n }\n}", "title": "" }, { "docid": "67199a0e555710d3893d383aca9541ae", "score": "0.6429783", "text": "function call_api (finishedAPI, ticker){\n request('https://cloud.iexapis.com/stable/stock/' + ticker + '/quote?token=pk_a778c55111784e1385443a21838cd069', {json: true}, (err, res, body) => {\n if(err){\n return console.log(err);\n }\n if(res.statusCode === 200){\n finishedAPI(body)\n }\n })\n}", "title": "" }, { "docid": "867862218834ade975be6a399adcb033", "score": "0.6418931", "text": "function newQuote() {\n //This gets the new random quote\n $.ajax({\n url: \"http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1\",\n //If the URL is successful, then it executes the function with json being the object retrieved from the URL.\n success: function (json) {\n //Select random color\n var randomColor = colorsQuote[Math.floor(Math.random() * colorsQuote.length)];\n //Set quote\n var quote = \"<p id='quote'>\" + json[0].content.replace(\"<p>\", \"\");\n twitterQuote = json[0].content.replace(/<p>|<\\/p>|\\n/g, \"\");\n //Set author\n var author = \"<p id='author'>~\" + json[0].title + \"</p>\";\n twitterAuthor = json[0].title;\n //Put new quote and author in div\n $(\"#div1\").prepend(quote, author);\n //Change colors with new quote\n $(\"#random-quote\").css(\"background-color\", randomColor);\n $(\"#activation\").css(\"background-color\", randomColor);\n $(\"#div1\").css(\"color\", randomColor);\n $(\"#twitter\").css(\"background-color\", randomColor);\n },\n //In case the apex doesn't work\n error: function () {\n $(\"#div1\").empty();\n $(\"#div1\").append(\"There was an error\");\n },\n //I read on a reddit post that this will allow a new quote to be generated.\n cache: false\n });\n}", "title": "" }, { "docid": "baab520a911b4a26984e463b7b5387bc", "score": "0.64003414", "text": "function requestQuote(twoDigitYear) {\n\n // Barchart API call where the symbol for September 2018 feeder calves is hardwired in \n var queryURL = \"https://marketdata.websol.barchart.com/getQuote.json?apikey=fb979bafe708bfae93cf3f7537d8b896&symbols=GFU18\"\n \n // alternative API call if the current year is provided in variable twoDigitYear\n // var queryURL = \"https://marketdata.websol.barchart.com/getQuote.json?apikey=fb979bafe708bfae93cf3f7537d8b896&symbols=GFU\" + twoDigitYear\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n \n var price = response.results.lastPrice;\n console.log(price);\n }\n );\n}", "title": "" }, { "docid": "0a1ee520fbdbfdabc56fd521d1032a6f", "score": "0.63914937", "text": "function getQuote() {\n $.ajax({\n type : 'GET',\n url : 'https://quotes.rest/qod?language=en',\n dataType : 'json',\n success : function(data) {\n var item = document.getElementById(\"person_bio\");\n item.value = data.contents.quotes[0].quote;\n },\n error : function(request){\n console.log(JSON.stringify(\"Error: \" + request));\n }\n });\n}", "title": "" }, { "docid": "0e6dcd86934f401e4ce7b22e39ae6246", "score": "0.63649064", "text": "function getAllQuote() {\n var newRequest = new Request();\n newRequest['type'] = \"GET\";\n newRequest['url'] = \"http://harryquotes-216807.apse1.nitrousbox.com:8080/quotes\";\n newRequest[\"success\"] = function(response){\n $('.return-content').text('');\n if (response.length > 0) {\n $.each(response, function(index){\n $('.return-content').append('<div class=\"content-row col-xs-12\"> \\\n <div class=\"col-lg-2 hidden-sm hidden-xs hidden-md id\">'+response[index][\"_id\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-6 col-sm-5 quote\">'+response[index][\"quote\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-2 col-sm-2 author\">'+response[index][\"author\"]+'</div> \\\n <button class=\"update btn btn-primary\">Update</button> \\\n <button class=\"delete btn btn-primary\">Delete</button> \\\n </div>'\n );\n });\n } else if (response.length === 1){\n $('.return-content').append('<div class=\"content-row col-xs-12\"> \\\n <div class=\"col-lg-2 hidden-sm hidden-xs hidden-md id\">'+response[\"_id\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-6 col-sm-5 quote\">'+response[\"quote\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-2 col-sm-2 author\">'+response[\"author\"]+'</div> \\\n <button class=\"update btn btn-primary\">Update</button> \\\n <button class=\"delete btn btn-primary\">Delete</button> \\\n </div>'\n );\n } else {\n $('.return-content').append(\"No results found.\");\n }\n }\n\n $.ajax(newRequest);\n }", "title": "" }, { "docid": "6af09403e0e00485d41e69807654552b", "score": "0.636281", "text": "function fetchSong() {\n let choice = $('option:selected').attr('data-songpk');\n\n // name and functionalize the ajax call\n // call those functions within this area\n $.ajax({\n url: `/api/songs/${choice}`,\n method: 'GET',\n success: function (response) {\n parseResponse(response);\n },\n error: function (err) {\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "f37d6c0a612afbeea02c4615576df38d", "score": "0.63616264", "text": "function btnBible() {\n // var category = '&category=love';\n var ourRequest = new XMLHttpRequest(); //opens new XML request\n ourRequest.open('POST', 'https://quotes.rest/quote/search.json?author=bible&' + clave); //gets JSON data\n\n ourRequest.onload = function() {\n var ourData = JSON.parse(ourRequest.responseText);\n // console.log(ourData.contents.quote);\n renderHTML(ourData);\n };\n ourRequest.send();\n}", "title": "" }, { "docid": "ac690b318970c52454a7e90a58bb5b45", "score": "0.6346237", "text": "getQuote() {\n var xhr = new XMLHttpRequest();\n var url = 'https://andruxnet-random-famous-quotes.p.mashape.com/';\n var data = {};\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4 && xhr.status == 200) {\n data = JSON.parse(xhr.responseText);\n this.setState({quote: data.quote}); // stores quote into state\n this.setState({author: '- ' + data.author}); // stores author into state\n $('#quote').fadeIn();\n $('#author').fadeIn();\n }\n };\n\n xhr.open('GET', url, true);\n xhr.setRequestHeader('X-Mashape-Key', 'RWDGX6A9NOmshtysnIctYO1avh2Sp1hv1myjsnMzSJasRoR2A8');\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n }", "title": "" }, { "docid": "96c9d968ebebd60c6cf6860f700cde81", "score": "0.6345179", "text": "function getArtist() {\n var randomID = randomize(9999);\n var artistURL = \"https://api.musixmatch.com/ws/1.1/artist.get?format=jsonp&callback=callback&artist_id=\" + randomID + \"&apikey=\" + key;\n $.ajax({ url: artistURL, dataType: \"jsonp\", jsonpCallback: \"artistResults\" });\n}", "title": "" }, { "docid": "9c5f2bc78b4ddb265b52bd48f5a62caa", "score": "0.63249004", "text": "function getAjaxMercado(){\r\n $.ajax({\r\n url: \"https://api.coingecko.com/api/v3/coins/markets?vs_currency=ars&order=market_cap_desc&per_page=25&page=1&sparkline=false\",\r\n type: \"GET\",\r\n dataType: \"json\"\r\n }).done((resultado)=>{\r\n armadoDeTabla(resultado, 'ars');\r\n }).fail(()=>{\r\n mensajeError('#mercado__lista')\r\n clearInterval(intervalo)\r\n })\r\n}", "title": "" }, { "docid": "95f73623641a572e40c36a02c0e1b3ea", "score": "0.63248855", "text": "function callAPI(finishedAPI, ticker) {\n request('https://cloud.iexapis.com/stable/stock/'+ticker+'/quote?token=pk_217be3b5db4a4cb8bf400fd4ab1348f5',{json: true},(err, res, body) =>{\n if(err){return console.log(err)};\n if(res.statusCode == 200) {\n finishedAPI(body);\n };\n });\n}", "title": "" }, { "docid": "8b9a4d26eff8c14a5b5966b3a6bdcd40", "score": "0.631834", "text": "function likeButtonMostLikes(questionID) {\n\n var Question_ID = questionID;\n var dataString = \"Question_ID=\" + Question_ID;\n\n $.ajax({\n url: \"http://13.59.122.228/api/Question/likequestion.php\",\n type: \"POST\",\n dataType: \"json\",\n data: dataString,\n //on success it will call this function\n success: function (data) {\n updateMostLikes();\n }\n\n });\n\n}", "title": "" }, { "docid": "811fc36bedaea9654d3cb1568ee64b02", "score": "0.63149774", "text": "function call_api(finishedAPI, ticker) {\n request('https://cloud.iexapis.com/stable/stock/' + ticker + '/quote?token=pk_662c636e819146319df2e6cd25f0e9e7',\n {json: true}, (err, res, body) => {\n \n if (err) {return console.log(err);}\n if (res.statusCode === 200){\n //console.log(body);\n finishedAPI(body);\n };\n });\n\n}", "title": "" }, { "docid": "49189abd91fbd1df0ab7c030b643a903", "score": "0.6300181", "text": "function displayQuote() {\n var xhReq = new XMLHttpRequest();\n xhReq.open(\"GET\", 'https://api.quotable.io/random', false);\n xhReq.send(null);\n var jsonObject = JSON.parse(xhReq.responseText);\n console.log(jsonObject)\n document.getElementById(\"quote\").innerHTML = jsonObject.content + \" -\" + jsonObject.author\n}", "title": "" }, { "docid": "b69b68b383afa28be454d4df8cb50013", "score": "0.62812614", "text": "function getAllNewQuote() {\n var newRequest = new Request();\n newRequest['type'] = \"GET\";\n newRequest['url'] = \"http://harryquotes-216807.apse1.nitrousbox.com:8080/newQuotes\";\n newRequest[\"success\"] = function(response){\n $('.return-new-content').text('');\n if (response.length > 0) {\n $.each(response, function(index){\n $('.return-new-content').append('<div class=\"content-row col-xs-12\"> \\\n <div class=\"col-lg-2 hidden-sm hidden-xs hidden-md id\">'+response[index][\"_id\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-6 col-sm-5 quote\">'+response[index][\"quote\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-2 col-sm-2 author\">'+response[index][\"author\"]+'</div> \\\n <button class=\"add btn btn-primary\">Add</button> \\\n <button class=\"delete-new btn btn-primary\">Delete</button> \\\n </div>'\n );\n });\n } else if (response.length === 1){\n $('.return-new-content').append('<div class=\"content-row col-xs-12\"> \\\n <div class=\"col-lg-2 hidden-sm hidden-xs hidden-md id\">'+response[\"_id\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-6 col-sm-5 quote\">'+response[\"quote\"]+'</div> \\\n <div contentEditable=\"true\" class=\"col-xs-2 col-sm-2 author\">'+response[\"author\"]+'</div> \\\n <button class=\"add btn btn-primary\">Add</button> \\\n <button class=\"delete-new btn btn-primary\">Delete</button> \\\n </div>'\n );\n } else {\n $('.return-new-content').append(\"No results found.\");\n }\n }\n\n $.ajax(newRequest);\n }", "title": "" }, { "docid": "5226d767101d74dd80f8f71147d1e34c", "score": "0.6279197", "text": "function getRandomQuote(action) {\n var baseApi = \"http://quotbook.com/widget/~\";\n var query = action.replace(/\\s+/g, '-');\n var type = \".json\";\n var uri = baseApi + query + type;\n var quote;\n request( uri, function (error, response, body) {\n if (!error && response.statusCode == 200) { \n var jsonResponse = JSON.parse(body);\n quote = stripQuote(jsonResponse.quote, action);\n console.log('LOGGING',quote);\n return quote;\n }\n });\n}", "title": "" }, { "docid": "520b843ca7703586bf3bf349dacef382", "score": "0.62760836", "text": "async function getQuote(event, params = 0) {\n showLoadingSpinner();\n const apiUrl = 'https://type.fit/api/quotes';\n try {\n const response = await fetch(apiUrl);\n const apiQuotes = await response.json();\n const quote = apiQuotes[Math.floor(Math.random() * apiQuotes.length)];\n\n // if the same quote is loaded again\n if(quote.innerText == quote['text']){\n throw \"Same quote\";\n }\n\n if(quote['text'].length>120){\n quoteText.classList.add('long-quote');\n }else{\n quoteText.classList.remove('long-quote');\n \n }\n quoteText.innerHTML = quote['text'];\n authorText.innerHTML = quote['author'] === '' ? 'Unknown' : quote['author'];\n\n removeLoadingSpinner();\n } catch (error) {\n console.log('No quotes available, trying again! ', error);\n if(params === 10) {\n loader.classList.add('stuck-loader');\n setTimeout(function(){ alert(\"Something went wrong. Please refresh the page.\"); }, 1500);\n return;\n }\n getQuote(event, params+1);\n }\n}", "title": "" }, { "docid": "cb5678f5bd4191a36c8038d89f7da0ea", "score": "0.6264143", "text": "async function getQuote() {\n const apiUrl = \"https://type.fit/api/quotes\";\n try {\n const response = await fetch(apiUrl);\n data = await response.json();\n newQoute();\n } catch (error) {\n console.log(\"There is no quote Fetched\", error);\n }\n}", "title": "" }, { "docid": "831f8c4fe4480549d15d9e54c00da0d7", "score": "0.6253134", "text": "function similars() {\n $.ajax({\n url: 'http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=Bad+Bunny&api_key=' + dades.myAPI_key + '&format=json',\n dataType: 'json',\n method: 'GET'\n }).then(function (data) {\n printSimilars(data);\n });\n}", "title": "" }, { "docid": "b99d8beff56fad32079919a449d13f19", "score": "0.6246863", "text": "async function getQuote(){\r\n showLoadingSpinner();\r\n const proxyUrl = 'https://whispering-tor-04671.herokuapp.com/'\r\n const apiUrl = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\r\n try{\r\n const response = await fetch( proxyUrl + apiUrl);\r\n const data = await response.json();\r\n\r\n console.log(data);\r\n //if quote is larger to display add the css to reduce the font\r\n if( data.quoteText.length > 100 ){\r\n quoteText.classList.add('long-quote');\r\n }else{\r\n quoteText.classList.remove('long-quote');\r\n }\r\n quoteText.innerHTML = data.quoteText;\r\n \r\n //if author is unknown\r\n if(data.quoteAuthor == ''){\r\n quoteAuthor.innerHTML = 'Unknown'\r\n }else{\r\n quoteAuthor.innerHTML = data.quoteAuthor;\r\n }\r\n hideLoadingSpinner();\r\n }catch(error){\r\n if(error)\r\n getQuote();\r\n console.log(error); \r\n }\r\n}", "title": "" }, { "docid": "608be408efd3442ca3bb343ee6103ef2", "score": "0.6222679", "text": "function likeButtonMostRecent(questionID) {\n\n var Question_ID = questionID;\n var dataString = \"Question_ID=\" + Question_ID;\n\n $.ajax({\n url: \"http://13.59.122.228/api/Question/likequestion.php\",\n type: \"POST\",\n dataType: \"json\",\n data: dataString,\n //on success it will call this function\n success: function (data) {\n updatelikesMostRecent();\n }\n\n });\n\n}", "title": "" }, { "docid": "a29fb6067080bc9ada751e77c7d3a5fc", "score": "0.62101686", "text": "async function getQuote(){\n loadingSpin();\n try{\n const response =await fetch(API);\n apiQuotes=await response.json();\n textAdjustment();\n hiddeSpin();\n }catch(err){\n const error = new Error(err);\n console.log(error);\n }\n}", "title": "" }, { "docid": "faa01bf73bfd223d276ebc1c5a5cf4b2", "score": "0.620959", "text": "function getNewQuestion() {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n // Assign Open Trivia DB response to object\n triviaResponse = response;\n // Start guess timer\n startGuessTimer();\n // Call Display Question/Choices\n displayQuestionChoices();\n }); \n}", "title": "" }, { "docid": "9ba4d81c3a20103d8cde30c6c9e24db6", "score": "0.6208746", "text": "function getSymbol() {\n console.log(\"running\");\n $.ajax({\n type: \"GET\",\n data: {\n apikey: \"bpulodvrh5rdgi0uf2ug\",\n format: \"json\",\n },\n\n url: \"https://finnhub.io/api/v1/stock/symbol?exchange=US&token=bpulodvrh5rdgi0uf2ug\",\n dataType: \"json\",\n contentType: 'application/json',\n success: function (data) {\n console.log(data);\n var stockName = data[0, 1, 2].displaySymbol;\n globalStocklist = data;\n console.log(stockName);\n \n }, \n fail: function(error) {\n console.log(error);\n } \n });\n }", "title": "" }, { "docid": "44a4f6bfcdbfadcaaff7a9d58113ef88", "score": "0.6202465", "text": "async function getQuote() {\n loading();\n const proxyUrl= 'https://cors-anywhere.herokuapp.com/'\n const apiUrl = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n \n try {\n const response = await fetch(proxyUrl + apiUrl, {\n headers: {\n 'Access-Control-Allow-Origin': '*'\n }\n })\n const data = await response.json();\n quoteText.innerText = data.quoteText;\n quoteAuthor.innerText = data.quoteAuthor;\n console.log(data);\n \n complete();\n } catch (error) {\n console.log('ops', error);\n }\n \n}", "title": "" }, { "docid": "f14b7eb68157301e3ed8fe7cd33370a8", "score": "0.61982983", "text": "async function getQuote(){\r\nconst url = 'https://api.quotable.io/random'\r\n\r\ntry {\r\n //fetching data using fetch method\r\n const res= await fetch(url);\r\n const data = await res.json();\r\n console.log(data);\r\n UpdateUi(data)\r\n}\r\ncatch (err) {\r\n getQuote();\r\n console.log(err.message)\r\n}\r\n\r\n}", "title": "" }, { "docid": "bfd8854831f288b613b4b8d4f399bc68", "score": "0.61961526", "text": "function surpriseAJAXRequest() {\n $.ajax({\n type: \"GET\",\n dataType: \"jsonp\",\n url: 'https://en.wikipedia.org/w/api.php?action=query&list=random&format=json',\n success: surpriseWikiResponse\n });\n }", "title": "" }, { "docid": "a9df89da141660904869d8b92b223a18", "score": "0.6190164", "text": "async function getQuote() {\n showLoadingSpinner();\n\n // personal cors proxy\n const proxy = 'https://murmuring-caverns-60366.herokuapp.com/';\n\n const url = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n\n try {\n const response = await fetch(proxy + url);\n const data = await response.json();\n\n authorText.innerText = data.quoteAuthor === '' ? 'Unknown' : data.quoteAuthor;\n\n // reduce font for long quotes\n if (data.quoteText.length > 80 ) {\n quoteText.classList.add('long-quote');\n } else {\n quoteText.classList.remove('long-quote');\n }\n\n quoteText.innerText = data.quoteText;\n\n hideLoadingSpinner();\n apiRetry = 0;\n \n } catch (error) {\n console.log(error);\n apiRetry++;\n if (apiRetry < 5) getQuote();\n else throw alert('Unable to load quotes please try again later...');\n }\n}", "title": "" }, { "docid": "69ad17c0de50b40bfef242b6f85a2a44", "score": "0.6180872", "text": "async function getQuotes() {\n showLoadingSpinner();\n const apiUrl = \"https://type.fit/api/quotes\";\n try {\n const response = await fetch(apiUrl);\n apiQuotes = await response.json();\n newQuote();\n } catch (error) {\n quoteText.textContent = \"Whoops, Failed to get data.\";\n quoteAuthorText.textContent = \"Are you connected to the Internet?\";\n }\n removeLoadingSpinner();\n}", "title": "" }, { "docid": "e6b4cf521a82726b713612318dc8435a", "score": "0.61751986", "text": "async function getQuotes() {\n loading();\n const API_URL = \"https://type.fit/api/quotes\";\n\n try {\n const res = await fetch(API_URL);\n apiQuotes = await res.json();\n newQuote();\n renderQuote(quote);\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "369b0d5c698ab9c4efc2f8d71b736b8b", "score": "0.6173074", "text": "async function getmyQuote(){\n showLoading();\n //API called from https://forismatic.com/en/api/ - \n const proxyUrl = 'https://cors-anywhere.herokuapp.com/'\n const apiUrl = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n try { \n // combininig the proxy url with apiUrl to get over the issue of CORS (browser's same origin policy)\n const response = await fetch(proxyUrl + apiUrl);\n const data = await response.json();\n // Condition to check whether author is blank and add 'Unknown'\n if(data.quoteAuthor === ''){\n quoteAuthor.innerText='-Unknown';\n } else{\n quoteAuthor.innerText=data.quoteAuthor;\n }\n //Reduce ong quotes for long quotes\n if (data.quoteText.length > 120){\n quoteText.classList.add ('long-quote')\n } else { \n quoteText.classList.remove ('long-quote')\n }\n quoteText.innerText = data.quoteText;\n hideLoading();\n console.log(data); \n } catch (error) {\n // this is to ensure if the API gives error due to special characters, it runs t he function again to fetch the next quote\n getmyQuote();\n console.log('Eror fetching quote: ' , error);\n }\n}", "title": "" }, { "docid": "f8ba6735419022d7a5a1b3134c993113", "score": "0.61727923", "text": "function getRandQuote() {\n axios.get('https://quote-garden.herokuapp.com/api/v2/quotes/random')\n .then(res => {\n const quote = res.data.quote.quoteText\n\n const params = {\n icon_emoji: ':pencil2:'\n };\n \n bot.postMessageToChannel('general', \n `Random Quote: ${quote}`, params) \n })\n}", "title": "" }, { "docid": "5d6eebfbdb5bfb8ce95cc0bdd4eb2eef", "score": "0.6172732", "text": "function likeButtonMostViewed(questionID) {\n\n var Question_ID = questionID;\n var dataString = \"Question_ID=\" + Question_ID;\n\n $.ajax({\n url: \"http://13.59.122.228/api/Question/likequestion.php\",\n type: \"POST\",\n dataType: \"json\",\n data: dataString,\n //on success it will call this function\n success: function (data) {\n updatelikesMostViewed();\n }\n\n });\n\n}", "title": "" }, { "docid": "46e4224386da2ee39ea859f1b3e6fb9f", "score": "0.6171836", "text": "async function getQuotes() {\n const apiUrl = 'https://type.fit/api/quotes';\n try {\n //this const will not be populated until it has data from our api\n const response = await fetch(apiUrl);\n //getting the json response from our api, turn that response into an object, pass it into global variable\n apiQuotes = await response.json();\n newQuote();\n } catch (error) {\n //catch error here\n }\n}", "title": "" }, { "docid": "672903d1f5627741de7d1e84e403e5ac", "score": "0.61580366", "text": "function buscarId(nameTrack,nameartist){\n //console.log(\"texto\");\n $.ajax({\n type: \"GET\",\n dataType: \"jsonp\",\n data: {\n apikey: \"af357840f7555def09db452b7c8b0865\",\n format: \"jsonp\",\n q_track: nameTrack,\n q_artist: nameartist\n },\n url: \"http://api.musixmatch.com/ws/1.1/track.search\",\n success: function(response){\n // console.log(response);\n buscarLetra(response.message.body.track_list[0].track.track_id);\n // console.log(response.message.body.track_list[0].track.track_id);\n },\n error: function(error) {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "52f092f9a536b78bb2be846a03e0b9e1", "score": "0.615174", "text": "function saveQuote() {\n // Collect Form Details\n let quote_text = $('#quote_text').val();\n let rating_value = parseInt($('#rating').val());\n\n // Prepare JSON data for storing \n let quote = {\n quoteText: quote_text,\n rating: rating_value\n };\n\n // Request the API for Insertion\n $.ajax({\n type: \"POST\",\n url: address,\n data: JSON.stringify(quote),\n contentType: \"application/json; charset=utf-8\"\n }).done(function (response) {\n // Display the appropriate message \n $(\"#add_result\").html(\"Quote is Saved\");\n // Refresh All Quotes Details\n loadQuotes();\n }).fail(function (xhr, status) {\n // Display the appropriate message \n $(\"#add_result\").html(\"Quote is not Saved\");\n });\n}", "title": "" }, { "docid": "1748eeaf663c46429b46900efc1c3131", "score": "0.61491066", "text": "async function getQuote(){\n loading();\n\n const proxyUrl= 'https://cors-anywhere.herokuapp.com/'\n const apiUrl = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n\n try{\n const respone = await fetch(proxyUrl + apiUrl);\n const data = await respone.json();\n// If Quote length are high , then we reduce the size of quote. \n if(data.quoteText.length > 120){\n quoteText.classList.add(\"long-quote\");\n } else {\n quoteText.classList.remove(\"long-quote\");\n }\n\n quoteText.innerText = data.quoteText;\n// IF author is blank\n if(data.quoteAuthor === \"\"){\n authorText.innerText = \"Unknown\"\n } else {\n authorText.innerText = data.quoteAuthor;\n }\n\n complete();\n \n\n } catch(error){\n getQuote();\n }\n}", "title": "" }, { "docid": "7a4ce0334f845e5a2b89b10aac571fe6", "score": "0.6148306", "text": "function sendQuizzData() {\n\n console.log(\"call the ajax function\");\n $.ajax({\n type: \"POST\",\n url: 'https://shouldibuythebag.com/quizz/saveQuizzData',\n data: {\n 'item': myitem,\n 'analytics_likeit': analytics_likeit,\n 'analytics_likeit_answer': analytics_likeit_answer,\n 'analytics_wantit': analytics_wantit,\n 'analytics_wantit_answer': analytics_wantit_answer,\n 'analytics_onquality': analytics_onquality,\n 'analytics_onquality_answer': analytics_onquality_answer,\n 'analytics_needit': analytics_needit,\n 'analytics_needit_answer': analytics_needit_answer,\n 'analytics_impulseshopping': analytics_impulseshopping,\n 'analytics_impulseshopping_answer': analytics_impulseshopping_answer,\n 'analytics_onlineshopping': analytics_onlineshopping,\n 'analytics_onlineshopping_answer': analytics_onlineshopping_answer,\n 'analytics_onlineshoppingbis': analytics_onlineshoppingbis,\n 'analytics_onlineshoppingbis_answer': analytics_onlineshoppingbis_answer,\n 'analytics_onlineshoppingter': analytics_onlineshoppingter,\n 'analytics_onlineshoppingter_answer': analytics_onlineshoppingter_answer,\n 'analytics_ownit': analytics_ownit,\n 'analytics_ownit_answer': analytics_ownit_answer,\n 'analytics_manyofit': analytics_manyofit,\n 'analytics_manyofit_answer': analytics_manyofit_answer,\n 'analytics_fitwardrobe': analytics_fitwardrobe,\n 'analytics_fitwardrobe_answer': analytics_fitwardrobe_answer,\n 'analytics_fitme': analytics_fitme,\n 'analytics_fitme_answer': analytics_fitme_answer,\n 'analytics_influencer': analytics_influencer,\n 'analytics_influencer_answer': analytics_influencer_answer,\n 'analytics_influencerbis': analytics_influencerbis,\n 'analytics_influencerbis_answer': analytics_influencerbis_answer,\n 'analytics_onetimeuse': analytics_onetimeuse,\n 'analytics_onetimeuse_answer': analytics_onetimeuse_answer,\n 'analytics_manyuse': analytics_manyuse,\n 'analytics_manyuse_answer': analytics_manyuse_answer,\n 'analytics_sale': analytics_sale,\n 'analytics_sale_answer': analytics_sale_answer,\n 'analytics_salebis': analytics_salebis,\n 'analytics_salebis_answer': analytics_salebis_answer,\n 'analytics_secondhand': analytics_secondhand,\n 'analytics_secondhand_answer': analytics_secondhand_answer,\n 'analytics_secondhandbis': analytics_secondhandbis,\n 'analytics_secondhandbis_answer': analytics_secondhandbis_answer,\n 'analytics_price': analytics_price,\n 'analytics_price_answer': analytics_price_answer,\n 'analytics_pricerange': analytics_pricerange,\n 'analytics_value_range': analytics_value_range,\n 'analytics_affordit': analytics_affordit,\n 'analytics_affordit_answer': analytics_affordit_answer,\n 'analytics_reallyaffordit': analytics_reallyaffordit,\n 'analytics_reallyaffordit_answer': analytics_reallyaffordit_answer,\n 'analytics_rewardyourself': analytics_rewardyourself,\n 'analytics_rewardyourself_answer': analytics_rewardyourself_answer,\n 'analyticsquizz_complete': analyticsquizz_complete,\n 'analytics_end': analytics_end,\n 'analyticsreturn_end': analytics_return_end,\n 'analytics_quit_end': analytics_quit_end\n },\n dataType: \"json\",\n success: function (response) {\n console.log(\"ajax success\");\n console.log(response);\n },\n error: function (response) {\n console.log(\"fail\");\n console.log(response);\n }\n });\n}", "title": "" }, { "docid": "4b792aba90bc8786703a8155b4afc59d", "score": "0.61470866", "text": "function getQuote(id) {\n $.ajax({\n type: \"GET\",\n url: address + \"/\" + id,\n contentType: \"application/json\"\n }).done(function (quote) {\n $('#quote_id').val(quote.id);\n $('#quote_text_edit').val(quote.quoteText);\n $('#rating_edit').val(quote.rating);\n });\n}", "title": "" }, { "docid": "31b1a17f71f8ebf32dad1cce4410511a", "score": "0.6144255", "text": "function askProduct() {\n var url = api + input.value()+ apiKey ;\n loadJSON(url, gotData);\n\n}", "title": "" }, { "docid": "cf85f56817f2780b0f5544094bbbebb2", "score": "0.6138868", "text": "function bibleApiCall()\n{\n var link = \"https://labs.bible.org/api/?passage=votd&type=json\";\n $.ajax( { url : link,\n method : 'GET',\n crossDomain : true,\n dataType : 'jsonp',\n success : function( r ) {\n var bookname = r[0].bookname;\n var chapter = r[0].chapter;\n var verse = r[0].verse;\n var text = r[0].text;\n var content = \"<legend>Verse Of The Day</legend>\";\n content += \"<blockquote>\";\n content += \"<p id='bible'>\" + text + \"</p>\";\n content += \"<small>\" + bookname + \" \" + chapter + \":\" + verse + \"<cite title='Source Title'>NIV</cite></small>\";\n content += \"</blockquote>\";\n $(\"#randomVerse\").html( content );\n },\n error : function( error ){\n alert(\"opps something went wrong!\")\n }\n });\n}", "title": "" }, { "docid": "3ed2aa134574d6c0111d18a1908cffe0", "score": "0.6131041", "text": "async function getQuotes() {\n showLoadingSpinner() // called here to appear before anything loads\n const apiUrl = 'https://type.fit/api/quotes';\n // make a fetch request by using try/catch so if an error occurs we can use its information and do something with it\n try {\n // setting the response const only after it has fetched the data\n const response = await fetch(apiUrl);\n apiQuotes = await response.json();\n newQuote() // calls complete() when everything is loaded\n } catch (error) {\n //Catch Error here, if we catch an error and we try to run the same func again we must make a threshhold where we dont end up in a endless loop wich will brake our program\n }\n}", "title": "" }, { "docid": "78098b20c0f60099ce4c6dba3ad41113", "score": "0.60987544", "text": "function countryapicall(x) {\n\n var ajaxurl = query.country.url + x.toLowerCase();\n\n\n $.ajax({\n url: ajaxurl,\n method: \"GET\"\n }) .then (function (result){\n\n var data = result\n\n console.log(\"country\", data)\n\n //function to show data in html\n htmlpushercountryinfo(data)\n\n //pass city name for weather api\n weatherapicall(data[0].capital)\n\n })\n\n}", "title": "" }, { "docid": "aaf04d8c83bb586d0ad885055f48c9a0", "score": "0.60964113", "text": "function submitOrder(albumIDs, albumTitles, orderTotal){\n $.ajax({\n method: \"GET\",\n url: \"/api/submitOrder\",\n data: {\n \"albumIDs\": albumIDs,\n \"albumTitles\": albumTitles,\n \"orderTotal\": orderTotal\n },\n \n success: function(data, status){\n console.log(\"Submit order returned: \" + data);\n }\n });//ajax\n }", "title": "" }, { "docid": "82f406a599de98410f30f338f8546d97", "score": "0.6089511", "text": "function getStockPrice(stockSymbol) {\n $.ajax({\n url: `${IEXCLOUD_PRICE_API_URL}${stockSymbol}/price?token=${IEXCLOUD_API_KEY}`,\n method: \"GET\"\n }).then(function(response) {\n // Test\n console.log(response);\n\n displayStockPrice(response);\n });\n}", "title": "" }, { "docid": "2a68c1416f2f057483cc58ddb8a761f8", "score": "0.6087715", "text": "function functionCallAPI(destCountry, destCity, destZip) {\n\n /* For news Api */\n var NEWS_API_KEY = 'b83d1089394b41b5860ba157c186b529';\n \n var queryURL = \"https://newsapi.org/v2/everything?q='\" + destCity + \"'&apiKey=\" + NEWS_API_KEY;\n //var queryURL = \"https://newsapi.org/v2/top-headlines?q='\" + destCity + \"'&category=general&country=\" + destCountry + \"&apiKey=\" + NEWS_API_KEY;\n $.ajax({\n\n url: queryURL,\n\n method: \"GET\"\n\n }).then(function (response) {\n\n //console.log(response);\n drycode(response);\n });\n}", "title": "" }, { "docid": "97986f26668a0b3d9ad203801b733dd8", "score": "0.60824245", "text": "function addShippingQuote(url){\n\t\ttry {\n jQuery.ajax( {\n url : url,\n dataType : 'json',\n success : function(data) {\n refreshQuotes(data); \n\t\t\t\t\t \n }\n });\n } catch (e) {\n }\n }", "title": "" }, { "docid": "2ca7ae757697288373b8ee9f341672ce", "score": "0.60818774", "text": "function fetchRandomTriviaQuestion(callback) {\n // This API gets random trvia questions\n // The url includes parameters to configure the API to only return\n // true or false trivia on animals encoded in base64\n\n // Configure your own api call at https://opentdb.com/api_config.php\n let promise = $.get(\"https://opentdb.com/api.php?amount=1&category=27&type=boolean&encode=base64\");\n\n // $.get is asynchronous, so we need to define a\n // handler for when the request is complete\n promise.done(function(data) {\n // Check the console when you have the API call working in order\n // to inspect the json object that we recieve\n console.log(data);\n\n // extract and decode the results\n let results = data.results;\n\n // atob() is a built in method to decode base64 encoded strings\n let question = atob(results[0].question);\n let answer = atob(results[0].correct_answer);\n\n // call the function we passed into fetchRandomTriviaQuestion\n callback(question, answer);\n })\n}", "title": "" }, { "docid": "3e4f7f7fbcb7675e2cff9dd881c5c20a", "score": "0.6080451", "text": "function newQuote() {\n //Pick a random quote from apiQuotes array\n const quote = apiQuotes[Math.floor(Math.random() * apiQuotes.length)];\n console.log(quote);\n}", "title": "" }, { "docid": "36c6cd64b82038ea6ec99b3fe2aadabc", "score": "0.60793495", "text": "function showQuotes(){\n //Generate Random Number bw 0 to 1600\n Quote = QuotesCollection[Math.floor((Math.random() * QuotesCollection.length))];\n //If Quote is fetched then show Quote else Alert User\n if (Quote.text) {\n //Remove the loader to show Quotes\n removeLoader();\n if( Quote.text.length > 35 ) {\n //Change font size for Responsiveness on Mobile Devices\n quoteContainer.classList.add('long-quote-text');\n }\n //Add the Quote to UI\n quoteContainer.innerHTML = Quote.text;\n //Add the Author Name to UI\n if (Quote.author)\n document.getElementById(\"author\").innerHTML = Quote.author;\n else\n document.getElementById(\"author\").innerHTML = 'Unknown!';\n }\n else {\n alert(\"Unable to fetch Quotes from API!\");\n console.log(Quote);\n }\n}", "title": "" }, { "docid": "7b4fb1477245bc85b209903daded3026", "score": "0.6077079", "text": "async function urlApi(){\n url = await fetch(\"https://cfw-takehome.developers.workers.dev/api/variants\")\n .then(res => res.json())\n .then(data => {\n const ind = Math.floor(Math.random()*2)\n return data['variants'][ind]\n })\n return url\n}", "title": "" }, { "docid": "7258f6c1ec6f11747a4b452f73b87fca", "score": "0.60669714", "text": "function getQuotes() {\n $.ajax({\n type: 'GET',\n url: '/quotes/getQuotes',\n success: function(data) {\n if(data.length > 0) {\n for (i = 0; i <= data.length; i++){\n var num = Math.floor(Math.random() * 10 + 1);\n if (i == 0) {\n $('<div class=\"carousel-item active\"><img class=\"d-block w-100 slide-image\" src=\"images/' + num + '.jpg\"><div class=\"carousel-caption\">' +\n '<p class=\"quote-quote\">' + data[i].quote + '</p><p class=\"quote-id\" hidden>' + data[i]._id + '</p></div></div>').appendTo('.carousel-inner');\n } else {\n $('<div class=\"carousel-item\"><img class=\"d-block w-100 slide-image\" src=\"images/' + num + '.jpg\"><div class=\"carousel-caption\">' +\n '<p class=\"quote-quote\">' + data[i].quote + '</p><p class=\"quote-id\" hidden>' + data[i]._id + '</p></div></div>').appendTo('.carousel-inner');\n }\n }\n } else {\n $('<div class=\"carousel-item active\"><img class=\"d-block w-100 slide-image\" src=\"images/11.jpg\"><div class=\"carousel-caption\">' +\n '<p style=\"color: #bf0000\">Ops! You are out of quotes! Go to settings and reset your rejected quotes!</p></div></div>').appendTo('.carousel-inner');\n $('.like-dislike-control').hide();\n }\n }\n });\n}", "title": "" }, { "docid": "c09398e271deabf72385cde3902f9aa7", "score": "0.6059562", "text": "function grabAPIdata (){\n\t\tconsole.log(\"Now grabbing api data ... \");\n\t\tvar stocks = \"NASDAQ:FB,NASDAQ:MSFT,NASDAQ:TSLA,NYSE:BRK.A,TSX:CNQ,NYSE:BABA,TSX:RY,TSX:CM,TSX:TD\"\n\n\t\tvar queryString = \"https://finance.google.com/finance/info?client=ig&q=\" + stocks;\n\t\n\t\t$.ajax({\n\t\t\turl: queryString,\n\t\t\tdataType: \"jsonp\",\n\t\t\tjsonpCallback: \"jsonCallback\"\n\t\t});\t\n}", "title": "" }, { "docid": "a01977e859950c22d758b572d3247a5d", "score": "0.6058083", "text": "getRandomNumber() {\n $.ajax({\n method: \"GET\",\n url: \"http://numbersapi.com/random/trivia?json&min=10&max=100\",\n }).done(response => {\n this.random_number = parseInt(response.number);\n })\n }", "title": "" }, { "docid": "d009e1631e72f2898f9ef9e896b47645", "score": "0.6043364", "text": "function sekolah(){\n\tvar url=\"./sekolah.php?rand=\"+Math.random();\n\tvar post=\"\";\n\tajax(url,post,\"isi\")\n}", "title": "" }, { "docid": "f7bf98f199aa7998d4b1f59c2b44787d", "score": "0.6040347", "text": "async function getQuote() {\n funcCallCount++;\n showLoadingSpinner();\n const proxyUrl = \"https://cors-anywhere.herokuapp.com/\";\n const getQuoteUrl = \"http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en\";\n try {\n const response = await fetch(proxyUrl + getQuoteUrl);\n const data = await response.json();\n data.quoteAuthor === '' ? quoteAuthor.innerText = 'unknown' : \n quoteAuthor.innerText = data.quoteAuthor;\n data.quoteText.length > 120 ? quote.classList.add('long-quote') :\n quote.classList.remove('long-quote');\n quote.innerText = data.quoteText;\n removeLoadingSpinner();\n console.log(data);\n } catch (error) {\n if(funcCallCount >= 15) {\n showingErrorMsg();\n console.log('Count is five plus');\n } else {\n getQuote();\n } \n \n }\n}", "title": "" }, { "docid": "ab64a781624ef8281d053ac50672f5b2", "score": "0.6035936", "text": "function pay(){\n $.ajax({\n url: 'https://z4j54197cb.execute-api.ap-south-1.amazonaws.com/demo/pay?chit_key=' + chit_key + '&amount=' + amount + '&brnch_key=' + brnch_key,\n type: 'get',\n success: function(data){\n \n alert(\"paid\");\n },\n error: function (xhr, ajaxOptions, thrownError) {\n var errorMsg = 'Ajax request failed: ' + xhr;\n console.log(thrownError);\n $('#content').html(errorMsg);\n }\n\n });\n}", "title": "" }, { "docid": "da5178508ced1932997b0aba91730574", "score": "0.6027619", "text": "async function getQuote() {\n showLoading();\n const proxyURL = \"https://cors-anywhere.herokuapp.com/\";\n const apiURL = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json&key=654321';\n try {\n const response = await fetch(proxyURL + apiURL);\n const data = await response.json();\n //Populating an empty author\n if(data.quoteAuthor === '') {\n authorText.innerText = \"Unknown\";\n }\n else {\n authorText.innerText = data.quoteAuthor;\n }\n \n //Reduce font size for longer quotes\n if(data.quoteText.length > 120) {\n quoteText.classList.add(\"long-quote\");\n }\n else {\n quoteText.classList.remove(\"long-quote\");\n }\n quoteText.innerText = data.quoteText;\n hideLoading();\n }\n catch(error) {\n //getQuote();\n console.log(\"No Quote\", error);\n }\n}", "title": "" }, { "docid": "ed8693c3466d618f04bb787d64380b7c", "score": "0.601721", "text": "function ajaxSingleProducts(idEarrings) {\n $.ajax({\n url: \"https://api.mercadolibre.com/items/\"+`${idEarrings}`,\n type: 'GET',\n datatype: 'json',\n limit: 20\n })\n .done(function (response) {\n var data = (response);\n console.log(data);\n descriptionSingleProducts(data);\n })\n .fail(function () {\n console.log(\"error\");\n })\n}", "title": "" }, { "docid": "f2fe451e23d4645aacd6c07370650fcd", "score": "0.6014355", "text": "function getData(value){\nvar corsProxy = 'https://cors-anywhere.herokuapp.com/'; //proxy to allow app to get around 'No Access-Control-Allow-Origin header' errors\nvar url = corsProxy + \"https://www.bitstamp.net/api/v2/ticker/\" + value;\n$('#choice').html(value.toUpperCase());\n$.ajax({\n\ttype: \"GET\",\n \turl: url,\n success: function(data) {\n \tappendToHtml(data);\n },\n fail: function() {\n \t$('#results').show();\n \t$('#results').html('<h5>Sorry, something went wrong, please try again.</h5>')\n }\n});\n}", "title": "" }, { "docid": "bb6f360b7351f6bcb760f44875e140af", "score": "0.6013582", "text": "function getAllQuotes(){\n document.getElementById(\"quotes\").innerHTML = \"\"\n http.open(\"GET\", \"https://www.erikgolke.com/reader/all\")\n http.setRequestHeader('Access-Control-Allow-Headers', '*');\n http.setRequestHeader('Content-type', 'application/json');\n http.setRequestHeader('Access-Control-Allow-Origin', '*');\n http.onload = function () {\n if(http.readyState === http.DONE && http.status === 200) {\n console.log(http.response);\n res = JSON.parse(http.response);\n res.forEach(element => {\n let authorName = element[\"author\"]\n let quoteText = element[\"quote\"]\n generateForm(authorName, quoteText);\n })\n\n }\n }\n http.send();\n}", "title": "" }, { "docid": "f237c40dd5fdb4053f1fa8c76312b502", "score": "0.6009463", "text": "async function getQuote() {\n\n // Show Loader till we get a quote \n showLoadingSpinner();\n\n const proxyUrl = 'https://cors-anywhere.herokuapp.com/';\n const apiUrl = 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n try {\n const response = await fetch(proxyUrl + apiUrl);\n const data = await response.json();\n\n //If no author is there, add 'Unknown'\n if (data.quoteAuthor === '') {\n authorText.innerText = 'Unknown';\n } else {\n authorText.innerText = data.quoteAuthor;\n }\n\n //If quote's length is above 100, add 'long-quote' class to reduce font-size\n if (data.quoteText.length > 100) {\n quoteText.classList.add('long-quote');\n } else {\n quoteText.classList.remove('long-quote')\n }\n quoteText.innerText = data.quoteText;\n\n // Stop Loader, and show quote \n hideLoadingSpinner();\n } catch (error) {\n getQuote();\n }\n}", "title": "" }, { "docid": "753d3bf9698100fc9a8bb12260dbaf03", "score": "0.60078615", "text": "function wikiRandomQuery() {\n $.ajax({\n url: 'https://en.wikipedia.org/w/api.php',\n type: 'GET',\n dataType: 'json',\n data: {\n action: 'query',\n format: 'json',\n list: 'random',\n rnlimit: '1',\n rnnamespace: 0,\n origin: '*'\n },\n success: searchRandom\n })\n .done(function() {\n console.log(\"done\");\n })\n .fail(function() {\n console.log(\"error\");\n })\n .always(function() {\n console.log(\"complete\");\n })\n }", "title": "" }, { "docid": "d1f611f88d7a1c3bc80cfe919d1b6f8c", "score": "0.6004313", "text": "function companyGenerateApiKey(compId) {\n var dataToSend = \"company.id=\"+compId;\n $.ajax({\n url : apiKeyGeneratorUrl,\n type : \"GET\",\n data : dataToSend,\n dataType : \"text\",\n cache : false,\n async : true,\n success : function(response, status) {\n $('#apiKeysCompanyAPIKey').val(response);\n var dataToSend = \"company.apiKey=\" + response;\n dataToSend += \"&company.id=\"+compId;\n dataToSend += \"&format=json\";\n $.ajax({\n url : updateCompanyUrl,\n type : \"POST\",\n noticeType : \"PUT\",\n data : dataToSend,\n dataType : \"json\",\n cache : false,\n async : true\n });\n }\n });\n}", "title": "" } ]
a896806497ddf519c20763494f28aea0
Return the date in browser's local time zone. Without year.
[ { "docid": "27cf425a14f4dca90b988dfec895356e", "score": "0.6231553", "text": "function getDateString(d) {\n // The other option is to use d.toLocaleDateString()\n var localDate = d.toDateString();\n // Strip the last 4 digits of the year\n localDate = localDate.substr(0, localDate.length - 4);\n return localDate;\n}", "title": "" } ]
[ { "docid": "da94ee48ee3a107753fbdc29176a251a", "score": "0.6837515", "text": "function getDate() { // 9210\n\t\treturn t.applyTimezone(date); // infuse the calendar's timezone // 9211\n\t} // 9212", "title": "" }, { "docid": "bbe556845974ee8165d88c170516cbc1", "score": "0.6714173", "text": "function getCurrentDate()\n{\n\tvar result = new Date().toISOString();\n\tresult = result.substring(0, result.indexOf(\"T\"));\n\treturn result;\n}", "title": "" }, { "docid": "003eb6190e1947b30c8accbe5d30fd53", "score": "0.64966786", "text": "getCurrentDateTime() {\n var date;\n date = new Date();\n date = date.getUTCFullYear() + '-' +\n ('00' + (date.getUTCMonth() + 1)).slice(-2) + '-' +\n ('00' + date.getUTCDate()).slice(-2) + ' ' +\n ('00' + date.getUTCHours()).slice(-2) + ':' +\n ('00' + date.getUTCMinutes()).slice(-2) + ':' +\n ('00' + date.getUTCSeconds()).slice(-2);\n return date;\n }", "title": "" }, { "docid": "079d9c14d21a36bcbc7852e0235d5974", "score": "0.6439692", "text": "function getLocalDateTime(){\n\tvar d = new Date();\n\tvar HH = addZero(d.getHours());\n\tvar mm = addZero(d.getMinutes());\n\tvar ss = addZero(d.getSeconds());\n\tvar dd = addZero(d.getDate());\n\tvar MM = addZero(d.getMonth() + 1);\n\tvar yyyy = d.getFullYear();\n\treturn '' + yyyy + '.' + MM + '.' + dd + '_' + HH + ':' + mm + ':' + ss;\n}", "title": "" }, { "docid": "ff6b31194cb9abf3d0ac09a2bc6dad8f", "score": "0.64038986", "text": "function getISOLocalDateTime(date) {\n return \"\".concat(getISOLocalDate(date), \"T\").concat(getHoursMinutesSeconds(date));\n}", "title": "" }, { "docid": "b9ff4f08263e19f0bbd52bf7f1c62c32", "score": "0.63928926", "text": "function datestring () {\n var d = new Date(Date.now() - 24*60*60*1000); //est timezone PST\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate() ;\n}", "title": "" }, { "docid": "1a1ce47781a6c21ba6e3819c7920c4ab", "score": "0.6385103", "text": "function getFormattedDate_() {\n var tz = getUserConfiguration_('Timezone');\n return Utilities.formatDate(new Date(),\n tz, \"yyyy-MM-dd' 'HH:mm:ss' '\");\n}", "title": "" }, { "docid": "3bab70841633fbd098204302665efb9a", "score": "0.6372935", "text": "function now() {\n let date = new Date().toLocaleString();\n date = date.substring(0, date.length - 3).replaceAll(\"/\", \"-\").replace(\", \", \"T\");\n\n let parts = date.split(\"T\");\n let dateParts = parts[0].split(\"-\");\n\n let day = parseInt(dateParts[0]);\n let month = parseInt(dateParts[1]);\n let year = dateParts[2];\n\n let timeParts = parts[1].split(\":\");\n let hour = parseInt(timeParts[0]);\n let minute = parseInt(timeParts[1]);\n\n return year + \"-\" + zeroPad(month) + \"-\" + zeroPad(day) + \"T\" + zeroPad(hour) + \":\" + zeroPad(minute);\n}", "title": "" }, { "docid": "7836108ac3842ad048446e7e32876332", "score": "0.63521576", "text": "function getDate() {\n const today = new Date();\n\n return `${today.getUTCFullYear()}-${pad(today.getUTCMonth()+1)}-${pad(today.getUTCDate())}`;\n}", "title": "" }, { "docid": "d128c8ecc5a5816eafbd52770cfeb5e8", "score": "0.6349722", "text": "function getLocalDate() {\n\tvar utcDate = new Date();\n\tvar shift = utcDate.setTime(utcDate.getTime() - (utcDate.getTimezoneOffset() * 60 * 1000));\n\tvar localDateStr = JSON.stringify(new Date(shift));\n\tvar localDate = localDateStr.substring(1,20);\n\treturn localDate;\n}", "title": "" }, { "docid": "87719ddd6e5495ffcf01d77297e70c18", "score": "0.6332967", "text": "function getDateWithTimezone() {\n var currentDate = new Date();\n var currentTimeZone = currentDate.getTimezoneOffset();\n currentTimeZone = (currentTimeZone >= 0) ? \" GMT +\" + currentTimeZone / 60 : \" GMT \" + currentTimeZone / 60;\n currentDate = currentDate + currentTimeZone;\n return currentDate;\n }", "title": "" }, { "docid": "61f2923354fe3483b0af3871cb838e5e", "score": "0.62921", "text": "function datestring () {\n var d = new Date(Date.now()); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "title": "" }, { "docid": "14954ae019288d48f7a21eebd2aee2bf", "score": "0.6287302", "text": "function getDate(){\n return new Date().toISOString().split('T')[0];\n}", "title": "" }, { "docid": "ef0e04655bd02cce01dd19171c3a1d6d", "score": "0.6221956", "text": "localDate(date) {\n return moment(date + ' Z')\n .utc()\n .local()\n .format('MMMM Do YYYY');\n }", "title": "" }, { "docid": "94b96e86b02b006da459b7acfac5d27c", "score": "0.62126577", "text": "function getDateString() {\n var time = new Date().getTime();\n // 36000000 is AEST (Australia Melbourne TimeZone)\n var datestr = new Date(time +36000000).toISOString().replace(/T/, ' ').replace(/Z/, '');\n return datestr;\n}", "title": "" }, { "docid": "53f8437c11f30bb4ca670d6b2e7f4821", "score": "0.6192492", "text": "function getDate() {\n return new Date().toLocaleDateString('cs-CZ');\n}", "title": "" }, { "docid": "98712e051db5f476d4d191fe7e70c777", "score": "0.6190218", "text": "function local() {\n return TimeZone.local();\n}", "title": "" }, { "docid": "bb38b51d155066a006526651a2c77c46", "score": "0.61657155", "text": "function current_date() {\n\tif (typeof window !== \"undefined\") {\n\t\tconst timestampQueryString = new URLSearchParams(window.location.search).get('timestamp');\n\t\tif (timestampQueryString) {\n\t\t\treturn new Date(Number.parseInt(timestampQueryString, 10) * 1000);\n\t\t}\n\t}\n\n\treturn new Date();\n}", "title": "" }, { "docid": "b6e18c80b97d7afbdc6ebe3e79b38357", "score": "0.6148922", "text": "function dateTimeNow() {\n var now = new Date();\n return now.toLocaleString();\n}", "title": "" }, { "docid": "5e684050012c260353349d3200db263c", "score": "0.6138237", "text": "function date() {\n function f(n) {\n return n < 10 ? '0' + n : n;\n }\n var date = new Date();\n var M = date.getMonth() + 1;\n var D = date.getDate();\n var Y = date.getFullYear();\n var h = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n return \"\" + Y + \"-\" + f(M) + \"-\" + f(D) + \"T\" + f(h) + ':' + f(m) + ':' + f(s);\n}", "title": "" }, { "docid": "76e395808685a36deb6d30cd009afab0", "score": "0.6135489", "text": "function datestring () {\n\tvar d = new Date(Date.now() - 10*60*60*1000); // est timezone\n\treturn d.getUTCFullYear() + '-'\n\t + (d.getUTCMonth() + 1) + '-'\n\t + d.getDate();\n}", "title": "" }, { "docid": "333c708c4c0adbeff0fa29e47bd2bc3d", "score": "0.61150956", "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": "333c708c4c0adbeff0fa29e47bd2bc3d", "score": "0.61150956", "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": "73b48a544a1ba47cd767155ab3cc0481", "score": "0.6112052", "text": "function now() {\n return moment.tz(new Date(), 'America/Detroit');\n }", "title": "" }, { "docid": "cdf69e3e2e5cb9997cf512a0222c79d2", "score": "0.61029166", "text": "function dateNow() {\n\tvar now = new Date();\n\tvar dateArr = now.toString().split(' ');\n\tdateArr = dateArr.slice(0, 6);\n\n\t//set proper timezone format\n\tvar timezone = dateArr[dateArr.length-1];\n\ttimezone = timezone.slice(timezone.length-5, timezone.length-2);\n\tdateArr[dateArr.length-1] = timezone;\n\n\t//shift year to tail\n\tvar year = dateArr[3];\n\tdateArr = dateArr.slice(0, 3).concat(dateArr.slice(4));\n\tdateArr.push(year);\n\n\tvar date = dateArr.join(' ');\n\treturn 'Time now is ' + date;\n}", "title": "" }, { "docid": "3b6b565aa8727ef40ed32ff98f0b21d5", "score": "0.6091216", "text": "static getDateString() {\n const now = new Date();\n return now.toISOString().substring(0,19).replace('T','_');\n }", "title": "" }, { "docid": "33e114e926c879222a35d9c02fa0254e", "score": "0.6084127", "text": "function getDateString () {\n var time = new Date();\n // for your timezone just multiply +/-GMT by 3600000\n var datestr = new Date(time - (3600000 * -2)).toISOString().replace(/T/, '_').replace(/Z/, '');\n return datestr;\n}", "title": "" }, { "docid": "04a0b7d8bc47d4909a96bec4997013ec", "score": "0.60602283", "text": "function getDateString () {\n var time = new Date();\n // 14400000 is (GMT-4 Montreal)\n // for your timezone just multiply +/-GMT by 3600000\n var datestr = new Date(time - 18000000).toISOString().replace(/T/, ' ').replace(/Z/, '');\n return datestr;\n}", "title": "" }, { "docid": "1c7b0bab26117210cd8d8666be0cc419", "score": "0.6018648", "text": "function get_server_time()\r\n{\r\n\tmy_date = new Date();\r\n\r\n\treturn my_date.toUTCString();\r\n}", "title": "" }, { "docid": "1c7b0bab26117210cd8d8666be0cc419", "score": "0.6018648", "text": "function get_server_time()\r\n{\r\n\tmy_date = new Date();\r\n\r\n\treturn my_date.toUTCString();\r\n}", "title": "" }, { "docid": "877e325d87ee68068317e40d4328f8bc", "score": "0.60163337", "text": "function UTCDateFormatNoYear(date) {\n return date.getUTCMonth() + 1 + \"/\" + date.getUTCDate();\n}", "title": "" }, { "docid": "4636aaacd43c9df9a86f286aacf835c4", "score": "0.59960335", "text": "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + \"-\" +\n (d.getUTCMonth() + 1) + \"-\" +\n d.getDate();\n}", "title": "" }, { "docid": "f69cdb1ebbb0a0fe6e132e35c835290d", "score": "0.5981224", "text": "function now() {\n const date = new Date();\n return date.toUTCString();\n}", "title": "" }, { "docid": "ba1bb7a7be00ab6cbb041d897a9fb042", "score": "0.59650105", "text": "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "title": "" }, { "docid": "e36755c1b9ff963445ccba48fe7de1fc", "score": "0.595676", "text": "getDateTime(date = false) {\n\t\tlet dateObj = new Date();\n\t\tif (date) {\n\t\t\tdateObj = new Date(date);\n\t\t}\n\t\treturn dateObj.toISOString().replace(/T/, ' ').replace(/\\..+/, '');\n\t}", "title": "" }, { "docid": "8d6ee756796057281c7e998721b87cd7", "score": "0.59547895", "text": "function currentTime() {\n var d = new Date();\n var ds = d.toISOString()\n return ds.slice(0,10) +\" \"+ ds.slice(11,19) +\"Z\"\n}", "title": "" }, { "docid": "76d4a3ed6bb6b03d43f846fb7c913532", "score": "0.5946444", "text": "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "title": "" }, { "docid": "c4e220c85c43a1eaba07fd99acd04a79", "score": "0.59456956", "text": "getAtomDate(){\n return `${this.year()}-${this.month()}-${this.date()}T`+\n `${this.hours()}:${this.minutes()}:${this.seconds()}${this.getTimezone()}`;\n }", "title": "" }, { "docid": "3d5d60275ee756c9f99883d0efee70a6", "score": "0.5935971", "text": "function get_server_time() {\n my_date = new Date();\n\n return my_date.toUTCString();\n}", "title": "" }, { "docid": "adf7126c061452eb078fd9ebadb465c4", "score": "0.5935864", "text": "function getFormattedDate() {\n var date = new Date();\n var str = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate() + \"T\" + date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds();\n var res = str.toString();\n return res;\n }", "title": "" }, { "docid": "397acb3de4c27cec7d7f1796a83fb455", "score": "0.59269696", "text": "function getCurrentDate() {\n return new Date().toISOString();\n}", "title": "" }, { "docid": "cc53b9ca79e19de6e3d974e09893e28d", "score": "0.5922037", "text": "function localDate(weather){\n var localTime = document.getElementById('local-time');\n var time = new Date();\n localTime.firstElementChild.innerHTML = time.toLocaleDateString();\n }", "title": "" }, { "docid": "7381b01aa9d5c6f2594a6888bcf8af6b", "score": "0.5917338", "text": "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (!isValidDate(date)) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "title": "" }, { "docid": "471b822de27163377dd9776f43a1de21", "score": "0.59170604", "text": "convert_date_to_local(date) {\n var local_tz = Intl.DateTimeFormat().resolvedOptions().timeZone; // local timezone\n\n return moment(date).tz(local_tz).format('YYYY-MM-DD');\n }", "title": "" }, { "docid": "708c7842300ab04fe96629c17188552e", "score": "0.59148335", "text": "function getDate(date) {\n var output = '-';\n if (date == null) {\n return output;\n } else {\n var d = new Date(date);\n output = d.toDateString(); // outputs to \"Thu May 28 2015\"\n //output = d.toGMTString(); //outputs to \"Thu, 28 May 2015 22:10:21 GMT\"\n }\n return output;\n}", "title": "" }, { "docid": "8a437719df14905bdae5298241760ef9", "score": "0.58988905", "text": "function _Date() {\n if(settings.timezone === \"UTC\") {\n return new utcDate();\n }\n\n else {\n return new Date();\n }\n }", "title": "" }, { "docid": "353e8b3d3867a41d604336d7cf50b4c4", "score": "0.58885497", "text": "static get since() {\n\t\t// The UTC representation of 2009-06-01\n\t\treturn new Date(Date.UTC(2009, 5, 1));\n\t}", "title": "" }, { "docid": "63d95abfa1038579ea79685d47cc6c3e", "score": "0.5873142", "text": "function getTodayDate() {\n return new Date().toJSON().slice(0, 10).replace(/-/g, '/');\n}", "title": "" }, { "docid": "b2bcf80859ee5474e92128926349df68", "score": "0.587255", "text": "getCookieDate(){\n return `${this.day()}, ${this.date()}-${this.monthShort()}-${this.year()}`+\n ` ${this.hours()}:${this.minutes()}:${this.seconds()} ${this.getTimezone()}`;\n }", "title": "" }, { "docid": "6656ead27f5b5c69968dea9437de3eed", "score": "0.58709216", "text": "localDateTime(date) {\n if (!date) return null;\n var stillUtc = moment.utc(date).toDate();\n return (local = moment(stillUtc)\n .local()\n .format('YYYY-MM-DD HH:mm:ss'));\n }", "title": "" }, { "docid": "da207811a295f9f596d347c4a9f17eba", "score": "0.5857933", "text": "function dateForTimezone(date) {\n return moment(new Date(date.getTime() + date.getTimezoneOffset())).format();\n}", "title": "" }, { "docid": "b3cbdae89b2db3c46a4c1da22ffe1a2e", "score": "0.5847359", "text": "function _local(dt) {\n\tvar local = dt._local;\n\tif (!local) {\n\t\tvar d = new Date(dt._value);\n\t\tlocal = d.getFullYear() * 10000 * 100000 + (d.getMonth() + 1) * 100 * 100000 + d.getDate() * 100000 + d.getHours() * 3600 + d.getMinutes() * 60 + d.getSeconds();\n\t\td._local = local;\n\t}\n\treturn local;\n}", "title": "" }, { "docid": "908685ea6100e307eb679e3508d2e8af", "score": "0.58334494", "text": "function date_time(){\r\n var d = new Date()\r\n return d;\r\n}", "title": "" }, { "docid": "951c94bbec55880b78c795c5da2d4010", "score": "0.5824128", "text": "function strGoogleDate( date ) {\n var year = date.getUTCFullYear();\n var month = date.getUTCMonth() + 1;\n if ( month < 10 ) month = '0' + month;\n var day = date.getUTCDate();\n if ( day < 10 ) day = '0' + day;\n var hours = date.getUTCHours();\n if ( hours < 10 ) hours = '0' + hours;\n var minutes = date.getUTCMinutes();\n if ( minutes < 10 ) minutes = '0' + minutes;\n var seconds = date.getUTCSeconds();\n if ( seconds < 10 ) seconds = '0' + seconds;\n return '' + year + month + day + 'T' + hours + minutes + seconds + 'Z';\n}", "title": "" }, { "docid": "fd5eead2559f431598dbf168de495f3f", "score": "0.58197635", "text": "function datestring () {\n let d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + \"-\" +\n (d.getUTCMonth() + 1) + \"-\" +\n d.getDate();\n}", "title": "" }, { "docid": "1f9260c8588c8d00b18620bb6381277f", "score": "0.5819082", "text": "function today() {\n\tvar d = new Date();\n\treturn d.getUTCFullYear()\n\t\t\t+ \"-\" + (\"\" + (d.getUTCMonth() + 1).fill(\"0\", 2)\n\t\t\t+ \"-\" + (\"\" + d.getUTCDate()).fill(\"0\", 2);\n//\treturn new Date().toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "01e886d69582af5b4605c3e109046bd8", "score": "0.58182377", "text": "currTime() {\n var date = new Date();\n var options = {\n day: '2-digit',\n month: '2-digit',\n year: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n };\n\n return date.toLocaleDateString('de-DE', options);\n }", "title": "" }, { "docid": "bdd1efa162db422094c0c28f5a2fd4d9", "score": "0.5816445", "text": "function nowLocal() {\n return DateTime.nowLocal();\n}", "title": "" }, { "docid": "425a855c7a5944307cd0144bbcb84bf2", "score": "0.58089423", "text": "function datestring() {\n var d = new Date(Date.now() - 5 * 60 * 60 * 1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "title": "" }, { "docid": "08628707a09c832dd939da97b0bf1be7", "score": "0.58088773", "text": "function getISODateTime() {\r\n var date = new Date();\r\nreturn date.toISOString().replace('Z', '+0000');\r\n}", "title": "" }, { "docid": "b1ca584ff96b1fd62b2a8a320ff34400", "score": "0.5791722", "text": "function getDateString(){\n var datetimenow = new Date(Date.now());\n var year = datetimenow.getUTCFullYear();\n var month = datetimenow.getUTCMonth()+1;\n var date = datetimenow.getUTCDate();\n\n var hour = datetimenow.getUTCHours();\n var minute = datetimenow.getUTCMinutes();\n var second = datetimenow.getUTCSeconds();\n var dateString = year + \"-\" + month + \"-\" + date + \" \" + hour + \":\" + minute + \":\" + second;\n return dateString;\n}", "title": "" }, { "docid": "a8bb5594915ec4885f796cdcbe41075b", "score": "0.5781141", "text": "function dateAndTime() {\n return new Date().toLocaleString();\n}", "title": "" }, { "docid": "f09bab2e2e9c87fd5212d177f9d248d2", "score": "0.57728744", "text": "function getCurrentDateTimeString () {\n let x = new Date();\n return `${x.getFullYear()}-${x.getMonth()}-${x.getDate()}T${x.getHours()}-${x.getMinutes()}-${x.getSeconds()}`;\n}", "title": "" }, { "docid": "98446365adc154e001aa78043962532c", "score": "0.57624066", "text": "function iso(date) {\n function pad(number) {\n if (number < 10) {\n return '0' + number;\n }\n return number;\n }\n\n return date.getUTCFullYear() +\n '-' + pad(date.getUTCMonth() + 1) +\n '-' + pad(date.getUTCDate()) +\n 'T' + pad(date.getUTCHours()) +\n ':' + pad(date.getUTCMinutes()) +\n ':' + pad(date.getUTCSeconds()) +\n 'Z';\n }", "title": "" }, { "docid": "d23f0389b5d8c90981c0a3c2253c9530", "score": "0.5761573", "text": "static today() {\n\t\treturn NepaliDate.fromgregorian(new Date());\n\t}", "title": "" }, { "docid": "3190b814a9ce1e33bd4c47e29947afa7", "score": "0.57606894", "text": "function GetCurrentDateString() {\n\tvar dt = new Date();\n\tstrReturn = dt.getFullYear() + \"-\" + TimeFormat( dt.getMonth() + 1 ) + \"-\" + TimeFormat( dt.getDate() ) + \"T\" + TimeFormat(dt.getHours()) + \":\" + TimeFormat( dt.getMinutes()) + \":\" + TimeFormat(dt.getSeconds()) + \".\" + TimeFormat( dt.getMilliseconds() ) + \"-\" + ( dt.getTimezoneOffset() / 60 ) + \":00\";\n\treturn strReturn;\n}", "title": "" }, { "docid": "697b65f70141efdcd667a716f09583eb", "score": "0.5758214", "text": "getIsoDate(){\n return `${this.year()}-${this.month()}-${this.date()}`+\n `T${this.hours()}:${this.minutes()}:${this.seconds()}.${this.milliseconds()} ${this.getTimezone()}`;\n }", "title": "" }, { "docid": "2a204bf7e25dfaa79e2cd32d871b81fe", "score": "0.5752577", "text": "function nowToDateString() {\n return new Date().toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "9c9604b0dc7a3b0cfd6ac175bb3194cc", "score": "0.5751285", "text": "function getDateTime() {\n var date = new Date();\n return date.toJSON();\n}", "title": "" }, { "docid": "be092c2d64d533ab09a286c51db0aa88", "score": "0.5748336", "text": "function localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}", "title": "" }, { "docid": "be092c2d64d533ab09a286c51db0aa88", "score": "0.5748336", "text": "function localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}", "title": "" }, { "docid": "be092c2d64d533ab09a286c51db0aa88", "score": "0.5748336", "text": "function localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}", "title": "" }, { "docid": "40966e503746b532b779bcd0af715cab", "score": "0.5747164", "text": "function isoDate() {\n const now = new Date()\n const year = '' + now.getFullYear()\n let month = '' + (now.getMonth() + 1)\n let day = '' + now.getDate()\n if (month.length < 2) {\n month = '0' + month\n }\n if (day.length < 2) {\n day = '0' + day\n }\n return year + '-' + month + '-' + day\n}", "title": "" }, { "docid": "e6bf2c329230bac51845ba5469de5756", "score": "0.5739821", "text": "function getFormattedDate() {\n \tlet options = { day: 'numeric', month: 'long', year: 'numeric' };\n \tlet currentDate = new Date();\n \treturn currentDate.toLocaleDateString(\"ru-RU\", options);\n }", "title": "" }, { "docid": "c88a221f817d096a806cdf655277bd4f", "score": "0.57341295", "text": "getUtcDate(){\n return `${this.year()}-${this.month()}-${this.date()}T`+\n `${this.hours()}:${this.minutes()}:${this.seconds()}.${this.milliseconds()}Z`;\n }", "title": "" }, { "docid": "1eff29408a85934bc77af5c309e9fb62", "score": "0.573407", "text": "function fullDate() {\n const year = new Date().getFullYear();\n\n return `The year is ${year}`;\n}", "title": "" }, { "docid": "dfb649d6a651b87660bef220ceb7b59a", "score": "0.57314795", "text": "get date() {\n const date = new Date();\n\n const day = date.getDate();\n const month = (date.getMonth().toString().length == 1? \"0\":'' ) + date.getMonth();\n const year = date.getFullYear();\n const hours = ((date.getHours()).toString().length == 1?'0':'') + \"\" + (date.getHours());\n const mins = ((date.getMinutes()).toString().length == 1?'0':'') + \"\" + (date.getMinutes());\n\n return `${day}.${month}.${year} ${hours}:${mins}`;\n }", "title": "" }, { "docid": "ee5a90b805de0b845ed1b959d48296ef", "score": "0.5730364", "text": "function getDate(){\n var dateObj = new Date();\n var month = dateObj.getUTCMonth() + 1; //months from 1-12\n var day = dateObj.getUTCDate();\n var year = dateObj.getUTCFullYear();\n\n newdate = year + \"-\" + month + \"-\" + day;\n\n return newdate;\n }", "title": "" }, { "docid": "a150639ac6cb7843b1de96a47b0e11ee", "score": "0.5724795", "text": "function getDateFromNow(){\n var date = new Date();\n return date.getFullYear()+'-'+(date.getMonth()<10?'0':'')+(date.getMonth()+1)+'-'+(date.getDate()<10?'0':'')+date.getDate()+' '+(date.getHours()<10?'0':'')+date.getHours()+':'+(date.getMinutes()<10?'0':'')+date.getMinutes()+':'+(date.getSeconds()<10?'0':'')+date.getSeconds();\n }", "title": "" }, { "docid": "bf157e56b52abb00ded92e57cfa9a952", "score": "0.5713035", "text": "function getServerTime() {\n var date = new Date();\n\n date.setTime(date.getTime());\n console.log(date);\n return date;\n}", "title": "" }, { "docid": "9e961f7bc48803f7bd7fcd154e7d1ca8", "score": "0.5709189", "text": "function get_date(){\n var d = new Date();\n var date_string = \"\" + d.getFullYear().toString() + \"-\";\n var month = (d.getMonth() + 1);\n date_string += (month < 10 ? \"0\" + month.toString() : month.toString());\n date_string += \"-\" + d.getDate().toString();\n return date_string;\n}", "title": "" }, { "docid": "5b5df6d15e6a9675c819b873f480329a", "score": "0.5691339", "text": "function fullYearFromDate(date){\n\treturn date.getUTCFullYear();\n}", "title": "" }, { "docid": "07d98994bcb73961f04f0a26c2a00552", "score": "0.5686557", "text": "function getTimeOnDate() {\n date = new Date();\n data = new Date();\n data.setDate(date.getDate());\n data.setMonth(date.getMonth());\n data.setFullYear(date.getFullYear());\n data.setHours(0);\n data.setMinutes(0);\n data.setSeconds(0);\n data.setMilliseconds(0);\n}", "title": "" }, { "docid": "d6090dd3caf21b58dcee29f47c5369d3", "score": "0.56818014", "text": "function getTimeDate() {\n var date=new Date();\n var month=1+date.getMonth();1\n var time=date.toLocaleTimeString();\n var dateDayYear=date.getDate()+'/'+month+'/'+date.getFullYear();\n var timeDate = time+' '+dateDayYear;\n return timeDate;\n }", "title": "" }, { "docid": "baf1550eaebc8244e6437d988b5d9f20", "score": "0.5675647", "text": "function get_time_local()\n{\n var d = new Date();\n\n var hours = d.getHours().toString().padStart(2, '0');\n var mins = d.getMinutes().toString().padStart(2, '0');\n var secs = d.getSeconds().toString().padStart(2, '0');\n\n return `${hours}:${mins}:${secs}`;\n}", "title": "" }, { "docid": "635600b6f29f317ea5b20dfe42c91473", "score": "0.56749994", "text": "function toISOStringLocal(d) {\n function z(n){return (n<10?'0':'') + n}\n return d.getFullYear() + '-' + z(d.getMonth()+1) + '-' +\n z(d.getDate()) + 'T' + z(d.getHours()) + ':' +\n z(d.getMinutes()) + ':' + z(d.getSeconds())\n\n}", "title": "" }, { "docid": "2f1a451caabdacaa64c72db8d47ff8b0", "score": "0.5668455", "text": "function getCurrentDateISO() {\n\treturn new Date().toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "772903f4f52c551dea9f62fa95cbb18f", "score": "0.56531566", "text": "function getFormattedDate() {\n var date = new Date();\n var str = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate() + \" \" + date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds();\n return str;\n}", "title": "" }, { "docid": "3169adca021bf9f76aecc6d12d8af672", "score": "0.5652724", "text": "function getCurrentDate() {\n const date = new Date();\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}", "title": "" }, { "docid": "60f54dad4c700c0a910598d964e4a03c", "score": "0.56509596", "text": "function getISODate() {\n var now = new Date().toISOString();\n //alert(now);\n return now;\n }", "title": "" }, { "docid": "addbe4809bd0337ccb16bd1585dded02", "score": "0.5638613", "text": "function now(){\n\tlet d = new Date();\n\treturn d.getDate()+'-'+d.getMonth()+'-'+d.getFullYear()+\" \"+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();\n}", "title": "" }, { "docid": "a127f974469096732c294c954ad027c2", "score": "0.5630277", "text": "function now() {\n return new Date().toISOString();\n }", "title": "" }, { "docid": "fe13cd3ee0e9486b5e1b29cb2919b26e", "score": "0.56278896", "text": "function jsfv_getshortdate() {\n var dt = new Date();\n m = (dt.getMonth() + 1).toString().padStart(2, \"0\");\n d = dt.getDate().toString().padStart(2, \"0\");\n return dt.getFullYear() + m + d;\n}", "title": "" }, { "docid": "6bfeb293ce1ca0b8b2e791fb90e02433", "score": "0.56271964", "text": "function current_date(){\n\tdate = new Date()\n\tdocument.write(date)\n}", "title": "" }, { "docid": "3761b3a7bef3850ba73440c34a84d7bf", "score": "0.5625013", "text": "function getDate() {\n var today = new Date();\n var date =\n today.getFullYear() + \"-\" + (today.getMonth() + 1) + \"-\" + today.getDate();\n var time =\n today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n var dateTime = date + \" \" + time;\n return dateTime;\n }", "title": "" }, { "docid": "36ee7bffd10b27a47fd4b48ef78320e7", "score": "0.5609738", "text": "function dateToDateString(date) {\n var m = date.getUTCMonth() + 1;\n if (m < 10) m = \"0\" + m;\n var d = date.getUTCDate();\n if (d < 10) d = \"0\" + d;\n return date.getUTCFullYear() + \"-\" + m + \"-\" + d;\n}", "title": "" }, { "docid": "2983f447f23dbea7aede8195efe4aab8", "score": "0.56047755", "text": "function get_current_time() {\n var date = new Date();\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth()+1)).slice(-2);\n var year = date.getFullYear();\n var current_date = year + \"-\" + month + \"-\" + day;\n return current_date;\n\n}", "title": "" }, { "docid": "529f67b8f46bf6b7c1dbabccbfac63d5", "score": "0.5601135", "text": "function getCurrentDate() {\n //retrieving current time stamp\n let ts = Date.now();\n\n //declaring date object\n let date_ob = new Date(ts);\n\n //Declaring current year,month,date\n var year = date_ob.getFullYear();\n var month =\n date_ob.getMonth() < 10\n ? `0${date_ob.getMonth() + 1}`\n : date_ob.getMonth() + 1;\n var date =\n date_ob.getDate() < 10 ? `0${date_ob.getDate()}` : date_ob.getDate();\n return { year: year, month: month, date: date };\n}", "title": "" }, { "docid": "3cab9059da92b99e798224dfa1c49642", "score": "0.5601086", "text": "function today() {\n var d = new Date();\n return date(d);\n }", "title": "" }, { "docid": "8a628c0a259923ab043f0b476f2d1530", "score": "0.55918163", "text": "function singaporeTime() {\n const SGT_OFFSET = -8 * 60;\n const localDate = new Date();\n return new Date(localDate.getTime() + (localDate.getTimezoneOffset() - SGT_OFFSET) * 60 * 1000);\n}", "title": "" } ]
0333cf920475e107e3b3312e53346da4
Prepare the root picker element with all bindings.
[ { "docid": "fbb85ceebc827e690b3d0b73c5a0600e", "score": "0.76417446", "text": "function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }", "title": "" } ]
[ { "docid": "7ed6bb2f1490c1fa264b38c5f01420ae", "score": "0.7634063", "text": "function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }", "title": "" }, { "docid": "7ed6bb2f1490c1fa264b38c5f01420ae", "score": "0.7634063", "text": "function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }", "title": "" }, { "docid": "7ed6bb2f1490c1fa264b38c5f01420ae", "score": "0.7634063", "text": "function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }", "title": "" }, { "docid": "2c1a3d8449ac1d05edbe304c70c72c63", "score": "0.7634063", "text": "function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href);\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }", "title": "" }, { "docid": "871194593eeaef863201bd0d1a83d999", "score": "0.7631066", "text": "function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }", "title": "" }, { "docid": "144176b56fc615dd540ef6a623a7b632", "score": "0.76309174", "text": "function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }", "title": "" }, { "docid": "74ce4b96e2d8fdeb43ce104ae2300692", "score": "0.7565767", "text": "function prepareElementRoot() {\n\n\t P.$root.\n\n\t on({\n\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\n\n\t // When something within the root is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function( event ) {\n\t P.$root.removeClass( CLASSES.focused )\n\t event.stopPropagation()\n\t },\n\n\t // When something within the root holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function( event ) {\n\n\t var target = event.target\n\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if ( target != P.$root.children()[ 0 ] ) {\n\n\t event.stopPropagation()\n\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n\t event.preventDefault()\n\n\t // Re-focus onto the root so that users can click away\n\t // from elements focused within the picker.\n\t P.$root[0].focus()\n\t }\n\t }\n\t }\n\t }).\n\n\t // Add/remove the “target” class on focus and blur.\n\t on({\n\t focus: function() {\n\t $ELEMENT.addClass( CLASSES.target )\n\t },\n\t blur: function() {\n\t $ELEMENT.removeClass( CLASSES.target )\n\t }\n\t }).\n\n\t // Open the picker and adjust the root “focused” state\n\t on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n\t var $target = $( this ),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = getActiveElement()\n\t activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n\t P.$root[0].focus()\n\t }\n\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if ( !targetDisabled && targetData.nav ) {\n\t P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n\t }\n\n\t // If something is picked, set `select` then close with focus.\n\t else if ( !targetDisabled && 'pick' in targetData ) {\n\t P.set( 'select', targetData.pick )\n\t }\n\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if ( targetData.clear ) {\n\t P.clear().close( true )\n\t }\n\n\t else if ( targetData.close ) {\n\t P.close( true )\n\t }\n\n\t }) //P.$root\n\n\t aria( P.$root[0], 'hidden', true )\n\t }", "title": "" }, { "docid": "8ed4d48bd0a48b2271175e98b4fe1bb3", "score": "0.7509981", "text": "function prepareElementRoot() {\r\n\r\n P.$root.on({\r\n\r\n // For iOS8.\r\n keydown: handleKeydownEvent,\r\n\r\n // When something within the root is focused, stop from bubbling\r\n // to the doc and remove the “focused” state from the root.\r\n focusin: function (event) {\r\n P.$root.removeClass(CLASSES.focused);\r\n event.stopPropagation();\r\n },\r\n\r\n // When something within the root holder is clicked, stop it\r\n // from bubbling to the doc.\r\n 'mousedown click': function (event) {\r\n\r\n var target = event.target;\r\n\r\n // Make sure the target isn’t the root holder so it can bubble up.\r\n if (target != P.$root.children()[0]) {\r\n\r\n event.stopPropagation();\r\n\r\n // * For mousedown events, cancel the default action in order to\r\n // prevent cases where focus is shifted onto external elements\r\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\r\n // Also, for Firefox, don’t prevent action on the `option` element.\r\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\r\n\r\n event.preventDefault();\r\n\r\n // Re-focus onto the root so that users can click away\r\n // from elements focused within the picker.\r\n P.$root.eq(0).focus();\r\n }\r\n }\r\n }\r\n }).\r\n\r\n // Add/remove the “target” class on focus and blur.\r\n on({\r\n focus: function () {\r\n $ELEMENT.addClass(CLASSES.target);\r\n },\r\n blur: function () {\r\n $ELEMENT.removeClass(CLASSES.target);\r\n }\r\n }).\r\n\r\n // Open the picker and adjust the root “focused” state\r\n on('focus.toOpen', handleFocusToOpenEvent).\r\n\r\n // If there’s a click on an actionable element, carry out the actions.\r\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\r\n\r\n var $target = $(this),\r\n targetData = $target.data(),\r\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\r\n\r\n\r\n // * For IE, non-focusable elements can be active elements as well\r\n // (http://stackoverflow.com/a/2684561).\r\n activeElement = getActiveElement();\r\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\r\n\r\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\r\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\r\n P.$root.eq(0).focus();\r\n }\r\n\r\n // If something is superficially changed, update the `highlight` based on the `nav`.\r\n if (!targetDisabled && targetData.nav) {\r\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\r\n }\r\n\r\n // If something is picked, set `select` then close with focus.\r\n else if (!targetDisabled && 'pick' in targetData) {\r\n P.set('select', targetData.pick);\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n }\r\n\r\n // If a “clear” button is pressed, empty the values and close with focus.\r\n else if (targetData.clear) {\r\n P.clear();\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n } else if (targetData.close) {\r\n P.close(true);\r\n }\r\n }); //P.$root\r\n\r\n aria(P.$root[0], 'hidden', true);\r\n }", "title": "" }, { "docid": "99becda29123f42374ff7082e4cfc4ac", "score": "0.74687403", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }", "title": "" }, { "docid": "99becda29123f42374ff7082e4cfc4ac", "score": "0.74687403", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }", "title": "" }, { "docid": "00ae299cc77c5273be73bb95a9815aa0", "score": "0.7457492", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }", "title": "" }, { "docid": "a3cf7e996be771481f55bc2c8ae28656", "score": "0.74039143", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }", "title": "" }, { "docid": "a3cf7e996be771481f55bc2c8ae28656", "score": "0.74039143", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }", "title": "" }, { "docid": "a3cf7e996be771481f55bc2c8ae28656", "score": "0.74039143", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }", "title": "" }, { "docid": "a3cf7e996be771481f55bc2c8ae28656", "score": "0.74039143", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }", "title": "" }, { "docid": "40092ed3b83f06719d6e366d497e7df7", "score": "0.740148", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, open the picker.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) {\n event.preventDefault()\n P.open()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }", "title": "" }, { "docid": "0085c6638eb8965449800f93c804171b", "score": "0.739372", "text": "function prepareElement() {\r\n\r\n $ELEMENT.\r\n\r\n // Store the picker data by component name.\r\n data(NAME, P).\r\n\r\n // Add the “input” class name.\r\n addClass(CLASSES.input).\r\n\r\n // Remove the tabindex.\r\n attr('tabindex', -1).\r\n\r\n // If there’s a `data-value`, update the value of the element.\r\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\r\n\r\n // Only bind keydown events if the element isn’t editable.\r\n if (!SETTINGS.editable) {\r\n\r\n $ELEMENT.\r\n\r\n // On focus/click, focus onto the root to open it up.\r\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\r\n event.preventDefault();\r\n P.$root.eq(0).focus();\r\n }).\r\n\r\n // Handle keyboard event based on the picker being opened or not.\r\n on('keydown.' + STATE.id, handleKeydownEvent);\r\n }\r\n\r\n // Update the aria attributes.\r\n aria(ELEMENT, {\r\n haspopup: true,\r\n expanded: false,\r\n readonly: false,\r\n owns: ELEMENT.id + '_root'\r\n });\r\n }", "title": "" }, { "docid": "08e58d3ee03f5d668d077ee53f56356a", "score": "0.73519665", "text": "function prepareElement() {\n\n\t $ELEMENT.\n\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\n\t // Remove the tabindex.\n\t attr('tabindex', -1).\n\n\t // If there’s a `data-value`, update the value of the element.\n\t val( $ELEMENT.data('value') ?\n\t P.get('select', SETTINGS.format) :\n\t ELEMENT.value\n\t )\n\n\n\t // Only bind keydown events if the element isn’t editable.\n\t if ( !SETTINGS.editable ) {\n\n\t $ELEMENT.\n\n\t // On focus/click, focus onto the root to open it up.\n\t on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n\t event.preventDefault()\n\t P.$root[0].focus()\n\t }).\n\n\t // Handle keyboard event based on the picker being opened or not.\n\t on( 'keydown.' + STATE.id, handleKeydownEvent )\n\t }\n\n\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root'\n\t })\n\t }", "title": "" }, { "docid": "c2c424d14e1207d404fde9681f6177cd", "score": "0.73351085", "text": "function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }", "title": "" }, { "docid": "460eaceb4a46a6d73adf82af549a8250", "score": "0.7302694", "text": "function prepareElementRoot() {\n\t\n\t P.$root.on({\n\t\n\t // When something within the root is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function focusin(event) {\n\t P.$root.removeClass(CLASSES.focused);\n\t event.stopPropagation();\n\t },\n\t\n\t // When something within the root holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function mousedownClick(event) {\n\t\n\t var target = event.target;\n\t\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if (target != P.$root.children()[0]) {\n\t\n\t event.stopPropagation\n\t\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t ();if (event.type == 'mousedown' && !$(target).is(':input') && target.nodeName != 'OPTION') {\n\t\n\t event.preventDefault\n\t\n\t // Re-focus onto the element so that users can click away\n\t // from elements focused within the picker.\n\t ();ELEMENT.focus();\n\t }\n\t }\n\t }\n\t }).\n\t\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\t\n\t var $target = $(this),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\t\n\t\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = document.activeElement;\n\t activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\t\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n\t ELEMENT.focus();\n\t }\n\t\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if (!targetDisabled && targetData.nav) {\n\t P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n\t }\n\t\n\t // If something is picked, set `select` then close with focus.\n\t else if (!targetDisabled && 'pick' in targetData) {\n\t P.set('select', targetData.pick).close(true);\n\t }\n\t\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if (targetData.clear) {\n\t P.clear().close(true);\n\t } else if (targetData.close) {\n\t P.close(true);\n\t }\n\t } //P.$root\n\t\n\t );aria(P.$root[0], 'hidden', true);\n\t }", "title": "" }, { "docid": "2aab5b2bf7c80a42303d43d78f10ce50", "score": "0.7249044", "text": "function prepareElement() {\n\t\n\t $ELEMENT.\n\t\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\t\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\t\n\t // If there’s a `data-value`, update the value of the element.\n\t val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\t\n\t // Only bind keydown events if the element isn’t editable.\n\t if (!SETTINGS.editable) {\n\t\n\t $ELEMENT.\n\t\n\t // On focus/click, open the picker.\n\t on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n\t event.preventDefault();\n\t P.open();\n\t }).\n\t\n\t // Handle keyboard event based on the picker being opened or not.\n\t on('keydown.' + STATE.id, handleKeydownEvent);\n\t }\n\t\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root'\n\t });\n\t }", "title": "" }, { "docid": "8cb33d1c04990603cde353637c000029", "score": "0.7247611", "text": "function prepareElement() {\n\t\n\t $ELEMENT.\n\t\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\t\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\t\n\t // If there’s a `data-value`, update the value of the element.\n\t val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value).\n\t\n\t // On focus/click, open the picker and adjust the root “focused” state.\n\t on('focus.' + STATE.id + ' click.' + STATE.id, focusToOpen\n\t\n\t // Only bind keydown events if the element isn’t editable.\n\t );if (!SETTINGS.editable) {\n\t\n\t // Handle keyboard event based on the picker being opened or not.\n\t $ELEMENT.on('keydown.' + STATE.id, function (event) {\n\t\n\t var keycode = event.keyCode,\n\t\n\t\n\t // Check if one of the delete keys was pressed.\n\t isKeycodeDelete = /^(8|46)$/.test(keycode\n\t\n\t // For some reason IE clears the input value on “escape”.\n\t );if (keycode == 27) {\n\t P.close();\n\t return false;\n\t }\n\t\n\t // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n\t if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\t\n\t // Prevent it from moving the page and bubbling to doc.\n\t event.preventDefault();\n\t event.stopPropagation\n\t\n\t // If `delete` was pressed, clear the values and close the picker.\n\t // Otherwise open the picker.\n\t ();if (isKeycodeDelete) {\n\t P.clear().close();\n\t } else {\n\t P.open();\n\t }\n\t }\n\t });\n\t }\n\t\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root' + (P._hidden ? ' ' + P._hidden.id : '')\n\t });\n\t }", "title": "" }, { "docid": "b5b074e503195327937e7ca0ae1ec1a2", "score": "0.6178174", "text": "function prepareElementHolder() {\n\n P.$holder.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n 'focus.toOpen': handleFocusToOpenEvent,\n\n blur: function() {\n // Remove the “target” class.\n $ELEMENT.removeClass( CLASSES.target )\n },\n\n // When something within the holder is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$holder[0] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the holder so that users can click away\n // from elements focused within the picker.\n P.$holder[0].focus()\n }\n }\n }\n\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$holder[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear()\n if ( SETTINGS.closeOnClear ) {\n P.close( true )\n }\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$holder\n\n }", "title": "" }, { "docid": "03f69327b73511dd807cfcf473a420b3", "score": "0.60993606", "text": "function prepareElementHolder() {\n\t\n\t P.$holder.on({\n\t\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\n\t\n\t 'focus.toOpen': handleFocusToOpenEvent,\n\t\n\t blur: function blur() {\n\t // Remove the “target” class.\n\t $ELEMENT.removeClass(CLASSES.target);\n\t },\n\t\n\t // When something within the holder is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function focusin(event) {\n\t P.$root.removeClass(CLASSES.focused);\n\t event.stopPropagation();\n\t },\n\t\n\t // When something within the holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function mousedownClick(event) {\n\t\n\t var target = event.target;\n\t\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if (target != P.$holder[0]) {\n\t\n\t event.stopPropagation();\n\t\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\t\n\t event.preventDefault();\n\t\n\t // Re-focus onto the holder so that users can click away\n\t // from elements focused within the picker.\n\t P.$holder[0].focus();\n\t }\n\t }\n\t }\n\t\n\t }).\n\t\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\t\n\t var $target = $(this),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\t\n\t\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = getActiveElement();\n\t activeElement = activeElement && (activeElement.type || activeElement.href);\n\t\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n\t P.$holder[0].focus();\n\t }\n\t\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if (!targetDisabled && targetData.nav) {\n\t P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n\t }\n\t\n\t // If something is picked, set `select` then close with focus.\n\t else if (!targetDisabled && 'pick' in targetData) {\n\t P.set('select', targetData.pick);\n\t if (SETTINGS.closeOnSelect) {\n\t P.close(true);\n\t }\n\t }\n\t\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if (targetData.clear) {\n\t P.clear();\n\t if (SETTINGS.closeOnClear) {\n\t P.close(true);\n\t }\n\t } else if (targetData.close) {\n\t P.close(true);\n\t }\n\t }); //P.$holder\n\t }", "title": "" }, { "docid": "fd18d82e11efe47ba6770e3914e1fe02", "score": "0.6006626", "text": "function pickerInit() \n\t{\n\t\t// reset downstream pickers\n\t\t\t// remove options except first\n\t\t\tresetMake();\n\t\t\tresetModel();\n\t\t\tresetYear();\n\t\t\tresetTrim();\n\t\t\t\n\t\t// look up years\n\t\t/* API version would load all makes&models into make_model_obj */\n\t\tfor ( var i in make_model_obj.makeHolder ) { // counting thru array\n\t\t\t$('#make_select').append(\n\t\t\t\t$('<option></option>')\n\t\t\t\t\t.val( make_model_obj.makeHolder[i].niceName )\n\t\t\t\t\t.html( make_model_obj.makeHolder[i].name )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "9e8af6e148fdf3c3ae4d8e502f71041d", "score": "0.58965766", "text": "function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }", "title": "" }, { "docid": "56eed4132fa0ab9507c7a3f39f0962a1", "score": "0.58756834", "text": "function prepareElementRoot() {\n\t aria(P.$root[0], 'hidden', true);\n\t }", "title": "" }, { "docid": "3aed9b6d6652d3b2a99c4b21ba477f52", "score": "0.5816044", "text": "_init() {\n this._renderMask()\n this._renderPicker()\n this._bindEvents()\n\n // generate years' wheel store\n this.wheels.year.setStore(utils.generateYears(this.options.minDate, this.options.maxDate))\n\n // default switch to start date selector\n this._switchType('start')\n }", "title": "" }, { "docid": "2c5b2280d5f8db41083fb4885c70d7d2", "score": "0.5710556", "text": "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' ).eq(0).focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "title": "" }, { "docid": "d6c8188d0209b5e0ac5e820e982e1a80", "score": "0.5710556", "text": "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root[0].focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' )[0].focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "title": "" }, { "docid": "2c5b2280d5f8db41083fb4885c70d7d2", "score": "0.5710556", "text": "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' ).eq(0).focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "title": "" }, { "docid": "e9d43132f76fcd1e9c468a2f54ebed36", "score": "0.5671549", "text": "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root and then prepare it.\n P.$root = $( '<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />' )\n prepareElementRoot()\n\n\n // Create the picker holder and then prepare it.\n P.$holder = $( createWrappedComponent() ).appendTo( P.$root )\n prepareElementHolder()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) {\n P.$holder = $( createWrappedComponent() )\n prepareElementHolder()\n P.$root.html( P.$holder )\n }\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n focusPickerOnceOpened()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$holder[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n if ( SETTINGS.editable ) {\n ELEMENT.focus()\n }\n else {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$holder.off( 'focus.toOpen' ).focus()\n setTimeout( function() {\n P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder,\n\n 'tabindex=\"-1\"'\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, open the picker.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) {\n event.preventDefault()\n P.open()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the holder picker element with all bindings.\n */\n function prepareElementHolder() {\n\n P.$holder.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n 'focus.toOpen': handleFocusToOpenEvent,\n\n blur: function() {\n // Remove the “target” class.\n $ELEMENT.removeClass( CLASSES.target )\n },\n\n // When something within the holder is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$holder[0] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the holder so that users can click away\n // from elements focused within the picker.\n P.$holder[0].focus()\n }\n }\n }\n\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$holder[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear()\n if ( SETTINGS.closeOnClear ) {\n P.close( true )\n }\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$holder\n\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n }\n\n\n // Wait for transitions to end before focusing the holder. Otherwise, while\n // using the `container` option, the view jumps to the container.\n function focusPickerOnceOpened() {\n\n if (IS_DEFAULT_THEME && supportsTransitions) {\n P.$holder.find('.' + CLASSES.frame).one('transitionend', function() {\n P.$holder[0].focus()\n })\n }\n else {\n P.$holder[0].focus()\n }\n }\n\n\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // Add the “target” class.\n $ELEMENT.addClass( CLASSES.target )\n\n // Add the “focused” class to the root.\n P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close( true )\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "title": "" }, { "docid": "0fcc2e9575cfce08af44444465cd9056", "score": "0.5621097", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\r\n\r\n // If there’s no element, return the picker constructor.\r\n if (!ELEMENT) return PickerConstructor;\r\n\r\n var IS_DEFAULT_THEME = false,\r\n\r\n\r\n // The state of the picker.\r\n STATE = {\r\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\r\n },\r\n\r\n\r\n // Merge the defaults and options passed.\r\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\r\n\r\n\r\n // Merge the default classes with the settings classes.\r\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\r\n\r\n\r\n // The element node wrapper into a jQuery object.\r\n $ELEMENT = $(ELEMENT),\r\n\r\n\r\n // Pseudo picker constructor.\r\n PickerInstance = function () {\r\n return this.start();\r\n },\r\n\r\n\r\n // The picker prototype.\r\n P = PickerInstance.prototype = {\r\n\r\n constructor: PickerInstance,\r\n\r\n $node: $ELEMENT,\r\n\r\n /**\r\n * Initialize everything\r\n */\r\n start: function () {\r\n\r\n // If it’s already started, do nothing.\r\n if (STATE && STATE.start) return P;\r\n\r\n // Update the picker states.\r\n STATE.methods = {};\r\n STATE.start = true;\r\n STATE.open = false;\r\n STATE.type = ELEMENT.type;\r\n\r\n // Confirm focus state, convert into text input to remove UA stylings,\r\n // and set as readonly to prevent keyboard popup.\r\n ELEMENT.autofocus = ELEMENT == getActiveElement();\r\n ELEMENT.readOnly = !SETTINGS.editable;\r\n ELEMENT.id = ELEMENT.id || STATE.id;\r\n if (ELEMENT.type != 'text') {\r\n ELEMENT.type = 'text';\r\n }\r\n\r\n // Create a new picker component with the settings.\r\n P.component = new COMPONENT(P, SETTINGS);\r\n\r\n // Create the picker root with a holder and then prepare it.\r\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\r\n prepareElementRoot();\r\n\r\n // If there’s a format for the hidden input element, create the element.\r\n if (SETTINGS.formatSubmit) {\r\n prepareElementHidden();\r\n }\r\n\r\n // Prepare the input element.\r\n prepareElement();\r\n\r\n // Insert the root as specified in the settings.\r\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\r\n\r\n // Bind the default component and settings events.\r\n P.on({\r\n start: P.component.onStart,\r\n render: P.component.onRender,\r\n stop: P.component.onStop,\r\n open: P.component.onOpen,\r\n close: P.component.onClose,\r\n set: P.component.onSet\r\n }).on({\r\n start: SETTINGS.onStart,\r\n render: SETTINGS.onRender,\r\n stop: SETTINGS.onStop,\r\n open: SETTINGS.onOpen,\r\n close: SETTINGS.onClose,\r\n set: SETTINGS.onSet\r\n });\r\n\r\n // Once we’re all set, check the theme in use.\r\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\r\n\r\n // If the element has autofocus, open the picker.\r\n if (ELEMENT.autofocus) {\r\n P.open();\r\n }\r\n\r\n // Trigger queued the “start” and “render” events.\r\n return P.trigger('start').trigger('render');\r\n }, //start\r\n\r\n\r\n /**\r\n * Render a new picker\r\n */\r\n render: function (entireComponent) {\r\n\r\n // Insert a new component holder in the root or box.\r\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\r\n\r\n // Trigger the queued “render” events.\r\n return P.trigger('render');\r\n }, //render\r\n\r\n\r\n /**\r\n * Destroy everything\r\n */\r\n stop: function () {\r\n\r\n // If it’s already stopped, do nothing.\r\n if (!STATE.start) return P;\r\n\r\n // Then close the picker.\r\n P.close();\r\n\r\n // Remove the hidden field.\r\n if (P._hidden) {\r\n P._hidden.parentNode.removeChild(P._hidden);\r\n }\r\n\r\n // Remove the root.\r\n P.$root.remove();\r\n\r\n // Remove the input class, remove the stored data, and unbind\r\n // the events (after a tick for IE - see `P.close`).\r\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\r\n setTimeout(function () {\r\n $ELEMENT.off('.' + STATE.id);\r\n }, 0);\r\n\r\n // Restore the element state\r\n ELEMENT.type = STATE.type;\r\n ELEMENT.readOnly = false;\r\n\r\n // Trigger the queued “stop” events.\r\n P.trigger('stop');\r\n\r\n // Reset the picker states.\r\n STATE.methods = {};\r\n STATE.start = false;\r\n\r\n return P;\r\n }, //stop\r\n\r\n\r\n /**\r\n * Open up the picker\r\n */\r\n open: function (dontGiveFocus) {\r\n\r\n // If it’s already open, do nothing.\r\n if (STATE.open) return P;\r\n\r\n // Add the “active” class.\r\n $ELEMENT.addClass(CLASSES.active);\r\n aria(ELEMENT, 'expanded', true);\r\n\r\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\r\n // killing transitions :(. So add the “opened” state on the next tick.\r\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\r\n setTimeout(function () {\r\n\r\n // Add the “opened” class to the picker root.\r\n P.$root.addClass(CLASSES.opened);\r\n aria(P.$root[0], 'hidden', false);\r\n }, 0);\r\n\r\n // If we have to give focus, bind the element and doc events.\r\n if (dontGiveFocus !== false) {\r\n\r\n // Set it as open.\r\n STATE.open = true;\r\n\r\n // Prevent the page from scrolling.\r\n if (IS_DEFAULT_THEME) {\r\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\r\n }\r\n\r\n // Pass focus to the root element’s jQuery object.\r\n // * Workaround for iOS8 to bring the picker’s root into view.\r\n P.$root.eq(0).focus();\r\n\r\n // Bind the document events.\r\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\r\n\r\n var target = event.target;\r\n\r\n // If the target of the event is not the element, close the picker picker.\r\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\r\n // Also, for Firefox, a click on an `option` element bubbles up directly\r\n // to the doc. So make sure the target wasn't the doc.\r\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\r\n // which causes the picker to unexpectedly close when right-clicking it. So make\r\n // sure the event wasn’t a right-click.\r\n if (target != ELEMENT && target != document && event.which != 3) {\r\n\r\n // If the target was the holder that covers the screen,\r\n // keep the element focused to maintain tabindex.\r\n P.close(target === P.$root.children()[0]);\r\n }\r\n }).on('keydown.' + STATE.id, function (event) {\r\n\r\n var\r\n // Get the keycode.\r\n keycode = event.keyCode,\r\n\r\n\r\n // Translate that to a selection change.\r\n keycodeToMove = P.component.key[keycode],\r\n\r\n\r\n // Grab the target.\r\n target = event.target;\r\n\r\n // On escape, close the picker and give focus.\r\n if (keycode == 27) {\r\n P.close(true);\r\n }\r\n\r\n // Check if there is a key movement or “enter” keypress on the element.\r\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\r\n\r\n // Prevent the default action to stop page movement.\r\n event.preventDefault();\r\n\r\n // Trigger the key movement action.\r\n if (keycodeToMove) {\r\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\r\n }\r\n\r\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\r\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\r\n P.set('select', P.component.item.highlight);\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n }\r\n }\r\n\r\n // If the target is within the root and “enter” is pressed,\r\n // prevent the default action and trigger a click on the target instead.\r\n else if ($.contains(P.$root[0], target) && keycode == 13) {\r\n event.preventDefault();\r\n target.click();\r\n }\r\n });\r\n }\r\n\r\n // Trigger the queued “open” events.\r\n return P.trigger('open');\r\n }, //open\r\n\r\n\r\n /**\r\n * Close the picker\r\n */\r\n close: function (giveFocus) {\r\n\r\n // If we need to give focus, do it before changing states.\r\n if (giveFocus) {\r\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\r\n // The focus is triggered *after* the close has completed - causing it\r\n // to open again. So unbind and rebind the event at the next tick.\r\n P.$root.off('focus.toOpen').eq(0).focus();\r\n setTimeout(function () {\r\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\r\n }, 0);\r\n }\r\n\r\n // Remove the “active” class.\r\n $ELEMENT.removeClass(CLASSES.active);\r\n aria(ELEMENT, 'expanded', false);\r\n\r\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\r\n // killing transitions :(. So remove the “opened” state on the next tick.\r\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\r\n setTimeout(function () {\r\n\r\n // Remove the “opened” and “focused” class from the picker root.\r\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\r\n aria(P.$root[0], 'hidden', true);\r\n }, 0);\r\n\r\n // If it’s already closed, do nothing more.\r\n if (!STATE.open) return P;\r\n\r\n // Set it as closed.\r\n STATE.open = false;\r\n\r\n // Allow the page to scroll.\r\n if (IS_DEFAULT_THEME) {\r\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\r\n }\r\n\r\n // Unbind the document events.\r\n $document.off('.' + STATE.id);\r\n\r\n // Trigger the queued “close” events.\r\n return P.trigger('close');\r\n }, //close\r\n\r\n\r\n /**\r\n * Clear the values\r\n */\r\n clear: function (options) {\r\n return P.set('clear', null, options);\r\n }, //clear\r\n\r\n\r\n /**\r\n * Set something\r\n */\r\n set: function (thing, value, options) {\r\n\r\n var thingItem,\r\n thingValue,\r\n thingIsObject = $.isPlainObject(thing),\r\n thingObject = thingIsObject ? thing : {};\r\n\r\n // Make sure we have usable options.\r\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\r\n\r\n if (thing) {\r\n\r\n // If the thing isn’t an object, make it one.\r\n if (!thingIsObject) {\r\n thingObject[thing] = value;\r\n }\r\n\r\n // Go through the things of items to set.\r\n for (thingItem in thingObject) {\r\n\r\n // Grab the value of the thing.\r\n thingValue = thingObject[thingItem];\r\n\r\n // First, if the item exists and there’s a value, set it.\r\n if (thingItem in P.component.item) {\r\n if (thingValue === undefined) thingValue = null;\r\n P.component.set(thingItem, thingValue, options);\r\n }\r\n\r\n // Then, check to update the element value and broadcast a change.\r\n if (thingItem == 'select' || thingItem == 'clear') {\r\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\r\n }\r\n }\r\n\r\n // Render a new picker.\r\n P.render();\r\n }\r\n\r\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\r\n return options.muted ? P : P.trigger('set', thingObject);\r\n }, //set\r\n\r\n\r\n /**\r\n * Get something\r\n */\r\n get: function (thing, format) {\r\n\r\n // Make sure there’s something to get.\r\n thing = thing || 'value';\r\n\r\n // If a picker state exists, return that.\r\n if (STATE[thing] != null) {\r\n return STATE[thing];\r\n }\r\n\r\n // Return the submission value, if that.\r\n if (thing == 'valueSubmit') {\r\n if (P._hidden) {\r\n return P._hidden.value;\r\n }\r\n thing = 'value';\r\n }\r\n\r\n // Return the value, if that.\r\n if (thing == 'value') {\r\n return ELEMENT.value;\r\n }\r\n\r\n // Check if a component item exists, return that.\r\n if (thing in P.component.item) {\r\n if (typeof format == 'string') {\r\n var thingValue = P.component.get(thing);\r\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\r\n }\r\n return P.component.get(thing);\r\n }\r\n }, //get\r\n\r\n\r\n /**\r\n * Bind events on the things.\r\n */\r\n on: function (thing, method, internal) {\r\n\r\n var thingName,\r\n thingMethod,\r\n thingIsObject = $.isPlainObject(thing),\r\n thingObject = thingIsObject ? thing : {};\r\n\r\n if (thing) {\r\n\r\n // If the thing isn’t an object, make it one.\r\n if (!thingIsObject) {\r\n thingObject[thing] = method;\r\n }\r\n\r\n // Go through the things to bind to.\r\n for (thingName in thingObject) {\r\n\r\n // Grab the method of the thing.\r\n thingMethod = thingObject[thingName];\r\n\r\n // If it was an internal binding, prefix it.\r\n if (internal) {\r\n thingName = '_' + thingName;\r\n }\r\n\r\n // Make sure the thing methods collection exists.\r\n STATE.methods[thingName] = STATE.methods[thingName] || [];\r\n\r\n // Add the method to the relative method collection.\r\n STATE.methods[thingName].push(thingMethod);\r\n }\r\n }\r\n\r\n return P;\r\n }, //on\r\n\r\n\r\n /**\r\n * Unbind events on the things.\r\n */\r\n off: function () {\r\n var i,\r\n thingName,\r\n names = arguments;\r\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\r\n thingName = names[i];\r\n if (thingName in STATE.methods) {\r\n delete STATE.methods[thingName];\r\n }\r\n }\r\n return P;\r\n },\r\n\r\n /**\r\n * Fire off method events.\r\n */\r\n trigger: function (name, data) {\r\n var _trigger = function (name) {\r\n var methodList = STATE.methods[name];\r\n if (methodList) {\r\n methodList.map(function (method) {\r\n PickerConstructor._.trigger(method, P, [data]);\r\n });\r\n }\r\n };\r\n _trigger('_' + name);\r\n _trigger(name);\r\n return P;\r\n } //trigger\r\n //PickerInstance.prototype\r\n\r\n\r\n /**\r\n * Wrap the picker holder components together.\r\n */\r\n };function createWrappedComponent() {\r\n\r\n // Create a picker wrapper holder\r\n return PickerConstructor._.node('div',\r\n\r\n // Create a picker wrapper node\r\n PickerConstructor._.node('div',\r\n\r\n // Create a picker frame\r\n PickerConstructor._.node('div',\r\n\r\n // Create a picker box node\r\n PickerConstructor._.node('div',\r\n\r\n // Create the components nodes.\r\n P.component.nodes(STATE.open),\r\n\r\n // The picker box class\r\n CLASSES.box),\r\n\r\n // Picker wrap class\r\n CLASSES.wrap),\r\n\r\n // Picker frame class\r\n CLASSES.frame),\r\n\r\n // Picker holder class\r\n CLASSES.holder); //endreturn\r\n } //createWrappedComponent\r\n\r\n\r\n /**\r\n * Prepare the input element with all bindings.\r\n */\r\n function prepareElement() {\r\n\r\n $ELEMENT.\r\n\r\n // Store the picker data by component name.\r\n data(NAME, P).\r\n\r\n // Add the “input” class name.\r\n addClass(CLASSES.input).\r\n\r\n // Remove the tabindex.\r\n attr('tabindex', -1).\r\n\r\n // If there’s a `data-value`, update the value of the element.\r\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\r\n\r\n // Only bind keydown events if the element isn’t editable.\r\n if (!SETTINGS.editable) {\r\n\r\n $ELEMENT.\r\n\r\n // On focus/click, focus onto the root to open it up.\r\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\r\n event.preventDefault();\r\n P.$root.eq(0).focus();\r\n }).\r\n\r\n // Handle keyboard event based on the picker being opened or not.\r\n on('keydown.' + STATE.id, handleKeydownEvent);\r\n }\r\n\r\n // Update the aria attributes.\r\n aria(ELEMENT, {\r\n haspopup: true,\r\n expanded: false,\r\n readonly: false,\r\n owns: ELEMENT.id + '_root'\r\n });\r\n }\r\n\r\n /**\r\n * Prepare the root picker element with all bindings.\r\n */\r\n function prepareElementRoot() {\r\n\r\n P.$root.on({\r\n\r\n // For iOS8.\r\n keydown: handleKeydownEvent,\r\n\r\n // When something within the root is focused, stop from bubbling\r\n // to the doc and remove the “focused” state from the root.\r\n focusin: function (event) {\r\n P.$root.removeClass(CLASSES.focused);\r\n event.stopPropagation();\r\n },\r\n\r\n // When something within the root holder is clicked, stop it\r\n // from bubbling to the doc.\r\n 'mousedown click': function (event) {\r\n\r\n var target = event.target;\r\n\r\n // Make sure the target isn’t the root holder so it can bubble up.\r\n if (target != P.$root.children()[0]) {\r\n\r\n event.stopPropagation();\r\n\r\n // * For mousedown events, cancel the default action in order to\r\n // prevent cases where focus is shifted onto external elements\r\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\r\n // Also, for Firefox, don’t prevent action on the `option` element.\r\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\r\n\r\n event.preventDefault();\r\n\r\n // Re-focus onto the root so that users can click away\r\n // from elements focused within the picker.\r\n P.$root.eq(0).focus();\r\n }\r\n }\r\n }\r\n }).\r\n\r\n // Add/remove the “target” class on focus and blur.\r\n on({\r\n focus: function () {\r\n $ELEMENT.addClass(CLASSES.target);\r\n },\r\n blur: function () {\r\n $ELEMENT.removeClass(CLASSES.target);\r\n }\r\n }).\r\n\r\n // Open the picker and adjust the root “focused” state\r\n on('focus.toOpen', handleFocusToOpenEvent).\r\n\r\n // If there’s a click on an actionable element, carry out the actions.\r\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\r\n\r\n var $target = $(this),\r\n targetData = $target.data(),\r\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\r\n\r\n\r\n // * For IE, non-focusable elements can be active elements as well\r\n // (http://stackoverflow.com/a/2684561).\r\n activeElement = getActiveElement();\r\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\r\n\r\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\r\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\r\n P.$root.eq(0).focus();\r\n }\r\n\r\n // If something is superficially changed, update the `highlight` based on the `nav`.\r\n if (!targetDisabled && targetData.nav) {\r\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\r\n }\r\n\r\n // If something is picked, set `select` then close with focus.\r\n else if (!targetDisabled && 'pick' in targetData) {\r\n P.set('select', targetData.pick);\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n }\r\n\r\n // If a “clear” button is pressed, empty the values and close with focus.\r\n else if (targetData.clear) {\r\n P.clear();\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n } else if (targetData.close) {\r\n P.close(true);\r\n }\r\n }); //P.$root\r\n\r\n aria(P.$root[0], 'hidden', true);\r\n }\r\n\r\n /**\r\n * Prepare the hidden input element along with all bindings.\r\n */\r\n function prepareElementHidden() {\r\n\r\n var name;\r\n\r\n if (SETTINGS.hiddenName === true) {\r\n name = ELEMENT.name;\r\n ELEMENT.name = '';\r\n } else {\r\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\r\n name = name[0] + ELEMENT.name + name[1];\r\n }\r\n\r\n P._hidden = $('<input ' + 'type=hidden ' +\r\n\r\n // Create the name using the original input’s with a prefix and suffix.\r\n 'name=\"' + name + '\"' + (\r\n\r\n // If the element has a value, set the hidden value as well.\r\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\r\n\r\n $ELEMENT.\r\n\r\n // If the value changes, update the hidden input with the correct format.\r\n on('change.' + STATE.id, function () {\r\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\r\n });\r\n\r\n // Insert the hidden input as specified in the settings.\r\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\r\n }\r\n\r\n // For iOS8.\r\n function handleKeydownEvent(event) {\r\n\r\n var keycode = event.keyCode,\r\n\r\n\r\n // Check if one of the delete keys was pressed.\r\n isKeycodeDelete = /^(8|46)$/.test(keycode);\r\n\r\n // For some reason IE clears the input value on “escape”.\r\n if (keycode == 27) {\r\n P.close();\r\n return false;\r\n }\r\n\r\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\r\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\r\n\r\n // Prevent it from moving the page and bubbling to doc.\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n // If `delete` was pressed, clear the values and close the picker.\r\n // Otherwise open the picker.\r\n if (isKeycodeDelete) {\r\n P.clear().close();\r\n } else {\r\n P.open();\r\n }\r\n }\r\n }\r\n\r\n // Separated for IE\r\n function handleFocusToOpenEvent(event) {\r\n\r\n // Stop the event from propagating to the doc.\r\n event.stopPropagation();\r\n\r\n // If it’s a focus event, add the “focused” class to the root.\r\n if (event.type == 'focus') {\r\n P.$root.addClass(CLASSES.focused);\r\n }\r\n\r\n // And then finally open the picker.\r\n P.open();\r\n }\r\n\r\n // Return a new picker instance.\r\n return new PickerInstance();\r\n }", "title": "" }, { "docid": "20d8472b393f32d7a6cc38e3bea5738d", "score": "0.558182", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "title": "" }, { "docid": "20d8472b393f32d7a6cc38e3bea5738d", "score": "0.558182", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "title": "" }, { "docid": "20d8472b393f32d7a6cc38e3bea5738d", "score": "0.558182", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "title": "" }, { "docid": "19b7d66e5048272c6e312f25b2274f46", "score": "0.558182", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href);\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "title": "" }, { "docid": "763d2d1cebcc79a7beb02524263d3f6b", "score": "0.5532787", "text": "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n\t // If there’s no element, return the picker constructor.\n\t if ( !ELEMENT ) return PickerConstructor\n\n\n\t var\n\t IS_DEFAULT_THEME = false,\n\n\n\t // The state of the picker.\n\t STATE = {\n\t id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n\t },\n\n\n\t // Merge the defaults and options passed.\n\t SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n\t // Merge the default classes with the settings classes.\n\t CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n\t // The element node wrapper into a jQuery object.\n\t $ELEMENT = $( ELEMENT ),\n\n\n\t // Pseudo picker constructor.\n\t PickerInstance = function() {\n\t return this.start()\n\t },\n\n\n\t // The picker prototype.\n\t P = PickerInstance.prototype = {\n\n\t constructor: PickerInstance,\n\n\t $node: $ELEMENT,\n\n\n\t /**\n\t * Initialize everything\n\t */\n\t start: function() {\n\n\t // If it’s already started, do nothing.\n\t if ( STATE && STATE.start ) return P\n\n\n\t // Update the picker states.\n\t STATE.methods = {}\n\t STATE.start = true\n\t STATE.open = false\n\t STATE.type = ELEMENT.type\n\n\n\t // Confirm focus state, convert into text input to remove UA stylings,\n\t // and set as readonly to prevent keyboard popup.\n\t ELEMENT.autofocus = ELEMENT == getActiveElement()\n\t ELEMENT.readOnly = !SETTINGS.editable\n\t ELEMENT.id = ELEMENT.id || STATE.id\n\t if ( ELEMENT.type != 'text' ) {\n\t ELEMENT.type = 'text'\n\t }\n\n\n\t // Create a new picker component with the settings.\n\t P.component = new COMPONENT(P, SETTINGS)\n\n\n\t // Create the picker root with a holder and then prepare it.\n\t P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n\t prepareElementRoot()\n\n\n\t // If there’s a format for the hidden input element, create the element.\n\t if ( SETTINGS.formatSubmit ) {\n\t prepareElementHidden()\n\t }\n\n\n\t // Prepare the input element.\n\t prepareElement()\n\n\n\t // Insert the root as specified in the settings.\n\t if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n\t else $ELEMENT.after( P.$root )\n\n\n\t // Bind the default component and settings events.\n\t P.on({\n\t start: P.component.onStart,\n\t render: P.component.onRender,\n\t stop: P.component.onStop,\n\t open: P.component.onOpen,\n\t close: P.component.onClose,\n\t set: P.component.onSet\n\t }).on({\n\t start: SETTINGS.onStart,\n\t render: SETTINGS.onRender,\n\t stop: SETTINGS.onStop,\n\t open: SETTINGS.onOpen,\n\t close: SETTINGS.onClose,\n\t set: SETTINGS.onSet\n\t })\n\n\n\t // Once we’re all set, check the theme in use.\n\t IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n\t // If the element has autofocus, open the picker.\n\t if ( ELEMENT.autofocus ) {\n\t P.open()\n\t }\n\n\n\t // Trigger queued the “start” and “render” events.\n\t return P.trigger( 'start' ).trigger( 'render' )\n\t }, //start\n\n\n\t /**\n\t * Render a new picker\n\t */\n\t render: function( entireComponent ) {\n\n\t // Insert a new component holder in the root or box.\n\t if ( entireComponent ) P.$root.html( createWrappedComponent() )\n\t else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n\t // Trigger the queued “render” events.\n\t return P.trigger( 'render' )\n\t }, //render\n\n\n\t /**\n\t * Destroy everything\n\t */\n\t stop: function() {\n\n\t // If it’s already stopped, do nothing.\n\t if ( !STATE.start ) return P\n\n\t // Then close the picker.\n\t P.close()\n\n\t // Remove the hidden field.\n\t if ( P._hidden ) {\n\t P._hidden.parentNode.removeChild( P._hidden )\n\t }\n\n\t // Remove the root.\n\t P.$root.remove()\n\n\t // Remove the input class, remove the stored data, and unbind\n\t // the events (after a tick for IE - see `P.close`).\n\t $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n\t setTimeout( function() {\n\t $ELEMENT.off( '.' + STATE.id )\n\t }, 0)\n\n\t // Restore the element state\n\t ELEMENT.type = STATE.type\n\t ELEMENT.readOnly = false\n\n\t // Trigger the queued “stop” events.\n\t P.trigger( 'stop' )\n\n\t // Reset the picker states.\n\t STATE.methods = {}\n\t STATE.start = false\n\n\t return P\n\t }, //stop\n\n\n\t /**\n\t * Open up the picker\n\t */\n\t open: function( dontGiveFocus ) {\n\n\t // If it’s already open, do nothing.\n\t if ( STATE.open ) return P\n\n\t // Add the “active” class.\n\t $ELEMENT.addClass( CLASSES.active )\n\t aria( ELEMENT, 'expanded', true )\n\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So add the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout( function() {\n\n\t // Add the “opened” class to the picker root.\n\t P.$root.addClass( CLASSES.opened )\n\t aria( P.$root[0], 'hidden', false )\n\n\t }, 0 )\n\n\t // If we have to give focus, bind the element and doc events.\n\t if ( dontGiveFocus !== false ) {\n\n\t // Set it as open.\n\t STATE.open = true\n\n\t // Prevent the page from scrolling.\n\t if ( IS_DEFAULT_THEME ) {\n\t $html.\n\t css( 'overflow', 'hidden' ).\n\t css( 'padding-right', '+=' + getScrollbarWidth() )\n\t }\n\n\t // Pass focus to the root element’s jQuery object.\n\t // * Workaround for iOS8 to bring the picker’s root into view.\n\t P.$root[0].focus()\n\n\t // Bind the document events.\n\t $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n\t var target = event.target\n\n\t // If the target of the event is not the element, close the picker picker.\n\t // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n\t // Also, for Firefox, a click on an `option` element bubbles up directly\n\t // to the doc. So make sure the target wasn't the doc.\n\t // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n\t // which causes the picker to unexpectedly close when right-clicking it. So make\n\t // sure the event wasn’t a right-click.\n\t if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n\t // If the target was the holder that covers the screen,\n\t // keep the element focused to maintain tabindex.\n\t P.close( target === P.$root.children()[0] )\n\t }\n\n\t }).on( 'keydown.' + STATE.id, function( event ) {\n\n\t var\n\t // Get the keycode.\n\t keycode = event.keyCode,\n\n\t // Translate that to a selection change.\n\t keycodeToMove = P.component.key[ keycode ],\n\n\t // Grab the target.\n\t target = event.target\n\n\n\t // On escape, close the picker and give focus.\n\t if ( keycode == 27 ) {\n\t P.close( true )\n\t }\n\n\n\t // Check if there is a key movement or “enter” keypress on the element.\n\t else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n\t // Prevent the default action to stop page movement.\n\t event.preventDefault()\n\n\t // Trigger the key movement action.\n\t if ( keycodeToMove ) {\n\t PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n\t }\n\n\t // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n\t else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n\t P.set( 'select', P.component.item.highlight ).close()\n\t }\n\t }\n\n\n\t // If the target is within the root and “enter” is pressed,\n\t // prevent the default action and trigger a click on the target instead.\n\t else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n\t event.preventDefault()\n\t target.click()\n\t }\n\t })\n\t }\n\n\t // Trigger the queued “open” events.\n\t return P.trigger( 'open' )\n\t }, //open\n\n\n\t /**\n\t * Close the picker\n\t */\n\t close: function( giveFocus ) {\n\n\t // If we need to give focus, do it before changing states.\n\t if ( giveFocus ) {\n\t // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n\t // The focus is triggered *after* the close has completed - causing it\n\t // to open again. So unbind and rebind the event at the next tick.\n\t P.$root.off( 'focus.toOpen' )[0].focus()\n\t setTimeout( function() {\n\t P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n\t }, 0 )\n\t }\n\n\t // Remove the “active” class.\n\t $ELEMENT.removeClass( CLASSES.active )\n\t aria( ELEMENT, 'expanded', false )\n\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So remove the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout( function() {\n\n\t // Remove the “opened” and “focused” class from the picker root.\n\t P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n\t aria( P.$root[0], 'hidden', true )\n\n\t }, 0 )\n\n\t // If it’s already closed, do nothing more.\n\t if ( !STATE.open ) return P\n\n\t // Set it as closed.\n\t STATE.open = false\n\n\t // Allow the page to scroll.\n\t if ( IS_DEFAULT_THEME ) {\n\t $html.\n\t css( 'overflow', '' ).\n\t css( 'padding-right', '-=' + getScrollbarWidth() )\n\t }\n\n\t // Unbind the document events.\n\t $document.off( '.' + STATE.id )\n\n\t // Trigger the queued “close” events.\n\t return P.trigger( 'close' )\n\t }, //close\n\n\n\t /**\n\t * Clear the values\n\t */\n\t clear: function( options ) {\n\t return P.set( 'clear', null, options )\n\t }, //clear\n\n\n\t /**\n\t * Set something\n\t */\n\t set: function( thing, value, options ) {\n\n\t var thingItem, thingValue,\n\t thingIsObject = $.isPlainObject( thing ),\n\t thingObject = thingIsObject ? thing : {}\n\n\t // Make sure we have usable options.\n\t options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n\t if ( thing ) {\n\n\t // If the thing isn’t an object, make it one.\n\t if ( !thingIsObject ) {\n\t thingObject[ thing ] = value\n\t }\n\n\t // Go through the things of items to set.\n\t for ( thingItem in thingObject ) {\n\n\t // Grab the value of the thing.\n\t thingValue = thingObject[ thingItem ]\n\n\t // First, if the item exists and there’s a value, set it.\n\t if ( thingItem in P.component.item ) {\n\t if ( thingValue === undefined ) thingValue = null\n\t P.component.set( thingItem, thingValue, options )\n\t }\n\n\t // Then, check to update the element value and broadcast a change.\n\t if ( thingItem == 'select' || thingItem == 'clear' ) {\n\t $ELEMENT.\n\t val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n\t trigger( 'change' )\n\t }\n\t }\n\n\t // Render a new picker.\n\t P.render()\n\t }\n\n\t // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n\t return options.muted ? P : P.trigger( 'set', thingObject )\n\t }, //set\n\n\n\t /**\n\t * Get something\n\t */\n\t get: function( thing, format ) {\n\n\t // Make sure there’s something to get.\n\t thing = thing || 'value'\n\n\t // If a picker state exists, return that.\n\t if ( STATE[ thing ] != null ) {\n\t return STATE[ thing ]\n\t }\n\n\t // Return the submission value, if that.\n\t if ( thing == 'valueSubmit' ) {\n\t if ( P._hidden ) {\n\t return P._hidden.value\n\t }\n\t thing = 'value'\n\t }\n\n\t // Return the value, if that.\n\t if ( thing == 'value' ) {\n\t return ELEMENT.value\n\t }\n\n\t // Check if a component item exists, return that.\n\t if ( thing in P.component.item ) {\n\t if ( typeof format == 'string' ) {\n\t var thingValue = P.component.get( thing )\n\t return thingValue ?\n\t PickerConstructor._.trigger(\n\t P.component.formats.toString,\n\t P.component,\n\t [ format, thingValue ]\n\t ) : ''\n\t }\n\t return P.component.get( thing )\n\t }\n\t }, //get\n\n\n\n\t /**\n\t * Bind events on the things.\n\t */\n\t on: function( thing, method, internal ) {\n\n\t var thingName, thingMethod,\n\t thingIsObject = $.isPlainObject( thing ),\n\t thingObject = thingIsObject ? thing : {}\n\n\t if ( thing ) {\n\n\t // If the thing isn’t an object, make it one.\n\t if ( !thingIsObject ) {\n\t thingObject[ thing ] = method\n\t }\n\n\t // Go through the things to bind to.\n\t for ( thingName in thingObject ) {\n\n\t // Grab the method of the thing.\n\t thingMethod = thingObject[ thingName ]\n\n\t // If it was an internal binding, prefix it.\n\t if ( internal ) {\n\t thingName = '_' + thingName\n\t }\n\n\t // Make sure the thing methods collection exists.\n\t STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n\t // Add the method to the relative method collection.\n\t STATE.methods[ thingName ].push( thingMethod )\n\t }\n\t }\n\n\t return P\n\t }, //on\n\n\n\n\t /**\n\t * Unbind events on the things.\n\t */\n\t off: function() {\n\t var i, thingName,\n\t names = arguments;\n\t for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n\t thingName = names[i]\n\t if ( thingName in STATE.methods ) {\n\t delete STATE.methods[thingName]\n\t }\n\t }\n\t return P\n\t },\n\n\n\t /**\n\t * Fire off method events.\n\t */\n\t trigger: function( name, data ) {\n\t var _trigger = function( name ) {\n\t var methodList = STATE.methods[ name ]\n\t if ( methodList ) {\n\t methodList.map( function( method ) {\n\t PickerConstructor._.trigger( method, P, [ data ] )\n\t })\n\t }\n\t }\n\t _trigger( '_' + name )\n\t _trigger( name )\n\t return P\n\t } //trigger\n\t } //PickerInstance.prototype\n\n\n\t /**\n\t * Wrap the picker holder components together.\n\t */\n\t function createWrappedComponent() {\n\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node( 'div',\n\n\t // Create a picker wrapper node\n\t PickerConstructor._.node( 'div',\n\n\t // Create a picker frame\n\t PickerConstructor._.node( 'div',\n\n\t // Create a picker box node\n\t PickerConstructor._.node( 'div',\n\n\t // Create the components nodes.\n\t P.component.nodes( STATE.open ),\n\n\t // The picker box class\n\t CLASSES.box\n\t ),\n\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t } //createWrappedComponent\n\n\n\n\t /**\n\t * Prepare the input element with all bindings.\n\t */\n\t function prepareElement() {\n\n\t $ELEMENT.\n\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\n\t // Remove the tabindex.\n\t attr('tabindex', -1).\n\n\t // If there’s a `data-value`, update the value of the element.\n\t val( $ELEMENT.data('value') ?\n\t P.get('select', SETTINGS.format) :\n\t ELEMENT.value\n\t )\n\n\n\t // Only bind keydown events if the element isn’t editable.\n\t if ( !SETTINGS.editable ) {\n\n\t $ELEMENT.\n\n\t // On focus/click, focus onto the root to open it up.\n\t on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n\t event.preventDefault()\n\t P.$root[0].focus()\n\t }).\n\n\t // Handle keyboard event based on the picker being opened or not.\n\t on( 'keydown.' + STATE.id, handleKeydownEvent )\n\t }\n\n\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root'\n\t })\n\t }\n\n\n\t /**\n\t * Prepare the root picker element with all bindings.\n\t */\n\t function prepareElementRoot() {\n\n\t P.$root.\n\n\t on({\n\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\n\n\t // When something within the root is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function( event ) {\n\t P.$root.removeClass( CLASSES.focused )\n\t event.stopPropagation()\n\t },\n\n\t // When something within the root holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function( event ) {\n\n\t var target = event.target\n\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if ( target != P.$root.children()[ 0 ] ) {\n\n\t event.stopPropagation()\n\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n\t event.preventDefault()\n\n\t // Re-focus onto the root so that users can click away\n\t // from elements focused within the picker.\n\t P.$root[0].focus()\n\t }\n\t }\n\t }\n\t }).\n\n\t // Add/remove the “target” class on focus and blur.\n\t on({\n\t focus: function() {\n\t $ELEMENT.addClass( CLASSES.target )\n\t },\n\t blur: function() {\n\t $ELEMENT.removeClass( CLASSES.target )\n\t }\n\t }).\n\n\t // Open the picker and adjust the root “focused” state\n\t on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n\t var $target = $( this ),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = getActiveElement()\n\t activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n\t P.$root[0].focus()\n\t }\n\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if ( !targetDisabled && targetData.nav ) {\n\t P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n\t }\n\n\t // If something is picked, set `select` then close with focus.\n\t else if ( !targetDisabled && 'pick' in targetData ) {\n\t P.set( 'select', targetData.pick )\n\t }\n\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if ( targetData.clear ) {\n\t P.clear().close( true )\n\t }\n\n\t else if ( targetData.close ) {\n\t P.close( true )\n\t }\n\n\t }) //P.$root\n\n\t aria( P.$root[0], 'hidden', true )\n\t }\n\n\n\t /**\n\t * Prepare the hidden input element along with all bindings.\n\t */\n\t function prepareElementHidden() {\n\n\t var name\n\n\t if ( SETTINGS.hiddenName === true ) {\n\t name = ELEMENT.name\n\t ELEMENT.name = ''\n\t }\n\t else {\n\t name = [\n\t typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n\t typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n\t ]\n\t name = name[0] + ELEMENT.name + name[1]\n\t }\n\n\t P._hidden = $(\n\t '<input ' +\n\t 'type=hidden ' +\n\n\t // Create the name using the original input’s with a prefix and suffix.\n\t 'name=\"' + name + '\"' +\n\n\t // If the element has a value, set the hidden value as well.\n\t (\n\t $ELEMENT.data('value') || ELEMENT.value ?\n\t ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n\t ''\n\t ) +\n\t '>'\n\t )[0]\n\n\t $ELEMENT.\n\n\t // If the value changes, update the hidden input with the correct format.\n\t on('change.' + STATE.id, function() {\n\t P._hidden.value = ELEMENT.value ?\n\t P.get('select', SETTINGS.formatSubmit) :\n\t ''\n\t })\n\n\n\t // Insert the hidden input as specified in the settings.\n\t if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n\t else $ELEMENT.after( P._hidden )\n\t }\n\n\n\t // For iOS8.\n\t function handleKeydownEvent( event ) {\n\n\t var keycode = event.keyCode,\n\n\t // Check if one of the delete keys was pressed.\n\t isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n\t // For some reason IE clears the input value on “escape”.\n\t if ( keycode == 27 ) {\n\t P.close()\n\t return false\n\t }\n\n\t // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n\t if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n\t // Prevent it from moving the page and bubbling to doc.\n\t event.preventDefault()\n\t event.stopPropagation()\n\n\t // If `delete` was pressed, clear the values and close the picker.\n\t // Otherwise open the picker.\n\t if ( isKeycodeDelete ) { P.clear().close() }\n\t else { P.open() }\n\t }\n\t }\n\n\n\t // Separated for IE\n\t function handleFocusToOpenEvent( event ) {\n\n\t // Stop the event from propagating to the doc.\n\t event.stopPropagation()\n\n\t // If it’s a focus event, add the “focused” class to the root.\n\t if ( event.type == 'focus' ) {\n\t P.$root.addClass( CLASSES.focused )\n\t }\n\n\t // And then finally open the picker.\n\t P.open()\n\t }\n\n\n\t // Return a new picker instance.\n\t return new PickerInstance()\n\t}", "title": "" }, { "docid": "8b95ba50193a4b5fe4dec74699fd7cca", "score": "0.5500414", "text": "buildPickerPanel() {\n let options = this.buildOptions();\n\n // Picker modal\n let pickerModal = document.createElement(\"div\");\n pickerModal.classList.add(\"picker-modal\");\n\n // Picker panel\n let pickerPanel = document.createElement(\"div\");\n pickerPanel.className = \"picker-panel\";\n\n // Options to display in the panel\n let pickerPanelOptions = document.createElement(\"div\");\n pickerPanelOptions.className = \"picker-panel-options\";\n\n for (let idx in options) {\n pickerPanelOptions.appendChild(options[idx]);\n }\n\n pickerPanel.appendChild(pickerPanelOptions);\n\n // Add a close button to our picker panel\n let closeButton = this.buildCloseButton();\n pickerPanel.appendChild(closeButton);\n\n pickerModal.appendChild(pickerPanel);\n\n return pickerModal;\n }", "title": "" }, { "docid": "5b0234db2a739c241c1cfc7ce0491f51", "score": "0.54780555", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\t\n\t // If there’s no element, return the picker constructor.\n\t if (!ELEMENT) return PickerConstructor;\n\t\n\t var IS_DEFAULT_THEME = false,\n\t\n\t\n\t // The state of the picker.\n\t STATE = {\n\t id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n\t },\n\t\n\t\n\t // Merge the defaults and options passed.\n\t SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\t\n\t\n\t // Merge the default classes with the settings classes.\n\t CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\t\n\t\n\t // The element node wrapper into a jQuery object.\n\t $ELEMENT = $(ELEMENT),\n\t\n\t\n\t // Pseudo picker constructor.\n\t PickerInstance = function PickerInstance() {\n\t return this.start();\n\t },\n\t\n\t\n\t // The picker prototype.\n\t P = PickerInstance.prototype = {\n\t\n\t constructor: PickerInstance,\n\t\n\t $node: $ELEMENT,\n\t\n\t /**\n\t * Initialize everything\n\t */\n\t start: function start() {\n\t\n\t // If it’s already started, do nothing.\n\t if (STATE && STATE.start) return P;\n\t\n\t // Update the picker states.\n\t STATE.methods = {};\n\t STATE.start = true;\n\t STATE.open = false;\n\t STATE.type = ELEMENT.type;\n\t\n\t // Confirm focus state, convert into text input to remove UA stylings,\n\t // and set as readonly to prevent keyboard popup.\n\t ELEMENT.autofocus = ELEMENT == getActiveElement();\n\t ELEMENT.readOnly = !SETTINGS.editable;\n\t ELEMENT.id = ELEMENT.id || STATE.id;\n\t if (ELEMENT.type != 'text') {\n\t ELEMENT.type = 'text';\n\t }\n\t\n\t // Create a new picker component with the settings.\n\t P.component = new COMPONENT(P, SETTINGS);\n\t\n\t // Create the picker root and then prepare it.\n\t P.$root = $('<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />');\n\t prepareElementRoot();\n\t\n\t // Create the picker holder and then prepare it.\n\t P.$holder = $(createWrappedComponent()).appendTo(P.$root);\n\t prepareElementHolder();\n\t\n\t // If there’s a format for the hidden input element, create the element.\n\t if (SETTINGS.formatSubmit) {\n\t prepareElementHidden();\n\t }\n\t\n\t // Prepare the input element.\n\t prepareElement();\n\t\n\t // Insert the hidden input as specified in the settings.\n\t if (SETTINGS.containerHidden) $(SETTINGS.containerHidden).append(P._hidden);else $ELEMENT.after(P._hidden);\n\t\n\t // Insert the root as specified in the settings.\n\t if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.after(P.$root);\n\t\n\t // Bind the default component and settings events.\n\t P.on({\n\t start: P.component.onStart,\n\t render: P.component.onRender,\n\t stop: P.component.onStop,\n\t open: P.component.onOpen,\n\t close: P.component.onClose,\n\t set: P.component.onSet\n\t }).on({\n\t start: SETTINGS.onStart,\n\t render: SETTINGS.onRender,\n\t stop: SETTINGS.onStop,\n\t open: SETTINGS.onOpen,\n\t close: SETTINGS.onClose,\n\t set: SETTINGS.onSet\n\t });\n\t\n\t // Once we’re all set, check the theme in use.\n\t IS_DEFAULT_THEME = isUsingDefaultTheme(P.$holder[0]);\n\t\n\t // If the element has autofocus, open the picker.\n\t if (ELEMENT.autofocus) {\n\t P.open();\n\t }\n\t\n\t // Trigger queued the “start” and “render” events.\n\t return P.trigger('start').trigger('render');\n\t }, //start\n\t\n\t\n\t /**\n\t * Render a new picker\n\t */\n\t render: function render(entireComponent) {\n\t\n\t // Insert a new component holder in the root or box.\n\t if (entireComponent) {\n\t P.$holder = $(createWrappedComponent());\n\t prepareElementHolder();\n\t P.$root.html(P.$holder);\n\t } else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\t\n\t // Trigger the queued “render” events.\n\t return P.trigger('render');\n\t }, //render\n\t\n\t\n\t /**\n\t * Destroy everything\n\t */\n\t stop: function stop() {\n\t\n\t // If it’s already stopped, do nothing.\n\t if (!STATE.start) return P;\n\t\n\t // Then close the picker.\n\t P.close();\n\t\n\t // Remove the hidden field.\n\t if (P._hidden) {\n\t P._hidden.parentNode.removeChild(P._hidden);\n\t }\n\t\n\t // Remove the root.\n\t P.$root.remove();\n\t\n\t // Remove the input class, remove the stored data, and unbind\n\t // the events (after a tick for IE - see `P.close`).\n\t $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n\t setTimeout(function () {\n\t $ELEMENT.off('.' + STATE.id);\n\t }, 0);\n\t\n\t // Restore the element state\n\t ELEMENT.type = STATE.type;\n\t ELEMENT.readOnly = false;\n\t\n\t // Trigger the queued “stop” events.\n\t P.trigger('stop');\n\t\n\t // Reset the picker states.\n\t STATE.methods = {};\n\t STATE.start = false;\n\t\n\t return P;\n\t }, //stop\n\t\n\t\n\t /**\n\t * Open up the picker\n\t */\n\t open: function open(dontGiveFocus) {\n\t\n\t // If it’s already open, do nothing.\n\t if (STATE.open) return P;\n\t\n\t // Add the “active” class.\n\t $ELEMENT.addClass(CLASSES.active);\n\t aria(ELEMENT, 'expanded', true);\n\t\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So add the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout(function () {\n\t\n\t // Add the “opened” class to the picker root.\n\t P.$root.addClass(CLASSES.opened);\n\t aria(P.$root[0], 'hidden', false);\n\t }, 0);\n\t\n\t // If we have to give focus, bind the element and doc events.\n\t if (dontGiveFocus !== false) {\n\t\n\t // Set it as open.\n\t STATE.open = true;\n\t\n\t // Prevent the page from scrolling.\n\t if (IS_DEFAULT_THEME) {\n\t $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n\t }\n\t\n\t // Pass focus to the root element’s jQuery object.\n\t focusPickerOnceOpened();\n\t\n\t // Bind the document events.\n\t $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\t\n\t var target = event.target;\n\t\n\t // If the target of the event is not the element, close the picker picker.\n\t // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n\t // Also, for Firefox, a click on an `option` element bubbles up directly\n\t // to the doc. So make sure the target wasn't the doc.\n\t // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n\t // which causes the picker to unexpectedly close when right-clicking it. So make\n\t // sure the event wasn’t a right-click.\n\t if (target != ELEMENT && target != document && event.which != 3) {\n\t\n\t // If the target was the holder that covers the screen,\n\t // keep the element focused to maintain tabindex.\n\t P.close(target === P.$holder[0]);\n\t }\n\t }).on('keydown.' + STATE.id, function (event) {\n\t\n\t var\n\t // Get the keycode.\n\t keycode = event.keyCode,\n\t\n\t\n\t // Translate that to a selection change.\n\t keycodeToMove = P.component.key[keycode],\n\t\n\t\n\t // Grab the target.\n\t target = event.target;\n\t\n\t // On escape, close the picker and give focus.\n\t if (keycode == 27) {\n\t P.close(true);\n\t }\n\t\n\t // Check if there is a key movement or “enter” keypress on the element.\n\t else if (target == P.$holder[0] && (keycodeToMove || keycode == 13)) {\n\t\n\t // Prevent the default action to stop page movement.\n\t event.preventDefault();\n\t\n\t // Trigger the key movement action.\n\t if (keycodeToMove) {\n\t PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n\t }\n\t\n\t // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n\t else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n\t P.set('select', P.component.item.highlight);\n\t if (SETTINGS.closeOnSelect) {\n\t P.close(true);\n\t }\n\t }\n\t }\n\t\n\t // If the target is within the root and “enter” is pressed,\n\t // prevent the default action and trigger a click on the target instead.\n\t else if ($.contains(P.$root[0], target) && keycode == 13) {\n\t event.preventDefault();\n\t target.click();\n\t }\n\t });\n\t }\n\t\n\t // Trigger the queued “open” events.\n\t return P.trigger('open');\n\t }, //open\n\t\n\t\n\t /**\n\t * Close the picker\n\t */\n\t close: function close(giveFocus) {\n\t\n\t // If we need to give focus, do it before changing states.\n\t if (giveFocus) {\n\t if (SETTINGS.editable) {\n\t ELEMENT.focus();\n\t } else {\n\t // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n\t // The focus is triggered *after* the close has completed - causing it\n\t // to open again. So unbind and rebind the event at the next tick.\n\t P.$holder.off('focus.toOpen').focus();\n\t setTimeout(function () {\n\t P.$holder.on('focus.toOpen', handleFocusToOpenEvent);\n\t }, 0);\n\t }\n\t }\n\t\n\t // Remove the “active” class.\n\t $ELEMENT.removeClass(CLASSES.active);\n\t aria(ELEMENT, 'expanded', false);\n\t\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So remove the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout(function () {\n\t\n\t // Remove the “opened” and “focused” class from the picker root.\n\t P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n\t aria(P.$root[0], 'hidden', true);\n\t }, 0);\n\t\n\t // If it’s already closed, do nothing more.\n\t if (!STATE.open) return P;\n\t\n\t // Set it as closed.\n\t STATE.open = false;\n\t\n\t // Allow the page to scroll.\n\t if (IS_DEFAULT_THEME) {\n\t $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n\t }\n\t\n\t // Unbind the document events.\n\t $document.off('.' + STATE.id);\n\t\n\t // Trigger the queued “close” events.\n\t return P.trigger('close');\n\t }, //close\n\t\n\t\n\t /**\n\t * Clear the values\n\t */\n\t clear: function clear(options) {\n\t return P.set('clear', null, options);\n\t }, //clear\n\t\n\t\n\t /**\n\t * Set something\n\t */\n\t set: function set(thing, value, options) {\n\t\n\t var thingItem,\n\t thingValue,\n\t thingIsObject = $.isPlainObject(thing),\n\t thingObject = thingIsObject ? thing : {};\n\t\n\t // Make sure we have usable options.\n\t options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\t\n\t if (thing) {\n\t\n\t // If the thing isn’t an object, make it one.\n\t if (!thingIsObject) {\n\t thingObject[thing] = value;\n\t }\n\t\n\t // Go through the things of items to set.\n\t for (thingItem in thingObject) {\n\t\n\t // Grab the value of the thing.\n\t thingValue = thingObject[thingItem];\n\t\n\t // First, if the item exists and there’s a value, set it.\n\t if (thingItem in P.component.item) {\n\t if (thingValue === undefined) thingValue = null;\n\t P.component.set(thingItem, thingValue, options);\n\t }\n\t\n\t // Then, check to update the element value and broadcast a change.\n\t if (thingItem == 'select' || thingItem == 'clear') {\n\t $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n\t }\n\t }\n\t\n\t // Render a new picker.\n\t P.render();\n\t }\n\t\n\t // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n\t return options.muted ? P : P.trigger('set', thingObject);\n\t }, //set\n\t\n\t\n\t /**\n\t * Get something\n\t */\n\t get: function get(thing, format) {\n\t\n\t // Make sure there’s something to get.\n\t thing = thing || 'value';\n\t\n\t // If a picker state exists, return that.\n\t if (STATE[thing] != null) {\n\t return STATE[thing];\n\t }\n\t\n\t // Return the submission value, if that.\n\t if (thing == 'valueSubmit') {\n\t if (P._hidden) {\n\t return P._hidden.value;\n\t }\n\t thing = 'value';\n\t }\n\t\n\t // Return the value, if that.\n\t if (thing == 'value') {\n\t return ELEMENT.value;\n\t }\n\t\n\t // Check if a component item exists, return that.\n\t if (thing in P.component.item) {\n\t if (typeof format == 'string') {\n\t var thingValue = P.component.get(thing);\n\t return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n\t }\n\t return P.component.get(thing);\n\t }\n\t }, //get\n\t\n\t\n\t /**\n\t * Bind events on the things.\n\t */\n\t on: function on(thing, method, internal) {\n\t\n\t var thingName,\n\t thingMethod,\n\t thingIsObject = $.isPlainObject(thing),\n\t thingObject = thingIsObject ? thing : {};\n\t\n\t if (thing) {\n\t\n\t // If the thing isn’t an object, make it one.\n\t if (!thingIsObject) {\n\t thingObject[thing] = method;\n\t }\n\t\n\t // Go through the things to bind to.\n\t for (thingName in thingObject) {\n\t\n\t // Grab the method of the thing.\n\t thingMethod = thingObject[thingName];\n\t\n\t // If it was an internal binding, prefix it.\n\t if (internal) {\n\t thingName = '_' + thingName;\n\t }\n\t\n\t // Make sure the thing methods collection exists.\n\t STATE.methods[thingName] = STATE.methods[thingName] || [];\n\t\n\t // Add the method to the relative method collection.\n\t STATE.methods[thingName].push(thingMethod);\n\t }\n\t }\n\t\n\t return P;\n\t }, //on\n\t\n\t\n\t /**\n\t * Unbind events on the things.\n\t */\n\t off: function off() {\n\t var i,\n\t thingName,\n\t names = arguments;\n\t for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n\t thingName = names[i];\n\t if (thingName in STATE.methods) {\n\t delete STATE.methods[thingName];\n\t }\n\t }\n\t return P;\n\t },\n\t\n\t /**\n\t * Fire off method events.\n\t */\n\t trigger: function trigger(name, data) {\n\t var _trigger = function _trigger(name) {\n\t var methodList = STATE.methods[name];\n\t if (methodList) {\n\t methodList.map(function (method) {\n\t PickerConstructor._.trigger(method, P, [data]);\n\t });\n\t }\n\t };\n\t _trigger('_' + name);\n\t _trigger(name);\n\t return P;\n\t } //trigger\n\t }; //PickerInstance.prototype\n\t\n\t\n\t /**\n\t * Wrap the picker holder components together.\n\t */\n\t function createWrappedComponent() {\n\t\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node('div',\n\t\n\t // Create a picker wrapper node\n\t PickerConstructor._.node('div',\n\t\n\t // Create a picker frame\n\t PickerConstructor._.node('div',\n\t\n\t // Create a picker box node\n\t PickerConstructor._.node('div',\n\t\n\t // Create the components nodes.\n\t P.component.nodes(STATE.open),\n\t\n\t // The picker box class\n\t CLASSES.box),\n\t\n\t // Picker wrap class\n\t CLASSES.wrap),\n\t\n\t // Picker frame class\n\t CLASSES.frame),\n\t\n\t // Picker holder class\n\t CLASSES.holder, 'tabindex=\"-1\"'); //endreturn\n\t } //createWrappedComponent\n\t\n\t\n\t /**\n\t * Prepare the input element with all bindings.\n\t */\n\t function prepareElement() {\n\t\n\t $ELEMENT.\n\t\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\t\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\t\n\t // If there’s a `data-value`, update the value of the element.\n\t val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\t\n\t // Only bind keydown events if the element isn’t editable.\n\t if (!SETTINGS.editable) {\n\t\n\t $ELEMENT.\n\t\n\t // On focus/click, open the picker.\n\t on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n\t event.preventDefault();\n\t P.open();\n\t }).\n\t\n\t // Handle keyboard event based on the picker being opened or not.\n\t on('keydown.' + STATE.id, handleKeydownEvent);\n\t }\n\t\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root'\n\t });\n\t }\n\t\n\t /**\n\t * Prepare the root picker element with all bindings.\n\t */\n\t function prepareElementRoot() {\n\t aria(P.$root[0], 'hidden', true);\n\t }\n\t\n\t /**\n\t * Prepare the holder picker element with all bindings.\n\t */\n\t function prepareElementHolder() {\n\t\n\t P.$holder.on({\n\t\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\n\t\n\t 'focus.toOpen': handleFocusToOpenEvent,\n\t\n\t blur: function blur() {\n\t // Remove the “target” class.\n\t $ELEMENT.removeClass(CLASSES.target);\n\t },\n\t\n\t // When something within the holder is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function focusin(event) {\n\t P.$root.removeClass(CLASSES.focused);\n\t event.stopPropagation();\n\t },\n\t\n\t // When something within the holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function mousedownClick(event) {\n\t\n\t var target = event.target;\n\t\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if (target != P.$holder[0]) {\n\t\n\t event.stopPropagation();\n\t\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\t\n\t event.preventDefault();\n\t\n\t // Re-focus onto the holder so that users can click away\n\t // from elements focused within the picker.\n\t P.$holder[0].focus();\n\t }\n\t }\n\t }\n\t\n\t }).\n\t\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\t\n\t var $target = $(this),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\t\n\t\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = getActiveElement();\n\t activeElement = activeElement && (activeElement.type || activeElement.href);\n\t\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n\t P.$holder[0].focus();\n\t }\n\t\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if (!targetDisabled && targetData.nav) {\n\t P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n\t }\n\t\n\t // If something is picked, set `select` then close with focus.\n\t else if (!targetDisabled && 'pick' in targetData) {\n\t P.set('select', targetData.pick);\n\t if (SETTINGS.closeOnSelect) {\n\t P.close(true);\n\t }\n\t }\n\t\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if (targetData.clear) {\n\t P.clear();\n\t if (SETTINGS.closeOnClear) {\n\t P.close(true);\n\t }\n\t } else if (targetData.close) {\n\t P.close(true);\n\t }\n\t }); //P.$holder\n\t }\n\t\n\t /**\n\t * Prepare the hidden input element along with all bindings.\n\t */\n\t function prepareElementHidden() {\n\t\n\t var name;\n\t\n\t if (SETTINGS.hiddenName === true) {\n\t name = ELEMENT.name;\n\t ELEMENT.name = '';\n\t } else {\n\t name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n\t name = name[0] + ELEMENT.name + name[1];\n\t }\n\t\n\t P._hidden = $('<input ' + 'type=hidden ' +\n\t\n\t // Create the name using the original input’s with a prefix and suffix.\n\t 'name=\"' + name + '\"' + (\n\t\n\t // If the element has a value, set the hidden value as well.\n\t $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\t\n\t $ELEMENT.\n\t\n\t // If the value changes, update the hidden input with the correct format.\n\t on('change.' + STATE.id, function () {\n\t P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n\t });\n\t }\n\t\n\t // Wait for transitions to end before focusing the holder. Otherwise, while\n\t // using the `container` option, the view jumps to the container.\n\t function focusPickerOnceOpened() {\n\t\n\t if (IS_DEFAULT_THEME && supportsTransitions) {\n\t P.$holder.find('.' + CLASSES.frame).one('transitionend', function () {\n\t P.$holder[0].focus();\n\t });\n\t } else {\n\t P.$holder[0].focus();\n\t }\n\t }\n\t\n\t function handleFocusToOpenEvent(event) {\n\t\n\t // Stop the event from propagating to the doc.\n\t event.stopPropagation();\n\t\n\t // Add the “target” class.\n\t $ELEMENT.addClass(CLASSES.target);\n\t\n\t // Add the “focused” class to the root.\n\t P.$root.addClass(CLASSES.focused);\n\t\n\t // And then finally open the picker.\n\t P.open();\n\t }\n\t\n\t // For iOS8.\n\t function handleKeydownEvent(event) {\n\t\n\t var keycode = event.keyCode,\n\t\n\t\n\t // Check if one of the delete keys was pressed.\n\t isKeycodeDelete = /^(8|46)$/.test(keycode);\n\t\n\t // For some reason IE clears the input value on “escape”.\n\t if (keycode == 27) {\n\t P.close(true);\n\t return false;\n\t }\n\t\n\t // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n\t if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\t\n\t // Prevent it from moving the page and bubbling to doc.\n\t event.preventDefault();\n\t event.stopPropagation();\n\t\n\t // If `delete` was pressed, clear the values and close the picker.\n\t // Otherwise open the picker.\n\t if (isKeycodeDelete) {\n\t P.clear().close();\n\t } else {\n\t P.open();\n\t }\n\t }\n\t }\n\t\n\t // Return a new picker instance.\n\t return new PickerInstance();\n\t }", "title": "" }, { "docid": "127d9554a4356a5191bbce0489b37d15", "score": "0.5459894", "text": "function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder,\n\n 'tabindex=\"-1\"'\n ) //endreturn\n }", "title": "" }, { "docid": "c1fc44556a58fe5d7773f9fde0a80d63", "score": "0.5449319", "text": "function PickerView() {}", "title": "" }, { "docid": "aa9e5cd1c05fe68aa4a50b96d6f43641", "score": "0.54024863", "text": "function createWrappedComponent() {\n\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node( 'div',\n\n\t // Create a picker wrapper node\n\t PickerConstructor._.node( 'div',\n\n\t // Create a picker frame\n\t PickerConstructor._.node( 'div',\n\n\t // Create a picker box node\n\t PickerConstructor._.node( 'div',\n\n\t // Create the components nodes.\n\t P.component.nodes( STATE.open ),\n\n\t // The picker box class\n\t CLASSES.box\n\t ),\n\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t }", "title": "" }, { "docid": "4e63ec36b89b9711dcd0f09091eb1237", "score": "0.53991956", "text": "function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n }", "title": "" }, { "docid": "4e63ec36b89b9711dcd0f09091eb1237", "score": "0.53991956", "text": "function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n }", "title": "" }, { "docid": "4e63ec36b89b9711dcd0f09091eb1237", "score": "0.53991956", "text": "function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n }", "title": "" }, { "docid": "7e58176f4e8e1b0d81e40a1903a10044", "score": "0.53535414", "text": "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "title": "" }, { "docid": "c2dab7d921c12aabfb1b78e7c71dcf9d", "score": "0.5302492", "text": "function createWrappedComponent() {\n\t\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node('div',\n\t\n\t // Create a picker wrapper node\n\t PickerConstructor._.node('div',\n\t\n\t // Create a picker frame\n\t PickerConstructor._.node('div',\n\t\n\t // Create a picker box node\n\t PickerConstructor._.node('div',\n\t\n\t // Create the components nodes.\n\t P.component.nodes(STATE.open),\n\t\n\t // The picker box class\n\t CLASSES.box),\n\t\n\t // Picker wrap class\n\t CLASSES.wrap),\n\t\n\t // Picker frame class\n\t CLASSES.frame),\n\t\n\t // Picker holder class\n\t CLASSES.holder, 'tabindex=\"-1\"'); //endreturn\n\t }", "title": "" }, { "docid": "c21def96e67a868aeca7a60cdc94812d", "score": "0.52608347", "text": "createPickerPalettes() {\n\t\tlet $paletteWrapper = $( '<div class=\"secondary-colors\"></div>' );\n\n\t\tfor ( let i = 0; i < this.options.secondaryPalette.length; i++ ) {\n\t\t\t$paletteWrapper.append( '<a class=\"iris-palette\" tabindex=\"0\"></a>' );\n\t\t}\n\n\t\t$paletteWrapper.prependTo( this.$element.find( '.iris-picker-inner' ) );\n\n\t\t// Repaint Picker.\n\t\tthis.$input.iris( 'option', 'width', this.options.width );\n\t}", "title": "" }, { "docid": "7cb3a0d82dd50f3cea83ce581e25d020", "score": "0.5236969", "text": "_getPickerTemplate() {\n\t\tconst pickerTemplate = `\n<div class=\"selector\" data-fip-origin=\"${this.element.attr( 'id' )}\">\n\t<span class=\"selected-icon\">\n\t\t<i class=\"fip-icon-block\"></i>\n\t</span>\n\t<span class=\"selector-button\">\n\t\t<i class=\"fip-icon-down-dir\"></i>\n\t</span>\n</div>\n<div class=\"selector-popup-wrap\" data-fip-origin=\"${this.element.attr( 'id' )}\">\n\t<div class=\"selector-popup\" style=\"display: none;\"> ${ ( this.settings.hasSearch ) ?\n\t\t`<div class=\"selector-search\">\n\t\t\t<input type=\"text\" name=\"\" value=\"\" placeholder=\"${ this.settings.searchPlaceholder }\" class=\"icons-search-input\"/>\n\t\t\t<i class=\"fip-icon-search\"></i>\n\t\t</div>` : '' }\n\t\t<div class=\"selector-category\">\n\t\t\t<select name=\"\" class=\"icon-category-select\" style=\"display: none\"></select>\n\t\t</div>\n\t\t<div class=\"fip-icons-container\"></div>\n\t\t<div class=\"selector-footer\" style=\"display:none;\">\n\t\t\t<span class=\"selector-pages\">1/2</span>\n\t\t\t<span class=\"selector-arrows\">\n\t\t\t\t<span class=\"selector-arrow-left\" style=\"display:none;\">\n\t\t\t\t\t<i class=\"fip-icon-left-dir\"></i>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"selector-arrow-right\">\n\t\t\t\t\t<i class=\"fip-icon-right-dir\"></i>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</div>\n\t</div>\n</div>`;\n\t\treturn pickerTemplate;\n\t}", "title": "" }, { "docid": "7e022513103d5588bc1b57d24d5becda", "score": "0.5226821", "text": "_bindElements() {\n var self = this;\n this.populateInitial();\n\t\tvar dgDom = this.dgDom;\n // Create promise to release the keyboard when dialog is closed\n this.closeDialogPromise = new Promise((resolve) => {\n $(dgDom.element).find('.cancel-button').remove();\n $(dgDom.element).find('.ok-button').off('click').on('click', function (ev) {\n self._backup();\n self.handleFuture();\n self.complete();\n resolve();\n });\n $(dgDom.element).find('.remove-button').off('click').on('click', function (ev) {\n self._backup();\n self.handleRemove();\n self.complete();\n resolve();\n });\n });\n this.completeNotifier.unbindKeyboardForModal(this);\n }", "title": "" }, { "docid": "ca2f025e48774a63b531f4e4d544a8f2", "score": "0.5191125", "text": "setup() {\n\t const self = this;\n\t const settings = self.settings;\n\t const control_input = self.control_input;\n\t const dropdown = self.dropdown;\n\t const dropdown_content = self.dropdown_content;\n\t const wrapper = self.wrapper;\n\t const control = self.control;\n\t const input = self.input;\n\t const focus_node = self.focus_node;\n\t const passive_event = {\n\t passive: true\n\t };\n\t const listboxId = self.inputId + '-ts-dropdown';\n\t setAttr(dropdown_content, {\n\t id: listboxId\n\t });\n\t setAttr(focus_node, {\n\t role: 'combobox',\n\t 'aria-haspopup': 'listbox',\n\t 'aria-expanded': 'false',\n\t 'aria-controls': listboxId\n\t });\n\t const control_id = getId(focus_node, self.inputId + '-ts-control');\n\t const query = \"label[for='\" + escapeQuery(self.inputId) + \"']\";\n\t const label = document.querySelector(query);\n\t const label_click = self.focus.bind(self);\n\n\t if (label) {\n\t addEvent(label, 'click', label_click);\n\t setAttr(label, {\n\t for: control_id\n\t });\n\t const label_id = getId(label, self.inputId + '-ts-label');\n\t setAttr(focus_node, {\n\t 'aria-labelledby': label_id\n\t });\n\t setAttr(dropdown_content, {\n\t 'aria-labelledby': label_id\n\t });\n\t }\n\n\t wrapper.style.width = input.style.width;\n\n\t if (self.plugins.names.length) {\n\t const classes_plugins = 'plugin-' + self.plugins.names.join(' plugin-');\n\t addClasses([wrapper, dropdown], classes_plugins);\n\t }\n\n\t if ((settings.maxItems === null || settings.maxItems > 1) && self.is_select_tag) {\n\t setAttr(input, {\n\t multiple: 'multiple'\n\t });\n\t }\n\n\t if (settings.placeholder) {\n\t setAttr(control_input, {\n\t placeholder: settings.placeholder\n\t });\n\t } // if splitOn was not passed in, construct it from the delimiter to allow pasting universally\n\n\n\t if (!settings.splitOn && settings.delimiter) {\n\t settings.splitOn = new RegExp('\\\\s*' + escape_regex(settings.delimiter) + '+\\\\s*');\n\t } // debounce user defined load() if loadThrottle > 0\n\t // after initializePlugins() so plugins can create/modify user defined loaders\n\n\n\t if (settings.load && settings.loadThrottle) {\n\t settings.load = loadDebounce(settings.load, settings.loadThrottle);\n\t }\n\n\t self.control_input.type = input.type;\n\t addEvent(dropdown, 'mousemove', () => {\n\t self.ignoreHover = false;\n\t });\n\t addEvent(dropdown, 'mouseenter', e => {\n\t var target_match = parentMatch(e.target, '[data-selectable]', dropdown);\n\t if (target_match) self.onOptionHover(e, target_match);\n\t }, {\n\t capture: true\n\t }); // clicking on an option should select it\n\n\t addEvent(dropdown, 'click', evt => {\n\t const option = parentMatch(evt.target, '[data-selectable]');\n\n\t if (option) {\n\t self.onOptionSelect(evt, option);\n\t preventDefault(evt, true);\n\t }\n\t });\n\t addEvent(control, 'click', evt => {\n\t var target_match = parentMatch(evt.target, '[data-ts-item]', control);\n\n\t if (target_match && self.onItemSelect(evt, target_match)) {\n\t preventDefault(evt, true);\n\t return;\n\t } // retain focus (see control_input mousedown)\n\n\n\t if (control_input.value != '') {\n\t return;\n\t }\n\n\t self.onClick();\n\t preventDefault(evt, true);\n\t }); // keydown on focus_node for arrow_down/arrow_up\n\n\t addEvent(focus_node, 'keydown', e => self.onKeyDown(e)); // keypress and input/keyup\n\n\t addEvent(control_input, 'keypress', e => self.onKeyPress(e));\n\t addEvent(control_input, 'input', e => self.onInput(e));\n\t addEvent(focus_node, 'blur', e => self.onBlur(e));\n\t addEvent(focus_node, 'focus', e => self.onFocus(e));\n\t addEvent(control_input, 'paste', e => self.onPaste(e));\n\n\t const doc_mousedown = evt => {\n\t // blur if target is outside of this instance\n\t // dropdown is not always inside wrapper\n\t const target = evt.composedPath()[0];\n\n\t if (!wrapper.contains(target) && !dropdown.contains(target)) {\n\t if (self.isFocused) {\n\t self.blur();\n\t }\n\n\t self.inputState();\n\t return;\n\t } // retain focus by preventing native handling. if the\n\t // event target is the input it should not be modified.\n\t // otherwise, text selection within the input won't work.\n\t // Fixes bug #212 which is no covered by tests\n\n\n\t if (target == control_input && self.isOpen) {\n\t evt.stopPropagation(); // clicking anywhere in the control should not blur the control_input (which would close the dropdown)\n\t } else {\n\t preventDefault(evt, true);\n\t }\n\t };\n\n\t const win_scroll = () => {\n\t if (self.isOpen) {\n\t self.positionDropdown();\n\t }\n\t };\n\n\t addEvent(document, 'mousedown', doc_mousedown);\n\t addEvent(window, 'scroll', win_scroll, passive_event);\n\t addEvent(window, 'resize', win_scroll, passive_event);\n\n\t this._destroy = () => {\n\t document.removeEventListener('mousedown', doc_mousedown);\n\t window.removeEventListener('scroll', win_scroll);\n\t window.removeEventListener('resize', win_scroll);\n\t if (label) label.removeEventListener('click', label_click);\n\t }; // store original html and tab index so that they can be\n\t // restored when the destroy() method is called.\n\n\n\t this.revertSettings = {\n\t innerHTML: input.innerHTML,\n\t tabIndex: input.tabIndex\n\t };\n\t input.tabIndex = -1;\n\t input.insertAdjacentElement('afterend', self.wrapper);\n\t self.sync(false);\n\t settings.items = [];\n\t delete settings.optgroups;\n\t delete settings.options;\n\t addEvent(input, 'invalid', () => {\n\t if (self.isValid) {\n\t self.isValid = false;\n\t self.isInvalid = true;\n\t self.refreshState();\n\t }\n\t });\n\t self.updateOriginalInput();\n\t self.refreshItems();\n\t self.close(false);\n\t self.inputState();\n\t self.isSetup = true;\n\n\t if (input.disabled) {\n\t self.disable();\n\t } else {\n\t self.enable(); //sets tabIndex\n\t }\n\n\t self.on('change', this.onChange);\n\t addClasses(input, 'tomselected', 'ts-hidden-accessible');\n\t self.trigger('initialize'); // preload options\n\n\t if (settings.preload === true) {\n\t self.preload();\n\t }\n\t }", "title": "" }, { "docid": "24eb48c3cd3138c24db8165ddbdffec5", "score": "0.5177285", "text": "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "title": "" }, { "docid": "e9af459545b63c5fd2e11be78597dc5b", "score": "0.51739717", "text": "preRender() {\n this.keyConfigure = {\n enter: 'enter',\n escape: 'escape',\n end: 'end',\n tab: 'tab',\n home: 'home',\n down: 'downarrow',\n up: 'uparrow',\n left: 'leftarrow',\n right: 'rightarrow',\n open: 'alt+downarrow',\n close: 'alt+uparrow'\n };\n this.cloneElement = this.element.cloneNode(true);\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"removeClass\"])([this.cloneElement], [ROOT$3, CONTROL$2, LIBRARY$2]);\n this.inputElement = this.element;\n this.angularTag = null;\n this.formElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"closest\"])(this.element, 'form');\n this.isBlazorServer = (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isBlazor\"])() && this.isServerRendered && this.getModuleName() === 'timepicker') ? true : false;\n if (!this.isBlazorServer) {\n if (this.element.tagName === 'EJS-TIMEPICKER') {\n this.angularTag = this.element.tagName;\n this.inputElement = this.createElement('input');\n this.element.appendChild(this.inputElement);\n }\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n this.element.removeAttribute('tabindex');\n this.openPopupEventArgs = {\n appendTo: document.body\n };\n }\n }", "title": "" }, { "docid": "e7ed799d3c335a15b5c11dd231c2dd75", "score": "0.5165412", "text": "setupRootElement() {\n this.rootElement = document.createElement(\"div\");\n this.rootElement.style.width = \"100%\";\n this.rootElement.style.height = \"100%\";\n this.rootElement.style.position = \"relative\";\n }", "title": "" }, { "docid": "6ec654b51cbc1209a355ee3be4584cf7", "score": "0.51575947", "text": "function setPickerFor(el) {\n\t\"use strict\";\n\t// identify picker (select parent), select, options collection and current selected index (a number);\n\t// create a list and 2 arrows and a style block\n\t// NB - in our struts config, is \"picker\" is assigned to the select (while the parent receives 'ui-select' class)?\n\tvar picker = el.tagName.toLowerCase() === 'select' ? el.parentNode : el,\n\t\tselect = picker.querySelector('select'),\n\t\topts = select.querySelectorAll('option'),\n\t\tcurrNum = select.selectedIndex, // 0; select.options[select.selectedIndex]\n\t\tul = document.createElement('ul'),\n\t\tarr1 = document.createElement('span'),\n\t\tarr2 = document.createElement('span'),\n\t\tstyleEl = document.createElement('style');\n\n\t// replace .ui-select class with .JS (styles set to .picker.JS)\n\tpicker.classList.remove('ui-select');\n\tpicker.classList.add('JS');\n\n\t// hide select, then append new scrollable list and arrows to picker, to replace it\n\tselect.classList.add('ui-access');\n\tpicker.appendChild(ul);\n\tpicker.appendChild(arr1);\n\tpicker.appendChild(arr2);\n\t// insert arrow characters\n\tarr1.textContent = '\\u003C';\n\tarr2.textContent = '\\u003E';\n\t// loop through the options and write their text to a list item; append that item to the new list\n\tforEach(opts, function (el, i) {\n\t\tvar li = document.createElement('li');\n\t\tli.textContent = el.textContent;\n\t\tul.className = 'l-n a-c';\n\t\tul.appendChild(li);\n\t});\n\n\t// mark the style block as specific to the select, then append it to the document\n\t// this style block will contain a rule for the currently displayed item within the scrollable list\n\tstyleEl.id = 'for_' + select.id;\n\tdocument.body.appendChild(styleEl);\n\n\t// write a series of CSS declarations with same property and value, but incorporating browser-specific prefix:\n\tfunction declareWithPrefixes(property,value) {\n\t\tvar prefixes = ['webkit','o','ms'],\n\t\t\tcssTxt = '';\n\t\tprefixes.forEach(function(item) {\n\t\t\tcssTxt += '-' + item + '-' + property + ':' + value + '; ';\n\t\t});\n\t\treturn cssTxt + property + ':' + value;\n\t}\n\n\t// update the selected index & ensure the correct list item is displayed in the scrollable list\n\tfunction setAndShowSelected(num) {\n\t\tselect.selectedIndex = num;\n\t\tpicker.setAttribute('data-selected', num);\n\t\t// write a rule for the list corresponding to selectedIndex; note - this will replace the current rule in new style sheet\n\t\tvar yVal = num === 0 ? '0' : '-' + (num * 1.5) + 'em';\n\t\tstyleEl.textContent = '.picker.JS[data-selected=\"' + num + '\"] > ul {' + declareWithPrefixes('transform','translateY(' + yVal + ')') + '}';\n\t}\n\n\t// on clicking 1st arrow, shift list down by a multiple of 1.5em; that multiple will be currNum - 1\n\tarr1.addEventListener('click', function () {\n\t\tif (currNum > 0) {\n\t\t\tcurrNum = currNum - 1;\n\t\t\tsetAndShowSelected(currNum);\n\t\t}\n\t});\n\t// on clicking 2nd arrow, shift list up by a multiple of 1.5em; that multiple will be currNum + 1\n\tarr2.addEventListener('click', function () {\n\t\tif (currNum < (opts.length - 1)) {\n\t\t\tcurrNum += 1;\n\t\t\tsetAndShowSelected(currNum);\n\t\t}\n\t});\n\n\t// ensure the correct list item is displayed in the scrollable list, on DOM ready\n\tsetAndShowSelected(currNum);\n}", "title": "" }, { "docid": "b19cdd7fc71a184da1ba178d8adac9c9", "score": "0.51311976", "text": "init() {\n // input options\n this.selectedItems = [];\n this.addtionalClasses = this.prop('class', '');\n this.label = this.prop('label');\n this.name = this.prop('name', '');\n this.isRequired = !Is.null(this.inputs.getAttr('required')) || this.inputs.getProp('required');\n let value = this.inputs.getProp('value');\n this.placeholder = this.prop('placeholder');\n\n this.heading = this.prop('heading');\n\n this.onSelectEvent = this.inputs.getEvent('select');\n this.limit = this.inputs.getProp('limit', Config.get('form.dropdown.limit', 0));\n this.theme = this.prop('theme', Config.get('form.dropdown.theme', this.defaultTheme));\n\n this.imageable = this.inputs.getProp('imageable', false);\n this.except = this.inputs.getProp('except');\n\n this.icon = this.prop('icon');\n\n this.position = this.prop('position', 'bottom'); // dropdown list position\n\n if (this.multiple) {\n this.currentValue = Is.array(value) ? value.map(item => {\n return String(Is.object(item) ? item.id || item.value : item);\n }) : [];\n } else {\n this.currentValue = value ? String(value) : null;\n }\n\n this.getItemsList();\n\n if (!this.availableThemes.includes(this.theme)) {\n throw new Error(`flk-dropdownlist: Invalid theme '${this.theme}', available themes are: ${this.availableThemes.join(', ')}. `);\n }\n\n let closeOnSelect = this.prop('closeOnSelect');\n\n this.closeOnSelect = Is.boolean(closeOnSelect) ? closeOnSelect : this.multiple === false;\n }", "title": "" }, { "docid": "2725b16ca0529cb33e4e7fd1fdf6da59", "score": "0.5108306", "text": "createdCallback() {\n this.createShadowRoot().innerHTML = this.template;\n\n //Grab the elements from the shadow root\n this.$label = this.shadowRoot.querySelector('label');\n this.$radioInput = this.shadowRoot.querySelector('input[type=\"radio\"]');\n\n //Set radio value and label's text\n this.value = this.getAttribute('data-value');\n this.labelText = this.getAttribute('data-label-text');\n }", "title": "" }, { "docid": "d899f145181ea6e9fa4d2a16a6a7793d", "score": "0.50880593", "text": "_bind() {\n this._domNode = document.querySelector(this.el);\n this.element = this._domNode;\n this._bindData();\n }", "title": "" }, { "docid": "7bf4249f364bc5147d925b28209d8630", "score": "0.5036084", "text": "bind() {\n let cp = this.colorpicker;\n\n if (cp.options.inline) {\n cp.picker.addClass('colorpicker-inline colorpicker-visible');\n return; // no need to bind show/hide events for inline elements\n }\n\n cp.picker.addClass('colorpicker-popup colorpicker-hidden');\n\n // there is no input or addon\n if (!this.hasInput && !this.hasAddon) {\n return;\n }\n\n // create Bootstrap 4 popover\n if (cp.options.popover) {\n this.createPopover();\n }\n\n // bind addon show/hide events\n if (this.hasAddon) {\n // enable focus on addons\n if (!this.addon.attr('tabindex')) {\n this.addon.attr('tabindex', 0);\n }\n\n this.addon.on({\n 'mousedown.colorpicker touchstart.colorpicker': $.proxy(this.toggle, this)\n });\n\n this.addon.on({\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n\n this.addon.on({\n 'focusout.colorpicker': $.proxy(this.hide, this)\n });\n }\n\n // bind input show/hide events\n if (this.hasInput && !this.hasAddon) {\n this.input.on({\n 'mousedown.colorpicker touchstart.colorpicker': $.proxy(this.show, this),\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n\n this.input.on({\n 'focusout.colorpicker': $.proxy(this.hide, this)\n });\n }\n\n // reposition popup on window resize\n $(this.root).on('resize.colorpicker', $.proxy(this.reposition, this));\n }", "title": "" }, { "docid": "51a9da32ec9cc11eed6814b3bef3beaf", "score": "0.5032346", "text": "function hp_initFormWithPicker ($partialForm) {\n var $clone = $partialForm.clone();\n // Find all bootstrap select picker <select> & reinit select picker plugin\n $.each($clone.find(btPickerWrap), function (idx, picker) {\n var $picker = $(picker),\n $select = $picker.find('select');\n \n $picker.replaceWith($select);\n $select.selectpicker();\n hp_initPickerFilterFmInput($select);\n });\n\n return $clone;\n }", "title": "" }, { "docid": "34c20513b150e96f9eaf90bd692bd420", "score": "0.5018414", "text": "_initBinder() {\n this.binder = new UniversalFieldNodeBinder(this);\n this.binder.targetValueField = 'checked';\n this.applyBindingSet();\n }", "title": "" }, { "docid": "567d4e7b494677dbde168cd44d5c3fb0", "score": "0.4963255", "text": "init() {\n this._createShadowRoot()\n this._attachStyles()\n this._createElements()\n }", "title": "" }, { "docid": "d71c7bc4098ae3effe0ad2277fd7a574", "score": "0.49561262", "text": "_init(){\n this._super();\n\n // retrieves the current infos and applies the right styles\n this.updateControls();\n\n // Initial value setup\n this.checkValue();\n\n // Visually hides the original select so it's still usable even if it's invisible\n this._visuallyHide(this.element);\n $(this.element).before(this.triggerElement);\n\n // Widget initialization\n dropdown($.extend(this.options, {\n 'appendTo': this.container,\n 'triggerTarget': this.triggerElement[0],\n 'title': this._generateModalTitle()\n }), this.dialogElement[0]);\n this.init = true;\n }", "title": "" }, { "docid": "eee8b12bbc147ce7e22c9244726cfc98", "score": "0.49381584", "text": "function initizalizeSettings(root) {\n // UTILITY FUNCTIONS\n var getValue = function (node) { // To determine which property of a DOM node gives its relevant value\n return (node.type === 'checkbox' || node.type === 'radio') ? node.checked : node.value\n }\n\n var wordify = function (phrase) { // This is for defining valid IDs\n return phrase.split(' ').join('-').toLowerCase()\n }\n\n var inputType = function (datatype) { // So we know what to render for a given input type\n switch (datatype) {\n case \"boolean\":\n return \"checkbox\"\n case \"number\":\n return \"number\"\n default:\n return \"text\"\n }\n }\n\n // Bind to settings from DATA\n var settings = root.selectAll('.settings--control').data(DATA.settings)\n\n // Each setting is contained in a controls group\n var settings_controls = settings.enter()\n .append('div').classed('settings--control', true)\n\n // Add the appropriate input type for each setting\n settings_controls.append('input')\n .attr('type', function (d) { return inputType(d.type) })\n .attr('id', function (d) { return wordify(d.name) })\n .attr('checked', function (d) { return d.default })\n\n // Add labels for each settings\n settings_controls.append('label')\n .text(function (d) { return d.name })\n .attr('for', function (d) { return wordify(d.name) })\n\n // A method to get settings - needed for later when they're accessed\n var getSingleSetting = function (name) {\n for (var i = 0; i < this.length; i++) {\n if (this[i].name === name) {\n return this[i]\n }\n }\n return null;\n }\n // Returns a settings object, based on the current state of the UI\n var getSettings = function () {\n var settings = [];\n settings_controls.selectAll('input').each(function (d) { settings.push({ name: d.name, value: getValue(this) }) })\n settings.get = getSingleSetting\n return settings;\n }\n\n // This looks complex, but in reality, it's quite simple.\n // 1. Make an array, which will hold functions\n // 2. The subscriber function, when called, will add a function to this array\n // 3. Whenever the settings change, call every function in the array with the new settings\n var subscribers = [];\n var subscribe = function (callback) {\n subscribers.push(callback);\n }\n settings_controls.on('change.notifySubscribers', function () {\n for (var i = 0; i < subscribers.length; i++) {\n subscribers[i].call(this, getSettings())\n }\n })\n\n return { subscribe: subscribe, default: getSettings() };\n}", "title": "" }, { "docid": "63d05c2c4e0464ee805148572564a7c9", "score": "0.49286133", "text": "function onPickerApiLoad() {\n if(!pickerApiLoaded){\n setPicker(true)\n }\n }", "title": "" }, { "docid": "65f812704c12794a5c1e791cc2349258", "score": "0.49280018", "text": "function createElements() {\r\n _dom = {};\r\n createElementsForSelf();\r\n if (_opts.placement.popup) {\r\n createElementsForPopup();\r\n }\r\n createElementsForColorWheel();\r\n createElementsForNumbersMode();\r\n createElementsForSamples();\r\n createElementsForControls();\r\n }", "title": "" }, { "docid": "96276d479f7a9b29994e704f381d1c47", "score": "0.49246144", "text": "prepare(){\n this.$el = $(this.selector);\n this.$el.empty();\n\n if(!this.$el.length){\n throw new Error(`Element specified by selector \"${this.selector}\" not found in DOM`);\n }\n\n this.$el.html(this.template);\n\n return this;\n }", "title": "" }, { "docid": "064d0b39029b45f199f9ed75e68f024d", "score": "0.4914958", "text": "withRootElement(rootElement) {\n const element = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__[\"coerceElement\"])(rootElement);\n if (element !== this._rootElement) {\n if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n });\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n this._ownerSVGElement = this._rootElement.ownerSVGElement;\n }\n return this;\n }", "title": "" }, { "docid": "8107024802bb8d677f99f5dee4c7b84d", "score": "0.48961523", "text": "function pgdoc_cmbstipo_documento_codigo__init(){\n $(\"#pgdoc_cmbstipo_documento_codigo\").html('');\n \n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_tipo_documento_select\", function(data, status){\n $(\"#pgdoc_cmbstipo_documento_codigo\").html(data);\n $(\"#pgdoc_cmbstipo_documento_codigo\").selectpicker('refresh');\n });\n}", "title": "" }, { "docid": "7a295557555c7e3fd7beab84018973cf", "score": "0.48779556", "text": "function pgvar_cmbsruta_servicio_destino_codigo__init(){\n $(\"#pgvar_cmbsruta_servicio_destino_codigo\").html('');\n $(\"#pgvar_cmbsruta_servicio_destino_codigo\").selectpicker('refresh');\n}", "title": "" }, { "docid": "a6651b95fd9f1b9a1d7a6100efb33ad5", "score": "0.48734465", "text": "changePicker(picker, oldPicker) {\n const\n me = this,\n pickerWidth = me.pickerWidth || picker?.width;\n\n picker = Combo.reconfigure(oldPicker, picker ? Objects.merge({\n owner : me,\n store : me.store,\n selected : me.valueCollection,\n multiSelect : me.multiSelect,\n cls : me.listCls,\n itemTpl : me.listItemTpl || (item => item[me.displayField]),\n forElement : me[me.pickerAlignElement],\n align : {\n matchSize : pickerWidth == null,\n anchor : me.overlayAnchor,\n target : me[me.pickerAlignElement]\n },\n width : pickerWidth,\n navigator : {\n keyEventTarget : me.input\n }\n }, picker) : null, me);\n\n picker && (picker.element.dataset.emptyText = me.emptyText || me.L('L{noResults}'));\n\n return picker;\n }", "title": "" }, { "docid": "6deb795f5c88e9e08cf9fe98e4a38032", "score": "0.48713046", "text": "function initRoot() {\n // add container\n if (!weavy.getRoot()) {\n // append container to target element || html\n var rootParent = WeavyUtils.asElement(weavy.options.container) || document.documentElement;\n\n var root = weavy.createRoot.call(weavy, rootParent);\n weavy.nodes.container = root.root;\n weavy.nodes.overlay = root.container;\n\n weavy.nodes.overlay.classList.add(\"weavy-overlay\");\n }\n }", "title": "" }, { "docid": "4019414606798575d422b8003f65aa59", "score": "0.4862552", "text": "init() {\n // Parent element is defined\n if (this.parent_element !== null) {\n\n // Create the selector_element using a div\n this.selector_element = document.createElement('div');\n\n // Set the name of the selector_element using a data attribute\n this.selector_element.setAttribute('data-name', this.selector_element_name);\n\n // Set the CSS class of the selector_element\n this.selector_element.className = this.selector_element_class;\n\n // Set the width of the selector_element\n this.selector_element.style.width = this.selector_element_width + 'px';\n\n // Set the height of the selector_element\n this.selector_element.style.height = this.selector_element_height + 'px';\n\n // Set the initial visibility of the selector_element\n this.setVisible();\n\n // Add the selecotr_element to the parent_element\n this.parent_element.appendChild(this.selector_element);\n }\n\n }", "title": "" }, { "docid": "0dc77b630373fb0bb88c5930439f19e3", "score": "0.48620412", "text": "function openPicker() {\n\t\t\t\t\telm.append('<div class=\"datepicker\"></div>');\n\t\t\t\t\tdpCtrl = elm.find('.datepicker');\n\t\t\t\t\tdpCtrl.datepicker( buildOptions() );\n\t\t\t\t\tdpCtrl.datepicker('option', $.datepicker.regional);\n\t\t\t\t}", "title": "" }, { "docid": "b6188d13d28d2934f87cce5b87612ae4", "score": "0.48614627", "text": "function initializeColorPicker() {\n if (global.params.selectedColor === undefined) {\n global.params.selectedColor = DefaultColor;\n }\n const colorPicker = new ColorPicker(new Color(global.params.selectedColor));\n main.append(colorPicker);\n const width = colorPicker.offsetWidth;\n const height = colorPicker.offsetHeight;\n resizeWindow(width, height);\n}", "title": "" }, { "docid": "7c18c497d91136e2cf12eabd880b604c", "score": "0.48600477", "text": "function init(){\n buildComponent();\n attachHandlers();\n }", "title": "" }, { "docid": "f58ee6cd2ea4a172770a800de1da0b84", "score": "0.48567227", "text": "function initControls() {\n /* COLOR PICKER */\n $(colorPicker).colpick({\n color: iconBackground,\n layout: 'hex',\n submit: 0,\n colorScheme: 'dark',\n onChange: function (hsb, hex, rgb, el, bySetColor) {\n $(el).css('border-color', '#' + hex);\n iconBackground = '#' + hex;\n updateCurrentBackground();\n\n // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.\n if (!bySetColor) $(el).val(hex);\n }\n }).keyup(function () {\n $(this).colpickSetColor(this.value);\n });\n /* END COLOR PICKER */\n\n /* INIT OPACITY SLIDER */\n $(opacityPicker).rangeslider({\n polyfill: false,\n\n // Callback function\n onSlide: function (position, value) {\n updateCurrentShadow();\n }\n });\n /* END INIT SLIDER */\n\n /* INIT LENGTH SLIDER */\n $(lengthPicker).rangeslider({\n polyfill: false,\n\n // Callback function\n onSlide: function (position, value) {\n updateCurrentShadow();\n }\n });\n /* END INIT SLIDER */\n\n /* INIT ANGLE SLIDER */\n $(anglePicker).rangeslider({\n polyfill: false,\n\n // Callback function\n onSlide: function (position, value) {\n updateCurrentShadow();\n }\n });\n /* END INIT SLIDER */\n\n /* INIT PADDING SLIDER */\n $(paddingPicker).rangeslider({\n polyfill: false,\n\n // Callback function\n onSlide: function (position, value) {\n updateCurrentPadding()\n }\n });\n /* END INIT SLIDER */\n\n /* INIT SHAPE PICKER */\n shapePicker.onchange = function () {\n updateCurrentBackground();\n };\n /* END INIT SWITCH */\n}", "title": "" }, { "docid": "0cd92eb83c5c563aa1f1b3aaba4e0725", "score": "0.4855442", "text": "reset() {\n const child = this.getRequiredChildElement(this.centerSlot);\n if (child.reset instanceof Function) {\n child.reset();\n }\n else {\n if ('value' in child) {\n child.value = child.defaultValue;\n }\n if ('checked' in child) {\n child.checked = child.defaultChecked;\n }\n }\n this.changeHandler();\n }", "title": "" }, { "docid": "64f4d455dd9028169863c6bf80539782", "score": "0.48540077", "text": "buildElements() {\n\t\t// build ui selects\n\t\tif (this.config.buildUiSelects) {\n\t\t\tthis.selects = new SelectBuilder(this.config.selects, this.selector, this.creator, this.check, this.utils);\n\t\t\tthis.selects.build();\n\t\t}\n\t\t// build ui inputs radio and/or checkbox\n\t\tif (this.config.buildUiCheckboxesRadios) {\n\t\t\tthis.checkboxesRadios = new CheckboxRadioBuilder(this.config.checkboxesRadios, this.selector, this.creator, this.check, this.utils);\n\t\t\tthis.checkboxesRadios.build();\n\t\t}\n\t\t// build ui inputs file\n\t\tif (this.config.buildUiInputsFile) {\n\t\t\tthis.inputsFile = new InputFileBuilder(this.config.inputsFile, this.selector, this.creator, this.check, this.utils);\n\t\t\tthis.inputsFile.build();\n\t\t}\n\t}", "title": "" }, { "docid": "35ab590f83b0c21e0ce24f75bb8927f1", "score": "0.48479432", "text": "ready() {\n if (this._template) {\n this.root = this._stampTemplate(this._template);\n this.$ = this.root.$;\n }\n super.ready();\n }", "title": "" }, { "docid": "92eeed96c604eeb707a58ed8b7fc4c5e", "score": "0.48328286", "text": "reset (root) {\n const $root = $(root);\n const $select2 = $root.find('.js-select2');\n const $tempFormWrapper = $root\n .wrap('<form></form>').closest('form');\n\n $tempFormWrapper.trigger('reset');\n $root.unwrap($tempFormWrapper);\n\n // Trigger a change for select2 enabled inputs\n if ($select2.length) {\n $select2.each((index, element) => {\n $(element).change();\n });\n }\n }", "title": "" }, { "docid": "cbb02b63792aab61232dfe787a1954f3", "score": "0.48308384", "text": "function init() {\n formElement = $('#cq-commerce-products-bindproducttree-form');\n catalogIdentifierCoralSelectComponent = $('#cq-commerce-products-bindproducttree-catalog-select').get(0);\n catalogIdentifierDataCoralSelectComponent = $('#cq-commerce-products-bindproducttree-catalog-select-data').get(0);\n commerceProviderCoralSelectComponent = $('#cq-commerce-products-bindproducttree-provider-select').get(0);\n nameCoralTextfieldComponent = $('#cq-commerce-products-bindproducttree-name').get(0);\n redirectLocation = $('#cq-commerce-products-bindproducttree-form')\n .find('[data-foundation-wizard-control-action=cancel]')\n .attr('href');\n }", "title": "" }, { "docid": "0da4b433914cc451e08f0d4be65ff70f", "score": "0.48307922", "text": "build() {\n this.isEditor = this.settings.placeIn === 'editor';\n const colorpicker = this.element;\n const initialValue = this.isEditor ? this.element.attr('data-value') : this.element.val();\n const classList = `swatch${(!initialValue || $.trim(initialValue) === '') ? ' is-empty' : ''}`;\n\n if (!this.isEditor) {\n // Add Button\n if (this.isInlineLabel) {\n this.inlineLabel.addClass('colorpicker-container');\n } else {\n this.container = $('<span class=\"colorpicker-container\"></span>');\n colorpicker.wrap(this.container);\n }\n\n this.container = colorpicker.parent();\n this.swatch = $(`<span class=\"${classList}\"></span>`).prependTo(this.container);\n\n // Add Masking to show the #.\n // Remove the mask if using the \"showLabel\" setting\n if (!this.settings.showLabel) {\n const pattern = ['#', /[0-9a-fA-F]/, /[0-9a-fA-F]/, /[0-9a-fA-F]/, /[0-9a-fA-F]/, /[0-9a-fA-F]/, /[0-9a-fA-F]/];\n\n colorpicker.mask({ pattern });\n } else {\n const maskAPI = colorpicker.data('mask');\n if (maskAPI && typeof maskAPI.destroy === 'function') {\n maskAPI.destroy();\n }\n }\n }\n\n let trigger = this.element.children('.trigger');\n if (this.container && this.container.length) {\n trigger = this.container.children('.trigger');\n }\n\n if (!trigger || !trigger.length || !trigger.children('.icon').length) {\n this.icon = $.createIconElement('dropdown')\n .appendTo(this.isEditor ? this.element : this.container);\n this.icon.wrap('<span class=\"trigger\"></span>');\n }\n\n // Handle initial values\n if (initialValue) {\n this.setColor(initialValue);\n }\n\n if (this.element.is(':disabled') || this.settings.disabled) {\n this.disable();\n }\n\n if (this.element.is(':disabled') && this.container) {\n this.container.closest('.field').addClass('is-disabled');\n }\n\n if (this.element.prop('readonly')) {\n this.readonly();\n }\n\n if (!this.settings.editable && !this.settings.disabled) {\n this.readonly();\n }\n\n if (this.settings.colorOnly) {\n this.element.parent().addClass('color-only');\n }\n\n this.element.attr('autocomplete', 'off');\n this.addAria();\n\n // Add automation Id's\n utils.addAttributes(this.element, this, this.settings.attributes, 'colorpicker');\n utils.addAttributes(this.element.parent().find('.trigger'), this, this.settings.attributes, 'trigger');\n }", "title": "" }, { "docid": "e8e52cced45d18a09efdb98682d041ce", "score": "0.4828706", "text": "function pgvar_cmbsgrupo_cliente_codigo__init(){\n $(\"#pgvar_cmbsgrupo_cliente_codigo\").html('');\n \n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_grupo_cliente_select\", function(data, status){\n $(\"#pgvar_cmbsgrupo_cliente_codigo\").html(data);\n $(\"#pgvar_cmbsgrupo_cliente_codigo\").selectpicker('refresh');\n });\n}", "title": "" }, { "docid": "e39c6f75489e57f43ee6a221733e52eb", "score": "0.48274794", "text": "_setup() {\n\t\tlet _ = this, picker = _.timepicker, overlay = picker.overlay, wrapper = picker.wrapper,\n\t\t\ttime = picker.timeHolder, clock = picker.clockHolder\n\n\t\thf.appendTo([time.hour, time.dots, time.minute], time.wrapper)\n\t\thf.appendTo(time.wrapper, wrapper)\n\n\t\tif (!_.config.is24hour) hf.appendTo(time.am_pm, time.wrapper)\n\n\t\t// Setup hours\n\t\tlet _hours = _.config.is24hour ? 24 : 12\n\t\tfor (let i = 0; i < _hours; i++) {\n\t\t\tlet value = i + 1, deg = ((HOUR_START_DEG + (i * HOUR_DEG_INCR)) % END_DEG) - (_.config.is24hour && value < 13 ? 15 : 0),\n\t\t\t\tis24 = value === 24,\n\t\t\t\thour = hf.createElem('div', { class: `mdtp__digit rotate-${deg}`, 'data-hour': (is24 ? 0 : value) }),\n\t\t\t\thourInner = hf.createElem('span', null, (is24 ? '00' : value))\n\n\t\t\thf.appendTo(hourInner, hour)\n\n\t\t\tif (_.config.is24hour && value < 13) hour.classList.add('inner--digit')\n\t\t\t\n\t\t\thf.addEvent(hourInner, 'click', function() {\n\t\t\t\tlet _hour = parseInt(this.parentNode.dataset.hour),\n\t\t\t\t\t_selectedT = _.selected.getPeriod(),\n\t\t\t\t\t_value = _.config.is24hour ? _hour :\n\t\t\t\t\t\t(_hour + ((_selectedT === 'PM' && _hour < 12) || (_selectedT === 'AM' && _hour === 12) ? 12 : 0)) % 24,\n\t\t\t\t\tdisabled = _.isDisabled(_value, 0, true)\n\n\t\t\t\tif (disabled) return\n\n\t\t\t\t_.setHour(_value)\n\t\t\t\t_._switchView('minutes')\n\t\t\t})\n\n\t\t\thf.appendTo(hour, clock.clock.hours)\n\t\t}\n\n\t\t// Setup minutes\n\t\tfor (let i = 0; i < 60; i++) {\n\t\t\tlet min = i < 10 ? '0' + i : i, deg = (MIN_START_DEG + (i * MIN_DEG_INCR)) % END_DEG,\n\t\t\t\tminute = hf.createElem('div', { class: `mdtp__digit rotate-${deg}`, 'data-minute': i }),\n\t\t\t\tminuteInner = hf.createElem('span')\n\n\t\t\thf.appendTo(minuteInner, minute)\n\n\t\t\tif (i % 5 === 0) {\n\t\t\t\tminute.classList.add('marker')\n\t\t\t\tminuteInner.innerText = min\n\t\t\t}\n\t\t\t\n\t\t\thf.addEvent(minuteInner, 'click', function() {\n\t\t\t\tlet _minute = parseInt(this.parentNode.dataset.minute),\n\t\t\t\t\t_hour = _.selected.getHour(),\n\t\t\t\t\tdisabled = _.isDisabled(_hour, _minute, true)\n\n\t\t\t\tif (disabled) return\n\n\t\t\t\t_.setMinute(_minute)\n\t\t\t})\n\n\t\t\thf.appendTo(minute, clock.clock.minutes)\n\t\t}\n\n\t\t// Setup clock\n\t\tif (!_.config.is24hour) {\n\t\t\thf.appendTo([clock.am, clock.pm], clock.clock.wrapper)\n\t\t}\n\n\t\thf.appendTo([clock.clock.dot, clock.clock.hours, clock.clock.minutes], clock.clock.wrapper)\n\t\thf.appendTo(clock.clock.wrapper, clock.wrapper)\n\n\t\t// Setup buttons\n\t\tif (_.config.clearBtn) {\n\t\t\thf.appendTo(clock.buttonsHolder.btnClear, clock.buttonsHolder.wrapper)\n\t\t}\n\n\t\thf.appendTo([clock.buttonsHolder.btnCancel, clock.buttonsHolder.btnOk], clock.buttonsHolder.wrapper)\n\t\thf.appendTo(clock.buttonsHolder.wrapper, clock.wrapper)\n\n\t\thf.appendTo(clock.wrapper, wrapper)\n\n\t\t// Setup theme\n\t\twrapper.dataset.theme = _.input.dataset.theme || _.config.theme\n\n\t\thf.appendTo(wrapper, overlay)\n\n\t\treturn overlay\n\t}", "title": "" }, { "docid": "61b28987cd5368969427280bd867a4f4", "score": "0.48227513", "text": "preRender() {\n this.inputElementCopy = this.element.cloneNode(true);\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"removeClass\"])([this.inputElementCopy], [ROOT$1, CONTROL, LIBRARY]);\n this.inputElement = this.element;\n this.formElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"closest\"])(this.inputElement, 'form');\n this.index = this.showClearButton ? 2 : 1;\n this.isBlazorServer = (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isBlazor\"])() && this.isServerRendered && this.getModuleName() === 'datepicker') ? true : false;\n if (!this.isBlazorServer) {\n this.ngTag = null;\n if (this.element.tagName === 'EJS-DATEPICKER' || this.element.tagName === 'EJS-DATETIMEPICKER') {\n this.ngTag = this.element.tagName;\n this.inputElement = this.createElement('input');\n this.element.appendChild(this.inputElement);\n }\n if (this.element.getAttribute('id')) {\n if (this.ngTag !== null) {\n this.inputElement.id = this.element.getAttribute('id') + '_input';\n }\n }\n else {\n if (this.getModuleName() === 'datetimepicker') {\n this.element.id = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getUniqueID\"])('ej2-datetimepicker');\n if (this.ngTag !== null) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"attributes\"])(this.inputElement, { 'id': this.element.id + '_input' });\n }\n }\n else {\n this.element.id = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getUniqueID\"])('ej2-datepicker');\n if (this.ngTag !== null) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"attributes\"])(this.inputElement, { 'id': this.element.id + '_input' });\n }\n }\n }\n if (this.ngTag !== null) {\n this.validationAttribute(this.element, this.inputElement);\n }\n this.updateHtmlAttributeToElement();\n }\n this.defaultKeyConfigs = this.getDefaultKeyConfig();\n this.checkHtmlAttributes(false);\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n if (!this.isBlazorServer) {\n this.element.removeAttribute('tabindex');\n super.preRender();\n }\n }", "title": "" }, { "docid": "f61c6ede1f450fd1add22debc91a7fd1", "score": "0.4793115", "text": "function initFlatpickr() {\n const element = document.querySelector(\".datepicker\");\n if (element) {\n flatpickr(\".datepicker\", {});\n }\n\n const time = document.querySelector(\".timepicker\")\n if (time) {\n flatpickr(\".timepicker\",\n {\n enableTime: true,\n minDate: \"today\"\n }\n )\n }\n}", "title": "" }, { "docid": "bca5aa29e0320544fb143b0f6c9f7214", "score": "0.47911632", "text": "_updateRootElement() {\n const element = this.element.nativeElement;\n const rootElement = this.rootElementSelector ?\n getClosestMatchingAncestor(element, this.rootElementSelector) : element;\n if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(`cdkDrag must be attached to an element node. ` +\n `Currently attached to \"${rootElement.nodeName}\".`);\n }\n this._dragRef.withRootElement(rootElement || element);\n }", "title": "" }, { "docid": "4b4ab5bb3b4c2f3be3c4bb0f97a9f74e", "score": "0.47694734", "text": "buildUI() {\n this.node.innerHTML = '\\\n <div class=\"fw-fileuploadfield-action\">\\\n <input type=\"file\"></input>\\\n <div tabIndex=\"0\" class=\"fw-fileuploadfield-choice\"></div>\\\n </div>\\\n <div class=\"fw-fileuploadfield-view\">\\\n <table><tbody></tbody></table>\\\n </div>';\n this.choiceNode = this.node.getElementsByClassName('fw-fileuploadfield-choice')[0];\n this.inputNode = this.node.getElementsByTagName('input')[0];\n this.bodyNode = this.node.getElementsByTagName('tbody')[0];\n this.viewNode = this.node.getElementsByClassName('fw-fileuploadfield-view')[0];\n this.setMultiple(this.multiple);\n this.setFocusableNode(this.choiceNode);\n }", "title": "" }, { "docid": "ccb4d41f3557ff6cc06b1bedf8979154", "score": "0.47486302", "text": "function setupChosen(element) {\n // Get all elements with class='chosen-select'\n element = (element ? element : document);\n var selects = element.querySelectorAll('.chosen-select');\n if (selects.length === 0) {\n return;\n }\n\n // Make sure jQuery and Chosen are loaded\n if (window.$ === undefined) {\n app.showErrorAlert('Missing jQuery for use with chosen plugin');\n return;\n } else if ($.prototype.chosen === undefined) {\n app.showErrorAlert('Missing jQuery chosen plugin');\n return;\n }\n\n // Setup each chosen control based on an optional attribute\n Array.prototype.forEach.call(selects, function(select) {\n var options = select.getAttribute('data-chosen-options');\n options = (options === null ? {} : JSON.parse(options));\n $(select).chosen(options).change(function(e) {\n // By default chosen blocks the standard 'change' and 'input' events.\n // Make sure 'input' events run so other plugins or code such as\n // [dataBind.js] behave as expected.\n var event, eventName = 'input';\n if (typeof(Event) === 'function') {\n event = new Event(eventName, { bubbles: true }); // Modern Browsers\n } else {\n event = document.createEvent('Event'); // IE 11\n event.initEvent(eventName, true, false);\n }\n e.target.dispatchEvent(event);\n });\n });\n }", "title": "" }, { "docid": "e7320d8cb3b8131fb539267ccbc1614b", "score": "0.4748179", "text": "setup() {\n this.el = this.rb.getDocument().getElement(this.band);\n }", "title": "" }, { "docid": "882de9ed962234dab6757253a5f339bd", "score": "0.4745206", "text": "preRender() {\n this.keyInputConfigs = {\n altDownArrow: 'alt+downarrow',\n escape: 'escape',\n enter: 'enter',\n tab: 'tab',\n altRightArrow: 'alt+rightarrow',\n altLeftArrow: 'alt+leftarrow',\n moveUp: 'uparrow',\n moveDown: 'downarrow',\n spacebar: 'space'\n };\n this.defaultConstant = {\n placeholder: this.placeholder,\n startLabel: 'Start Date',\n endLabel: 'End Date',\n customRange: 'Custom Range',\n applyText: 'Apply',\n cancelText: 'Cancel',\n selectedDays: 'Selected Days',\n days: 'days'\n };\n /**\n * Mobile View\n */\n this.isMobile = window.matchMedia('(max-width:550px)').matches;\n this.inputElement = this.element;\n this.angularTag = null;\n if (this.element.tagName === 'EJS-DATERANGEPICKER') {\n this.angularTag = this.element.tagName;\n this.inputElement = this.createElement('input');\n this.element.appendChild(this.inputElement);\n }\n this.cloneElement = this.element.cloneNode(true);\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"removeClass\"])([this.cloneElement], [ROOT$2, CONTROL$1, LIBRARY$1]);\n this.updateHtmlAttributeToElement();\n if (this.element.getAttribute('id')) {\n if (this.angularTag !== null) {\n this.inputElement.id = this.element.getAttribute('id') + '_input';\n }\n }\n else {\n this.element.id = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getUniqueID\"])('ej2-datetimepicker');\n if (this.angularTag !== null) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"attributes\"])(this.inputElement, { 'id': this.element.id + '_input' });\n }\n }\n this.checkInvalidRange(this.value);\n if (!this.invalidValueString && (typeof (this.value) === 'string')) {\n let rangeArray = this.value.split(' ' + this.separator + ' ');\n this.value = [new Date(rangeArray[0]), new Date(rangeArray[1])];\n }\n this.initProperty();\n this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';\n this.element.removeAttribute('tabindex');\n super.preRender();\n this.navNextFunction = this.navNextMonth.bind(this);\n this.navPrevFunction = this.navPrevMonth.bind(this);\n this.deviceNavNextFunction = this.deviceNavNext.bind(this);\n this.deviceNavPrevFunction = this.deviceNavPrevious.bind(this);\n this.initStartDate = this.checkDateValue(this.startValue);\n this.initEndDate = this.checkDateValue(this.endValue);\n this.formElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"closest\"])(this.element, 'form');\n }", "title": "" }, { "docid": "76bbdf80adb79bfa71a3a0af18dc3845", "score": "0.47353002", "text": "function initItems() {\n\t\t\tif (!items) {\n\t\t\t\titems = [];\n\n\t\t\t\tif (root.find) {\n\t\t\t\t\t// Root is a container then get child elements using the UI API\n\t\t\t\t\troot.find('*').each(function(ctrl) {\n\t\t\t\t\t\tif (ctrl.canFocus) {\n\t\t\t\t\t\t\titems.push(ctrl.getEl());\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// Root is a control/widget then get the child elements of that control\n\t\t\t\t\tvar elements = root.getEl().getElementsByTagName('*');\n\t\t\t\t\tfor (var i = 0; i < elements.length; i++) {\n\t\t\t\t\t\tif (elements[i].id && elements[i]) {\n\t\t\t\t\t\t\titems.push(elements[i]);\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}", "title": "" }, { "docid": "76bbdf80adb79bfa71a3a0af18dc3845", "score": "0.47353002", "text": "function initItems() {\n\t\t\tif (!items) {\n\t\t\t\titems = [];\n\n\t\t\t\tif (root.find) {\n\t\t\t\t\t// Root is a container then get child elements using the UI API\n\t\t\t\t\troot.find('*').each(function(ctrl) {\n\t\t\t\t\t\tif (ctrl.canFocus) {\n\t\t\t\t\t\t\titems.push(ctrl.getEl());\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// Root is a control/widget then get the child elements of that control\n\t\t\t\t\tvar elements = root.getEl().getElementsByTagName('*');\n\t\t\t\t\tfor (var i = 0; i < elements.length; i++) {\n\t\t\t\t\t\tif (elements[i].id && elements[i]) {\n\t\t\t\t\t\t\titems.push(elements[i]);\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}", "title": "" }, { "docid": "76bbdf80adb79bfa71a3a0af18dc3845", "score": "0.47353002", "text": "function initItems() {\n\t\t\tif (!items) {\n\t\t\t\titems = [];\n\n\t\t\t\tif (root.find) {\n\t\t\t\t\t// Root is a container then get child elements using the UI API\n\t\t\t\t\troot.find('*').each(function(ctrl) {\n\t\t\t\t\t\tif (ctrl.canFocus) {\n\t\t\t\t\t\t\titems.push(ctrl.getEl());\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// Root is a control/widget then get the child elements of that control\n\t\t\t\t\tvar elements = root.getEl().getElementsByTagName('*');\n\t\t\t\t\tfor (var i = 0; i < elements.length; i++) {\n\t\t\t\t\t\tif (elements[i].id && elements[i]) {\n\t\t\t\t\t\t\titems.push(elements[i]);\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}", "title": "" }, { "docid": "a9fddfc965289b615cb05e15fa26f0b0", "score": "0.47215527", "text": "function pgvar_cmbstipo_servicio_codigo__init(){\n $(\"#pgvar_cmbstipo_servicio_codigo\").html('');\n \n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_tipo_servicio_select\", function(data, status){\n $(\"#pgvar_cmbstipo_servicio_codigo\").html(data);\n $(\"#pgvar_cmbstipo_servicio_codigo\").selectpicker('refresh');\n });\n}", "title": "" }, { "docid": "77d4f3d5cb2cbb8e773703be83b0ac7a", "score": "0.4717977", "text": "function initselpick() {\n $('.selectpicker').selectpicker();\n}", "title": "" }, { "docid": "b72195f505c8cc02b064b60bb2eddba0", "score": "0.4701827", "text": "function prepareAndStyle() {\n var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;\n angular.forEach({\n 'fit': '',\n 'height': '100%',\n 'width': '100%',\n 'preserveAspectRatio': 'xMidYMid meet',\n 'viewBox': this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize),\n 'focusable': false // Disable IE11s default behavior to make SVGs focusable\n }, function(val, attr) {\n this.element.setAttribute(attr, val);\n }, this);\n }", "title": "" } ]
f03303c2d8505dcc75392bffdd55b86d
Merge a list of walmart products with this.products
[ { "docid": "2520aa171c8ff0a999758b80f5bc316f", "score": "0.68735516", "text": "addProducts(otherProducts) {\n this.products = this.products.concat(otherProducts);\n }", "title": "" } ]
[ { "docid": "834e685fddf3ae35db5c19b93d7ac1a8", "score": "0.69013935", "text": "function mergeProductData(products) {\n\n for (var i=0; i<products.length; i++) {\n var guid = products[i].productId;\n /*jshint -W083 */\n Object.keys(itemMapping[guid]).forEach(function(key) {\n products[i][key] = itemMapping[guid][key];\n });\n }\n\n products.unshift({\n name: 'Fighter',\n cat: 1,\n smallImageUrl: '/img/items/fighter-ship.png',\n description: 'Your main ship.',\n });\n\n return products;\n }", "title": "" }, { "docid": "b535ce4a1e722c3fe5a1a515eabec523", "score": "0.65331614", "text": "buildList() {\n if (!this.products.length) {\n return this.noProductsFound()\n }\n this.products.forEach((p) => {\n this.container.append(this.buildProduct(p))\n })\n }", "title": "" }, { "docid": "ab75218e29362570c52602929b5a24dd", "score": "0.632778", "text": "function mergeProducts (products1, products2) {\n\n\tlet new_products = products1.concat(products2);\n\tif(new_products.length <= 1) {\n\t\treturn new_products;\n\t}\n\tlet final_products = [];\n\tlet sortedArr = toolifier.objects.sortByKey(new_products, 'product_SKU');\n\t// console.log(sortedArr.length);\n\tlet current = sortedArr[0];\n\tlet currentIndex = 0;\n\tlet i = 0;\n\t//Iterate through array\n\twhile(currentIndex <= sortedArr.length-1){\n\t\tif(i >= sortedArr.length-1) {\n\t\t\tcurrentIndex++;\n\t\t\t// console.log(\"ITERATING\" + currentIndex + \" \" + i);\n\t\t\tfinal_products.push(current);\n\t\t\tcurrent = sortedArr[currentIndex];\n\t\t\ti = currentIndex;\n\t\t} else {\n\t\t\ti++;\n\t\t\t// console.log(\"COMPARING\" + currentIndex + \" \" + i);\n\t\t\tif (sortedArr[i].product_SKU != current.product_SKU) { //Check if SKUs do not match, if they don't then ignore\n\t\t\t\ti = sortedArr.length;\n\t\t\t} else { //SKUs do match, but do objects match?\n\t\t\t\t//Temporarily store the count, because this prop should be ignored for the equivalence\n\t\t\t\tconst tempcount = sortedArr[i].count;\n\t\t\t\tsortedArr[i].count = current.count;\n\t\t\t\t//Check if objects are equivalent\n\t\t\t\tlet flag = __.isEquivalent(sortedArr[i], current)\n\t\t\t\tsortedArr[i].count = tempcount;\n\t\n\t\t\t\tif(!flag) {\n\t\t\t\t\t//Products are too dissimilar, ignore\n\t\t\t\t} else {\n\t\t\t\t\tcurrent.count += sortedArr[i].count;\n\t\t\t\t\tsortedArr[i].count = 0;\n\t\t\t\t\t// console.log(\"changing counts\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tlet final = [];\n\tfor(let product of final_products) {\n\t\tif(product.count > 0) {\n\t\t\tfinal.push(product);\n\t\t}\n\t}\n\t// console.log(final);\n\n\treturn final.reverse();\n}", "title": "" }, { "docid": "bf5232811eba2f43ef2ff164fde658ab", "score": "0.6148054", "text": "productsList(productsJSON) {\n let products = [];\n productsJSON.forEach(function(product) {\n if (product.hasOwnProperty('upc') && product.availableOnline && product.stock.toLowerCase() === 'available') {\n products.push(new WalmartProduct(product));\n }\n });\n return products;\n }", "title": "" }, { "docid": "e6d7e41d826b4891e8ede98b4171ff8c", "score": "0.6105606", "text": "putAll() {\n return this.storage.save(STORAGE_KEY, Array.from(this.products.values()));\n }", "title": "" }, { "docid": "6c38135c566aca4546b82134ea23295d", "score": "0.60944235", "text": "appendProducts(rawProducts)\r\n\t{\r\n\t\tif (! Array.isArray(rawProducts) || (rawProducts.length <= 0 && typeof rawProducts[0] == 'string')) {\r\n\t\t\tthrow new InvalidArgumentException;\r\n\t\t}\r\n\r\n\t\tlet products = this.buildProducts(rawProducts, this.settings.item_class, 'div');\r\n\r\n\t\tproducts.forEach(function(product) {\r\n\t\t\tEventManager.publish('products.loading', product);\r\n\t\t\tthis.element.appendChild(product);\r\n\t\t}.bind(this));\r\n\r\n\t\tEventManager.publish('products.loaded', products);\r\n\r\n\t\treturn products;\r\n\t}", "title": "" }, { "docid": "13d174e5b55e87fc30a0f89a079ace85", "score": "0.60702395", "text": "@computed get allProducts() {\n return this.products;\n }", "title": "" }, { "docid": "dfdef9dc460d395b5c1a7a14049f67f0", "score": "0.6024239", "text": "function getAll() {\n return products;\n }", "title": "" }, { "docid": "746d82df5925422558dcef2cdf5e74b4", "score": "0.59823835", "text": "function prepareProducts(products) {\n var preparedProducts = products.map(preConfigureProduct);\n return preparedProducts;\n}", "title": "" }, { "docid": "f8e49471d4c72b762820ee5dc42ee62b", "score": "0.58794624", "text": "function getAllProducts() {\n productService.getAll()\n .then(function(products){\n vm.products = products;\n })\n .catch(function(message){\n vm.errorMessage = message;\n });\n }", "title": "" }, { "docid": "8188dad6fee791a70d7f1135d85c0ad1", "score": "0.5832612", "text": "getProducts() {\n let products = store.get('products');\n // boostrap products with books if they don't exist\n if(!products) {\n store.save('products', books);\n products = books;\n } \n return products;\n }", "title": "" }, { "docid": "1845c799616b89b382b12efe42f357f7", "score": "0.58096486", "text": "getProducts() {\n return this.products;\n }", "title": "" }, { "docid": "ea56a916f320068cd068cd86cb839610", "score": "0.580062", "text": "replaceProducts(rawProducts) \r\n\t{\r\n\t\tif (! Array.isArray(rawProducts) || (rawProducts.length <= 0 && typeof rawProducts[0] == 'string')) {\r\n\t\t\tthrow new InvalidArgumentException;\r\n\t\t}\r\n\r\n\t\tlet products = this.buildProducts(rawProducts, this.settings.item_class, 'div');\r\n\r\n\t\tthis.element.innerHTML = '';\r\n\t\tproducts.forEach(function(product) {\r\n\t\t\tEventManager.publish('products.loading', product);\r\n\t\t\tthis.element.appendChild(product);\r\n\t\t}.bind(this));\r\n\r\n\t\tEventManager.publish('products.loaded', products);\r\n\r\n\t\treturn products;\r\n\t}", "title": "" }, { "docid": "311406ef73a18c9a94f0e21dddc96262", "score": "0.57518005", "text": "function mergeDataProduct(users, products) {\n const results = products.map( product => {\n const indexUser = users.findIndex(user => {\n return product.userId === user.id;\n });\n if (indexUser !== -1) {\n product.user = users[indexUser];\n }\n delete product.userId;\n return product;\n });\n return results;\n}", "title": "" }, { "docid": "f9818b2b424e6689b23e2de834b79937", "score": "0.5669639", "text": "getProducts(products) {\n\t\tthis.renderProducts(products);\n\t\t// SAVE PRODUCTS TO STORAGE\n\t\tStorage.SetItem(\"products\", products);\n\t}", "title": "" }, { "docid": "f5f25ddc2686cdd7fd5eb30b271ae04f", "score": "0.5664775", "text": "getAllProductDeails() {\n return this.products;\n }", "title": "" }, { "docid": "ba9bffd98ff84d90efad86b482f7115e", "score": "0.5660928", "text": "constructor(data = {}) {\n Object.assign(this, data);\n if (this.products.length > 0) {\n this.products = this.products.map(x => new Product(x));\n }\n }", "title": "" }, { "docid": "484d353620e6d79578262ea6ce6ed12b", "score": "0.56500566", "text": "getProducts() {\n\t\treturn ProductsData;\n\t}", "title": "" }, { "docid": "62fff320e51cae360f85940e776a785f", "score": "0.56350243", "text": "function mergeDataUser(users, products) {\n const results = users.map( user => {\n user.product = products.filter(product => {\n return product.userId === user.id;\n });\n return user;\n });\n return results;\n}", "title": "" }, { "docid": "8daf8256eb798ab98b336fec39ea8d68", "score": "0.55952466", "text": "get products () {return $$('.ajax_block_product .replace-2x')}", "title": "" }, { "docid": "7bb6eedb3ba9835e9b85452b4cbe7b5f", "score": "0.5568041", "text": "function populateProducts(productList) {\n $(\"#home-product-container\").empty();\n for(var i = 0; i < productList.length; i++) {\n $(\"#home-product-container\").append(\n '<div class=\"productItem col-3\">' +\n '<div>' +\n '<a>' + productList[i].name + '</a>' +\n '</div>' +\n '<img src=' + productList[i].img + '>' +\n '<div class=\"product-item-content\">' +\n '<div class=\"product-description\">' +\n productList[i].details +\n '</div>' +\n '<div class=\"product-view-btn\">' +\n '<button type=\"button\" class=\"btn btn-primary btn-lg\" onclick=\"viewProduct()\">View</button>' +\n '</div>' +\n '</div>' +\n '</div>'\n );\n }\n}", "title": "" }, { "docid": "f32400f31c508fb78d7c0ff989179a45", "score": "0.5556373", "text": "function loadProducts() {\n \n productAPI\n .getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "3a5670f502c99278fb1450df815ff8f2", "score": "0.5552697", "text": "getProducts() {\n return this.products\n }", "title": "" }, { "docid": "9323a733add51386972652b42e664443", "score": "0.55416733", "text": "function updateProductsInStorage(list) {\n\n storageHelper.save('cartProducts', list);\n return storageHelper.get('cartProducts');\n }", "title": "" }, { "docid": "fbc8eab334aead06de80d8f19381f2c9", "score": "0.55381346", "text": "constructor(productsJSON) {\n this.products = this.productsList(productsJSON);\n }", "title": "" }, { "docid": "557afdaebdd95e4aa74fdadd3c95b4ba", "score": "0.5537396", "text": "function getUpdatedProductList() {\n dataService.getProductsFromApi()\n .then(function(data) {\n $scope.productList = data;\n });\n }", "title": "" }, { "docid": "713feeddd5b56c3e9fd14632ee0b56f6", "score": "0.55211425", "text": "addProducts(product) {\n return this.productsCollection.add(product);\n }", "title": "" }, { "docid": "e6f702fbfb802e59efe7b86c1218a355", "score": "0.5517076", "text": "function fetchProducts(data) {\n let lst_products = [];\n\n for (let i = 0; i < data.length; i++) {\n lst_products.push({\n PRODUCT_ID_ENTRY: data[i].id,\n PRODUCT_NAME_ENTRY: data[i].name,\n PRODUCT_PRICE_ENTRY: data[i].price,\n PRODUCT_IMAGE_URL_ENTRY: data[i].image_url,\n });\n }\n return lst_products;\n}", "title": "" }, { "docid": "9e14e496a99b804180a76ee7008cc0fd", "score": "0.5510149", "text": "async products(_, args) {\n const products = await Products.list(args.input);\n return products;\n }", "title": "" }, { "docid": "f9d8ca285bdd9e83962b7844bbb2ad43", "score": "0.5476347", "text": "async getAllItemsRatingsAndReviews(pairedProductList){\n return this._allProdsReturn(pairedProductList).then((allProds) => {\n let allProducts = new PairedProductList();\n allProds.forEach((product) => {\n allProducts.addPairedProduct(product.amazonProd, product.walmartProd);\n })\n return allProducts;\n });\n }", "title": "" }, { "docid": "8bb6375e7b3f88fca44d815c1ae0028a", "score": "0.54734", "text": "function ownedProducts(){\n // Initialize the billing plugin\n inappbilling.getPurchases(successHandler, errorHandler);\n\n }", "title": "" }, { "docid": "c9b714c5a9ba6a94512623c63a8b7129", "score": "0.54719496", "text": "renderProducts(products) {\n\t\t// FOR EVERY SINGLE PRODUCT\n\t\tproducts.forEach((product, index) => {\n\t\t\t// DEFINE A SINGLE PRODUCT (using the products data)\n\t\t\tconst element = Product(product, index);\n\t\t\t// PRODUCTS \"DOM\" APPENDS \"ELEMENT\"\n\t\t\tPRODUCTS.innerHTML += element;\n\t\t});\n\t\t// GET PRODUCTS FROM STORAGE\n\t\tproducts = Storage.GetItem(\"products\") || products;\n\t\t// GET ALL ADD TO CART BUTTONS\n\t\tthis.getAddToCartButtons(products);\n\t\t// FUNCTIONALITIES FOR REMOVING CART ITEMS\n\t\tthis.cartLogic();\n\t}", "title": "" }, { "docid": "1db2a4b42eabd360252e5601461bd99a", "score": "0.54513186", "text": "async function loadProducts() {\n const response = await api.get('products');\n const data = response.data.map(product => ({\n ...product,\n priceFormatted: formatPrice(product.price),\n }));\n // and instead of setState, we use setProducts now\n setProducts(data);\n }", "title": "" }, { "docid": "b2fa304b0d6f9b4748761c2cf6cacb5a", "score": "0.5447035", "text": "loadFromStorage() {\n\n let products = this.all();\n products.forEach(product => this.products.set(product.id, product))\n }", "title": "" }, { "docid": "94fc12a7a50fb88070f9d4a7d0b0d602", "score": "0.5446526", "text": "function LoadProducts() {\n\t\n\t\n\tvar data = JSON.parse(ProductData);\n\t\n\tdata.Products.sort((a, b) => (a.Price < b.Price) ? 1 : -1);\n\tdata.Products.forEach(AddProductToCatalog);\n\n\t\n}", "title": "" }, { "docid": "d07a0a868a91b4c7ad4f6a5bc0fc91e6", "score": "0.5446242", "text": "function updateProducts(){\n $('.cart-products > li').each(function(){\n var $transformed = $(this);\n var $original = $('#' + $transformed.attr('data-id')).closest('tr');\n if ($original.length) {\n\n // Update quantity, price\n $transformed.find('.qty-stepper input').val($original.find('[id^=\"qty_\"]').val());\n $transformed.find('.price').text($original.find('.each .price').first().text());\n\n // Update promo information\n var promo = $original.next('tr');\n if (promo.length) {\n promo = parsePromo(promo);\n }\n if (promo.discount) {\n $transformed.find('.promo').addClass('active');\n $transformed.find('.promo .discount').text(promo.discount);\n $transformed.find('.promo .value').text(promo.value);\n } else {\n $transformed.find('.promo').removeClass('active');\n }\n\n } else {\n $transformed.remove();\n }\n });\n }", "title": "" }, { "docid": "09d86c4d397020ee52c4ace44a774505", "score": "0.5444332", "text": "getAllProducts() {\n return __awaiter(this, void 0, void 0, function* () {\n // try/catch\n // data = await Product.find()\n const products = mongo_data_1.data.map((productEntity) => mapper_1.ProductMap.toDomain(productEntity));\n return shared_1.Result.ok(products);\n });\n }", "title": "" }, { "docid": "1e49da739a4fd0138429bfb69aed1369", "score": "0.54403615", "text": "async function fetchAllProducts() {\n\t\ttry {\n\t\t\tconst result = await API.graphql(graphqlOperation(listProducts));\n\t\t\tsetAllProductList(result.data.listProducts.items);\n\t\t} catch (err) {\n\t\t\tconsole.error(`Error fetching all the products`, err);\n\t\t}\n\t}", "title": "" }, { "docid": "0ccddec66c3467b9468ac2e3f27d2bbb", "score": "0.54240614", "text": "function getProductList() {\n fetch(\"https://mapi.sendo.vn/mob/product/cat/ao-so-mi-nam?p=1\")\n .then(result => result.json())\n .then(products => {\n console.log(products)\n setProductList(products.data)\n })\n }", "title": "" }, { "docid": "e0deb0b3a5385cce14aa5520c79a1031", "score": "0.541869", "text": "function createProductList(list, singleProdAndCategories) {\n\tlet productsList = {};\n\tproductsList.author = {}\n\tproductsList.author.name = 'Diego';\n\tproductsList.author.lastname = 'Almirón';\n\n\tlet categoriesArray = [];\n\n\tsingleProdAndCategories[singleProdAndCategories.length - 1].path_from_root.map(category => {\n\t\tcategoriesArray.push(category.name);\n\t});\n\n\tproductsList.categories = categoriesArray;\n\n\tproductsList.items = [];\n\n\tlist.results.map((product, index) => {\n\t\tlet item = {};\n\t\titem.id = product.id;\n\t\titem.title = product.title;\n\t\titem.price = {\n\t\t\tcurrency: product.currency_id,\n\t\t\tamount: product.price,\n\t\t\tdecimals: 00\n\t\t}\n\t\titem.picture = singleProdAndCategories[index].pictures[0].url;\n\t\titem.condition = product.condition;\n\t\titem.free_shipping = product.shipping.free_shipping;\n\t\titem.address = product.address.state_name;\n\n\t\tproductsList.items.push(item);\n\t});\n\n\treturn productsList;\n}", "title": "" }, { "docid": "dfafe6047547da1805d4dc311933b55b", "score": "0.5416616", "text": "function getAvailableProducts() {\n return [{\n id: 23771823,\n name: 'Flat screen',\n price: 4000,\n rating: 4.2,\n shipsTo: ['Denmark', 'Germany']\n },\n {\n id: 23771824,\n name: 'Mobile Phones',\n price: 14000,\n rating: 4.6,\n shipsTo: ['Germany','Sweden','Norway','Denmark']\n },\n {\n id: 23771825,\n name: 'Wallets',\n price: 4000,\n rating: 4.2,\n shipsTo: ['Denmark']\n }]\n }", "title": "" }, { "docid": "1a6da1a1a9431a8aaab5623d73f38cbf", "score": "0.54137915", "text": "function renderingProducts(products) {\n const productsContainer = document.querySelector('ul.product-list');\n productsContainer.innerHTML = products\n .map(p => {\n return `\n <li>\n <a class=\"product-link\" data-id=\"${p.id}\" href=\"\">\n <span>${p.id} - </span>\n ${p.title}\n </a>\n </li>\n `;\n })\n .join(\"\");\n}", "title": "" }, { "docid": "659d965d08a36a3e050a74e86ffa37fd", "score": "0.53796804", "text": "async getAllProducts() {\n try {\n let allProducts = await products.findAll();\n\n if (allProducts.length <= 0) {\n return {\n msg: 'No products found..',\n payload: 1\n }\n }\n\n let productList = allProducts.map((item, index, arr) => {\n return {\n product: item.dataValues,\n index: index\n };\n });\n\n return {\n msg: 'Success',\n payload: 0,\n productList: productList\n }\n } catch (e) {\n return {\n msg: 'An error occurred while trying to get the products list',\n payload: 1\n }\n }\n }", "title": "" }, { "docid": "61d3d555a25a65910ea54ccbebee239d", "score": "0.53737557", "text": "function getProducts() {\n let potentialProducts = localStorage.getItem('productstorage');\n if(potentialProducts) {\n let parsedProducts = JSON.parse(potentialProducts);\n allProducts = parsedProducts;\n }\n}", "title": "" }, { "docid": "9bda956014611db716aee70cf7c231e4", "score": "0.53730035", "text": "renderList(products) {\n this._cleanProductsList();\n\n if (products.length === 0) {\n this._hideProductsList();\n\n return;\n }\n\n for (const key in products) {\n const product = products[key];\n\n const $template = this.cloneProductTemplate(product);\n\n let customizationId = 0;\n\n if (product.customization) {\n customizationId = product.customization.customizationId;\n this._renderListedProductCustomization(product.customization, $template);\n }\n\n $template.find(createOrderMap.listedProductImageField).prop('src', product.imageLink);\n $template.find(createOrderMap.listedProductNameField).text(product.name);\n $template.find(createOrderMap.listedProductAttrField).text(product.attribute);\n $template.find(createOrderMap.listedProductReferenceField).text(product.reference);\n\n if (product.gift !== true) {\n $template.find(createOrderMap.listedProductUnitPriceInput).val(product.unitPrice);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('product-id', product.productId);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('customization-id', customizationId);\n $template.find(createOrderMap.listedProductQtyInput).val(product.quantity);\n $template.find(createOrderMap.listedProductQtyInput).data('product-id', product.productId);\n $template.find(createOrderMap.listedProductQtyInput).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.listedProductQtyInput).data('customization-id', customizationId);\n $template.find(createOrderMap.listedProductQtyInput).data('prev-qty', product.quantity);\n $template.find(createOrderMap.productTotalPriceField).text(product.price);\n $template.find(createOrderMap.productRemoveBtn).data('product-id', product.productId);\n $template.find(createOrderMap.productRemoveBtn).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.productRemoveBtn).data('customization-id', customizationId);\n } else {\n $template.find(createOrderMap.listedProductGiftQty).text(product.quantity);\n }\n\n this.$productsTable.find('tbody').append($template);\n }\n\n this._showTaxWarning();\n this._showProductsList();\n }", "title": "" }, { "docid": "06c422199dbbd4dd80056c7fb1fd02c3", "score": "0.53717506", "text": "function loadProductData(data) {\n _prodData = _.extend({},data);\n}", "title": "" }, { "docid": "83b891b045af40ae062506d7fd170085", "score": "0.5343728", "text": "function getProducts() {\n\tvar products = [];\n\tproducts.push({\n\t\t'name': 'Peas',\n\t\t'per': 'bag',\n\t\t'price': '.95',\n\t\t'currency': 'USD',\n\t\t'quantity': 0,\n\t});\n\tproducts.push({\n\t\t'name': 'Eggs',\n\t\t'per': 'dozen',\n\t\t'price': '2.10',\n\t\t'currency': 'USD',\n\t\t'quantity': 0,\n\t});\n\tproducts.push({\n\t\t'name': 'Milk',\n\t\t'per': 'bottle',\n\t\t'price': '1.30',\n\t\t'currency': 'USD',\n\t\t'quantity': 0,\n\t});\n\tproducts.push({\n\t\t'name': 'Beans',\n\t\t'per': 'can',\n\t\t'price': '.73',\n\t\t'currency': 'USD',\n\t\t'quantity': 0,\n\t});\n\n\treturn products;\n}", "title": "" }, { "docid": "4cf0c3d48f7a8a77bc630e657357d70e", "score": "0.53423935", "text": "function getproducts() {\n $.get(\"/api/products\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createproductRow(data[i]));\n }\n renderproductList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "title": "" }, { "docid": "eb0941427c995fe5d508cea515dade9a", "score": "0.533758", "text": "function appendProducts(products) { \n document.querySelector(\"#products-container\").innerHTML = \"\"\n for (let product of products){\n document.querySelector(\"#products-container\").innerHTML += /*html*/\n `\n <article>\n <img src=\"${product.img}\">\n <h3>${product.model}</h3>\n Brand: ${product.brand}\n Price: ${product.price}\n </article>\n `\n }\n\n // to do\n}", "title": "" }, { "docid": "4b5489caaabc99665fb8223be1a9082c", "score": "0.5337407", "text": "function createProducts(){\n for(var i = 0; i < productNames.length; i++){\n var name = productNames[i];\n var newItem = new Product(name);\n allProducts.push(newItem);\n }\n}", "title": "" }, { "docid": "1c963871105d6b75a021e26887ec6fa7", "score": "0.5334055", "text": "function renderProducts(product) {\n const ul = document.querySelector(\"section.products > ul\");\n\n products.forEach(function(product) {\n const nameLi = document.createElement(\"li\");\n nameLi.innerText = product.name;\n ul.appendChild(nameLi);\n\n const priceLi = document.createElement(\"li\");\n priceLi.innerText = product.price;\n ul.appendChild(priceLi);\n\n const ratingLi = document.createElement(\"li\");\n ratingLi.innerText = product.rating;\n ul.appendChild(ratingLi);\n\n const shipsToLi = document.createElement(\"li\");\n const shippingListUl = document.createElement(\"ul\");\n\n shipsToLi.innerText = product.shipsTo;\n ul.appendChild(shipsToLi);\n const shipingItems = product.shipsTo;\n for (let i = 0; i < product.shipsTo.length; i++) {\n const countryToLi = document.createElement(\"li\");\n countryToLi.innerText = shipingItems[i];\n shippingListUl.appendChild(countryToLi);\n }\n ul.appendChild(shippingListUl)\n });\n return ul;\n}", "title": "" }, { "docid": "d5defac7712eda788210e4c6872afa9e", "score": "0.53239834", "text": "function loadProducts() {\n sendRequest(\"/products/allProducts\", \"GET\", null, null, setProducts);\n}", "title": "" }, { "docid": "b1c26c598e2dc63349764bebaaecc638", "score": "0.53194207", "text": "async getAllBoughtProducts() {\n const inSkillProductList = await this.getProducts();\n if (!inSkillProductList)\n return null;\n const entitledProductList = inSkillProductList.filter(record => record.activeEntitlementCount > 0);\n return entitledProductList;\n }", "title": "" }, { "docid": "584d21408a48b71318833e8743a2a294", "score": "0.5313944", "text": "async _fetchMoreProducts(search) {\n const noProductsFetchedYet = this.products.length === 0;\n const nextProducts = noProductsFetchedYet\n ? await this._fetchProducts(search)\n : await this._fetchNextPage(this.products);\n const nextVariants = productsToVariantsTransformer(nextProducts);\n this.products = uniqBy([...this.products, ...nextProducts], 'id');\n this.variants = sortBy(uniqBy([...this.variants, ...nextVariants], 'id'), ['title', 'sku']);\n\n this.freshSearch = false;\n }", "title": "" }, { "docid": "c052a703d6011be7d01246aec4719d46", "score": "0.53032905", "text": "function updateProductQtd(list, product) {\n let newList = list.map(item => {\n if (item.id == product.id) {\n\n item.qtd = product.qtd;\n return item;\n }\n\n return item;\n });\n\n storageHelper.save('cartProducts', newList);\n return newList;\n }", "title": "" }, { "docid": "c697c4b05fc9cb212caec28a090fac73", "score": "0.529413", "text": "function getProducts() {\n\treturn (dispatch) => {\n\t\tclient.product.fetchAll().then((resp) => {\n\t\t\tdispatch({\n\t\t\t\ttype: PRODUCTS_FOUND,\n\t\t\t\tpayload: resp,\n\t\t\t})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "928b28e5568beb06c703368533866347", "score": "0.52881444", "text": "function Product({products}) {\n\treturn (\n\t\tproducts.map((e, i) => {\n\t\t\treturn (\n\t\t\t<div className=\"product-image-container\" key={i}>\n\t\t\t\t<div className=\"product-image-overlay\">\n\t\t\t\t\t<div>{e.title}</div>\n\t\t\t\t\t<div>Add to cart</div>\n\t\t\t\t</div>\n\t\t\t\t<img alt=\"gif\" src={e.fixed_width_downsampled_url}/>\n\t\t\t</div>\n\t\t\t);\n\t\t})\n\t)\n}", "title": "" }, { "docid": "04988021b74d254c4f109bd2daf06147", "score": "0.5279385", "text": "function addProductsCategories() {\n for (var _i2 = 0, _Object$keys2 = Object.keys(FULL_PRODUCTS); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n FULL_PRODUCTS[k][\"Cat1\"] = types[k].Cat1;\n FULL_PRODUCTS[k][\"Cat2\"] = types[k].Cat2;\n FULL_PRODUCTS[k][\"Cat3\"] = types[k].Cat3;\n }\n}", "title": "" }, { "docid": "c3255bce900c78d34f43d2b8029416bd", "score": "0.52743304", "text": "saleProducts(state) {\n\t\treturn state.products.map(product => {\n\t\t\treturn {\n\t\t\t\tname: '**' + product.name + '**',\n\t\t\t\tprice: product.price / 2,\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "1ca9b6f72c8741f1fa1abc7228ca48c4", "score": "0.52552724", "text": "function addtoBasket(productsList, productId, quantity) {\n let basket = loadBasket();\n let productMatch = productsList.find(product => product.id == productId);\n productMatch.quantity = Number(quantity);\n basket.push(productMatch);\n saveBasket(basket);\n basketCounter.innerHTML = calculateBasketQuantity();\n displayBasket();\n}", "title": "" }, { "docid": "10d956e83cc7bdc417229a9992b5a823", "score": "0.5249993", "text": "async function addProductsToOrderProducts(orderId, productList) {\n try {\n await Promise.all(productList.map(product =>\n createOrderProducts(orderId, product.id, product.quantity, product.currentPrice))\n );\n } catch (error) {\n throw error;\n }\n}", "title": "" }, { "docid": "9dc8e06a62a14e1294a87ce9b53d0809", "score": "0.52453786", "text": "async function populateProductData() {\n // npm install --save axios\n const response = await axios.get('Inventory/GetInventory');\n setProducts(response.data);\n setLoading(false);\n }", "title": "" }, { "docid": "5009f5ecc61981ed3859022ea1f8db4c", "score": "0.5227795", "text": "async getAllProductItems() {\n let content = '';\n try {\n const products = await orinocoApi.apiDatas.allProductItems();\n for (let p = 0; p < products.length; p += 1) {\n const unitPrice = orinocoApi.apiDatas.formatLocaleMoney(\n products[p].price / 100\n );\n content += Home.buildHtmlProduct(products[p], unitPrice);\n }\n } catch (err) {\n console.error(err);\n }\n this.self.innerHTML = content;\n this.addInMyCartClick();\n }", "title": "" }, { "docid": "cced2c81acf27e10be15932ca0e1b0c5", "score": "0.52147895", "text": "async function getProducts () {\n // Initialize product service\n const productService = new ProductService();\n\n // Fetch all products from the api recursively\n const products = await productService.fetchProducts(URLS.PRODUCT_API_URL);\n\n // Filter products so we only have air conditioners\n const airConditioners = productService.filterProducts(products, 'category', 'Air Conditioners');\n\n // calculate individual cubic weight of each product\n const airconditionersWithWeight = productService.calculateCubicWeight(airConditioners);\n \n // get the total average cubic weight of all products\n const averageCubicWeight = totalAverageCubicWeight(airconditionersWithWeight).toFixed(2);\n \n return { products: airconditionersWithWeight, averageCubicWeight }\n}", "title": "" }, { "docid": "a3fdd6ed9b368c1b291e033f22397b08", "score": "0.52064246", "text": "function setProducts(fetchedProducts) {\n fetchedProducts.forEach(element => {\n categories.push(element);\n });\n }", "title": "" }, { "docid": "c0d4ae60f03e827e1297cb6bac8fe9ba", "score": "0.51969504", "text": "function set_product_list()\n{\n c_debug(debug.item, \"=> set_product_list\");\n var vb_product = new Array();\n vb_product.push({\"label\": \"Create new...\", \"value\": \"new\"});\n\n var products_array = products_list.sort(sortArrayByKey({key: 'product_name', string: true}, false) );\n $.each(products_array, function() {\n var key_i = this.product_name;\n var value_i = this.product_abbreviate.toUpperCase();\n // var value_i = \"&#10143; \" + this.product_abbreviate.toUpperCase();\n vb_product.push({\"label\": key_i, \"value\": value_i});\n });\n c_debug(debug.item, \"=> set_product_list: vb_product = \", vb_product);\n\n // id_spinner.setVisible(false);\n var a = new RMP_List();\n a.fromArray(vb_product);\n RMPApplication.setList(\"my_item.vb_product\", a);\n}", "title": "" }, { "docid": "6cec091993679a9b913f6aa43e302a41", "score": "0.5189166", "text": "function updateProducts() {\n var productStorage = JSON.stringify(Product.productArray);\n localStorage.setItem('products', productStorage);\n}", "title": "" }, { "docid": "1692bb8ed40f3c031e7ad4cfa3555c56", "score": "0.518143", "text": "add(product) {\n this._products.push(product);\n }", "title": "" }, { "docid": "1d2149f25db27b2fe353ea3a40aefd5d", "score": "0.5174752", "text": "function renderList(products) {\n\tconst list = `\n ${products.map(product => `<li>${product.name} ${CURRENCY} ${product.price}</li>`).join(' ')}\n `;\n\treturn list;\n}", "title": "" }, { "docid": "76d2ca939afc6171ff3a73f2cbb79a7e", "score": "0.51725113", "text": "function allNewProducts() {\n new Product ('bag', 'img/bag.png');\n new Product ('banana', 'img/banana.jpg');\n new Product ('bathroom', 'img/bathroom.jpg');\n new Product ('boots', 'img/boots.jpg');\n new Product ('breakfast', 'img/breakfast.jpg');\n new Product ('bubblegum', 'img/bubblegum.jpg');\n new Product ('chair', 'img/chair.jpg');\n new Product ('cthulhu', 'img/cthulhu.jpg');\n new Product ('dog duck', 'img/dog-duck.jpg');\n new Product ('dragon', 'img/dragon.jpg');\n new Product ('pen', 'img/pen.jpg');\n new Product ('pet sweep', 'img/pet-sweep.jpg');\n new Product ('scissors', 'img/scissors.jpg');\n new Product ('shark', 'img/shark.jpg');\n new Product ('sweep', 'img/sweep.png');\n new Product ('tauntaun', 'img/tauntaun.jpg');\n new Product ('unicorn', 'img/unicorn.jpg');\n new Product ('usb', 'img/usb.gif');\n new Product ('water can', 'img/water-can.jpg');\n new Product ('wine glass', 'img/wine-glass.jpg');\n}", "title": "" }, { "docid": "26a400811b269ce4026efbbdf39a3afc", "score": "0.51723623", "text": "function addShopToAll() {\n\tfor(var i=0; i<shopData.items.length; i++) {\n\t\t_allItems.push(shopData.items[i]);\n\t}\n}", "title": "" }, { "docid": "e77a7750e0801fda5d6ae7d035b81063", "score": "0.51686335", "text": "function storeProducts() {\n localStorage.setItem('products', JSON.stringify(Product.allProducts));\n}", "title": "" }, { "docid": "f39a5641c47a6af710794335e64da647", "score": "0.5162392", "text": "async function insertProductsUpdateOnDuplicate(ProductClass, dataList) {\n // return Promise.all(__.map(dataList, data => {\n // insertProductUpdateOnDuplicate(ProductClass, data);\n // }));\n var productModels = [];\n\n for (var i = 0; i < dataList.length; i++) {\n var data = dataList[i];\n productModels.push(await insertProductUpdateOnDuplicate(ProductClass, data));\n }\n\n return productModels;\n}", "title": "" }, { "docid": "051d83e5e82550d15c221de49612d63f", "score": "0.5160469", "text": "function simplify (data) {\n var productlist = [];\n data.d.results.forEach(element => {\n var product = {\n 'ProductID' : element.ProductID,\n 'Category' : element.Category,\n 'Name': element.Name,\n 'Description' : element.Description,\n }\n\n productlist.push (product);\n });\n\n return productlist;\n\n}", "title": "" }, { "docid": "358984a73eff78b0b63dfc209aaca4aa", "score": "0.5158758", "text": "function getProduct() {\n const item = products.filter(result =>\n result._id === id);\n prodID = item[0].productID;\n setProduct(item);\n\n }", "title": "" }, { "docid": "052cfe00789995ea40f23cb5561eba5d", "score": "0.5156783", "text": "function loadProducts() {\n API.getProducts()\n .then(products => {\n setId(window.location.href.split(\"/\").pop());\n setProducts(products);\n getProduct();\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "258242c4e6c47d0a63d84708e988ab2a", "score": "0.5153122", "text": "function setBundleProducts(product, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.includeFields, includeFields = _c === void 0 ? null : _c, _d = _b.excludeFields, excludeFields = _d === void 0 ? null : _d;\n return __awaiter(this, void 0, void 0, function () {\n var skus, query, items, _e, _f, bundleOption, _loop_1, _g, _h, productLink, _j, price, priceInclTax;\n var e_1, _k, e_2, _l;\n return __generator(this, function (_m) {\n switch (_m.label) {\n case 0:\n if (!(Object(___WEBPACK_IMPORTED_MODULE_4__[\"isBundleProduct\"])(product) && product.bundle_options)) return [3 /*break*/, 2];\n skus = product.bundle_options\n .map(function (bundleOption) { return bundleOption.product_links.map(function (productLink) { return productLink.sku; }); })\n .reduce(function (acc, next) { return acc.concat(next); }, []);\n query = Object(_buildQuery__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(skus);\n return [4 /*yield*/, _vue_storefront_core_data_resolver_ProductService__WEBPACK_IMPORTED_MODULE_5__[\"ProductService\"].getProducts({\n query: query,\n excludeFields: excludeFields,\n includeFields: includeFields,\n options: {\n prefetchGroupProducts: false,\n fallbackToDefaultWhenNoAvailable: false,\n setProductErrors: false,\n setConfigurableProductOptions: false,\n assignProductConfiguration: false,\n separateSelectedVariant: false\n }\n })];\n case 1:\n items = (_m.sent()).items;\n _hooks__WEBPACK_IMPORTED_MODULE_6__[\"catalogHooksExecutors\"].afterSetBundleProducts(items);\n try {\n for (_e = __values(product.bundle_options), _f = _e.next(); !_f.done; _f = _e.next()) {\n bundleOption = _f.value;\n _loop_1 = function (productLink) {\n var associatedProduct = items.find(function (associatedProduct) { return associatedProduct.sku === productLink.sku; });\n Object(_setProductLink__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(productLink, associatedProduct);\n };\n try {\n for (_g = (e_2 = void 0, __values(bundleOption.product_links)), _h = _g.next(); !_h.done; _h = _g.next()) {\n productLink = _h.value;\n _loop_1(productLink);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_l = _g.return)) _l.call(_g);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_k = _e.return)) _k.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (config__WEBPACK_IMPORTED_MODULE_0__.products.calculateBundlePriceByOptions) {\n _j = Object(_getBundleProductPrice__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(product), price = _j.price, priceInclTax = _j.priceInclTax;\n product.price = price;\n product.priceInclTax = priceInclTax;\n product.price_incl_tax = priceInclTax;\n }\n _m.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "a5146241549f9ffce65a5113a03eb889", "score": "0.51492", "text": "function listProducts() {\n\tconnection.query('SELECT ItemID, ProductName, Price, StockQuantity FROM products', function(err, rows, fields) {\n\t\tif(err) throw err;\n\t\tconsole.log('Available products for sale:');\n\t\tshowSelectedProducts(rows);\n\t});\n\tconnection.end();\n}", "title": "" }, { "docid": "3b6386587adb6819cdd37085ad2390f0", "score": "0.51457316", "text": "renderProducts() {\n this.products.forEach( ( product ) => {\n product.render();\n } );\n }", "title": "" }, { "docid": "40b150efbf15f5fb7f707fb4519201f1", "score": "0.514141", "text": "function getProductsData() {\r\n var data = [];\r\n\r\n try {\r\n for (const p of productsFromLocalStorage) {\r\n var id = p.id;\r\n var name = p.name;\r\n var description = p.description;\r\n var variant;\r\n var variant_options = [];\r\n var prices = [];\r\n var images = [];\r\n var categories = [];\r\n\r\n for (const s of skusFromLocalStorage) {\r\n if (s.product_id == id) {\r\n prices.push(s.price);\r\n variant_options.push(s);\r\n variant = s.variant;\r\n }\r\n }\r\n\r\n for (const i of imagesFromLocalStorage) {\r\n if (i.product_id == id) {\r\n images.push(i.link);\r\n }\r\n }\r\n\r\n for (const cp of categories_productFromLocalStorage) {\r\n if (cp.product_id == id) {\r\n for (const category of categoriesFromLocalStorage) {\r\n if (cp.category_id == category.id) {\r\n categories.push(category.name);\r\n }\r\n }\r\n }\r\n }\r\n\r\n var d = {\r\n id: id,\r\n name: name,\r\n description: description,\r\n variant: variant,\r\n variant_options: variant_options,\r\n price: Math.min(...prices),\r\n image: images[0],\r\n categories: categories,\r\n };\r\n\r\n data.push(d);\r\n }\r\n } catch (e) {\r\n alert(e);\r\n }\r\n\r\n return data;\r\n}", "title": "" }, { "docid": "52a55a684f24064ef860bccc7e4b62bf", "score": "0.5138887", "text": "function mapProducts(data) {\n let response = {\n offset: 0,\n count: data.rowCount,\n total: data.totalSize\n };\n let results = []; \n let variants = [];\n let variant = {\n id: '1234',\n sku: 'sku',\n name: {\n en: 'A localized EN name'\n }\n }\n variants.push(variant);\n data.rows.forEach(row => {\n let result = {\n name: {},\n categories: [{id: 'category-id'}]\n };\n result.id = row.values[0];\n result.name.en = row.values[1];\n result.variants = variants;\n result.masterVariantId = variant.id;\n results.push(result);\n });\n \n response.results = results;\n return response;\n}", "title": "" }, { "docid": "f8334bf925a1c1eb82de65b52472592b", "score": "0.5136326", "text": "function loadAll() {\n var allProducts = 'Chair, Computer, Desktop, Monitor, Optical Mouse, Table, Wireless Keyboard';\n\n return allProducts.split(/, +/g).map( function (product) {\n return {\n value: product.toLowerCase(),\n display: product\n };\n });\n }", "title": "" }, { "docid": "e827368ef2a8f6d41739c47052752033", "score": "0.51083916", "text": "async getAllAvailabeProducts() {\n const inSkillProductList = await this.getProducts();\n if (!inSkillProductList)\n return null;\n const entitledProductList = inSkillProductList.filter(record => record.entitled === 'NOT_ENTITLED' && record.purchasable === 'PURCHASABLE');\n return entitledProductList;\n }", "title": "" }, { "docid": "b8d8c8a39821e42f7774e0ec4ffdb8c1", "score": "0.50987846", "text": "function dataList(productList){\n\tvar innerElements = productList.map((product)=> {\n\t\treturn ' <option data-value=\"'+product.id+'\"value=\"'+product.name+'\">'+product.price+'</option>';\n\t});\n\n\t$('#products').html(innerElements.join('')) ;\n}", "title": "" }, { "docid": "221534f734c189943acc7565e6fd996c", "score": "0.50983936", "text": "addProduct(product) {\n this.products.push(product);\n this.products.sort();\n }", "title": "" }, { "docid": "17e828032730b1d70d5f15f033dd1e97", "score": "0.50968796", "text": "getInitialProducts() {\n getProducts(this.state.page, this.state.limit).then((response) => {\n this.setState((prevState, prevProps) => ({\n products: response.data,\n page: prevState.page + 1\n }));\n this.prefetchProducts();\n });\n }", "title": "" }, { "docid": "bfba853cfcf063ecd3f606b83806e2cb", "score": "0.50959665", "text": "constructor() {\n this.addedProducts = [];\n }", "title": "" }, { "docid": "d375a1b42bbbc7de5f68d0a9d2a4a00c", "score": "0.5095911", "text": "function retornarProductos(data) {\n let productos = [];\n data.customer.purchases.forEach(purchase => {\n purchase.products.forEach(product => {\n const prod = productos.find(p => p.sku == product.sku);\n if (prod == undefined) {\n productos.push({ sku: product.sku, name: product.name, dates: [purchase.date] })\n } else {\n prod.dates.push(purchase.date);\n }\n });\n });\n return productos;\n}", "title": "" }, { "docid": "40d835a557017dd2092f8a3e0eb28593", "score": "0.50918883", "text": "function getProducts() {\n $.get(\"/api/4products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "2ce2c43aefe38ab9b965a9c5d82d932a", "score": "0.5088429", "text": "function getProductsOnSale(){\n IndexService.getProductsOnSale().then(function (data) {\n vm.productOnSale = data;\n });\n }", "title": "" }, { "docid": "388ddb5a0cbc9197203073aced74edd2", "score": "0.50867534", "text": "function getProducts(res) {\n\tvar products = [];\n\t\n\tfor(var i=0; i< res.length; i++){\n\t\tproducts.push(`${res[i].item_id}. ${res[i].product_name}`);\n\t}\n\treturn products;\n}", "title": "" }, { "docid": "d4da6bf10aed4fdc781d75b6b8923f5e", "score": "0.50800925", "text": "function findAllProductCallback(data) {\n var all = { identifier: \"\", name: \"All\" };\n $scope.products = [all];\n\n data.forEach(function (d) {\n $scope.products.push(d);\n });\n\n $scope.productsReady = true;\n }", "title": "" }, { "docid": "92bddf81991dcb0d2ec73facba26cc72", "score": "0.50798345", "text": "static fetchAll(){\n return products;\n }", "title": "" }, { "docid": "12bbb4cbcc3eb4ff2d24fc3787d9077b", "score": "0.50780827", "text": "function newProduct(){\r\n var newProduct = [];\r\n }", "title": "" }, { "docid": "df0fa4b4e3cca280b34e5f89171fea20", "score": "0.5072125", "text": "function setupProducts() {\n var picsAsString = localStorage.getItem('three-pics');\n var usablePics = JSON.parse(picsAsString);\n if (usablePics && usablePics.length) {\n Product.allProducts = usablePics;\n console.log('Loaded from local storage');\n return;\n }\n\n console.log('Doing it the hard way');\n\n new Product('image/bag.jpg', 'Bag');\n new Product('image/banana.jpg', 'Banana');\n new Product('image/bathroom.jpg', 'Bathroom');\n new Product('image/boots.jpg', 'Boots');\n new Product('image/breakfast.jpg', 'Breakfast');\n new Product('image/bubblegum.jpg', 'Bubblegum');\n new Product('image/chair.jpg', 'Chair');\n new Product('image/cthulhu.jpg', 'Cthulu');\n new Product('image/dog-duck.jpg', 'Dog Duck');\n new Product('image/dragon.jpg', 'Dragon');\n new Product('image/pen.jpg', 'Pen');\n new Product('image/pet-sweep.jpg', 'Pet Sweep');\n new Product('image/scissors.jpg', 'Scissors');\n new Product('image/shark.jpg', 'Shark');\n new Product('image/sweep.png', 'Sweep');\n new Product('image/tauntaun.jpg', 'Tauntaun');\n new Product('image/unicorn.jpg', 'Unicorn');\n new Product('image/usb.gif', 'USB');\n new Product('image/water-can.jpg', 'Water Can');\n new Product('image/wine-glass.jpg', 'Wine Glass');\n}", "title": "" }, { "docid": "f6910fa0af5aab481e7ee478a015b2a0", "score": "0.50715923", "text": "function getProducts() {\n $.get(\"/api/5products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "6ce3e387853f644085c8a303ba8f5266", "score": "0.50653046", "text": "async getProducts() {\n this.loading = true;\n try {\n const { search, sort: sort_direction, sort_field, page} = this.productOptions;\n const {data: items , ...pagination} = await productService.list({\n search, \n sort_direction, \n sort_field,\n page,\n });\n\n this.pagination.props = pagination;\n this.products.props = {\n ...this.products.props,\n items,\n };\n } catch (e) {\n if (e.response && e.response.status === 404) {\n this.products.error = e.response.data;\n this.pagination.props = this.freshPagination().props;\n }\n } finally {\n this.loading = false;\n }\n }", "title": "" }, { "docid": "169b7fcf84d610120b793e4bcb6d80b8", "score": "0.5060482", "text": "function getProducts(store) {\n return store.getIn(['configuration', 'products']).toList().toArray();\n}", "title": "" }, { "docid": "9fd25abc3b4cd1602c425624c0f9dcbb", "score": "0.5049765", "text": "function sqr_products_to_sql(products) {\n\t//define local variables\n\tvar idProductsList = {};\n\n\t//iterate through all the products\n\tproducts.forEach(function(product) {\n\t\t//define local variables\n\n\t\t//iterate through all variations\n\t\tproduct.variations.forEach(function(variation) {\n\n\t\t\tconsole.log(product.name + \" \" + variation.name);\n\n\t\t\t//add the product id to the object\n\t\t\tidProductsList[variation.id] = {\n\t\t\t\tparentId: variation.item_id,\n\t\t\t\tname: product.name + \" \" + variation.name,\n\t\t\t\tcategory: products_value_map_category(product, variation),\n\t\t\t\tsku: products_value_map_sku(product, variation),\n\t\t\t\tnut: products_value_map_nut(product, variation),\n\t\t\t\tflavor: products_value_map_flavor(product, variation),\n\t\t\t\toz: products_value_map_oz(product, variation),\n\t\t\t\tpkg_size: products_value_map_pkg_size(product, variation),\n\t\t\t\tpkg_shape: products_value_map_pkg_shape(product, variation),\n\t\t\t\tCOG: products_value_map_COG(product, variation),\n\t\t\t\tretail: products_value_map_retail(product, variation),\n\t\t\t\twholesale: products_value_map_wholesale(product, variation)\n\t\t\t};\n\n\t\t});\n\n\t});\n\n\treturn idProductsList;\n}", "title": "" }, { "docid": "60d8d57276febebdce3ffeb995d95cca", "score": "0.50469977", "text": "loadImages() {\n\n\t\tvar ids = [];\n\n\t\tthis.products.results.map(p => {\n\t\t\tids.push(p.id);\n\t\t});\n\n\t\tthis.productsSvc.getProductPictures(ids.join(\",\")).then(products => {\n\n\t\t\tthis.products.results.map(p => {\n\t\t\t\tlet product_with_image = products.data.filter(o => {\n\t\t\t\t\treturn o.id === p.id;\n\t\t\t\t});\n\t\t\t\tif (product_with_image && product_with_image[0].pictures.length) {\n\t\t\t\t\tp.image = product_with_image[0].pictures[0].secure_url;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" } ]
b2625aa83da73351e374ab108ba16905
Load image to browser and reload the maze
[ { "docid": "fbafe81650afc028aaf23da51d9548b8", "score": "0.71844655", "text": "function _loadImg(img) {\n let temp = new Image();\n temp.onload = function () {\n document.getElementById('img').src = img;\n doMaze();\n };\n temp.src = img;\n}", "title": "" } ]
[ { "docid": "59f7ba55a597e0c977cbe4a22c0860a9", "score": "0.7032885", "text": "function reload() {\n stop();\n\n // Place the image\n img = new Image();\n img.onload = imageReady;\n img.src = src;\n }", "title": "" }, { "docid": "a10f0daa6f94f54d37d2e78c94ece2b1", "score": "0.6304127", "text": "function initMaze() {\n mazeAnimator = null;\n document.getElementById('playAnim').disabled = true;\n document.getElementById('stopAnim').disabled = true;\n let img = document.getElementById('img');\n\n //Create temporary canvas that we use to extract image data\n let tempCanvas = document.createElement('canvas');\n tempCanvas.width = img.width;\n tempCanvas.height = img.height;\n let tCtx = tempCanvas.getContext('2d');\n tCtx.width = tempCanvas.width;\n tCtx.height = tempCanvas.height;\n tCtx.drawImage(img, 0, 0);\n let imgData = tCtx.getImageData(0, 0, img.width, img.height);\n\n let temp = [];\n //White = 1 = pathway\n //Black = 0 = wall\n for (let i = 0; i < imgData.data.length; i += 4) {\n if (imgData.data[i] === 255) {\n temp.push(1);\n } else {\n temp.push(0);\n }\n }\n\n //Update the renderer size\n animCanvas.Height = img.height;\n animCanvas.Width = img.width;\n mainCanvas.Height = img.height;\n mainCanvas.Width = img.width;\n\n //Create a node data array\n let temp2 = [];\n for (let y = 0; y < img.height; y++) {\n let t = [];\n for (let x = 0; x < img.width; x++) {\n let s = temp[y * img.width + x];\n t.push(s);\n }\n temp2.push(t);\n }\n mazeBlockData = temp2;\n\n SNW.maze.allowEdit = true;\n}", "title": "" }, { "docid": "3de16725aa2857e722404dd7879a343e", "score": "0.61855936", "text": "function newImage() { \n window.location.reload();\n}", "title": "" }, { "docid": "123ead4bbab8f1796c89933f074c1a50", "score": "0.6145191", "text": "function changeDiagramImage(imageURL) {\r\n\t$(\"#diagram\").one(\"load\", function() {\r\n\t\trenderHilighting();\r\n\t\tinitializeMapHighlights();\r\n\t}).attr(\"src\", imageURL);\r\n}", "title": "" }, { "docid": "1f2d058ea9305b5fdd370fa7b8051553", "score": "0.6120549", "text": "function refresh(){\n\twindow.location.href = \"mathMaze.html\";\n}", "title": "" }, { "docid": "dd3cbde95cb31be9aa780dac0b62a2e0", "score": "0.6103166", "text": "function mazeRandom()\r\n{\r\n var random = Math.floor((Math.random()*6)) + 1;\r\n $(\"#maze\").html(\"<img src=\\\"maze\" + random + \".png\\\" height=\\\"200\\\">\");\r\n $(\"body\").pagecontainer( \"change\", \"#play\" );\r\n}", "title": "" }, { "docid": "ed6c1766b0e78cbae24cb64aba9213e0", "score": "0.60256886", "text": "function cambiarImg(url){\n mainImg.src=url\n}", "title": "" }, { "docid": "64e4eaf7b67ac68669633f1cd2711124", "score": "0.59472716", "text": "function takeSnapshot()\n {\n page.open(url, function () {\n page.render(dirPath + imgName + '.' + imgFormat);\n obj.stop();\n });\n }", "title": "" }, { "docid": "117ec878c0b2aacf66858cc449532179", "score": "0.59295183", "text": "function setPage()\n{\n //set the action bar to say \"Start the Maze\"\n document.getElementById(\"action\").innerHTML = loadHTML;\n\n //the canvas needs to be set to the right size\n //before the spot is initialized, or it will misbehave.\n //So this once, these values get initialized twice.\n var canvas = document.getElementById(\"canvas\");\n canvas.height = CANVAS_HEIGHT;\n canvas.width = CANVAS_WIDTH;\n\n //The starting location is intialized here.\n //This can't be done when it is defined as a global.\n\n //The spot is in reference to the GRID LINES\n //the actual line is drawn halfway in the middle of the square.\n //This makes obstacle comparisons easier.\n //Notice, I subtract half an interval \n //so it doesn't start off the edge.\n spot = [ 0, canvas.height/INTERVAL - 1/2 , \"up\", \"stopped\" ];\n\n animate_string('title');\n drawGrid();\n //loadSample();\n\t\n\tsample = getQueryVariable(\"sample\");\n\tif(sample!=null)\n\t{\n\t\tsampleFile(sample)\n\t}\n\telse\n\t{\n\t\tsampleFile(1);\n\t}\n}", "title": "" }, { "docid": "ccd58e0c6adcae93ff2a5ad82b4a05e2", "score": "0.58517313", "text": "function imageLoadingDoneSoStartGame() {\n p1.boatReset();\n p2.boatReset();\n setUpInput();\n\n // track.js\n loadLevel(trackGrid);\n\n var framesPerSecond = 30;\n setInterval(updateAll, 1000 / framesPerSecond);\n}", "title": "" }, { "docid": "d07427601fd5f3c7f8f82c666054bedc", "score": "0.5824233", "text": "reloadImage() {\n this.getInstance().reloadImage();\n }", "title": "" }, { "docid": "ffc7816ae451b50a8ce0783813af182b", "score": "0.58017564", "text": "function refreshMaze(){\n\t\t\tvar maze = model.maze();\n\t\t\tmodel.maze( [] );\n\t\t\tmodel.maze( maze );\n\t\t}", "title": "" }, { "docid": "4c683877dca862324e26ee984e57a17f", "score": "0.5799814", "text": "function saveImage() {\n glmol01.show();\n var imageURI = glmol01.renderer.domElement.toDataURL(\"image/png\");\n window.open(imageURI);\n}", "title": "" }, { "docid": "0e0bb0eddebd561ee1b000f0cfd07a38", "score": "0.5766638", "text": "function refreshMaps() {\n $timeout(function () {\n $('img').unveil(500);\n }, 0);\n }", "title": "" }, { "docid": "fd01aaa10ed65d825c057eb2b485ac29", "score": "0.5748923", "text": "function selectImage() {\n let imgSel = document.getElementById('imgSel');\n let img = imgSel[imgSel.selectedIndex].label;\n _loadImg('mazes/maze-' + img + '.png');\n}", "title": "" }, { "docid": "d62092c84cc86c3b64cf5f701f2c9d83", "score": "0.57410127", "text": "function refresh() {\r\n\t var tmp = new Date();\r\n\t var img = document.getElementById(\"cam\");\r\n\t img.src = img.src + '?' + tmp.getTime();\r\n\t}", "title": "" }, { "docid": "f7c85d0021b90eb4b8e005c72e27c169", "score": "0.5680847", "text": "function generateNaiveMaze(e) {\n cancelPathfinding();\n offScreenCTX.fillStyle = \"black\";\n offScreenCTX.clearRect(0,0,offScreenCVS.width,offScreenCVS.height);\n let imageData = offScreenCTX.getImageData(0,0,offScreenCVS.width,offScreenCVS.height);\n let cells = [];\n for (let y = 0; y < imageData.height; y++) {\n if (y%2 === 1) {\n continue;\n }\n cells[y] = [];\n for (let x = 0; x < imageData.width; x++) {\n if (x%2 === 1) {\n continue;\n }\n cells[y][x] = {x: x, y: y}\n }\n }\n //draw\n function drawMaze1() {\n cells.forEach(r => {\n r.forEach(c => {\n offScreenCTX.fillRect(c.x,c.y,1,1);\n })\n })\n source = offScreenCVS.toDataURL();\n renderImage();\n window.setTimeout(drawMaze2, delaySlider.value)\n }\n function drawMaze2() {\n cells.forEach(r => {\n r.forEach(c => {\n let rand = [[0,1],[0,-1],[1,0],[-1,0]];\n let randC = rand[Math.floor(Math.random() * 4)];\n offScreenCTX.fillRect(c.x+randC[0],c.y+randC[1],1,1);\n })\n })\n source = offScreenCVS.toDataURL();\n renderImage();\n }\n drawMaze1();\n}", "title": "" }, { "docid": "02ccd640f60ea6451dd6901d1af87ec1", "score": "0.5633719", "text": "function preload(){\n\timg= loadImage(\"tree.png\");\n}", "title": "" }, { "docid": "0433a34a69d2b4509050d5860932dd71", "score": "0.5633064", "text": "function moveCamera(move) {\n var cmd = \"cgi-bin/ui_live.cgi?cmd=motor&move=\" + move;\n $.get(cmd);\n setTimeout(refreshLiveImage, 500);\n}", "title": "" }, { "docid": "2a010f5a4ca0838b83dc5d212d847793", "score": "0.5631014", "text": "function preload(){\n \n renardVisage = loadImage(\"fox.PNG\");\n \n}", "title": "" }, { "docid": "9704a27b592255a4519de21861c55b60", "score": "0.5624153", "text": "function load()\n{\n dashcode.setupParts();\n\n setTimeout(function () { updateGEISPhoto(); }, 1000);\n}", "title": "" }, { "docid": "d2b7385ef59ed8f1e03b4d830d54f097", "score": "0.55987746", "text": "function refreshPage() {\n document.getElementsByTagName('body')[0].style.background = \"grey\";\n dimensions();\n imageMode(CORNER);\n image(performances, perfX, perfY, perfWidth, perfHeight);\n image(conversations, convX, convY, convWidth, convHeight);\n image(make, makeX, makeY, makeWidth, makeHeight);\n image(info, infoX, infoY, infoWidth, infoHeight);\n image(boxOfficeImage, 0, 0, width, height);\n}", "title": "" }, { "docid": "754158fb3433e604cd50e6b87218f131", "score": "0.55939513", "text": "async reloadImage(force = true) {\n this.setState({currentTileImg: await this.getCurrentTileImage(force)});\n }", "title": "" }, { "docid": "14779e149ff0cfb2e4a4382264e66a11", "score": "0.5572094", "text": "function load() {\n var list = [\n // map view images\n 'images/map/map.png',\n 'images/map/heightmap.png',\n 'images/map/areas.png',\n\n // item view images\n 'images/ui/details-icon-fav.png',\n 'images/ui/details-icon-fav-dark.png',\n 'images/ui/details-icon-link.png',\n\n // favorites view\n 'images/ui/favorites-empty-msg.png',\n\n // favorites and tags view\n 'images/ui/pagination-next-btn.jpg',\n 'images/ui/pagination-previous-btn.jpg'\n ];\n\n // add all images from the thumbs used in TunnelView\n var tunnelItemsData = appModel.getTunnelItemsData();\n\n tunnelItemsData.forEach(function(item) {\n list.push(item.thumbUrl);\n });\n list.forEach(function(item) {\n // the images will be cached.\n textures[item] = new THREE.TextureLoader(manager).load(item);\n });\n }", "title": "" }, { "docid": "e7efe459c21512943de9f53d726757d1", "score": "0.5568485", "text": "function updateGEISPhoto()\n{\n var image = new Image();\n image.src = '/Users/dnewell/dev/geis-wallpaper/wallpaper.png?' + new Date().getTime();\n document.getElementById(\"geisWallpaper\").src = image.src;\n}", "title": "" }, { "docid": "444c7243bb5993fc3a4e9d26d57d5764", "score": "0.55451614", "text": "function updateImage() {\n document.querySelector(\"#image\").src = image;\n}", "title": "" }, { "docid": "107de513eb90349ee733f67624613ddd", "score": "0.55378026", "text": "function dynamicLoadImage() {\n const image = new Image();\n image.src= \"space-ship.min.png\";\n const context = makeContext('dynamic-image-canvas');\n context.drawImage(image, 100, 100);\n}", "title": "" }, { "docid": "94cdbf903e4e67f60ea076d9945f7a14", "score": "0.55353594", "text": "function newGame(){\n\n\t\t//reload the web-page from the source (!from cash)\n\t\tlocation.reload(true);\n\t}", "title": "" }, { "docid": "c8d0ffb4e58bd7726260da13de37efc5", "score": "0.55160123", "text": "function load() {\n var image = new Image();\n image.onload = end;\n image.onerror = error;\n image.src = uri;\n }", "title": "" }, { "docid": "fc821626fd38b07f26a7231802542d1c", "score": "0.5499748", "text": "function drawMap() {\n if (mapGraphic == null) {\n for (var i = 0; i < gamemap.cols; i++) {\n for (var j = 0; j < gamemap.rows; j++) {\n if (gamemap.grid[i][j].wall) {\n gamemap.grid[i][j].show(color(255));\n }\n }\n }\n //grabs image from the maze generation algorithm\n mapGraphic = get(gamemap.x, gamemap.y, gamemap.w, gamemap.h);\n }\n image(mapGraphic, gamemap.x, gamemap.y);\n}", "title": "" }, { "docid": "ab564fae71dbc9eda5fde7419a0d324e", "score": "0.54991466", "text": "function loadPicture() {\n document.body.removeChild(document.getElementById('grid'));\n var loadArray = state;\n var picGrid = _gridMaker(rows, cols, loadArray);\n }", "title": "" }, { "docid": "705c3cd5a2c9b24b511612b79ba7e367", "score": "0.5475891", "text": "function setup() {//setup: makes the canvas\n createCanvas(400, 400); //a p5 only function\n //img = loadImage(\"https://www.pixilart.com/images/art/6cb07882c773d2c.png?v=1541820224\"); this did not work\n steps = 0;\n cols = floor(width/d); //width of the canvas divided by the width equals number of columns: number of square cells at the top/same for height\n rows = floor(height/d); //floor deals with math, makes the console know we are dealing with intergers, numbers are integers\n frameRate(-400)//how fast the maze is generated\n\n for (var r = 0; r < rows; r++) { //row generator\n for (var c = 0; c < cols; c++) { //column generator\n var cell = new Cell(c,r);\n grid.push(cell);\n }\n }\n current = grid[0]; //current cell visited starts at the top of the grid (origin, which is point 0)\n knight = grid[0]; //same for knight\n relic = grid[index(15,15)]; //the relic is found at the bottom right of the grid\n}", "title": "" }, { "docid": "86a3ffaf3ab6960159a9b82444b06027", "score": "0.5474534", "text": "function preload(){\n img = loadImage(\"gnome.jpg\") // Change the image here\n}", "title": "" }, { "docid": "0193d2dcee21598c704620108f984a85", "score": "0.54580396", "text": "function download_img(url) {\n\n\tvar image = new Image;\n\n\timage.onload = function() {\n\t\t$(\"#anatomy-map #img\").empty();\n\t\t$(\"#anatomy-map #img\").append(image);\n\t};\n\n\timage.src = url;\n}", "title": "" }, { "docid": "96fc6f599de4fe4befa5a22f3132874a", "score": "0.5455591", "text": "function showPlot() {\n let plotContainer = document.getElementById(\"plot\");\n let plot = new Image();\n\n fetch(\"./img/plot.png\")\n .then(function(response) {\n plot.src = \"./img/plot.png\"\n plotContainer.appendChild(plot)\n })\n}", "title": "" }, { "docid": "1780219639bd04ba89743aab8b7996a3", "score": "0.54386777", "text": "function reload() {\n var slides = document.getElementById(\"image-slides\");\n var target = Math.round(Math.random(slides) * 4) + 1;\n slides.src = `material/images/${target}.png`;\n}", "title": "" }, { "docid": "44b0d7b6ee508dae70365b2b4ba2df51", "score": "0.5417733", "text": "function updateExplorer(newImg) {\n explorer.visible = false;\n\n var oldExplorerX = explorer.x;\n var oldExplorerY = explorer.y;\n var oldExplorerVy = explorer.vy;\n var oldExplorerVx = explorer.vx;\n\n explorer = new Sprite(resources[newImg].texture);\n explorer.x = oldExplorerX;\n explorer.y = oldExplorerY;\n explorer.vx = oldExplorerVx;\n explorer.vy = oldExplorerVy;\n explorer.width = PLAYER_WIDTH;\n explorer.height = PLAYER_HEIGHT;\n gameScene.addChild(explorer);\n}", "title": "" }, { "docid": "145800fee5ed38bb5d635158c21659e8", "score": "0.54157543", "text": "reload() {\n this.imageData=\n this.ctx.getImageData(\n 0, 0,\n this.$canvas.width, this.$canvas.height\n );\n }", "title": "" }, { "docid": "86d7c8d07ba9639a6a20379f077e311d", "score": "0.5403042", "text": "function updateImage() {\n const dog = document.querySelector('#dog')\n dog.src = dogURL;\n}", "title": "" }, { "docid": "b04c45942527d8aa95213febaf7ccd24", "score": "0.53996897", "text": "function showMapsPage() {\n\n road_arrow = new Image();\n road_arrow.src = \"images/arrow.png\";\n road_arrow.onload = function () {\n setUpCanvas();\n\n getCarPark(carParkName);\n\n }\n\n}", "title": "" }, { "docid": "e91372f447b4061a820b42730db1ca82", "score": "0.5390936", "text": "function dankMeme() {\n $(\"img.output\").attr(\"src\", \"\");\n oReq = new XMLHttpRequest();\n oReq.open(\"post\", '/parrotify.gif', true);\n oReq.responseType = \"blob\";\n oReq.onload = function (e) {\n var blob = oReq.response;\n var urlCreator = window.URL || window.webkitURL;\n var imgSrc = urlCreator.createObjectURL(blob);\n output.attr(\"src\", imgSrc);\n };\n oReq.send(new FormData(form));\n}", "title": "" }, { "docid": "f519de71f28d1c3766da2a7f4da1f55e", "score": "0.5387912", "text": "function renderImage() {\n img.onload = () => {\n //Prevent blurring\n onScreenCTX.imageSmoothingEnabled = false;\n onScreenCTX.clearRect(0,0,onScreenCVS.width/scale,onScreenCVS.height/scale);\n onScreenCTX.drawImage(img,0,0,onScreenCVS.width/scale,onScreenCVS.height/scale)\n onScreenCTX.fillStyle = \"black\";\n generateMap();\n if (mapNodes) {\n freeTiles.forEach(n => {\n onScreenCTX.fillStyle = \"rgb(196, 188, 178)\";\n onScreenCTX.fillRect(n.x*tileSize+0.5,n.y*tileSize+0.5,tileSize-1,tileSize-1);\n })\n }\n }\n img.src = source;\n}", "title": "" }, { "docid": "499c6321ff0216a77f9d75736ad445d0", "score": "0.5387777", "text": "function print_maze(a) {\n\t//console.log(\"csz : \" + csz + \", wsz : \" + wsz);\n var i, j;\n\tvar maze = document.querySelector('#maze');\n\t\n\t// Vider la div maze\n\twhile (maze.hasChildNodes()) {\n\t\tmaze.removeChild(maze.lastChild);\n\t};\n\t\n\t\n\t\n\t/*\n\t\n\tdocument.getElementById('vie').innerHTML = '';\n\tfor(var i=1;i<dim+3;i++)\n\t{\n\t\tvar div = document.createElement('img');\n\t\t\tdiv.setAttribute('id','vie'+i);\n\t\t\tdiv.setAttribute('src','img/bad.png');\n\t\t\tdocument.getElementById('vie').appendChild(div);\n\t}\n\tvar chemin = 'img/missile_off.png';\n\tvar pos = dim+4;\n\tdiv.setAttribute('id','vie'+pos);\n\tdiv.setAttribute('src',chemin);\n\tdocument.getElementById('vie').appendChild(div);\n\t\n\tvar chemin = 'img/bombe_off.png';\n\tvar pos = dim+5;\n\tdiv.setAttribute('id','vie'+pos);\n\tdiv.setAttribute('src',chemin);\n\tdocument.getElementById('vie').appendChild(div);\n\t\n\t*/\n\t\n\t\n\t// Appliquer au labyrinthe des styles selon les paramètres entrés par l'utilisateur\n\tmaze.setAttribute('style', 'width:' + (csz * (a[0].length)) + 'px; height:' + (csz * a.length) + 'px; left:0;');\n\tmaze.setAttribute('class','maze');\n\tfor (i = 0; i < a.length; i++) {\n\t\tfor (j = 0; j < a[i].length; j++) {\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.setAttribute('id',i + \"_\" + j);\n\t\t\tdiv.setAttribute('class','cell ' + css_cell_code(a[i][j]) );\n\t\t\tdiv.setAttribute('style', ' top:'+ (csz * i) + '; left:' + (csz * j) + '; width:'+csz+'px; height:'+csz+'px;\tbackground-color:#ffffff;');\n\t\t\tmaze.appendChild(div);\n\t\t}\n\t}\n\t\n\t//document.getElementById(0+'_'+5).style.background = '#ffffff';\n\t\n\twhile(compteBonus < dim*(3))\n\t{\n\t\t\tvar posX = Math.floor(Math.random() * (dim));\n\t\t\tvar posY = Math.floor(Math.random() * (dim));\n\t\t\tconsole.log(posX,'+',posY);\n\t\t\tif(document.getElementById(posX + \"_\" + posY).innerHTML == '')\n\t\t\t{\n\t\t\t\tdocument.getElementById(posX + \"_\" + posY).innerHTML = '<img src=\"img/piece.png\" style=\"margin-top:10px;margin-left:5px;\">'\n\t\t\t\tcompteBonus++;\n\t\t\t}\n\t\t\n\t}\n\t\n\twhile(compteTemps < (dim / 3))\n\t{\n\t\t\tvar posX = Math.floor(Math.random() * (dim));\n\t\t\tvar posY = Math.floor(Math.random() * (dim));\n\t\t\tconsole.log(posX,'+',posY);\n\t\t\tif(document.getElementById(posX + \"_\" + posY).innerHTML == '')\n\t\t\t{\n\t\t\t\tdocument.getElementById(posX + \"_\" + posY).innerHTML = '<img src=\"img/temps.png\" style=\"margin-top:10px;margin-left:5px;\">'\n\t\t\t\tcompteTemps++;\n\t\t\t}\n\t}\n\t\n\t/*\n\t// Dessiner les intersections\n\tfor (i = 1; i < a.length; i++) {\n\t\tfor (j = 1; j < a[i].length; j++) {\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.setAttribute('id','_' + i + \"_\" + j);\n\t\t\tdiv.setAttribute('class','cell_intersect');\n\t\t\tdiv.setAttribute('style','top:'+ (csz * i - wsz) + \"; left:\" + (csz * j - wsz) + \";\");\n\t\t\tmaze.appendChild(div);\n\t\t}\n\t}\n\t*/\n\t\n\t\n\t// En début de partie, le joueur est matérialisé sur la cellule d’entrée du labyrinthe :\n\tvar user = document.createElement('div');\n\tuser.setAttribute('id','user');\n\tuser.setAttribute('style',\"top:\" + (csz * user_pos[0]) + \"; left:\" + (csz * user_pos[1]) + \"; width:\" + csz + \"px; height:\" + csz + \"px;\");\n\tmaze.appendChild(user);\n\t\n\t// Marquage de la sortie :\n\tfor (i = 0; i < a.length && has_E_wall(a[i][a[0].length - 1]); i++);\n\tdocument.getElementById(i + \"_\" + (a[0].length - 1)).style.backgroundColor = \"#ff6666\";\n\texit_pos = [i,a[0].length - 1];\n\t\n\tfor(var i=0;i<nbMonstres;i++)\n\t{\n\t\t\n\t\tpos_bot[i*2] = Math.floor(Math.random() * (dim));\n\t\tpos_bot[(i*2)+1] = Math.floor(Math.random() * (dim));\n\t\twhile(document.getElementById(pos_bot[i*2]+'_'+pos_bot[(i*2)+1]).innerHTML !='' || pos_bot[(2*i)+1] < 1|| Math.abs(pos_bot[2*i]-user_pos[0]) < 1)\n\t\t{\n\t\t\tpos_bot[i*2] = Math.floor(Math.random() * (dim));\n\t\t\tpos_bot[(i*2)+1] = Math.floor(Math.random() * (dim));\n\t\t}\t\n\t\t\n\t\tdocument.getElementById(pos_bot[i*2]+'_'+pos_bot[(i*2)+1]).innerHTML =\"<img src='img/bot.png' style='margin-top:10px;margin-left:5px;'>\";\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "c062b95bb1498c8d113280a6320752fc", "score": "0.5377647", "text": "draw(src) {\n this.image.src = src\n }", "title": "" }, { "docid": "1c3d15fb9fb8e3bbf83c1aa43a04e7b6", "score": "0.5372827", "text": "doShowURL(size, myURL) {\r\n if (myURL === null) {\r\n return;\r\n }\r\n const image = new Image();\r\n image.src = myURL;\r\n const turtle = this;\r\n\r\n image.onload = () => {\r\n const bitmap = new createjs.Bitmap(image);\r\n turtle.imageContainer.addChild(bitmap);\r\n turtle._media.push(bitmap);\r\n bitmap.scaleX = Number(size) / image.width;\r\n bitmap.scaleY = bitmap.scaleX;\r\n bitmap.scale = bitmap.scaleX;\r\n bitmap.x = turtle.container.x;\r\n bitmap.y = turtle.container.y;\r\n bitmap.regX = image.width / 2;\r\n bitmap.regY = image.height / 2;\r\n bitmap.rotation = turtle.orientation;\r\n turtle.activity.refreshCanvas();\r\n };\r\n }", "title": "" }, { "docid": "9688f69163a6b5b31f602f486361a38e", "score": "0.537156", "text": "function openImage() {\n let img = new Image();\n img.onload = function() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(img, 0, 0);\n }\n img.src = 'image.png';\n}", "title": "" }, { "docid": "d123a479553ba5a356a90df33439ea3a", "score": "0.5370157", "text": "function refreshLiveImage() {\n var ts = new Date().getTime();\n $(\"#liveview\").attr(\"src\", \"cgi-bin/currentpic.cgi?\" + ts);\n}", "title": "" }, { "docid": "7fdc9e2865cc2b67b8e05e73f6a6251e", "score": "0.5369167", "text": "loadImage(imageUrl) {\n this.imageLayer.activate();\n\n this.raster.source = imageUrl;\n this.raster.onLoad = () => {\n // in the project space, image is aligned to the topleft\n this.raster.pivot = this.raster.bounds.topLeft;\n this.raster.position = new window.paper.Point(0, 0);\n // adjust view to fit image\n this.zoomToFit();\n };\n\n this.annotationShapeLayer.activate();\n }", "title": "" }, { "docid": "6bea8ac53b67ac9440010eee2887dfd0", "score": "0.53670347", "text": "redraw() {\n /*\n this.spriteGroup.clear();\n \n // remove comment to draw all points on map\n // let allImages = this.viewerFloorAPI.currentFloor.viewerImages;\n \n // allImages.forEach(image => {\n // this.addPoint(\"black\", image.mapOffset);\n // });\n //\n\n this.location = this.addPoint(\"red\", this.viewerImageAPI.currentImage.mapOffset);\n //this.addViewingDirection(\"yellow\", this.viewerImageAPI.currentImage.mapOffset);\n */\n var floorIndex = this.viewerFloorAPI.currentFloorId;\n this.updateDisplayMap(floorIndex);\n\n }", "title": "" }, { "docid": "92bb82dc66c9e1415e70f9444a1c0082", "score": "0.5364238", "text": "function animateEnemies() {\r\n GAME.crc2.putImageData(image, 0, 0);\r\n for (let i = 0; i < GAME.snail.length; i++) {\r\n let s = GAME.snail[i];\r\n s.update(); //Alle Schnecken im Array werden geupdated: Neue Bewegung, Neu gezeichnete Schnecke\r\n }\r\n checkPositionSnail(); //Koordinaten-Position der Schnecke werden gecheckt mit Funktion checkPositionSnail\r\n if (running) {\r\n window.setTimeout(animateEnemies, 20);\r\n }\r\n else {\r\n location.reload(); //Wenn Spiel zu Ende, dann Seite neu laden\r\n }\r\n }", "title": "" }, { "docid": "beb85dadbce439b629e25050fd5296e3", "score": "0.53614277", "text": "function finishLoadingGrid() {\n if (floorArray[current_floor]) {\n // Load walls\n var matrix = floorArray[current_floor].nodes.map(function(nested) {\n return nested.map(function(element) {\n Controller.setTileAt(element.x, element.y, 'walkable', element.walkable);\n return element.walkable ? 0 : 1;\n });\n });\n // Load stores\n var stores = floorArray[current_floor].storeInfo;\n var numStores = Object.keys(stores).length;\n for (var x = 0; x < numStores; x++) {\n Controller.setTileAt(stores[x].x, stores[x].y, 'store', true);\n }\n showElevators();\n }\n}", "title": "" }, { "docid": "4366950826208ff848b7a8be5028a02f", "score": "0.5354996", "text": "function drawImage(newFrame) {\n // loadImage() is a p5.js function\n // load new frame from feed and then place it on p5.js canvas\n loadImage(newFrame.src, function (loadedFrame) {\n // white background\n background(255);\n // place the frame from kinectron at (0,0)\n image(loadedFrame, 0, 0);\n });\n}", "title": "" }, { "docid": "9238bfae6117229e47ec43f2efaee5e8", "score": "0.53504384", "text": "function updateHangman() {\n document.getElementById('hangman').src = './images/gallows' + mistakes + '.jpg';\n}", "title": "" }, { "docid": "80c3fbb29411011975b2c70ca1b36780", "score": "0.53338945", "text": "regenerate(randImg) {\n randImg = randImg || Math.floor(Math.random() * 2 * 0.7 + 1)\n this.grow = (randImg == 1)\n this.img.src = `./img/neves${randImg}.png`\n this.x = Math.floor(Math.random() * 17 + 1) * this.blockSize\n this.y = Math.floor(Math.random() * 15 + 3) * this.blockSize\n }", "title": "" }, { "docid": "ccd56788ed52a2798e5413e60434511d", "score": "0.5332268", "text": "function draw() {\n \n frameRate(15); // It can be changes to get slower or faster rate of rendering. In my walk through video I am using 10. \n\n background(51);\n\n for(var i=0; i < grid.length ; i++){\n \t \tgrid[i].put();\n }\n\n/*******************************************************************************************\n Create the maze \n//******************************************************************************************/\t\n\t\nif(creation){\n // STEP 1\n\t current.visited = true;\n current.highlight(0,0,255,100);\n \t\n \n var next = current.findNeighbours();\n\n if(next){\n \t\n \tnext.visited = true;\n\n \tstack.push(current);\n\n \tremoveWalls(current, next);\n\n \tcurrent = next;\n \t\n }else if(stack.length > 0){\n \tcurrent = stack.pop();\n }\n \n if( current.i ===0 && current.j === 0){\n \n creation = false;\n solve = true;\n //console.log(\"inside\");\n \n }\n\n //console.log(\"loop\");\n }\n \n\n \n/*******************************************************************************************\n Solve the maze \n//******************************************************************************************/\n\n if(solve){\n\n var start = current;\n\n var end = grid[grid.length - 1];\n\n start.highlight(0,255,0,100);\n end.highlight(255,0,0,100);\n\n currentPath = grid[0];\n\n solve = false;\n solveInProgress = true;\n}\n\nif(solveInProgress){\n currentPath.path = true;\n\n var end = grid[grid.length - 1];\n\n currentPath.highlight(255,255,255,100);\n end.highlight(255,0,0,100);\n\n var nextRoute = currentPath.nextPath();\n \n if(nextRoute){\n \n nextRoute.path = true;\n\n route.push(currentPath);\n \n currentPath = nextRoute;\n\n if( currentPath.i === end.i && currentPath.j === end.j ){\n \n currentPath.put();\n route.push(currentPath);\n currentPath.highlight(255,255,255,100);\n\n solve = false;\n solveInProgress = false;\n showPath = true;\n noLoop();\n }\n\n }else if(route.length > 0){\n currentPath = route.pop();\n \n }\n }\n\n\n if(showPath){\n\n while(route.length > 0){\n\n var pa = route.pop();\n noStroke();\n fill('rgba(0,255,0, 0.25)');\n //rect(pa.i*width_cell, pa.j*width_cell, width_cell, width_cell);\n ellipse(pa.i*width_cell+(width_cell/2), pa.j*width_cell+(width_cell/2), width_cell/2, width_cell/2);\n }\n\n infoText(\"Solution is along the green line starting top-left to bottom-right\");\n }\n\n \n \n}", "title": "" }, { "docid": "3d5df6ee46c6c20f63f774a172712d11", "score": "0.5329952", "text": "function preload()\n{\nboy1 = loadImage(\"boy.png\")\ntree=loadImage(\"tree.png\");\n\t\n}", "title": "" }, { "docid": "bbf8448683d4e8a205257b24b2c673f5", "score": "0.5329798", "text": "function faceTileClicked() {\n\tclearInterval( timer );\n\tloadMinesweeper();\n\tdocument.getElementById( \"faceTile\" ).src = \"assets/face-happy.png\";\n}", "title": "" }, { "docid": "c1f1b55654b253db4d2b6682124659bf", "score": "0.53267413", "text": "function load() {\r\n createImageLayer();\r\n setInterval(updateSensorData, 1000);\r\n}", "title": "" }, { "docid": "ffbb68372d8a2701fefc4b3d27b953f7", "score": "0.53221226", "text": "function preloading(url)\n{\n\tvar xhr=createXHR(); \n\txhr.onreadystatechange=function()\n\t{ \n\t\tif(xhr.readyState == 4)\n\t\t{\n\t\t\tvar content = xhr.responseText;\n\t\t\tvar i = new Image();\n\t\t\ti.src = content;\n\t\t} \n\t}; \n\n\txhr.open(\"GET\", url , true);\n\txhr.send(null); \n}", "title": "" }, { "docid": "3f5a91ce7e2f68fc7850a5dd41efc5b9", "score": "0.53207654", "text": "function reload() {\n resetState = true;\n takeState = false;\n sizeState = false;\n readState = false;\n returnedSize = new Array();\n returnedImage = new Array();\n returnedReset = new Array();\n}", "title": "" }, { "docid": "0b4ff1eba7aa4210eb220f3280ab8873", "score": "0.5314502", "text": "function eye_init(){\r\n $(\"#eyef\").attr('src', '/cleancode/'+getUnifiedParams().id+\"/look/\");\r\n}", "title": "" }, { "docid": "50c5d5aa86baf7a92167cd7aed8fe000", "score": "0.5312806", "text": "function imageReturn() {\r\n document.getElementById(\"teamLeader\").src = \"../images/teamLeader.jpg\";\r\n}", "title": "" }, { "docid": "1098a0339cc5655a5ed8cf03d45dd3d9", "score": "0.53032494", "text": "function loadImages() {\n\tNinja_idle.src = \"images/Ninja/Idle__000.png\";\n\tNinja_jump0.src = \"images/Ninja/Jump__000.png\";\n\tNinja_jump1.src = \"images/Ninja/Jump__001.png\";\n\tNinja_jump2.src = \"images/Ninja/Jump__002.png\";\n\tNinja_jump3.src = \"images/Ninja/Jump__003.png\";\n\tNinja_jump4.src = \"images/Ninja/Jump__004.png\";\n\tNinja_jump5.src = \"images/Ninja/Jump__005.png\";\n\tNinja_jump6.src = \"images/Ninja/Jump__006.png\";\n\tNinja_jump7.src = \"images/Ninja/Jump__007.png\";\n\tNinja_jump8.src = \"images/Ninja/Jump__008.png\";\n\tNinja_jump9.src = \"images/Ninja/Jump__009.png\";\n\tNinja_run0.src = \"images/Ninja/Run__000.png\";\n\tNinja_run1.src = \"images/Ninja/Run__001.png\";\n\tNinja_run2.src = \"images/Ninja/Run__002.png\";\n\tNinja_run3.src = \"images/Ninja/Run__003.png\";\n\tNinja_run4.src = \"images/Ninja/Run__004.png\";\n\tNinja_run5.src = \"images/Ninja/Run__005.png\";\n\tNinja_run6.src = \"images/Ninja/Run__006.png\";\n\tNinja_run7.src = \"images/Ninja/Run__007.png\";\n\tNinja_run8.src = \"images/Ninja/Run__008.png\";\n\tNinja_run9.src = \"images/Ninja/Run__009.png\";\n\ttile1.src = \"images/Tiles/2.png\";\n\ttile2.src = \"images/Tiles/5.png\";\n\ttileSkyLeft.src = \"images/Tiles/13.png\";\n\ttileSkyRight.src = \"images/Tiles/15.png\";\n\tmushroom1.src = \"images/Object/Mushroom_1.png\"\n}", "title": "" }, { "docid": "0a1f60b32a5a6c81b67887ba7a421cb3", "score": "0.5297206", "text": "function updateImg() {\n document.getElementById('hangman-img').src=\"./images/hangman\"+mistakes+\".png\" \n}", "title": "" }, { "docid": "9f01d81f5f0fa6d716bca5e4bd4c4e21", "score": "0.5294589", "text": "function reloadPreview() {\n\tdebugLog(\"The preview has been reloaded\");\n\tanimPreview.load(JSON.parse(editedLottie));\n\tif (isDestroyToDo == true) easter2()\n}", "title": "" }, { "docid": "e1144c519ce67dfd9dbce4c63bc92ab5", "score": "0.5287896", "text": "loadImages(){\n for(var t = 0; t < 12; t++) {\n this.mineralTiles[t] = new Image();\n this.mineralTiles[t].src = \"./img/Minerals/\" + (t+1) + \".png\" ;\n }\n this.playerGfx[0] = new Image();\n this.playerGfx[0].src = \"./img/side.png\";\n this.playerGfx[1] = new Image();\n this.playerGfx[1].src = \"./img/top.png\";\n }", "title": "" }, { "docid": "d526563c764a499f29a3fd23c3a3ca90", "score": "0.528436", "text": "function genLearningAgent(){\n // load the image\n // move circle from probe update\n}", "title": "" }, { "docid": "1f19c5e64dac019e683c5097c2c1bd80", "score": "0.52842784", "text": "function image () {\n document.getElementById('budgies').src = 'images/PaintAndArt.jpg'\n}", "title": "" }, { "docid": "248d2b62aec56d9e70f5b6552265b7a0", "score": "0.5270711", "text": "function renderImage() {\n var img = document.createElement('img');\n img.className = \"movieImage\";\n img.src = 'wwwroot/placeholder.png';\n document.getElementById('rendered-content').appendChild(img);\n}", "title": "" }, { "docid": "a2b46d91bb2ffc649e78b10d16f70ea8", "score": "0.52703696", "text": "function load_page() {\n\t\t/* Set the wider variables here so we can reset at any point */\n\t\tcurrent_img\t= '';\n\t\tcurrent_world_pop = 0;\n\t\tcurrent_ureach_pop = 0;\n\n\t\tdt = new Date();\t\t\t// the date/time of the last time the loop ran\n\t\tif (image_timeout) {\n\t\t\tclearTimeout(image_timeout);\n\t\t}\n\t\tif (stats_timeout) {\n\t\t\tclearTimeout(stats_timeout);\n\t\t}\n\t\tload_settings();\n\n\t\tload_template();\n\n\t\t// later this will be initiated via a button on the settings screen\n\t\tlaunch_auto_updates();\n\t}", "title": "" }, { "docid": "dffcf6053c223d55448fce83b870ac61", "score": "0.5262466", "text": "function sendImage() {\n ctx.drawImage(video2, 0, 0, 300, 280);\n // Send to Runway the current element in the canvas\n socket.emit('query', {\n semantic_map: document.getElementById(\"defaultCanvas0\").toDataURL('image/jpeg'), \n });\n }", "title": "" }, { "docid": "008eedf4a40b0ae6c0e560cbeebf6e43", "score": "0.5260062", "text": "function image(src) {\n\ttry {\n\t\tinitCanvas(src);\n\t\tip5SplitsRetrieveData();\n\t} catch(err) {\n\t\tconsole.log('image', err);\n\t}\n}", "title": "" }, { "docid": "a6e35d9716c00d60ef6a9d6e3c2baa95", "score": "0.5258975", "text": "preload()\n {\n const base = \"image/\";\n this.load.image('endScene',`${base}EndScene.png`);\n }", "title": "" }, { "docid": "3b64169800a30d52a8c7e50c04eda103", "score": "0.52587", "text": "function preload(){\n//seaImg=loadImage(\"sea.png\")\n//shipImg=loadImage(\"ship-1.png\",\"ship-2.png\",\"ship-3.png\",\"ship-4.png\",)\n}", "title": "" }, { "docid": "661af3a73f00c787f9f834403419770e", "score": "0.5255523", "text": "function startNewGame(){\n\tlocation.reload(true);\n}", "title": "" }, { "docid": "36995b37653f12e64f5f5e44b51fce02", "score": "0.5247324", "text": "function doMaze() {\n let genTime = document.getElementById('genTime');\n genTime.innerHTML = '';\n\n recordAnim = document.getElementById('recordAnimation').checked;\n animPathFind = document.getElementById('animPathFind').checked;\n animFoundPath = document.getElementById('animFoundPath').checked;\n\n let genStartTime = performance.now();\n nodes = [];\n mazeBlockData = [];\n\n //Create and draw the maze\n initMaze();\n\n createBlockData();\n\n mainCanvas.renderNodes(nodes);\n\n mazeEditor.updateCanvasInfo(mainCanvas.Width, mainCanvas.Height, mainCanvas.Scale);\n\n let timeTaken = new Date();\n let t = performance.now() - genStartTime;\n timeTaken.setTime(t);\n\n\n genTime.innerHTML = timeTaken.getMinutes() + 'm' + timeTaken.getSeconds() + 's' + timeTaken.getMilliseconds() + ' Raw: ' + t.toString();\n}", "title": "" }, { "docid": "2d1128568f70be23ccc239eeb843e449", "score": "0.52459866", "text": "function MainInit() {\n main_handler = new handler();\n main_canvas = new canvas('myCanvas_bg');\n main_select_canvas = new canvas('select_canvas');\n main_draw_canvas = new canvas('draw_canvas');\n main_query_canvas = new canvas('query_canvas');\n main_image = new image('im');\n\n function main_image_onload_helper() {\n main_image.SetImageDimensions();\n var anno_file = main_image.GetFileInfo().GetFullName();\n anno_file = 'Annotations/' + anno_file.substr(0,anno_file.length-4) + '.xml' + '?' + Math.random();\n ReadXML(anno_file,LoadAnnotationSuccess,LoadAnnotation404);\n };\n \n main_image.GetNewImage(main_image_onload_helper);\n \n var dirname = main_image.GetFileInfo().GetDirName();\n var imname = main_image.GetFileInfo().GetImName();\n\n if(document.getElementById('img_url')) {\n imPath = main_image.GetFileInfo().GetImagePath();\n document.getElementById('img_url').onclick = function() {location.href=imPath};\n }\n\n \n // if(document.getElementById('username_main_div')) write_username();\n\n WriteLogMsg('*done_loading_' + main_image.GetFileInfo().GetImagePath());\n}", "title": "" }, { "docid": "a2e4b3cee1609122f60f6aa913770b2d", "score": "0.52406394", "text": "function preload(){\r\n roadImg = loadImage(\"path.png\");\r\n\r\n boyAni = loadAnimation(\"Runner-1.png\",\"Runner-2.png\");\r\n\r\n// drinkImg = loadImage(\"energyDrink.png\");\r\n\r\n// coinImg = loadImage(\"coin.png\");\r\n\r\n// bombImg = loadImage(\"bomb.png\");\r\n}", "title": "" }, { "docid": "5d424cd2bf982364217b28d0d0069d78", "score": "0.5238622", "text": "function gearth() {\n\n var gearthAPI = localURL + ('scripts/earthview.json');\n\n $.getJSON(gearthAPI, {})\n .done(function (data) {\n imgarray = [];\n $('#infocontainer').empty();\n $.each(data, function (i, item) {\n imgarray.push(data[i])\n });\n //grab random image\n var image = imgarray[Math.floor(Math.random() * imgarray.length)];\n //push data to page\n $('#image').css('background-image', 'url(' + image.image + ')');\n $('#infocontainer').attr('href', image.map);\n $('#infocontainer').append('<h3>' + image.region + ', ' + image.country + '</h3>');\n $('#imginfo').fadeIn();\n $('#infocontainer').fadeIn();\n });\n}", "title": "" }, { "docid": "ca03ca5a696f714dad18df6aca987365", "score": "0.5237643", "text": "function main() {\n var image = new Image();\n var image2 = new Image();\n\n image.onload = function() { \n\t\tloadModel(image, image2);\n\t\t};\n\t\n // starts loading the image asynchronously\n\t//image.src = imageFilename;\n\timage.src = imageFilenamePrimary;\n\timage2.src = imageFilename;\n}", "title": "" }, { "docid": "eed96e7207b427d1fb8f392ea65b198a", "score": "0.52303284", "text": "function renderProcess() {\n\tif (LIMIT_IMAGE_SIZE) {\n\t\tresizeCanvas(min(img.width, MAX_CANVAS_WIDTH) + SIZE_INFO_WIDTH, max(min(img.height, MAX_CANVAS_HEIGHT), MIN_CANVAS_HEIGHT));\n\t} else if (LIMIT_IMAGE_SIZE_BASED_SCREEN) {\n\t\tresizeCanvas(min(img.width, window.innerWidth * (SCREEN_BASED_IMAGE_LIMITATION_PERCENT / 100)) + SIZE_INFO_WIDTH, max(min(img.height, window.innerHeight * (SCREEN_BASED_IMAGE_LIMITATION_PERCENT / 100)), MIN_CANVAS_HEIGHT));\n\t} else {\n\t\tresizeCanvas(img.width + SIZE_INFO_WIDTH, max(img.height, MIN_CANVAS_HEIGHT));\n\t}\n\n\tdelete sim;\n\tsim = new simbol();\n\n\tlastSavedX = 0;\n\tlastSavedY = 0;\n\n\tbuttonDownloadImage.elt.hidden = false;\n\tbuttonDownloadCode.elt.hidden = false;\n\n\tbackupPixels = [];\n\tbackupPixelsHasFilled = false;\n\n\tfirst = false\n\n\n\tpixelDensity(1);\n}", "title": "" }, { "docid": "92807173820a4f7efdf8bf7702d3986f", "score": "0.52253604", "text": "function preloader() {\n let loadingImage = new Image();\n loadingImage.src = \"images/aboutMiguel/backgrounds/gifs/rocketBackground.gif\";\n}", "title": "" }, { "docid": "2f0eb16b01870a082d6118030bd806f2", "score": "0.5221625", "text": "function showMovie(movieFile){\n var movieElement = document.getElementById(\"gif-moviezone\")\n url = baseUrl + \":\" + port + \"/\" + movieFile\n console.log(url)\n var imgElement = document.createElement(\"img\");\n imgElement.className = \"gif gifmovie\"\n imgElement.setAttribute(\"src\", url)\n movieElement.appendChild(imgElement)\n console.log(\"showtime!\")\n }", "title": "" }, { "docid": "690d3c4348302e5bf2966dbfa855509e", "score": "0.5216044", "text": "function setLocationImage() {\n imageOne.src = \"./img/montreal0\" + (Math.floor(Math.random() * 2) + 1) + \".jpg\";\n imageTwo.src = \"./img/toronto0\" + (Math.floor(Math.random() * 2) + 1) + \".jpg\";\n imageThree.src = \"./img/vancouver0\" + (Math.floor(Math.random() * 2) + 1) + \".jpg\";\n}", "title": "" }, { "docid": "05ebeef24abbcab13f22728cf3090437", "score": "0.5214454", "text": "function updateTilesMM() {\n if (gt_drawTiles && GM_getValue('mm_files') && mm_draw) {\n files = JSON.parse(GM_getValue('mm_files'));\n if (document.getElementById('tiles')) {\n var tileTypes = [\n 'tiles',\n 'splats',\n 'speedpad',\n 'speedpadred',\n 'speedpadblue',\n 'portal'\n ];\n for (i in tileTypes) {\n if (document.getElementById(tileTypes[i])) {\n document.getElementById(tileTypes[i]).crossOrigin = 'Anonymous';\n document.getElementById(tileTypes[i]).src = '';\n document.getElementById(tileTypes[i]).src = files[tileTypes[i]] != undefined ? files[tileTypes[i]] : 'http://' + tagpro.host + '/images/' + tileTypes[i] + '.png';\n }\n }\n setTimeout(tagpro.renderer.refresh, 100);\n }\n }\n }", "title": "" }, { "docid": "ae0270d86afcff5b0e4a99e4ea67f5d9", "score": "0.520965", "text": "function preload(){\n sky = loadImage(\"images/sky.png\");\n}", "title": "" }, { "docid": "c10d64625b03be8ffb8b4b0dd680dc01", "score": "0.52090245", "text": "function setMachineState( s ){\n\tdocument.getElementById( \"machine\" ).src = \"./img/\" + s + \".png\" // image\n}", "title": "" }, { "docid": "abc9e0d392cd6bd2707c5711fea10462", "score": "0.5208533", "text": "function showPreloaderAndAnimation() {\n hidePage();\n island_img.on(\"load\", function () {\n showPage();\n //showing animation\n noticeMyArea(areas.eq(3), Start1, End1);\n noticeMyArea(areas.eq(4), Start2, End2);\n noticeMyArea(areas.eq(0), Start3, End3);\n noticeMyArea(areas.eq(1), Start4, End4);\n noticeMyArea(areas.eq(2), Start5, End5);\n noticeMyArea(areas.eq(3), Start6, End6);\n });\n var pictureInCache = document.getElementById('island_img').complete;\n if (pictureInCache == true) {\n showPage();\n //showing animation\n noticeMyArea(areas.eq(3), Start1, End1);\n noticeMyArea(areas.eq(4), Start2, End2);\n noticeMyArea(areas.eq(0), Start3, End3);\n noticeMyArea(areas.eq(1), Start4, End4);\n noticeMyArea(areas.eq(2), Start5, End5);\n noticeMyArea(areas.eq(3), Start6, End6);\n\n } \n }", "title": "" }, { "docid": "85a51078f9696f1bfb26583b2d77fd61", "score": "0.52078843", "text": "function backToStartAnimation() {\n //getting the proper island part from GET\n var source = main.data('source');\n source = source.replace('/the-island', ''); //for localhost only\n source = source.split(\"/\");\n source = source[1].split(\".\");\n source = source[0]; //the name of the part of the island\n\n // START position of the image\n islandPartDisplayParameters(source);\n\n //END position of the image \n var pixOnVw = window.innerWidth / 100; //how many pixels are in vw\n newLeft = mainPaddingLeftVw * pixOnVw;\n newTop = grpelemPaddingTopPx + nav.height();\n\n\n //END size of the img\n var imgWidth = document.getElementById(\"island_img\").naturalWidth; //1098; - need to do it with vanilla js to get this property\n var imgHeight = document.getElementById(\"island_img\").naturalHeight; // 1881;\n\n var width = Math.round(window.innerWidth * imageScale);\n var proportion = width / imgWidth;\n var height = Math.round(imgHeight * proportion);\n widthPx = width + 'px';\n heightPx = height + 'px';\n\n\n //START animation--------------\n //recalculating the size of map image areas in case it's not done\n fixedImgSize();\n\n //hiding the map island image , just in case it is not hidden after the previous action \n island.addClass('hidden');\n \n //showing the resizable island image \n wholeisland\n .removeClass('hidden')\n .addClass('exposed');\n //giving START position of an image\n wholeisland //added\n .find('img') \n .css({\n \"position\": \"fixed\",\n \"left\": left,\n \"top\": top,\n \"height\": heightOfExtendedIsland,\n \"width\": widthOfExtendedIsland\n })\n\n //END animation---------------\n //giving END position and END size of an image\n .animate({\n left: newLeft,\n top: newTop,\n height: heightPx,\n width: widthPx\n }, {\n duration: backToStartAnimationMilisec,\n always: function () { //in this form this happens both fail & success;\n wholeisland\n .removeClass('exposed')\n .addClass('hidden');\n island.removeClass('hidden');\n //isTouch(); //pins can be hidden after click \n }\n }\n );\n }", "title": "" }, { "docid": "6f4b1a959f8a24f66e80dc18ea4be899", "score": "0.5202176", "text": "function update() {\n paint();\n // TODO: update url\n}", "title": "" }, { "docid": "d0085cd9a193f044ee2e61097d3135c2", "score": "0.51957124", "text": "function preload() {\r\n explorerImg = loadImage(\"Forest Ranger.jpg\");\r\n orangutanImg = loadImage(\"Orangutan.jpg\");\r\n imagePath = loadImage(\"pathway.jpg\");\r\n}", "title": "" }, { "docid": "56b170a69dccb68200e98951a589d5cd", "score": "0.51947606", "text": "function changeImage() {\n var pictureDisplay = document.querySelector(\"#pictureDisplay\");\n pictureDisplay.src = halloImage2;\n gameStatus = false;\n}", "title": "" }, { "docid": "c7ffb69868ff20080cfd20fa44054383", "score": "0.5193652", "text": "function loadImage(){\n img.src = \"image/DemoRpgCharacter.png\"\n img.onload = function(){\n init ()\n } \n}", "title": "" }, { "docid": "c1c6039544af248ba164459add7ce5ec", "score": "0.5189893", "text": "function imageLoaded () {\n var data = {\n images: [walker],\n frames: [\n [9, 8, 30, 32],\n [59, 8, 30, 32],\n [109, 8, 30, 32],\n [159, 8, 30, 32],\n [209, 8, 30, 32],\n [259, 8, 30, 32],\n [309, 8, 30, 32],\n [359, 8, 30, 32],\n [409, 8, 30, 32],\n [459, 8, 30, 32],\n [509, 8, 30, 32],\n [559, 8, 30, 32],\n [9, 58, 31, 32],\n [59, 58, 31, 32],\n [109, 58, 31, 32],\n [159, 58, 31, 32],\n [209, 58, 31, 32],\n [259, 58, 31, 32],\n [309, 58, 31, 32]\n ],\n animations: {\n run: [0,11],\n jump: [12,18],\n holdJump: 18\n }\n };\n var spriteSheet = new createjs.SpriteSheet(data);\n hero = new Hero(spriteSheet);\n score = new Score;\n pauseText = pauseScreen();\n stage.addChild(pauseText);\n stage.addChild(hero, score.currentScore, score.topScore);\n stage.setChildIndex(hero, stage.getNumChildren()-1);\n window.hero = hero;\n window.score = score;\n start();\n }", "title": "" }, { "docid": "879c87f6f04eab5244d0918d8fc553ff", "score": "0.51882946", "text": "function clear() {\n $(\"#results\").empty();\n // $(\"#map\").attr(\"src\", \"assets/images/theMap.jpg\")\n}", "title": "" }, { "docid": "75c7fcd495bca2133b3003abfd0be183", "score": "0.5188031", "text": "loadImage() {\n if (this.imageLoaded === false || this.imageReloader === true) {\n this.getImageFile(this.smartImageElem);\n }\n }", "title": "" }, { "docid": "c186b6ff79a3433fb7f468d98bbd3bc0", "score": "0.51863986", "text": "function reloadGame(){\n var logo_link = document.getElementById('logo');\n\n logo_link.onclick = function(){\n location.reload(); // On recharge au click sur le logo\n }\n}", "title": "" }, { "docid": "2abbc34ee1a0b6c17d54786557ccfd01", "score": "0.5185247", "text": "function redrawImage() {\n\timageData = getData()\n\tif ( imageData ) {\n\t\tappendImageRegionToRender( {\"x1\": 0, \"y1\": 0, \"x2\": imageData[\"width\"] - 1, \"y2\": imageData[\"height\"] - 1, \"function\": redrawImageRect})\n\t}\n}", "title": "" }, { "docid": "cb1d91ccf823710de816d223b7f54043", "score": "0.5180401", "text": "function setWindowImage() {\n //use is looking for \"weather\" ,\n \"Images/Weather/Window/Thunderstorm.jpg\";\n document.getElementById(\"WeatherAnimation\").src = `Images/Weather/Window/${allWeatherData[\"current\"][\"weather\"][0][\"main\"]}.jpg`;\n}", "title": "" }, { "docid": "662472f3ee5fd0aad7ce1f56f79379aa", "score": "0.5179009", "text": "function run() {\n idx++;\n changeImage();\n}", "title": "" } ]
89979e1f1833571614d5618f6f865f99
return a keyvalue argument passed tothe commandline (does not return singlevalue arguments) example: "myKey=myValue" will return, but "someValue" will not. if you need single value args, access process.argv directly.
[ { "docid": "f1fc5d6bf4122d9a32f72ae082fab7a3", "score": "0.7421369", "text": "function getCommandlineArg(key, valueIfNullOrEmpty) {\n let parsedArgs = exports.getCommandlineArgs();\n let result = parsedArgs[key];\n if (valueIfNullOrEmpty != null) {\n if (result == null || result.length === 0) {\n return valueIfNullOrEmpty;\n }\n }\n return result;\n}", "title": "" } ]
[ { "docid": "7dfc58959a5ed172754db4142e2d496c", "score": "0.78912294", "text": "function _getArgValue(key) {\n for (let i = 0; i < process.argv.length ; i++) {\n if (process.argv[i].startsWith(`--${key}=`)) {\n return process.argv[i].split('=')[1];\n }\n if (process.argv[i] === `--${key}`) {\n return true;\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "11a433ca4687519b22a953e5aa62420e", "score": "0.713881", "text": "function getCommandLineParameter(key, defaultValue = undefined) {\n\t\t\tvar index = process.argv.indexOf(`--${key}`);\n\t\t\tvar value = index > -1 ? process.argv[index + 1] : undefined;\n\t\t\treturn value !== undefined ? String(value) : defaultValue;\n\t\t}", "title": "" }, { "docid": "17a99999d8de81a6f9a962b82f4db565", "score": "0.68548995", "text": "function getCLIArgs() {\n return process.argv.reduce(function(hash, arg, idx, array) {\n\n var next = array[idx + 1];\n\n // We have identified a keyname\n if (!arg.indexOf('--')) {\n // Lookahead for non-key\n // ? Remove leading dashes\n // : Non-value keys are boolean\n hash[arg.substr(2).toLowerCase()] = next && next.indexOf('--') ? next : true;\n }\n\n return hash;\n\n }, {});\n}", "title": "" }, { "docid": "70c3cab551ccfe6ce0d5b572fce389e9", "score": "0.6442345", "text": "function getArgs() {\n\tfunction isNumeric(n) {\n\t return !isNaN(parseFloat(n)) && isFinite(n);\n\t}\n\n\tlet args = process.argv.slice(2);\n\n\tlet result = {};\n\tlet current = 0;\n\targs.forEach(function (val, index) {\n\t\tif (index == current) {\n\t\t\tcurrent = index + 1;\n\t\t\tif (val.substring(0,2) == '--' && val.length > 2) {\n\t\t\t\tif (args[index+1] && args[index+1].substring(0,1) != '-' && args[index+1].indexOf('=') == -1) {\n\t\t\t\t\tresult[val.substring(2,100)] = isNumeric(args[index+1]) ? parseFloat(args[index+1]) : args[index+1];\n\t\t\t\t\tcurrent++;\n\t\t\t\t} else {\n\t\t\t\t\tresult[val.substring(2,100)] = true;\n\t\t\t\t}\n\t\t\t} else if (val.substring(0,1) == '-' && val.length > 1) {\n\t\t\t\tvar part = '';\n\t\t\t\tfor (let i = 1; i < val.length; i++) {\n\t\t\t\t\tpart = val.substring(i,i+1);\n\t\t\t\t\tresult[part] = true;\n\t\t\t\t}\n\t\t\t\tif (args[index+1] && args[index+1].substring(0,1) != '-' && args[index+1].indexOf('=') == -1) {\n\t\t\t\t\tresult[part] = isNumeric(args[index+1]) ? parseFloat(args[index+1]) : args[index+1];\n\t\t\t\t\tcurrent++;\n\t\t\t\t}\n\t\t\t} else if (val.indexOf('=') >= 1) {\n\t\t\t\tvar parts = val.split('=');\n\t\t\t\tresult[parts[0]] = isNumeric(parts[1]) ? parseFloat(parts[1]) : parts[1]\n\t\t\t} else {\n\t\t\t\tresult[val] = true;\n\t\t\t}\n\t\t}\n\t});\n\treturn result;\n}", "title": "" }, { "docid": "b965fd8bda45062170a411257aec3090", "score": "0.6363778", "text": "function process_args () {\r\n\tvar a = {};\r\n\tfor (var i = 2; i < process.argv.length; i++) {\r\n\t\tvar string = process.argv[i];\r\n\t\tvar kv = string.split('=');\r\n\t\ta[kv[0]] = kv[1];\r\n\t}\r\n\treturn a;\r\n}", "title": "" }, { "docid": "c7b09cc35744a6ff6aaf7ba4150eb98e", "score": "0.62655884", "text": "function getValue(flag){\n const index = process.argv.indexOf(flag);\n return (index > -1) ? process.argv[index + 1] : null\n}", "title": "" }, { "docid": "e760a3e5c6a104798fd30f911e09637d", "score": "0.6201338", "text": "function get_arg_value(args, key) {\n for(let arg of args) {\n var k = arg.replace(']','').replace('[','').split(':')[0];\n if (key === k){\n // special parsing for msg field\n if (key === 'msg') {\n\tvar str = args.join(' ');\n\tvar msg = str.substring(str.indexOf('msg'));\n msg = msg.substring(0, msg.indexOf(']'));\n return msg.split(':')[2];\n }\n return arg.replace(']','').replace('[','').split(':')[1]; \n }\n }\n return \"null\";\n}", "title": "" }, { "docid": "c00394ab9ecf8a4d933ded998433a7bd", "score": "0.61936826", "text": "function parseArgs(key = '__ARGS__') {\n const queryArgs = GetQueryString(key);\n if (!queryArgs) {\n global[key] = {};\n } else {\n global[key] = Object.freeze(JSON.parse(decodeURIComponent(queryArgs)));\n }\n return key;\n}", "title": "" }, { "docid": "f103166e1865dead099b8b098cb14bc4", "score": "0.61754733", "text": "function getQueryArg(argName) \n{\n var mainURL = window.location.search;\n var argStr = mainURL.split('?');\n if (argStr.length > 1) {\n var args = argStr[1].split('&');\n for (i in args) {\n var keyVal = args[i].split('=');\n if (argName == keyVal[0]) {\n //document.write('Found Key: ' + keyVal[0] + ' == ' + keyVal[1] + '<br>');\n return keyVal[1];\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "4378181b7bdd49da6cbce31803e2e2fe", "score": "0.6003456", "text": "function getParam(flagName){\n var indx = process.argv.indexOf(flagName);\n if(indx < 0){\n return;\n }\n \n var param = process.argv[indx + 1];\n return param;\n}", "title": "" }, { "docid": "f730f0149b6c2314d3f086ad3563d2e4", "score": "0.5977486", "text": "function _next() {\n var o;\n\n if (_args.length === 0) {\n return null;\n }\n\n if (_args[0] === '-') {\n _expectingIo = true;\n _expectingKeys = false;\n _args.shift();\n\n if (_args.length > 0) {\n throw Error('Expected input or output, but found command line ' +\n 'arguments after hyphen (\"-\") token.');\n }\n\n return null;\n }\n\n if (!_expectingKeys) {\n return _args.shift();\n }\n\n if (_args[0] === '--') {\n _expectingKeys = false;\n _args.shift();\n return _next();\n }\n\n if (_args[0].indexOf('-') === 0) {\n o = _args.shift();\n\n var e = o.indexOf('=');\n\n if (e > -1) {\n var r = o.substr(e + 1);\n o = o.substring(0, e);\n\n if (r !== '') {\n _beforeOptional = true;\n _args.unshift(r);\n }\n }\n\n if (o.indexOf('--') === 0) {\n if (o.length < 4) {\n throw Error('Expected a multi-character key to follow a double ' +\n 'hyphen (\"--\"), but found a single character key \"' + o + '\".');\n }\n return o.substr(2);\n } else if (o.length === 2) {\n _inBundle = false;\n return o.substr(1);\n } else {\n _inBundle = true;\n _args.unshift('-' + o.substr(2));\n return o.substr(1,1);\n }\n }\n\n return Options.VALUE;\n}", "title": "" }, { "docid": "102331db8c1bdac74f7cb3a5e23c224a", "score": "0.5913472", "text": "function main(option){\n var index = process.argv.indexOf(option);\n return (index === -1) ? null : process.argv[index + 1]; // if index is -1 then return null else return value \n}", "title": "" }, { "docid": "11ef48655aab187fd68ac957c84cbde4", "score": "0.59082216", "text": "function getCommandLineOptions() {\n return process.argv\n .slice(2)\n .map(arg => arg.split('='))\n .reduce((accum, arg) => {\n const key = arg[0].replace('--', '');\n\n // if secret, do not put in config\n if (key === 'secret') {\n secret = arg[1];\n return accum;\n }\n\n // If provided key is not encoded, encode it first\n // do not put in config\n if (key === 'privatekey') {\n secret = otplib.authenticator.encode(arg[1]);\n return accum;\n }\n\n if (key === 'step' || key === 'epoch') {\n accum[key] = parseInt(arg[1], 10);\n return accum;\n }\n\n return accum;\n }, {});\n}", "title": "" }, { "docid": "28e340b1f5a1be337e96fe02e7600e11", "score": "0.5877429", "text": "function getArg(argname, defaultValue) {\n var regex = new RegExp('\\\\?.*?' + argname + '=([^&]*)&?');\n var parts = location.search.match(regex);\n if (!parts) {\n return defaultValue;\n }\n\n return (parts.length == 2)\n ? parts[1]\n : true\n}", "title": "" }, { "docid": "b350aa7f3e80a1c62745a3d309975716", "score": "0.5799862", "text": "function getCommandLineVariables(){\n\t\tvar arg_array = process.argv.slice(2);\n\n\t\tif(arg_array.length !== 1){\n\t\t\tthrow new Error(\"Pass a number\");\n\t\t}\n\t\t\n\t\t\n\t\treturn parseInt(arg_array[0]);\n\t}", "title": "" }, { "docid": "a073375ee03a2b9f22a08e0e66e2a1f5", "score": "0.57003045", "text": "function parseArgv() {\n const [,, ...argv] = process.argv;\n const distributionOptions = {\n name: '',\n length: 0,\n params: {}\n };\n for (let i = 0; i < argv.length; i++) {\n const param = argv[i];\n const [key, value] = param.split(/\\s*=\\s*/);\n if (!key || !value) {\n console.log(`Argument \"${param}\" cannot be parsed`);\n return null;\n }\n switch (key) {\n case 'name':\n distributionOptions.name = value;\n break;\n case 'length':\n distributionOptions.length = parseInt(value, 10);\n break;\n default:\n distributionOptions.params[key] = parseFloat(value);\n }\n }\n return distributionOptions;\n}", "title": "" }, { "docid": "7e2d7f5313d4c0fbac7390239be57c38", "score": "0.56639034", "text": "function getArgLetterAndValue(args, message) {\n\n //Check that there's an even number of arguments\n if ((args.length % 2) != 0) {\n message.channel.send(`Invalid argument format, ${getRandomNameInsult(message)} (there should be an even amount of inputs)`);\n return undefined;\n }\n\n //Check that the current argument starts with a hyphen\n if (args[0][0] != '-') {\n message.channel.send(`Invalid argument provided, ${getRandomNameInsult(message)} (the argument you want to provide needs to start with a hyphen)`);\n return undefined;\n }\n\n //Check that the current argument is exactly 2 characters long\n if (args[0].length != 2) {\n message.channel.send(`Invalid argument provided, ${getRandomNameInsult(message)} (the start of an argument should be a hyphen and a letter, e.g. -d)`);\n return undefined;\n }\n\n //If nothing above proc'd, return the letter and value\n let returnObject = {letter: args[0][1], value: args[1]};\n args.splice(0, 2);\n return returnObject;\n\n}", "title": "" }, { "docid": "0c02dcf90af3fb70c90b738be1b5e2a1", "score": "0.56420213", "text": "function parseArgv() {\n let args = [];\n let options = {};\n\n process.argv.forEach(function(arg, i) {\n if(i > 1) {\n if (arg.substr(0, 2) === \"--\") {\n // remove leading dashes\n const str = arg.substr(2);\n\n // split out to key/value pairs\n if (str.indexOf(\"=\") !== -1) {\n const strSplit = str.split('=');\n options[strSplit[0]] = strSplit[1];\n } else {\n options[str] = true;\n }\n }\n else {\n args.push(arg);\n }\n }\n });\n\n return {\n args: args,\n options: options\n }\n}", "title": "" }, { "docid": "1e7fd2e24e9d88c2970829ab156ec1d0", "score": "0.5637925", "text": "function grab(flag){\n //find index of flag in the array\n var index = process.argv.indexOf(flag);\n // return the value/next variable in the array// if index is == -1 flag is not found in array, \n // and if index is not == to -1 the flag is found in array\n return (index === -1) ? null : process.argv[index+1];\n}", "title": "" }, { "docid": "3496709dcc6349a1e8b4de6e855bf7bc", "score": "0.54906875", "text": "function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName];}else if(arguments.length === 3){return aDefaultValue;}else {throw new Error('\"' + aName + '\" is a required argument.');}}", "title": "" }, { "docid": "411ea51b6ea95ddde72b72142de3375c", "score": "0.5485417", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return (args[key] === undefined) ? defaultParams[key] : args[key];\n }", "title": "" }, { "docid": "792c5de3204fcb871cdf83ac64cb48ec", "score": "0.5481007", "text": "function parseArgs(args) {\n const obj = {};\n args.split('&').forEach((keyVal) => {\n // replace missing value with ''\n keyVal = keyVal.split('=');\n if(keyVal.length == 1) {\n keyVal[1] = '';\n }\n obj[window.decodeURIComponent(keyVal[0])] = window.decodeURIComponent(keyVal[1]);\n });\n return obj;\n}", "title": "" }, { "docid": "c66fb701156512ccb84e7fa56fb7c2ad", "score": "0.53988117", "text": "function getThirdArgument() {\n\n\t// Stores all possible arguments in array.\n\targumentArray = process.argv;\n\n\t// Loops through words in node argument.\n\tfor (var i = 3; i < argumentArray.length; i++) {\n\t\targument += argumentArray[i];\n\t}\n\treturn argument;\n}", "title": "" }, { "docid": "1ae79dee65a5af43021f4bb1138f4b68", "score": "0.5370699", "text": "function getCmdLineArgs() {\n return process.argv.slice(2,);\n}", "title": "" }, { "docid": "e6983b232f92230482b05d4d4f08c438", "score": "0.53378874", "text": "addCustomArg(key, value) {\n if (typeof key !== 'string') {\n throw new Error('String expected for custom arg key');\n }\n if (typeof value !== 'string') {\n throw new Error('String expected for custom arg value');\n }\n this.customArgs[key] = value;\n }", "title": "" }, { "docid": "dffe599072f989d11b544c1062ef7057", "score": "0.5330457", "text": "function prepareInput(arg) {\n arg = escapeCommadArg(arg);\n if (arg.startsWith(\"--\"))\n return arg;\n else\n return `\"${arg}\"`;\n}", "title": "" }, { "docid": "82ad79343b451f7ae35e20c686505e58", "score": "0.5303984", "text": "function evalArg(arg) {\n if (typeof arg !== 'string') {\n return (arg || null);\n }\n try {\n arg = JSON.parse(arg);\n } catch (err) {}\n return arg;\n }", "title": "" }, { "docid": "83923e1e3ca97fc0737a7bb1ce987554", "score": "0.5284465", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2.default[key] : args[key];\n }", "title": "" }, { "docid": "83923e1e3ca97fc0737a7bb1ce987554", "score": "0.5284465", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2.default[key] : args[key];\n }", "title": "" }, { "docid": "83923e1e3ca97fc0737a7bb1ce987554", "score": "0.5284465", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2.default[key] : args[key];\n }", "title": "" }, { "docid": "812cd2c200e69df8d32f526ca04ff99c", "score": "0.5280297", "text": "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2.default[key] : args[key];\n\t }", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.52771664", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.52771664", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.52771664", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.52771664", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.52771664", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "7faaac799c18595c21f8738171edb200", "score": "0.52700347", "text": "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 }", "title": "" }, { "docid": "246754065ad212a234a231418b782a6f", "score": "0.5269969", "text": "function getParsedArg(arg) {\n try {\n var parsedArg = $parse(arg)();\n if (_.isObject(parsedArg) || _.isArray(parsedArg)) {\n return parsedArg;\n } else {\n return null;\n }\n } catch (e) {\n return null;\n }\n }", "title": "" }, { "docid": "683b112b623a12dd7b593df56a0768ed", "score": "0.5265165", "text": "function parseArgs(str) {\n // regex from npm string-argv\n //[^\\s'\"] Match if not a space ' or \"\n\n //+|['] or Match '\n //([^']*) Match anything that is not '\n //['] Close match if '\n\n //+|[\"] or Match \"\n //([^\"]*) Match anything that is not \"\n //[\"] Close match if \"\n var rx = /[^\\s'\"]+|[']([^']*?)[']|[\"]([^\"]*?)[\"]/gi;\n var value = str;\n var unnammedArgs = [];\n var args = { _: unnammedArgs };\n var match, key;\n do {\n //Each call to exec returns the next regex match as an array\n match = rx.exec(value);\n if (match !== null) {\n //Index 1 in the array is the captured group if it exists\n //Index 0 is the matched text, which we use if no captured group exists\n var arg = match[2] ? match[2] : (match[1]?match[1]:match[0]);\n if (key) {\n args[key] = arg;\n key = null;\n } else {\n if (arg.substr(arg.length-1) === '=') {\n key = arg.substr(0, arg.length-1);\n // remove leading '-' if it exists.\n if (key.substr(0,1)=='-') {\n key = key.substr(1);\n }\n } else {\n unnammedArgs.push(arg)\n key = null;\n }\n }\n }\n } while (match !== null);\n return args;\n}", "title": "" }, { "docid": "483a3ab287eb5b4400741af372ec99a0", "score": "0.5260661", "text": "get args() {\n const argv = process.argv instanceof Object ? process.argv : [];\n const args = {};\n\n if (argv.length > 2) {\n argv.slice(2).forEach((arg) => {\n const name = String(arg.split('=')[0]);\n const key = name.replace('--', '');\n const value = String(arg.substring(arg.indexOf('=') + 1)).replace('--', '');\n\n if (key === value && Object.keys(this.defaults).includes(value)) {\n // Only accept CLI arguments when defining the required plugins.\n if (name.startsWith('--')) {\n args[key] = !this.defaults[key];\n }\n\n return;\n }\n\n switch (value.toLocaleLowerCase()) {\n case 'true':\n args[key] = true;\n break;\n case 'false':\n args[key] = false;\n break;\n default:\n args[key] = value;\n break;\n }\n });\n }\n\n const privateArgs = {};\n Object.keys(args)\n .filter((arg) => Object.keys(this.defaults).includes(arg))\n .forEach((arg) => {\n privateArgs[arg] = args[arg];\n });\n\n const customArgs = {};\n\n const initialArgs = [].concat(...Object.keys(args).map((a) => a.split(','))).filter((b) => b);\n\n initialArgs\n .filter((arg) => !Object.keys(this.defaults).includes(arg))\n .forEach((arg) => {\n customArgs[arg] = args[arg];\n });\n\n return Object.assign(this.defaults, Object.assign(privateArgs, { customArgs }));\n }", "title": "" }, { "docid": "66855c6a50485a2d0966f030564d6454", "score": "0.52568984", "text": "function getParam(key, source)\n\t{\n\t\tvar result = new RegExp(key + \"=([^&]*)\", \"i\").exec(source ? source : window.location.search);\n\t\treturn result && unescape(result[1]) || \"\";\n\t}", "title": "" }, { "docid": "a245e531ed3bf98e6df437219fcb1674", "score": "0.5240202", "text": "function get_args(argv, args) {\n var m;\n argv.forEach(function (arg) {\n if (m = arg.match(/^-?-?port=(\\d+)/i)) {\n args.port = parseInt(m[1], 10);\n } else if (m = arg.match(/^-?-?ip=(\\S*)/i)) {\n args.ip = m[1];\n } else if (arg.match(/^-?-?h(elp)?$/i)) {\n args.help = true;\n } else if (m = arg.match(/^-?-?doc(?:ument)?s=(\\S+)/)) {\n args.documents = m[1];\n } else if (m = arg.match(/^-?-?app=(\\S+)/i)) {\n args.apps.push(m[1]);\n }\n });\n return args;\n}", "title": "" }, { "docid": "d98f3c386bfb1488e7fe15c821b4f115", "score": "0.5237711", "text": "function getParams(key) {\n var reg = new RegExp(\"(^|@)\" + key + \"=([^@]*)(@|$)\");\n var r = window.location.search.substr(1).match(reg);\n if (r != null) {return unescape(r[2]);}\n else{\n console.log(\"there is no parameter\")\n };\n }", "title": "" }, { "docid": "c209d02535530a6c3668720395725344", "score": "0.52360004", "text": "parseArgument() {\n let isConst = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(_tokenKind.TokenKind.COLON);\n return this.node(start, {\n kind: _kinds.Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst)\n });\n }", "title": "" }, { "docid": "fd8bb2fb5fd05d96a02e671b483303f1", "score": "0.5233754", "text": "function getInstruction(_processArgv) {\n var instruction = {\n cmd: \"\",\n search: \"\"\n };\n instruction.cmd = process.argv[2];\n instruction.search = process.argv.splice(3).join(\" \");\n return instruction;\n}", "title": "" }, { "docid": "c1215a9c959f79e8804dcbcdda90b590", "score": "0.52288204", "text": "function parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.Kind.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "47edd54a7c4eab0dd5f9ededab9d3588", "score": "0.52272373", "text": "function parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "47edd54a7c4eab0dd5f9ededab9d3588", "score": "0.52272373", "text": "function parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "47edd54a7c4eab0dd5f9ededab9d3588", "score": "0.52272373", "text": "function parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "00a5ff59ce09d610967f39ee03a7f7df", "score": "0.52254057", "text": "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "title": "" }, { "docid": "93f29569cf99cfd96c7c7a73adca804a", "score": "0.5219136", "text": "function getArg(value, defaultValue) {\n return value ? value : defaultValue;\n}", "title": "" }, { "docid": "66ed371986e2a92e54a6e42074dee0aa", "score": "0.52004945", "text": "function getVersionParam() {\n if (command.getArguments().length > 0 && command.getArguments().get(0).trim().length > 0) {\n var regexp = /version=([\\w.-]+)/;\n var result = regexp.exec(command.getArguments().get(0).trim());\n if (result && result.length > 1) {\n return result[1];\n }\n }\n return null;\n }", "title": "" }, { "docid": "f77626e74203a29947374d69c504d84e", "score": "0.5180735", "text": "get(arg) {}", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.51772875", "text": "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 }", "title": "" }, { "docid": "7fa0d7e87bbc1a27af886d1967386709", "score": "0.5164012", "text": "function getArguments() {\n var port = 3000;\n var path = './applications';\n var args = process.argv.slice(2);\n\n while (args.length) {\n var arg = args.shift();\n switch (arg) {\n case '-p':\n port = args.shift();\n break;\n default:\n path = arg;\n }\n }\n\n return {\n port: port,\n path: path\n };\n}", "title": "" }, { "docid": "2ad835b9d1bfed56968dd5dfa208b4f4", "score": "0.5162036", "text": "function get_args( args ) { return util.tostr( args[0] ) === '[object Arguments]' ? args[0] : args; }", "title": "" }, { "docid": "cb48f43af7c6ce5db798d4b034b22dee", "score": "0.5148745", "text": "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 }", "title": "" }, { "docid": "dbb1a0c0341e581b90a9c10458f59710", "score": "0.5147977", "text": "function parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "4eb46d24754a1a3b6e4a9e81b1e1f183", "score": "0.51473194", "text": "function getValue() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var arg = _step.value;\n\n if (arg !== undefined && arg === arg) {\n return arg;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }", "title": "" }, { "docid": "e154f7ae8c429b624b9d7154cf9625d6", "score": "0.51464695", "text": "function getUrlParam(key) { \n // Gets all user params\n let params = location.search.replace(\"?\", \"\");\n\n // Removes all ampersands from parameters\n params = params.split(\"&\");\n\n // Defines default value\n let value = null;\n\n // Loops through each parameter\n for (let i = 0; i < params.length; i++) {\n // Gets current parameter\n let parameter = params[i].split(\"=\");\n\n // Checks if given key exists in parameter\n if (key === parameter[0]) {\n // Sets value to second element\n value = parameter[1];\n\n // Exits current loop\n break;\n }\n }\n\n // Returns final value\n return value;\n}", "title": "" } ]
8b3a9328c36fe20d739d4ce71934d8cb
oldstyle streams. Note that the pipe method (the only relevant part of this class) is overridden in the Readable class.
[ { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.0", "text": "function Stream() {\n EE.call(this);\n}", "title": "" } ]
[ { "docid": "4c3037f28292871d9cef403b5ea78126", "score": "0.67981195", "text": "function PlainStream() {}", "title": "" }, { "docid": "09825a6dd47785f212e9a6cdcb54e23b", "score": "0.65313095", "text": "function createStream (data) {\n var rs = new Readable({ objectMode: true });\n rs.push(data);\n rs.push(null);\n\n return rs;\n}", "title": "" }, { "docid": "811727c91be37b2d8106bdd1582cd182", "score": "0.6500395", "text": "function pipesetup() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n return streams.reduce(function (src, dst) {\n src.on('error', function (err) {\n return dst.emit('error', err);\n });\n return src.pipe(dst);\n });\n} // return a Readable stream that emits data", "title": "" }, { "docid": "d3a2376ff4befa5a09b681943a013e5d", "score": "0.6413265", "text": "function StreamLikeSequence() {}", "title": "" }, { "docid": "e2ef5d1b7f22fb56bba250cc1ce7414d", "score": "0.6339972", "text": "function through(write,end,opts){write=write||function(data){this.queue(data);};end=end||function(){this.queue(null);};var ended=false,destroyed=false,buffer=[],_ended=false;var stream=new Stream();stream.readable=stream.writable=true;stream.paused=false;// stream.autoPause = !(opts && opts.autoPause === false)\nstream.autoDestroy=!(opts&&opts.autoDestroy===false);stream.write=function(data){write.call(this,data);return!stream.paused;};function drain(){while(buffer.length&&!stream.paused){var data=buffer.shift();if(null===data)return stream.emit('end');else stream.emit('data',data);}}stream.queue=stream.push=function(data){// console.error(ended)\nif(_ended)return stream;if(data===null)_ended=true;buffer.push(data);drain();return stream;};//this will be registered as the first 'end' listener\n//must call destroy next tick, to make sure we're after any\n//stream piped from here.\n//this is only a problem if end is not emitted synchronously.\n//a nicer way to do this is to make sure this is the last listener for 'end'\nstream.on('end',function(){stream.readable=false;if(!stream.writable&&stream.autoDestroy)process.nextTick(function(){stream.destroy();});});function _end(){stream.writable=false;end.call(stream);if(!stream.readable&&stream.autoDestroy)stream.destroy();}stream.end=function(data){if(ended)return;ended=true;if(arguments.length)stream.write(data);_end();// will emit or queue\nreturn stream;};stream.destroy=function(){if(destroyed)return;destroyed=true;ended=true;buffer.length=0;stream.writable=stream.readable=false;stream.emit('close');return stream;};stream.pause=function(){if(stream.paused)return;stream.paused=true;return stream;};stream.resume=function(){if(stream.paused){stream.paused=false;stream.emit('resume');}drain();//may have become paused again,\n//as drain emits 'data'.\nif(!stream.paused)stream.emit('drain');return stream;};return stream;}", "title": "" }, { "docid": "91adb5fe59968bdbf82e3188f2c7fb78", "score": "0.63124484", "text": "getStream() {\n const s = new stream_1.Readable();\n s.push(this.getBody());\n s.push(null);\n return s;\n }", "title": "" }, { "docid": "7299c96550cea3de930ffb7a762ec963", "score": "0.62897485", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream);}}", "title": "" }, { "docid": "1d0a6e7c7ac0da2e2933b1d08e73aa96", "score": "0.6283634", "text": "getReadableStream() {\n return new BuffersStream(this.buffers, this.size);\n }", "title": "" }, { "docid": "761854a312e6cda78f1a24f1fa7a2fd9", "score": "0.6233655", "text": "function emitReadable(stream){var state=stream._readableState;debug('emitReadable',state.needReadable,state.emittedReadable);state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;process.nextTick(emitReadable_,stream);}}", "title": "" }, { "docid": "faa27d3370a420c0b00963db912057f1", "score": "0.6223067", "text": "cloneBodyStream () {\n const input = buffered != null ? buffered : readable;\n const p1 = new _stream.PassThrough();\n const p2 = new _stream.PassThrough();\n input.pipe(p1);\n input.pipe(p2);\n buffered = p2;\n return p1;\n }", "title": "" }, { "docid": "5ef523e459b9a49b42b13f7f12981dee", "score": "0.6198524", "text": "function Writable(){this.writable=!0;stream.Stream.call(this)}", "title": "" }, { "docid": "935276f3134afe98115dcb01f8477266", "score": "0.6183095", "text": "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream);}}", "title": "" }, { "docid": "14c77d0ff743dd1976a1c26fc2533f89", "score": "0.6176866", "text": "function OpStream(v) {\n Readable.call(this, {objectMode:true});\n\n // Version number of the next op we expect to see. Be careful - this is modified & used in a few\n // places.\n this._v = v;\n\n this.open = true;\n}", "title": "" }, { "docid": "0ccd1fe711aeeb899a8da1366d04afb3", "score": "0.6145078", "text": "function polyfillReadable() {\n stream.Readable.from = (iterable) => {\n const iterator = iterable[Symbol.iterator]();\n\n return new stream.Readable({\n read() {\n const {value, done} = iterator.next();\n this.push(done ? null : value);\n }\n })\n }\n}", "title": "" }, { "docid": "24dce507ef188e939eb9be41c04a460e", "score": "0.61040354", "text": "function Stream() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "24dce507ef188e939eb9be41c04a460e", "score": "0.61040354", "text": "function Stream() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "2e829c87128dc17290f07f668d5c57af", "score": "0.604723", "text": "function Stream() {\n EventEmitter.call(this);\n }", "title": "" }, { "docid": "ab2c655678a686530e220a5a8e3a7dd2", "score": "0.5995057", "text": "function ReadableStream(options, cursor) {\n\t\t if (cursor) this._cursor = cursor;\n\t\t this._pending = 0; // How many time we called _read while no cursor was available\n\t\t this._index = 0;\n\t\t this._maxRecursion = 1000; // Hardcoded\n\t\t this._highWaterMark = options.highWaterMark;\n\n\t\t Readable.call(this, {\n\t\t objectMode: true,\n\t\t highWaterMark: this._highWaterMark\n\t\t });\n\t\t}", "title": "" }, { "docid": "916206e6186a0f21a050c060f8652007", "score": "0.5990868", "text": "function through_v1(write, end, opts) {\n write = write || function (data) { this.queue(data) }\n end = end || function () { this.queue(null) }\n\n var ended = false\n var destroyed = false\n var buffer = []\n var _ended = false\n var stream = new Stream()\n stream.readable = stream.writable = true\n stream.paused = false\n\n// stream.autoPause = !(opts && opts.autoPause === false)\n stream.autoDestroy = !(opts && opts.autoDestroy === false)\n\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = stream.push = function (data) {\n// console.error(ended)\n if(_ended) return stream\n if(data === null) _ended = true\n buffer.push(data)\n drain()\n return stream\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable && stream.autoDestroy)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable && stream.autoDestroy)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n return stream\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n return stream\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n return stream\n }\n\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n stream.emit('resume')\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n return stream\n }\n return stream\n}", "title": "" }, { "docid": "66cce7e9162038025f98c0d9c5049a7f", "score": "0.5973445", "text": "function BufferStream() {\n this.chunks = [];\n this.length = 0;\n this.writable = true;\n this.readable = true;\n}", "title": "" }, { "docid": "fe53558d3888dabeb7b43c22ad808982", "score": "0.59634376", "text": "function stream() {\n\tlet out = \"\";\n\treturn {\n\t\twrite(str) {\n\t\t\tout += str;\n\t\t},\n\t\tdump() {\n\t\t\treturn out;\n\t\t}\n\t};\n}", "title": "" }, { "docid": "752e3d5e916035f22c9456707a1eaac0", "score": "0.59530574", "text": "function Stream() {\n EventEmitter.call(this);\n }", "title": "" }, { "docid": "6ce081bb6e7fe6d7604317615be9cfca", "score": "0.59460586", "text": "function InputStream() {\n stream.Readable.call(this);\n\n this._buffer = [];\n this._canPush = true;\n}", "title": "" }, { "docid": "51f7a4c97b6762df5da320333da6a156", "score": "0.5938452", "text": "readFileStream(path) {\n var deepest = this._snapshotOfDeepest(path);\n var f = deepest[this._last(path)];\n //console.log(`Attempting to read from ${f}`, typeof f, deepest, this._last(path), path);\n\n var rs = Readable();\n\n const max = 5;\n let currIdx = 0;\n rs._read = () => {\n //console.log(\"Trying to read\", currIdx, f.length, max);\n if (currIdx >= f.length) {\n rs.push(null);\n rs.emit('close');\n } else {\n const chunk = f.slice(currIdx, Math.min(max+currIdx, f.length))\n chunk.forEach(l => rs.push(l));\n currIdx += max\n rs.emit('keepgoing');\n }\n }\n return rs;\n }", "title": "" }, { "docid": "e59c77d41f04115a08f746b406c985ea", "score": "0.5919197", "text": "function through (write, end) {\n write = write || function (data) { this.emit('data', data) }\n end = end || function () { this.emit('end') }\n\n var ended = false, destroyed = false\n var stream = new Stream(), buffer = []\n stream.buffer = buffer\n stream.readable = stream.writable = true\n stream.paused = false\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = function (data) {\n buffer.push(data)\n drain()\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n }\n return stream\n}", "title": "" }, { "docid": "e59c77d41f04115a08f746b406c985ea", "score": "0.5919197", "text": "function through (write, end) {\n write = write || function (data) { this.emit('data', data) }\n end = end || function () { this.emit('end') }\n\n var ended = false, destroyed = false\n var stream = new Stream(), buffer = []\n stream.buffer = buffer\n stream.readable = stream.writable = true\n stream.paused = false\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = function (data) {\n buffer.push(data)\n drain()\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n }\n return stream\n}", "title": "" }, { "docid": "135635d9add8c15595713cad98564b31", "score": "0.5894014", "text": "stream(destination, options) {\n\t\t// In Node 10+ use stream.pipeline()\n\t\tthis._response.pipe(destination, options);\n\t}", "title": "" }, { "docid": "383bb43931481b887eb9938f025f0905", "score": "0.58676904", "text": "function MyRawStream() {}", "title": "" }, { "docid": "57fb0c6b4ba39912b0357080efc4e139", "score": "0.5863952", "text": "function emitReadable(stream) {\r\n var state = stream._readableState;\r\n debug('emitReadable', state.needReadable, state.emittedReadable);\r\n state.needReadable = false;\r\n\r\n if (!state.emittedReadable) {\r\n debug('emitReadable', state.flowing);\r\n state.emittedReadable = true;\r\n process.nextTick(emitReadable_, stream);\r\n }\r\n }", "title": "" }, { "docid": "592614ce1b495c1cb1af272bf6bf0c2c", "score": "0.5862727", "text": "function FlattenContentsStream(opts) {\n Transform.call(this);\n this.opts = opts;\n this.data = [];\n}", "title": "" }, { "docid": "e473c316f5a371c5a2a79d035b345c2c", "score": "0.5862407", "text": "function emitReadable(stream) {\r\n\t var state = stream._readableState;\r\n\t state.needReadable = false;\r\n\t if (!state.emittedReadable) {\r\n\t debug('emitReadable', state.flowing);\r\n\t state.emittedReadable = true;\r\n\t if (state.sync)\r\n\t process.nextTick(function() {\r\n\t emitReadable_(stream);\r\n\t });\r\n\t else\r\n\t emitReadable_(stream);\r\n\t }\r\n\t}", "title": "" }, { "docid": "0e6148b0a37da66a93345b98f36338dd", "score": "0.5859594", "text": "function emitReadable(stream) {\r\n var state = stream._readableState;\r\n state.needReadable = false;\r\n if (!state.emittedReadable) {\r\n debug('emitReadable', state.flowing);\r\n state.emittedReadable = true;\r\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\r\n }\r\n }", "title": "" }, { "docid": "ed3ab1500477e095ae89ed79b7ddf461", "score": "0.58500665", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "dd5dbcac563f739bd596de20bf630af0", "score": "0.5842935", "text": "tee() {\n\t\tconsole.warn('TO BE IMPLEMENTED ReadableStreamAdapter.tee()');\n\t\treturn [this, this]\n\t}", "title": "" }, { "docid": "a787176362b41c633ae8e8b553ccb8b6", "score": "0.5841369", "text": "function shellExecStream() {\n var ss = new stream.Transform({\n objectMode: true\n });\n ss._transform = function(chunk, encoding, done) {\n shellExec(chunk, function(err, result) {\n if (err) {\n done(err);\n } else {\n ss.push(result);\n done();\n }\n });\n };\n return ss;\n}", "title": "" }, { "docid": "57f31a5ba3d2357a7a60eb1536ac4679", "score": "0.58406556", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "2bca7d60b17eb043e07405c376871abe", "score": "0.5836569", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug(\"emitReadable\", state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);\n else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "b8df18ad643b81d8d8962557b0956191", "score": "0.58358705", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug(\"emitReadable\", state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "0a7102d76546a1da39f1a04008e3249c", "score": "0.5831694", "text": "function through (write, end) {\n write = write || function (data) { this.queue(data) }\n end = end || function () { this.queue(null) }\n\n var ended = false, destroyed = false, buffer = []\n var stream = new Stream()\n stream.readable = stream.writable = true\n stream.paused = false\n\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = stream.push = function (data) {\n buffer.push(data)\n drain()\n return stream\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n return stream\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n return stream\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n return stream\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n return stream\n }\n return stream\n}", "title": "" }, { "docid": "0a7102d76546a1da39f1a04008e3249c", "score": "0.5831694", "text": "function through (write, end) {\n write = write || function (data) { this.queue(data) }\n end = end || function () { this.queue(null) }\n\n var ended = false, destroyed = false, buffer = []\n var stream = new Stream()\n stream.readable = stream.writable = true\n stream.paused = false\n\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = stream.push = function (data) {\n buffer.push(data)\n drain()\n return stream\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n return stream\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n return stream\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n return stream\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n return stream\n }\n return stream\n}", "title": "" }, { "docid": "0a7102d76546a1da39f1a04008e3249c", "score": "0.5831694", "text": "function through (write, end) {\n write = write || function (data) { this.queue(data) }\n end = end || function () { this.queue(null) }\n\n var ended = false, destroyed = false, buffer = []\n var stream = new Stream()\n stream.readable = stream.writable = true\n stream.paused = false\n\n stream.write = function (data) {\n write.call(this, data)\n return !stream.paused\n }\n\n function drain() {\n while(buffer.length && !stream.paused) {\n var data = buffer.shift()\n if(null === data)\n return stream.emit('end')\n else\n stream.emit('data', data)\n }\n }\n\n stream.queue = stream.push = function (data) {\n buffer.push(data)\n drain()\n return stream\n }\n\n //this will be registered as the first 'end' listener\n //must call destroy next tick, to make sure we're after any\n //stream piped from here.\n //this is only a problem if end is not emitted synchronously.\n //a nicer way to do this is to make sure this is the last listener for 'end'\n\n stream.on('end', function () {\n stream.readable = false\n if(!stream.writable)\n process.nextTick(function () {\n stream.destroy()\n })\n })\n\n function _end () {\n stream.writable = false\n end.call(stream)\n if(!stream.readable)\n stream.destroy()\n }\n\n stream.end = function (data) {\n if(ended) return\n ended = true\n if(arguments.length) stream.write(data)\n _end() // will emit or queue\n return stream\n }\n\n stream.destroy = function () {\n if(destroyed) return\n destroyed = true\n ended = true\n buffer.length = 0\n stream.writable = stream.readable = false\n stream.emit('close')\n return stream\n }\n\n stream.pause = function () {\n if(stream.paused) return\n stream.paused = true\n stream.emit('pause')\n return stream\n }\n stream.resume = function () {\n if(stream.paused) {\n stream.paused = false\n }\n drain()\n //may have become paused again,\n //as drain emits 'data'.\n if(!stream.paused)\n stream.emit('drain')\n return stream\n }\n return stream\n}", "title": "" }, { "docid": "cd1c460d52cbdc85d74feb0349112c56", "score": "0.58269596", "text": "tee() {\n\t\tconsole.warn('TO BE IMPLEMENTED ReadableStreamAdapter.tee()')\n\t\treturn [this, this]\n\t}", "title": "" }, { "docid": "c3f9e6478f5eb047bba48a8b396988ea", "score": "0.5822469", "text": "function isNodeReadableStream(body) {\n return body && typeof body.pipe === \"function\";\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.5808749", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "f8fc89b2e24d8e0c2fb3dd34d9f1260d", "score": "0.5805283", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "0c4032e2689ff00c7d80e106a12c4df4", "score": "0.58030826", "text": "function mkStream(input) {\n var I = {};\n var pos = 0;\n\n I.error = null;\n I.consumed = null;\n\tI.data = null;\n\n\t// Returns the next available character from the input stream,\n\t// or EOF if there is none.\n I.ch = function() {\n\t if (input.length < 1) {\n\t\treturn EOF;\n\t }\n return input[pos];\n };\n\n\t// Returns a copy of this stream, with error condition set to\n\t// the provided value.\n I.raise = function(error) {\n var s = mkStream(input);\n s.error = error;\n\t if (debug.ultra) {\n\t\tconsole.log(\"failed to consume anything from [\" + input + \"]: \" + error);\n\t }\n return s;\n };\n\n\t// Returns a copy of this stream after consuming n characters\n\t// and setting the data property to the provided value.\n I.consume = function(n, data) {\n\t if (typeof data === \"undefined\") data = null;\n var s = mkStream(input.slice(n));\n s.consumed = input.slice(0, n);\n\t s.data = data;\n\t if (debug.ultra) {\n\t\tconsole.log(\"consumed [\" + s.consumed + \"] from [\" + input + \"], leaving [\" + s.string() + \"]\");\n\t }\n return s;\n };\n\n\t// Returns the entire input stream as a string.\n I.string = function() {\n return input;\n };\n\n\t// Returns the value of this stream, defined as the data\n\t// property if it is non-null, or the text that was consumed\n\t// in the creation of this stream.\n\tI.value = function() {\n\t if (I.data !== null) {\n\t\treturn I.data;\n\t } else if (I.consumed !== null && I.consumed.length > 0) {\n\t\treturn I.consumed;\n\t }\n\t return null;\n\t}\n\n return I;\n }", "title": "" }, { "docid": "a096ea5d1e921ee7dc8e211160795290", "score": "0.5796447", "text": "function ChunkedStream (matcher, passEmpty) {\n if (!(this instanceof ChunkedStream)) return new ChunkedStream(matcher, passEmpty)\n\n if (typeof matcher === 'undefined') {\n matcher = '\\n'\n }\n\n this.matcher = matcher\n this.passEmpty = passEmpty\n this.buffer = ''\n\n this.writable = true\n this.readable = true\n}", "title": "" }, { "docid": "eb3bab9676357fa17895a44e9c50beb8", "score": "0.5795446", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "234b8fd2bf01258805d96088025a719c", "score": "0.5790215", "text": "function pipe(readStream, writeStream, opts = {}) {\n let options = Object.assign({resolveOn: \"close\"}, opts);\n let resolveEvent = options.resolveOn;\n delete options.resolveOn;\n return new Promise((resolve, reject) => {\n function errorHandler(err) {\n cleanup();\n reject(err);\n }\n\n function doneHandler() {\n cleanup();\n resolve();\n }\n\n function cleanup() {\n readStream.off('error', errorHandler);\n writeStream.off('error', errorHandler);\n writeStream.off(resolveEvent, doneHandler);\n }\n\n // register our event handlers\n readStream.once('error', errorHandler);\n writeStream.once('error', errorHandler);\n writeStream.once(resolveEvent, doneHandler);\n\n // start the pipe operation\n readStream.pipe(writeStream, options);\n });\n}", "title": "" }, { "docid": "52fc991a085f8312d9b6d1a0a684b47f", "score": "0.5788345", "text": "function emitReadable(stream) {\r\n var state = stream._readableState;\r\n state.needReadable = false;\r\n if (!state.emittedReadable) {\r\n debug('emitReadable', state.flowing);\r\n state.emittedReadable = true;\r\n if (state.sync)\r\n process.nextTick(function() {\r\n emitReadable_(stream);\r\n });\r\n else\r\n emitReadable_(stream);\r\n }\r\n}", "title": "" }, { "docid": "52fc991a085f8312d9b6d1a0a684b47f", "score": "0.5788345", "text": "function emitReadable(stream) {\r\n var state = stream._readableState;\r\n state.needReadable = false;\r\n if (!state.emittedReadable) {\r\n debug('emitReadable', state.flowing);\r\n state.emittedReadable = true;\r\n if (state.sync)\r\n process.nextTick(function() {\r\n emitReadable_(stream);\r\n });\r\n else\r\n emitReadable_(stream);\r\n }\r\n}", "title": "" }, { "docid": "e908088374f6d8393ccc01a446edbb51", "score": "0.57864386", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "5bb7417eec9915ade14bf18c570f74c7", "score": "0.578349", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "5bb7417eec9915ade14bf18c570f74c7", "score": "0.578349", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "7728a0c24ec92c0a298ba6d20252d94c", "score": "0.5777345", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "7728a0c24ec92c0a298ba6d20252d94c", "score": "0.5777345", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n }", "title": "" }, { "docid": "85289139d6606ab7d0df8b21149e83b9", "score": "0.5776884", "text": "function pipe(fs, x) {\n return Z.reduce(function(x, f) { return f(x); }, x, fs);\n }", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" }, { "docid": "ba90ccae155797a8fa3a7a0452d214c1", "score": "0.5774124", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" } ]
b94395a150d01dbf1f3e5ccec40b7231
Simple 2D JavaScript Vector Class Hacked from evanw's lightgl.js
[ { "docid": "979189473d4ca80efb03ae06bd5962f6", "score": "0.6315542", "text": "function Vector(x, y) {\n\tthis.x = x || 0;\n\tthis.y = y || 0;\n\tthis.limit = undefined;\n}", "title": "" } ]
[ { "docid": "6141569c1283a67e77c038dc1fae6b0e", "score": "0.7210479", "text": "create_vector() { return {x:0,y:0} }", "title": "" }, { "docid": "4d90e0cc3556aebd0c1a67eb290944de", "score": "0.7126741", "text": "function vec4() \r\n{\r\n this.v = [ 0, 0, 0, 1 ]\r\n}", "title": "" }, { "docid": "522c9b287d2b2928a2263ddac0489c88", "score": "0.70928025", "text": "function Vector(x, y){\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "bd7e223b4f943b8496b39761a47af49b", "score": "0.7053448", "text": "function Vector(x,y){\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "953f9209d4b2580932384abdba9c0667", "score": "0.70305485", "text": "function Vector(x, y) {\n this.x = x; this.y = y;\n}", "title": "" }, { "docid": "10a4f53337e8923c55a10bae9be5c0a2", "score": "0.70072347", "text": "function Vector( x, y ){\n //alert(\"vector made\");\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "50faebae338c0ed41e27e93b290e382d", "score": "0.7002875", "text": "function Vector2d(x, y) {\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "21418abdcbbf83b32a1098f932774110", "score": "0.6997537", "text": "function vector() {\n return new Vector([].slice.call(arguments));\n }", "title": "" }, { "docid": "73f2c3b7ab928724244c9fa0c9d5ecd2", "score": "0.6994155", "text": "constructor(\n /** x value of the vector */\n x, \n /** y value of the vector */\n y, \n /** z value of the vector */\n z, \n /** w value of the vector */\n w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "title": "" }, { "docid": "5f1811f57eb51320d436b60c0e89722b", "score": "0.6983846", "text": "constructor(x,y,w,h,clr){\n this.loc = createVector(x,y)\n this.w = w;\n this.h = h;\n}", "title": "" }, { "docid": "cdfe8588f86f7c4dd15bea24e4a867ff", "score": "0.6937859", "text": "function Vector(x, y) {\n this.x = Number(x);\n this.y = Number(y);\n}", "title": "" }, { "docid": "36c13bb723a645baf25d9b6f1020a958", "score": "0.6895154", "text": "function Vec2(x,y) {\n this.x=x;\n this.y=y;\n if(this.y == null) this.y=this.x;\n\n this.toString = function() {\n return \"(\" + rnd(this.x,2) + \", \" + rnd(this.y,2) + \")\";\n }\n this.add = function(v) {\n return new Vec2(this.x+v.x, this.y+v.y);\n }\n this.subtract = function(v) {\n var value = parseFloat(v);\n if(!isNaN(value)) {\n v = new Vec2(value, value);\n }\n return new Vec2(this.x-v.x, this.y-v.y);\n }\n this.scale = function(scalar) {\n return new Vec2(scalar*this.x, scalar*this.y);\n }\n this.vmult = function(v) {\n return new Vec2(this.x*v.x, this.y*v.y);\n }\n this.dot = function(v) {\n return this.x*v.x + this.y*v.y;\n }\n this.length = function() {\n return Math.sqrt(this.x*this.x + this.y*this.y);\n }\n this.distance = function(v) {\n x = this.x-v.x; y = this.y-v.y;\n return Math.sqrt(x*x + y*y);\n }\n this.apply = function(f) {\n return new Vec2(f(this.x), f(this.y));\n }\n this.floor = function() {\n return this.apply(Math.floor);\n }\n this.fract = function() {\n return this.subtract(this.apply(Math.floor));\n }\n this.normalize = function() {\n var l = this.length();\n return new Vec2(this.x / l, this.y / l);\n }\n this.cross = function(v) {\n return this.length() * v.length () * this.angle(v);\n }\n}", "title": "" }, { "docid": "f633d4bc8f3e60b29a133e7d4caea56c", "score": "0.6883752", "text": "function Vector(_x, _y) {\n this.x = _x;\n this.y = _y;\n}", "title": "" }, { "docid": "6157887f21c25cbb50b4358ee8d6a7e2", "score": "0.6838608", "text": "function Vector(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n}", "title": "" }, { "docid": "40213dffc10c0641cae48265abf9fb73", "score": "0.6832666", "text": "constructor(x,y){ // define the constructor for new vector objects\n this.x=x;\n this.y=y;\n }", "title": "" }, { "docid": "cc4c22fdecf23b919692c85429c6ae7e", "score": "0.68306124", "text": "function Vector(x,y){ \n return [x,y];\n }", "title": "" }, { "docid": "cc4c22fdecf23b919692c85429c6ae7e", "score": "0.68306124", "text": "function Vector(x,y){ \n return [x,y];\n }", "title": "" }, { "docid": "7eca205839643571fab0393be5419268", "score": "0.6823067", "text": "function Vector(x, y)\n{\n\tthis.x = x;\n\tthis.y = y;\n \n\t// Calculate the length of a the vector\n\t// @param void\n\t// @return vector\n\tthis.Length = function Length()\n\t{\n\t\treturn Math.sqrt((this.x * this.x) + (this.y * this.y));\n\t}\n \n\t// Substract 2 vectors\n\t// @param v A vector\n\t// @return vector\n\tthis.Substract = function Substract(v)\n\t{\n\t\treturn new toolbox.Vector(this.x - v.x, this.y - v.y);\n\t}\n \n\t// Calculate a vector dot product\n\t// @param v A vector\n\t// @return The dot product\n\tthis.DotProduct = function DotProduct(v)\n\t{\n\t\treturn (this.x * v.x + this.y * v.y);\n\t}\n \n\t// Normalize the vector\n\t// http://www.fundza.com/vectors/normalize/index.html\n\t// http://programmedlessons.org/VectorLessons/vch04/vch04_4.html\n\t// @param void\n\t// @return vector\n\tthis.Normalize = function Normalize()\n\t{\n\t\tvar length = this.Length();\n\t\tthis.x = this.x / length;\n\t\tthis.y = this.y / length;\n\t}\n \n\t// Calculate the perpendicular vector (normal)\n\t// http://en.wikipedia.org/wiki/Perpendicular_vector\n\t// @param void\n\t// @return vector\n\tthis.Perp = function Perp()\n\t{\n\t\treturn new Vector(-this.y, this.x);\n\t}\n}", "title": "" }, { "docid": "185da10c60918eed66862da8a29d8567", "score": "0.6815812", "text": "function vect (x, y) {\n return new Vector2D (x, y);\n }", "title": "" }, { "docid": "7a8e0d3a3fe203c6d6ce9c54a9235b6f", "score": "0.68078285", "text": "function ExtVector(x, y)\n{\n\tthis.__defineGetter__(\"Zero\", function() { return new Vector(0, 0); });\n\n\tthis.__defineGetter__(\"X\", function() { return this.x; });\n\tthis.__defineSetter__(\"X\", function(value) { this.x = value });\n\n\tthis.__defineGetter__(\"Y\", function() { return this.y; });\n\tthis.__defineSetter__(\"Y\", function(value) { this.y = value });\n\n\tthis.Add = function(v)\n\t{\n\t\treturn new Vector(this.x + v.x, this.y + v.y);\n\t}\n\n\tthis.Subtract = function(v)\n\t{\n\t\treturn new Vector(this.x - v.x, this.y - v.y);\n\t}\n\n\tthis.Multiply = function(s)\n\t{\n\t\treturn new Vector(this.x * s, this.y * s);\n\t}\n\n\tthis.Divide = function(s)\n\t{\n\t\treturn new Vector(this.x / s, this.y / s);\n\t}\n\n\tthis.ThisAdd = function(v)\n\t{\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t}\n\n\tthis.ThisSubtract = function(v)\n\t{\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t}\n\n\tthis.ThisMultiply = function(s)\n\t{\n\t\tthis.x *= s;\n\t\tthis.y *= s;\n\t}\n\n\tthis.ThisDivide = function(s)\n\t{\n\t\tthis.x /= s;\n\t\tthis.y /= s;\n\t}\n\n\tthis.Length = function()\n\t{\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tthis.LengthSquared = function()\n\t{\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tthis.Normal = function()\n\t{\n\t\treturn new Vector(-this.y, this.x);\n\t}\n\n\tthis.ThisNormal = function()\n\t{\n\t\tvar x = this.x;\n\t\tthis.x = -this.y\n\t\tthis.y = x;\n\t}\n\n\tthis.Normalize = function()\n\t{\n\t\tvar length = this.Length();\n\t\tif(length != 0)\n\t\t{\n\t\t\treturn new Vector(this.x / length, this.y / length);\n\t\t}\n\t}\n\n\tthis.ThisNormalize = function()\n\t{\n\t\tvar length = this.Length();\n\t\tif (length != 0)\n\t\t{\n\t\t\tthis.x /= length;\n\t\t\tthis.y /= length;\n\t\t}\n\t}\n\n\tthis.Negate = function()\n\t{\n\t\treturn new Vector(-this.x, -this.y);\n\t}\n\n\tthis.ThisNegate = function()\n\t{\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t}\n\n\tthis.Compare = function(v)\n\t{\n\t\treturn Math.abs(this.x - v.x) < 0.0001 && Math.abs(this.y - v.y) < 0.0001;\n\t}\n\n\tthis.Dot = function(v)\n\t{\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tthis.Cross = function(v)\n\t{\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tthis.Projection = function(v)\n\t{\n\t\treturn this.Multiply(v, (this.x * v.x + this.y * v.y) / (v.x * v.x + v.y * v.y));\n\t}\n\n\tthis.ThisProjection = function(v)\n\t{\n\t\tvar temp = (this.x * v.x + this.y * v.y) / (v.x * v.x + v.y * v.y);\n\t\tthis.x = v.x * temp;\n\t\tthis.y = v.y * temp;\n\t}\n\n\t// If x and y aren't supplied, default them to zero\n\tif (x == undefined) this.x = 0; else this.x = x;\n\tif (y == undefined) this.y = 0; else this.y = y;\n}", "title": "" }, { "docid": "bd77f42c0eeaaaea9d4f560b37a19418", "score": "0.6782384", "text": "function Vector(x, y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "title": "" }, { "docid": "910e9dc3522a3894dc09208a3baa9799", "score": "0.67677116", "text": "function Vector(x, y) {\n this.x = x != null ? x : 0.0;\n this.y = y != null ? y : 0.0;\n }", "title": "" }, { "docid": "ad60e68284f0ee220ce8585db57808eb", "score": "0.6724211", "text": "function Vector(x, y) {\n\t this.x = x || 0;\n\t this.y = y || 0;\n\t}", "title": "" }, { "docid": "9cf8b17384527d8752099299fd3cf1e2", "score": "0.6702472", "text": "function Vector2D(x, y) { if (isNull(y)) y = x; this.x = x; this.y = y; }", "title": "" }, { "docid": "61df4b767b8a3d3e6ed42356ec6c4c07", "score": "0.6663074", "text": "function Vector(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n}", "title": "" }, { "docid": "e57d27d00ee680079c32cf282c61bdf8", "score": "0.6644236", "text": "function Vector3() { }", "title": "" }, { "docid": "94c506a7a3f3e120c91e7d7f0d50978c", "score": "0.66293085", "text": "constructor(\n /** x value of the vector */\n x, \n /** y value of the vector */\n y, \n /** z value of the vector */\n z, \n /** w value of the vector */\n w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "title": "" }, { "docid": "bd6a1b1e0b53d3f11b6ee370a70ba1de", "score": "0.6627505", "text": "function Stick() {\r\n this.val = new Vec2d();\r\n}", "title": "" }, { "docid": "89f53a0b1831de0e29005b520fd9afde", "score": "0.6598935", "text": "function Vector2D(x, y) {\n if (typeof x === \"undefined\") { x = 0; }\n if (typeof y === \"undefined\") { y = 0; }\n this._length = 0;\n // this.x = x;\n // this.y = y;\n // this._length = 0;\n }", "title": "" }, { "docid": "64a092e571cb6c0523fc005c19e6ff88", "score": "0.65885437", "text": "function Vector(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "title": "" }, { "docid": "844251957700323bf271f528ea42b5ff", "score": "0.65874994", "text": "function vec2(x, y) {\n return { x: x, y: y };\n }", "title": "" }, { "docid": "2d31ec4ce8aed0709075017e02715668", "score": "0.65743184", "text": "function View(world, vector) {\r\n this.world = world;\r\n this.vector = vector;\r\n}", "title": "" }, { "docid": "5d89c650df91c3902d0ca107b0af7d8e", "score": "0.6568428", "text": "function Vector() {\n\t/**\n\t * PRIVATE\n\t * Javascript Array object used to implement the Vector object. It is a private attribute since it\n\t * is declared as a var attribute of the Vector object.\n\t */\n\tvar v = new Array();\n\t/**\n\t * PUBLIC\n\t * Inserts the specified element at the specified position in this Vector. Shifts the element\n\t * currently at that position (if any) and any subsequent elements to the right (adds one to their indices).\n\t * If no position is specified, the element at the objOrPos parameter is appended to the Vector.\n\t * @param (int or Object) objOrPos index at which the specified element is to be inserted (when the obj\n\t * parameter is null or not specified); otherway, it is the element to be appended at the end of the Vector.\n\t * @param (Object) obj element to be inserted. If null, the object to be inserted is specified at the\n\t * objOrPos parameter.\n\t */\n\tthis.add = function addObjToVector(objOrPos, obj) {\n\t\tif (obj == null) {\n\t\t\tv[v.length] = objOrPos;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tvar i = eval(objOrPos);\n\t\t\t\tif (i >= v.length) {\n\t\t\t\t\tv[i] = obj;\n\t\t\t\t} else {\n\t\t\t\t\tv.splice(i, 0, obj);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\talert(\"[Vector]: Attempting to add object failed. Possibly index is not an integer value.\");\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * PUBLIC\n\t * Adds the specified component to the end of this vector, increasing its size by one.\n\t * @param (Object) obj the component to be added.\n\t */\n\tthis.addElement = function addElementToVector(obj) {\n\t\tv[v.length] = obj;\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes all of the elements from this Vector.\n\t */\n\tthis.clear = function clearVector() {\n\t\tv.splice(0, v.length);\n\t}\n\t/**\n\t * PUBLIC\n\t * Tests if the specified object is a component in this vector.\n\t * @param (Object) elem an object.\n\t * @return (boolean) true if and only if the specified object is the same as a component\n\t * in this vector; false otherwise.\n\t */\n\tthis.contains = function containsVector(elem) {\n\t\tfor (var i = 0; i < v.length && v[i] != elem; i++) ;\n\t\treturn i < v.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the component at the specified index. This method is identical in functionality\n\t * to the get method.\n\t * @param (int) index an index into this vector.\n\t * @return (Object) the component at the specified index.\n\t */\n\tthis.elementAt = function elementAtVector(index) {\n\t\treturn v[eval(index)];\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns an enumeration of the components of this vector. The returned Enumeration object\n\t * will generate all items in this vector. The first item generated is the item at index 0,\n\t * then the item at index 1, and so on.\n\t * @return (Enumeration) an enumeration of the components of this vector.\n\t */\n\tthis.elements = function elementsOfVector() {\n\t\tvar e = new Enumeration();\n\t\tfor (var i = 0; i < v.length; i++) {\n\t\t\te.add(v[i]);\n\t\t}\n\t\treturn e;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the first component (the item at index 0) of this vector.\n\t * @return (Object) the first component of this vector.\n\t */\n\tthis.firstElement = function firstElementOfVector() {\n\t\treturn v.length > 0 ? v[0] : null;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the component at the specified index. This method is identical in functionality\n\t * to the elementAt method.\n\t * @param (int) index an index into this vector.\n\t * @return (Object) the component at the specified index.\n\t */\n\tthis.get = function getVector(index) {\n\t\treturn v[eval(index)];\n\t}\n\t/**\n\t * PUBLIC\n\t * Searches for the first occurence of the given argument, beginning the search at index or at\n\t * the beginning of the Vector if no index is specified.\n\t * @param (Object) obj an object.\n\t * @param (int) index the non-negative index to start searching from.\n\t * @return (int) the index of the first occurrence of the object argument in this vector at\n\t * position index or later in the vector\n\t */\n\tthis.indexOf = function indexOfVector(obj, index) {\n\t\tvar i = index == null ? 0 : eval(index);\n\t\tfor (; i < v.length && v[i] != obj; i++) ;\n\t\treturn i < v.length ? i : -1;\n\t}\n\t/**\n\t * PUBLIC\n\t * Inserts the specified object as a component in this vector at the specified index.\n\t * Each component in this vector with an index greater or equal to the specified index is\n\t * shifted upward to have an index one greater than the value it had previously.\n\t * The index must be a value greater than or equal to 0 and less than or equal to the current\n\t * size of the vector. (If the index is equal to the current size of the vector, the new\n\t * element is appended to the Vector.)\n\t * This method is identical in functionality to the add(Object, int) method (which is part\n\t * of the List interface). Note that the add method reverses the order of the parameters,\n\t * to more closely match array usage.\n\t * @param (Object) obj an object to insert.\n\t * @param (int) index where to insert the new component.\n\t */\n\tthis.insertElementAt = function insertElementAtVector(obj, index) {\n\t\tthis.add(index, obj);\n\t}\n\t/**\n\t * PUBLIC\n\t * Tests if this vector has no components.\n\t * @return (boolean) true if and only if this vector has no components, that is, its size\n\t * is zero; false otherwise.\n\t */\n\tthis.isEmpty = function isEmptyVector() {\n\t\treturn v.length == 0;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns an iterator over the elements in this vector in proper sequence.\n\t * @return (Iterator) an iterator over the elements in this vector in proper sequence.\n\t * is zero; false otherwise.\n\t */\n\tthis.iterator = function iteratorVector() {\n\t\tvar it = new Iterator();\n\t\tfor (var i = 0; i < v.length; i++) {\n\t\t\tit.add(v[i]);\n\t\t}\n\t\treturn it;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the last component of the vector.\n\t * @return (Object) the last component of the vector, i.e., the component at index size() - 1.\n\t */\n\tthis.lastElement = function lastElementOfVector() {\n\t\treturn v.length > 0 ? v[length - 1] : null;\n\t}\n\t/**\n\t * PUBLIC\n\t * Searches backwards for the specified object, starting from the specified index, and\n\t * returns an index to it. If no index is specified, the search process begins at the\n\t * end of the Vector.\n\t * @param (Object) obj an object.\n\t * @param (int) index the index to start searching from. Can be null.\n\t * @return (int) the index of the last occurrence of the specified object in this vector\n\t * at position less than or equal to index in the vector.\n\t */\n\tthis.lastIndexOf = function lastIndexOfVector(obj, index) {\n\t\tvar i = index == null ? v.length - 1 : eval(index);\n\t\tfor (; i >= 0 && v[i] != obj; i--) ;\n\t\treturn i;\n\t}\n\t/**\n\t * PUBLIC\n\t * 1. Case objOrPos is instance of Object:\n\t * Removes the first occurrence of the specified element in this Vector.\n\t * If the Vector does not contain the element, it is unchanged.\n\t * @param (Object or int) objOrPos element to be removed from this Vector, if present.\n\t * @return (boolean) true if the Vector contained the specified element.\n\t * 2. Case objOrPos is an int:\n\t * Removes the element at the specified position in this Vector. shifts any subsequent\n\t * elements to the left (subtracts one from their indices). Returns the element that\n\t * was removed from the Vector.\n\t * @param (Object or int) objOrPos the index of the element to remove.\n\t * @return (Object) the element that was removed from the Vector.\n\t */\n\tthis.remove = function removeObjFromVector(objOrPos) {\n\t\tif (eval(objOrPos) >= 0 && eval(objOrPos) < v.length) {\n\t\t\tv.splice(objOrPos, 1);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tvar i = this.indexOf(objOrPos);\n\t\t\tif (i >= 0) {\n\t\t\t\tv.splice(i, 1);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes all components from this vector and sets its size to zero.\n\t * This method is identical in functionality to the clear method.\n\t */\n\tthis.removeAllElements = function removeAllVector() {\n\t\tthis.clear();\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes the first (lowest-indexed) occurrence of the argument from this vector.\n\t * If the object is found in this vector, each component in the vector with an index\n\t * greater or equal to the object's index is shifted downward to have an index one\n\t * smaller than the value it had previously.\n\t * This method is identical in functionality to the remove(Object) method.\n\t * @param (Object) obj the component to be removed.\n\t * @return (boolean) true if the argument was a component of this vector; false otherwise.\n\t */\n\tthis.removeElement = function removeElementOfVector(obj) {\n\t\treturn this.remove(obj);\n\t}\n\t/**\n\t * PUBLIC\n\t * Deletes the component at the specified index. Each component in this vector with an\n\t * index greater or equal to the specified index is shifted downward to have an index\n\t * one smaller than the value it had previously. The size of this vector is decreased by 1.\n\t * The index must be a value greater than or equal to 0 and less than the current size of the vector.\n\t * This method is identical in functionality to the remove method.\n\t * @param (int) index the index of the object to remove.\n\t */\n\tthis.removeElementAt = function removeElementAtVector(index) {\n\t\tthis.remove(eval(index));\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes from this Vector all of the elements whose index is between fromIndex, inclusive and\n\t * toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index).\n\t * @param (int) fromIndex index of first element to be removed.\n\t * @param (int) toIndex index after last element to be removed.\n\t */\n\tthis.removeRange = function removeRangeOfVector(fromIndex, toIndex) {\n\t\tvar startIndex = Math.min(eval(fromIndex), eval(toIndex));\n\t\tvar endIndex = Math.max(eval(fromIndex), eval(toIndex));\n\t\tif (endIndex >= v.length) {\n\t\t\tendIndex = v.length;\n\t\t}\n\t\tv.splice(startIndex, endIndex - startIndex);\n\t}\n\t/**\n\t * PUBLIC\n\t * Replaces the element at the specified position in this Vector with the specified element.\n\t * @param (int) index index of element to replace.\n\t * @param (Object) obj element to be stored at the specified position.\n\t * @return (Object) the element previously at the specified position.\n\t */\n\tthis.set = function setObjAtVector(index, obj) {\n\t\treturn v.splice(index, 1, obj);\n\t}\n\t/**\n\t * PUBLIC\n\t * Sets the component at the specified index of this vector to be the specified object.\n\t * The previous component at that position is discarded. The index must be a value greater\n\t * than or equal to 0 and less than the current size of the vector.\n\t * This method is identical in functionality to the set method.\n\t * @param (int) index index of element to replace.\n\t * @param (Object) obj element to be stored at the specified position.\n\t */\n\tthis.setElementAt = function setElementAtVector(obj, index) {\n\t\tthis.set(index, obj);\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the number of components in this vector.\n\t * @return (int) the number of components in this vector.\n\t */\n\tthis.size = function sizeOfVector() {\n\t\treturn v.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns an array containing all of the elements in this Vector in the correct order.\n\t */\n\tthis.toArray = function vectorToArray() {\n\t\tvar vv = new Array();\n\t\tfor (var i = 0; i < v.length; i++) {\n\t\t\tvv[i] = v[i];\n\t\t}\n\t\treturn vv;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns a string representation of this Vector.\n\t */\n\tthis.toString = function vectorToString() {\n\t\tvar str = \"[\";\n\t\tfor (var i = 0; i < v.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tstr += \", \";\n\t\t\t}\n\t\t\tstr += v[i];\n\t\t}\n\t\treturn str + \"]\";\n\t}\n}", "title": "" }, { "docid": "b30c8118f3294f872764976ab18aba7b", "score": "0.65633506", "text": "function Vector2(x, y) {\n if (typeof x === \"undefined\") { x = 0; }\n if (typeof y === \"undefined\") { y = 0; }\n this.data = new Float32Array(2);\n this.data[0] = x;\n this.data[1] = y;\n }", "title": "" }, { "docid": "e79d8468573bbbeaf6f6cd1c6a180838", "score": "0.65421015", "text": "function RTVector2D(x, y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "title": "" }, { "docid": "4ddbf7663fec4498da451d70de86a5a8", "score": "0.6532192", "text": "constructor(x = 0, y = 0, z = 0, w = 0) {\n this.vector = [x, y, z, w];\n }", "title": "" }, { "docid": "a21724ac1fbc7a3f59e3978a4473e6d4", "score": "0.65067923", "text": "function Vector2(o) {\n var self = {};\n if (!o) {\n self.x = 0;\n self.y = 0;\n }\n else {\n self.x = o.x || 0;\n self.y = o.y || 0;\n }\n self.add = function(v1) {\n var self = this;\n self.x += v1.x;\n self.y += v1.y;\n return self;\n }\n return self;\n}", "title": "" }, { "docid": "c35b3782c033aa95e278fc6688ea5924", "score": "0.64936393", "text": "constructor() // etc) smaller and more cache friendly.\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Name the values we'll define per each vertex.\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\n this.texture_coords.push( ...Vec.cast( [0,0.51], [0.49,0.51], [0,1], [0.49,1] ) ); // Draw a square in texture coordinates too.\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\n }", "title": "" }, { "docid": "2d1f3bc89d0fae0716c1c529509e2d77", "score": "0.6490338", "text": "constructor() // etc) smaller and more cache friendly.\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Name the values we'll define per each vertex.\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\n this.texture_coords.push( ...Vec.cast( [0,0], [0.49,0], [0,0.49], [0.49,0.49] ) ); // Draw a square in texture coordinates too.\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\n }", "title": "" }, { "docid": "8e9bd2eea361575dc1484570957a2ae6", "score": "0.6485569", "text": "constructor() // etc) smaller and more cache friendly.\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Name the values we'll define per each vertex.\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\n this.texture_coords.push( ...Vec.cast( [0.51,0.51], [1,0.51], [0.51,1], [1,1] ) ); // Draw a square in texture coordinates too.\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\n }", "title": "" }, { "docid": "8aad5750cdbb7fe48b0fccead9090e31", "score": "0.6482315", "text": "getVector() {\n if (this.parent) {\n let dx = this.parent.loc.x - this.loc.x;\n let dy = this.parent.loc.y - this.loc.y;\n let v = new JSVector(dx, dy);\n return v;\n }\n else return (JSVector(0, 0));\n }", "title": "" }, { "docid": "d571733453d3eca7edc43d168c6f2e9b", "score": "0.64798474", "text": "function Vec2(x, y)\n{\n this.x = x !== undefined ? x : 0;\n this.y = y !== undefined ? y : 0;\n}", "title": "" }, { "docid": "bc86dbd025721306b906af4bdd48413e", "score": "0.6476605", "text": "function Vector() {\n this.length = arguments.length;\n for (var i=0; i < arguments.length; i++) {\n this[i] = arguments[i];\n }\n }", "title": "" }, { "docid": "d84701bc7a8bfcdf0d13de356536a824", "score": "0.6474879", "text": "function View(world, vector) {\n this.world = world;\n this.vector = vector;\n}", "title": "" }, { "docid": "86bd805a9493514f8f29bb20f94d8e99", "score": "0.6434846", "text": "function Vector(x_, y_) {\n\t\t\tthis.x = x_;\n\t\t\tthis.y = y_;\n\t\t}", "title": "" }, { "docid": "4faaf30c09de0a8ae14749316d028c9a", "score": "0.6432607", "text": "function Vector2(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.previousX = 0;\n this.previousY = 0;\n}", "title": "" }, { "docid": "7327c8e930e2ee2f82f7b83e76c0f902", "score": "0.64197487", "text": "function Vec2(a_x, a_y) {\n if (a_x === undefined) {\n a_x = 0;\n }\n this.x = a_x;\n\n if (a_y === undefined) {\n a_y = 0;\n }\n this.y = a_y;\n}", "title": "" }, { "docid": "0f6463a696a6296061f998688f358c83", "score": "0.64023715", "text": "function Vector2(/** defines the first coordinate */x,/** defines the second coordinate */y){if(x===void 0){x=0;}if(y===void 0){y=0;}this.x=x;this.y=y;}", "title": "" }, { "docid": "a171789439d956959f7d53eb7eb0c59e", "score": "0.6392869", "text": "static create (x, y, z, w) {\n const v = new Vector4 (4);\n v[ 0 ] = x;\n v[ 1 ] = y;\n v[ 2 ] = z;\n v[ 3 ] = w;\n return v;\n }", "title": "" }, { "docid": "e5608de94e16f951039b03ea9d325bb8", "score": "0.6379615", "text": "unit() {\n const l = this.length();\n\n return l === 0 ? new Vector(0, 0) : new Vector(this.x / l, this.y / l);\n }", "title": "" }, { "docid": "91ae8b2790729f9e574035e393f1bd66", "score": "0.6378938", "text": "function Vector2 (x, y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "title": "" }, { "docid": "697b910b6de804dacd3469522b2eb092", "score": "0.6366495", "text": "add(vector){\r\n\t\tlet newVector = new Vector2D(null, null);\r\n\t\tnewVector.x = this.x + vector.x;\r\n\t\tnewVector.y = this.y + vector.y;\r\n\t\treturn newVector;\r\n\t}", "title": "" }, { "docid": "fb4b2404395e96794c1d97a6c5f484f8", "score": "0.6361209", "text": "constructor(inx,iny){\n this.v=createVector(random(-0.2*scale,0.2*scale),random(-0.2*scale,0.2*scale));\n this.lifespan=255;\n this.a=createVector(random(-0.1*scale,0.1*scale),random(-0.1*scale,0.1*scale));\n this.location=createVector(inx,iny);\n this.r=random(1*scale,10*scale);\n this.isdead=false;\n }", "title": "" }, { "docid": "7040ca01cc3feda17d275a93fabd35be", "score": "0.6354789", "text": "function UnitVector(x, y) {\n this.x = x;\n this.y = y;\n this.axis = undefined;\n this.slope = y / x;\n this.normalSlope = -x / y;\n (0, _freeze2.default)(this);\n}", "title": "" }, { "docid": "f085f3b6f3109fd0f78ffa66613c537f", "score": "0.63512474", "text": "function Vector(object, first, second)\n{\n if(object instanceof Array)\n {\n this.values = [object[0], object[1]] ;\n this.names = [first || \"_x\", second || \"_y\"] ;\n }\n else\n {\n this.names = [first, second] ;\n this.values = [] ;\n for(var i=0; i<2; ++i)\n {\n var x = this.names[i];\n if(object[x]!=null)\n var re = object[x].match(\"(?:^| )(-?\\\\d+)(?:px)?(?: |$)\") ;\n else\n var re = object.toString().match(\"(?:^| )\"+x+\": (-?\\\\d+)px;(?: |$)\") ;\n if(!re)\n return null ;\n var v = parseInt(re[1]) ;\n if(isNaN(v))\n return null ;\n this.values.push(v) ;\n }\n }\n // Debug.log(\"Vector constructed from object \", object, \"\\n\", this.names.toString(), \"\\n\", this.values.toString())\n // Debug.log(\"Vector constructed from object \", object, \"\\n\", this.toString())\n}", "title": "" }, { "docid": "ff7cb88fc4333ca790972b99113044fc", "score": "0.632653", "text": "function Vector2() {\n var _this;\n\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Vector2);\n\n _this = _possibleConstructorReturn(this, (Vector2.__proto__ || Object.getPrototypeOf(Vector2)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y);\n }\n\n return _this;\n }", "title": "" }, { "docid": "ac8084b8846c460b9ce40d2f3b5ba84a", "score": "0.63243914", "text": "constructor(x = 0, y = 0, w = 0, h = 0){\n\t\tthis.position = new vec2(x, y);\n\t\tthis.size = new vec2(w, h);\n\t}", "title": "" }, { "docid": "21fa640de8ff607cdd1f5f4025e70335", "score": "0.63198936", "text": "function Vec2(x, y) {\n if (x) {\n this.x = x;\n }\n\n if (y) {\n this.y = y;\n }\n}", "title": "" }, { "docid": "5ff5443e817e1346aaf94aeb9c624426", "score": "0.6319353", "text": "function Vector(x,y,z) {\n return {\n x: x || 0,\n y: y || 0,\n z: z || 0,\n };\n}", "title": "" }, { "docid": "e68ed1cacf63642e37a7d65350927d1a", "score": "0.6307143", "text": "constructor(){\n this.pos = new Vec2(0,0);\n this.vel = new Vec2(0,0);\n\n this.traits = [];\n }", "title": "" }, { "docid": "96b87636b923960e5fb1e60dc89b9c42", "score": "0.6306613", "text": "function Vec2(a,b){\n if (isNaN(a) || isNaN(b)) {\n throw 'Cannot construct Vec2 from non number variables';\n }\n\n this._x = a;\n this._y = b;\n\n this.add = function(other){\n if (other instanceof Vec2) {\n this._x += other.x;\n this._y += other.y;\n }\n };\n\n this.substract = function(other){\n if(other instanceof Vec2){\n this._x -= other.x;\n this._y -= other.y;\n }\n };\n\n this.multiply = function(other){\n if(other instanceof Vec2){\n this._x *= other.x;\n this._y *= other.y;\n }\n };\n\n this.multiplyScalar = function(scalar){\n if (isNaN(scalar)) {\n return;\n }\n this._x *= scalar;\n this._y *= scalar;\n return this;\n };\n\n this.divide = function(other){\n if (other instanceof Vec2) {\n this._x /= other.x;\n this._y /= other.y;\n }\n };\n\n this.divideScalar = function(scalar){\n if (isNaN(scalar) || scalar === 0.0) {\n return;\n }\n this._x /= scalar;\n this._y /= scalar;\n };\n\n this.addCopy = function(other){\n if (other instanceof Vec2) {\n var result = new Vec2(this._x + other.x, this._y + other.y);\n return result;\n }\n };\n\n this.substractCopy = function(other){\n if (other instanceof Vec2) {\n var result = new Vec2(this._x - other.x, this._y - other.y);\n return result;\n }\n };\n\n this.multiplyCopy = function(other){\n if (other instanceof Vec2) {\n var result = new Vec2(this._x * other.x, this._y * other.y);\n return result;\n }\n };\n\n this.multiplyScalarCopy = function(scalar){\n if (isNaN(scalar)) {\n return;\n }\n var result = new Vec2(this._x * scalar, this._y * scalar);\n return result;\n };\n\n this.divideCopy = function(other){\n if (other instanceof Vec2) {\n var result = new Vec2(this._x / other.x, this._y / other.y);\n return result;\n }\n };\n\n this.divideScalarCopy = function(scalar){\n if (isNaN(scalar) || scalar === 0.0) {\n return;\n }\n return new Vec2(this._x / scalar, this._y / scalar);\n };\n\n\n this.toArray = function(){\n return new Float32Array([x,y]);\n };\n\n this.toString = function(){\n return 'Vec2[' + this._x + ', ' + this._y;\n };\n}", "title": "" }, { "docid": "55d74e7092f4050ee9ceb7e5bea7648f", "score": "0.6295717", "text": "function Vl(a){var b=Wl;this.J=[];this.ga=b;this.Y=a||null;this.G=this.F=!1;this.D=void 0;this.R=this.Z=this.N=!1;this.K=0;this.C=null;this.M=0}", "title": "" }, { "docid": "8f142111bb9cc3cf81816e937552c050", "score": "0.62915444", "text": "function v(x,y,z){ \n return new THREE.Vertex(new THREE.Vector3(x,y,z)); \n }", "title": "" }, { "docid": "a5e62dbb81322c0c7f0eb1a08bd090e7", "score": "0.6290444", "text": "function UnitVector(x, y) {\n\t this.x = x;\n\t this.y = y;\n\t this.axis = undefined;\n\t this.slope = y / x;\n\t this.normalSlope = -x / y;\n\t Object.freeze(this);\n\t}", "title": "" }, { "docid": "ceadca4e04b8f91c981cd70c89905396", "score": "0.6285253", "text": "function Vector2() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Vector2);\n\n var _this = _possibleConstructorReturn(this, (Vector2.__proto__ || Object.getPrototypeOf(Vector2)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y);\n }\n return _this;\n }", "title": "" }, { "docid": "03fb240e5712c702e8b9a77e93996b7c", "score": "0.6272836", "text": "multiply(scalar){\r\n\t\tlet newVector = new Vector2D(null, null);\r\n\t\tnewVector.x = this.x * scalar;\r\n\t\tnewVector.y = this.y * scalar;\r\n\t\treturn newVector;\r\n\t}", "title": "" }, { "docid": "3eb83bc5788ca0b3cfaa18bbec1021b0", "score": "0.6268718", "text": "constructor(locX,locY){\n this.loc = createVector(locX, locY);\n }", "title": "" }, { "docid": "96c07cd619810a5e8198aec26be02fe6", "score": "0.6259361", "text": "function Vector2(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "ef9c4b803bb877555df56dcdad3d7e4d", "score": "0.62489825", "text": "function generateVector(){\n // traverse towards screen center\n let traverseTo_x = canvas.width/2;\n let traverseTo_y = canvas.height/2;\n // add noise to traverse point\n // +/- rand 0-0.5 screen size\n traverseTo_x = traverseTo_x + \n (((Math.random() * 2) - 1) * (canvas.width/2));\n traverseTo_y = traverseTo_y + \n (((Math.random() * 2) - 1) * (canvas.height/2));\n // start with non-normal vector\n let vec_x = rand_x - traverseTo_x;\n let vec_y = rand_y - traverseTo_y;\n let vecLength = Math.sqrt(Math.pow(vec_x,2) + Math.pow(vec_y,2));\n // normalize\n speed_x = (vec_x / vecLength) * -1;\n speed_y = (vec_y / vecLength) * -1; \n\n }", "title": "" }, { "docid": "b76bcd91eea4f8c12a6b2fac24f2553a", "score": "0.6244559", "text": "static zeroV() { return new mVec3(); }", "title": "" }, { "docid": "bbad6c26b7b88a0b8da19729e1e77840", "score": "0.62399703", "text": "function UnitVector(x, y) {\n this.x = x;\n this.y = y;\n this.axis = undefined;\n this.slope = y / x;\n this.normalSlope = -x / y;\n Object.freeze(this);\n }", "title": "" }, { "docid": "9662d4f1709d4f6c193eeabf30a05aca", "score": "0.6230933", "text": "function skybox(){\n var v = [\n 100, 100, 100,\n 100, 100, -100,\n 100, -100, 100,\n 100, -100, -100,\n -100, 100, 100,\n -100, 100, -100,\n -100, -100, 100,\n -100, -100, -100\n ];\n\n var skybox_vertexIndex = [\n 6, 2, 0,\n 6, 0, 4,\n 7, 5, 1,\n 7, 1, 3,\n 5, 4, 0,\n 5, 0, 1,\n 7, 3, 2,\n 7, 2, 6,\n 3 ,1 ,0,\n 3, 0, 2,\n 7, 6, 4,\n 7, 4, 5\n ];\n\n skyvBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, skyvBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(v), gl.STATIC_DRAW);\n\n skyiBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, skyiBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(skybox_vertexIndex), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "63046164538ac7aa0022d7dadd5a2c5f", "score": "0.62231976", "text": "function drawVector(x, y) {\n\t\t\tvar px = 512 + (x * 512);\n\t\t\tvar py = (768 / 2) + (y * (768 / 2));\n\t\t\tvar x2 = px + ( (x * -1) * 10);\n\t\t\tvar y2 = py + ( (y * -1) * 10);\n\t\t\tvar x3 = px - ( (x * -1) * 10);\n\t\t\tvar y3 = py - ( (y * -1) * 10);\n\n\t\t\tctx.fillStyle = '#FFF';\n\t\t\tctx.strokeStyle = 'white';\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(px, py);\n\t\t\tctx.lineTo(x2, y2);\n\t\t\tctx.lineTo(x3, y3);\n\t\t\t//ctx.lineTo(px, py);\n\t\t\tctx.stroke();\n\t\t\tctx.fill();\n\t\t\tctx.closePath();\n\n\n\t\t\tconsole.log(px + ',' + py + ' ' + x2 + ',' + y2 + ' ' + x3 + ',' + y3);\n\n\t\t}", "title": "" }, { "docid": "94744db8490c236c1bca215df604d358", "score": "0.62172943", "text": "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "6f8c184f07020bf5d88190d536f83681", "score": "0.62148565", "text": "function vector() {\n var array = [];\n\n return {\n get: function (a) {\n return array[a];\n },\n store: function (a, b) {\n array[a] = b;\n\n },\n append: function (a) {\n array.push[a];\n\n }\n }\n }", "title": "" }, { "docid": "37f27fe7671edffb80854fdbb83112e6", "score": "0.6208163", "text": "function VectorEsri3dLayer() {\n SMK.TYPE.Layer[ 'vector' ].prototype.constructor.apply( this, arguments )\n }", "title": "" }, { "docid": "f9c9ea9cd6e0e1a4a1d9dc5f0401b2f0", "score": "0.6198977", "text": "function v(x,y,z){ \n\t\t\t\t\t\treturn new THREE.Vertex(new THREE.Vector3(x,y,z)); \n\t\t\t\t}", "title": "" }, { "docid": "c761913312c3ec905eb08914049b2ffd", "score": "0.61979854", "text": "function Vector2(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "0860b23f63cc18a81f5407fd0fb25f5f", "score": "0.6194322", "text": "function vZero() { return new Vector(0,0); }", "title": "" }, { "docid": "2adcf0a82885fa947a77cea248b32da8", "score": "0.6192885", "text": "function random2DVector() {\r\n\tvar vector = new Vector();\r\n\treturn vector.fromAngle(Math.random() * Math.PI * 2);\r\n}", "title": "" }, { "docid": "0bd08862c8f26b4db38e28256394c352", "score": "0.6190188", "text": "andarEsquerda(){\n this._vel = new Vetor2D(-1, 0);\n }", "title": "" }, { "docid": "f05c1ce5be8d1d223cce5bcdfa756fa7", "score": "0.6189052", "text": "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "cede60c013638c78b2a63f83c15af4ad", "score": "0.6185675", "text": "function UnitVector(x, y) {\n this.x = x;\n this.y = y;\n this.axis = undefined;\n this.slope = y / x;\n this.normalSlope = -x / y;\n Object.freeze(this);\n }", "title": "" }, { "docid": "4a3100ca5049dfbe7dd77a23ed1bb79b", "score": "0.6184173", "text": "function Vector(x, y) {\r\n\tthis.x = x || 0;\r\n\tthis.y = y || 0;\r\n\r\n\tthis.add = function (vector) {\r\n\t\tthis.x += vector.x;\r\n\t\tthis.y += vector.y;\r\n\t\treturn this;\r\n\t};\r\n\r\n\tthis.sub = function (vector) {\r\n\t\tthis.x -= vector.x;\r\n\t\tthis.y -= vector.y;\r\n\t\treturn this;\r\n\t};\r\n\r\n\tthis.set = function (vector) {\r\n\t\tthis.x = vector.x;\r\n\t\tthis.y = vector.y;\r\n\t};\r\n\r\n\tthis.setMag = function (mag) {\r\n\t\treturn this.norm().mult(mag);\r\n\t};\r\n\r\n\tthis.mag = function () {\r\n\t\treturn Math.sqrt(this.magSq());\r\n\t};\r\n\r\n\tthis.magSq = function () {\r\n\t\treturn this.x * this.x + this.y * this.y;\r\n\t};\r\n\r\n\tthis.norm = function () {\r\n\t\treturn this.mag() === 0 ? this : this.div(this.mag());\r\n\t};\r\n\r\n\tthis.mult = function (value) {\r\n\t\tthis.x *= value;\r\n\t\tthis.y *= value;\r\n\t\treturn this;\r\n\t};\r\n\r\n\tthis.div = function (value) {\r\n\t\tthis.x /= value;\r\n\t\tthis.y /= value;\r\n\t\treturn this;\r\n\t};\r\n\r\n\tthis.fromAngle = function (angle) {\r\n\t\treturn new Vector(Math.cos(angle), Math.sin(angle));\r\n\t};\r\n\r\n\tthis.limit = function (max) {\r\n\t\tvar mSq = this.magSq();\r\n\t\tif (mSq > max * max) {\r\n\t\t\tthis.div(Math.sqrt(mSq)).mult(max);\r\n\t\t}\r\n\t\treturn this;\r\n\t};\r\n\r\n\tthis.copy = function () {\r\n\t\treturn new Vector(this.x, this.y);\r\n\t};\r\n}", "title": "" }, { "docid": "78baf7a502c08fcc4e0d19ec74efd632", "score": "0.6180872", "text": "static One() {\n return new Vector2(1, 1);\n }", "title": "" }, { "docid": "2ef4800414c28b414e9fbad7770a0463", "score": "0.618001", "text": "function Vector (x,y,z)\r\n{\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.z = z;\n\n\tthis.selected = false;\t\t// editing flags.\n\tthis.group = -1;\t\t\t\t// -1 = no group\r\n\r\n\tthis.add = v_Add;\r\n\tthis.subtract = v_Sub;\r\n\tthis.normalise = v_Normalise;\r\n\tthis.magnitude = v_Magnitude;\r\n}", "title": "" }, { "docid": "6da54679d242b3d2cae7d967ed4892ae", "score": "0.61642396", "text": "static vOrth(v) {\n return [\n {x: -v.y, y: v.x},\n {x: v.y, y: -v.x}\n ]\n }", "title": "" }, { "docid": "6da54679d242b3d2cae7d967ed4892ae", "score": "0.61642396", "text": "static vOrth(v) {\n return [\n {x: -v.y, y: v.x},\n {x: v.y, y: -v.x}\n ]\n }", "title": "" }, { "docid": "58c30c5fce180545075da6872ef223cd", "score": "0.61628", "text": "static from(p1, p2) {\r\n\t\tlet x = p2.x - p1.x\r\n\t\tlet y = p2.y - p1.y\r\n\t\treturn new Vector(x, y)\r\n\t}", "title": "" }, { "docid": "2815cf3796ce1f6b170b584a3ff025dd", "score": "0.6161178", "text": "function Shape() {\n Vector.apply( this, arguments ); // call Vector's constructor\n this.age = 0\n this.maxAge = 450\n this.size = 0\n this.color = \"#00FFFF\";\n}", "title": "" }, { "docid": "7e92e4c804f5774d587a422916ee0bfa", "score": "0.61609846", "text": "plus(vector){ return new Vec(this.x + vector.x, this.y + vector.y); }", "title": "" }, { "docid": "6211824e4d5f8fc97557be2c2920efeb", "score": "0.6158892", "text": "static create (x, y, z) {\n const v = new Vector3 (3);\n v[ 0 ] = x;\n v[ 1 ] = y;\n v[ 2 ] = z;\n return v;\n }", "title": "" }, { "docid": "29f7bce3c3ea262f4be4f2ca2c13ed36", "score": "0.61578596", "text": "constructor(w, h) {\n this.pos = new Vec; // position for vector\n this.size = new Vec(w, h); // position for the size\n }", "title": "" }, { "docid": "0827cf9db740a36a136bcd801edd29d1", "score": "0.6155221", "text": "function VectorsRenderer(pixiContainer, config) {\n // Public API object to be returned.\n var api, m2px, m2pxInv, container, viewVectors, // Vectors rendering enabled or disabled.\n show, // Number of vectors to render.\n count, // Physical vector properties (functions!).\n xFunc, yFunc, vxFunc, vyFunc, // Visual vector properties.\n alphaFunc, length, width, color, dirOnly;\n\n function readOptions() {\n count = config.count;\n xFunc = config.x;\n yFunc = config.y;\n vxFunc = config.vx;\n vyFunc = config.vy;\n alphaFunc = config.alpha;\n show = config.show;\n length = config.length;\n width = config.width;\n color = config.color;\n dirOnly = config.dirOnly;\n m2px = config.m2px;\n m2pxInv = config.m2pxInv;\n }\n\n function getVectorTexture() {\n var canv = document.createElement(\"canvas\"),\n ctx = canv.getContext(\"2d\");\n canv.width = 1;\n canv.height = 1;\n ctx.fillStyle = color;\n ctx.fillRect(0, 0, 1, 1);\n return new pixi_default.a.Texture.fromCanvas(canv);\n }\n\n function getVectorArrowheadTexture() {\n var canv = document.createElement(\"canvas\"),\n ctx = canv.getContext(\"2d\"),\n dim = m2px(3.5 * width);\n canv.width = dim;\n canv.height = dim;\n ctx.fillStyle = color;\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(dim, 0);\n ctx.lineTo(dim * 0.5, dim);\n ctx.closePath();\n ctx.fill();\n return new pixi_default.a.Texture.fromCanvas(canv);\n }\n\n function renderVector(i) {\n var vec = viewVectors[i],\n x = xFunc(i),\n y = yFunc(i),\n vx = vxFunc(i) * length,\n vy = vyFunc(i) * length,\n len = Math.sqrt(vx * vx + vy * vy),\n rot = Math.PI + Math.atan2(vx, vy),\n arrowHead = vec.arrowHead;\n\n if (dirOnly) {\n // 0.15 is a bit random, empirically set value to match previous rendering done by SVG.\n vx = 0.15 * length * vx / len;\n vy = 0.15 * length * vy / len;\n len = 0.15 * length;\n }\n\n var lenInPx = m2px(len);\n\n if (lenInPx < 1) {\n // Hide completely tiny vectors (< 1px).\n vec.alpha = 0;\n arrowHead.alpha = 0;\n return;\n } else if (alphaFunc) {\n vec.alpha = alphaFunc(i);\n arrowHead.alpha = alphaFunc(i);\n } else {\n vec.alpha = 1;\n arrowHead.alpha = 1;\n }\n\n if (lenInPx > 1e6) {\n // When vectors has enormous size, it can cause rendering artifacts. Limit it.\n var s = lenInPx / 1e6;\n vx /= s;\n vy /= s;\n len /= s;\n lenInPx /= s;\n } // Vector.\n\n\n vec.position.x = m2px(x);\n vec.position.y = m2pxInv(y);\n vec.scale.y = lenInPx;\n vec.rotation = rot; // Arrowhead.\n\n arrowHead.position.x = m2px(x + vx);\n arrowHead.position.y = m2pxInv(y + vy);\n arrowHead.rotation = rot;\n }\n\n api = {\n setup: function setup() {\n readOptions();\n\n if (container) {\n pixiContainer.removeChild(container);\n container = null;\n }\n\n if (!show || count === 0) return;\n container = new pixi_default.a.DisplayObjectContainer();\n pixiContainer.addChild(container);\n var i, vec, arrowHead, tex;\n viewVectors = [];\n tex = getVectorTexture();\n\n for (i = 0; i < count; ++i) {\n vec = new pixi_default.a.Sprite(tex);\n vec.anchor.x = 0.5;\n vec.scale.x = m2px(width);\n vec.i = i;\n viewVectors.push(vec);\n container.addChild(vec);\n }\n\n tex = getVectorArrowheadTexture();\n\n for (i = 0; i < count; ++i) {\n arrowHead = new pixi_default.a.Sprite(tex);\n arrowHead.anchor.x = 0.5;\n viewVectors[i].arrowHead = arrowHead;\n container.addChild(arrowHead);\n }\n\n api.update();\n },\n update: function update() {\n if (!show || count === 0) return;\n\n for (var i = 0; i < count; ++i) {\n renderVector(i);\n }\n }\n };\n return api;\n}", "title": "" }, { "docid": "77b0db2b6623251b13086e48faf8f386", "score": "0.6153502", "text": "static unitVector(vec){\r\n let returnVector = {\r\n x: 0,\r\n y: 0\r\n };\r\n let vecMag=vectorMath.magnitude(vec);\r\n if(vecMag>0){\r\n returnVector = {\r\n x: vec.x/vecMag,\r\n y: vec.y/vecMag\r\n };\r\n }\r\n return returnVector;\r\n }", "title": "" }, { "docid": "ea6ff32be4318439b032dbab7852e31d", "score": "0.61249095", "text": "MultiplyVector() {}", "title": "" }, { "docid": "96e61396c3cf8269abe2253c5f14ec5f", "score": "0.612241", "text": "function v(x, y, z) {\r\n return new THREE.Vector3(x, y, z);\r\n }", "title": "" }, { "docid": "7a9f55f80524ee881576ed6dc72ca5a7", "score": "0.6119904", "text": "generateSpecialUV()\n {\n this.vertices[0].uv = [0.0, 0.0];\n this.vertices[1].uv = [3.0, 0.0];\n this.vertices[2].uv = [3.0, 3.0];\n this.vertices[3].uv = [0.0, 3.0];\n this.vertices[4].uv = [0.0, 0.0];\n this.vertices[5].uv = [2.0, 0.0];\n this.vertices[6].uv = [2.0, 1.0];\n this.vertices[7].uv = [0.0, 1.0];\n this.vertices[8].uv = [0.0, 0.0];\n this.vertices[9].uv = [1.0, 0.0];\n this.vertices[10].uv = [1.0, 0.5];\n this.vertices[11].uv = [0.0, 0.5];\n this.vertices[12].uv = [0.0, 0.5];\n this.vertices[13].uv = [1.0, 0.5];\n this.vertices[14].uv = [1.0, 1.0];\n this.vertices[15].uv = [0.0, 1.0];\n this.vertices[16].uv = [0.0, 0.0];\n this.vertices[17].uv = [1.0, 0.0];\n this.vertices[18].uv = [1.0, 1.0];\n this.vertices[19].uv = [0.0, 1.0];\n this.vertices[20].uv = [0.0, 0.0];\n this.vertices[21].uv = [1.0, 0.0];\n this.vertices[22].uv = [1.0, 1.0];\n this.vertices[23].uv = [0.0, 1.0];\n }", "title": "" }, { "docid": "8bbdab1d07f681a20b28950a5b2eba0f", "score": "0.6116748", "text": "projection(other_vector) {}", "title": "" }, { "docid": "3ed9c055c54333904b175ef336c9385d", "score": "0.611448", "text": "toVector2() {\n return new Vector2(this.x, this.y);\n }", "title": "" } ]
6e6f2ee409f2d8034d22437fe8ac9eff
Initialize the TView (e.g. static data) for the active embedded view. Each embedded view block must create or retrieve its own TView. Otherwise, the embedded view's static data for a particular node would overwrite the static data for a node in the view above it with the same index (since it's in the same template).
[ { "docid": "caa79d9eb99196e4a8fced05c059c377", "score": "0.5436596", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" } ]
[ { "docid": "38a71e2e4bf967c25ec22e091853722d", "score": "0.63132197", "text": "_initializeViews()\n {\n this._layoutViewMaster = new LayoutViewMaster();\n }", "title": "" }, { "docid": "b4f258280481c0cf88196ebaf07abf34", "score": "0.6176723", "text": "initViews(){\n this.camera = this.graph.views[this.graph.defaultView];\n this.interface.setActiveCamera(this.camera);\n }", "title": "" }, { "docid": "685bdb3b2d329e27d2c7d0585e0a3849", "score": "0.6169974", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = viewData[containerTNode.index];\n var currentView = viewData;\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n isParent = true;\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, currentView, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewToRender);\n}", "title": "" }, { "docid": "46acbbb3016124ca3c273f93cbc7bc55", "score": "0.6159821", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n var lView = getLView();\n var previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = lView[containerTNode.index];\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(lView, getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 4 /* CheckAlways */);\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return isCreationMode(viewToRender) ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "46acbbb3016124ca3c273f93cbc7bc55", "score": "0.6159821", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n var lView = getLView();\n var previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = lView[containerTNode.index];\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(lView, getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 4 /* CheckAlways */);\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return isCreationMode(viewToRender) ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "46acbbb3016124ca3c273f93cbc7bc55", "score": "0.6159821", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n var lView = getLView();\n var previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = lView[containerTNode.index];\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(lView, getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 4 /* CheckAlways */);\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return isCreationMode(viewToRender) ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "46acbbb3016124ca3c273f93cbc7bc55", "score": "0.6159821", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n var lView = getLView();\n var previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = lView[containerTNode.index];\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(lView, getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 4 /* CheckAlways */);\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return isCreationMode(viewToRender) ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "a722bfb17dd91127aa198bbe03f6cd60", "score": "0.613985", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLViewData(declarationView, renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}", "title": "" }, { "docid": "0b65f6eb0b3525c9417584bc7d56394a", "score": "0.61103195", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = isParent;\n var _previousOrParentTNode = previousOrParentTNode;\n isParent = true;\n previousOrParentTNode = null;\n var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n isParent = _isParent;\n previousOrParentTNode = _previousOrParentTNode;\n return lView;\n}", "title": "" }, { "docid": "2e793a4db82f6010589b38500b6dcd3b", "score": "0.61082715", "text": "function embeddedViewStart(viewBlockId, consts, vars) {\n var viewData = getViewData();\n var previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n var containerTNode = previousOrParentTNode.type === 2 /* View */ ?\n previousOrParentTNode.parent :\n previousOrParentTNode;\n var lContainer = viewData[containerTNode.index];\n ngDevMode && assertNodeType(containerTNode, 0 /* Container */);\n var viewToRender = scanForView(lContainer, containerTNode, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLViewData(getViewData(), getRenderer(), getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES].createView();\n }\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (getCreationMode()) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, viewData, lContainer[ACTIVE_INDEX], -1);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewToRender);\n}", "title": "" }, { "docid": "0a141a955191154f99ae4b4a4ef37b84", "score": "0.6077616", "text": "createNodeViews() {\n this.view.setProps({\n nodeViews: this.extensionManager.nodeViews,\n });\n }", "title": "" }, { "docid": "c561ef2f0c5ed129aaa2cf2e13a3e4fd", "score": "0.60458684", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLView(declarationView, tView, context, 16 /* CheckAlways */, null, null);\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n assignTViewNodeToLView(tView, null, -1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n }", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.60411495", "text": "function TViewNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.60411495", "text": "function TViewNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.60411495", "text": "function TViewNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.60411495", "text": "function TViewNode() {}", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.6025147", "text": "function TViewNode() { }", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.6025147", "text": "function TViewNode() { }", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.6025147", "text": "function TViewNode() { }", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.6025147", "text": "function TViewNode() { }", "title": "" }, { "docid": "3018fb2449ad731e243e8e89a364e10a", "score": "0.60051626", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLView(declarationView, tView, context, 4 /* CheckAlways */);\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}", "title": "" }, { "docid": "3018fb2449ad731e243e8e89a364e10a", "score": "0.60051626", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLView(declarationView, tView, context, 4 /* CheckAlways */);\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}", "title": "" }, { "docid": "3018fb2449ad731e243e8e89a364e10a", "score": "0.60051626", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLView(declarationView, tView, context, 4 /* CheckAlways */);\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}", "title": "" }, { "docid": "3018fb2449ad731e243e8e89a364e10a", "score": "0.60051626", "text": "function createEmbeddedViewAndNode(tView, context, declarationView, renderer, queries, injectorIndex) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var lView = createLView(declarationView, tView, context, 4 /* CheckAlways */);\n lView[DECLARATION_VIEW] = declarationView;\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n if (tView.firstTemplatePass) {\n tView.node.injectorIndex = injectorIndex;\n }\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}", "title": "" }, { "docid": "93976d8f21b3e2f4dc5bf42864131f9a", "score": "0.5998392", "text": "setView(initView) {\n this.view = initView;\n }", "title": "" }, { "docid": "93976d8f21b3e2f4dc5bf42864131f9a", "score": "0.5998392", "text": "setView(initView) {\n this.view = initView;\n }", "title": "" }, { "docid": "93976d8f21b3e2f4dc5bf42864131f9a", "score": "0.5998392", "text": "setView(initView) {\n this.view = initView;\n }", "title": "" }, { "docid": "93976d8f21b3e2f4dc5bf42864131f9a", "score": "0.5998392", "text": "setView(initView) {\n this.view = initView;\n }", "title": "" }, { "docid": "642f7ab13a0cd936c083566b210423f0", "score": "0.59925747", "text": "function embeddedViewStart(viewBlockId) {\n var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode));\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var lContainer = container.data;\n var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n isParent = true;\n enterView(viewNode.data, viewNode);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n newView[QUERIES] = lContainer[QUERIES].createView();\n }\n enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView));\n }\n if (container) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(container, viewNode, lContainer[ACTIVE_INDEX]);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewNode.data);\n }", "title": "" }, { "docid": "09cdeaf88c292c88199d613f37ecb5a4", "score": "0.59551555", "text": "function TViewNode(){}", "title": "" }, { "docid": "8cd169a1c48e6cb1b2d13d66e359fc33", "score": "0.59534127", "text": "function doInitView(){\n this.on(\"load\", function(){\n //on load (after render) on the parent view, we must propagate the list auto status to all created instances\n Object.keys(this.views).forEach(function(viewId){\n this.views[viewId].instances.forEach(function(v){\n v.listAutoActive = this.views[viewId].listAutoActive ;\n }.bind(this)) ;\n }.bind(this)) ;\n }.bind(this)) ;\n\n \n if(this.isMultiple){\n //I am a view 'item' of a list\n \n //get my view definition from parent\n var viewDef = this.parentView.views[this.viewId] ;\n\n if(viewDef.el.hasAttribute(\"data-list-auto\")){\n this.isListAuto = true ;\n viewDef.getValue = function(){\n return this.parentView._getSubviewData(this.viewId) ;\n }.bind(this) ;\n }\n \n this.once(\"load\", function(){\n //first time render on this item, search for all fields to listen on changes\n \n //get the list array from data\n var elements = this.elementsHavingAttribute(\"data-bind\");\n elements.forEach(function(element){\n var eventType = \"change\" ;\n if(element.tagName === \"INPUT\" && element.type === \"text\"){\n eventType = \"keyup\" ;\n }else if(element.hasAttribute(\"data-field\") && element.getAttribute(\"data-field\") === \"varchar\"){\n eventType = \"keyup\" ;\n }\n element.addEventListener(eventType, function(){\n //a change happen \n if(this.listAutoActive){ //the list is active\n var listIndex = viewDef.instances.indexOf(this) ; //recompute because it may have change with remove actions\n if(listIndex === viewDef.instances.length - 1){\n //where are on the last line, add a line\n var v = this.parentView.addViewInstance(this.viewId, function(){}) ;\n v.listAutoActive = true ;\n }\n }\n }.bind(this)) ;\n }.bind(this));\n\n //get the potential remove buttons\n var elsRemove = this.elementsHavingAttribute(\"data-list-remove\");\n elsRemove.forEach(function(elRemove){\n elRemove.addEventListener(\"click\", function(){\n //click on remove button\n if(this.listAutoActive){ //the list is active\n //remove the line\n var listIndex = viewDef.instances.indexOf(this) ;\n this.parentView.removeViewInstance(this.viewId, listIndex) ;\n }\n }.bind(this)) ;\n }.bind(this)) ;\n\n \n //listen to load (render), remove and add instance events in parent view\n this.parentView.on('load', toggleRemoveEls.bind(this)) ;\n this.parentView.on('viewInstanceRemoved', toggleRemoveEls.bind(this)) ;\n this.parentView.on('viewInstanceAdded', toggleRemoveEls.bind(this)) ; \n this.parentView.on('viewInstanceAdded', prepareSortHandlers.bind(this)) ; \n }.bind(this)) ;\n }\n }", "title": "" }, { "docid": "9e48648ee20e2b652b04786c0f01bdeb", "score": "0.5923733", "text": "function View(context, type, parentView, data, template, key, onRender, contentTmpl) {\n\t// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n\tvar views, parentView_, tag, self_,\n\t\tself = this,\n\t\tisArray = type === \"array\";\n\t\t// If the data is an array, this is an 'array view' with a views array for each child 'item view'\n\t\t// If the data is not an array, this is an 'item view' with a views 'hash' object for any child nested views\n\n\tself.content = contentTmpl;\n\tself.views = isArray ? [] : {};\n\tself.data = data;\n\tself.tmpl = template;\n\tself_ = self._ = {\n\t\tkey: 0,\n\t\t// ._.useKey is non zero if is not an 'array view' (owning a data array). Use this as next key for adding to child views hash\n\t\tuseKey: isArray ? 0 : 1,\n\t\tid: \"\" + viewId++,\n\t\tonRender: onRender,\n\t\tbnds: {}\n\t};\n\tself.linked = !!onRender;\n\tself.type = type || \"top\";\n\tif (self.parent = parentView) {\n\t\tself.root = parentView.root || self; // view whose parent is top view\n\t\tviews = parentView.views;\n\t\tparentView_ = parentView._;\n\t\tself.isTop = parentView_.scp; // Is top content view of a link(\"#container\", ...) call\n\t\tself.scope = (!context.tag || context.tag === parentView.ctx.tag) && !self.isTop && parentView.scope || self;\n\t\tif (parentView_.useKey) {\n\t\t\t// Parent is not an 'array view'. Add this view to its views object\n\t\t\t// self._key = is the key in the parent view hash\n\t\t\tviews[self_.key = \"_\" + parentView_.useKey++] = self;\n\t\t\tself.index = indexStr;\n\t\t\tself.getIndex = getNestedIndex;\n\t\t} else if (views.length === (self_.key = self.index = key)) { // Parent is an 'array view'. Add this view to its views array\n\t\t\tviews.push(self); // Adding to end of views array. (Using push when possible - better perf than splice)\n\t\t} else {\n\t\t\tviews.splice(key, 0, self); // Inserting in views array\n\t\t}\n\t\t// If no context was passed in, use parent context\n\t\t// If context was passed in, it should have been merged already with parent context\n\t\tself.ctx = context || parentView.ctx;\n\t} else {\n\t\tself.ctx = context || {};\n\t}\n}", "title": "" }, { "docid": "b30cd15e0283074053266f46e8c2d101", "score": "0.59039414", "text": "function embeddedViewStart(viewBlockId) {\n var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode));\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var lContainer = container.data;\n var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n isParent = true;\n enterView(viewNode.data, viewNode);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n newView[QUERIES] = lContainer[QUERIES].createView();\n }\n enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView));\n }\n if (container) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(container, viewNode, lContainer[ACTIVE_INDEX]);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewNode.data);\n}", "title": "" }, { "docid": "b30cd15e0283074053266f46e8c2d101", "score": "0.59039414", "text": "function embeddedViewStart(viewBlockId) {\n var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode));\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var lContainer = container.data;\n var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n isParent = true;\n enterView(viewNode.data, viewNode);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n newView[QUERIES] = lContainer[QUERIES].createView();\n }\n enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView));\n }\n if (container) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(container, viewNode, lContainer[ACTIVE_INDEX]);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewNode.data);\n}", "title": "" }, { "docid": "b30cd15e0283074053266f46e8c2d101", "score": "0.59039414", "text": "function embeddedViewStart(viewBlockId) {\n var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode));\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var lContainer = container.data;\n var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId);\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n isParent = true;\n enterView(viewNode.data, viewNode);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer());\n if (lContainer[QUERIES]) {\n newView[QUERIES] = lContainer[QUERIES].createView();\n }\n enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView));\n }\n if (container) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(container, viewNode, lContainer[ACTIVE_INDEX]);\n }\n lContainer[ACTIVE_INDEX]++;\n }\n return getRenderFlags(viewNode.data);\n}", "title": "" }, { "docid": "9eb872105aed7caf8b3888b3cd40cf0c", "score": "0.5873371", "text": "createView() {\n this.view = new prosemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView(this.options.element, {\n ...this.options.editorProps,\n dispatchTransaction: this.dispatchTransaction.bind(this),\n state: prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorState.create({\n doc: createDocument(this.options.content, this.schema, this.options.parseOptions),\n }),\n });\n // `editor.view` is not yet available at this time.\n // Therefore we will add all plugins and node views directly afterwards.\n const newState = this.state.reconfigure({\n plugins: this.extensionManager.plugins,\n });\n this.view.updateState(newState);\n this.createNodeViews();\n // Let’s store the editor instance in the DOM element.\n // So we’ll have access to it for tests.\n const dom = this.view.dom;\n dom.editor = this;\n }", "title": "" }, { "docid": "c324aee048bb445edf2156d48e9f5261", "score": "0.5852215", "text": "function init() {\r\n renderView();\r\n delegateEvents();\r\n }", "title": "" }, { "docid": "38e4d4b06f358ea9ed7fb590cc53815e", "score": "0.5825791", "text": "function createEmbeddedViewNode(tView, context, renderer, queries) {\n var _isParent = isParent;\n var _previousOrParentNode = previousOrParentNode;\n isParent = true;\n previousOrParentNode = null;\n var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n var viewNode = createLNode(-1, 2 /* View */, null, null, null, lView);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n return viewNode;\n }", "title": "" }, { "docid": "9ae7fe2f0015f3f4acd811da1760cb75", "score": "0.57986885", "text": "function initialize_view() {\r\n\t\t// Make current view actively selected in view dropdown button.\r\n\t\tvar classes = $('body').attr( 'class' ).split( ' ' );\r\n\t\tfor ( i in classes ) {\r\n\t\t\t// Extract current view from the body class.\r\n\t\t\tvar matches = /ai1ec-action-([\\w]+)/.exec( classes[i] );\r\n\t\t\tif ( matches != null ) break;\r\n\t\t}\r\n\t\t// Get the dropdown menu link of the active view.\r\n\t\tvar $selected_view = $( '#ai1ec-view-' + matches[1] );\r\n\t\t// Replace contents of dropdown button with menu link, plus the caret.\r\n\t\t$( '#ai1ec-current-view' )\r\n\t\t\t.contents()\r\n\t\t\t\t.remove()\r\n\t\t\t\t.end()\r\n\t\t\t.prepend( $selected_view.contents().clone() )\r\n\t\t\t.append( '<span class=\"caret\"></span>' );\r\n\t\t// Deactivate all dropdown menu items.\r\n\t\t$( '#ai1ec-view-dropdown .dropdown-menu li' ).removeClass( 'active' );\r\n\t\t// Activate only currently selected dropdown menu item.\r\n\t\t$selected_view.parent().addClass( 'active' );\r\n\r\n\t\t// Cache the current list of post IDs\r\n\t\tpost_ids = new Array();\r\n\t\t$( '.ai1ec-post-id' ).each( function() {\r\n\t\t\tpost_ids.push( this.value );\r\n\t\t} );\r\n\t\tpost_ids = post_ids.join();\t// Store IDs as comma-separated values\r\n\r\n\t\t// Make week view table scrollable\r\n\t\t$( 'table.ai1ec-week-view-original' ).tableScroll( { height: 400, containerClass: 'ai1ec-week-view' } );\r\n\t\t$( 'table.ai1ec-oneday-view-original' ).tableScroll( { height: 400, containerClass: 'ai1ec-oneday-view' } );\r\n\r\n\t\t// ===========================\r\n\t\t// = Pop up the active event =\r\n\t\t// ===========================\r\n\t\tif( $( '.ai1ec-active-event:first' ).length ) {\r\n\t\t\t// Pop up any active event in month/week view views\r\n\t\t\t$( '.ai1ec-month-view .ai1ec-active-event:first, .ai1ec-oneday-view .ai1ec-active-event:first, .ai1ec-week-view .ai1ec-active-event:first' )\r\n\t\t\t\t.each( function() {\r\n\t\t\t\t$(this)\r\n\t\t\t\t\t.each( show_popup )\r\n\t\t\t\t\t.prev() // .ai1ec-popup\r\n\t\t\t\t\t\t.data( 'ai1ec_mouseinside', true ); // To keep pop-up from vanishing\r\n\t\t\t} );\r\n\t\t\t// Expand any active event in agenda view\r\n\t\t\t$( '.ai1ec-agenda-view .ai1ec-active-event:first > .ai1ec-event-click' ).each( expand_event );\r\n\t\t\t// Bring the active event into focus\r\n\t\t\t$.scrollTo( '.ai1ec-active-event:first', 1000,\r\n\t\t\t\t{\r\n\t\t\t\t\toffset: {\r\n\t\t\t\t\t\tleft: 0,\r\n\t\t\t\t\t\ttop: -window.innerHeight / 2 + 100\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\telse if( $( '.ai1ec-week-view' ).length || $( '.ai1ec-oneday-view' ).length ) {\r\n\t\t\t// If no active event, then in week view, scroll down to 6am.\r\n\t\t\t$( '.ai1ec-oneday-view .tablescroll_wrapper, .ai1ec-week-view .tablescroll_wrapper' ).scrollTo( '.ai1ec-hour-marker:eq(6)' );\r\n\t\t}\r\n\r\n\t\t// Apply category/tag filters if any; hide all events by default, then fade\r\n\t\t// in filtered ones.\r\n\t\tif( $('.ai1ec-dropdown.active').length ) {\r\n\t\t\t$('.ai1ec-month-view .ai1ec-event-container, .ai1ec-oneday-view .ai1ec-event-container, .ai1ec-week-view .ai1ec-event-container, .ai1ec-agenda-view .ai1ec-event').hide();\r\n\t\t\tapply_filters();\r\n\t\t}\r\n\r\n\t\t// If in month view, extend multiday events.\r\n\t\tif ( $('.ai1ec-month-view .ai1ec-multiday').length ) {\r\n\t\t\trevert_multiday_events();\r\n\t\t\textend_multiday_events();\r\n\t\t}\r\n\r\n\t\t// Hide the print button if the current view is not supported for printing.\r\n\t\ttoggle_print_button();\r\n\t}", "title": "" }, { "docid": "437d1ec96b3729f9913f3db9a5bc12e7", "score": "0.57931775", "text": "function View(context, type, parentView, data, template, key, contentTmpl, onRender) {\n // Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n var views, parentView_, tag,\n self = this,\n isArray = type === \"array\",\n self_ = {\n key: 0,\n useKey: isArray ? 0 : 1,\n id: \"\" + viewId++,\n onRender: onRender,\n bnds: {}\n };\n\n self.data = data;\n self.tmpl = template,\n self.content = contentTmpl;\n self.views = isArray ? [] : {};\n self.parent = parentView;\n self.type = type;\n // If the data is an array, this is an 'array view' with a views array for each child 'item view'\n // If the data is not an array, this is an 'item view' with a views 'hash' object for any child nested views\n // ._.useKey is non zero if is not an 'array view' (owning a data array). Use this as next key for adding to child views hash\n self._ = self_;\n self.linked = !!onRender;\n if (parentView) {\n views = parentView.views;\n parentView_ = parentView._;\n if (parentView_.useKey) {\n // Parent is an 'item view'. Add this view to its views object\n // self._key = is the key in the parent view hash\n views[self_.key = \"_\" + parentView_.useKey++] = self;\n self.index = indexStr;\n self.getIndex = getNestedIndex;\n tag = parentView_.tag;\n self_.bnd = isArray && (!tag || !!tag._.bnd && tag); // For array views that are data bound for collection change events, set the\n // view._.bnd property to true for top-level link() or data-link=\"{for}\", or to the tag instance for a data-bound tag, e.g. {^{for ...}}\n } else {\n // Parent is an 'array view'. Add this view to its views array\n views.splice(\n // self._.key = self.index - the index in the parent view array\n self_.key = self.index = key,\n 0, self);\n }\n // If no context was passed in, use parent context\n // If context was passed in, it should have been merged already with parent context\n self.ctx = context || parentView.ctx;\n } else {\n self.ctx = context;\n }\n }", "title": "" }, { "docid": "18e85934dc05c27ac11683001f725bff", "score": "0.5791354", "text": "function View () {\n\n\t\tthis._initialize();\n\n\t}", "title": "" }, { "docid": "ae3a17f159a6948cab0db6fa1021bff5", "score": "0.5758533", "text": "function createEmbeddedViewNode(tView, context, renderer, queries) {\n var _isParent = isParent;\n var _previousOrParentNode = previousOrParentNode;\n isParent = true;\n previousOrParentNode = null;\n var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n var viewNode = createLNode(-1, 2 /* View */, null, null, null, lView);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n return viewNode;\n}", "title": "" }, { "docid": "ae3a17f159a6948cab0db6fa1021bff5", "score": "0.5758533", "text": "function createEmbeddedViewNode(tView, context, renderer, queries) {\n var _isParent = isParent;\n var _previousOrParentNode = previousOrParentNode;\n isParent = true;\n previousOrParentNode = null;\n var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n var viewNode = createLNode(-1, 2 /* View */, null, null, null, lView);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n return viewNode;\n}", "title": "" }, { "docid": "ae3a17f159a6948cab0db6fa1021bff5", "score": "0.5758533", "text": "function createEmbeddedViewNode(tView, context, renderer, queries) {\n var _isParent = isParent;\n var _previousOrParentNode = previousOrParentNode;\n isParent = true;\n previousOrParentNode = null;\n var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n var viewNode = createLNode(-1, 2 /* View */, null, null, null, lView);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n return viewNode;\n}", "title": "" }, { "docid": "6d8e332ff53ac14a0ea06cf1ff9d286e", "score": "0.5747515", "text": "function embeddedViewStart(viewBlockId) {\n var container = (isParent ? previousOrParentNode : previousOrParentNode.parent);\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var lContainer = container.data;\n var viewNode = scanForView(container, lContainer.nextIndex, viewBlockId);\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n isParent = true;\n enterView(viewNode.data, viewNode);\n }\n else {\n // When we create a new LView, we always reset the state of the instructions.\n var newView = createLView(viewBlockId, renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, null, 2 /* CheckAlways */);\n if (lContainer.queries) {\n newView.queries = lContainer.queries.enterView(lContainer.nextIndex);\n }\n enterView(newView, viewNode = createLNode(null, 2 /* View */, null, newView));\n }\n return getRenderFlags(viewNode.data);\n}", "title": "" }, { "docid": "ecc8eaf4437df413f256a0faa349bd45", "score": "0.5707082", "text": "initialize(data) {\n REQUIRED_DATA.forEach((d) => {\n if (!Object.prototype.hasOwnProperty.call(data, d)) throw Error(`initialize requires: ${d}`);\n });\n data.views.forEach((v) => {\n if (v.id !== this.view.id) {\n this.addShadow(v);\n }\n });\n data.items.reverse().forEach((o) => {\n if (Object.prototype.hasOwnProperty.call(o, 'src')) {\n this.addImage(o);\n } else if (Object.prototype.hasOwnProperty.call(o, 'tagname')) {\n this.addElement(o);\n } else {\n this.addItem(o);\n }\n });\n this.view.config.shadows = data.settings.shadows;\n this.view.config.status = data.settings.status;\n }", "title": "" }, { "docid": "7a3999a54570054cdae92d942490b587", "score": "0.56759113", "text": "function init() {\n blogView = new app.views.BlogView(self);\n }", "title": "" }, { "docid": "5d372e3962e1b792d28045f7fac8edb9", "score": "0.56509835", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null, null);\n }\n return containerTViews[viewIndex];\n }", "title": "" }, { "docid": "95509aedf411c02c9795155d8483bc94", "score": "0.56035364", "text": "function builder_view_initialize() {\n\t this.next_field_num = 0;\n\n\t var template_el = document.getElementById('fz-resume-template-meta-box');\n\t this.template = Handlebars.compile(template_el.innerHTML);\n\n\t var button_wrap_el = document.getElementById('fz-resume-template-field-button');\n\t this.add_button_template = Handlebars.compile(button_wrap_el.innerHTML);\n\n\t var meta_box_inside = window.jQuery('#fz-resume-meta-box .inside');\n\n\t meta_box_inside.prepend(this.$el);\n\n\t this.render();\n\n\t this.$('.meta-fields').sortable({\n\t items: '> li',\n\t handle: '> .fz-resume-handle'\n\t });\n\n\t this.$el.delegate('.fz-resume-date', 'focusin', function () {\n\t window.jQuery(this).datepicker({\n\t dateFormat: 'mm-dd-yy',\n\t changeMonth: true,\n\t changeYear: true\n\t });\n\t });\n\t}", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5599474", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5599474", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5599474", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5599474", "text": "function TView() { }", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.55919784", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.55919784", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.55919784", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.55919784", "text": "function TView() {}", "title": "" }, { "docid": "2b124e0de7a9e2bd4caa7c6854efb5c1", "score": "0.55681664", "text": "function getOrCreateEmbeddedTView(viewIndex, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var tContainer = parent.tNode.data;\n if (viewIndex >= tContainer.length || tContainer[viewIndex] == null) {\n var tView = currentView.tView;\n tContainer[viewIndex] = createTView(tView.directiveRegistry, tView.pipeRegistry);\n }\n return tContainer[viewIndex];\n}", "title": "" }, { "docid": "3dfdfc26de680b2cb20d4059cc21e7ac", "score": "0.5562533", "text": "function initView() {\n\tif (isLocation) {\n\t\tHelper.removeFromView($.shuffleTable);\n\t\tHelper.removeFromView($.explainShuffle);\n\t\tHelper.removeFromView($.songs);\n\t\tHelper.removeFromView($.noneTable);\n\t\t$.tones.setBottom(40);\n\t}\n}", "title": "" }, { "docid": "ee194d787e7808484587eeace9a12c18", "score": "0.55488497", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "ee194d787e7808484587eeace9a12c18", "score": "0.55488497", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "ee194d787e7808484587eeace9a12c18", "score": "0.55488497", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "ee194d787e7808484587eeace9a12c18", "score": "0.55488497", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "ee194d787e7808484587eeace9a12c18", "score": "0.55488497", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "31f4b91e31bfb5b9180cf11dfeb77c4f", "score": "0.5544254", "text": "function getOrCreateEmbeddedTView(viewIndex, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tNode.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] =\n createTView(viewIndex, null, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n }", "title": "" }, { "docid": "2a5f28d613843e6f1ab7eedb51a475e1", "score": "0.55422556", "text": "function initView(args){\n\t\tvar view = registry.byId(args.id);\n\t\tvar viewType = (args.type) ? args.type : 'demo';\n\t\t\n\t\tconnect.connect(view, \"onAfterTransitionIn\", view, function(){\n\t\t\tinTransitionOrLoading = false;\n\t\t\tvar headerLabel = dom.byId('headerLabel');\n\t\t\tvar header = dom.byId(\"header\");\n\t\t\tvar sourceButton = dom.byId(\"sourceButton\");\n\t\t\tif (viewType === 'demo') {\n\t\t\t\t// after transition in, set the header, source button and load\n\t\t\t\t// the source code of current view.\t\t\t\t\t\t\n\t\t\t\t// but exclude when you transit back from \"source\"\n\t\t\t\t// otherwise local nav history will be broken\n\t\t\t\tif (!transitFrom || (transitFrom != \"source\")) {\n\t\t\t\t\theaderLabel.innerHTML = args.title;\n\t\t\t\t\t// this is more a timing change, update nav button after transit in\n\t\t\t\t\t// so that it can be shown/hidden along with \"Source\" button\n\t\t\t\t\tif (structure.layout.leftPane.hidden) {\n\t\t\t\t\t\tstructure.navRecords.push({\n\t\t\t\t\t\t\tfrom:\"navigation\",\n\t\t\t\t\t\t\tto: args.id,\n\t\t\t\t\t\t\ttoTitle: args.title,\n\t\t\t\t\t\t\tnavTitle:\"Back\"\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclearNavRecords();\n\t\t\t\t\t}\n\t\t\t\t\tconnect.publish(\"onAfterDemoViewTransitionIn\", [args.id]);\n\t\t\t\t}\n\t\t\t\tvar srcBtn = registry.byId(\"sourceButton\");\n\t\t\t\tsrcBtn.backTo = args.id;\n\t\t\t\tsrcBtn.set(\"selected\", false);\n\t\t\t\tsourceButton.innerHTML = (srcBtn.selected ? \"Demo\" : \"Source\");\n\t\t\t\t\n\t\t\t\t// set the header's moveTo attribute to \"navigation\"\n\t\t\t\tregistry.byNode(header).moveTo = \"navigation\";\n\t\t\t\t// restore sourceButton if applicable\n\t\t\t\tif (domClass.contains(sourceButton, \"hidden\")) {\n\t\t\t\t\tdomClass.remove(sourceButton, \"hidden\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdom.byId(\"htmlContent\").innerHTML = getDemoHtml(args.id);\n\t\t\t\tdom.byId(\"jsContent\").innerHTML = getDemoJs(args.id);\n\t\t\t\tregistry.byId(\"htmlSrcView\").scrollTo({x:0,y:0});\n\t\t\t\tregistry.byId(\"jsSrcView\").scrollTo({x:0,y:0});\n\t\t\t\tstructure.layout.currentDemo = {\n\t\t\t\t\tid: args.id,\n\t\t\t\t\ttitle: args.title\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (viewType === 'navigation') {\n\t\t\t\t//hide the sourceButton when navigation views \n\t\t\t\t//and demo views are in the same holder.\n\t\t\t\tif (structure.layout.leftPane.hidden) {\n\t\t\t\t\t// set header label and the moveTo attribute of header to args.back\n\t\t\t\t\theaderLabel.innerHTML = args.title;\n\t\t\t\t\tregistry.byNode(header).moveTo = args.back;\n\t\t\t\t\t// hide or show navigation button, hide sourceButton\n\t\t\t\t\tif (!domClass.contains(sourceButton, \"hidden\")) {\n\t\t\t\t\t\tdomClass.add(sourceButton, \"hidden\");\n\t\t\t\t\t}\n\t\t\t\t\t// co-operate with \"srcBtnClickHandler()\" above\n\t\t\t\t\tshowHideNavButton();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// if leftPane is not hidden then we need to set the back attribute of the leftPane header\n\t\t\t\t\tvar leftHeader = dom.byId(\"leftHeader\");\n\t\t\t\t\tvar leftHeaderLabel = dom.byId(\"leftHeaderLabel\");\n\t\t\t\t\tregistry.byNode(leftHeader).moveTo = args.back;\n\t\t\t\t\t// set the header label\n\t\t\t\t\tleftHeaderLabel.innerHTML = args.title;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tstructure.layout.setCurrentView(this.id);\n\t\t});\n\t}", "title": "" }, { "docid": "fb62804a98c7aa74de9b361282e50737", "score": "0.55413395", "text": "initView(view) {\n\t\t//debug\n\t\tthis.root.addChild(view);\n\t}", "title": "" }, { "docid": "da36d7fb49ae2d8a88e0a11005d0f0b9", "score": "0.55131125", "text": "initView() {\n var {$container, videoSrc, videoStart, videoEnd} = this;\n \n this.view = new PlayerView({$container, videoSrc, videoStart, videoEnd});\n\n this.view.ready().then(this.viewReady.resolve);\n }", "title": "" }, { "docid": "ad7b005f7fe5d66e99056f748cf3d8f2", "score": "0.55102235", "text": "function create( dataView, $el, options ) {\n\n var dfd = $.Deferred();\n\n dfd.then(function() { delete _view_creating[dataView]; }, function() { delete _view_creating[dataView]; } );\n\n _view_creating[dataView] = dfd;\n\n load( dataView ).then( function( view ) {\n\n var inst = new view(_.extend( options, { el: $el[0] } )),\n parent, fizzle = false;\n\n $el.attr( 'data-cid', inst.cid );\n _view_inst[inst.cid] = inst;\n\n parent = $el.parents( '[data-view]' ).first();\n\n if ( parent.length > 0 ) {\n parent = parent.attr( 'data-cid' );\n if ( _view_inst[parent] ) {\n _view_inst[parent].addChild( inst );\n inst.setParent( _view_inst[parent] );\n } else {\n fizzle = true;\n inst.remove();\n }\n } else if ( $el.closest('body').length === 0 ) {\n fizzle = true;\n inst.remove();\n }\n\n if (!fizzle) {\n inst.render();\n dfd.resolve( inst );\n } else {\n dfd.reject();\n }\n\n }, function() { dfd.reject(); } );\n\n }", "title": "" }, { "docid": "6a32a3cd64a3f2231fb679933ddca71f", "score": "0.5481295", "text": "function MainView() {\n this.$el = $('#main-view');\n\n // STATE [\n this.state = {\n recursive: true,\n mode: 'code',\n// mode: 'childs',\n// mode: 'code childs',\n applyChilds: true\n };\n // STATE ]\n\n this.scopes = {}\n\n}", "title": "" }, { "docid": "d8af4dad7b1ad71cae6ce75f60fa6881", "score": "0.5465", "text": "initViews() {\n let graph = this.gameOrchestrator.theme;\n this.cameraDefault = graph.views[graph.defaultView];\n }", "title": "" }, { "docid": "eb56c8ac57e0087a076733c0afd2b428", "score": "0.54343474", "text": "_createEmbeddedViewAt(index) {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return this._viewContainerRef.createEmbeddedView(this._template, {\n $implicit: null,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false\n }, index);\n }", "title": "" }, { "docid": "a4c011c7e446b08a925a05db97125d54", "score": "0.54256094", "text": "function enterView(newView, hostTNode) {\n var oldView = viewData;\n tView = newView && newView[TVIEW];\n creationMode = newView && (newView[FLAGS] & 1 /* CreationMode */) === 1 /* CreationMode */;\n firstTemplatePass = newView && tView.firstTemplatePass;\n bindingRootIndex = newView && tView.bindingStartIndex;\n renderer = newView && newView[RENDERER];\n previousOrParentTNode = hostTNode;\n isParent = true;\n viewData = contextViewData = newView;\n oldView && (oldView[QUERIES] = currentQueries);\n currentQueries = newView && newView[QUERIES];\n return oldView;\n}", "title": "" }, { "docid": "a4c011c7e446b08a925a05db97125d54", "score": "0.54256094", "text": "function enterView(newView, hostTNode) {\n var oldView = viewData;\n tView = newView && newView[TVIEW];\n creationMode = newView && (newView[FLAGS] & 1 /* CreationMode */) === 1 /* CreationMode */;\n firstTemplatePass = newView && tView.firstTemplatePass;\n bindingRootIndex = newView && tView.bindingStartIndex;\n renderer = newView && newView[RENDERER];\n previousOrParentTNode = hostTNode;\n isParent = true;\n viewData = contextViewData = newView;\n oldView && (oldView[QUERIES] = currentQueries);\n currentQueries = newView && newView[QUERIES];\n return oldView;\n}", "title": "" }, { "docid": "a760a1603c5dea8e5c80bac0c81f2151", "score": "0.5425171", "text": "_createEmbeddedViewAt(index) {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return this._viewContainerRef.createEmbeddedView(this._template, {\n $implicit: null,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false\n }, index);\n }", "title": "" }, { "docid": "ecc11cb9b46ce4849cf8748c2ec34885", "score": "0.5423764", "text": "init_tvjs($root) {\n if (this.tv === undefined) {\n this.tv = $root\n this.init_data()\n this.update_ids()\n }\n }", "title": "" }, { "docid": "f4541e02603e4d6e6309459fb33ab4fc", "score": "0.54229814", "text": "function getOrCreateEmbeddedTView(viewIndex, consts, vars, parent) {\n var tView = getTView();\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "a4031509fb000954be808cd36d2faee8", "score": "0.5415503", "text": "function getOrCreateEmbeddedTView(viewIndex, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tNode.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] =\n createTView(viewIndex, null, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "a4031509fb000954be808cd36d2faee8", "score": "0.5415503", "text": "function getOrCreateEmbeddedTView(viewIndex, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tNode.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] =\n createTView(viewIndex, null, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "a4031509fb000954be808cd36d2faee8", "score": "0.5415503", "text": "function getOrCreateEmbeddedTView(viewIndex, parent) {\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tNode.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] =\n createTView(viewIndex, null, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.5404058", "text": "function TView(){}", "title": "" }, { "docid": "5704424b93825aac11aec8620bdb80bf", "score": "0.53831905", "text": "function init() {\n // debugger;\n // The data we are syncing from Firebase\n var collection = new ResourceCollection();\n var app = new AppView({ collection: collection });\n}", "title": "" }, { "docid": "95bb0c46e93f01b4af530b6cff082346", "score": "0.5359871", "text": "function _extendWithStaticViews(objState) {\n if (!objState.views) {\n objState.views = {};\n }\n return objState;\n}", "title": "" }, { "docid": "73afebab232aa3af7a6d651dbcb116fd", "score": "0.5329973", "text": "constructor() {\n super()\n\n this.view = View.create()\n this.model = Model.create(Model.handleDataChange)\n\n this.view.on('change:viewName', (viewName) => {\n getTemplate(viewName, this).then(() => {\n const templateData = this.view.get('templates')[viewName]\n const styles = templateData.styles\n\n this.view.render(templateData.template, {\n styles\n })\n pageConfigs[viewName].setupPageData()\n })\n })\n }", "title": "" }, { "docid": "ae2733be5c49e36c7974f1b485c2959b", "score": "0.53185385", "text": "function init(instance) {\n instance.elem.innerHTML = \"\";\n instance.showView(\"start\");\n }", "title": "" }, { "docid": "4628ac27b8e8f272d1f550bde574758c", "score": "0.53181857", "text": "function init() {\n // The data we are syncing from Firebase\n var collection = new TodoCollection();\n var app = new AppView({ collection: collection });\n}", "title": "" }, { "docid": "c69447a9d4a8e5a96c29a2d1cb0ae667", "score": "0.5304899", "text": "function LView(){}", "title": "" }, { "docid": "a374002b2aeeaa228c0c7dde7624cf15", "score": "0.5298036", "text": "function initializeViews() {\n titlebarView = new layerSampleApp.Titlebar();\n titlebarView.render();\n\n // Setup Conversation Views\n conversationListView = new layerSampleApp.ConversationList();\n conversationListHeaderView = new layerSampleApp.ConversationListHeader();\n userListView = new layerSampleApp.UserListDialog();\n\n // Setup Message Views\n messageComposerView = new layerSampleApp.MessageComposer();\n messageListView = new layerSampleApp.MessageList();\n\n // When the user clicks the New Conversation button in the\n // Conversation List Header, call newConversation.\n conversationListHeaderView.on('conversations:new', function() {\n newConversation();\n });\n\n // When the user is in the User List Dialog and clicks to create a conversation,\n // call createConversation.\n userListView.on('conversation:created', function(participants) {\n createConversation(participants);\n });\n\n // When the user selects a Conversation, call selectConversation.\n conversationListView.on('conversation:selected', function(conversationId) {\n selectConversation(conversationId);\n });\n\n // When the user hits ENTER after typing a message this will trigger\n // to create a new message and send it.\n messageComposerView.on('message:new', function(text) {\n sendMessage(text);\n });\n }", "title": "" }, { "docid": "a632c0704a990f8835c865bd405b7cd8", "score": "0.52967584", "text": "function field_view_initialize() {\n\t this.next_item_num = 0;\n\n\t var wrap_el = document.getElementById('fz-resume-template-meta-field-wrap');\n\t this.wrap_template = Handlebars.compile(wrap_el.innerHTML);\n\n\t var repeater_el = document.getElementById('fz-resume-template-meta-repeater');\n\t this.repeater_template = Handlebars.compile(repeater_el.innerHTML);\n\n\t var repeater_wrap_el = document.getElementById('fz-resume-template-meta-repeater-item-wrap');\n\t this.repeater_wrap_template = Handlebars.compile(repeater_wrap_el.innerHTML);\n\n\t this.render();\n\n\t var field_type = this.model.get('field');\n\n\t if (field_type_is_a_repeater(field_type)) {\n\t this.$el.sortable({\n\t items: '.list-items > li',\n\t handle: '> .fz-resume-list-handle'\n\t });\n\t }\n\t}", "title": "" }, { "docid": "d5923828ef6e1f89db06644108d050e4", "score": "0.5296562", "text": "afterViewInit() {\n this.initData();\n this.attachEvents();\n }", "title": "" }, { "docid": "f9bdb44a4f000f4647e363137d1d7e7d", "score": "0.5286031", "text": "function getOrCreateEmbeddedTView(viewIndex, decls, vars, parent) {\n var tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, 0 /* Container */);\n var containerTViews = parent.tViews;\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(2 /* Embedded */, viewIndex, null, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, null, tView.consts);\n }\n return containerTViews[viewIndex];\n}", "title": "" }, { "docid": "ec9f885a043f0648a88fca71b725d81e", "score": "0.52641", "text": "initialize(options) {\n RB.Admin.PageView.prototype.initialize.call(this, options);\n\n this.formID = options.formID;\n this.formView = null;\n this.inlineGroupViews = [];\n }", "title": "" }, { "docid": "476059b58133db3688b3d419e17affed", "score": "0.5263", "text": "function cms_tvp_set_view(view, elm) {\n\n\tvar $wrapper = jQuery(elm).closest(\".cms_tpv_wrapper\"),\n\t\tdiv_actions_for_post_type = cms_tpv_get_page_actions_div(elm);\n\n\tcms_tpv_message.hide();\n\n\t$wrapper.append(div_actions_for_post_type);\n\t$wrapper.find(\".cms_tvp_view_all, .cms_tvp_view_public, .cms_tvp_view_trash\").removeClass(\"current\");\n\t$wrapper.find(\".cms_tpv_container\").jstree(\"destroy\").html(\"\");\n\t$wrapper.find(\"div.cms_tpv_page_actions\").removeClass(\"cms_tpv_page_actions_visible\");\n\n\tcms_tpv_bind_clean_node();\n\n\t// Mark selected link\n\tif (view == \"all\") {\n\t\t$wrapper.find(\".cms_tvp_view_all\").addClass(\"current\");\n\t} else if (view == \"public\") {\n\t\t$wrapper.find(\".cms_tvp_view_public\").addClass(\"current\");\n\t} else if (view == \"trash\") {\n\t\t$wrapper.find(\".cms_tvp_view_trash\").addClass(\"current\");\n\t} else {\n\n\t}\n\n\t// Reload tree\n\tvar treeOptionsTmp = jQuery.extend(true, {}, treeOptions);\n\ttreeOptionsTmp.json_data.ajax.url = ajaxurl + CMS_TPV_AJAXURL + view + '&cms-tpv-nonce=' + window.CMS_TPV_NONCE + \"&post_type=\" + cms_tpv_get_post_type(elm) + \"&lang=\" + cms_tpv_get_wpml_selected_lang(elm);\n\n\t$wrapper.find(\".cms_tpv_container\").on(\"loaded.jstree open_node.jstree\", cms_tpv_tree_loaded);\n\t$wrapper.find(\".cms_tpv_container\").jstree(treeOptionsTmp);\n\n}", "title": "" }, { "docid": "002b546fc923de5c860eda99d17c83ae", "score": "0.52574986", "text": "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "title": "" }, { "docid": "002b546fc923de5c860eda99d17c83ae", "score": "0.52574986", "text": "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "title": "" }, { "docid": "1e678063303addad4582294d1fabdb1e", "score": "0.52475935", "text": "function navigate(viewType, data) {\n\n setImmediate(function() {\n \n if (currentView && currentView.unload) {\n currentView.unload();\n }\n\n currentView = new viewType();\n\n let template = document.querySelector(`#templates ${currentView.templateSelector}`).cloneNode(true);\n currentView.initialize(template, data);\n\n let contentRoot = document.querySelector(\"#content-root\");\n while (contentRoot.firstChild)\n {\n contentRoot.removeChild(contentRoot.firstChild);\n }\n contentRoot.appendChild(template);\n });\n }", "title": "" }, { "docid": "506eaf38b542c3d293290936f2bfafdd", "score": "0.52409154", "text": "initialize() {\n this.renderRoot = this.createRenderRoot();\n this._saveInstanceProperties();\n }", "title": "" }, { "docid": "5cd83cf0ef2d3a82ceac391d784e4c77", "score": "0.5230848", "text": "defineView(aViewDef) {\n this._views[aViewDef.index] = aViewDef;\n }", "title": "" }, { "docid": "80b1c0c1d18832d5580937d53356312b", "score": "0.5223248", "text": "function View(template) {\n this.template = template;\n this.$eventsList = document.querySelector('.events');\n }", "title": "" }, { "docid": "cd3b4f56735130cb7515e14e339393f2", "score": "0.52103764", "text": "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\tcalcSize();\n\t\trenderView(viewType, scrollState);\n\n\t\tthawContentHeight();\n\t\tignoreWindowResize--;\n\t}", "title": "" } ]
eb1bda24efabe050237523b1c40512ca
Checks if a section (sect) takes place in the given semester (sem)
[ { "docid": "0932d1bafdd48959c180a7b0aceaef6d", "score": "0.86627704", "text": "function sectionIsInSemester(sect, sem) {\n return (sem.year == String(sect.year) &&\n sem.semester.toLowerCase() === sect.semester.toLowerCase());\n }", "title": "" } ]
[ { "docid": "0be84f039bc17260217262cef9fba6ca", "score": "0.59301907", "text": "function is_section_news(section){\r\n var list = ['rugby_espnnews', 'rugby_foxnews'];\r\n for(var i=0; i < list.length; ++i){\r\n if (list[i] == section){\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "0a874b16c8419c83a1f4eff8022b8b4c", "score": "0.579228", "text": "function isSectionEvent(event) {\n return 'section' === event.category;\n }", "title": "" }, { "docid": "9e3b80e3979302015de59e10d30c30ab", "score": "0.5763686", "text": "isClosedSection() {\n for (var i = 0; i < Object.keys(this.seams).length; i++) {\n var seamId = Object.keys(this.seams)[i];\n var seam = this.seams[seamId];\n if (seam.isBoundary) {\n if (seam.startSeam == null || seam.endSeam == null) {\n return false;\n }\n var startSeams = this.getBoundarySeamsAtVertex(seam.startVertex.idx);\n var endSeams = this.getBoundarySeamsAtVertex(seam.endVertex.idx);\n if (startSeams.length < 2 || endSeams.length < 2) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "84caa84ac98cd1e0427939d678db7388", "score": "0.57436424", "text": "function setSemOptsFromSects(sectOpts) {\n let opts = [];\n for (let i = 0; i < semesters.length; i++) {\n for (let j = 0; j < sectOpts.length; j++) {\n if (sectionIsInSemester(sectOpts[j], semesters[i])) {\n opts.push(i);\n }\n }\n }\n setSemOptions(opts);\n }", "title": "" }, { "docid": "d1e07ca21b5ff2a1d15b20f33afa7cb4", "score": "0.5682997", "text": "function sectorContainsSector( m, p ) {\n\n\treturn three_module_area( m.prev, m, p.prev ) < 0 && three_module_area( p.next, m, m.next ) < 0;\n\n}", "title": "" }, { "docid": "f839a9d2b1e1812dc899cb6f8b054e53", "score": "0.5660036", "text": "function sectorContainsSector(m, p) {\r\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\r\n }", "title": "" }, { "docid": "9512035381179631d5d18abaa0493166", "score": "0.5644165", "text": "function sectorContainsSector$1(m, p) {\n return area$1(m.prev, m, p.prev) < 0 && area$1(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "292a40f4ba6b4e8fdab52b0c9c9bd95f", "score": "0.56371576", "text": "function sectorContainsSector( m, p ) {\n\n\t\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n\t}", "title": "" }, { "docid": "c2a979283a61179d4719f670202e53bf", "score": "0.5630334", "text": "function sectorContainsSector(m, p) {\n return area$1(m.prev, m, p.prev) < 0 && area$1(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "73fa4c318e228a888728a6495b91db32", "score": "0.5592795", "text": "function sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}", "title": "" }, { "docid": "73fa4c318e228a888728a6495b91db32", "score": "0.5592795", "text": "function sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}", "title": "" }, { "docid": "73fa4c318e228a888728a6495b91db32", "score": "0.5592795", "text": "function sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "6545a2aa471010973117080175dbc48a", "score": "0.5583349", "text": "function sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}", "title": "" }, { "docid": "d61fd4dba12cae583584f49686b1dac7", "score": "0.55717695", "text": "function semcomp(sem1, sem2) {\n if (sem1.year != sem2.year) {\n return -(sem1.year - sem2.year);\n } else {\n if (sem1.semester === sem2.semester)\n return 0;\n else if (sem1.semester.toLowerCase() === \"spring\")\n return 1;\n else\n return -1;\n }\n }", "title": "" }, { "docid": "f164f5a41a189666b132b435a6cba417", "score": "0.5503272", "text": "function checkSection(puzzle){\n for(let i = 0; i < 3; i++){\n for(let j = 0; j < 3; j++){\n let currentSec = sudMethodsObj.getSection(puzzle, j, i);\n if(sudMethodsObj.subCheck(currentSec)[0] === false){\n sudMethodsObj.secRepeaters.push([i, j, sudMethodsObj.subCheck(currentSec)[1]]);\n sudMethodsObj.affectedSections.push([j,i]);\n if(sudMethodsObj.result !== \"incorrectInputArray\"){\n sudMethodsObj.result = false; \n }\n }\n }\n }\n }", "title": "" }, { "docid": "2a6ff2456b014c13af5872cba618cd79", "score": "0.54513335", "text": "function validateSections(sectionIds)\r\n {\r\n var errorMessages = \"\"; \r\n if(!PS.Common.Functions.isNullOrEmpty(sectionIds))\r\n {\r\n for(var index=0;index < sectionIds.length;index++)\r\n {\r\n registerEntityValidation(sectionIds[index]);\r\n errorMessages += activePage.getErrorMessage(sectionIds[index]);\r\n }\r\n }\r\n \r\n if( !PS.Common.Functions.isNullOrEmpty(errorMessages) )\r\n {\r\n //TODO: Need to change based, scenarios used...\r\n if(!PS.Common.Functions.isNullOrEmpty(sectionIds))\r\n showErrorMessage(sectionIds[0],errorMessages);\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "2774621616328fa8da2a31da0dbdad29", "score": "0.54444337", "text": "isSelectedSemester( semester ) {\n\n // Compare the semester data for a match.\n return _.isEqual(this.selected.semester, semester);\n\n }", "title": "" }, { "docid": "0d8d15a6f26e87ff53b14f90b1cb0a48", "score": "0.5437843", "text": "function isNavSection(node) {\n\t\treturn isTag('section', node) || isTag('article', node);\n\t}", "title": "" }, { "docid": "89b1b2051374ad957332ffe464c49c6d", "score": "0.5392882", "text": "isValidSector(sector){\n return sector[0] >= 0 && sector[0] <= 11 && sector[1] >= 0 && sector[1] <= 11\n }", "title": "" }, { "docid": "e5174a9c536059dda0996b3bbab42164", "score": "0.5391695", "text": "function is_retreived_required(section){\r\n var list = ['fixtures', 'results', 'rugby_espnnews', 'rugby_foxnews'];\r\n for(var i=0; i < list.length; ++i){\r\n if (list[i] == section){\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "ceb49887a2e2243eedf451332e3b948d", "score": "0.53662443", "text": "function restrictSections(){\n console.log(\"Angular:Sections are Restriced\");\n if($scope.optDept.Code==\"CIV\"||$scope.optDept.Code==\"BME\"){\n $scope.sec=[\"A\"];\n $scope.optSec=$scope.sec[0];\n }\n else\n $scope.sec=[\"A\",\"B\"];\n }", "title": "" }, { "docid": "ddfc8260fb71fdcebfa0c2dd7ac09eea", "score": "0.53397113", "text": "function processSections(sects) {\n sects = sects.sort(sectcomp);\n if (instAnchored && iid !== 0) {\n setSemOptsFromSects(sects);\n } else if (!instAnchored && sem !== 0) {\n setInstOptsFromSects(sects);\n }\n return sects;\n }", "title": "" }, { "docid": "79ddb9c3f55e7d050c8d0985a28eb98c", "score": "0.5306937", "text": "isSectionVisible() {}", "title": "" }, { "docid": "f6a4f72fce01e878d7d5774ac1363560", "score": "0.53000593", "text": "function CheckSectores(){\n\tvar checkiar = true;\n\tif($(\"#numSector\").val()<0||$(\"#numSector\").val()>99||$(\"#numSector\").val()==\"\"||$(\"#txtDesSector\").val()==\"\"){\n\t\tcheckiar = false;\n\t}\n\tfor(var l=0;l<colSectores.length;l++){\n\t\tif(colSectores[l].Numero == $(\"#numSector\").val()){\n\t\t\tcheckiar=false;\n\t\t}\n\t}\n\treturn checkiar;\n}", "title": "" }, { "docid": "6be7b1aebaeaaf2cb78de1e47ba7714b", "score": "0.5184252", "text": "function isSemesterFormValid(){\n return(NamaField.isValid() && TahunAjaranField.isValid() && BatasRegField.isValid());\n }", "title": "" }, { "docid": "cd2f2c67328bf9be72a12f5f7ef05794", "score": "0.5107379", "text": "function validateSection(section) {\n // while there are 2+ elements in the current section...\n while (section.length > 1) {\n const currentValue = section.shift() // kickoff the first element\n // check if there are values in the section that are duplicate of the current value\n if (section.includes(currentValue)) {\n // then we have a duplicate value, IE NOT VALID\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "37f655628873d8678599ffe27472d3b9", "score": "0.50929004", "text": "function Section(src, class_list_version) {\n var sect;\n var tokens;\n if (src.incomplete) { // A schedule was opened with the wrong semester\n sect = { // active. Only 3 fields are known.\n college: \"Other\",\n program: src.program,\n course_id: 0,\n catalog_no: src.catalog_no,\n section: src.section,\n session: \"\",\n ugrad: true,\n title: \"(no such course)\",\n class_no: 0,\n seats: -1,\n filled: -1,\n instructor: \"(unknown)\",\n closed: false,\n credits: -1,\n meetsAt: new TBAMeeting(\"\")\n };\n }\n else if (class_list_version === 0) { // Old class list files.\n tokens = src.split(\",\");\n sect = {\n college: tokens[1],\n program: tokens[2],\n course_id: parseInt(tokens[3], 10),\n catalog_no: tokens[4],\n section: tokens[5],\n session: tokens[6],\n ugrad: (tokens[7] == \"UGRAD\"),\n title: tokens[8],\n class_no: parseInt(tokens[9], 10),\n seats: parseInt(tokens[10], 10),\n filled: parseInt(tokens[11], 10),\n instructor: (function(){\n var a = (tokens.length == 14 ? tokens[12] : tokens[12] + \",\" + tokens[13]);\n return (a === \"\" ? \"TBA\" : a);\n })(),\n closed: (tokens[tokens.length-3] == \"C\"),\n credits: parseInt(tokens[tokens.length-2], 10),\n meetsAt: makeMeeting(tokens[tokens.length-1], tokens[6])\n };\n }\n else { // New class list files.\n tokens = src.splitQuoted(\",\", \"\\\"\");\n sect = {\n college: tokens[1],\n program: tokens[2],\n course_id: parseInt(tokens[3], 10),\n catalog_no: tokens[4],\n section: tokens[5],\n session: tokens[6],\n ugrad: (tokens[7] == \"UGRAD\"),\n title: tokens[8],\n class_no: parseInt(tokens[9], 10), // this is unique within a semester.\n seats: parseInt(tokens[10], 10),\n filled: parseInt(tokens[11], 10),\n instructor: (tokens[12] === \"\" ? \"TBA\" : tokens[12]),\n closed: (tokens[13] == \"C\"),\n credits: parseInt(tokens[14], 10),\n meetsAt: makeMeeting(tokens[15], tokens[6])\n };\n }\n \n // Why did I call this res?\n var res = {\n // Sets credits to zero.\n suppressCredits: function () {\n this.credits = 0;\n },\n \n // Returns this section as a string. Used for saving a\n // schedule.\n toString: function() {\n return this.program + \" \" + this.catalog_no + \" \" + this.section + \" \" + this.title\n + \" \" + this.instructor + \" \" + this.filled + \"/\" + this.seats\n + (this.closed ? \" (C) \" : \" \")\n + this._meetsAt().toString();\n },\n \n // Returns this's meeting.\n _meetsAt: function () {\n if (typeof this.meetsAt === \"undefined\") {\n this.meetsAt = new TBAMeeting(\"\");\n }\n return this.meetsAt;\n },\n \n // Determines whether the number of credits that this section\n // has can reliably be regarded to be true.\n creditHoursInDoubt: function() {\n if (this.credits != 1\n || this.title.indexOf(\" LAB\") != -1\n || this.title == \"INTRO TO ENGR PROJECTS\"\n || (this.program == \"PHYSED\" && this.catalog_no < 2000))\n return false;\n var hrs = this._meetsAt().class_hours();\n var is_lab = this.section.length > 0\n && (this.section[0] == \"L\" || this.section[0] == \"l\");\n if (hrs == this.credits || (hrs/2 == this.credits && is_lab))\n return false;\n else\n return true;\n },\n \n // Checks whether this section conflicts with another.\n conflictsWith: function(other) {\n return this._meetsAt().conflictsWith(other._meetsAt());\n },\n \n // Checks whether this section conflicts with another that\n // isn't itself.\n conflictsWithSansSelf: function(other) {\n return this != other && this._meetsAt().conflictsWith(other._meetsAt());\n },\n \n // Returns the iCal text for this section.\n toICal: function(gen) {\n var note = this.title;\n if (this.instructor != \"TBA\")\n note += \"\\\\nInstructor: \" + this.instructor;\n var result = this._meetsAt().toICal(this.program + \" \" + this.catalog_no + \" \",\n note,\n gen);\n return result;\n }\n };\n \n var a = {};\n $.extend(true, a, res, sect); \n return a;\n}", "title": "" }, { "docid": "2330600500e71b7318f13f9e2332054c", "score": "0.50741404", "text": "function studentsExceedGoal (){\n var arrayStudents = data[sede][generation]['students'];\n for(i = 0; arrayStudents.length; i++){\n if(arrayStudents[i]['sprints'] == )\n\n }\n}", "title": "" }, { "docid": "56f9ecd0f3abb3c5962e1e2fc9f55399", "score": "0.5071894", "text": "function hasConflict(curr, sections) {\n let returnValue = false;\n for (let section of sections) {\n for (let st of section.times) {\n for (let currTimesObj of curr.times) {\n if (currTimesObj.days == st.days) {\n //console.log('\\n---\\n' + curr.section + ' - ' + section.section);\n //console.log(st.days);\n //console.log(currTimesObj.start + \" vs. \" + st.start);\n if ((currTimesObj.start >= st.start && currTimesObj.start <= st.end) || (currTimesObj.end >= st.start && currTimesObj.end <= st.end)) {\n //returnValue = true; \n return true; \n }\n }\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "703875e34b2bc3e9e331d9b0f21052f4", "score": "0.5046814", "text": "_updateSection(section) {\n const intSection = parseInt(section);\n if (!isNaN(intSection) && intSection >= constants.minSection && intSection <= constants.maxSection) {\n if (this.shouldLoadSection(section)) {\n this.loadSection(section);\n } else {\n this._updateStudents(constants.defaultNumStudents);\n this.setState(() => ({ section: intSection }));\n }\n }\n }", "title": "" }, { "docid": "aa88ed8c98b0dc05b04296f550fdd15f", "score": "0.5042068", "text": "function validCourseInfo(crse) {\n return (crse.crse_id && crse.crse_offer_nbr && \n crse.catalog_nbr &&\n crse.subject_lov_descr &&\n crse.course_title_long);\n}", "title": "" }, { "docid": "7e8f64fd0a277567bbb55d16d5437e5d", "score": "0.50022614", "text": "function SectionEngagement(){}", "title": "" }, { "docid": "75cfe55824b2cd23ac2dbb5e22948378", "score": "0.49872983", "text": "function sectionCheckChange() {\n try {\n vm.module.pageObj.sectionObj = new section();\n\n // manage section dataList for section input field \n _displaySectionNameByPageId(vm.module._id, vm.module.pageObj._id);\n\n } catch (e) {\n showErrorMsg();\n }\n }", "title": "" }, { "docid": "196af02a3de7f8fc6b5b926088b7d355", "score": "0.49663863", "text": "function sectionInViewPort(section) {\n let sectionPlace = section.getBoundingClientRect();\n console.log(sectionPlace);\n return sectionPlace.top < 100 && sectionPlace.bottom > 0;\n}", "title": "" }, { "docid": "c9dd226d636a755373ebeab89576b358", "score": "0.49445656", "text": "function checkSectors() {\n\t\tfor (var i = 0; i < 9; i++) {\n\t\t\tvar sectorToCheck = createArrayForSector(i);\n\t\t\tcheckSingleLine(sectorToCheck);\n\t\t}\n\t}", "title": "" }, { "docid": "7b1ad8ada3a77b7436759ec8f95e1415", "score": "0.49241075", "text": "function sectionLessThan(a, b) {\n if (a.college != b.college)\n if (a.college > b.college) return 1;\n else return -1;\n if (a.program != b.program)\n if (a.program > b.program) return 1;\n else return -1;\n if (a.catalog_no != b.catalog_no)\n if (a.catalog_no > b.catalog_no) return 1;\n else return -1;\n if (a.section != b.section)\n if (a.section > b.section) return 1;\n else return -1;\n return 1;\n}", "title": "" }, { "docid": "0290d5fe1023f5d82c2cf0bb2984ea75", "score": "0.49128884", "text": "function sectionInViewport() {\n //use the Intersection Observer to detect if the section appears in the viewport\n //only if it's supported\n \n if(!! window.IntersectionObserver) {\n \n //define the observer object and send the intersecting section to \n //function activateSelectedSec to apply the 'your-active-class' to \n //highlight the section appears in the viewport\n const observer = new IntersectionObserver(function(entries, observer) {\n entries.forEach(entry => {\n if(entry.isIntersecting) {\n activateSelectedSec(entry.target);\n }\n })\n }, {threshold: 1});\n sectionsArr.forEach(section => {\n observer.observe(section);\n });\n } else { \n \n //in case the observer is not supported, this is another way I have learned to \n //detect if the section appears in the viewport\n \n //loop on every section and get it's viewable dimensions to compare\n //it with the space the page has been scrolled till now related to the\n //top left corner of the window to know if it appears now in the \n //viewport or not\n sectionsArr.forEach(section => {\n let rectView = section.getBoundingClientRect();\n if(rectView.top >= 0 && rectView.left >= 0 && \n rectView.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rectView.right <= (window.innerWidth || document.documentElement.clientWidth)) {\n activateSelectedSec(section);\n }\n });\n }\n}", "title": "" }, { "docid": "5c4b7c8b3d955ab042bb138047c7171a", "score": "0.49013704", "text": "function inViewport(section) {\n let bounding = section.getBoundingClientRect();\n return (\n bounding.top <= 150 &&\n bounding.left <= 150 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n}", "title": "" }, { "docid": "e6b8f208325e3966844f7730cfd13e0d", "score": "0.48982415", "text": "function isSegmentsTechnique(technique) {\n return technique.name === \"segments\";\n}", "title": "" }, { "docid": "e6b8f208325e3966844f7730cfd13e0d", "score": "0.48982415", "text": "function isSegmentsTechnique(technique) {\n return technique.name === \"segments\";\n}", "title": "" }, { "docid": "6077eb920ce5c8958a4a5c3dd9fd4ac5", "score": "0.4891417", "text": "function stdDoesCaseAssignmentHaveData() \n{\n return (pgSubSectionHasData('NBS_INV_STD_UI_29'));\n}", "title": "" }, { "docid": "8260395a8e44b074a7f8e25ae78fd3b9", "score": "0.48726308", "text": "function ToggleGroupSection(secname, showness) \n{\n var parnode = Node(\"section_\" + secname);\n var nodes = parnode.getElementsByTagName(\"span\");\n \n for (var n = -1; n < nodes.length; n++) {\n\tvar node = n < 0 ? parnode : nodes[n];\n\tif (node.id.substring(0, 8) == \"section_\") {\n\t var isshown = node.style.display == 'block';\n\t if ((isshown && !showness) || (!isshown && showness)) {\n\t\tToggleSection(node.id.substring(8));\n\t }\n\t}\n }\n}", "title": "" }, { "docid": "c0c323016c999368552973ce7b546ee4", "score": "0.4828571", "text": "function optionSemester(value, element, param) {\n var options = ['Primero', 'Segundo', 'Tercero', 'Cuarto', 'Quinto', 'Sexto', 'Septimo', 'Octavo', 'Noveno', 'Decimo', 'Onceavo', 'Doceavo'];\n\n if ( options.indexOf(value) >= 0 ) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "4074db0050979943192066495aadfa7c", "score": "0.4807797", "text": "function inSection(x)\n{\n return \"Section \" + x + \" of test - \";\n}", "title": "" }, { "docid": "2d5cd48529e77a8f3462a964fb3c1d63", "score": "0.4772756", "text": "function setSection()\n{\n let crn = $('#crn');\n let title = $('#course_title');\n\n crn.val(\"\");\n title.val(\"\");\n\n if(!(validateNotEmpty(\"department\") &&\n validateRegex(\"course_num\", COURSE_REGEX) &&\n validateRegex(\"section\", SECTION_REGEX) &&\n $('#section').val() > 0))\n return;\n\n crn.parent().addClass(\"loading\");\n title.parent().addClass(\"loading\");\n\n let data = {};\n\n data.semester = $('#semester').val();\n data.department = $('#department').val();\n data.course_num = $('#course_num').val();\n data.section = parseInt($('#section').val(), 10);\n\n let request = $.get(\"/api/truman/section.php\", data, function (data, status, xhr)\n {\n data = data.response;\n\n crn.parent().removeClass(\"loading\");\n title.parent().removeClass(\"loading\");\n\n if(status === \"success\")\n {\n crn.val(data.crn);\n title.val(data.course.title);\n }\n else\n {\n crn.val(\"\");\n title.val(\"\");\n }\n }, \"json\").fail(function ()\n {\n crn.parent().removeClass(\"loading\");\n title.parent().removeClass(\"loading\");\n });\n}", "title": "" }, { "docid": "07b905092564f53b6bfbb4c9bcbddbe6", "score": "0.47706777", "text": "function inViewport(sec) {\n\t// Get the size of the element and its position \n\t// relative to the viewport\n\tconst rect = sec.getBoundingClientRect();\n\t// console.log(rect);\n\t// If the element is in the viewport, return True\n\t// Otherwise, return False\n\treturn (\n\t\trect.top >= 0 &&\n\t\trect.left >= 0 &&\n\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t);\n}", "title": "" }, { "docid": "a3a4f785abfc0ef7f5311aed16b50f9e", "score": "0.47658587", "text": "function checkSectionSelected(scrolledTo){\n\t\t//How close the top has to be to the section.\n\t\tvar threshold = 100;\n\t\tvar i;\n\t\tfor (i = 0; i < sections.length; i++) {\n\t\t\t//get next nav item\n\t\t\tvar section = $(sections[i]);\n\t\t\t//get the distance from top\n\t\t\tvar target = getTargetTop(section);\n\t\t\t//Check if section is at the top of the page.\n\t\t\tif (scrolledTo > target - threshold && scrolledTo < target + threshold) {\n\t\t\t\t//remove all selected elements\n\t\t\t\tsections.removeClass(\"active\");\n\t\t\t\t//add current selected element.\n\t\t\t\tsection.addClass(\"active\");\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "25a9c09a38815f3bf875e2d76cc63931", "score": "0.47647932", "text": "constructor(semester, year, courseName, professor, sectionNumber) {\n this.semester = semester;\n this.year = year;\n this.courseName = courseName;\n this.professor = professor;\n this.sectionNumber = sectionNumber;\n }", "title": "" }, { "docid": "dbf9066b5204059975286e73034af4f3", "score": "0.4762973", "text": "function isValid(story) {\n let finalEncounter = false;\n let hasOptions = true;\n let startEncounter = false;\n\n if (story.encounters) {\n if (story.start_encounter_id) {\n startEncounter = true;\n }\n story.encounters.forEach(encounter => {\n if (parseInt(encounter.final_encounter) === 1) {\n finalEncounter = true;\n } else if (encounter.options.length < 1) {\n hasOptions = false;\n }\n });\n }\n if (startEncounter && finalEncounter && hasOptions) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "51f9b0b52258be7a4ef1d808564eb931", "score": "0.47438145", "text": "function isConsistent(cours, professeur, assignment) {\n if (coursDejaAssigne(cours, assignment)) return false;\n if (mauvaiseEvaluation(cours, professeur, assignment)) return false;\n if (plageDejaAssignee(cours, professeur, assignment)) return false;\n return true;\n}", "title": "" }, { "docid": "bf2806f59a1f4dd2f3e999302ae862d4", "score": "0.47415045", "text": "function doesSegSegIntersect(a, b) {\n if ((flo_numerical_1.orient2d(a[0], a[1], b[0]) * flo_numerical_1.orient2d(a[0], a[1], b[1])) > 0) {\n return false;\n }\n if ((flo_numerical_1.orient2d(b[0], b[1], a[0]) * flo_numerical_1.orient2d(b[0], b[1], a[1])) > 0) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "8217ea2b97ddf78970a5210089bdf601", "score": "0.4738263", "text": "function isVisible(section) {\n const pos = section.getBoundingClientRect();\n if ((pos.top >= 0 && pos.top < window.innerHeight) || (pos.bottom >= 0 && pos.bottom < window.innerHeight))\n return true;\n return false;\n}", "title": "" }, { "docid": "28bbf8e601c76a3c01778d73399f8a9b", "score": "0.47270304", "text": "function validateManuscript() {\r\n\tvar pages = document.getElementById(\"manuPages\").value;\r\n\tvar checkManu = document.getElementById(\"mService\");\r\n\t\r\n\tif (mService.checked == true) {\r\n\t\ttry {\r\n\t\t\tif (pages <= 0) throw \"You need to submit at least one page for a manuscript review.\";\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\talert(err);\r\n\t\t}\r\n\t}\r\n\t\t\r\n}", "title": "" }, { "docid": "3543e08e897e8afc9bfd97292ccdaa39", "score": "0.47159377", "text": "isOnSegment(p1,p2,p3) {\n // For p3 to be on segment p1p2 , segments p1p3 and p3p2 must be collinear\n let crossProduct = (p3.y - p1.y) * (p2.x - p1.x) - (p3.x - p1.x) * (p2.y - p1.y);\n if ( crossProduct !== 0) {\n // They are not collinear\n return false;\n }\n\n // A collinear point falls on a segment if the dotProduct is\n // positive and if it is less than the squared length of the\n // segment\n let dotProduct = (p3.x - p1.x) * (p2.x - p1.x) + (p3.y - p1.y) * (p2.y - p1.y);\n\n if (dotProduct < 0) {\n return false;\n }\n\n let squaredLengthP1P2 = (p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y);\n\n if ( dotProduct > squaredLengthP1P2) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "65afa248c2cdff3fcffb9675a116b1ff", "score": "0.46995407", "text": "function validateSections(msdsNotRequired, idOnly, requireFields, isCo) {\n\t\tvar message = \"\";\n\n\t\t// Validate Material Description\n\t\tif ( ! isCo) {\n\t\t\tmessage = validateMaterialDesc(message, requireFields);\n\t\t}\n\n\t\t// Validate Physical State\n\t\tvar physicalState = msdsIndex.getMSDSfieldValue(\"physicalState\",isCo);\n\t\tif (physicalState == '') {\n\t\t\tif(requireFields && ! isCo && ! idOnly)\n\t\t\t\tmessage += messagesData.pleaseselect.replace('{0}',messagesData.physicalState) + '\\n';\n\t\t\t// if no CO physical state, use global\n\t\t\telse if(isCo)\n\t\t\t\tphysicalState = msdsIndex.getMSDSfieldValue(\"physicalState\");\n\t\t}\n\n\t\t// Validate NFPA and HMIS\n\t\tmessage += checkInteger(\"health\", messagesData.nfpaHealth,0,4,null,isCo);\n\t\tmessage += checkInteger(\"flammability\", messagesData.nfpaFlammability,0,4,null,isCo);\n\t\tmessage += checkInteger(\"reactivity\", messagesData.nfpaReactivity,0,4,null,isCo);\n\n\t\tmessage += checkInteger(\"hmisHealth\", messagesData.hmisHealth,0,4,'*',isCo);\n\t\tmessage += checkInteger(\"hmisFlammability\", messagesData.hmisFlammability,0,4,null,isCo);\n\t\tmessage += checkInteger(\"hmisReactivity\", messagesData.hmisReactivity,0,4,null,isCo);\n\n\t\t// Validate Specific Gravity\n\t\tif(msdsNotRequired && msdsIndex.getMSDSfieldValue(\"specificGravityLower\").trim().length == 0) {\n\t\t\tmsdsIndex.getMSDSfield(\"specificGravityLower\").value = \"1\";\n\t\t\tmsdsIndex.getMSDSfield(\"specificGravityLower\").disabled = false;\n\t\t\tmsdsIndex.getMSDSfield(\"specificGravitySource\").value = \"estimate\";\n\t\t\tif (msdsIndex.getMSDSfieldValue(\"specificGravityDetect\").trim().length == 0) {\n\t\t\t\tmsdsIndex.getMSDSfield(\"specificGravityDetect\").value = \"=\";\n\t\t\t\tmsdsIndex.getMSDSfield(\"specificGravityBasisWater\").checked = true;\n\t\t\t}\n\t\t}\n\t\tvar specificGravityBasis = j$(\"input[name$='specificGravityBasis']:checked\");\n\t\tvar specificGravityBasisVal = null;\n\t\tif (specificGravityBasis != null && specificGravityBasis.length > 0) {\n\t\t\tvar specificGravityBasisCo = null;\n\t\t\tif (isCo)\n\t\t\t\tspecificGravityBasisCo = specificGravityBasis.filter(\"input[name^='co']\").eq(0);\n\t\t\tif (specificGravityBasisCo == null || specificGravityBasisCo.length == 0)\n\t\t\t\tspecificGravityBasis = specificGravityBasis.filter(\"input[name^='msds']\").eq(0);\n\t\t\telse\n\t\t\t\tspecificGravityBasis = specificGravityBasisCo;\n\t\t\tif (specificGravityBasis != null && specificGravityBasis.length > 0)\n\t\t\t\tspecificGravityBasisVal = specificGravityBasis.eq(0).val();\n\t\t}\n\n\t\tif (requireFields && ! isCo && ! msdsNotRequired && ! idOnly && ! msdsIndex.getMSDSfield(\"specificGravityLower\").disabled &&\n\t\t\t(specificGravityBasis == null || specificGravityBasis.length == 0))\n\t\t\tmessage += messagesData.pleaseselect.replace('{0}',messagesData.specificGravityBasis) + '\\n';\n\n\t\tif( ! msdsIndex.getMSDSfield('specificGravityLower',isCo).disabled) {\n\t\t\tmessage += checkPositiveFloat(\"specificGravityLower\", messagesData.specificGravity,isCo,false);\n\t\t\tif(specificGravityBasisVal == \"W\") {\n\t\t\t\tif(physicalState == \"gas\") {\n\t\t\t\t\tvar msg = checkFloat(\"specificGravityLower\", messagesData.specificGravity, 0.0, 0.1,isCo);\n\t\t\t\t\tif (msg.length > 0) {\n\t\t\t\t\t\tif (isCo)\n\t\t\t\t\t\t\tmsg = messagesData.customerOverride + \" - \" + msg;\n\t\t\t\t\t\tvar confirmSpecGrav = confirm(msg+\"\\n\"+messagesData.wanttocontinue);\n\t\t\t\t\t\tif( ! confirmSpecGrav)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(physicalState == \"liquid\") {\n\t\t\t\t\tvar msg = checkFloat(\"specificGravityLower\", messagesData.specificGravity, 0.5, Number.POSITIVE_INFINITY,isCo);\n\t\t\t\t\tif (msg.length > 0) {\n\t\t\t\t\t\tif (isCo)\n\t\t\t\t\t\t\tmsg = messagesData.customerOverride + \" - \" + msg;\n\t\t\t\t\t\tvar confirmSpecGrav = confirm(msg+\"\\n\"+messagesData.wanttocontinue);\n\t\t\t\t\t\tif ( ! confirmSpecGrav)\n\t\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\tif(physicalState == \"solid\") {\n\t\t\t\tvar msg = checkFloat(\"specificGravityLower\", messagesData.specificGravity, 0.0, 14.0,isCo);\n\t\t\t\tif (msg.length > 0) {\n\t\t\t\t\tif (isCo)\n\t\t\t\t\t\tmsg = messagesData.customerOverride + \" - \" + msg;\n\t\t\t\t\tvar confirmSpecGrav = confirm(msg+\"\\n\"+messagesData.wanttocontinue);\n\t\t\t\t\tif( ! confirmSpecGrav)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif( ! msdsIndex.getMSDSfield('specificGravityUpper',isCo).disabled)\n\t\t\tmessage += checkPositiveFloat(\"specificGravityUpper\", messagesData.specificGravity,isCo,false);\n\t\tif(validateRange('specificGravity',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.specificGravity) + '\\n';\n\n\t\t// Validate Density\n\t\tif( ! msdsIndex.getMSDSfield('density',isCo).disabled)\n\t\t\tmessage += checkPositiveFloat(\"density\", messagesData.density,isCo,false);\n\t\tif( ! msdsIndex.getMSDSfield('densityUpper',isCo).disabled)\n\t\t\tmessage += checkPositiveFloat(\"densityUpper\", messagesData.density,isCo,false);\n\t\tif(validateRange('density',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.density) + '\\n';\n\t\tif(validateUnits('density',isCo))\n\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.density) + '\\n';\n\t\tvar densityUnits = msdsIndex.getMSDSfieldValue(\"densityUnit\",isCo);\n\t\tif (densityUnits != \"\") {\n\t\t\tvar msg = checkFloat(\"density\", messagesData.density,0.0,22.65/densityUnitConversion[densityUnits],isCo);\n\t\t\tif (msg.length > 0) {\n\t\t\t\tif (isCo)\n\t\t\t\t\tmsg = messagesData.customerOverride + \" - \" + msg;\n\t\t\t\tvar conf = confirm(msg+\"\\n\"+messagesData.wanttocontinue);\n\t\t\t\tif ( ! conf)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Validate Flash Point\n\t\tif(requireFields && ! isCo && ! msdsNotRequired && !idOnly && msdsIndex.getMSDSfieldValue(\"flashPointDetect\") == '')\n\t\t\tmessage += messagesData.pleaseselectfor.replace('{0}',messagesData.detect).replace('{1}',messagesData.flashPoint) + '\\n';\n\t\telse {\n\t\t\tif( ! msdsIndex.getMSDSfield('flashPointLower',isCo).disabled)\n\t\t\t\tmessage += checkSignedFloat(\"flashPointLower\", messagesData.flashPoint);\n\t\t\tif( ! msdsIndex.getMSDSfield('flashPointUpper',isCo).disabled)\n\t\t\t\tmessage += checkSignedFloat(\"flashPointUpper\", messagesData.flashPoint);\n\t\t\tif(validateRange('flashPoint',isCo))\n\t\t\t\tmessage += messagesData.range.replace('{0}',messagesData.flashPoint) + '\\n';\n\t\t\tif(validateUnits('flashPoint',isCo))\n\t\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.flashPoint) + '\\n';\n\t\t}\n\n\t\t// Validate Boiling Point\n\t\tif( ! msdsIndex.getMSDSfield('boilingPointLower',isCo).disabled)\n\t\t\tmessage += checkSignedFloat(\"boilingPointLower\", messagesData.boilingPoint);\n\t\tif( ! msdsIndex.getMSDSfield('boilingPointUpper',isCo).disabled)\n\t\t\tmessage += checkSignedFloat(\"boilingPointUpper\", messagesData.boilingPoint);\n\t\tif(validateRange('boilingPoint',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.boilingPoint) + '\\n';\n\t\tif(validateUnits('boilingPoint',isCo))\n\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.boilingPoint) + '\\n';\n\n\t\t// Validate pH\n\t\tvar ph = msdsIndex.getMSDSfield('ph',isCo);\n\t\tvar phUpper = msdsIndex.getMSDSfield('phUpper',isCo);\n\t\tif( ! ph.disabled) {\n\t\t\tmessage += checkFloat(\"ph\", messagesData.ph,0,14,isCo);\n\t\t}\n\t\tif( ! phUpper.disabled) {\n\t\t\tmessage += checkFloat(\"phUpper\", messagesData.ph,0,14,isCo);\n\t\t}\n\t\tif(validateRange('ph',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.ph) + '\\n';\n\t\tif(encodeURI(msdsIndex.getMSDSfieldValue(\"phDetail\",isCo).replace(/%[A-F\\d]{2,6}/g, 'U')).length > 50)\n\t\t\tmessage += messagesData.maxinputlength + ': ' + messagesData.ph + ' ' + messagesData.detail + '\\n';\n\n\t\t// Validate Vapor Pressure\n\t\tif(requireFields && ! isCo && ! msdsNotRequired && ! idOnly && msdsIndex.getMSDSfieldValue(\"vaporPressureDetect\",isCo) == '')\n\t\t\tmessage += messagesData.pleaseselectfor.replace('{0}',messagesData.detect).replace('{1}',messagesData.vaporPressure) + '\\n';\n\t\telse {\n\t\t\tif( ! msdsIndex.getMSDSfield('vaporPressure',isCo).disabled)\n\t\t\t\tmessage += checkPositiveFloat(\"vaporPressure\", messagesData.vaporPressure,isCo,true);\n\t\t\tif( ! msdsIndex.getMSDSfield('vaporPressureUpper',isCo).disabled)\n\t\t\t\tmessage += checkPositiveFloat(\"vaporPressureUpper\", messagesData.vaporPressure,isCo,true);\n\t\t\tif( ! msdsIndex.getMSDSfield('vaporPressureTemp',isCo).disabled)\n\t\t\t\tmessage += checkFloat(\"vaporPressureTemp\", messagesData.vaporPressureTemp,null,null,isCo);\n\t\t\tif(validateRange('vaporPressure',isCo))\n\t\t\t\tmessage += messagesData.range.replace('{0}',messagesData.vaporPressure) + '\\n';\n\t\t\tif(validateUnits('vaporPressure',isCo))\n\t\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.vaporPressure) + '\\n';\n\t\t\tif(validateUnits('vaporPressureTemp',isCo))\n\t\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.vaporPressureTemp) + '\\n';\n\t\t}\n\n\t\t// Validate VOC\n\t\tif ((physicalState == \"solid\" || msdsNotRequired) &&\n\t\t\tmsdsIndex.getMSDSfieldValue(\"voc\").trim().length == 0 &&\n\t\t\tmsdsIndex.getMSDSfieldValue(\"vocLessH2oExempt\").trim().length == 0) {\n\t\t\tmsdsIndex.getMSDSfield(\"voc\",isCo).value = \"0\";\n\t\t\tmsdsIndex.getMSDSfield(\"vocUnit\",isCo).value = \"g/L\";\n\t\t\tmsdsIndex.getMSDSfield(\"vocSource\",isCo).value = \"composition\";\n\t\t\tmsdsIndex.getMSDSfield(\"vocLessH2oExempt\",isCo).value = \"0\";\n\t\t\tmsdsIndex.getMSDSfield(\"vocLessH2oExemptUnit\",isCo).value = \"g/L\";\n\t\t\tmsdsIndex.getMSDSfield(\"vocLessH2oExemptSource\",isCo).value = \"composition\";\n\t\t}\n\n\t\tvar coCompare = false;\n\t\tvar voclwes = msdsIndex.getMSDSfieldValue(\"vocLessH2oExempt\",isCo);\n\t\tvar voclwesUnit = msdsIndex.getMSDSfieldValue(\"vocLessH2oExemptUnit\",isCo);\n\t\tif (isCo && (voclwes == null || voclwes.trim().length == 0)) {\n\t\t\tvoclwes = msdsIndex.getMSDSfieldValue(\"vocLessH2oExempt\");\n\t\t\tvoclwesUnit = msdsIndex.getMSDSfieldValue(\"vocLessH2oExemptUnit\");\n\t\t}\n\t\telse {\n\t\t\tcoCompare = true;\n\t\t}\n\t\tvar vocVal = msdsIndex.getMSDSfieldValue(\"voc\", isCo);\n\t\tvar vocUnit = msdsIndex.getMSDSfieldValue(\"vocUnit\", isCo);\n\t\tvar vocDensity = msdsIndex.getMSDSfieldValue(\"density\", isCo);\n\t\tvar vocDensityUnit = msdsIndex.getMSDSfieldValue(\"densityUnit\",isCo);\n\t\tvar vocSpecificGrav = msdsIndex.getMSDSfieldValue(\"specificGravityLower\",isCo);\n\t\tif (isCo && (vocVal == null || vocVal.trim().length == 0)) {\n\t\t\tvocVal = msdsIndex.getMSDSfieldValue(\"voc\");\n\t\t\tvocUnit = msdsIndex.getMSDSfieldValue(\"vocUnit\");\n\t\t\tvocDensity = msdsIndex.getMSDSfieldValue(\"density\");\n\t\t\tvocDensityUnit = msdsIndex.getMSDSfieldValue(\"densityUnit\");\n\t\t\tvocSpecificGrav = msdsIndex.getMSDSfieldValue(\"specificGravityLower\");\n\t\t}\n\t\telse {\n\t\t\tcoCompare = true;\n\t\t}\n\n\t\tmessage += checkFloat(\"vocLower\", messagesData.vocLower,null,null,isCo);\n\t\tmessage += checkFloat(\"vocUpper\", messagesData.vocUpper,null,null,isCo);\n\t\tif(validateRange('voc',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.voc) + '\\n';\n\t\tif(validateUnits('voc',isCo))\n\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.voc) + '\\n';\n\t\tif (vocUnit == \"%(w/w)\")\n\t\t\tmessage += checkFloat(\"voc\", messagesData.voc,0.0,100.0,isCo);\n\n\t\tmessage += checkFloat(\"vocLessH2oExempt\", messagesData.vocLessH2oExempt,null,null,isCo);\n\t\tmessage += checkFloat(\"vocLessH2oExemptLower\", messagesData.vocLessH2oExemptLower,null,null,isCo);\n\t\tmessage += checkFloat(\"vocLessH2oExemptUpper\", messagesData.vocLessH2oExemptUpper,null,null,isCo);\n\t\tif(validateRange('vocLessH2oExempt',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.vocLessH2oExempt) + '\\n';\n\t\tif(validateUnits('vocLessH2oExempt',isCo))\n\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.vocLessH2oExempt) + '\\n';\n\n\t\tif (vocVal != null && vocVal.trim().length > 0 &&\n\t\t\tvoclwes != null && voclwes.trim().length > 0 &&\n\t\t\tvocUnit.trim().length > 0 && voclwesUnit.trim().length > 0 &&\n\t\t\t(coCompare || ! isCo)) {\n\t\t\tif (vocUnit == voclwesUnit) {\n\t\t\t\tif (parseFloat(vocVal) > parseFloat(voclwes))\n\t\t\t\t\tmessage += formatMessage(messagesData.rangeError, messagesData.voc, 0.0, messagesData.vocLessH2oExempt) + '\\n';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmessage = validateVOCUnits(vocVal, vocUnit, voclwes, voclwesUnit, vocDensity, vocDensityUnit, vocSpecificGrav, message);\n\t\t\t}\n\t\t}\n\n\t\tmessage = validateVOCVLessDensity(message,isCo);\n\n\t\t// Validate Solids\n\t\tmessage += checkFloat(\"solids\", messagesData.solids,null,null,isCo);\n\t\tmessage += checkFloat(\"solidsLower\", messagesData.solidsLower,null,null,isCo);\n\t\tmessage += checkFloat(\"solidsUpper\", messagesData.solidsUpper,null,null,isCo);\n\t\tif(validateRange('solids',isCo))\n\t\t\tmessage += messagesData.range.replace('{0}',messagesData.solids) + '\\n';\n\t\tif(validateUnits('solids',isCo))\n\t\t\tmessage += messagesData.nounit.replace('{0}',messagesData.solids) + '\\n';\n\t\tvar solidsUnits = msdsIndex.getMSDSfieldValue(\"solidsUnit\",isCo);\n\t\tif (solidsUnits == \"%(w/w)\")\n\t\t\tmessage += checkFloat(\"solids\", messagesData.solids,0.0,100.0,isCo);\n\n\t\treturn message;\n\t}", "title": "" }, { "docid": "ee5414fa1debce27d5b157b544e3ddac", "score": "0.46904346", "text": "function checkIncludes(chapter, fromVerse, toVerse) {\n if (toVerse === undefined)\n toVerse = fromVerse\n\n\n\n for (i = fromVerse; i <= toVerse; i++) {\n if (!confirmedVerses.some((element) => element[0] == chapter && element[1] == i))\n return false\n }\n return true\n\n}", "title": "" }, { "docid": "b66e01b72f94757a77a922a0b252dd54", "score": "0.4684649", "text": "validateSegmentSpecStructure(data) {\n\t\t//Validate data exists\n\t\tif(data===undefined)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!data.VERTEX_GROUP || !data.VERTEX) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (Object.keys(data).length > 2) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "43b8aad013dbac4f7ceb681ff3823822", "score": "0.46842068", "text": "function singleSector( buildings ) {\n\tvar id;\n\n\tif ( buildings.length === 0 )\n\t\treturn false;\n\n\tid = buildings[0].sectorId;\n\treturn buildings.every( function(b) { return b.sectorId === id } );\n}", "title": "" }, { "docid": "21bd664565970105c8ecce12e90720a2", "score": "0.46801525", "text": "semester() {\n\n // Find data for the given semester.\n return _.find(this.hours.grouped.semesters, this.selected.semester);\n\n }", "title": "" }, { "docid": "679c2a5de60eac4da41e364212a5537c", "score": "0.467735", "text": "function isDaySegCollision(seg, otherSegs) {\r\n\tvar i, otherSeg;\r\n\r\n\tfor (i = 0; i < otherSegs.length; i++) {\r\n\t\totherSeg = otherSegs[i];\r\n\r\n\t\tif (\r\n\t\t\totherSeg.leftCol <= seg.rightCol &&\r\n\t\t\totherSeg.rightCol >= seg.leftCol\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "f7a79e2aee3f13560d89712903c1d8b6", "score": "0.46769226", "text": "function findSections(n, sects) {\n\t\t// Loop through all the cuildren of n\n\t\tfor(var m = n.firstChild; m != null; m = m.nextSibling) {\t\t\t\n\t\t\t// Skyp any nodes that are not elements.\n\t\t\tif (m.nodeType != 1 /* Node.Element_NODE */) continue;\n\t\t\t// Skyp the container element since it may have its own heading\n\t\t\tif (m == container) continue;\n\t\t\tif (m.tagName == \"P\") continue; // Optimization\n\t\t\t\n\t\t\tif (m.tagName.length==2 && m.tagName.charAt(0)==\"H\") sects.push(m);\n\t\t\telse findSections(m, sects);\n\t\t}\n\t}", "title": "" }, { "docid": "5cb9485a0c32ec39a5544b9a1598937d", "score": "0.46763644", "text": "async function selectSem(n) {\n log(`selectsem|${major}|${n}`);\n selected_sem = n;\n d3.selectAll(\".sem\").attr(\"fill\", \"none\");\n d3.selectAll(`.sem${n}`).attr(\"fill\", \"pink\");\n d3.selectAll(`.selectText2`).text(\"Add Courses\");\n d3.selectAll(`.selectText2_${n + 1}`).text(\"Selected\");\n var sem_recs = data_recs.filter(d => d.Row == n);\n var rec_names = [];\n sem_recs.forEach(sr => sr.Recs.forEach(r => rec_names.push(r)));\n var rec_info = await infoAll(rec_names);\n render_id = `Semester ${n+1} Recommendations`;\n render(rec_info, `Semester ${n+1} Recommendations`, true, false);\n}", "title": "" }, { "docid": "bb4831d0a89f3e10174da20622c33a73", "score": "0.46711895", "text": "function isSectionOverlapping(sectionA_, sectionB_) {\n var overlap;\n if (sectionA_ == undefined || sectionB_ == undefined) {\n overlap = false;\n } else {\n for (var a = 0; a < sectionA_.classList.length; a++) {\n var classA = sectionA_.classList[a];\n for (var b = 0; b < sectionB_.classList.length; b++) {\n var classB = sectionB_.classList[b];\n if (isClassOverlapping(classA, classB)) {\n overlap = true;\n break;\n }\n }\n if (overlap) {\n break;\n }\n }\n }\n return overlap;\n}", "title": "" }, { "docid": "8371bf907eecbee488e2bbad0e586aca", "score": "0.4664693", "text": "function hasIntersection(tmpRect, svg) {\n if (svg == null || svg == \"undefined\") {\n return false;\n }\n var el = document.getElementById(svg.node.id);\n var childNodes = el.childNodes;\n var check = false;\n if (childNodes.length == 0) {\n return checkInterscetion(tmpRect, el);\n } else {\n for (var c in childNodes) {\n if (childNodes[c] instanceof SVGElement) {\n if (childNodes[c].id.startsWith('SvgjsTspan')) {\n check = checkInterscetion(tmpRect, el);\n } else {\n check = checkInterscetion(tmpRect, childNodes[c]);\n }\n if (check) {\n return check;\n }\n }\n\n }\n }\n return check;\n}", "title": "" }, { "docid": "518b533339557084382f21c96136903b", "score": "0.46638235", "text": "function put_section(course_code, section_id, year, semester, weekday, start_time, end_time) {\n\tlet xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = () => {\n\t\tif ( xhr.readyState === 4 ) {\n\t\t\tswitch (xhr.status) {\n\t\t\t\tcase 200:\n\t\t\t\t\tanimate_success( submit_btn_2, 'Success', 2000, 'Submit' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 400:\n\t\t\t\tcase 409:\n\t\t\t\tcase 500:\n\t\t\t\t\tlet resp = JSON.parse(xhr.responseText);\n\t\t\t\t\tanimate_failure( submit_btn_2, 'Adding a new section failed: ' + resp.msg, 3500, 'Submit' );\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t};\n\txhr.open('PUT', '/addSection?course_code=' + course_code + '&section_id=' + section_id + '&year=' + year\n\t\t\t+'&semester=' + semester + '&weekday=' + weekday + '&start_time=' + start_time + '&end_time=' + end_time);\n\txhr.send();\n}", "title": "" }, { "docid": "7ac43a5fce423087488b9d7ea6b7f68e", "score": "0.4654943", "text": "function isDaySegCollision(seg, otherSegs) {\n\tvar i, otherSeg;\n\n\tfor (i = 0; i < otherSegs.length; i++) {\n\t\totherSeg = otherSegs[i];\n\n\t\tif (\n\t\t\totherSeg.leftCol <= seg.rightCol &&\n\t\t\totherSeg.rightCol >= seg.leftCol\n\t\t\t) {\n\t\t\treturn true;\n\t}\n}\n\nreturn false;\n}", "title": "" }, { "docid": "a26f46a341847fd1ea6d91a587c70894", "score": "0.46490923", "text": "function verifySignUp() {\n var numCourses = document.getElementById(\"numCourses\").value;\n for (var i = 0; i < numCourses; i++) {\n for (var j = i + 1; j < numCourses; j++) {\n // check to make sure a course is selected first\n c1 = document.getElementById(\"courseSelect_\" + i).value;\n c2 = document.getElementById(\"courseSelect_\" + j).value;\n if (c1 == \"\" || c2 == \"\") {\n alert(\"Please ensure all form data is filled out.\");\n return false;\n }\n // check to make sure the sections don't match\n s1 = document.getElementById(\"section_\" + i).value;\n s2 = document.getElementById(\"section_\" + j).value;\n console.log(s1 + \", \" + s2);\n if(c1 == c2 && s1 == s2) {\n alert(\"Please ensure you are not selecting the same section of the same course twice.\");\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "d4b76d85af2ff155448d973af8923b87", "score": "0.46446586", "text": "selectSection(section){\r\n //Reset to 1st page at change section\r\n this.prevSection = this.selectedSection;\r\n this.selectedSection = section;\r\n (this.prevSection != this.selectedSection) ? this.currentPage = 1 : '';\r\n switch(this.selectedSection) {\r\n case this.menuSections[0]:\r\n this.searchDailyTrending();\r\n break;\r\n case this.menuSections[1]:\r\n this.searchMoviePopular();\r\n break;\r\n case this.menuSections[2]:\r\n this.searchTvPopular();\r\n break;\r\n case this.menuSections[3]:\r\n this.searchTvAndMoviesMostPopular();\r\n break;\r\n case this.menuSections[4]:\r\n this.videoTitles = this.myList;\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "4bb32e73e4b83d12ab5866b1430f7f20", "score": "0.46445343", "text": "function _setPageSection() {\n try {\n vm.isSectionChecked = false;\n vm.module.pageObj.sectionObj = new section();\n } catch (e) {\n showErrorMsg(e);\n }\n }", "title": "" }, { "docid": "6a8eca4eda39ca4ce4bf383ed3ea40f8", "score": "0.46410617", "text": "function onSectionChange(e) {\n //detect the current section\n var currentSelection = $('#mode section.active');\n\n /*if(currentSelection && currentSelection.hasClass('report')) {\n //populate the authority\n findAuthority();\n }*/\n}", "title": "" }, { "docid": "12fafc865a4648a0947238888f0e7651", "score": "0.4625465", "text": "function mass_modify_select_section_handler() {\n\t$('#qa_body_div').delegate('#esect_dd', 'change', function() {\n\t\t\tvar section = $('#esect_dd option:selected').val();\n\t\t\tform_data='&section='+section+'&mass_modify=1';\n\t\t\t//console.log(form_data);\n\t\t\tif ($('#esect_dd').val()=='No Select'){\n\t\t\t\t$('#status_msg_div').html(\"Error: No section selected\").show();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$('#status_msg_div').html(\"\").show();\n\t\t\tget_topics_for_section(form_data,1);\n\t\t});\t\n}", "title": "" }, { "docid": "ae7a3f37a62f5ae1cd3e27251f9ebdea", "score": "0.46233308", "text": "checkSectionChange($c, title, oldTitle) {\n if (!self.isSection(title) && !self.isSection(oldTitle)) {\n return;\n }\n\n /*\n * Case 1: Only title changed (was, and still is, a section)\n */\n if (self.isSection(title) && self.isSection(oldTitle)) {\n $c.find(\"#section-title\").text(self.getStrippedTitle(title));\n return;\n }\n\n /*\n * Case 3: A card was changed from a section\n */\n if (!self.isSection(title)) {\n self.removeSectionFormatting($c);\n } else {\n /*\n * Case 2: Was a normal card now a section\n */\n self.formatAsSection($c);\n }\n }", "title": "" }, { "docid": "fd3dc718e96cce1f884fff3a824df983", "score": "0.46180823", "text": "checkDocument(arrayJson) {\n for (index in arrayJson) {\n if (arrayJson[index].name === 'Document') {\n if (arrayJson[index].elements) {\n var docElements = arrayJson[index].elements;\n for (var index2 in docElements) {\n if (docElements[index2].name === 'Sections') {\n if (docElements[index2].elements) {\n if (docElements[index2].elements[0].elements) {\n if (docElements[index2].elements[0].elements[0].elements) {\n return true;\n };\n };\n };\n };\n };\n };\n };\n };\n return false;\n }", "title": "" }, { "docid": "c13d1a91996f2b86d561d0ebef569300", "score": "0.46106866", "text": "function select_section_handler() {\n\t$('#qa_body_div').delegate('#sect_dd', 'change', function() {\n\t\t\tvar section = $('#sect_dd option:selected').val();\n\t\t\tform_data='&section='+section+'&mass_modify=0';\n\t\t\tif ($('#sect_dd').val()=='No Select'){\n\t\t\t\t$('#add_q_msg_div').html(\"Error: No section selected\").show();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$('#add_q_msg_div').html(\"\").show();\n\t\t\tget_topics_for_section(form_data,0); \n\t\t});\t\n}", "title": "" }, { "docid": "024e4a71a247fa8cbcac66c816065e51", "score": "0.46087974", "text": "function checkSectionSelected(scrolledTo){\n \n //How close the top has to be to the section.\n var threshold = 50;\n\n var i;\n\n for (i = 0; i < sections.length; i++) {\n \n //get next nav item\n var section = $(sections[i]);\n\n //get the distance from top\n var target = getTargetTop(section);\n \n //Check if section is at the top of the page.\n if (scrolledTo > target - threshold && scrolledTo < target + threshold) {\n\n //remove all selected elements\n sections.removeClass(\"active\");\n\n //add current selected element.\n section.addClass(\"active\");\n }\n\n };\n }", "title": "" }, { "docid": "d4b00054f9b448d5728eb862b76cd26e", "score": "0.4605393", "text": "function hideSpecificSignatureSection(section, sectionDiv) {\n log(\"Method: hideSpecificSignatureSection\");\n if ($(section + \"_checkbox\").is(':checked')){\n $(\"#\"+sectionDiv).show();\n }\n else {\n $(\"#\"+sectionDiv).hide();\n }\n}", "title": "" }, { "docid": "b0fbdab023d1c31bfa63032d08bc48fc", "score": "0.4605359", "text": "segmentIntersects(p1, p2, p3, p4) {\n\n // Line equation , segment p1p2\n let a1 = p2.y - p1.y;\n let b1 = p1.x - p2.x;\n let c1 = p2.x * p1.y - p1.x * p2.y;\n\n // Compute the line sign values\n let r1 = a1 * p3.x + b1 * p3.y + c1;\n let r2 = a1 * p4.x + b1 * p4.y + c1;\n\n if (r1 !== 0 && r2 !== 0 && ((r1 > 0) === (r2>0))) {\n return false;\n }\n\n //Line equation , segment p3p4\n let a2 = p4.y - p3.y;\n let b2 = p3.x - p4.x;\n let c2 = p4.x * p3.y - p3.x * p4.y;\n\n // Compute the line sign values\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n\n if (r1 !== 0 && r2 !== 0 && ((r1 > 0) === (r2>0))) {\n return false;\n }\n\n if ( (a1 * b2 - a2 * b1) === 0) {\n // The segments are collinear, they intersect if they overlap\n // They overlap is p4 falls on p1p2 or if p2 falls on p3p4\n if (this.isOnSegment(p1, p2, p4) || this.isOnSegment(p3, p4, p2)) {\n return true;\n } else {\n return false;\n }\n } else {\n\n return true;\n\n }\n }", "title": "" }, { "docid": "63c7c68830614fd87ddf7ed926e91a4f", "score": "0.4604462", "text": "get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }", "title": "" }, { "docid": "63c7c68830614fd87ddf7ed926e91a4f", "score": "0.4604462", "text": "get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }", "title": "" }, { "docid": "1dccc69b6e999c5d1a725132800e32eb", "score": "0.45831135", "text": "function Sections(obj) {\n\tthis.sections = obj ;\n\tthis.secMarkers = [] ; \n\tthis.secLines = [] ; \n}", "title": "" }, { "docid": "07ff32d83cfd6addf2a27a5f82c73b2b", "score": "0.4580134", "text": "function checkSeason (month) {\n if (month == 'September' || month == 'October' || month == 'November') {\n console.log('It\\s Autumn.')\n \n } else if (month == 'December' || month == 'January' || month == 'February') {\n console.log('It\\'s Winter.')\n \n } else if (month == 'March' || month == 'April' || month == 'May') {\n console.log('It\\'s Spring.')\n \n } else if (month == 'June' || month == 'July' || month == 'August') {\n console.log('It\\'s Summer.')\n }\n}", "title": "" }, { "docid": "5d2a95b443b7a7714a1e378787ac0e5b", "score": "0.45787045", "text": "function isDaySegCollision(seg,otherSegs){var i,otherSeg;for(i = 0;i < otherSegs.length;i++) {otherSeg = otherSegs[i];if(otherSeg.leftCol <= seg.rightCol && otherSeg.rightCol >= seg.leftCol){return true;}}return false;} // A cmp function for determining the leftmost event", "title": "" }, { "docid": "fcb8decdca88cf6994320691cf43c78a", "score": "0.4573653", "text": "function isDaySegCollision(seg, otherSegs) {\r\n var i;\r\n var otherSeg;\r\n for (i = 0; i < otherSegs.length; i++) {\r\n otherSeg = otherSegs[i];\r\n if (otherSeg.leftCol <= seg.rightCol &&\r\n otherSeg.rightCol >= seg.leftCol) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "ebb2c4b40714265ff9008a0e7843f324", "score": "0.45681113", "text": "selectSection(section) {\n // Resetting to first page when selecting other sections\n this.otherSection = this.sectionSelected;\n this.sectionSelected = section;\n (this.otherSection !== this.sectionSelected) ? this.pagesIndex = 1 : \"\";\n \n // Selecting sections\n switch(this.sectionSelected) {\n // Home\n case this.navSections[0]:\n this.trendingWeekly();\n break;\n\n // Trending\n case this.navSections[1]:\n this.trendingDaily();\n break;\n\n // Movies\n case this.navSections[2]:\n this.searchPopularMovies();\n break;\n\n // TV series\n case this.navSections[3]:\n this.searchPopularTvSeries();\n break;\n\n // Discover\n case this.navSections[4]:\n this.discoverTitles();\n break;\n }\n }", "title": "" }, { "docid": "7c9c0a5887968c3ad52efa57fd4792cd", "score": "0.4567549", "text": "function sectionChanged () {\n\t\tvar sections = myForm.frmNewSec;\n\t\tvar containers = myForm.frmNewParent;\n\t\t\n\t\tif (sections.selectedIndex != 0) \n\t\t\tcontainers.disabled = false;\n\t\t\t\n\t\telse\n\t\t\tcontainers.disabled = true;\n\n\t\tvar secId = sections.options[sections.selectedIndex].value;\n// get the questions via ajax...\t\n\t\tvar xReq = new AjaxReq ();\n\t\txReq.setUrl (\"ajax/items4sec.jsp\");\n\t\txReq.setMethod (\"POST\");\n\t\txReq.setPostdata(\"t=sec&frmid=\"+secId);\n\t\txReq.setCallback (ajaxResp.onItems4Sec, ajaxResp.onFail,\n\t\t\t\t\t\t\t\t\t\t\tajaxResp, null);\n\t\t\n\t\txReq.startReq();\n\t}", "title": "" }, { "docid": "eb897a123eed489bf55d1ef5e6263f90", "score": "0.45660397", "text": "function checkSchedule(ga, course, notes) {\n \n var c = JSON.parse(JSON.stringify(course.schedule));\n c['Days'] = c['Days'].split('');\n for (var i = 0; i < ga.schedule.length; i++) {\n var g = JSON.parse(JSON.stringify(ga.schedule[i])); // copy by value, so we don't edit the original schedule\n \n g['Days'] = g['Days'].split('');\n var union = [...new Set([...c['Days'], ...g['Days']])]; \n // ^ Takes the union of the sets of days\n //For example, 'WF' becomes ['W', 'F'] and then see if any overlap\n //If this union's size is now as long as the two combined, none overlapped.\n if (union.length != c['Days'].length + g['Days'].length) {\n if ((c['Start_Time'] <= g['Start_Time'] && g['Start_Time'] <= c['Stop_Time'])\n || (c['Start_Time'] <= g['Stop_Time'] && g['Stop_Time'] <= c['Stop_Time'])) {\n //If the ga's class's start or stop time lies between the class's start and stop time, then there is a conflict.\n ga['notes'] += \"This student has a class at that time.\";\n return false;\n }\n\n } \n }\n //We didn't find a conflict\n ga['notes'] += \"This student is free at that time\";\n return true;\n }", "title": "" }, { "docid": "3f42a72325b88ce10a6b8157cb6e7836", "score": "0.4562599", "text": "function isActiveSection() {\n let options = { root: null, rootMargin: '0px', threshold: 0.3 };\n let callback = (entries) => {\n // Add class 'active' to section when near top of viewport\n if (entries[0].isIntersecting) { // is this section active?\n sections.forEach((sec) => { // loop sections\n if (sec.classList.contains('your-active-class')) { //add class\n sec.classList.remove('your-active-class'); //remove class\n }\n });\n // Set sections as active\n entries[0].target.classList.add('your-active-class');\n\n let link = null;\n for (let i = 0; i < links.length; i++) {\n links[i].classList.remove('your-active-link');\n if (links[i].innerHTML == entries[0].target.getAttribute('data-nav')) {\n link = links[i].classList.add(\"your-active-link\")\n } //end if links.text = active section\n } //end loops in links \n }; // end if section isIntersecting\n } //end callback function\n\n sections.forEach((section) => {\n let observer = new IntersectionObserver(callback, options);\n observer.observe(section);\n });\n}", "title": "" }, { "docid": "7d696145a4c3d0360ac1828a2355b06c", "score": "0.45596492", "text": "function SectionDisEngagement(){}", "title": "" }, { "docid": "3f4b8127fdbb300db654517fb713a032", "score": "0.45593658", "text": "function isSummer( summerSeason ) {\n\t\t\tvar currMonth = new Date().getMonth() + 1;\n\t\t\treturn ( currMonth >= summerSeason.fromMonth && currMonth <= summerSeason.toMonth ) ? true : false;\n\t\t}", "title": "" }, { "docid": "413bb36136a8bcf6c90719250df993b3", "score": "0.4557496", "text": "check(text, course) {\n try {\n let config = {}\n let notes = text.replace(/=|\\r/g, '').split(\"#END\")\n for (let note of notes) {\n if (note.replace(/\\s/g, '').length === 0) continue\n\n let [forked, branches, activatedBranches] = Tab._fromText(note, { ...DEFAULT_CONFIG, ...config, })\n config = { ...config, ...branches[0].config }\n if (getCourse(branches[0].config.course) === course) {\n return true\n }\n }\n } catch (e) {//could be grammar problem or level not found\n return false\n }\n\n return false\n }", "title": "" }, { "docid": "2398c98dbb2977dce0c25c07bc004b20", "score": "0.45553717", "text": "function toggleSemester(to){\r\n if(to == null || to == undefined){\r\n\tto = shownSemester == \"1\" ? \"2\" : \"1\";\r\n }\r\n \r\n document.getElementById(\"sem-0\").style.color = \"\";\r\n document.getElementById(\"sem-1\").style.color = \"\";\r\n document.getElementById(\"sem-2\").style.color = \"\";\r\n document.getElementById(\"sem-0\").style.backgroundColor = \"\";\r\n document.getElementById(\"sem-1\").style.backgroundColor = \"\";\r\n document.getElementById(\"sem-2\").style.backgroundColor = \"\";\r\n document.getElementById(\"sem-\" + to).style.color = \"#101E5B\";\r\n document.getElementById(\"sem-\" + to).style.backgroundColor = \"#fff\";\t\r\n\r\n if(to == \"0\"){\r\n\tdocument.getElementById(\"next\").innerHTML = \"Next\"\r\n\tdocument.getElementById(\"next\").onclick = function(){toggleSemester(1)}\r\n\tdocument.getElementById(\"previous\").style.display = \"none\"\r\n }if(to == \"1\"){\r\n\tdocument.getElementById(\"next\").innerHTML = \"Next\"\r\n\tdocument.getElementById(\"next\").onclick = function(){toggleSemester(2)}\r\n\tdocument.getElementById(\"previous\").onclick = function(){toggleSemester(0)}\r\n\tdocument.getElementById(\"previous\").style.display = \"\"\r\n } else if(to == \"2\"){\r\n\tif(shownSemester == \"1\" && canAutoPopulate()){\r\n\t if(confirm(\"Would you like to automatically place your two semester classes into your schedule for the 2nd semester?\")){\r\n\t\tautoPopulate()\r\n\t }\r\n\t}\r\n\tdocument.getElementById(\"next\").innerHTML = \"Print\"\r\n\tdocument.getElementById(\"previous\").onclick = function(){toggleSemester(1)}\r\n\tdocument.getElementById(\"previous\").style.display = \"\"\r\n\tdocument.getElementById(\"next\").onclick = function(){printButton()}\r\n }\r\n \r\n localStorage.setItem(\"shownPage\", to);\r\n shownSemester = to.toString();\r\n shownSemAttribute = \"sem-\" + shownSemester + \"-sub\";\r\n for(var subject in subjects){\r\n\t//console.log(selectedSchedule.filter(item => item[SCHEDULE_SUBJECT].subject == subjects[subject].subject).length < parseInt(subjects[subject].semAmt, 10))\r\n\t/*if(selectedSchedule.filter(item => item[SCHEDULE_SUBJECT].subject == subjects[subject].subject).length < parseInt(subjects[subject].semAmt, 10)){\r\n\t subjects[subject].elem.style.display = \"inline-block\";\r\n\t \r\n\t} else {\r\n\t subjects[subject].elem.style.display = \"none\";\r\n\t}\r\n\t*/\r\n\tsubjects[subject].elem.style.borderRight = \"\";\r\n\r\n\tupdateSchedule();\r\n\r\n }\r\n var shownSubjects = subjects.filter(function($0){return $0.elem.style.display == \"inline-block\"});\r\n if(shownSubjects[shownSubjects.length - 1] !== undefined){\r\n\tshownSubjects[shownSubjects.length - 1].elem.style.borderRight = \"none\";\r\n }\r\n if(to === 0){\r\n\tdocument.getElementById(\"schedule\").style.display = \"none\";\r\n\tclasses.style.display = \"none\";\r\n\tdocument.getElementById(\"classSelection\").style.display = \"\"\r\n } else {\r\n\tdocument.getElementById(\"schedule\").style.display = \"\";\r\n\tclasses.style.display = \"block\";\r\n\tdocument.getElementById(\"classSelection\").style.display = \"none\";\r\n }\r\n\r\n deselect();\r\n updateSchedule();\r\n}", "title": "" }, { "docid": "59f5182e37855b685c69fbee3fc2e963", "score": "0.45504525", "text": "function isDaySegCollision(seg, otherSegs) {\n var i;\n var otherSeg;\n for (i = 0; i < otherSegs.length; i++) {\n otherSeg = otherSegs[i];\n if (otherSeg.firstCol <= seg.lastCol &&\n otherSeg.lastCol >= seg.firstCol) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "93ab432065db52aa42b742e8a9407a55", "score": "0.45483762", "text": "function compareLabsBySemester(a, b) {\n\ta = a.find(\".version-semester\").text().split(\" \")[0];\n\tb = b.find(\".version-semester\").text().split(\" \")[0];\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (b < a) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "49f2c7b8807f1b335a218609e88a3252", "score": "0.45426998", "text": "function isDaySegCollision(seg, otherSegs) {\n\tvar i, otherSeg;\n\n\tfor (i = 0; i < otherSegs.length; i++) {\n\t\totherSeg = otherSegs[i];\n\n\t\tif (\n\t\t\totherSeg.leftCol <= seg.rightCol &&\n\t\t\totherSeg.rightCol >= seg.leftCol\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "title": "" } ]
f60f0d50fbf9a2bd1c09165865b70aa2
(public) return + if this > a, if this < a, 0 if equal
[ { "docid": "2e54aa650df82fc9a442108796a55a3e", "score": "0.0", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r;\n return 0;\n}", "title": "" } ]
[ { "docid": "8a843129ee07f48b36f924c6fdfaccb8", "score": "0.67695665", "text": "ascend(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }", "title": "" }, { "docid": "408e7d2c814bc19821441221b6c70fea", "score": "0.67426413", "text": "function compare(a,b) {\n\t\treturn a > b ? 1 :\n\t\t\ta < b ? -1 :\n\t\t\t0\n\t}", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "b4fab9270136132feae01b3071020d0d", "score": "0.6691011", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "9f7c63409b628b51916a6d14da460dbf", "score": "0.66854197", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "7b08ef1cc8289121550ee4643b796318", "score": "0.6674353", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "7a8579e81528fb1b6b263646fc04e531", "score": "0.6655748", "text": "function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return (this.s<0)?-r:r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t }", "title": "" }, { "docid": "7a8579e81528fb1b6b263646fc04e531", "score": "0.6655748", "text": "function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return (this.s<0)?-r:r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t }", "title": "" }, { "docid": "7a8579e81528fb1b6b263646fc04e531", "score": "0.6655748", "text": "function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return (this.s<0)?-r:r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t }", "title": "" }, { "docid": "620b77f7b086025208cbfb35f5f705a1", "score": "0.6652618", "text": "function compare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }", "title": "" }, { "docid": "316b574c048888e2e210fd2b31f913ba", "score": "0.66479236", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "754be024fc8b1cd4d058ef5511916a96", "score": "0.66463023", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "84df34926dbe311cb16b3b2a237e80ef", "score": "0.663406", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "e644a8e28ab2198404f985c0b1806e46", "score": "0.6630365", "text": "function bnCompareTo(a)\n {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "e644a8e28ab2198404f985c0b1806e46", "score": "0.6630365", "text": "function bnCompareTo(a)\n {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "ab67e3ca30ef6d2ccdd61c8fe8340bb7", "score": "0.66230017", "text": "function bnCompareTo(a) {\r\n var r = this.s-a.s;\r\n if(r != 0) return r;\r\n var i = this.t;\r\n r = i-a.t;\r\n if(r != 0) return (this.s<0)?-r:r;\r\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\r\n return 0;\r\n }", "title": "" }, { "docid": "ab67e3ca30ef6d2ccdd61c8fe8340bb7", "score": "0.66230017", "text": "function bnCompareTo(a) {\r\n var r = this.s-a.s;\r\n if(r != 0) return r;\r\n var i = this.t;\r\n r = i-a.t;\r\n if(r != 0) return (this.s<0)?-r:r;\r\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\r\n return 0;\r\n }", "title": "" }, { "docid": "b8a4d2ca3ff0d7a7f9a196792ccecb3d", "score": "0.6618285", "text": "function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t }", "title": "" }, { "docid": "db0bef9e1b1d0f50d054cf7236630284", "score": "0.6613801", "text": "function bnCompareTo(a)\n {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "719e90d6cb0f8e4e7491b290b68c04e5", "score": "0.66052926", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0)\n return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0)\n return (this.s < 0) ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0)\n return r;\n return 0;\n}", "title": "" }, { "docid": "830e0adea85c215b4d9abb7c1b6c0c3a", "score": "0.6596686", "text": "function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return (this.s<0)?-r:r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t}", "title": "" }, { "docid": "bffee6971a6f8d78c2fba029dce396b0", "score": "0.65961456", "text": "function bnCompareTo(a) {\r\nvar r = this.s-a.s;\r\nif(r != 0) return r;\r\nvar i = this.t;\r\nr = i-a.t;\r\nif(r != 0) return (this.s<0)?-r:r;\r\nwhile(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\r\nreturn 0;\r\n}", "title": "" }, { "docid": "7a835d7511de5e8b18a31a2b8d613068", "score": "0.65929836", "text": "function bnCompareTo(a) {\r\n var r = this.s-a.s;\r\n if(r != 0) return r;\r\n var i = this.t;\r\n r = i-a.t;\r\n if(r != 0) return (this.s<0)?-r:r;\r\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\r\n return 0;\r\n}", "title": "" }, { "docid": "6bc2e3017332798ca7a2abd27956b2c1", "score": "0.6592672", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "6bc2e3017332798ca7a2abd27956b2c1", "score": "0.6592672", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "6bc2e3017332798ca7a2abd27956b2c1", "score": "0.6592672", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return (this.s < 0) ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "c445061f3ecf305c8ed2ad38743eb127", "score": "0.6585958", "text": "function bnCompareTo(a) {\n var r = this.s - a.s\n if (r != 0) return r\n var i = this.t\n r = i - a.t\n if (r != 0) return (this.s < 0) ? -r : r\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r\n return 0\n}", "title": "" }, { "docid": "f2d28de52d876bb72e6b127d73f9b541", "score": "0.658397", "text": "function bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0) if ((r = this.data[i] - a.data[i]) != 0) return r;\n return 0;\n }", "title": "" }, { "docid": "8075b109d51f8ca9dc3f7d68313e5cbb", "score": "0.65805566", "text": "function bnCompareTo(a){var r=this.s-a.s;if(0!=r)return r;var i=this.t;if(r=i-a.t,0!=r)return this.s<0?-r:r;for(;--i>=0;)if(0!=(r=this[i]-a[i]))return r;return 0}", "title": "" }, { "docid": "5b0820edd7f878cd2e5bbe0aa0d07ee0", "score": "0.6579522", "text": "function compareNum(a, b) {\r\n if (a > b) return 1;\r\n if (a < b) return -1;\r\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "08894c9d84b42e5d4f4f1bfc23181512", "score": "0.6575776", "text": "function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" }, { "docid": "042a10db0804bf393ccdda557e8ca55e", "score": "0.6558409", "text": "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "title": "" } ]
6a624cc585632c1151eed760b918b05f
initializes the launch sequence
[ { "docid": "c92defa4f5617d29a971c61193763912", "score": "0.0", "text": "function init_launch_button() {\n //create launch button\n stage.removeChild(launch_button);\n launch_button = buttonGenerator(275, 40, 220, 60, 0xCC0000, 5, 0.3, 'images/launch.png', launch_activate);\n stage.addChild(launch_button);\n }", "title": "" } ]
[ { "docid": "4a44a36997d3ec4c4845d6c1689af78a", "score": "0.6483805", "text": "function init() {\n start()\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "73522a6526e69b6d0a01e7225f20cc64", "score": "0.6391165", "text": "function launch() {}", "title": "" }, { "docid": "73522a6526e69b6d0a01e7225f20cc64", "score": "0.6391165", "text": "function launch() {}", "title": "" }, { "docid": "3ba0bb990dc0eb077790330fa0d191eb", "score": "0.6369898", "text": "function init() {\n\n getLaunches().then(() => {\n displayLaunches()\n displayCount()\n viewPayloadButtons = document.querySelectorAll('.view-payload-button')\n viewPayloadButtons.forEach(element => element.addEventListener('click', viewPayload));\n })\n}", "title": "" }, { "docid": "208344b55a6ccd85b6363bbe9e9792d8", "score": "0.627985", "text": "function init () {\n\n lastTime = Date.now();\n main();\n\n }", "title": "" }, { "docid": "9e1ad13adb4289368926d95433ff6021", "score": "0.62528425", "text": "init() {\n\t\tif (this.actions) {\n\t\t\tthis.actions.start();\n\t\t}\n\t}", "title": "" }, { "docid": "edd0d638a2d09550d29d12fcbe3790cf", "score": "0.62443286", "text": "function init() {\n // check to see if the url has a specific process to go to\n var processId = getURLParameter(\"process\");\n processId = parseInt(processId) !== NaN ? parseInt(processId) : undefined;\n\n // check to see if the url has a specific queue to go to\n var queueId = getURLParameter(\"queue\");\n queueId = parseInt(queueId) !== NaN ? parseInt(queueId) : undefined;\n\n // load up the initial processes\n loadProcesses(processId, queueId);\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6213827", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6213827", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6213827", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "3c1a7344040d1cea183c071aab90ea9b", "score": "0.6173953", "text": "initializing() {\n this.log('Mobile app assimilation process has begun');\n }", "title": "" }, { "docid": "876b355019af7377c5eea599a1077100", "score": "0.61702275", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "b833d68c6069b9af64d237b61cfd383e", "score": "0.61564004", "text": "function Init() {\n this.jobs = {};\n this.proc = {};\n}", "title": "" }, { "docid": "f7bad7ec9dff4b550c9d27ddf582298b", "score": "0.6155584", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "f9fe32b68fcdd6081a9b874b83039f6e", "score": "0.6155192", "text": "function initAllSteps(){\n\tcreateSteps('kick', false);\n\tcreateSteps('snare', false);\n\tcreateSteps('bass', false);\n\tcreateSteps('piano', true);\n}", "title": "" }, { "docid": "1df7657376c948be95b3c875848d1b91", "score": "0.6155008", "text": "async _init() {}", "title": "" }, { "docid": "1ba0a4bab82a3b357b484068d4b5a8b3", "score": "0.61486757", "text": "_init() {\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6147067", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6147067", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "64b3b97e6477c9b08bb048728736c4d4", "score": "0.6128302", "text": "function init() {\n\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "e4f518d8a2af433f080de1f8ec8d9051", "score": "0.61173505", "text": "async function init() {\n await createFrames();\n await spriteMaker();\n await sheetToXnb();\n await jsonToAtlasXnb();\n await zipFiles();\n }", "title": "" }, { "docid": "a9a44bbf61e4aea82bba2e2126f74fa4", "score": "0.61139", "text": "function init() {\n\t\tinstance.reset();\n\t\trunning = true;\n\t\tlastTime = Date.now();\n\t\tmain();\n\t}", "title": "" }, { "docid": "61926f22b072cdad16e42003046d51c1", "score": "0.61066383", "text": "startup () {}", "title": "" }, { "docid": "9f5d19e7e6acec6690ff585400a0980d", "score": "0.60966855", "text": "function init()\n {\n reset();\n lastTime=Date.now();\n main();\n }", "title": "" }, { "docid": "ea70084137b2da916504cf88d7796fc9", "score": "0.6073025", "text": "init() {\n super.gameState.startTime= new Date().getTime();\n if(this.context.trialType === 'demo'){\n trajectoryParameters = this.context.demoObstructions.map((obstruction,index)=> [obstruction,this.context.demoTrajectories[index]]);\n }else {\n trajectoryParameters = super.getTrajectoriesObstacles(gameArrayValues.OBSTRUCTIONS, gameArrayValues.VELOCITIES);\n }\n // Randomize trajectory for each obstruction\n super.fillAudioArray(soundURLs,sounds);\n super.fillImageArray(imageURls,images);\n super.fillImageArray(windowImageURLS,windowImgs);\n super.fillImageArray(obstrImageURLS,obstrImgs);\n\n\n sounds[gameSound.START].addEventListener('onloadeddata', this.initGame(), false);\n sounds[gameSound.START].addEventListener('playing', super.onSoundEvent);\n super.init();\n }", "title": "" }, { "docid": "ab9569c804a63082245f1ee81b2d6b81", "score": "0.60706633", "text": "startup() {}", "title": "" }, { "docid": "137ba33ff44056745e0ab1bbd3836c0a", "score": "0.6060502", "text": "init() {\n this.reset();\n this.lastTime = Date.now();\n this.main();\n }", "title": "" }, { "docid": "f11817502bd56c872dda148c9b513782", "score": "0.6035818", "text": "initSequence() {\n\t\tconst self = this;\n\n\t\tasync.series(\n\t\t\t[\n\t\t\t\tfunction validateNodeCount(callback) {\n\t\t\t\t\tif(self.config.nodeMax > 0 &&\n\t\t\t\t\t\t_.isNumber(activeDoorNodeInstances[self.config.name]) && \n\t\t\t\t\t\tactiveDoorNodeInstances[self.config.name] + 1 > self.config.nodeMax)\n\t\t\t\t\t{\n\t\t\t\t\t\tself.client.log.info( \n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\tname\t\t: self.config.name,\n\t\t\t\t\t\t\t\tactiveCount : activeDoorNodeInstances[self.config.name]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'Too many active instances');\n\n\t\t\t\t\t\tif(_.isString(self.config.tooManyArt)) {\n\t\t\t\t\t\t\ttheme.displayThemeArt( { client : self.client, name : self.config.tooManyArt }, function displayed() {\n\t\t\t\t\t\t\t\tself.pausePrompt( () => {\n\t\t\t\t\t\t\t\t\tcallback(new Error('Too many active instances'));\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\tself.client.term.write('\\nToo many active instances. Try again later.\\n');\n\n\t\t\t\t\t\t\t//\t:TODO: Use MenuModule.pausePrompt()\n\t\t\t\t\t\t\tself.pausePrompt( () => {\n\t\t\t\t\t\t\t\tcallback(new Error('Too many active instances'));\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\t//\t:TODO: JS elegant way to do this?\n\t\t\t\t\t\tif(activeDoorNodeInstances[self.config.name]) {\n\t\t\t\t\t\t\tactiveDoorNodeInstances[self.config.name] += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tactiveDoorNodeInstances[self.config.name] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcallback(null);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction generateDropfile(callback) {\t\t\t\t\t\n\t\t\t\t\tself.dropFile\t= new DropFile(self.client, self.config.dropFileType);\n\t\t\t\t\tvar fullPath\t= self.dropFile.fullPath;\n\n\t\t\t\t\tmkdirs(paths.dirname(fullPath), function dirCreated(err) {\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\tcallback(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.dropFile.createFile(function created(err) {\n\t\t\t\t\t\t\t\tcallback(err);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t],\n\t\t\tfunction complete(err) {\n\t\t\t\tif(err) {\n\t\t\t\t\tself.client.log.warn( { error : err.toString() }, 'Could not start door');\n\t\t\t\t\tself.lastError = err;\n\t\t\t\t\tself.prevMenu();\n\t\t\t\t} else {\n\t\t\t\t\tself.finishedLoading();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "ba1d21c546ae6fdc0bd3c4b6251defdb", "score": "0.60298836", "text": "async init() {\n await this.manifest.load();\n\n const manifest = {\n checks: this.manifest.get('checks', {}),\n tms: this.manifest.get('tms', {}),\n };\n\n const checks = await this.api.getChecks();\n const tms = await this.api.getTms();\n\n const checksIds = _.map(checks, 'id');\n const tmsIds = _.map(tms, 'id');\n\n manifest.checks = _.reduce(checks, (obj, check) => {\n obj[check.id] = manifest.checks[check.id] || {};\n obj[check.id].infos = {\n id: check.id,\n name: check.name,\n hostname: check.hostname,\n region: check.region,\n };\n return obj;\n }, {});\n manifest.tms = _.reduce(tms, (obj, tm) => {\n obj[tm.id] = manifest.tms[tm.id] || {};\n obj[tm.id].infos = {\n id: tm.id,\n name: tm.name,\n kitchen: tm.kitchen,\n };\n return obj;\n }, {});\n\n await this.manifest.saveManifest({ content: manifest });\n this.logger.info(`The manifest file is updated with ${checksIds.length} checks and ${tmsIds.length} TMs.`);\n\n await this.initProbes();\n }", "title": "" }, { "docid": "afe12dd743c875d7cebd96ee9e85210e", "score": "0.6028338", "text": "function initial() {\n\tcount = 0;\n\tsequence = [];\n\tcurrent = null;\n\tsubCount = 0;\n\tgameStart = false;\n\tuserTurn = false;\n}", "title": "" }, { "docid": "f86ce89b7370f1a399e0aa1b66f11094", "score": "0.6019469", "text": "function init() {\n self.process = troubleshootingProcess;\n self.step = self.process.activeStep;\n self.validator = tucValidator;\n }", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6002061", "text": "function init() {}", "title": "" }, { "docid": "2ca444a44ce765447b51f97ef2a80d2e", "score": "0.60015327", "text": "startup()\n\t{\n\t\tthis.rows(7, 8, 1);\n\t\tthis.action(0);\n\t}", "title": "" }, { "docid": "2eb19c58008058e277bddc7fad28a25b", "score": "0.59563327", "text": "function init() {\n\t\trotateText();\n\t\tconsole.log('app init');\n\t\tsetupDimensions();\n\t\tmirrorVideo();\n\t\tinitCapture();\n\t\tupdate();\n\n\t\t\n\t}", "title": "" }, { "docid": "68eedb7f20e08d16efb1cea71cd362ba", "score": "0.5954875", "text": "initializing() {\n \n }", "title": "" }, { "docid": "e4f172576984c0705e20b3ab45250365", "score": "0.59228987", "text": "function init(){\n \n }", "title": "" }, { "docid": "85ee989f05d314fd229650ab3d28b1d0", "score": "0.59212965", "text": "function gameInit() {\n beginInitSequence = true;\n}", "title": "" }, { "docid": "d479ca91d808fa82f4926fc22c723b39", "score": "0.5921155", "text": "function initiate() {\n console.time('botTime');\n log('Started to crawl: ' + params.start + ' at ' + startTime);\n Arachnod.queue({'url': params.start});\n for(var i = 0; i<params.parallel; i++) {\n spiderlings[i] = child.fork(__dirname + '/spiderling.js', [params.redis, tasks, finished, params.verbose]);\n spiderlings[i].on('message', getMsgs);\n }\n }", "title": "" }, { "docid": "f45cbe8e1c8477bb313ea0f9dec26b04", "score": "0.5900023", "text": "async function init4(){}", "title": "" }, { "docid": "b54ca4a3cbe544e3594d72349663f815", "score": "0.58985686", "text": "init() {\n this.createGridArray();\n this.whoseTurn();\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5885994", "text": "init() {}", "title": "" }, { "docid": "18734a238ca7e8afdaf857dbd27d83d2", "score": "0.58841735", "text": "function start() { \n //initialize is a USER-DEFINED argument-less function, which may be a stub\n initialize (); \n}", "title": "" }, { "docid": "08a4262e2bb1b8a2ee12f7daa4e63fec", "score": "0.5882474", "text": "init() {\n\t\tdebug = this.debug;\n\t\tlog = this.log;\n\n\t\tthis.initPresets();\n\t\tthis.init_tcp();\n\t\tthis.initVariables();\n\t\tthis.initFeedbacks();\n\t}", "title": "" }, { "docid": "def654f7c3fa864ef3bab7fe05fe068f", "score": "0.5876811", "text": "function init(){\n\t\t\tinitPhysijs();\n\t\t\tscene = initScene();\n\t\t\tcreateStartScene();\n\t\t\tcreateEndScene();\n\t\t\tcreateEndScene2();\n\t\t\tcreateStartScreen();\n\t\t\tinitRenderer();\n\t\t\tcreateMainScene();\n\t}", "title": "" }, { "docid": "01dfa78ba2c9410c77de64b5411cf0e8", "score": "0.5858286", "text": "async init() { }", "title": "" }, { "docid": "178fcfecf1b83e77c9469266b972ddba", "score": "0.5856446", "text": "function startUp() {\n Messages.subscribe(ASSIGNMENT_MANAGER_CHANNEL);\n Messages.subscribe(ASSIGNMENT_CLIENT_MESSANGER_CHANNEL);\n Messages.messageReceived.connect(onMangerChannelMessageReceived);\n Script.scriptEnding.connect(onEnding);\n populateRecordingList();\n startSequence();\n }", "title": "" }, { "docid": "aedeb0f6e371833ceecc4c29bc96f233", "score": "0.5848827", "text": "init(){\n this.stateIterator = this.stateGenerator();\n this.changeState();\n this.rules = this.createRules();\n this.actionRules = this.createActionRules();\n }", "title": "" }, { "docid": "65af4c2af0457f279828c5fa3aa1d99e", "score": "0.5846943", "text": "init() {\n this.generateMatrix();\n this._generateSubtrees(this.targetTask);\n this.subTask.sort((node1, node2) => {\n return node1.depth < node2.depth ? 1 : -1;\n });\n }", "title": "" }, { "docid": "63154d4221209df98e7859328c645099", "score": "0.58445704", "text": "constructor(run) { \r\n\t\tthis.run= run; \r\n\t}", "title": "" }, { "docid": "b254cf99664aea876e58ab57d52872c5", "score": "0.5843273", "text": "function init()\n{\n try\n {\n var tStart = (new Date()).valueOf();\n createEditDetector_();\n registerWebhook_();//for member\n createBoardDBSheet_();\n storeCurrentUserBoards_();\n var completeFlag = registerAllBoards_(tStart); \n if(completeFlag)\n {\n writeInfo_(\"Trellinator Initialization complete\");\n }\n }\n catch(error)\n {\n writeInfo_(\"Trellinator Initialization \" + error);\n }\n \n flushInfoBuffer();\n}", "title": "" }, { "docid": "2adae6c473d9eafa13faa2203d6d8ea0", "score": "0.5841291", "text": "function callNextInit() {\n\t\t\t\t\tvar runtime = runtimeList[runTimeIndex++], features, requiredFeatures, i;\n\n\t\t\t\t\tif (runtime) {\n\t\t\t\t\t\tfeatures = runtime.getFeatures();\n\n\t\t\t\t\t\t// Check if runtime supports required features\n\t\t\t\t\t\trequiredFeatures = self.settings.required_features;\n\t\t\t\t\t\tif (requiredFeatures) {\n\t\t\t\t\t\t\trequiredFeatures = requiredFeatures.split(',');\n\n\t\t\t\t\t\t\tfor (i = 0; i < requiredFeatures.length; i++) {\n\t\t\t\t\t\t\t\t// Specified feature doesn't exist\n\t\t\t\t\t\t\t\tif (!features[requiredFeatures[i]]) {\n\t\t\t\t\t\t\t\t\tcallNextInit();\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}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Try initializing the runtime\n\t\t\t\t\t\truntime.init(self, function(res) {\n\t\t\t\t\t\t\tif (res && res.success) {\n\t\t\t\t\t\t\t\t// Successful initialization\n\t\t\t\t\t\t\t\tself.features = features;\n\t\t\t\t\t\t\t\tself.runtime = runtime.name;\n\t\t\t\t\t\t\t\tself.trigger('Init', {runtime : runtime.name});\n\t\t\t\t\t\t\t\tself.trigger('PostInit');\n\t\t\t\t\t\t\t\tself.refresh();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcallNextInit();\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\t// Trigger an init error if we run out of runtimes\n\t\t\t\t\t\tself.trigger('Error', {\n\t\t\t\t\t\t\tcode : plupload.INIT_ERROR,\n\t\t\t\t\t\t\tmessage : plupload.translate('Init error.')\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "a61cf872f8c48921b71bb2d24b39ce16", "score": "0.5832564", "text": "function init() {\n initProps(options);\n initMode();\n\n handlePostInitTasks();\n }", "title": "" }, { "docid": "bed5e9a3a8955d5d5bc2c94ac6f87006", "score": "0.5829081", "text": "function init() {\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "1befc5ad8d09e17efe001f5fd363052d", "score": "0.58278096", "text": "function init() {\n\n //clean screen\n $('#blackboard').html('');\n\n //get launchcards\n launches = getNNextLaunchesObjects(10);\n\n //append the launchcards\n for (var i = 0; i < launches.length; i++) {\n launches[i].appendTo('#blackboard');\n launches[i].imageCSS({\n 'max-width': $('.rock').width()*0.9,\n 'margin': 'auto', 'padding': 0,\n 'border-radius': '20px'\n });\n }\n\n //make launchcards interactable\n let elements = document.getElementsByClassName('rock');\n\n for (var i = 0; i < elements.length; i++) {\n elements[i].addEventListener('click', showInfo);\n }\n\n //hide the launches descriptions\n $('.desc').hide();\n \n }", "title": "" }, { "docid": "7965ce2fca8e12f6fd19505511dbbbae", "score": "0.5824426", "text": "function runSequence() {\n\n pagePositions = [];\n setTargeting();\n setPagePositions();\n defineSlotsForPagePositions();\n\n }", "title": "" }, { "docid": "a6c36e85ad015d2a1c21469e90fefd9c", "score": "0.5821742", "text": "function Initialization() {\n\t\tpopulateRunnningText();\n\t\tloadDataPortfolio();\n\t\tcheckMenu();\n\t}", "title": "" }, { "docid": "cb70111465f0461fa5d1308e64f28252", "score": "0.5816178", "text": "function init () {\n\t\tconsole.log('all is loaded.');\n\t}", "title": "" }, { "docid": "f87fef4c1a3ce7155637b5af0c901b9b", "score": "0.58161336", "text": "function init_launcher () {\n\t\t\n\t\t_Launcher = main.get_asset_data( \"assets/modules/sections/Launcher.js\" );\n\t\t\n\t\tset_section( _Launcher );\n\t\t\n\t}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5815637", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5815637", "text": "init() { }", "title": "" }, { "docid": "73dd5084997cb9a19b01c1e506adafad", "score": "0.58150184", "text": "function init() {\n lastTime = Date.now();\n main();\n}", "title": "" }, { "docid": "351a4936076bdeede53f7a4097bd0c83", "score": "0.5813249", "text": "function initialise() {\n\n // set the board size\n boardSize = mission.boardSize;\n\n // check that a mission has been passed\n if (mission != null) {\n\n // switch the mission and run the specific initialise\n switch (mission.name) {\n\n case \"fog-of-war\":\n initFogOfWar();\n break;\n\n case \"hardcore\":\n initHardcore();\n break;\n\n case \"last-stand\":\n initLastStand();\n break;\n\n case \"against-the-clock\":\n initAgainstTheClock();\n break;\n\n case \"pearl-harbour\":\n initPearlHarbour();\n break;\n\n case \"island-warfare\":\n initIslandWarfare();\n break;\n }\n }\n}", "title": "" }, { "docid": "aff2bf331cb6f6aa0aece4a7abc37ed6", "score": "0.5810597", "text": "function _init() {\n vm.flags.isProcessing = false;\n }", "title": "" }, { "docid": "a3105acd5eeaf6146a5203d63578ef79", "score": "0.5801228", "text": "function init () {\n\tconnectScorm();\n\tcreateInitScreen();\n\tloadContent();\n}", "title": "" }, { "docid": "0bb815f20944016542a5b9d8e990a6a3", "score": "0.5799939", "text": "function init() {\n\t\t\t// init code here\n\t\t}", "title": "" }, { "docid": "0bb815f20944016542a5b9d8e990a6a3", "score": "0.5799939", "text": "function init() {\n\t\t\t// init code here\n\t\t}", "title": "" }, { "docid": "c3a6fc5b4a017708c6c1816a77acc4b7", "score": "0.5797805", "text": "function init() {\n console.log(\"Empezamos!\");\n }", "title": "" }, { "docid": "98dbe15612a275ed8c2a062145e75420", "score": "0.5793282", "text": "prepare() {\n this.initializeScreenElements();\n this.initializeTutorialSteps();\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.57930964", "text": "function init() { }", "title": "" }, { "docid": "6fd7d28b4b9c35c2b6368337a08a13cb", "score": "0.57746065", "text": "function init()\r\n{\r\n\tconsole.log('init');\t\r\n\t\r\n\tUI_init();\t\r\n\t\r\n\tNext();\t \r\n}", "title": "" }, { "docid": "86a9bd7c1ca4a0d3b0082e8bb7a34b0c", "score": "0.5769857", "text": "function init() {\n cloudGeneration()\n}", "title": "" }, { "docid": "7fdbfeb62d0ec56b5aa6eaab348f3b49", "score": "0.57673764", "text": "function init() {\n lastTime = Date.now();\n newGame();\n main();\n }", "title": "" }, { "docid": "213b71b96f27a320fc6dee214257dfc1", "score": "0.5765605", "text": "function init() {\n resetGame();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.575979", "text": "initialize() {}", "title": "" }, { "docid": "9ccef14126adb37ab6661f69330ca9e1", "score": "0.57502747", "text": "function _init() {\n virtualmachine(warm);\n}", "title": "" }, { "docid": "9ccef14126adb37ab6661f69330ca9e1", "score": "0.57502747", "text": "function _init() {\n virtualmachine(warm);\n}", "title": "" }, { "docid": "ef8fcf9ceae611d9bd7c22ba361ea19d", "score": "0.57403916", "text": "function main() {\n _initEvent();\n // initWorker();\n initScene();\n initCamera();\n initRender();\n initLight();\n initContr();\n initStats();\n initAxesHelper();\n _createModel();\n animate();\n}", "title": "" }, { "docid": "d547f3d786aeb5de772acef3ba7ad830", "score": "0.5736555", "text": "initializing() {\n console.log('Initializing Step');\n return Promise.all([this._fetchGradleVersion(), this._fetchKotlinVersion()]);\n }", "title": "" } ]
337c93ff95ba05608cadf257e86e2af3
Currently: The order that these are listed in the transaction is critical: Suppresses events. Restores selection range. Future: Restore document/overflow scroll positions that were unintentionally modified via DOM insertions above the top viewport boundary. Implement/integrate with customized constraint based layout system and keep track of which dimensions must be remeasured.
[ { "docid": "4d36b1c701d7c7c062e8cbd0ba9c2553", "score": "0.0", "text": "function ReactReconcileTransaction(forceHTML) {\n\t this.reinitializeTransaction();\n\t // Only server-side rendering really needs this option (see\n\t // `ReactServerRendering`), but server-side uses\n\t // `ReactServerRenderingTransaction` instead. This option is here so that it's\n\t // accessible and defaults to false when `ReactDOMComponent` and\n\t // `ReactTextComponent` checks it in `mountComponent`.`\n\t this.renderToStaticMarkup = false;\n\t this.reactMountReady = CallbackQueue.getPooled(null);\n\t this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;\n\t}", "title": "" } ]
[ { "docid": "c9c30b36c91f5d4831a0a3b2cdfb2300", "score": "0.63406384", "text": "function updateSize() { // 427\n\t\tmarkSizesDirty(); // 428\n\t\tif (elementVisible()) { // 429\n\t\t\tcalcSize(); // 430\n\t\t\tsetSize(); // 431\n\t\t\tunselect(); // 432\n\t\t\tcurrentView.clearEvents(); // 433\n\t\t\tcurrentView.renderEvents(events); // 434\n\t\t\tcurrentView.sizeDirty = false; // 435\n\t\t} // 436\n\t} // 437", "title": "" }, { "docid": "526bb8c9c5a3ecef6afca1397a01577e", "score": "0.6189833", "text": "recalculateSelectionBounds(element) {\n if (element) {\n const style = window.getComputedStyle(element);\n const x = this.extractStyleNumber(style.left);\n const y = this.extractStyleNumber(style.top);\n const w = element.clientWidth;\n const h = element.clientHeight;\n // move bounds\n if (this.selectionBounds.left > x) {\n this.selectionBounds.left = x;\n }\n if (this.selectionBounds.top > y) {\n this.selectionBounds.top = y;\n }\n if (this.selectionBounds.right < (x + w)) {\n this.selectionBounds.right = x + w;\n }\n if (this.selectionBounds.bottom < (y + h)) {\n this.selectionBounds.bottom = y + h;\n }\n }\n else {\n // contract bounds by checking all selected objects\n let minLeft = Number.MAX_SAFE_INTEGER;\n let minTop = Number.MAX_SAFE_INTEGER;\n let maxBottom = -Number.MAX_SAFE_INTEGER;\n let maxRight = -Number.MAX_SAFE_INTEGER;\n this.selection.forEach((obj) => {\n const style = window.getComputedStyle(obj.element);\n const x = this.extractStyleNumber(style.left);\n const y = this.extractStyleNumber(style.top);\n minLeft = Math.min(minLeft, x);\n minTop = Math.min(minTop, y);\n maxBottom = Math.max(maxBottom, y + obj.element.clientHeight);\n maxRight = Math.max(maxRight, x + obj.element.clientWidth);\n });\n this.selectionBounds = new _mathematics_service__WEBPACK_IMPORTED_MODULE_5__[\"Bounds\"](minTop, maxRight, maxBottom, minLeft);\n }\n }", "title": "" }, { "docid": "af85eb29c4adad3077f145c95f118435", "score": "0.58779776", "text": "_setCurrentLayoutBounds(left, top, right, bottom) {\n this._isLayoutValid = true;\n let boundsChanged = this._oldLeft !== left || this._oldTop !== top || this._oldRight !== right || this._oldBottom !== bottom;\n let sizeChanged = this._oldRight - this._oldLeft !== right - left || this._oldBottom - this._oldTop !== bottom - top;\n this._oldLeft = left;\n this._oldTop = top;\n this._oldRight = right;\n this._oldBottom = bottom;\n return { boundsChanged, sizeChanged };\n }", "title": "" }, { "docid": "ec90998991c086bc7539cca3c5962e25", "score": "0.5763233", "text": "function setupScrollbarCornerEvents() {\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var mouseDownPosition = { };\n var mouseDownSize = { };\n var mouseDownInvertedScale = { };\n\n _resizeOnMouseTouchDown = function(event) {\n if (onMouseTouchDownContinue(event)) {\n if (_mutationObserversConnected) {\n _resizeReconnectMutationObserver = true;\n disconnectMutationObservers();\n }\n\n mouseDownPosition = getCoordinates(event);\n\n mouseDownSize.w = _hostElementNative[LEXICON.oW] - (!_isBorderBox ? _paddingX : 0);\n mouseDownSize.h = _hostElementNative[LEXICON.oH] - (!_isBorderBox ? _paddingY : 0);\n mouseDownInvertedScale = getHostElementInvertedScale();\n\n _documentElement.on(_strSelectStartEvent, documentOnSelectStart)\n .on(_strMouseTouchMoveEvent, documentDragMove)\n .on(_strMouseTouchUpEvent, documentMouseTouchUp);\n\n addClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.setCapture)\n _scrollbarCornerElement.setCapture();\n\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n };\n function documentDragMove(event) {\n if (onMouseTouchDownContinue(event)) {\n var pageOffset = getCoordinates(event);\n var hostElementCSS = { };\n if (_resizeHorizontal || _resizeBoth)\n hostElementCSS[_strWidth] = (mouseDownSize.w + (pageOffset.x - mouseDownPosition.x) * mouseDownInvertedScale.x);\n if (_resizeVertical || _resizeBoth)\n hostElementCSS[_strHeight] = (mouseDownSize.h + (pageOffset.y - mouseDownPosition.y) * mouseDownInvertedScale.y);\n _hostElement.css(hostElementCSS);\n COMPATIBILITY.stpP(event);\n }\n else {\n documentMouseTouchUp(event);\n }\n }\n function documentMouseTouchUp(event) {\n var eventIsTrusted = event !== undefined;\n\n _documentElement.off(_strSelectStartEvent, documentOnSelectStart)\n .off(_strMouseTouchMoveEvent, documentDragMove)\n .off(_strMouseTouchUpEvent, documentMouseTouchUp);\n\n removeClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.releaseCapture)\n _scrollbarCornerElement.releaseCapture();\n\n if (eventIsTrusted) {\n if (_resizeReconnectMutationObserver)\n connectMutationObservers();\n _base.update(_strAuto);\n }\n _resizeReconnectMutationObserver = false;\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function getCoordinates(event) {\n return _msieVersion && insideIFrame ? { x : event.screenX , y : event.screenY } : COMPATIBILITY.page(event);\n }\n }", "title": "" }, { "docid": "f0c12d343f01890088ee75b7936cee4b", "score": "0.5753476", "text": "function adapterEvent_Layout(frames) {\n\tfor(var i = 0; i < frames.length; i++) {\n\t\tvar frame = frames[i];\n\t\tframe.event -= frame.layout;\n\t}\n}", "title": "" }, { "docid": "9f04939212bbfd09433745a57589f256", "score": "0.5753139", "text": "function doResizeActions(){\n\t\t\t\t// don't run this if a manual resize is going on\n\t\t\t\tif(resizing) return \n\t\t\t\t\n\t\t\t\tvar curWidth = $container.width(),\n\t\t\t\t\tcurHeight = $container.height()\n\t\t\t\tif(curWidth != lastWidth || curHeight != lastHeight){\n\t\t\t\t\t/*\n\t\t\t\t\t * At this point, the size change has been detected and acknowledged.\n\t\t\t\t\t * Recompute the height and width of the svg and treemap layout, then\n\t\t\t\t\t * update the UI.\n\t\t\t\t\t */\n\t\t\t\t\tlastWidth = curWidth\n\t\t\t\t\tlastHeight = curHeight\n\t\t\t\t\tvar tmHeight = Math.max(0, curHeight - margin.top - margin.bottom),\n\t\t\t\t\t\ttmWidth = Math.max(0, curWidth - margin.left - margin.right)\n\t\t\t\t\t\n\t\t\t\t\tsvg.attr('width', curWidth).attr('height', curHeight)\n\t\t\t\t\tresetLayout(privateState, [tmWidth, tmHeight])\n\t\t\t\t\tself.update()\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "44e7b9d7c453b480a7f5e48b269b9191", "score": "0.57185256", "text": "onResize() {\r\n\t\t// Update the selection, to match correct sizing.\r\n\t\tthis.updateSelection(0);\r\n\t}", "title": "" }, { "docid": "0c0a26584420dd673a0c72871d32e625", "score": "0.569624", "text": "function resizexy(e){ // During resize of browses\n e=window.fixEvent(e);\n var BODY=app.document.body;\n var FS=window.main.mousedrag;\n var LS=FS.parentNode.style;\n var min=(mousedrag.getAttribute('min')).split(',');\n\n if(mousedrag.getAttribute('resize')!='resizex'){\n var h=e.clientY+BODY.scrollTop -LS.top.replace('px','');\n if(h>min[1]*1) LS.height=(FS.style.height=h+'px');\n }\n var w=e.clientX+BODY.scrollLeft-LS.left.replace('px','');\n if(w>min[0]*1) LS.width=(FS.style.width=w+'px');\n}", "title": "" }, { "docid": "6e2e8648c41b7c8f6651d688eba00715", "score": "0.56566817", "text": "function updateSelectionRectangles() {}", "title": "" }, { "docid": "c9036822f92a7b02d64a117f631e6fd7", "score": "0.56412476", "text": "documentMouseMove(e: MouseEvent) {\n const offsetTop = 18;\n const offsetLeft = 56;\n\n const { canvas: state } = window.store.getState();\n\n let clientX = e.clientX,\n clientY = e.clientY;\n\n if (clientX < offsetLeft) {\n clientX = offsetLeft;\n }\n\n if (clientY < offsetTop) {\n clientY = offsetTop;\n }\n\n // in the case where there is overflowed\n let newWidth = clientX - offsetLeft + state.scrollLeft - 5,\n newHeight = clientY - offsetTop + state.scrollTop - 5;\n newWidth = Math.max(newWidth, 1);\n newHeight = Math.max(newHeight, 1);\n\n if (state.pressed) {\n switch (state.resizeDirection) {\n case HORIZONTAL:\n window.store.dispatch(resizeTemp(newWidth, state.height));\n break;\n case VERTICAL:\n window.store.dispatch(resizeTemp(state.width, newHeight));\n break;\n case DIAGONAL:\n window.store.dispatch(resizeTemp(newWidth, newHeight));\n break;\n default:\n break;\n }\n }\n }", "title": "" }, { "docid": "92a09d80a64d588d359cfcfb84e2c85b", "score": "0.5613923", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "630c8307758d8c18a08b3c4c649da510", "score": "0.55313677", "text": "_updateSelection() {\n\t\t// If there is no selection - remove DOM and fake selections.\n\t\tif ( this.selection.rangeCount === 0 ) {\n\t\t\tthis._removeDomSelection();\n\t\t\tthis._removeFakeSelection();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRoot = this.domConverter.mapViewToDom( this.selection.editableElement );\n\n\t\t// Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.\n\t\tif ( !this.isFocused || !domRoot ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Render selection.\n\t\tif ( this.selection.isFake ) {\n\t\t\tthis._updateFakeSelection( domRoot );\n\t\t} else {\n\t\t\tthis._removeFakeSelection();\n\t\t\tthis._updateDomSelection( domRoot );\n\t\t}\n\t}", "title": "" }, { "docid": "35a1ae780d741ad842557dfe8f847945", "score": "0.552996", "text": "function _layout() {\n\n divElem.style.maxHeight = divElem.scrollHeight + 'px';\n\n if (divElem.clientHeight + divElem.offsetTop > screen.availHeight /*document.body.clientHeight*/) {\n divElem.style.maxHeight = \"120px\";\n divElem.style.overflow = \"visible\";\n divElem.style.overflowX = \"hidden\";\n divElem.style.overflowY = \"scroll\";\n }\n else {\n divElem.style.overflow = \"visible\";\n divElem.style.overflowX = \"hidden\";\n divElem.style.overflowY = \"hidden\";\n scrollToView = true;\n }\n\n \n \n }", "title": "" }, { "docid": "a0a17b9967e5d02a1e507c5f02f1eab9", "score": "0.55158895", "text": "function setupScrollbarCornerEvents() {\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var mouseDownPosition = {};\n var mouseDownSize = {};\n var mouseDownInvertedScale = {};\n var reconnectMutationObserver;\n\n function documentDragMove(event) {\n if (onMouseTouchDownContinue(event)) {\n var pageOffset = getCoordinates(event);\n var hostElementCSS = {};\n if (_resizeHorizontal || _resizeBoth)\n hostElementCSS[_strWidth] = (mouseDownSize.w + (pageOffset.x - mouseDownPosition.x) * mouseDownInvertedScale.x);\n if (_resizeVertical || _resizeBoth)\n hostElementCSS[_strHeight] = (mouseDownSize.h + (pageOffset.y - mouseDownPosition.y) * mouseDownInvertedScale.y);\n _hostElement.css(hostElementCSS);\n COMPATIBILITY.stpP(event);\n }\n else {\n documentMouseTouchUp(event);\n }\n }\n function documentMouseTouchUp(event) {\n var eventIsTrusted = event !== undefined;\n\n setupResponsiveEventListener(_documentElement,\n [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent],\n [documentOnSelectStart, documentDragMove, documentMouseTouchUp],\n true);\n\n removeClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.releaseCapture)\n _scrollbarCornerElement.releaseCapture();\n\n if (eventIsTrusted) {\n if (reconnectMutationObserver)\n connectMutationObservers();\n _base.update(_strAuto);\n }\n reconnectMutationObserver = false;\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function getCoordinates(event) {\n return _msieVersion && insideIFrame ? { x: event.screenX, y: event.screenY } : COMPATIBILITY.page(event);\n }\n\n addDestroyEventListener(_scrollbarCornerElement, _strMouseTouchDownEvent, function (event) {\n if (onMouseTouchDownContinue(event) && !_resizeNone) {\n if (_mutationObserversConnected) {\n reconnectMutationObserver = true;\n disconnectMutationObservers();\n }\n\n mouseDownPosition = getCoordinates(event);\n\n mouseDownSize.w = _hostElementNative[LEXICON.oW] - (!_isBorderBox ? _paddingX : 0);\n mouseDownSize.h = _hostElementNative[LEXICON.oH] - (!_isBorderBox ? _paddingY : 0);\n mouseDownInvertedScale = getHostElementInvertedScale();\n\n setupResponsiveEventListener(_documentElement,\n [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent],\n [documentOnSelectStart, documentDragMove, documentMouseTouchUp]);\n\n addClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.setCapture)\n _scrollbarCornerElement.setCapture();\n\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n });\n }", "title": "" }, { "docid": "29a43be1e211951b14afcff71ad30000", "score": "0.55078334", "text": "function updateView() {\n\t\t//$log.log(preDebugMsg + \"updateView\");\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(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 resize = checkNeededSize();\n\n\t\tif(!resize) {\n\t\t\t//$log.log(preDebugMsg + \"actually draw\");\n\n\t\t\tif(ctx) {\n\t\t\t\tctx.clearRect(0, 0, myCanvas.width, myCanvas.height);\n\t\t\t}\n\n\t\t\tdrawBackground();\n\t\t\tdrawImages();\n\t\t\tdrawSelections();\n\t\t}\n\t\telse {\n\t\t\t//$log.log(preDebugMsg + \"resize, wait\");\n\t\t}\n\t}", "title": "" }, { "docid": "7f41563a540f069e11311687f605926d", "score": "0.5502563", "text": "function applySelectionChanges() {\n setHeight();\n setWidth();\n setColor();\n setSelectionInfo(myDiagram.selection.first());\n}", "title": "" }, { "docid": "f5a7aea4fc6f63dc02470323747d7175", "score": "0.54853976", "text": "function H(a,b){var c=document.documentElement;\n// Mark the handle as 'active' so it can be styled.\nif(1===b.handles.length){\n// Support 'disabled' handles\nif(b.handles[0].hasAttribute(\"disabled\"))return!1;i(b.handles[0].children[0],d.cssClasses.active)}\n// Fix #551, where a handle gets selected instead of dragged.\na.preventDefault(),\n// A drag should never propagate up to the 'tap' event.\na.stopPropagation();\n// Attach the move and end events.\nvar e=D(Y.move,c,E,{start:a.calcPoint,baseSize:A(),pageOffset:a.pageOffset,handles:b.handles,handleNumber:b.handleNumber,buttonsProperty:a.buttons,positions:[$[0],$[W.length-1]]}),f=D(Y.end,c,F,{handles:b.handles,handleNumber:b.handleNumber}),g=D(\"mouseout\",c,G,{handles:b.handles,handleNumber:b.handleNumber});\n// Text selection isn't an issue on touch devices,\n// so adding cursor styles can be skipped.\nif(c.noUiListeners=e.concat(f,g),a.cursor){\n// Prevent the 'I' cursor and extend the range-drag cursor.\ndocument.body.style.cursor=getComputedStyle(a.target).cursor,\n// Mark the target with a dragging state.\nW.length>1&&i(Z,d.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,\n// Prevent text selection when dragging the handles.\ndocument.body.addEventListener(\"selectstart\",h,!1)}void 0!==b.handleNumber&&B(\"start\",b.handleNumber)}", "title": "" }, { "docid": "9f7f331943adb2cbed2d8768a1d526e5", "score": "0.5468486", "text": "function updateSelectionDisplaySizes() {\n\t\tfor(coord = 0; coord < coordTypes.length; coord++) {\n\t\t\tfor(sel = 0; sel < selections[coord].length; sel++) {\n\t\t\t\tif(selections[coord][sel][4]) { // only null\n\t\t\t\t\tselections[coord][sel][0] = topMarg + drawH + nullMarg / 2;\n\t\t\t\t\tselections[coord][sel][1] = topMarg + drawH + nullMarg;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(coordTypes[coord] == 'string') {\n\t\t\t\t\t\tvar smallestInside = selections[coord][sel][2];\n\t\t\t\t\t\tvar largestInside = selections[coord][sel][3];\n\n\t\t\t\t\t\tvar top = topMarg;\n\t\t\t\t\t\tif(smallestInside > 0) {\n\t\t\t\t\t\t\ttop = Math.floor(topMarg + drawH * (coordLimits[coord].props[smallestInside] + coordLimits[coord].props[smallestInside - 1]) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar bottom = topMarg + drawH;\n\t\t\t\t\t\tif(largestInside < coordLimits[coord].props.length - 1) {\n\t\t\t\t\t\t\tbottom = Math.ceil(topMarg + drawH * (coordLimits[coord].props[largestInside] + coordLimits[coord].props[largestInside + 1]) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselections[coord][sel][0] = top;\n\t\t\t\t\t\tselections[coord][sel][1] = bottom;\n\t\t\t\t\t}\n\t\t\t\t\telse if(coordTypes[coord] == 'date') {\n\t\t\t\t\t\tselections[coord][sel][0] = val2pixel(selections[coord][sel][2], coord);\n\t\t\t\t\t\tselections[coord][sel][1] = val2pixel(selections[coord][sel][3], coord);\n\t\t\t\t\t}\n\t\t\t\t\telse { // number\n\t\t\t\t\t\tselections[coord][sel][0] = val2pixel(selections[coord][sel][3], coord); // y-axis is flipped\n\t\t\t\t\t\tselections[coord][sel][1] = val2pixel(selections[coord][sel][2], coord);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(selections[coord][sel][5]) {\n\t\t\t\t\t\tselections[coord][sel][1] = topMarg + drawH + nullMarg;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f942bfff24dd62db528330baaa022eed", "score": "0.54487634", "text": "handleConstraints() {\n if (this.x < 0) {\n this.x = 0;\n }\n if (this.x > width - 1) {\n this.x = width - this.size;\n }\n if (this.y < 0) {\n this.y = 0;\n }\n if (this.y > height - 1) {\n this.y = height - this.size;\n }\n }", "title": "" }, { "docid": "d32cfc1b68b53ab54274dbdfd136de95", "score": "0.5436254", "text": "function justToIsolateScope() {\n\t\t\t\t\t\tvar minRelayoutPeriodPassed = true;\n\t\t\t\t\t\tvar pendingLayout = false;\n\t\t\t\t\t\tvar elementSize = null;\n\t\t\t\t\t\tvar timeoutPromise = null;\n\t\t\t\t\t\tfunction getNewSize() {\n\t\t\t\t\t\t\tvar newSize;\n\t\t\t\t\t\t\tif ($scope.foundset == EMPTY) newSize = [0,0];\n\t\t\t\t\t\t\telse newSize = [ gridUtil.elementWidth($element), gridUtil.elementHeight($element) ];\n\t\t\t\t\t\t\tif (!elementSize || (newSize[0] != elementSize[0] || newSize[1] != elementSize[1])){\n\t\t\t\t\t\t\t\telementSize = newSize;\n\t\t\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$scope.$watch(function() {\n\t\t\t\t\t\t\tif (timeoutPromise) $timeout.cancel(timeoutPromise);\n\t\t\t\t\t\t\ttimeoutPromise = $timeout(getNewSize,200, false);\n\t\t\t\t\t\t\treturn elementSize;\n\t\t\t\t\t\t },\n\t\t\t\t\t\t\tfunction(oldV, newV) {\n\t\t\t\t\t\t\tif (oldV != newV) {\n\t\t\t\t\t\t\t\t// the portal resized (browser window resize or split pane resize for example)\n\t\t\t\t\t\t\t\tif (pendingLayout) return; // will layout later anyway\n\t\t\t\t\t\t\t\tif (minRelayoutPeriodPassed) {\n\t\t\t\t\t\t\t\t\tlayoutColumnsAndGrid();\n\n\t\t\t\t\t\t\t\t\tminRelayoutPeriodPassed = false;\n\t\t\t\t\t\t\t\t\tfunction wait200ms() {\n\t\t\t\t\t\t\t\t\t\tif (pendingLayout) {\n\t\t\t\t\t\t\t\t\t\t\tpendingLayout = false;\n\t\t\t\t\t\t\t\t\t\t\tlayoutColumnsAndGrid();\n\t\t\t\t\t\t\t\t\t\t\t$timeout(wait200ms, 200);\n\t\t\t\t\t\t\t\t\t\t} else minRelayoutPeriodPassed = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$timeout(wait200ms, 200);\n\t\t\t\t\t\t\t\t} else pendingLayout = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}", "title": "" }, { "docid": "4b220181864c91c3441d727d0495bc15", "score": "0.5430893", "text": "onContentLayout(e) {\n\t\tconsole.log(\"onContentLayout dimensionsSet...\"+this.state.dimensionsSet);\n\t\tconsole.log(\"this.props.recalculateHiddenLayout...\"+this.props.recalculateHiddenLayout);\t\t\n\t\tthis.setState({\n\t\t\tdimensionsSet: !this.props.recalculateHiddenLayout,\n\t\t\thiddenHeight: e.nativeEvent.layout.height,\n\t\t\thiddenWidth: e.nativeEvent.layout.width,\n\t\t});\n\n\t\tif(this.props.preview && !this.ranPreview) {\n\t\t\tthis.ranPreview = true;\n\t\t\tlet previewOpenValue = this.props.previewOpenValue || this.props.rightOpenValue * 0.5;\n\t\t\tthis.getPreviewAnimation(previewOpenValue, PREVIEW_OPEN_DELAY)\n\t\t\t.start( _ => {\n\t\t\t\tthis.getPreviewAnimation(0, PREVIEW_CLOSE_DELAY).start();\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "4ca6034e97268909ee5b1272147e3b41", "score": "0.5416449", "text": "function onBoundsCalculated() {\n\t\twindow.callPhantom({\n\t\t\tview_box: paintbox.view_box,\n\t\t\tdefs: paintbox.defs,\n\t\t\ttree: tree\n\t\t});\n\t}", "title": "" }, { "docid": "6331fc40d88d7febb52054b1b9013f5e", "score": "0.5401389", "text": "_updateSelection (): void {\n if (featureGetSelection && featureCreateRange) {\n let currentSelection = window.getSelection()\n\n if (!currentSelection.focusNode || !currentSelection.anchorNode) {\n return\n }\n\n let selectionStartPosition: ?Position = this._getSelectionStartNodePosition(),\n selectionEndPosition: ?Position = this._getSelectionEndNodePosition()\n\n if (selectionStartPosition && selectionEndPosition) {\n\n // let rangeStartColumn: number,\n // rangeEndColumn: number,\n // range = currentSelection.getRangeAt(0)\n\n // // Find the text content length for range start and end offset\n // let rangeStartOffset: number = this._getTextContentByOffset(range.startContainer, range.startOffset).length,\n // rangeEndOffset: number = this._getTextContentByOffset(range.endContainer, range.endOffset).length\n\n // if (this._isRangeReversed({\n // start: selectionStartPosition,\n // end: selectionEndPosition\n // })) {\n // rangeStartColumn = rangeEndOffset\n // rangeEndColumn = rangeStartOffset\n // } else {\n // rangeStartColumn = rangeStartOffset\n // rangeEndColumn = rangeEndOffset\n // }\n\n let startColumnOffset: number = this._getTextContentByOffset(currentSelection.anchorNode, currentSelection.anchorOffset).length,\n endColumnOffset: number = this._getTextContentByOffset(currentSelection.focusNode, currentSelection.focusOffset).length\n\n this.setSelection({\n start: {\n row: selectionStartPosition.row,\n column: selectionStartPosition.column + startColumnOffset\n },\n end: {\n row: selectionEndPosition.row,\n column: selectionEndPosition.column + endColumnOffset\n }\n })\n }\n }\n else {\n // TODO: add support for old IE\n }\n }", "title": "" }, { "docid": "9103ef08e787d4fd27bf33649a867436", "score": "0.5400636", "text": "function beforeMaximize() {\n var selectorWidthCalculation = \"#editedContent_ , #divSourceTextContainer_ , #sourceTextArea_ , #commentsTextArea_ , #divComments, #targetTextArea__tbl, #divOptions\";\n oldh = $('#postEditDialog_').height();\n oldw = $('#postEditDialog_').width();\n $('#postEditDialog_').data('isMaximized', { state: true });\n $(selectorWidthCalculation).each(function () {\n $(this).data('elementWidth', { elementWidthBeforeMaximize: $(this).css(\"width\") });\n $(this).data('elementHeight', { elementHeightBeforeMaximize: $(this).css(\"height\") });\n });\n }", "title": "" }, { "docid": "de12e16d6d880c61eab05ce58d2b9716", "score": "0.5397659", "text": "onDidChangeOptions() {\n this._lastRenderData = null;\n this._buffers = null;\n this._applyLayout();\n this._domNode.setClassName(this._getMinimapDomNodeClassName());\n }", "title": "" }, { "docid": "ab7eee3672d7725de2e759e71226800d", "score": "0.53952456", "text": "_updateLayout() {\n this._isUpdatingLayout = true; // Indicate that we are now updating our layout.\n\n // First position the title and numberDisplay horizontally relative to the slider.\n this._title.left = this._slider.left;\n this._numberDisplay.right = this._slider.right;\n\n // Position the title and NumberDisplay vertically relative to the slider.\n if ( this._title.height > this._numberDisplay.height ) {\n this._numberDisplay.centerY = this._title.centerY;\n this._slider.top = this._title.bottom + this._sliderTopMargin;\n }\n else {\n this._title.centerY = this._numberDisplay.centerY;\n this._slider.top = this._numberDisplay.bottom + this._sliderTopMargin;\n }\n\n this._isUpdatingLayout = false; // Indicate that we are now done updating our layout of our children.\n super._recomputeAncestorBounds();\n }", "title": "" }, { "docid": "ecbce9aae3a6cf9abd277a5a1a2d69fa", "score": "0.538687", "text": "function move(e)\r\n{\r\n\tif(bInMove) return; // we're already processing a mousemove event\r\n\t\r\n\tbInMove = true;\r\n\toCanvas.style.cursor = \"auto\";\r\n\toSelection.style.cursor = \"auto\";\r\n\r\n\tbCanMove = false;\r\n\tif (!e) var e = window.event;\r\n\tvar p = new point(e);\t\r\n\tvar selection = rectangle(oSelection);\r\n\t\r\n\t//debugDisplay(p, selection);\r\n\t\t\r\n\tif(bMoving)\t\r\n\t{\t\t\r\n\t\tvar dx = p.x - downPoint.x;\r\n\t var dy = p.y - downPoint.y;\r\n\t\tselection.x = 0 + originalRect.x + dx;\r\n\t\tselection.y = 0 + originalRect.y + dy;\t\t\r\n\t\t//confine(selection);\r\n\t\t//constrain(selection);\t\r\n\t\tsetSelection(selection);\r\n\t\tcheckConfine(selection);\r\n\t}\r\n else if(bResizing)\r\n {\r\n\t var dx = p.x - downPoint.x;\r\n var dy = p.y - downPoint.y;\r\n \r\n if(resizeXMode == \"E\")\r\n\t {\t\t\r\n\t\t selection.w = 0 + originalRect.w + dx;\r\n\t\t if(selection.w < minimumSelectionSize)\r\n\t {\r\n\t selection.w = minimumSelectionSize;\r\n\t bResizing = false;\r\n\t }\r\n\t }\r\n\t if(resizeXMode == \"W\")\r\n\t {\r\n\t selection.w = 0 + originalRect.w - dx;\r\n\t selection.x = 0 + originalRect.x + dx;\t\t\t\r\n\t\t if(selection.w < minimumSelectionSize)\r\n\t {\r\n\t dx = selection.w - minimumSelectionSize;\r\n\t selection.w = minimumSelectionSize;\r\n\t selection.x += dx; \r\n\t bResizing = false;\r\n\t }\t\t\t\r\n\t }\r\n\t if(resizeYMode == \"S\")\r\n\t {\r\n\t\t selection.h = 0 + originalRect.h + dy;\r\n\t\t if(selection.h < minimumSelectionSize)\r\n\t {\r\n\t selection.h = minimumSelectionSize;\r\n\t bResizing = false;\r\n\t }\t\t\t\t\r\n\t }\r\n\t if(resizeYMode == \"N\")\r\n\t {\r\n\t selection.h = 0 + originalRect.h - dy;\r\n\t selection.y = 0 + originalRect.y + dy;\r\n\t\t if(selection.h < minimumSelectionSize)\r\n\t {\r\n\t dy = selection.h - minimumSelectionSize;\r\n\t selection.h = minimumSelectionSize;\r\n\t selection.y += dy; \r\n\t bResizing = false;\r\n\t }\t\t\t\r\n\t }\r\n \r\n //confine(selection);\t\t\t\r\n constrain(selection);\r\n setSelection(selection);\r\n\t checkConfine(selection); \r\n }\r\n else\r\n\t{\r\n\t\tresizeXMode = \"\";\r\n\t\tresizeYMode = \"\";\r\n\r\n\t\tvar targetSize = 15;\r\n\t\tif(p.x >= selection.x && p.x <= (selection.x + selection.w) && p.y >= selection.y && p.y <= (selection.y + selection.h))\r\n\t\t{\r\n\t\t\t// cursor is inside the selection\r\n\t\t\t// default to move behaviour\r\n\t\t\toSelection.style.cursor = \"move\";\r\n\t\t\toCanvas.style.cursor = \"move\";\r\n\t\t\tbCanMove = true;\r\n\t\t\t// only display N, E, W, S cursors for unconstrained selections - \r\n\t\t // constrained selections should only get NW, NE, SW, SE cursors.\r\n\t\t if(p.x <= (selection.x + targetSize))\r\n\t\t\t{\r\n\t\t\t\toSelection.style.cursor = bConstrain ? \"Auto\" : \"W-resize\";\r\n\t\t\t\toCanvas.style.cursor = bConstrain ? \"Auto\" : \"W-resize\";\r\n\t\t\t\tresizeXMode = \"W\";\r\n\t\t\t\tif(p.y <= (selection.y + targetSize))\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = \"NW-resize\";\r\n\t\t\t\t\toCanvas.style.cursor = \"NW-resize\";\r\n\t\t\t\t\tresizeYMode = \"N\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(p.y >= (selection.y + (selection.h - targetSize)))\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = \"SW-resize\";\r\n\t\t\t\t\toCanvas.style.cursor = \"SW-resize\";\r\n\t\t\t\t\tresizeYMode = \"S\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(p.x > (selection.x + targetSize) && p.x <= (selection.x + (selection.w - targetSize)))\r\n\t\t\t{\r\n\t\t\t\tif(p.y <= (selection.y + targetSize))\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = bConstrain ? \"Auto\" : \"N-resize\";\r\n\t\t\t\t\toCanvas.style.cursor = bConstrain ? \"Auto\" : \"N-resize\";\r\n\t\t\t\t\tresizeYMode = \"N\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(p.y >= (selection.y + (selection.h - targetSize)))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!bConstrain)\r\n\t\t\t\t {\r\n\t\t\t\t oSelection.style.cursor = bConstrain ? \"Auto\" : \"S-resize\";\r\n\t\t\t\t\t oCanvas.style.cursor = bConstrain ? \"Auto\" : \"S-resize\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresizeYMode = \"S\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = \"move\";\t\r\n\t\t\t\t\toCanvas.style.cursor = \"move\";\t\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse if(p.x > (selection.x + (selection.w - targetSize)))\r\n\t\t\t{\r\n\t\t\t\tif(!bConstrain)\r\n\t\t\t\t{\r\n\t\t\t\t oSelection.style.cursor = bConstrain ? \"Auto\" : \"E-resize\";\r\n\t\t\t\t oCanvas.style.cursor = bConstrain ? \"Auto\" : \"E-resize\";\r\n\t\t\t\t}\r\n\t\t\t\tresizeXMode = \"E\";\r\n\t\t\t\tif(p.y <= (selection.y + targetSize))\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = \"NE-resize\";\r\n\t\t\t\t\toCanvas.style.cursor = \"NE-resize\";\r\n\t\t\t\t\tresizeYMode = \"N\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(p.y >= (selection.y + (selection.h - targetSize)))\r\n\t\t\t\t{\r\n\t\t\t\t\toSelection.style.cursor = \"SE-resize\";\t\r\n\t\t\t\t\toCanvas.style.cursor = \"SE-resize\";\t\r\n\t\t\t\t\tresizeYMode = \"S\";\r\n\t\t\t\t}\t\t\r\n\t\t\t}\t\t\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tbInMove = false;\r\n}", "title": "" }, { "docid": "95afd32a2bac9bb4c4f4035e8fdf39a7", "score": "0.53857946", "text": "function layoutChange() {\n if ( prevLayoutView !== layoutView ) {\n // functions that need to fire when breakpoints change\n prevLayoutView = layoutView;\n }\n }", "title": "" }, { "docid": "3e4ee041fb305ef5a98a860c566c748c", "score": "0.53747183", "text": "function adjustScrollContent(type) {\n\t//get all of the selection area elements\n\tvar selections = document.getElementsByClassName(type + \"-select\");\n\n\t//iterate over the selection area elements\n\tfor (var i = 0; i < selections.length; i++) {\n\t\t/*\n\t\tget the current offset height of the object, this will be NaN if the\n\t\telement is hidden\n\t\t*/\n\t\tvar height = selections[i].offsetHeight;\n\n\t\tvar top;\n\t\t//only compute if height is a number and more than the selection area\n\t\tif (!isNaN(height) && height >= selection_area_height) {\n\t\t\t//compute the relative top offset based on that value and the start\n\t\t\ttop = selections[i].offsetTop - tab_start_top;\n\n\t\t\t//reduce the top based on the height\n\t\t\tif (top < (height * (-1)) + selection_area_height) {\n\t\t\t\ttop = (height * (-1)) + selection_area_height;\n\t\t\t}\n\t\t} else {\n\t\t\ttop = 0;\n\t\t}\n\n\t\t//update the top style of the element\n\t\tselections[i].style.top = top + \"px\";\n\t}\n\n}", "title": "" }, { "docid": "45d15f41b6d27c57456235b21a912b37", "score": "0.5374666", "text": "onViewRangeChanged() {\n this.viewRangeChanged.raise();\n }", "title": "" }, { "docid": "45d15f41b6d27c57456235b21a912b37", "score": "0.5374666", "text": "onViewRangeChanged() {\n this.viewRangeChanged.raise();\n }", "title": "" }, { "docid": "45d15f41b6d27c57456235b21a912b37", "score": "0.5374666", "text": "onViewRangeChanged() {\n this.viewRangeChanged.raise();\n }", "title": "" }, { "docid": "c50e95c600ad2c08bc7248e179a94552", "score": "0.5374358", "text": "function resizeNorth(e) {\n var calculateValue = false;\n var boundaryRectValues;\n var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n boundaryRectValues = getClientRectValues(containerElement);\n }\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {\n calculateValue = true;\n }\n else if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && pageY > 0) {\n calculateValue = true;\n }\n var currentHeight = originalHeight - (pageY - originalMouseY);\n if ((getClientRectValues(targetElement).bottom + currentHeight) > maxHeight) {\n calculateValue = false;\n targetElement.style.height = maxHeight - getClientRectValues(targetElement).bottom + 'px';\n }\n if (calculateValue) {\n if (currentHeight >= minHeight && currentHeight <= maxHeight) {\n var containerTop = 0;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerTop = boundaryRectValues.top;\n }\n var top_1 = (originalY - containerTop) + (pageY - originalMouseY);\n top_1 = top_1 > 0 ? top_1 : 1;\n targetElement.style.height = currentHeight + 'px';\n targetElement.style.top = top_1 + 'px';\n }\n }\n}", "title": "" }, { "docid": "d7dd83ec4e99059402e36258e287c4f0", "score": "0.5368662", "text": "setLayout(layout) {\n if (Layouts[layout]) {\n if (this.activeLayout !== layout) {\n if (LAYOUT_TO_COUNT[this.activeLayout] !== LAYOUT_TO_COUNT[layout]) {\n const counts = [\n LAYOUT_TO_COUNT[this.activeLayout],\n LAYOUT_TO_COUNT[layout],\n ].sort();\n for (let i = counts[0]; i < counts[1]; ++i) {\n this.triggerVisibilityChange(\n this.viewportList[i].renderer,\n i,\n layout\n );\n }\n }\n }\n this.activeLayout = layout;\n this.layoutFn = Layouts[layout];\n this.resize();\n //\n this.triggerChange();\n }\n }", "title": "" }, { "docid": "42354482e0321063657c2ea125670dae", "score": "0.5350839", "text": "[positionElements]() {\n\t\tconst self = this;\n\n\t\tif (!self.isRemoved) {\n\t\t\tlet baseWidth = self.innerWidth();\n\t\t\tconst textWidth = self.textWidth() || new CssSize(self.width().isAuto ? '14em' : HUNDRED_PERCENT);\n\n\t\t\tif (textWidth.toString() !== HUNDRED_PERCENT) {\n\t\t\t\tif (textWidth.isFixed) {\n\t\t\t\t\tbaseWidth = textWidth.toPixels(true);\n\t\t\t\t}\n\t\t\t\telse if (textWidth.isPercent) {\n\t\t\t\t\tbaseWidth *= textWidth.value / 100;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (self[PREFIX_WIDTH] || self[SUFFIX_WIDTH]) {\n\t\t\t\tbaseWidth -= Math.ceil(self[PREFIX_WIDTH] + self[SUFFIX_WIDTH]) + 1;\n\t\t\t}\n\n\t\t\tself[INPUT].width(baseWidth);\n\t\t}\n\t}", "title": "" }, { "docid": "9769079681615365ec6bbe0127b34ddf", "score": "0.5349312", "text": "recomputeTops() {\n const start = this.docs_[this.currDoc_].startSG;\n const num = this.docs_[this.currDoc_].numSG;\n let docRowRect = this.docs_[this.currDoc_].row.getBoundingClientRect();\n let pos = 0;\n for (let s = start; s < start + num; s++) {\n const tgtRect = this.tgtSpans[s].getBoundingClientRect();\n const srcRect = this.config.TARGET_SIDE_ONLY ? tgtRect :\n this.srcSpans[s].getBoundingClientRect();\n pos = Math.min(srcRect.top - docRowRect.top,\n tgtRect.top - docRowRect.top);\n const sg = this.segments_[s];\n sg.top = '' + pos + 'px';\n if (s == this.currSegment && this.evalPanel_) {\n this.evalPanel_.style.top = sg.top;\n }\n }\n // Make sure the table height is sufficient.\n const docEvalCell = this.docs_[this.currDoc_].eval;\n docEvalCell.style.height = '' + (pos + 600) + 'px';\n }", "title": "" }, { "docid": "ed90b7593bcad40e80be3be8653b479c", "score": "0.5340663", "text": "_reflow() {\n const {_first, _last, _scrollSize} = this;\n\n this._updateScrollSize();\n this._getActiveItems();\n\n if (this._scrollSize !== _scrollSize) {\n this._emitScrollSize();\n }\n\n if (this._first === -1 && this._last === -1) {\n this._emitRange();\n }\n else if (this._first !== _first || this._last !== _last || this._spacingChanged) {\n this._emitRange();\n this._emitChildPositions();\n } \n this._pendingReflow = null;\n }", "title": "" }, { "docid": "1d822b7141774273d65a3391065de5d8", "score": "0.5340539", "text": "contentSizeChanged_() {\n const zoomedDimensions = this.getZoomedDocumentDimensions_(this.zoom);\n if (zoomedDimensions) {\n this.sizer_.style.width = zoomedDimensions.width + 'px';\n this.sizer_.style.height =\n zoomedDimensions.height + this.topToolbarHeight_ + 'px';\n }\n }", "title": "" }, { "docid": "b9c62139599c453d0e9cb3383fb3381c", "score": "0.53388906", "text": "function setupScrollbarCornerEvents() {\n var insideIFrame =\n _windowElementNative.top !== _windowElementNative;\n var mouseDownPosition = {};\n var mouseDownSize = {};\n var mouseDownInvertedScale = {};\n var reconnectMutationObserver;\n\n function documentDragMove(event) {\n if (onMouseTouchDownContinue(event)) {\n var pageOffset = getCoordinates(event);\n var hostElementCSS = {};\n if (_resizeHorizontal || _resizeBoth)\n hostElementCSS[_strWidth] =\n mouseDownSize.w +\n (pageOffset.x - mouseDownPosition.x) *\n mouseDownInvertedScale.x;\n if (_resizeVertical || _resizeBoth)\n hostElementCSS[_strHeight] =\n mouseDownSize.h +\n (pageOffset.y - mouseDownPosition.y) *\n mouseDownInvertedScale.y;\n _hostElement.css(hostElementCSS);\n COMPATIBILITY.stpP(event);\n } else {\n documentMouseTouchUp(event);\n }\n }\n function documentMouseTouchUp(event) {\n var eventIsTrusted = event !== undefined;\n\n setupResponsiveEventListener(\n _documentElement,\n [\n _strSelectStartEvent,\n _strMouseTouchMoveEvent,\n _strMouseTouchUpEvent,\n ],\n [\n documentOnSelectStart,\n documentDragMove,\n documentMouseTouchUp,\n ],\n true\n );\n\n removeClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.releaseCapture)\n _scrollbarCornerElement.releaseCapture();\n\n if (eventIsTrusted) {\n if (reconnectMutationObserver) connectMutationObservers();\n _base.update(_strAuto);\n }\n reconnectMutationObserver = false;\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed\n ? false\n : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function getCoordinates(event) {\n return _msieVersion && insideIFrame\n ? { x: event.screenX, y: event.screenY }\n : COMPATIBILITY.page(event);\n }\n\n addDestroyEventListener(\n _scrollbarCornerElement,\n _strMouseTouchDownEvent,\n function (event) {\n if (onMouseTouchDownContinue(event) && !_resizeNone) {\n if (_mutationObserversConnected) {\n reconnectMutationObserver = true;\n disconnectMutationObservers();\n }\n\n mouseDownPosition = getCoordinates(event);\n\n mouseDownSize.w =\n _hostElementNative[LEXICON.oW] -\n (!_isBorderBox ? _paddingX : 0);\n mouseDownSize.h =\n _hostElementNative[LEXICON.oH] -\n (!_isBorderBox ? _paddingY : 0);\n mouseDownInvertedScale = getHostElementInvertedScale();\n\n setupResponsiveEventListener(\n _documentElement,\n [\n _strSelectStartEvent,\n _strMouseTouchMoveEvent,\n _strMouseTouchUpEvent,\n ],\n [\n documentOnSelectStart,\n documentDragMove,\n documentMouseTouchUp,\n ]\n );\n\n addClass(_bodyElement, _classNameDragging);\n if (_scrollbarCornerElement.setCapture)\n _scrollbarCornerElement.setCapture();\n\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n }\n );\n }", "title": "" }, { "docid": "c6ec8106dbd855695a2546090054d01c", "score": "0.5336026", "text": "_dragCancelCleanup() {\n // Revert viewport to original state\n if (this._dragInitialX) {\n var deltaX = this._component.getTimeZoomCanvas().getTranslateX() - this._dragInitialX;\n var deltaY = this._component.getTimeZoomCanvas().getTranslateY() - this._dragInitialY;\n if (deltaX !== 0 || deltaY !== 0) {\n var dragObj = this._keyboardDragObject\n ? this._keyboardDragObject\n : this.DragSource.getDragObject();\n if (this._component.isDiscreteNavigationMode()) {\n this._component.discreteScrollIntoViewport(dragObj);\n } else {\n this._component.panZoomCanvasBy(deltaX);\n // in case of rounding errors, explictly reset viewport start/end times\n this._component.setViewportStartTime(this._dragInitialViewportStart);\n this._component.setViewportEndTime(this._dragInitialViewportEnd);\n }\n }\n }\n\n this._dragInitialX = null;\n this._dragInitialY = null;\n this._dragInitialViewportStart = null;\n this._dragInitialViewportEnd = null;\n }", "title": "" }, { "docid": "dad88efbfd675a5147722cb29f758958", "score": "0.53270113", "text": "_determineLayout() {\n const client = this.el.nativeElement.getBoundingClientRect();\n this.dom.width.inner = client.width;\n this.dom.state.mobile = this.dom.width.inner <= 1340 ? true : false;\n if (this.dom.state.mobile) {\n this.tab.view.map((column) => {\n column.maxHeight = null;\n column.minHeight = null;\n });\n }\n else {\n this.tab.view.map((column) => {\n column.minHeight = column.header ? this.dom.height.inner - 50 : this.dom.height.inner;\n column.maxHeight = column.header ? this.dom.height.inner - 50 : this.dom.height.inner;\n });\n }\n // if( this.log.repo.enabled('dom', this.name) || this.extension.debug ) console.log(this.log.repo.message(`${this.name}:${this.tab.entityId}:_determineLayout:width:${this.dom.width.inner}: mobile: ${this.dom.state.mobile}`), this.log.repo.color('dom'));\n }", "title": "" }, { "docid": "57a3fc9a21f55b24004dfbaa978904e1", "score": "0.53255945", "text": "function resizeNorth(e) {\n var calculateValue = false;\n var boundaryRectValues;\n var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) {\n boundaryRectValues = getClientRectValues(containerElement);\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {\n calculateValue = true;\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement) && pageY > 0) {\n calculateValue = true;\n }\n var currentHeight = originalHeight - (pageY - originalMouseY);\n if ((getClientRectValues(targetElement).bottom + currentHeight) > maxHeight) {\n calculateValue = false;\n targetElement.style.height = maxHeight - getClientRectValues(targetElement).bottom + 'px';\n }\n if (calculateValue) {\n if (currentHeight >= minHeight && currentHeight <= maxHeight) {\n var containerTop = 0;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) {\n containerTop = boundaryRectValues.top;\n }\n var top_1 = (originalY - containerTop) + (pageY - originalMouseY);\n top_1 = top_1 > 0 ? top_1 : 1;\n targetElement.style.height = currentHeight + 'px';\n targetElement.style.top = top_1 + 'px';\n }\n }\n}", "title": "" }, { "docid": "4bee69559955fc0e06364f19fa287ab5", "score": "0.5317227", "text": "function StoreOldDimensions() \n {\n m_nOldContentWidth = m_nContentWidth;\n m_nOldContentHeight = m_nContentHeight;\n m_nOldContentTop = m_nContentTop;\n m_nOldContentLeft = m_nContentLeft;\n }", "title": "" }, { "docid": "817a2f5343ea8b00307dbca86fcbe2e4", "score": "0.5316949", "text": "function setToInitialSize(){\n $( \"#sidebar\" ).resizable({handles: 'e', \n containment: \"parent\", minWidth: MIN_WIDTH, \n start: function( event, ui ) {\n $( \"#sidebar\" ).resizable( \"option\", \"maxWidth\", \n $(\"#outerPanel\").width()\n - MIN_WIDTH - PAD_W\n - $( \"#tablePanel\" ).width() );\n }\n });\n $( \"#content\" ).resizable({handles: 'e', \n containment: \"parent\", minWidth: MIN_WIDTH, \n start: function( event, ui ) {\n $( \"#content\" ).resizable( \"option\", \"maxWidth\", \n $(\"#outerPanel\").width()\n - $( \"#sidebar\" ).width()\n - MIN_WIDTH - PAD_W );\n }\n }); \n\n //$(\"#visualisation\").draggable();\n $( \"#redraw\" ).draggable();\n bindResize(\"#sidebar\", \"#tablePanel\", '#content'); \n bindResize(\"#content\", \"#sidebar\", '#tablePanel'); \n\n $('#outerPanel')\n //.width(\"100%\")\n .height($(window).height() \n - $(\"header\").height() - $(\"footer\").height() - PAD_H );\n var quarter = ($(\"#outerPanel\").width()-PAD_W)/4;\n \n $('#content').width(quarter*2 + 2 ).height(\"100%\").css(\"margin-left\", \"4px\");\n\n \n $('#tablePanel').width(quarter).height(\"100%\");\n $('#sidebar').width(quarter).height(\"100%\");\n\n $('#visualisation').height($('#content').height() \n - $('#visToolbarTop').height() /*- $('#visToolbarBottom').height() */ - 10);\n $('#tablePanelInner').height($('#tablePanel').height() \n - $('#tableToolbarTop').height() - 10\n //- $('#tableToolbarBottom').height() \n //- $('#tableHeaderDisplay').height()\n );\n //defaultColourLegend\n $('#bars').height($('#sidebar').height() /*- $(\"#defaultColourLegend\").height()*/\n - $('#barsToolbar').height() -20 ); // 20 == 2 10px margins\n\n //$('header').width($(window).width()-PAD_W/2);\n //$('footer').width($(window).width()-PAD_W/2);\n\n $(\".panel\").removeClass('hidden').removeClass('closed').removeClass('maximised'); \n\n setColumnWidths();\n //$(\"#redraw\").click(); // do we want to automatically resize the wagon wheel?\n}", "title": "" }, { "docid": "804a17c74188269855e2a22369c64a3f", "score": "0.53159994", "text": "function resizeSouth(e) {\n var documentHeight = document.documentElement.clientHeight;\n var calculateValue = false;\n var containerRectValues;\n var coordinates = e.touches ? e.changedTouches[0] : e;\n var currentpageY = coordinates.pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n calculateValue = true;\n }\n else if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {\n calculateValue = true;\n }\n var calculatedHeight = originalHeight + (currentpageY - originalMouseY);\n calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;\n var containerTop = 0;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerTop = containerRectValues.top;\n }\n var borderValue = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;\n var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);\n topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;\n if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';\n return;\n }\n var targetTop = 0;\n if (calculateValue) {\n if (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {\n targetTop = targetRectValues.top;\n if ((calculatedHeight + targetTop) <= 30) {\n calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;\n }\n }\n if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {\n targetElement.style.height = targetRectValues.height +\n (documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';\n }\n var calculatedTop = (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) ? targetTop : topWithoutborder;\n if (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {\n targetElement.style.height = calculatedHeight + 'px';\n }\n }\n}", "title": "" }, { "docid": "8a89909b2795dc0931cc2608a3dd20f8", "score": "0.5306783", "text": "_updateScrollPosition() {\n if (!this.has_allocation())\n return;\n\n const adj = this._scrollAdjustment;\n const allowSwitch =\n adj.get_transition('value') === null && !this._gestureActive;\n\n let workspaceManager = global.workspace_manager;\n let active = workspaceManager.get_active_workspace_index();\n let current = Math.round(adj.value);\n\n if (allowSwitch && active !== current) {\n if (!this._workspaces[current]) {\n // The current workspace was destroyed. This could happen\n // when you are on the last empty workspace, and consolidate\n // windows using the thumbnail bar.\n // In that case, the intended behavior is to stay on the empty\n // workspace, which is the last one, so pick it.\n current = this._workspaces.length - 1;\n }\n\n let metaWorkspace = this._workspaces[current].metaWorkspace;\n metaWorkspace.activate(global.get_current_time());\n }\n\n if (adj.upper == 1)\n return;\n\n const vertical = workspaceManager.layout_rows === -1;\n const rtl = this.text_direction === Clutter.TextDirection.RTL;\n const progress = vertical || !rtl\n ? adj.value : adj.upper - adj.value;\n\n for (const ws of this._workspaces) {\n if (vertical)\n ws.translation_y = -progress * this.height;\n else\n ws.translation_x = -progress * this.width;\n }\n }", "title": "" }, { "docid": "80a23032fb0558767373ea364d003139", "score": "0.5299536", "text": "function adjustSelectionToVisibleSelection() {\n\t\t\t\tfunction findSelectionEnd(start, end) {\n\t\t\t\t\tvar walker = new TreeWalker(end);\n\t\t\t\t\tfor (node = walker.prev2(); node; node = walker.prev2()) {\n\t\t\t\t\t\tif (node.nodeType == 3 && node.data.length > 0) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adjust selection so that a end container with a end offset of zero is not included in the selection\n\t\t\t\t// as this isn't visible to the user.\n\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\tvar start = rng.startContainer;\n\t\t\t\tvar end = rng.endContainer;\n\n\t\t\t\tif (start != end && rng.endOffset === 0) {\n\t\t\t\t\tvar newEnd = findSelectionEnd(start, end);\n\t\t\t\t\tvar endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n\t\t\t\t\trng.setEnd(newEnd, endOffset);\n\t\t\t\t}\n\n\t\t\t\treturn rng;\n\t\t\t}", "title": "" }, { "docid": "80a23032fb0558767373ea364d003139", "score": "0.5299536", "text": "function adjustSelectionToVisibleSelection() {\n\t\t\t\tfunction findSelectionEnd(start, end) {\n\t\t\t\t\tvar walker = new TreeWalker(end);\n\t\t\t\t\tfor (node = walker.prev2(); node; node = walker.prev2()) {\n\t\t\t\t\t\tif (node.nodeType == 3 && node.data.length > 0) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adjust selection so that a end container with a end offset of zero is not included in the selection\n\t\t\t\t// as this isn't visible to the user.\n\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\tvar start = rng.startContainer;\n\t\t\t\tvar end = rng.endContainer;\n\n\t\t\t\tif (start != end && rng.endOffset === 0) {\n\t\t\t\t\tvar newEnd = findSelectionEnd(start, end);\n\t\t\t\t\tvar endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n\t\t\t\t\trng.setEnd(newEnd, endOffset);\n\t\t\t\t}\n\n\t\t\t\treturn rng;\n\t\t\t}", "title": "" }, { "docid": "cc092843969379049e4f3ddac11fcae7", "score": "0.52899283", "text": "didUpdateLayout(bucket, bounds) { }", "title": "" }, { "docid": "a3e127afa5d3398c41179e4463d7a1c4", "score": "0.52897483", "text": "$_elementQueryMixin_forceUpdate() {\n this.$_elementQueryMixin_resize();\n }", "title": "" }, { "docid": "cd72570ada77e333408ea54f8e343453", "score": "0.5288685", "text": "Reposition() {\r\n\t\tlet tPrevElems = this.HighlightedElements;\r\n\t\tthis.Highlight([]);\r\n\t\tthis.Highlight(tPrevElems);\r\n\t}", "title": "" }, { "docid": "ec0b6166e5bd198e36c974465c3c163f", "score": "0.5286689", "text": "_applySelection (): void {\n if (featureGetSelection && featureCreateRange) {\n let selection = this.editorState.selection\n\n if (!selection) {\n return\n }\n\n let range = document.createRange(),\n rangeStart: Position,\n rangeEnd: Position\n\n if (this._isRangeReversed(selection)) {\n rangeStart = selection.end\n rangeEnd = selection.start\n } else {\n rangeStart = selection.start\n rangeEnd = selection.end\n }\n\n let rangeStartRowElement = this._getRowElementByIndex(rangeStart.row),\n rangeEndRowElement = this._getRowElementByIndex(rangeEnd.row),\n side1, side2\n\n if (!rangeStartRowElement || !rangeEndRowElement) {\n return\n }\n\n // Set the range to the current cursor position to start with\n range.setStart(rangeStartRowElement, 0)\n range.collapse(true)\n\n function getRangeSide (node: Node, nodeStartColumn: number, sideColumn: number) {\n let side = null\n let nodeCharLength: number = 0\n // if (node instanceof Text) {\n if (node instanceof Text) {\n nodeCharLength = node.length\n }\n\n let nodeEndColumn = nodeStartColumn + nodeCharLength\n\n if (sideColumn >= nodeStartColumn && sideColumn <= nodeEndColumn) {\n // Found the text node where side column inside node\n side = {\n node,\n offset: sideColumn - nodeStartColumn\n }\n }\n // }\n\n return side\n }\n\n this._dfsTraverseNode((node: Node, row: number, column: number) => {\n if (node.childNodes.length === 0) {\n\n if (!side1 && row === rangeStart.row) {\n side1 = getRangeSide(node, column, rangeStart.column)\n if (side1) {\n range.setStart(side1.node, side1.offset)\n }\n }\n\n if (!side2 && row === rangeEnd.row) {\n side2 = getRangeSide(node, column, rangeEnd.column)\n if (side2) {\n range.setEnd(side2.node, side2.offset)\n }\n }\n\n if (side1 && side2) {\n return true\n }\n }\n })\n\n let sel = window.getSelection()\n sel.removeAllRanges()\n sel.addRange(range)\n }\n }", "title": "" }, { "docid": "25ff6554e4f5e9c74da1cfba15da6b4e", "score": "0.5283221", "text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }", "title": "" }, { "docid": "25ff6554e4f5e9c74da1cfba15da6b4e", "score": "0.5283221", "text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }", "title": "" }, { "docid": "79f9e7043796383e7a343cd38fc4fcc8", "score": "0.528219", "text": "function resizeSouth(e) {\n var documentHeight = document.documentElement.clientHeight;\n var calculateValue = false;\n var containerRectValues;\n var currentpageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) {\n calculateValue = true;\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {\n calculateValue = true;\n }\n var calculatedHeight = originalHeight + (currentpageY - originalMouseY);\n calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;\n var containerTop = 0;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) {\n containerTop = containerRectValues.top;\n }\n var borderValue = Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;\n var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);\n topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;\n if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';\n return;\n }\n var targetTop = 0;\n if (calculateValue) {\n if (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {\n targetTop = targetRectValues.top;\n if ((calculatedHeight + targetTop) <= 30) {\n calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;\n }\n }\n if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {\n targetElement.style.height = targetRectValues.height +\n (documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';\n }\n var calculatedTop = (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"S\" /* isNullOrUndefined */])(containerElement)) ? targetTop : topWithoutborder;\n if (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {\n targetElement.style.height = calculatedHeight + 'px';\n }\n }\n}", "title": "" }, { "docid": "9471c5598f07385ab4f99cabb61dd2d0", "score": "0.52765185", "text": "requestLayout() {\n this._layoutDirty = true;\n }", "title": "" }, { "docid": "5e5a03f89de2207a57520b9111aaf7c1", "score": "0.52640146", "text": "function inspectSelection()\n{\n // Call initializeUI() here; it's how the global variables get\n // initialized. The onLoad event on the body tag is never triggered\n // in inspectors.\n initializeUI();\n \n var dom = dw.getDocumentDOM();\n var selectedNode = dom.getSelectedNode(true, false, true);\n if (!canInspectSelection())\n return;\n\n var divId = selectedNode.id;\n // the ID\n WIDGET_ID.value = divId;\n \n var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);\n var widgetObj = widgetMgr.getWidget(\"Spry.Widget.Tooltip\", divId ); \n var widgetArgs = widgetObj.getConstructorArgs(\"Spry.Widget.Tooltip\"); \n\n if( !widgetObj || !widgetObj.isValidStructure() )\n {\n displayTopLayerErrorMessage(dw.loadString(\"spry/widget/alert/broken structure\"));\n return;\n }\n\n clearTopLayerErrorMessage();\n widgetObj.refresh();\n\n //exclude this tooltip's ID \n var triggers = widgetObj.getAllIds(divId); \n \n //update trigger list only if new items appeared in page\n var currValues = TRIGGER.getValue(\"all\");\n var needUpdate = false;\n if(triggers.length != currValues.length)\n {\n needUpdate = true;\n } \n for(var i=0; i<triggers.length; i++) \n {\n if (!currValues || (typeof(currValues[i]) != \"string\") || (triggers[i] != currValues[i])) {\n needUpdate = true;\n break;\n }\n }\n if (needUpdate) \n {\n TRIGGER.setAll(triggers, triggers);\n }\n TRIGGER.pickValue(widgetArgs[1].replace(/[\"']/g,''));\n \n OFFSET_X.setValue(widgetObj.getOption(\"offsetX\", \"\"));\n OFFSET_Y.setValue(widgetObj.getOption(\"offsetY\", \"\"));\n\n SHOW_DELAY.setValue(widgetObj.getOption(\"showDelay\", \"\"));\n HIDE_DELAY.setValue(widgetObj.getOption(\"hideDelay\", \"\"));\n \n FOLLOW_MOUSE.checkBox.checked = (widgetObj.getOption(\"followMouse\", false));\n CLOSE_TOOLTIP_LEAVE.checkBox.checked = (widgetObj.getOption(\"closeOnTooltipLeave\", false));\n USE_EFFECT.pickValue(widgetObj.getOption(\"useEffect\", \"none\").toLowerCase());\n}", "title": "" }, { "docid": "29adb55177efe28ae06fc171cda11d2f", "score": "0.52619815", "text": "_setSizes() {\n this._reelWidth = this._bodyNode.getBoundingClientRect().width;\n this._rollWidth = parseInt(\n this._children\n .reduce((prev, item) => prev + item.getBoundingClientRect().width, 0)\n .toFixed(),\n 10\n );\n this._maxPosition =\n -1 * parseInt((this._rollWidth - this._reelWidth).toFixed(), 10);\n\n const scopedPosition = this._getMinMaxPosition(this._position);\n if (scopedPosition !== this._position) {\n this._startAnimation(scopedPosition);\n }\n }", "title": "" }, { "docid": "e6cb811826c3856fcd0f132bb74b296b", "score": "0.5256938", "text": "function je(e,t){return Te(e).removeEventListener(\"resize\",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener(\"scroll\",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}", "title": "" }, { "docid": "6c665452b0adcb8ce86a1731d2ddbdab", "score": "0.5254188", "text": "function updateSelection() {\n // Default to negative space\n var currentRegion = { left: Number.MAX_VALUE, top: Number.MAX_VALUE, right: 0, bottom: 0 };\n\n var nodes = getSelectedNodes();\n selectedRegionList = [];\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n var node = nodes[i];\n\n // Select parents of text nodes that have contents\n if (node.nodeName === '#text' && node.nodeValue.trim()) {\n node = node.parentNode;\n }\n\n // Fetch the screen coordinates for this element\n var position = getScreenPosition(node);\n\n if (position.x == 0 && position.y == 0)\n continue;\n\n var x = position.x,\n y = position.y,\n w = node.offsetWidth,\n h = node.offsetHeight;\n\n // 1. offsetLeft works\n // 2. offsetWidth works\n // 3. Element is larger than zero pixels\n // 4. Element is not <br>\n if (node && typeof x === 'number' && typeof w === 'number' && ( w > 0 || h > 0 ) && !node.nodeName.match(/^br$/gi)) {\n currentRegion.left = Math.min(currentRegion.left, x);\n currentRegion.top = Math.min(currentRegion.top, y);\n currentRegion.right = Math.max(currentRegion.right, x + w);\n currentRegion.bottom = Math.max(currentRegion.bottom, y + h);\n }\n selectedRegionList.push({\n left: x,\n top: y,\n right: x + w,\n bottom: y + h\n });\n }\n // Start repainting if there is a selected region\n if (hasSelection()) {\n redraw();\n }\n }", "title": "" }, { "docid": "a5c982b53f552b9f9d6d496f773ca098", "score": "0.5249621", "text": "function fixLayout(){\n lognote('APP:Create Layout');\n var layout=(app.layout=new Object());\t\n layout.tabs=new Object();\t\n layout.row=new Object();\t\n layout.tabcell=null;\n var a=app.document.body.childNodes;\n for(var i=0;i<a.length;i++){\n if(!a[i].className || a[i].className.split(' ')[0]!='layout') continue;\n var ch=a[i].firstChild;\n if(!ch) continue;\n if(ch.nodeName=='#text') ch=ch.nextSibling;\n var page=a[i].getAttribute('page');\n var pos=(a[i].getAttribute('pos')).split('');\n\n // Setting up pages in app.layout[page]\n var lay=(page?layout.tabs[page]:layout);\n if(!lay){\n \tlay=(layout.tabs[page]=new Object());\n lay.row=new Object();\n }\n // Setting up rows in layout[page].rows[row]\n var row=lay.row[pos[0]];\n if(!row){\n \trow=(lay.row[pos[0]]=new Object());\n row.col=new Object();\n }\n row.col[pos[1]]=a[i]; // Setting elements in layout[page].rows[row].col[col]\n \n // Setting minimum size\n var min=ch.getAttribute('min');\n if(min){\n min=(min+',').split(',');\n\t\t a[i].style.width=min[0]+'px';\n\t\t a[i].style.height=min[1]+'px';\n\t\t a[i].setAttribute('min',min);\n }\n // Setting grow attribute for objects\n if(ch.getAttribute('tabs')) layout.tabcell=a[i];\n a[i].setAttribute('growx',ch.getAttribute('resize')?'yes':'no');\n a[i].setAttribute('growy',ch.getAttribute('resize')=='resize'?'yes':'no');\n }\t\n\n // Sort the rows and columns into a sort arrays per tab and main grid\n for(var p in layout.tabs) sortCells(layout.tabs[p]);\n sortCells(layout);\n \n function sortCells(tab){\n tab.sortrow=[];\n for(var i in tab.row){ // each row\n tab.sortrow.push(i);\n var l=tab.row[i];\n l.sortcol=[]; // each column\n for(var j in l.col) l.sortcol.push(j); \n l.sortcol.sort();\n }\n tab.sortrow.sort();\n } \n}", "title": "" }, { "docid": "ab9120203bf9d1b4b4e976f0cf86e38e", "score": "0.52478105", "text": "function startRepositioningOnResize(){var repositionMenu=function(target,options){return $$rAF.throttle(function(){if(opts.isRemoved)return;var position=calculateMenuPosition(target,options);target.css(animator.toCss(position));});}(element,opts);$window.addEventListener('resize',repositionMenu);$window.addEventListener('orientationchange',repositionMenu);return function stopRepositioningOnResize(){// Disable resizing handlers\n$window.removeEventListener('resize',repositionMenu);$window.removeEventListener('orientationchange',repositionMenu);};}", "title": "" }, { "docid": "b3757381a63f3cea5082aa9af0708563", "score": "0.5246349", "text": "transformSelection(deltaX, deltaY) {\n // validate bounds of selection\n const editorBorderWidth = 2;\n if ((deltaX > 0 && this.selectionBounds.right + deltaX >= this.editorWidth - editorBorderWidth) // right exceeded\n ||\n (deltaX < 0 && this.selectionBounds.left + deltaX <= 0) // left exceeded\n ||\n (deltaY > 0 && this.selectionBounds.bottom + deltaY >= this.editorHeight - editorBorderWidth) // bottom exceeded\n ||\n (deltaY < 0 && this.selectionBounds.top + deltaY <= 0) // top exceeded\n ) {\n return;\n }\n this.selection.forEach(obj => {\n obj.x += deltaX;\n obj.y += deltaY;\n obj.element.style.left = `${this.extractStyleNumber(obj.element.style.left) + deltaX}px`;\n obj.element.style.top = `${this.extractStyleNumber(obj.element.style.top) + deltaY}px`;\n this.redraw();\n });\n this.selectionBounds.left += deltaX;\n this.selectionBounds.right += deltaX;\n this.selectionBounds.top += deltaY;\n this.selectionBounds.bottom += deltaY;\n }", "title": "" }, { "docid": "ca6095c805383ebef8e33cb0b0246635", "score": "0.52419907", "text": "_setLayout() {\n const editor = this._editor;\n const panel = this._panel;\n const state = this._state;\n editor.state = state.container;\n // Allow the message queue (which includes fit requests that might disrupt\n // setting relative sizes) to clear before setting sizes.\n requestAnimationFrame(() => {\n panel.setRelativeSizes(state.sizes);\n });\n }", "title": "" }, { "docid": "53fed85e104500d7b8f5d9acb5a4e137", "score": "0.5241427", "text": "didRenderLayout(bucket, bounds) { }", "title": "" }, { "docid": "7b99d82bc0f7370a735bf20e6af72feb", "score": "0.52295333", "text": "function Positioner(args) {\n\tvar winSize = $('dv_root').getDimensions();\n\tvar sidebarWidth = 0;\n\tif ($('dv_sidebar')) {\n\t\tif (DV_shownSideElement)\n\t\t\tsidebarWidth = $('dv_sidebar').getWidth() + DV_shownSideElement.getWidth();\n\t\telse\n\t\t\tsidebarWidth = $('dv_sidebar').getWidth();\n\t}\n\tvar navbarHeight = 0;\n\tif ($('dv_navbar'))\n\t\tnavbarHeight = $('dv_navbar').getHeight();\n\tvar elem = $('dv_page_cont');\n\tvar elemPos = findPos(elem);\n\tvar w = elem.getWidth();\n\tvar h = elem.getHeight();\n\t// for a new page\n\tif (args['sender']=='new') {\n\t\tif (w < winSize['width'] - sidebarWidth)\n\t\t\telem.style.left = ((winSize['width'] + sidebarWidth - w) / 2) + 'px';\n\t\telse\n\t\t\telem.style.left = sidebarWidth + 'px';\n\t\tif (h < winSize['height'] - navbarHeight)\n\t\t\telem.style.top = ((winSize['height'] + navbarHeight - h) / 2) + 'px';\n\t\telse\n\t\t\telem.style.top = navbarHeight + 'px';\n\t};\n\t// mouse wheel + panel zoom\n\tif (args['sender']=='wheel' || args['sender']=='panel') {\n\t\tvar new_left = (winSize['width']/2 - sidebarWidth/2 - w/args['old_width'] * (winSize['width']/2 - sidebarWidth/2 - elemPos['left']));\n\t\tvar new_top = (winSize['height']/2 - navbarHeight/2 - h/args['old_height'] * (winSize['height']/2 - navbarHeight/2 - elemPos['top']));\n\t\t// correct false positioning\n\t\tif (w < winSize['width']) {\n\t\t\tif (new_left < sidebarWidth)\n\t\t\t\telem.style.left = sidebarWidth + 'px';\n\t\t\telse if (new_left + w > winSize['width'])\n\t\t\t\telem.style.left = (winSize['width'] - w) + 'px';\n\t\t\telse\n\t\t\t\telem.style.left = new_left + 'px';\n\t\t } else {\n\t\t\tif (new_left < winSize['width'] - w)\n\t\t\t\telem.style.left = (winSize['width'] - w) + 'px';\n\t\t\telse if (new_left > sidebarWidth)\n\t\t\t\telem.style.left = sidebarWidth + 'px';\n\t\t\telse\n\t\t\t\telem.style.left = new_left + 'px';\n\t\t};\n\t\tif (h < winSize['height']) {\n\t\t\tif (new_top < navbarHeight)\n\t\t\t\telem.style.top = navbarHeight + 'px';\n\t\t\telse if (new_top + h > winSize['height'])\n\t\t\t\telem.style.top = (winSize['height'] - h) + 'px';\n\t\t\telse\n\t\t\t\telem.style.top = new_top + 'px';\n\t\t} else {\n\t\t\tif (new_top < winSize['height'] - h)\n\t\t\t\telem.style.top = (winSize['height'] - h) + 'px';\n\t\t\telse if (new_top > navbarHeight)\n\t\t\t\telem.style.top = navbarHeight + 'px';\n\t\t\telse\n\t\t\t\telem.style.top = new_top + 'px';\n\t\t};\n\t};\n\t// fire event to show the page\n\t$('dv_root').fire(\"page:ready\");\n}", "title": "" }, { "docid": "1d51a324a93ea9a325fd37b80eaed4de", "score": "0.5226536", "text": "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "title": "" }, { "docid": "89ad69ee22b6d106e192051e55221c59", "score": "0.5215452", "text": "rerenderDOMSelection () {\n if (this.isDisabled()) return\n if (platform.inBrowser) {\n // console.log('Surface.rerenderDOMSelection', this.__id__);\n const sel = this.getEditorSession().getSelection()\n if (sel.surfaceId === this.getId()) {\n this.domSelection.setSelection(sel)\n // TODO: remove this HACK\n const scrollPane = this.context.scrollPane\n if (scrollPane && scrollPane.onSelectionPositioned) {\n console.error('DEPRECATED: you should manage the scrollPane yourself')\n scrollPane.onSelectionPositioned()\n }\n }\n }\n }", "title": "" }, { "docid": "d0e8be4aac4d178063312cf63096097c", "score": "0.52148885", "text": "function Evme_dndManager() {\n\n // the dragging arena (container)\n // currently hard coded for collections for simplicity\n var dndContainerEl = document.getElementById('collection');\n\n // initial coordinates\n var sx, sy;\n\n // coordinates updated with every touch move\n var cx, cy;\n\n // the element we want to drag\n var originNode;\n\n // the common parent of the nodes we are organizing\n var parentNode;\n\n // child nodes of parentNode\n // we store a mutable copy for keeping track of temporary ordering while\n // dragging without actually changing the DOM\n var children;\n\n // the dragged node will be inserted before this node\n var insertBeforeNode;\n\n // the 'cloned' element that is visually dragged on screen\n var draggableEl;\n\n // the element we are dragging over\n // triggeres the re-arrange\n var targetNode;\n\n // position of targetNode when triggering re-arrange\n var targetIndex;\n\n // flags that nodes are shifted from original positions\n var shifted = false;\n\n // callback to execute after rearranging\n var rearrangeCb;\n\n // currently animating nodes\n var animatingNodes;\n\n var hoverTimeout = null;\n\n var cleanupTimeout = null;\n\n // delay after which cleanup will be triggered in case something went wrong\n // note: we don't want to fire too early to allow normal-flow cleanup after\n // animations have ended\n var DEFAULT_CLEANUP_DELAY = 1200;\n\n // constants\n var HOVER_DELAY = Page.prototype.REARRANGE_DELAY;\n var DRAGGING_TRANSITION = Page.prototype.DRAGGING_TRANSITION;\n var ICONS_PER_ROW = Page.prototype.ICONS_PER_ROW;\n\n // support mouse events for simulator and desktopb2g\n var isTouch = 'ontouchstart' in window;\n var touchmove = isTouch ? 'touchmove' : 'mousemove';\n var touchend = isTouch ? 'touchend' : 'mouseup';\n\n var getTouch = (function getTouchWrapper() {\n return isTouch ? function(e) { return e.touches[0] } :\n function(e) { return e };\n })();\n\n /**\n * touchmove handler\n *\n * - move draggable element\n * - trigger rearrange preview if hovering on sibling longer than HOVER_DELAY\n */\n function onMove(evt) {\n evt.preventDefault();\n\n cx = getTouch(evt).pageX;\n cy = getTouch(evt).pageY;\n\n window.mozRequestAnimationFrame(moveDraggable);\n\n var elFromPoint = document.elementFromPoint(cx, cy);\n\n // avoid triggering duplicated events -\n // same target at same location, do nothing\n if (elFromPoint === targetNode &&\n children.indexOf(elFromPoint) === targetIndex) {\n return;\n }\n\n targetNode = elFromPoint;\n\n if (hoverTimeout) {\n clearTimeout(hoverTimeout);\n }\n\n // dragging within parent bounds\n if (targetNode.parentNode === parentNode) {\n // on sibling - re-arrange\n if (targetNode !== originNode) {\n targetIndex = children.indexOf(targetNode);\n hoverTimeout = setTimeout(shiftNodes, HOVER_DELAY);\n }\n }\n }\n\n // touchend handler\n function onEnd() {\n window.removeEventListener(touchmove, onMove);\n window.removeEventListener(touchend, onEnd);\n\n if (hoverTimeout) {\n clearTimeout(hoverTimeout);\n }\n\n // make sure cleanup will be performed\n // normally rearrage/revert will call it\n cleanupTimeout = setTimeout(cleanup, DEFAULT_CLEANUP_DELAY);\n if (shifted) {\n rearrange();\n } else {\n revert();\n }\n }\n\n function moveDraggable() {\n draggableEl.style.MozTransform =\n 'translate(' + (cx - sx) + 'px,' + (cy - sy) + 'px)';\n }\n\n // 'preview mode' - move nodes to where they would end up when dropping\n // the dragged icon on targetNode\n function shiftNodes() {\n // animation already in progress - abort\n if (animatingNodes.length) {\n return;\n }\n\n shifted = true;\n\n var originIndex = children.indexOf(originNode);\n var targetIndex = children.indexOf(targetNode);\n\n if (originIndex < 0 || targetIndex < 0) {\n return;\n }\n\n var forward = originIndex < targetIndex;\n insertBeforeNode = forward ? targetNode.nextSibling : targetNode;\n\n // translate nodes to new positions\n // originNode is translated ** WITHOUT ** transition\n translateNode(originNode, originIndex, targetIndex);\n\n if (forward) {\n for (var i = originIndex + 1; i <= targetIndex; i++) {\n translateNode(children[i], i, i - 1, DRAGGING_TRANSITION);\n }\n } else {\n for (var i = targetIndex; i < originIndex; i++) {\n translateNode(children[i], i, i + 1, DRAGGING_TRANSITION);\n }\n }\n\n function translateNode(node, from, to, transition) {\n if (!node) {\n return;\n }\n\n var x = node.dataset.posX = parseInt(node.dataset.posX || 0) +\n ((Math.floor(to % ICONS_PER_ROW) -\n Math.floor(from % ICONS_PER_ROW)) * 100);\n var y = node.dataset.posY = parseInt(node.dataset.posY || 0) +\n ((Math.floor(to / ICONS_PER_ROW) -\n Math.floor(from / ICONS_PER_ROW)) * 100);\n\n if (transition) {\n animatingNodes.push(node);\n\n node.addEventListener('transitionend', function tEnd() {\n node.removeEventListener('transitionend', tEnd);\n animatingNodes.splice(animatingNodes.indexOf(node), 1);\n\n // animations ended, update children ordering to reflect shifting\n if (animatingNodes.length === 0) {\n children.splice(originIndex, 1);\n children.splice(targetIndex, 0, originNode);\n }\n });\n\n window.mozRequestAnimationFrame(function() {\n node.style.MozTransition = transition;\n node.style.MozTransform = 'translate(' + x + '%, ' + y + '%)';\n });\n\n } else {\n node.style.MozTransform = 'translate(' + x + '%, ' + y + '%)';\n }\n }\n }\n\n function clearTranslate() {\n for (var i = 0, node; node = children[i++]; ) {\n node.style.MozTransform = node.style.MozTransition = '';\n delete node.dataset.posX;\n delete node.dataset.posY;\n }\n\n // restore original order\n children = Array.prototype.slice.call(parentNode.childNodes);\n shifted = false;\n }\n\n // update DOM with new node ordering\n function rearrange() {\n // animate draggableEl to the new location\n var rect = originNode.getBoundingClientRect();\n var x = rect.left - draggableEl.dataset.initX;\n var y = rect.top - draggableEl.dataset.initY;\n\n animateDraggable(x, y, function onEnd() {\n // cancel transitions to avoid flickering\n parentNode.dataset.rearranging = true;\n\n setTimeout(function() {\n // clear translations and update the DOM on the same tick\n clearTranslate();\n parentNode.insertBefore(originNode, insertBeforeNode);\n shrink();\n cleanup();\n\n setTimeout(function() {\n // next tick\n delete parentNode.dataset.rearranging;\n\n // call callback with new index of originNode\n var newIndex =\n Array.prototype.indexOf.call(parentNode.childNodes, originNode);\n\n if (newIndex > -1) {\n rearrangeCb(newIndex);\n }\n });\n });\n });\n }\n\n // move draggableEl back to original location\n function revert() {\n animateDraggable(0, 0, cleanup);\n }\n\n // animate draggableEl to x,y then execute callback\n function animateDraggable(x, y, callback) {\n dndContainerEl.dataset.transitioning = true;\n draggableEl.style.MozTransition = '-moz-transform .4s';\n draggableEl.style.MozTransform = 'translate(' + x + 'px,' + y + 'px)';\n shrink();\n\n draggableEl.addEventListener('transitionend', function tEnd(e) {\n e.target.removeEventListener('transitionend', tEnd);\n delete dndContainerEl.dataset.transitioning;\n callback();\n });\n }\n\n function shrink() {\n var divContainer = draggableEl.querySelector('div');\n divContainer.style.MozTransform = 'scale(1)';\n }\n\n function cleanup() {\n clearTimeout(cleanupTimeout);\n\n delete dndContainerEl.dataset.dragging;\n delete originNode.dataset.dragging;\n\n if (draggableEl) {\n dndContainerEl.removeChild(draggableEl);\n }\n draggableEl = null;\n }\n\n // create cloned draggable grid-like element from an E.me li element\n function initDraggable() {\n draggableEl = document.createElement('div');\n draggableEl.className = 'draggable';\n\n var container = document.createElement('div');\n var img = originNode.querySelector('img').cloneNode();\n var labelWrapper = document.createElement('span');\n var label = document.createElement('span');\n\n // E.me renders the name using canvas but here we need text\n // we get it from originNode's dataset\n labelWrapper.className = 'labelWrapper';\n label.textContent = originNode.dataset.name;\n labelWrapper.appendChild(label);\n\n container.appendChild(img);\n container.appendChild(labelWrapper);\n draggableEl.appendChild(container);\n\n var rect = originNode.getBoundingClientRect();\n draggableEl.dataset.initX = rect.left;\n draggableEl.dataset.initY = rect.top;\n draggableEl.style.left = rect.left + 'px';\n draggableEl.style.top = rect.top + 'px';\n }\n\n /**\n * Start dragging an E.me static app inside a Collection for re-ordering\n * @param {DOM element} node\n * @param {MouseEvent} contextMenuEvent 'contextmenu' event\n * @param {Function} cb callback to execute after rearrange\n * receives the new index of node as parameter\n */\n this.start = function start(node, contextMenuEvent, cb) {\n originNode = node;\n parentNode = originNode.parentNode;\n targetNode = originNode;\n\n children = Array.prototype.slice.call(parentNode.childNodes);\n animatingNodes = [];\n\n // remove leftover draggable elements (normally, there shouldn't be any)\n Array.prototype.forEach.call(dndContainerEl.querySelectorAll('.draggable'),\n function removeNode(node) {\n dndContainerEl.removeChild(node);\n });\n\n // fresh start, avoid cleanup if one is scheduled\n clearTimeout(cleanupTimeout);\n\n dndContainerEl.dataset.dragging = true;\n originNode.dataset.dragging = true;\n\n window.addEventListener(touchmove, onMove);\n window.addEventListener(touchend, onEnd);\n\n initDraggable();\n dndContainerEl.appendChild(draggableEl);\n\n // save start position\n sx = contextMenuEvent.pageX;\n sy = contextMenuEvent.pageY;\n\n // set callback\n rearrangeCb = cb || Evme.Utils.NOOP;\n };\n\n this.stop = function stop() {\n rearrangeCb = Evme.Utils.NOOP;\n cleanup();\n };\n}", "title": "" }, { "docid": "765812d95e4c645836a789fb2b554603", "score": "0.52135515", "text": "static GetFlowLayoutedRects() {}", "title": "" }, { "docid": "bd1da7dea3c180617921e02d84606aa5", "score": "0.5210055", "text": "storeDOMState() {\n let sel = this.pm.root.getSelection()\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset\n this.lastHeadNode = sel.focusNode; this.lastHeadOffset = sel.focusOffset\n }", "title": "" }, { "docid": "87b66cfee6b98f8be2a9d4f54a1ac2fa", "score": "0.52095217", "text": "function updateDOM() {\n\n\t \t var dragRange, // is the user dragging the entire range and not just one knob?\n lowValueOffset, // where did the low knob start\n highValueOffset, // where did the high knob start\n pointer, // which knob/bar is being dragged\n ref; // which value should we be changing\n\n\t \t // update the dimensions\n\t \t dimensions();\n\n\t \t // set the limit bubble positions\n\t \t offset(refs.flrBub, 0);\n\t \t offset(refs.ceilBub, pixelize(barWidth - width(refs.ceilBub)));\n\n\t \t /**\n * Get the offset percentage from the given absolute offset\n * @param {number} offset\n * @returns {number}\n */\n\t \t function percentFromOffset(offset) {\n\t \t return ((offset - minOffset) / offsetRange) * 100;\n\t \t }\n\n\t \t /**\n * Get the decoded value from the given offset\n * @param {number} offset\n * @returns {number}\n */\n\t \t function decodedValueFromOffset(offset) {\n\t \t return percentFromOffset(offset) / 100 * valueRangeDecoded + minValueDecoded;\n\t \t }\n\n\t \t /**\n * Get the value from the given offset\n * @param {number} offset\n * @returns {number}\n */\n\t \t function valueFromOffset(offset) {\n\t \t return scope.encode(decodedValueFromOffset(offset));\n\t \t }\n\n\t \t /**\n * Get the absolute offset from the given decoded value\n * @param {number} value\n * @returns {number}\n */\n\t \t function offsetFromDecodedValue(value) {\n\t \t return ((value - minValueDecoded) * offsetRange) + minOffset;\n\t \t }\n\n\t \t /**\n * Get the absolute offset from the given value\n * @param {number} value\n * @returns {number}\n */\n\t \t function offsetFromValue(value) {\n\t \t return offsetFromDecodedValue(scope.decode(value));\n\t \t }\n\n\t \t /**\n * Get the offset percentage from the given decoded value\n * @param {number} value\n * @returns {number}\n */\n\t \t function percentFromDecodedValue(value) {\n\t \t var percent = value - minValueDecoded;\n\t \t if (valueRange == valueRangeDecoded) {\n\t \t percent = roundTo(percent, scope.decodedValues[stepWidth]) / stepRange;\n\t \t } else {\n\t \t percent /= valueRangeDecoded;\n\t \t }\n\t \t return percent * 100;\n\t \t }\n\n\t \t /**\n * Get the offset percentage from the given value\n * @param {number} value\n * @returns {number}\n */\n\t \t function percentFromValue(value) {\n\t \t return percentFromDecodedValue(scope.decode(value));\n\t \t }\n\n\t \t /**\n * Get the absolute offset (in px) from the given offset percentage\n * @param {number} percent\n * @returns {string}\n */\n\t \t function offsetFromPercent(percent) {\n\t \t return pixelize(percent * offsetRange / 100);\n\t \t }\n\n\t \t /**\n * Bring the offset back in range of the slider\n * @param {number} offset\n * @returns {number}\n */\n\t \t function bringOffsetInRange(offset) {\n\t \t return Math.min(Math.max(offset, minOffset), maxOffset);\n\t \t }\n\n\t \t /**\n * Bring the element back within the confines of the slider\n * @param {object} element\n * @returns {Object}\n */\n\t \t function fitToBar(element) {\n\t \t return offset(element, offsetFromPercent(percentFromOffset(bringOffsetInRange(offsetLeft(element)))));\n\t \t }\n\n\t \t /**\n * Compute the amount of stretch\n * @param {number} percent the mouse offset from the start position\n * @param {number} [maxPercent = 100] the maximum stretch\n * @param {boolean} [end = false] are we beyond the max stretch?\n * @returns {number}\n */\n\t \t function percentStretch(percent, maxPercent, end) {\n\n\t \t // which direction?\n\t \t var sign = percent > 0 ? 1 : -1;\n\n\t \t // if the maxPercent is 0 or not given apply no limit (i.e. set it to 100)\n\t \t maxPercent = !maxPercent ? 100 : maxPercent;\n\n\t \t if (end) {\n\t \t // compute the max stretch amount\n\t \t return (\n Math.sin((\n Math.min(Math.abs(percent / maxPercent), 1) * Math.PI\n ) - (Math.PI / 2)) + 1\n ) * sign * maxPercent / 6;\n\t \t }\n\n\t \t // compute the current stretch amount\n\t \t return (\n sign * Math.pow(Math.min(Math.abs(percent / maxPercent * 2), 1), scope.stickiness) * maxPercent / 2\n );\n\t \t }\n\n\t \t /**\n * Update the pointers in the DOM\n */\n\t \t function setPointers() {\n\n\t \t /**\n * The base percent for the low knob\n * @type {number}\n */\n\t \t var rawLowPercent = percentFromDecodedValue(scope.decodedValues[refLow]);\n\n\t \t /**\n * The width in percent of a step above the low value\n * @type {number}\n */\n\t \t var stepWidthPercentAboveLow = percentFromValue(scope[refLow] + scope[stepWidth]) - rawLowPercent;\n\n\t \t /**\n * The width in percent of a step below the low value\n * @type {number}\n */\n\t \t var stepWidthPercentBelowLow = rawLowPercent - percentFromValue(scope[refLow] - scope[stepWidth]);\n\n\t \t /**\n * The width in percent of the buffer above the low value\n * @type {number}\n */\n\t \t var bufferWidthPercentLow = percentFromValue(scope[refLow] + scope.buffer) - rawLowPercent;\n\n\t \t /**\n * The width in percent of the pointer\n * @type {number}\n */\n\t \t var ptrHalfWidthPercent = percentFromOffset(pointerHalfWidth + minOffset);\n\n\t \t /**\n * The percent for the low knob after the stretch has been applied\n * @type {number}\n */\n\t \t var stretchedLowPercent = rawLowPercent + percentStretch(stickyOffsetLow, stickyOffsetLow > 0 ? stepWidthPercentAboveLow : stepWidthPercentBelowLow);\n\n\t \t // set the low knob's and bubble's new positions\n\t \t offset(refs.minPtr, offsetFromPercent(stretchedLowPercent));\n\t \t offset(refs.lowBub,\n offsetFromPercent(percentFromOffset(offsetLeft(refs.minPtr) - halfWidth(refs.lowBub) + pointerHalfWidth)));\n\n\t \t if (isDualKnob) {\n\t \t // dual knob slider\n\n\t \t /**\n * The base percent for the high knob\n * @type {number}\n */\n\t \t var rawHighPercent = percentFromDecodedValue(scope.decodedValues[refHigh]);\n\n\t \t /**\n * The width in percent of a step above the high value\n * @type {number}\n */\n\t \t var stepWidthPercentAboveHigh = percentFromValue(scope[refHigh] + scope[stepWidth]) - rawHighPercent;\n\n\t \t /**\n * The width in percent of a step below the high value\n * @type {number}\n */\n\t \t var stepWidthPercentBelowHigh = rawHighPercent - percentFromValue(scope[refHigh] - scope[stepWidth]);\n\n\t \t /**\n * The width in percent of the buffer below the high value\n * @type {number}\n */\n\t \t var bufferWidthPercentHigh = rawHighPercent - percentFromValue(scope[refHigh] - scope.buffer);\n\n\t \t /**\n * The percent for the high knob after the stretch has been applied\n * @type {number}\n */\n\t \t var stretchedHighPercent = rawHighPercent + percentStretch(stickyOffsetHigh, stickyOffsetHigh > 0 ? stepWidthPercentAboveHigh : stepWidthPercentBelowHigh);\n\n\t \t if (stretchedLowPercent > rawHighPercent - bufferWidthPercentHigh) {\n\t \t // if the low knob has reached its maximum\n\n\t \t // get the new stretch amount for the low knob\n\t \t stretchedLowPercent = rawLowPercent + percentStretch(stickyOffsetLow, bufferWidthPercentLow, true);\n\n\t \t // and re-set the low knob's and bubble's new positions\n\t \t offset(refs.minPtr, offsetFromPercent(stretchedLowPercent));\n\t \t offset(refs.lowBub, offsetFromPercent(percentFromOffset(offsetLeft(refs.minPtr) - halfWidth(refs.lowBub) +\n pointerHalfWidth)));\n\t \t }\n\n\t \t if (stretchedHighPercent < rawLowPercent + bufferWidthPercentLow) {\n\t \t // if the high knob has reached its minimum\n\n\t \t // get the new stretch amount for the high knob\n\t \t stretchedHighPercent = rawHighPercent + percentStretch(stickyOffsetHigh, bufferWidthPercentHigh, true);\n\t \t }\n\n\t \t // set the high knob's and bubble's new positions\n\t \t offset(refs.maxPtr, offsetFromPercent(stretchedHighPercent));\n\t \t offset(refs.highBub, offsetFromPercent(percentFromOffset(offsetLeft(refs.maxPtr) - halfWidth(refs.highBub) +\n pointerHalfWidth)));\n\n\t \t // set the selection bar's new position and width\n\t \t offset(refs.selBar, offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent));\n\t \t refs.selBar.css({\n\t \t width: offsetFromPercent(stretchedHighPercent - stretchedLowPercent)\n\t \t });\n\n\t \t // set the selection bubbles' new positions\n\t \t offset(refs.selBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.selBub) + minOffset) + ptrHalfWidthPercent));\n\t \t offset(refs.cmbBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.cmbBub) + minOffset) + ptrHalfWidthPercent));\n\n\t \t // set the low unselected bar's new position and width\n\t \t refs.unSelBarLow.css({\n\t \t left: 0,\n\t \t width: offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent)\n\t \t });\n\n\t \t // set the high unselected bar's new position and width\n\t \t offset(refs.unSelBarHigh, offsetFromPercent(stretchedHighPercent + ptrHalfWidthPercent));\n\t \t refs.unSelBarHigh.css({\n\t \t right: 0\n\t \t });\n\n\t \t if (AngularSlider.inputtypes.range) {\n\t \t // we're using range inputs\n\n\t \t var ptrWidth = ptrHalfWidthPercent * 2;\n\n\t \t // get the high input's new position\n\t \t var highInputLeft = stretchedLowPercent + (bufferWidthPercentLow / 2);\n\t \t var highInputWidth = 100 - highInputLeft;\n\t \t highInputLeft += ptrWidth;\n\n\t \t // get the low input's new width\n\t \t var lowInputWidth = stretchedHighPercent - (bufferWidthPercentHigh / 2);\n\n\t \t // get the selection inputs new position and width;\n\t \t var selInputLeft = stretchedLowPercent + ptrWidth;\n\t \t var selInputWidth = stretchedHighPercent - stretchedLowPercent - ptrWidth;\n\n\t \t if (stretchedHighPercent <= stretchedLowPercent + ptrWidth) {\n\t \t selInputLeft = stretchedLowPercent;\n\t \t selInputWidth = stretchedHighPercent + ptrWidth - stretchedLowPercent;\n\t \t }\n\n\t \t // set the low input's new width\n\t \t refs.minInput.css({\n\t \t width: offsetFromPercent(lowInputWidth)\n\t \t });\n\n\t \t // set the high input's new position and width\n\t \t refs.maxInput.css({\n\t \t left: offsetFromPercent(highInputLeft),\n\t \t width: offsetFromPercent(highInputWidth)\n\t \t });\n\n\t \t // set the selection input's new position and width\n\t \t refs.selInput.css({\n\t \t left: offsetFromPercent(selInputLeft),\n\t \t width: offsetFromPercent(selInputWidth)\n\t \t });\n\t \t }\n\t \t }\n\t \t }\n\n\t \t /**\n * Update the bubbles in the DOM\n */\n\t \t function adjustBubbles() {\n\n\t \t /**\n * The bubble to use for dual knobs\n * @type {object}\n */\n\t \t var bubToAdjust = refs.lowBub;\n\n\t \t // make sure the low value bubble is actually within the slider\n\t \t fitToBar(refs.lowBub);\n\n\t \t if (isDualKnob) {\n\t \t // this is a dual knob slider\n\n\t \t // make sure the high value and selection value bubbles are actually within the slider\n\t \t fitToBar(refs.highBub);\n\t \t fitToBar(refs.selBub);\n\n\t \t if (gap(refs.lowBub, refs.highBub) < 10) {\n\t \t // the low and high bubbles are overlapping\n\n\t \t // so hide them both\n\t \t hide(refs.lowBub);\n\t \t hide(refs.highBub);\n\n\t \t // and show the center bubble\n\t \t show(refs.cmbBub);\n\n\t \t // and make sure the center bubble is actually within the slider\n\t \t fitToBar(refs.cmbBub);\n\n\t \t // the center bubble is the bubble we care about now\n\t \t bubToAdjust = refs.cmbBub;\n\t \t } else {\n\t \t // the low and high bubbles aren't overlapping\n\n\t \t // so show the low and high bubbles\n\t \t show(refs.lowBub);\n\t \t show(refs.highBub);\n\n\t \t // and hide the center bubble\n\t \t hide(refs.cmbBub);\n\t \t bubToAdjust = refs.highBub;\n\t \t }\n\t \t }\n\n\t \t if (gap(refs.flrBub, refs.lowBub) < 5) {\n\t \t // the low bubble overlaps the floor bubble\n\n\t \t // so hide the floor bubble\n\t \t hide(refs.flrBub);\n\t \t } else {\n\t \t // the low bubble doesn't overlap the floor bubble\n\n\t \t if (isDualKnob) {\n\t \t // this is a dual knob slider\n\n\t \t if (gap(refs.flrBub, bubToAdjust) < 5) {\n\t \t // the bubble overlaps the floor bubble\n\n\t \t // so hide the floor bubble\n\t \t hide(refs.flrBub);\n\t \t } else {\n\t \t // no overlap\n\n\t \t // so show the floor bubble\n\t \t show(refs.flrBub);\n\t \t }\n\t \t } else {\n\t \t // single knob slider\n\n\t \t // so show the floor slider\n\t \t show(refs.flrBub);\n\t \t }\n\t \t }\n\n\t \t if (gap(refs.lowBub, refs.ceilBub) < 5) {\n\t \t // the low bubble overlaps the ceiling bubble\n\n\t \t // so hide the ceiling bubble\n\t \t hide(refs.ceilBub);\n\t \t } else {\n\t \t // the low bubble doesn't overlap the ceiling bubble\n\n\t \t if (isDualKnob) {\n\t \t // dual knob slider\n\n\t \t if (gap(bubToAdjust, refs.ceilBub) < 5) {\n\t \t // the bubble overlaps the ceiling bubble\n\n\t \t // so hide the ceiling bubble\n\t \t hide(refs.ceilBub);\n\t \t } else {\n\t \t // no overlap\n\n\t \t // so show the ceiling bubble\n\t \t show(refs.ceilBub);\n\t \t }\n\t \t } else {\n\t \t // no overlap\n\n\t \t // so show the ceiling bubble\n\t \t show(refs.ceilBub);\n\t \t }\n\t \t }\n\t \t }\n\n\t \t /**\n * What to do when dragging ends\n */\n\t \t function onEnd() {\n\n\t \t // reset the offsets\n\t \t stickyOffsetLow = 0;\n\t \t stickyOffsetHigh = 0;\n\n\t \t if (pointer) {\n\t \t // if we have a pointer reference\n\n\t \t // update all the elements in the DOM\n\t \t setPointers();\n\t \t adjustBubbles();\n\n\t \t // the pointer is no longer active\n\t \t pointer.removeClass('active');\n\t \t }\n\n\t \t // reset the references\n\t \t pointer = null;\n\t \t ref = null;\n\t \t dragRange = false;\n\t \t }\n\n\t \t /**\n * What to do when the knob/bar is moved\n * @param {object} event\n */\n\t \t function onMove(event) {\n\t \t if (pointer) {\n\t \t // we have a reference to a knob/bar\n\n\t \t scope.$apply(function () {\n\n\t \t /**\n * The current x position of the mouse/finger/etc.\n * @type {number}\n */\n\t \t var currentX = event.clientX || event.x;\n\n\t \t if (dragRange) {\n\t \t // the entire range is being dragged\n\n\t \t /**\n * The new offset for the low knob\n * @type {number}\n */\n\t \t var newLowValue = valueFromOffset(currentX) - lowValueOffset;\n\n\t \t /**\n * The new offset for the high knob\n * @type {number}\n */\n\t \t var newHighValue = valueFromOffset(currentX) + highValueOffset;\n\n\t \t if (newLowValue < minValue) {\n\t \t // the new low is outside of the slider\n\n\t \t // so bring the values back within range\n\t \t newHighValue += minValue - newLowValue;\n\t \t newLowValue = minValue;\n\t \t } else if (newHighValue > maxValue) {\n\t \t // the new high value is outside of the slider\n\n\t \t // so bring the values back within range\n\t \t newLowValue -= newHighValue - maxValue;\n\t \t newHighValue = maxValue;\n\t \t }\n\n\t \t // get the offset percentages\n\t \t var newLowPercent = percentFromValue(newLowValue);\n\t \t var newHighPercent = percentFromValue(newHighValue);\n\n\t \t // save the temporary sticky offset\n\t \t stickyOffsetLow = newLowPercent;\n\t \t stickyOffsetHigh = newHighPercent;\n\n\t \t // round the raw values to steps and assign them to the knobs\n\t \t scope[refLow] = newLowValue = roundToStep(newLowValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n\t \t scope[refHigh] = newHighValue = roundToStep(newHighValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n\n\t \t // keep the difference between both knobs the same\n\t \t stickyOffsetLow = stickyOffsetLow - percentFromValue(newLowValue);\n\t \t stickyOffsetHigh = stickyOffsetHigh - percentFromValue(newHighValue);\n\t \t } else {\n\t \t // only one knob is being dragged\n\n\t \t /**\n * The new offset for the knob being dragged\n * @type {number}\n */\n\t \t var newOffset = bringOffsetInRange(currentX + minOffset - offsetLeft(element) - halfWidth(pointer));\n\n\t \t /**\n * The new offset percent for the knob being dragged\n * @type {number}\n */\n\t \t var newPercent = percentFromOffset(newOffset);\n\n\t \t /**\n * The new value for the knob being dragged\n * @type {number}\n */\n\t \t var newValue = scope.encode(minValueDecoded + (valueRangeDecoded * newPercent / 100.0));\n\n\t \t // set the sticky offset for the low knob\n\t \t stickyOffsetLow = newPercent;\n\n\t \t if (isDualKnob) {\n\t \t // dual knob slider\n\n\t \t if (scope.buffer > 0) {\n\t \t // we need to account for the buffer\n\n\t \t if (ref === refLow) {\n\t \t // the low knob is being dragged\n\n\t \t if (newValue > scope[refHigh] - scope.buffer) {\n\t \t // the new value cuts into the buffer\n\n\t \t // so make the value respect the buffer\n\t \t newValue = scope[refHigh] - scope.buffer\n\t \t }\n\t \t } else {\n\t \t // the high knob is being dragged\n\n\t \t if (newValue < scope[refLow] + scope.buffer) {\n\t \t // the new value cuts into the buffer\n\n\t \t // so make the value respect the buffer\n\t \t newValue = scope[refLow] + scope.buffer;\n\t \t }\n\t \t }\n\t \t } else {\n\t \t // we don't have to worry about a buffer\n\n\t \t if (ref === refLow) {\n\t \t // the low knob is being dragged\n\n\t \t if (newValue > scope[refHigh]) {\n\t \t // the new value is greater then the value of the high knob\n\n\t \t // so set the low value to what the high used to be\n\t \t scope[refLow] = scope[refHigh];\n\n\t \t // make sure the decoded values are updated\n\t \t scope.decodedValues[refLow] = scope.decodeRef(refLow);\n\n\t \t // switch the value reference\n\t \t ref = refHigh;\n\n\t \t // swap the element references\n\t \t var temp = refs.minPtr;\n\t \t refs.minPtr = refs.maxPtr;\n\t \t refs.maxPtr = temp;\n\n\t \t // and the classes\n\t \t refs.maxPtr.removeClass('active').removeClass('high').addClass('low');\n\t \t refs.minPtr.addClass('active').removeClass('low').addClass('high');\n\t \t }\n\t \t } else {\n\t \t // the high knob is being dragged\n\n\t \t if (newValue < scope[refLow]) {\n\t \t // the new value is less than the value of the low knob\n\n\t \t // so set the high value to what the low used to be\n\t \t scope[refHigh] = scope[refLow];\n\n\t \t // make sure the decoded values are updated\n\t \t scope.decodedValues[refHigh] = scope.decodeRef(refHigh);\n\n\t \t // switch the value reference\n\t \t ref = refLow;\n\n\t \t // swap the element references\n\t \t var temp = refs.minPtr;\n\t \t refs.minPtr = refs.maxPtr;\n\t \t refs.maxPtr = temp;\n\n\t \t // and the classes\n\t \t refs.minPtr.removeClass('active').removeClass('low').addClass('high');\n\t \t refs.maxPtr.addClass('active').removeClass('high').addClass('low');\n\t \t }\n\t \t }\n\t \t }\n\t \t }\n\n\t \t // round the new value and assign it\n\t \t scope[ref] = newValue = roundToStep(newValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n\n\t \t // update the decoded value\n\t \t scope.decodedValues[ref] = scope.decodeRef(ref);\n\n\t \t if (ref === refLow) {\n\t \t // the low knob is being dragged\n\n\t \t // so update the sticky offset for the low knob\n\t \t stickyOffsetLow = stickyOffsetLow - percentFromValue(newValue);\n\n\t \t // and ensure the high knob stays put\n\t \t stickyOffsetHigh = 0;\n\t \t } else {\n\t \t // the high knob is being dragged\n\n\t \t // so update the sticky offset for the high knob\n\t \t stickyOffsetHigh = stickyOffsetLow - percentFromValue(newValue);\n\n\t \t // and ensure the low knob stays put\n\t \t stickyOffsetLow = 0;\n\t \t }\n\t \t }\n\n\t \t if (scope.ngChange) {\n\t \t scope.ngChange();\n\t \t }\n\t \t ctrl.$setViewValue(scope[refLow]);\n\n\t \t // update the DOM\n\t \t setPointers();\n\t \t adjustBubbles();\n\n\t \t });\n\t \t }\n\t \t }\n\n\t \t /**\n * What to do when a knob/bar is starting to be dragged\n * @param {object} event\n * @param {object} ptr\n * @param {string} rf\n */\n\t \t function onStart(event, ptr, rf) {\n\n\t \t if (scope.ngDisabled && scope.ngDisabled == true) return;\n\n\t \t event.preventDefault();\n\n\t \t /**\n\t\t\t\t\t\t\t\t\t * The current x position of the mouse/finger/etc.\n\t\t\t\t\t\t\t\t\t * @type {number}\n\t\t\t\t\t\t\t\t\t */\n\t \t var currentX = event.clientX || event.x;\n\n\t \t // save the pointer reference\n\t \t pointer = ptr;\n\n\t \t // save the a reference to the model\n\t \t ref = rf;\n\n\t \t // set the knob/bar to active\n\t \t pointer.addClass('active');\n\n\t \t if (ref == refSel) {\n\t \t // the selection bar is being dragged\n\n\t \t // so tell everyone else this is the case\n\t \t dragRange = true;\n\n\t \t var startValue = valueFromOffset(currentX);\n\n\t \t // and save the start positions\n\t \t lowValueOffset = startValue - scope[refLow];\n\t \t highValueOffset = scope[refHigh] - startValue;\n\t \t }\n\n\t \t onMove(event);\n\t \t }\n\n\t \t /**\n * Bind the various events to the various DOM elements\n */\n\t \t function setBindings() {\n\t \t if (AngularSlider.inputtypes.range) {\n\t \t // we're using range inputs\n\n\t \t /**\n * Bind the events necessary for a range input\n * @param {object} elem\n * @param {object} ptr\n * @param {string} rf\n */\n\t \t function bindSlider(elem, ptr, rf) {\n\n\t \t // make sure the element has all the methods and properties we'll need\n\t \t elem = angularize(elem);\n\n\t \t /**\n * Start event\n * @param {object} coords\n * @param {event} ev\n */\n\t \t function start(coords, ev) {\n\t \t onStart(ev, ptr, rf);\n\t \t }\n\n\t \t /**\n * End event\n * @param {object} coords\n * @param {event} ev\n */\n\t \t function end(coords, ev) {\n\t \t onMove(ev);\n\t \t onEnd();\n\t \t }\n\n\t \t // bind events to the range input\n\t \t $swipe.bind(elem, {\n\t \t start: start,\n\t \t move: function (coords, ev) {\n\t \t onMove(ev);\n\t \t },\n\t \t end: end,\n\t \t cancel: function (coords, ev) {\n\t \t onEnd(ev);\n\t \t }\n\t \t });\n\t \t }\n\n\t \t // bind the events to the low value range input\n\t \t bindSlider(refs.minInput, refs.minPtr, refLow);\n\n\t \t if (isDualKnob) {\n\t \t // bind the events to the high value range input\n\t \t bindSlider(refs.maxInput, refs.maxPtr, refHigh);\n\t \t // bind the events to the selection bar range input\n\t \t bindSlider(refs.selInput, refs.selBar, refSel);\n\t \t }\n\t \t } else {\n\t \t // we're using normal DOM elements\n\n\t \t /**\n * Start event\n * @param {object} elem\n * @param {string} rf\n * @param {object} [ptr]\n */\n\t \t function bindSwipeStart(elem, rf, ptr) {\n\n\t \t // make sure the element has all the methods and properties we'll need\n\t \t elem = angularize(elem);\n\n\t \t // if no pointer reference is supplied, reference the element given\n\t \t if (angular.isUndefined(ptr)) {\n\t \t ptr = elem;\n\t \t } else {\n\t \t ptr = angularize(ptr);\n\t \t }\n\n\t \t // bind the swipe start event to the element\n\t \t $swipe.bind(elem, {\n\t \t start: function (coords, ev) {\n\t \t onStart(ev, ptr, rf);\n\t \t }\n\t \t });\n\t \t }\n\n\t \t /**\n * Move event\n * @param {object} elem\n */\n\t \t function bindSwipe(elem) {\n\n\t \t // make sure the element has all the methods and properties we'll need\n\t \t elem = angularize(elem);\n\n\t \t // bind the swipe move, end, and cancel events\n\t \t $swipe.bind(elem, {\n\t \t move: function (coords, ev) {\n\t \t onMove(ev);\n\t \t },\n\t \t end: function (coords, ev) {\n\t \t onMove(ev);\n\t \t onEnd();\n\t \t },\n\t \t cancel: function (coords, ev) {\n\t \t onEnd(ev);\n\t \t }\n\t \t });\n\t \t }\n\n\t \t // bind the common events to the various common elements\n\t \t bindSwipe($document);\n\t \t bindSwipeStart(refs.minPtr, refLow);\n\t \t bindSwipeStart(refs.lowBub, refLow);\n\t \t bindSwipeStart(refs.flrBub, refLow, refs.minPtr);\n\t \t if (isDualKnob) {\n\t \t // bind the dual knob specific events to the dual knob specific elements\n\t \t bindSwipeStart(refs.maxPtr, refHigh);\n\t \t bindSwipeStart(refs.highBub, refHigh);\n\t \t bindSwipeStart(refs.ceilBub, refHigh, refs.maxPtr);\n\t \t bindSwipeStart(refs.selBar, refSel);\n\t \t bindSwipeStart(refs.selBub, refSel, refs.selBar);\n\t \t bindSwipeStart(refs.unSelBarLow, refLow, refs.minPtr);\n\t \t bindSwipeStart(refs.unSelBarHigh, refHigh, refs.maxPtr);\n\t \t } else {\n\t \t // bind the single knob specific events to the single knob specific elements\n\t \t bindSwipeStart(refs.ceilBub, refLow, refs.minPtr);\n\t \t bindSwipeStart(refs.fullBar, refLow, refs.minPtr);\n\t \t }\n\t \t }\n\t \t }\n\n\t \t // update the DOM\n\t \t setPointers();\n\t \t adjustBubbles();\n\n\t \t if (!eventsBound) {\n\t \t // the events haven't been bound yet\n\n\t \t // so bind the events, damnit!\n\t \t setBindings();\n\t \t eventsBound = true;\n\t \t }\n\t \t }", "title": "" }, { "docid": "1359876abcf478a807a224318cc97f9e", "score": "0.52015793", "text": "function resizeWest(e) {\n var documentWidth = document.documentElement.clientWidth;\n var calculateValue = false;\n var rectValues;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n rectValues = getClientRectValues(containerElement);\n }\n var pageX = (getEventType(e.type) === 'mouse') ? e.pageX : e.touches[0].pageX;\n var targetRectValues = getClientRectValues(targetElement);\n var borderValue = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) ? 0 : containerElement.offsetWidth - containerElement.clientWidth;\n var left = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) ? 0 : rectValues.left;\n var containerWidth = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) ? 0 : rectValues.width;\n if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(resizeWestWidth)) {\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n resizeWestWidth = (((targetRectValues.left - left) - borderValue / 2)) + targetRectValues.width;\n resizeWestWidth = resizeWestWidth + (containerWidth - borderValue - resizeWestWidth);\n }\n else {\n resizeWestWidth = documentWidth;\n }\n }\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) &&\n (((targetRectValues.left - rectValues.left) + targetRectValues.width +\n (rectValues.right - targetRectValues.right)) - borderValue) <= maxWidth) {\n calculateValue = true;\n }\n else if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && pageX >= 0) {\n calculateValue = true;\n }\n var calculatedWidth = originalWidth - (pageX - originalMouseX);\n if (setLeft) {\n calculatedWidth = (calculatedWidth > resizeWestWidth) ? resizeWestWidth : calculatedWidth;\n }\n if (calculateValue) {\n if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {\n var containerLeft = 0;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerLeft = rectValues.left;\n }\n var left_1 = (originalX - containerLeft) + (pageX - originalMouseX);\n left_1 = (left_1 > 0) ? left_1 : 1;\n if (calculatedWidth !== previousWidth && setWidth) {\n targetElement.style.width = calculatedWidth + 'px';\n }\n if (setLeft) {\n targetElement.style.left = left_1 + 'px';\n if (left_1 === 1) {\n setWidth = false;\n }\n else {\n setWidth = true;\n }\n }\n }\n }\n previousWidth = calculatedWidth;\n}", "title": "" }, { "docid": "90a862ae274c8d3ebae1a08f4529d629", "score": "0.5195742", "text": "function computeReplacedSel(doc,changes,hint){var out=[];var oldPrev=Pos(doc.first,0),newPrev=oldPrev;for(var i=0;i<changes.length;i++){var change=changes[i];var from=offsetPos(change.from,oldPrev,newPrev);var to=offsetPos(changeEnd(change),oldPrev,newPrev);oldPrev=change.to;newPrev=to;if(hint==\"around\"){var range=doc.sel.ranges[i],inv=cmp(range.head,range.anchor)<0;out[i]=new Range(inv?to:from,inv?from:to);}else {out[i]=new Range(from,from);}}return new Selection(out,doc.sel.primIndex);} // Allow \"beforeChange\" event handlers to influence a change", "title": "" }, { "docid": "7ffecf8f86066e5812db65d02b68e3c3", "score": "0.51941323", "text": "function restorePostEditContainerElementsSize(restoreDefaults) {\n try {\n if (restoreDefaults) {\n try {\n $(\"#editedContent_\").css(\"height\", settings.leftPaneHeight);\n $(\"#editedContent_\").css(\"width\", settings.leftPaneWidth);\n\n $(\"#divSourceTextContainer_\").css(\"width\", settings.textAreasWidth);\n $(\"#sourceTextArea_\").css(\"width\", settings.textAreasWidth);\n $(\"#sourceTextArea_\").css(\"height\", settings.textAreasHeight);\n\n $(\"#commentsTextArea_\").css(\"height\", settings.textAreasHeight);\n $(\"#commentsTextArea_\").css(\"width\", settings.textAreasWidth);\n\n $(\"#divComments\").css(\"width\", settings.textAreasWidth);\n $(\"#divOptions\").css(\"width\", settings.textAreasWidth);\n\n if ($('#postEditDialog_').data('isMaximized') !== undefined && $('#postEditDialog_').data('isMaximized').state === true) {\n $(\"#targetTextArea__tbl\").width(parseFloat($(\"#targetTextArea__tbl\").data('elementWidth').elementWidthBeforeMaximize).toString() + \"px\");\n $(\"#targetTextArea__tbl\").height(parseFloat($(\"#targetTextArea__tbl\").data('elementHeight').elementHeightBeforeMaximize).toString() + \"px\");\n }\n\n } catch (e) { }\n\n }\n else {\n if ($('#postEditDialog_').data('isMaximized') !== undefined && $('#postEditDialog_').data('isMaximized').state === true) {\n var selectorWidthCalculation = \"#editedContent_ , #divSourceTextContainer_ , #sourceTextArea_ , #commentsTextArea_ , #targetTextArea__tbl , #divComments, #divOptions\";\n $(selectorWidthCalculation).each(function () {\n try {\n $(this).css(\"width\", $(this).data('elementWidth').elementWidthBeforeMaximize.toString());\n $(this).css(\"height\", $(this).data('elementHeight').elementHeightBeforeMaximize.toString());\n } catch (e) { }\n });\n }\n }\n } catch (e) { }\n $('#postEditDialog_').data('isMaximized', { state: false });\n }", "title": "" }, { "docid": "5e138cbf905aa14106646b6b054557c3", "score": "0.5176436", "text": "_forceSync() {\n const {handleX, handleY, viewport, scrollY, scrollX, previousX, previousY, _silent, _easingBeginTimestamp, _easing, _easingDuration} = this,\n {scrollableX, scrollableY, nativeScroll, outset, onViewportScroll, scrollMinX, scrollMinY} = this.props,\n {clientWidth, clientHeight, offsetWidth, offsetHeight, scrollWidth, scrollHeight, scrollTop, scrollLeft} = viewport;\n\n const SCROLL_MAX_X = Math.max(0, scrollWidth - clientWidth),\n SCROLL_MAX_Y = Math.max(0, scrollHeight - clientHeight);\n\n this.scrollBarXExposed = scrollableX && SCROLL_MAX_X >= scrollMinX;\n this.scrollBarYExposed = scrollableY && SCROLL_MAX_Y >= scrollMinY;\n\n this.el.classList.toggle('scroll-box--requires-x', this.scrollBarXExposed);\n this.el.classList.toggle('scroll-box--requires-y', this.scrollBarYExposed);\n\n // Scrollbars may have non-zero thickness so in case of outset positioning\n // pixes cropped by scrollbar must be compensated.\n let width = '100%',\n height = '100%';\n if (nativeScroll && outset) {\n let trackYWidth = offsetWidth - clientWidth,\n trackXHeight = offsetHeight - clientHeight;\n if (trackYWidth) {\n width = `calc(100% + ${trackYWidth}px)`;\n }\n if (trackXHeight) {\n height = `calc(100% + ${trackXHeight}px)`;\n }\n }\n viewport.style.width = width;\n viewport.style.height = height;\n\n let targetX = Math.max(0, Math.min(Math.round(this.targetX), SCROLL_MAX_X)) * this.scrollBarXExposed,\n targetY = Math.max(0, Math.min(Math.round(this.targetY), SCROLL_MAX_Y)) * this.scrollBarYExposed,\n x = targetX,\n y = targetY;\n\n if (scrollY == scrollTop && scrollX == scrollLeft) {\n let elapsed = Date.now() - _easingBeginTimestamp;\n if (elapsed < _easingDuration && typeof _easing == 'function') {\n let ratio = _easing(elapsed / _easingDuration, elapsed, 0, 1, _easingDuration);\n\n // Compute eased scroll positions.\n x = Math.round(previousX + ratio * (targetX - previousX));\n y = Math.round(previousY + ratio * (targetY - previousY));\n } else {\n // Scroll animation completed.\n this._easingDuration = 0;\n }\n // Prevent native scrolling glitches, especially if native scroll is inertial or smooth.\n viewport.scrollLeft = x;\n viewport.scrollTop = y;\n } else {\n // Viewport scroll position is not synced with component state.\n // This is usually caused by system scrolling, resize of element etc.\n // So stop running animation and update component state with current\n // viewport scroll offsets.\n this._easingDuration = 0;\n x = targetX = scrollLeft;\n y = targetY = scrollTop;\n }\n this.targetX = targetX;\n this.targetY = targetY;\n\n if (scrollX == x && scrollY == y && this.scrollMaxX == SCROLL_MAX_X && this.scrollMaxY == SCROLL_MAX_Y) {\n if (!this._easingDuration) {\n // Animation has completed and geometry did not change.\n this._easing = null;\n this._silent = false;\n }\n // TODO Viewport did not change its scroll parameters, so invocation of `onViewportScroll` and further altering geometry of handles and tracks may not be required.\n }\n this.scrollX = x;\n this.scrollY = y;\n this.scrollMaxX = SCROLL_MAX_X;\n this.scrollMaxY = SCROLL_MAX_Y;\n this.trackMaxX = 0;\n this.trackMaxY = 0;\n\n // Update custom handle positions and sizes.\n // Scrollbar size represents ratio of content and viewport sizes.\n if (!nativeScroll) {\n this.trackMaxX = this.trackX.clientWidth - handleX.offsetWidth;\n this.trackMaxY = this.trackY.clientHeight - handleY.offsetHeight;\n\n handleX.style.width = clientWidth / scrollWidth * 100 + '%';\n handleX.style.left = this.trackMaxX * x / SCROLL_MAX_X + 'px';\n\n handleY.style.height = clientHeight / scrollHeight * 100 + '%';\n handleY.style.top = this.trackMaxY * y / SCROLL_MAX_Y + 'px';\n }\n if (!_silent && !(scrollX == x && scrollY == y)) {\n onViewportScroll(this);\n }\n }", "title": "" }, { "docid": "7a30dcc4ffb5f8226d5e337c5970f103", "score": "0.51733536", "text": "_computeFocusAndRange(\n ): ?{focusNode: Node, focusOffset: number, range: DOMRange} {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n\n const range = selection.getRangeAt(0);\n if (range.collapsed) {\n return null;\n }\n\n // NOTE(mdr): The focus node is guaranteed to exist, because\n // there's a range, but the Flow type annotations for\n // Selection don't know that. Cast it ourselves.\n const focusNode: Node = (selection.focusNode: any);\n const focusOffset = selection.focusOffset;\n return {focusNode, focusOffset, range};\n }\n\n /**\n * Compute the current TrackedSelection from the document state.\n */\n _computeTrackedSelection(\n buildHighlight: (domRange: DOMRange) => ?DOMHighlight,\n ): ?TrackedSelection {\n const focusAndRange = this._computeFocusAndRange();\n if (!focusAndRange) {\n return null;\n }\n\n const {focusNode, focusOffset, range} = focusAndRange;\n const proposedHighlight = buildHighlight(range);\n if (!proposedHighlight) {\n return null;\n }\n\n return {focusNode, focusOffset, proposedHighlight};\n }\n\n /**\n * Update the TrackedSelection to reflect the document state.\n */\n _updateTrackedSelection(\n buildHighlight: (domRange: DOMRange) => ?DOMHighlight,\n ) {\n const trackedSelection = this._computeTrackedSelection(buildHighlight);\n this.setState({trackedSelection});\n }\n\n _handleSelectionChange = () => {\n this._updateTrackedSelection(this.props.buildHighlight);\n\n if (this.state.mouseState === \"down\") {\n this.setState({\n mouseState: \"down-and-selecting\",\n });\n }\n }\n\n _handleMouseDown = () => {\n this.setState({mouseState: \"down\"});\n }\n\n _handleMouseUp = () => {\n this.setState({mouseState: \"up\"});\n }\n\n render() {\n const {mouseState, trackedSelection} = this.state;\n const userIsMouseSelecting = mouseState === \"down-and-selecting\";\n\n return this.props.children && <div>\n {this.props.children(trackedSelection, userIsMouseSelecting)}\n </div>;\n }\n}", "title": "" }, { "docid": "d5386d025bb75fce0c8ced0e1deb5965", "score": "0.5173338", "text": "_cleanup() {\n\t\tthis._sizeView._dismiss();\n\n\t\tconst editingView = this._options.editor.editing.view;\n\n\t\teditingView.change( writer => {\n\t\t\twriter.setStyle( 'width', this._initialViewWidth, this._options.viewElement );\n\t\t} );\n\t}", "title": "" }, { "docid": "0ac8bce626a114c53741deccfdede323", "score": "0.5168952", "text": "function _viewportHandler() {\n var root = document.documentElement;\n _viewportWidth = root.clientWidth;\n _viewportHeight = root.clientHeight;\n _scrollX = window.pageXOffset || root.scrollLeft;\n _scrollY = window.pageYOffset || root.scrollTop;\n\n // Update all popups.\n for (var i = 0; i < _popups.length; i++) {\n _popups[i]._update();\n }\n}", "title": "" }, { "docid": "406a5053b87ffa457f79a0498101a731", "score": "0.5159012", "text": "function onRangeEvent(){\n changeRange(\"entrybox\"); \n paint();\n}", "title": "" }, { "docid": "743b5d305ef689093957ab20db5b398f", "score": "0.51547235", "text": "function applyEvents(args) {\n\n $('#' + args.contentId).attr('tabindex', -1).focus();\n var draggable = document.getElementById(args.domId);\n var dragTarget = document.getElementById(args.dragId);\n\n dragTarget.addEventListener('touchmove', function(event) {\n var touch = event.targetTouches[0];\n // Place element where the finger is\n draggable.style.left = (touch.pageX - 125) + 'px';\n draggable.style.top = (touch.pageY - 15) + 'px';\n event.preventDefault();\n }, false);\n $('#' + args.dragId).on('mousedown', function(e) {\n $('#' + args.contentId).css(\"pointer-events\", \"none\");\n var pos = $('#' + args.domId).position();\n var left = pos.left;\n var top = pos.top;\n var lDiff = left - e.pageX;\n var tDiff = top - e.pageY;\n $(\"#\" + args.domId).on('mousemove', function(e) {\n $(\"#\" + args.domId).offset({\n top: (e.pageY + tDiff),\n left: (e.pageX + lDiff)\n });\n });\n e.preventDefault();\n }).on('mouseup', function() {\n $('#' + args.contentId).css(\"pointer-events\", \"auto\");\n $(\"#\" + args.domId).off('mousemove');\n });\n\n $(\"#\" + args.closeId).on(\"click\", function() {\n $(\"#\" + args.domId).hide();\n });\n\n applyResizeEvents(args);\n }", "title": "" }, { "docid": "7263f94c1be1569ff5d73fbf9125059b", "score": "0.515439", "text": "function updateVisibleViewport(range) {\n // only for mobile. \n if (!isMobile) { return; } \n \n\n // on android keyboard used to trigger window resize events,\n // but now it triggers visualviewport resize instead as of chrome 108, released in October 2022\n // https://developer.chrome.com/blog/viewport-resize-behavior/\n // so with the exception of Firefox Android, all browsers use visualViewport now\n // on firefox this causes an extra tiny bit of animation but it's okay.\n // leaving this if/else clause here in case if you ever need to re-enable it \n // if (isios || isipados || (isAndroid && !isFirefox)) { \n \n // STEP 1 – Move the Toolbar on iOS \n var viewport = window.visualViewport || { height : window.innerHeight };\n var keyboardHeight = 0 - (window.innerHeight - viewport.height) + 16; // intentionally adding +1rem to the bottom more to pad for the cubic bezier not matching the ios keyboard spring animation\n \n $(\".ql-tooltip\").attr(\"style\", `transform: translateY(${keyboardHeight}px)`);\n $(\".ql-tooltip\")[0].scrollTo({ left: 0, behavior : \"smooth\" });\n\n // STEP 2 – Determine if keyboard is opening / closing, so you can crop the editor, and fire keyboard opened / closed events\n cropEditorAccordingtoVisibleViewport();\n \n // }\n\n // STEP 3 – SCROLL THE EDITOR TO THE CURSOR (EVEN IF IT'S BEHIND THE TOOLBAR / KEYBOARD)\n // now let's make the editor scroll to the selection while typing / when tapped on, and make sure it's not behind the keyboard.\n\n // this is to prevent regular viewport scrolls from triggering auto-scroll.\n // since those scrolls don't send a range, auto-scroll starts fighting regular user scrolls = and goes to quill.range.index = 0 = top of the doc.\n if (!range || isEmpty(range)) { return; }\n autoScrollWhileTyping(range);\n}", "title": "" }, { "docid": "f45abf1c6f649f6c9496b526fe83edc1", "score": "0.51493347", "text": "updateElements()\n {\n\n this.$selector = $(this.selector);\n this.scrollbar.update();\n this.windowHeight = $window.height();\n this.windowMiddle = this.windowHeight / 2;\n this.setScrollbarLimit();\n this.addElements();\n this.transformElements(true);\n }", "title": "" }, { "docid": "820246f9dd4ffc14d06ee37137e49b8d", "score": "0.5145581", "text": "function prepViewer () {\n console.log('IN [testView.js] prepViewer()');\n\n\n /****************************** START OF LOGIC FOR DRAGGING WHOLE DIV ******************************/\n // console.log('HELLOWORLD======>');\n\n //Make the DIV element draggable\n dragElement(document.getElementById(\"container\"));\n\n function dragElement(elmnt) {\n elmnt.style.position = \"absolute\";\n //console.log('hit dragElement');\n \n let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;\n\n if (document.getElementById(elmnt.id + \"header\")) {\n /* if present, the header is where you move the DIV from:*/\n document.getElementById(elmnt.id + \"header\").onmousedown = dragMouseDown;\n } else {\n /* otherwise, move the DIV from anywhere inside the DIV:*/\n elmnt.onmousedown = dragMouseDown;\n }\n\n function dragMouseDown(e) {\n e = e || window.event;\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementDrag;\n }\n\n function elementDrag(e) {\n e = e || window.event;\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n\n // set the element's new position:\n\n // the following works to limit the top left boundary...\n // ... however, since we also have to check the lower right \n // we can't use ternary operators (without ludacris mode that is)\n // elmnt.style.top = (((elmnt.offsetTop - pos2) < 0) ? 0 : (elmnt.offsetTop - pos2)) + \"px\";\n // elmnt.style.left = (((elmnt.offsetLeft - pos1) < 0) ? 0 : (elmnt.offsetLeft - pos1)) + \"px\";\n \n // //console.log(\"heights:\");\n // //console.log(elmnt.parentElement);\n // //console.log(elmnt.parentNode);\n // //console.log(elmnt.offsetHeight);\n // //console.log(window.outerHeight);\n\n let manualHeightOffsetFix = 74;\n\n if (elmnt.offsetTop - pos2 < 0) {\n //console.log(\"v-top:\");\n elmnt.style.top = 0 + \"px\";\n } else if (elmnt.offsetTop - pos2 + elmnt.offsetHeight + manualHeightOffsetFix > window.outerHeight) {\n //console.log(\"v-bottom:\");\n elmnt.style.top = window.outerHeight - elmnt.offsetHeight - manualHeightOffsetFix + \"px\";\n } else {\n //console.log(\"v-good:\");\n elmnt.style.top = elmnt.offsetTop - pos2 + \"px\";\n }\n // elmnt.style.top = ((( < 0) ? 0 : (elmnt.offsetTop - pos2)) + \"px\";\n // elmnt.style.left = (((elmnt.offsetLeft - pos1) < 0) ? 0 : (elmnt.offsetLeft - pos1)) + \"px\";\n\n if (elmnt.offsetLeft - pos1 < 0) {\n //console.log(\"v-top:\");\n elmnt.style.left = 0 + \"px\";\n } else if (elmnt.offsetLeft - pos1 + elmnt.offsetWidth > window.outerWidth) {\n //console.log(\"v-bottom:\");\n elmnt.style.left = window.outerWidth - elmnt.offsetWidth + \"px\";\n } else {\n //console.log(\"v-good:\");\n elmnt.style.left = elmnt.offsetLeft - pos1 + \"px\";\n }\n \n //console.log('this is Y coordinate after drag and drop', elmnt.style.top);\n //console.log('this is X coordinate after drag and drop', elmnt.style.left);\n }\n\n function closeDragElement() {\n /* stop moving when mouse button is released:*/\n document.onmouseup = null;\n document.onmousemove = null;\n elmnt.style.position = \"fixed\";\n document.getElementById(\"page\").style.opacity = 1;\n clearSelection();\n }\n document.getElementById(\"container\").style.position = \"fixed\";\n }\n\n //console.log('in index.js ---- dragElement() invoked');\n\n /******************************END FOR LOGIC FOR DRAGGING WHOLE DIV ******************************/\n\n\n\n\n\n /******************************LOGIC FOR MANUAL RESIZING BY DRAGGING*************************/\n\n function clearSelection() {\n if ( document.selection ) {\n document.selection.empty();\n } else if ( window.getSelection ) {\n window.getSelection().removeAllRanges();\n }\n }\n let resizeHandle = document.getElementById('handle');\n let boxes = [document.getElementById('mini'), document.getElementById(\"tabRibbon\"), document.getElementById(\"page\"), document.getElementById(\"innerPage\")];\n\n resizeHandle.addEventListener('mousedown', initialiseResize, false);\n \n function initialiseResize(e) {\n window.addEventListener('mousemove', startResizing, false);\n window.addEventListener('mouseup', stopResizing, false);\n }\n \n function startResizing(e) {\n boxes.forEach(box => {\n if (box === document.getElementById(\"tabRibbon\")) {\n box.style.width = (e.clientX - box.offsetLeft) + 'px';\n } else {\n box.style.width = (e.clientX - box.offsetLeft) + 'px';\n box.style.height = (e.clientY - box.offsetTop) + 'px';\n\n }\n })\n }\n function stopResizing(e) {\n window.removeEventListener('mousemove', startResizing, false);\n window.removeEventListener('mouseup', stopResizing, false);\n clearSelection();\n }\n /******************************END FOR MANUAL RESIZING BY DRAGGING*************************/\n\n\n// dev.vw();\n\n}", "title": "" }, { "docid": "2d9ed2c2a242f518bf9c98fdcc689c18", "score": "0.5131415", "text": "function updateEditorSizes() {\n var margins = 90;\n var windowHeight = window.innerHeight;\n var pageFooterHeight = 84;\n var headerNavHeight = 47;\n var queryBoxHeight = $('.wb-query-editor').height();\n\n var otherStuff = pageFooterHeight + headerNavHeight + queryBoxHeight;\n\n if (headerNavHeight == null || queryBoxHeight == null) {\n return;\n }\n\n var editor_size = windowHeight - otherStuff - margins;\n if (editor_size > 1000)\n editor_size = 1150;\n if (editor_size < 0)\n editor_size = 0;\n\n// console.log(\"pageHeaderHeight: \" + pageHeaderHeight);\n// console.log(\"pageFooterHeight: \" + pageFooterHeight);\n// console.log(\"headerNavHeight: \" + headerNavHeight);\n// console.log(\"queryBoxHeight: \" + queryBoxHeight);\n// console.log(\"windowHeight: \" + windowHeight);\n// console.log(\"resultHeaderHeight: \" + resultHeaderHeight);\n// console.log(\"resultSummaryHeight: \" + resultSummaryHeight + \"\\n\\n\");\n// console.log(\" current_ui: \" + current_ui);\n// console.log(\" editor_size: \" + editor_size);\n\n var sidebarHeight = windowHeight - 130;\n $('.insights-sidebar').height(sidebarHeight);\n $('.wb-results-json').height(editor_size);\n $('.wb-results-table').height(editor_size + 32);\n $('.wb-results-tree').height(editor_size + 15);\n $('.wb-results-explain').height(editor_size + 32);\n $('.wb-results-explain-text').height(editor_size + 32);\n\n\n //\n // allow the query editor to grow and shrink a certain amount based\n // on the number of lines in the query\n //\n // as the query is edited, allow it more vertical space, but max sure it\n // doesn't have fewer than 5 lines or more than ~50% of the window\n\n if (qc.inputEditor) {\n var queryAreaHeight = Math.max($('.wb-main-wrapper').height(),240);\n var queryHeaderHeight = $('.wb-query-editor-header').height();\n var curSession = qc.inputEditor.getSession();\n var lines = curSession.getLength();\n var halfScreen = queryAreaHeight/2-queryHeaderHeight*4;\n var height = Math.max(75,((lines-1)*21)-10); // make sure height no less than 75\n if (halfScreen > 75 && height > halfScreen)\n height = halfScreen;\n\n //console.log(\"QueryAreaHeight: \" + queryAreaHeight + \", queryHeaderHeight: \" + queryHeaderHeight);\n //console.log(\"Half screen: \" + halfScreen + \", Area height: \" + queryAreaHeight + \", header: \" + queryHeaderHeight + \", setting height to: \" + height);\n\n $(\".wb-ace-editor\").height(height);\n }\n\n\n }", "title": "" }, { "docid": "c3c8c0c8b1add99e589f7d853fcecb87", "score": "0.5126883", "text": "handleScrollChange() {\n this.clientRect = this.computeClientRect();\n }", "title": "" }, { "docid": "7a96ed2aeca1c9aa6c38abba7e7cc6f0", "score": "0.5125735", "text": "sync () {\n this.syncQueued = false; // clear flag so sync can be queued to run again\n var that = this;\n // Delete any elements that don't belong\n Array.from( ((this.view.childNodes /*: any */) /*: NodeList<HTMLElement> */) ).map( function ( htmlElt /*: HTMLElement */ ) {\n if ( htmlElt.id == 'overlay' ) return;\n if ( !that.elements.find( ( sheetElt ) => htmlElt.childNodes[0] == sheetElt.htmlViewElement() ) ) {\n ((htmlElt.parentElement /*: any */) /*: HTMLElement */).removeChild( htmlElt );\n }\n } );\n // Ensure all Sheet Elements have their HTML element in the view\n this.elements.map( function ( sheetElt ) { that.buildWrapperFor( sheetElt ); } );\n // Schedule any overlay drawing that may need to be done.\n setTimeout( () => this.drawOverlay(), 0 );\n // While we're here, if anything changed since the last time we were here,\n // record it on the undo/redo stack.\n if ( this.undoRedoActive ) {\n function updateUndoRedoStack () {\n // ensure elements are fully initialized before recording their state\n if ( !that.elements.every( ( elt ) => elt.isReady() ) )\n return setTimeout( updateUndoRedoStack, 25 );\n // ok all elements are ready; we can proceed\n var last = that.history[that.historyIndex];\n var next = JSON.stringify( that.toJSON() );\n if ( next != last ) {\n // do the work of updating the history array\n that.history = that.history.slice( 0, that.historyIndex + 1 );\n that.history.push( next );\n that.historyIndex++;\n if ( that.history.length > that.maxHistorySize ) {\n that.history.shift();\n that.historyIndex--;\n }\n // also, tell all my new elements that they may have been resized,\n // and they should check and maybe re-render themselves.\n that.elements.map( ( elt ) => { if ( elt.emit ) elt.emit( 'resize' ); } );\n }\n }\n updateUndoRedoStack();\n }\n this.view.dispatchEvent( new CustomEvent( 'synced', { bubbles : true } ) );\n }", "title": "" }, { "docid": "79e745242a70a64915a3d8c45303dc97", "score": "0.5123936", "text": "function W(e,t){\n// Remove resize event listener on window\n// Remove scroll event listener on scroll parents\n// Reset state\nreturn R(e).removeEventListener(\"resize\",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener(\"scroll\",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}", "title": "" }, { "docid": "d6c1fceaff0265b3f242f64eb966ad7d", "score": "0.5117192", "text": "rerenderDOMSelection() {\n if (this.isDisabled()) return\n if (platform.inBrowser) {\n // console.log('Surface.rerenderDOMSelection', this.__id__);\n let sel = this.getEditorSession().getSelection()\n if (sel.surfaceId === this.getId()) {\n this.domSelection.setSelection(sel)\n // HACK: accessing the scrollpane directly\n // TODO: this should be done in a different way\n // this will let the scrollpane know that the DOM selection is ready\n const scrollPane = this.context.scrollPane\n if (scrollPane) {\n this.context.scrollPane.onSelectionPositioned()\n }\n }\n }\n }", "title": "" }, { "docid": "202975630385f5c31ba68a90c4c703b2", "score": "0.5115531", "text": "update() {\n if (!this.mStartDate || !this.mEndDate) {\n return;\n }\n\n // Calculate the relation of startdate/basedate and enddate/startdate.\n let offset = this.mStartDate.subtractDate(this.mBaseDate);\n\n // Calculate how much pixels a single hour and a single day take up.\n let num_hours = this.mEndHour - this.mStartHour;\n let hour_width = this.mContentWidth / num_hours;\n\n // Calculate the offset in fractional hours that corrospond to our start- and end-time.\n let start_offset_in_hours = this.date2offset(this.mStartDate);\n let end_offset_in_hours = this.date2offset(this.mEndDate);\n let duration_in_hours = end_offset_in_hours - start_offset_in_hours;\n\n // Calculate width & margin for the selection bar based on the relation of\n // startdate/basedate and enddate/startdate. This is a simple conversion from hours to\n // pixels.\n this.mWidth = duration_in_hours * hour_width;\n let totaldragwidths = this.leftdragWidth + this.rightdragWidth;\n if (this.mWidth < totaldragwidths) {\n this.mWidth = totaldragwidths;\n }\n this.mMargin = start_offset_in_hours * hour_width;\n\n // Calculate the difference between content and container in pixels. The container is the\n // window showing this control, the content is the total number of pixels the selection bar\n // can theoretically take up.\n let total_width =\n this.mContentWidth * this.mRange - this.parentNode.getBoundingClientRect().width;\n\n // Calculate the current scroll offset.\n offset = Math.floor(total_width * this.mRatio);\n\n // The final margin is the difference between the date-based margin and the scroll-based\n // margin.\n this.mMargin -= offset;\n\n // Set the styles based on the calculations above for the 'selection-bar'.\n let style =\n \"width: \" +\n this.mWidth +\n \"px; margin-inline-start: \" +\n this.mMargin +\n \"px; margin-top: \" +\n this.mHeaderHeight +\n \"px;\";\n this.mSelectionbar.setAttribute(\"style\", style);\n\n let event = document.createEvent(\"Events\");\n event.initEvent(\"timechange\", true, false);\n event.startDate = this.mStartDate;\n event.endDate = this.mEndDate.clone();\n if (event.endDate.isDate) {\n event.endDate.day--;\n }\n event.endDate.makeImmutable();\n this.dispatchEvent(event);\n }", "title": "" }, { "docid": "7a92bdc1921829ddfe29be662e9c379a", "score": "0.51105136", "text": "onLayout() {\n super.onLayout();\n // Create items matrix\n var depth = this._createMatrix();\n // Width and height of items\n var w = Math.floor(this._content.width() / 7);\n var h = Math.max(Math.floor(this._content.height() / 7), depth * this._itemItemHeight + this._itemItemTopStart);\n // Position calendar squares\n for (var row = 0; row < 7; row++)\n for (var col = 0; col < 7; col++)\n this.element.find(latte.sprintf('.day-%s-%s', row, col))\n .css({ left: w * col, top: h * row })\n .width(w).height(h);\n // Update selection\n if (this._selectionStart && this._selectionEnd)\n this.setSelectionRange(this._selectionStart, this._selectionEnd);\n // Layout items\n this.onLayoutItems();\n }", "title": "" }, { "docid": "59c76d9b94d3331ff7f9192840e59c87", "score": "0.51071525", "text": "updatePositionAndSize() {\n changeX = changeY = changeW = changeH = false;\n expr = this.evaluator.eval(this.expresion);\n\n temporalCompare = MathRound(expr[0][0]);\n changeX = MathRound(this.x) !== temporalCompare;\n this.x = temporalCompare;\n\n temporalCompare = MathRound(expr[0][1]);\n changeY = MathRound(this.y) !== temporalCompare;\n this.y = temporalCompare;\n\n if (expr[0].length === 4) {\n temporalCompare = MathRound(expr[0][2]);\n changeW = MathRound(this.w) !== temporalCompare;\n this.w = temporalCompare\n\n temporalCompare = MathRound(expr[0][3]);\n changeH = MathRound(this.h) !== temporalCompare;\n this.h = temporalCompare;\n }\n\n // if has some change, then init the control and redraw it\n if ((changeW) || (changeH) || (changeX) || (changeY)) {\n this.init(true, true);\n this.draw();\n }\n }", "title": "" }, { "docid": "e1f578a628acfd8a87441256b2e89d75", "score": "0.5106842", "text": "cleanup(state, event) {\n const current = state.canvas.findPen();\n\n if (current) {\n state.canvas.updateBounds(current);\n }\n\n state.canvas.removeSelection();\n state.canvas.removePen();\n\n // we cannot reset temp here, because state.target might still be needed.\n }", "title": "" }, { "docid": "fc00f5717665b86cfb13715d67d07a11", "score": "0.5106739", "text": "function mvis() \n{\n var scf=0.3;\n var ele=window.getSelection().getRangeAt(0); \n var sel = ele.getBoundingClientRect(); \n var dw = document.documentElement.clientWidth; \n var dh = document.documentElement.clientHeight; \n dw=window.innerWidth;\n dh=window.innerHeight;\n var st=sel.top;\n var sb=sel.bottom;\n var db=dh; \n var dt=0;\n var amt=0;\n if(st<0) //too much up\n {\n //alert(\"st<0\");\n amt=-1*dh*scf;//341 dh*scf; \n }\n if(sb>db) //too much down\n {\n //alert(\"sb>db\");\n amt=dh*scf; //341; \n }\n window.scrollBy(0, amt);\n //console.log(sel.top+\" \" +sel.right+\" \"+sel.bottom+\" \"+ sel.left+\"\\n\"+dw+\" \"+dh+\" amt= \"+amt); \n\t //console.error(\"scroll value \"+amt);\t \n\tif(amt>500) \n console.debug(\"scroll value too much \"+amt);\n\n//simply scroll down or up a constant number\n//amt<0?amt=-1*dh*scf:amt=dh*scf;\n//alert(\"document top and bottom \"+dt+\" \"+db+\"\\n\"+\"selecton top and bottom \"+st+\" \"+sb+\"\\n\"+\"amount \"+amt);\n//alert(sel.top+\" \"+sel.bottom);\n/* if(amt>0)\n {\n for(var i=0;i<amt;i++)\n {\n setTimeout(function(){},300);\n window.scrollBy(0, 1);\n }\n }\n else\n { amt=-1*amt; //make amt posititve\n for(i=0;i<amt;i++)\n {\n setTimeout(function(){},300);\n window.scrollBy(0, -1);\n } \n } */\n \n// console.log(sel.top+\" \"+sel.bottom);\n}", "title": "" }, { "docid": "7f69f7f0ef98bf612b6162b324d8cf30", "score": "0.51027185", "text": "updateLayout(textEditor, options = {}) {\n this.showLoadingMessage();\n this.setVerovioOptions(options);\n this.redoVerovioLayout();\n this.showCurrentPage();\n this.addNotationEventListeners(textEditor);\n this.updateHighlight(textEditor);\n }", "title": "" }, { "docid": "63bce0f606dfaa03ea670c7c1642a393", "score": "0.5102139", "text": "function RePositionElements() {\n\t\tif( g_containerThumbnailsDisplayed ) {\n\t\t\tSetTumbnailsContainerWidth();\n\t\t\tSetTumbnailsContainerHeight();\n\t\t}\n\t\tif( g_containerViewerDisplayed ) {\n\t\t\tResizeInternalViewer();\n\t\t}\n\t}", "title": "" }, { "docid": "4746e99a23d75e867dd8ebde82eb19c0", "score": "0.5100935", "text": "function resizeSouth(e) {\n var documentHeight = document.documentElement.clientHeight;\n var calculateValue = false;\n var coordinates = e.touches ? e.changedTouches[0] : e;\n var currentpageY = coordinates.pageY;\n var targetRectValues = getClientRectValues(targetElement);\n var containerRectValues;\n if (!isNOU(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n if (!isNOU(containerElement)) {\n calculateValue = true;\n }\n else if (isNOU(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {\n calculateValue = true;\n }\n var calculatedHeight = originalHeight + (currentpageY - originalMouseY);\n calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;\n var containerTop = 0;\n if (!isNOU(containerElement)) {\n containerTop = containerRectValues.top;\n }\n var borderValue = isNOU(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;\n var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);\n topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;\n if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';\n return;\n }\n var targetTop = 0;\n if (calculateValue) {\n if (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {\n targetTop = targetRectValues.top;\n if ((calculatedHeight + targetTop) <= 30) {\n calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;\n }\n }\n if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {\n targetElement.style.height = targetRectValues.height +\n (documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';\n }\n var calculatedTop = (isNOU(containerElement)) ? targetTop : topWithoutborder;\n if (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {\n targetElement.style.height = calculatedHeight + 'px';\n }\n }\n}", "title": "" }, { "docid": "f716cb3f342234967f270ef978617926", "score": "0.5089802", "text": "function rerunLayout() {\n //console.log(\"rerunLayout...\");\n // Get the cytoscape instance as a Javascript object from JQuery.\n var cy= $('#cy').cytoscape('get'); // now we have a global reference to `cy`\n var selected_elements= cy.$(':visible'); // get only the visible elements.\n\n // Re-run the graph's layout, but only on the visible elements.\n rerunGraphLayout(selected_elements);\n \n // Reset the graph/ viewport.\n resetGraph();\n }", "title": "" }, { "docid": "8e7d1d84099674376c9dfa6c6494d3cc", "score": "0.5087575", "text": "function resizeEast(e) {\n var documentWidth = document.documentElement.clientWidth;\n var calculateValue = false;\n var containerRectValues;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n var coordinates = e.touches ? e.changedTouches[0] : e;\n var pageX = coordinates.pageX;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && (((targetRectValues.left - containerRectValues.left) + targetRectValues.width) < maxWidth\n || (targetRectValues.right - containerRectValues.left) > targetRectValues.width)) {\n calculateValue = true;\n }\n else if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && (documentWidth - pageX) > 0) {\n calculateValue = true;\n }\n var calculatedWidth = originalWidth + (pageX - originalMouseX);\n var containerLeft = 0;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerLeft = containerRectValues.left;\n }\n if (((targetRectValues.left - containerLeft) + calculatedWidth) > maxWidth) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.width = maxWidth - (targetRectValues.left - containerLeft) + 'px';\n }\n if (calculateValue) {\n if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {\n targetElement.style.width = calculatedWidth + 'px';\n }\n }\n}", "title": "" }, { "docid": "28ac1c6cd808452da211f54760656715", "score": "0.5085967", "text": "restoreSelection() {\r\n // syncSelectionState gets actual selectedIds\r\n // from selection manager and updates selectable datapoints state to correspond state\r\n this.syncSelectionState();\r\n // render new state of selection\r\n this.renderAll();\r\n }", "title": "" }, { "docid": "3b8306628d592f017624e1b64bfa7207", "score": "0.50859606", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\t\"position:absolute;top:1%\";\n\t\t\tdocElem.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" } ]
e1b8609f1fe78c60d47ab433c0a18b40
`ReactInstanceMap` maintains a mapping from a public facing stateful instance (key) and the internal representation (value). This allows public methods to accept the user facing instance as an argument and map them back to internal methods. Note that this module is currently shared and assumed to be stateless. If this becomes an actual Map, that will break. This API should be called `delete` but we'd have to make sure to always transform these to strings for IE support. When this transform is fully supported we can rename it.
[ { "docid": "aaadca4aa069312573b8dfa8e7428dc7", "score": "0.0", "text": "function get(key) {\n return key._reactInternalFiber;\n}", "title": "" } ]
[ { "docid": "b31253f4de3711aa2a879fe27580c8cc", "score": "0.5442913", "text": "function FMap() {\n _classCallCheck$3(this, FMap);\n }", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.52910364", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.52910364", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "6c40061bac768d91b345b56635803788", "score": "0.5237903", "text": "refMap(k) {\n\t\tconst id = {}; // SYMBOL FALLBACK\n\t\tconst map = this.refs[ k ] || (this.refs[ k ] = new Map());\n\t\treturn function updateRefHashmap(el) {\n\t\t\tif (el) map.set(id, el);\n\t\t\telse map.delete(id);\n\t\t};\n\t}", "title": "" }, { "docid": "2fb0b699024533b0fef8b6290b6506f2", "score": "0.51301783", "text": "function EBX_Map() {\n this.map = [];\n\n this.put = function (key, val) {\n this.map[key] = val;\n };\n\n this.get = function (key) {\n return this.map[key];\n };\n\n this.getMap = function () {\n return this.map;\n };\n\n this.isKeyExists = function (key) {\n return this.map[key] !== undefined;\n };\n}", "title": "" }, { "docid": "bdf9385686e3143b6e8c08941e70c943", "score": "0.5117586", "text": "function HappyMap() {\n this.map = new WeakMap()\n}", "title": "" }, { "docid": "48936af2c51b99ba9c88709182c2c0b8", "score": "0.5111929", "text": "_saveInstanceProperties() {\n for (const [p] of this.constructor\n ._classProperties) {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n }\n }", "title": "" }, { "docid": "48936af2c51b99ba9c88709182c2c0b8", "score": "0.5111929", "text": "_saveInstanceProperties() {\n for (const [p] of this.constructor\n ._classProperties) {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n }\n }", "title": "" }, { "docid": "3c835729185387341f007c64cf521846", "score": "0.5096996", "text": "function makeInstanceFn ( aMap, argOptionMap ) {\n // == BEGIN MODULE SCOPE VARIABLES ================================\n var\n subName = '_02_fake_',\n aKey = aMap._aKey_,\n vMap = aMap._vMap_,\n nMap = aMap._nMap_,\n\n __util = aMap._01_util_,\n __logObj = __util._getLogObj_(),\n __logMsg = __logObj._logMsg_,\n\n instanceMap, optionMap\n ;\n // == . END MODULE SCOPE VARIABLES ================================\n\n // == BEGIN UTILITY METHODS =======================================\n // == . END UTILITY METHODS =======================================\n\n // == BEGIN DOM METHODS ===========================================\n // == . END DOM METHODS ===========================================\n\n // == BEGIN PUBLIC METHODS ========================================\n function fetchExampleMap () {\n __logMsg( '_warn_', '_place_mock_fetch_here_' );\n }\n\n function configModule () {\n __logMsg( '_warn_', '_place_mock_config_here_' );\n }\n\n function logInfo () {\n __logMsg( '_info_', aKey, vMap, nMap );\n }\n\n instanceMap = {\n _logInfo_ : logInfo,\n _fetchExampleMap_ : fetchExampleMap,\n _configModule_ : configModule\n };\n\n optionMap = __util._castMap_( argOptionMap, {} );\n if ( optionMap._dont_autoadd_ !== vMap._true_ ) {\n aMap[ subName ] = instanceMap;\n }\n\n return instanceMap;\n // == . END PUBLIC METHODS ========================================\n }", "title": "" }, { "docid": "67282a6016f1b1d235220a97e72c52c4", "score": "0.50530136", "text": "_saveInstanceProperties(){for(const[e]of this.constructor._classProperties)if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}", "title": "" }, { "docid": "91034b1ad0415a88b7254c94619c3376", "score": "0.505031", "text": "takeSnapshot() {\n const hiddenMap = hiddenFlexMap.get(this);\n\n // Ideally we'd delete, as we would from a WeakMap. However,\n // PrivateName, to emulate class private names, has no delete.\n // hiddenFlexMap.delete(this);\n // hiddenEMap.delete(this);\n hiddenFlexMap.set(this, null);\n hiddenEMap.set(this, null);\n\n const result = new FixedMap();\n hiddenEMap.init(result, hiddenMap);\n return result;\n }", "title": "" }, { "docid": "0994680c906a84ffb351b2102366b7bd", "score": "0.50458837", "text": "function reactInternalInstance(node){\n Object.keys(node).find(key => key.startsWith('__reactInternalInstance'))\n}", "title": "" }, { "docid": "174aee1d037205e96973f9703aca19dc", "score": "0.5023732", "text": "function get(key){return key._reactInternals;}", "title": "" }, { "docid": "dd5ac82867166d9dc4450159d01a3c84", "score": "0.50119615", "text": "function newMap() {\n return Object.create(null);\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4993814", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "abb08701161ced9d1db2141b10fceda8", "score": "0.49888822", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "abb08701161ced9d1db2141b10fceda8", "score": "0.49888822", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "815306a60d49629ce729a02bd8b720cc", "score": "0.49756414", "text": "static getInstance(key) {\n if (null == key) {\n return null;\n }\n\n if (View.instanceMap[key] == null) {\n View.instanceMap[key] = new View(key);\n }\n\n return View.instanceMap[key];\n }", "title": "" }, { "docid": "8267ce04c4f8319228235eac75b46cb8", "score": "0.4970557", "text": "constructor() { this.map = new Map(); }", "title": "" }, { "docid": "2389038989865d557034c006a1eea09f", "score": "0.49253854", "text": "function ObjectMap( ) {\n if (typeof global.Map !== 'undefined') {\n var map = new Map();\n return map;\n }\n else {\n this.keys = new Array();\n this.values = new Array();\n this.set = function(obj, copy) { this.keys.push(obj); this.values.push(copy) };\n this.get = function(obj) { var ix = this.keys.indexOf(obj); return ix >= 0 ? this.values[ix] : undefined };\n //this.has = function(obj) { return this.keys.indexOf(obj) >= 0 };\n return this;\n }\n}", "title": "" }, { "docid": "3cae90f4a1110d3f7305252851176e77", "score": "0.49197125", "text": "function rekeySourceMap(cjsModuleInstance, newInstance) {\n const sourceMap = cjsSourceMapCache.get(cjsModuleInstance);\n if (sourceMap) {\n cjsSourceMapCache.set(newInstance, sourceMap);\n }\n}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49172297", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "7c802b60b715000f5059de0e4395d048", "score": "0.49110574", "text": "function SadMap() {\n this.keys = []\n this.values = []\n}", "title": "" }, { "docid": "60467d25e7d6e336a1af16803fae5fdb", "score": "0.4901761", "text": "function MapCache() {\n this.__data__ = {};\n}", "title": "" }, { "docid": "60467d25e7d6e336a1af16803fae5fdb", "score": "0.4901761", "text": "function MapCache() {\n this.__data__ = {};\n}", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4881688", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.48772606", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.48772606", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.48772606", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "03581e33598d1c81771048b7258e6510", "score": "0.4864292", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "09688504172bb00f084e515318115784", "score": "0.4863189", "text": "constructor(map) {\n // Should be using \"private field\"\n this._map = new Map(map)\n }", "title": "" }, { "docid": "34e45d67d439fc8806ebafb9fe060465", "score": "0.48506516", "text": "mapInstanceProps(instance) {\n return Object.keys(this.schema).reduce((soFar, key) => {\n soFar[key] = instance[key];\n return soFar;\n }, {});\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48490587", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" } ]
f358076db3823ae48fa52a568edcbe6c
Constructor of the LevelButton class that inherits from GameObjectList and its task is to define the behaviour of the buttons representing each of the levels in the levelMenuState. Each of the buttons will have different states represented by different sprites (locked, unlocked, solved or unsolved) The constructor tales as parameters the level index the button will refer to, a layer and an id
[ { "docid": "bad9f7b31424e7a8f922aa73a538e1db", "score": "0.8805515", "text": "function LevelButton(levelIndex, layer, id) {\r\n myLibrary.GameObjectList.call(this, layer, id);\r\n\r\n this.pressed = false;\r\n this.levelIndex = levelIndex;\r\n\r\n /* Assigning the sprites a button will acquire when a level is locked, unlocked & solved, and unlock & unsolved */\r\n this._levelLocked = new myLibrary.SpriteGameObject(sprites.level_locked, ID.layer_overlays_2);\r\n this._levelSolved = new myLibrary.SpriteGameObject(sprites.level_solved, ID.layer_overlays_1);\r\n this._levelUnsolved = new myLibrary.SpriteGameObject(sprites.level_unsolved, ID.layer_overlays);\r\n\r\n /* Adding the sprites to the GameObjectList */\r\n this.add(this._levelLocked);\r\n this.add(this._levelSolved);\r\n this.add(this._levelUnsolved);\r\n\r\n /* Here I create a text label that will display the number of the level each button refers to */\r\n var textLabel = new myLibrary.Label(\"Arial\", \"20px\", ID.layer_overlays_2);\r\n textLabel.text = levelIndex + 1;\r\n textLabel.position = new myLibrary.Vector2(this._levelSolved.width - textLabel.width - 10, 10);\r\n textLabel.color = myLibrary.Color.white;\r\n this.add(textLabel);\r\n}", "title": "" } ]
[ { "docid": "59b845c76d6ba3dfb0956db56a028ac4", "score": "0.6307699", "text": "function Button(sprite, layer, id) {\r\n myLibrary.SpriteGameObject.call(this, sprite, layer, id);\r\n this.pressed = false;\r\n this.down = false;\r\n }", "title": "" }, { "docid": "f3bd09c3b2c47dfe53152217324746f8", "score": "0.61350244", "text": "initButtons(){\n this.buttons = new Array(); //tableau contenant les boutons de menu (restart et next)\n this.buttonRestart = new MenuButton(\"Restart level\", \"ressources/Boutons/restart.png\", this.canvas, this.context,\n this.centre.x-this.sizeButton-20, this.centre.y+this.sizeButton+20,\n this.sizeButton, this.sizeButton, true, this.game);\n var clickable = this.game.currentLevel.levelNum+1 <= this.game.nbWins && this.game.currentLevel.levelNum+1 < this.levels.length;\n\n this.buttonNext = new MenuButton(\"Next level\", \"ressources/Boutons/next_level.png\", this.canvas, this.context,\n this.centre.x+20, this.centre.y+this.sizeButton+20,\n this.sizeButton, this.sizeButton, clickable, this.game);\n this.buttons.push(this.buttonRestart);\n this.buttons.push(this.buttonNext);\n }", "title": "" }, { "docid": "5b41c2f92867d62b10563f8b20cf044f", "score": "0.6041937", "text": "function LevelTab(element){\n\tvar level = this;\n\tthis.isActiveTab = false;\n\tthis.name = \"\";\n\tthis.gridSize = 0;\n\tthis.activeGridItem = null;\n\t\n\t// Used for the drag events\n\tthis.translate = {\n\t\tx: 0,\n\t\ty: 0\n\t};\n\tthis.mouseOffset = {\n\t\tx: 0,\n\t\ty: 0\n\t};\n\n\tthis.visibleRange = {\n\t\tminX: 0,\n\t\tminY: 0,\n\t\tmaxX: 0,\n\t\tmaxX: 0\n\t};\n\n\n\t// Holds the different grid objects\n\tthis.grid = [];\n\n\t// Temporary\n\tthis.canvas = document.createElement('canvas');\n\tthis.context = this.canvas.getContext('2d');\n\t$(element).append(this.canvas);\n\t// Save context with no modifications\n\tthis.context.save();\n\n\tthis.createLevel = function (levelParams){\n\t\tthis.name = levelParams.name;\n\t\tthis.sizeX = levelParams.sizeX;\n\t\tthis.sizeY = levelParams.sizeY;\n\t\tthis.gridSize = levelParams.gridSize;\n\n\t\t// Create grid\n\t\tfor(var y = 0; y <= this.sizeY; y++){\n\t\t\tfor(var x = 0; x <= this.sizeX; x++){\n\t\t\t\tthis.grid.push(new GridSquare(this.context, this.gridSize, y, x));\n\t\t\t}\n\t\t}\n\n\t\tthis.isActiveTab = true;\n\t\tthis.bindEvents();\n\t\tthis.calculateVisibleRange();\n\t\tsetInterval(function(){ \n\t\t\t//TODO: Change this to prevent the interval. Setter for isActive would help\n\t\t\tif(this.isActiveTab){\n\t\t\t\tlevel.draw(); \t\n\t\t\t}\n\t\t}.bind(this), 33);\n\t};\n\n\tthis.bindEvents = function(){\n\t\tvar level = this;\n\t\tthis.canvas.onselectstart = function(){ return false; }\n\t\t$(this.canvas).on('mousedown', function(e){ level.rightClickDown.call(level, e); });\n\t\t$(this.canvas).on('mousemove', function(e){ \n\t\t\tlevel.drag.call(level, e);\n\t\t\tlevel.gridHover.call(level, e);\n\t\t});\n\t\tthis.canvas.onmouseup = function(e){ level.rightClickUp.call(level, e); }\n\t\tthis.canvas.oncontextmenu = function(){ return false; }\n\t\twindow.onresize = function(e){ level.resizeCanvas.call(level, e); };\n\t};\n\n\tthis.rightClickDown = function(e){\n\t\tif(e.button !== 2){ return true; }\n\t\tthis.dragging = true;\n\t\tthis.mouseOffset.x = e.pageX;\n\t\tthis.mouseOffset.y = e.pageY;\n\t\treturn false;\n\t}\n\n\tthis.rightClickUp = function(){\n\t\tthis.dragging = false;\n\t}\n\n\t/* This function is responsible for dragging the canvas around during\n\t * a drag with the right click of the mouse\n\t */\n\tthis.drag = function(e){\n\t\tif(!this.dragging){ return;\t}\n\t\tthis.translate.x += e.pageX - this.mouseOffset.x;\n\t\tthis.translate.y += e.pageY - this.mouseOffset.y;\n\t\tthis.mouseOffset.x = e.pageX;\n\t\tthis.mouseOffset.y = e.pageY;\n\t\tthis.calculateVisibleRange();\n\t};\n\n\tthis.gridHover = function(e){\n\t\t// Calculate the new active grid and unselect the old one\n\t\tvar col = Math.floor((e.pageX-this.translate.x)/this.gridSize);\n\t\tvar row = Math.floor((e.pageY-this.translate.y)/this.gridSize);\n\t\tvar gridItem = this.selectGridByColRow(col,row);\n\t\tif(!gridItem || gridItem === this.activeGridItem){ return; }\n\t\tif(this.activeGridItem){\n\t\t\tthis.activeGridItem.active = false;\t\n\t\t}\n\t\tthis.activeGridItem = gridItem;\n\t\tthis.activeGridItem.active = true;\n\t};\n\n\tthis.draw = function(){\n\t\tthis.clear();\n \t\tthis.context.lineWidth = 2;\n \t\t// Determine visible items and only draw those items\n\t\tfor(var y=this.visibleRange.minY; y <= this.visibleRange.maxY; y++){\n\t\t\tfor(var x=this.visibleRange.minX; x <= this.visibleRange.maxX; x++){\n\t\t\t\tthis.selectGridByColRow(x,y).draw();\n\t\t\t}\n\t\t}\n\t};\n\n\t// Sets the visible range of grids to speed up \n\tthis.calculateVisibleRange = function(){\n\t\tthis.visibleRange.maxX = Math.ceil((this.canvas.width - this.translate.x) / this.gridSize);\n \t\tthis.visibleRange.maxY = Math.ceil((this.canvas.height - this.translate.y) / this.gridSize);\n \t\tthis.visibleRange.minX = Math.max(Math.floor(this.translate.x *-1/ this.gridSize),0);\n \t\tthis.visibleRange.minY = Math.max(Math.floor(this.translate.y *-1/ this.gridSize),0);\n\t};\n\n\tthis.resizeCanvas = function(){\n\t\tthis.context.canvas.width = window.innerWidth;\n\t\tthis.context.canvas.height = window.innerHeight;\n\t\tthis.context.save();\n\t\tthis.context.translate(this.translate.x, this.translate.y);\n\t\tthis.calculateVisibleRange();\n\t};\n\n\tthis.clear = function(){\n\t\tthis.context.restore();\n\t\tthis.context.save();\n\t\tthis.context.clearRect(0,0,this.canvas.width, this.canvas.height);\n\t\tthis.context.translate(this.translate.x, this.translate.y);\n\t};\n\n\tthis.selectGridByColRow = function(col, row){\n\t\tvar index = row*this.sizeX+col+row;\n\t\treturn this.grid[index];\n\t};\n}", "title": "" }, { "docid": "c17296ce83b964f75a4e10701ddd1d61", "score": "0.59368324", "text": "function Level(numLevel){\n this.numLevel = numLevel;\n // Main logic based on the level\n this.selectLevel();\n}", "title": "" }, { "docid": "000d4532d521f5093a5f1bfad0d1fc87", "score": "0.585435", "text": "__addNewLevel(index) {\n //Copy the the first button group\n let buttongroup = document.querySelector(\"#template-layer-block\");\n let copy = buttongroup.cloneNode(true);\n\n //Make the delete button visible since the first layer ui keeps it hidden\n copy.querySelector(\".delete-level\").style.visibility = \"visible\";\n\n //Change all the parameters for the UI elements\n\n //Update the level index for the layerblock\n copy.dataset.levelindex = String(index);\n\n //Change the Label\n let label = copy.querySelector(\".level-index\");\n label.innerHTML = \"LEVEL \" + (index + 1);\n\n //Change the button indices\n let flowbutton = copy.querySelector(\".flow-button\");\n flowbutton.dataset.layerindex = String(index * 3);\n setButtonColor(flowbutton, inactiveButtonBackground, inactiveButtonText);\n\n let controlbutton = copy.querySelector(\".control-button\");\n controlbutton.dataset.layerindex = String(index * 3 + 1);\n setButtonColor(controlbutton, inactiveButtonBackground, inactiveButtonText);\n\n //Add reference to the deletebutton\n let deletebutton = copy.querySelector(\".delete-level\");\n deletebutton.dataset.levelindex = String(index);\n\n return copy;\n }", "title": "" }, { "docid": "75f99288ba3378a5da45af3518cf8498", "score": "0.5788365", "text": "function load_buttons (loader, levelObj) {\r\n\r\n\tfor(var i=0; i<levelObj.buttonsArr.length; i++) {\r\n\r\n\t\t// id, model, x, z, pressed, script function..\r\n\r\n\t\tvar butsy = create_game_object();\r\n\t\tbutsy.gameID = levelObj.buttonsArr[i][0];\r\n\t\tbutsy.name = \"button\" + i;\r\n\t\tbutsy.model = levelObj.buttonsArr[i][1];\r\n\t\tbutsy.pressed = 0;\r\n\t\tbutsy.map_position.set(levelObj.buttonsArr[i][2],0,levelObj.buttonsArr[i][3]);\r\n\t\tbutsy.orientation = levelObj.buttonsArr[i][4];\r\n\t\t\r\n\t\t//set position depending on orientation\r\n\t\tif(butsy.orientation==0)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2])*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3]+0.5)*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 0, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==1)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2]-0.5)*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3])*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, Math.PI/2, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==2)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2])*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3]-0.5)*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 2*Math.PI/2, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==3)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2]+0.5)*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3])*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 3*Math.PI/2, 0);\r\n\t\t}\r\n\t\t\r\n\t\t//get js function from string\r\n\t\tvar onPressFn = window[levelObj.buttonsArr[i][5]];\r\n\t\tif(typeof onPressFn === 'function') \r\n\t\t{\r\n\t\t\tbutsy.onPressFunc = onPressFn;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tbutsy.onPressFunc = missing_click_function;\r\n\t\t}\r\n\r\n\t\tloadGameObjectCheck(loader, butsy);\r\n\t\t\r\n\t\tlevelObj.array_of_buttons.push(butsy);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "4ee493c7ef0ca066a9b3a56e55c2b042", "score": "0.57673675", "text": "function LoadLevels()\n{\n // Load levels json\n jsonLevels = JSON.parse(JSON.stringify(levels));\n levelCount = jsonLevels.length;\n\n // Create Levels buttons and add them to the array\n for (var i = 1; i <= levelCount; i++)\n {\n var button = { name: i, xPos: i/10, yPos: 0.1, xSize: 75, ySize: 40, px: 50, color: \"white\", font: \"Roboto-Light\"};\n levelsButtons.push(button);\n }\n\n}", "title": "" }, { "docid": "af06f56b03289add362cb7844e610dfb", "score": "0.5714516", "text": "function Level() {\n\n\tPhaser.State.call(this);\n\n}", "title": "" }, { "docid": "72d9c20a92287f254e4a10413298b58c", "score": "0.57042783", "text": "function runSelectLevel() {\n console.log(\"run select level\");\n\n if ($('#lButton').length === 0) {\n var b = $(\"#selectLevel section:first-child\").prepend($('<img>', {\n id: 'lButton',\n class: 'backButton',\n src: convertImgToUri(myLoader.getRessource(\"back\"))\n }));\n b.click(function () {\n DODDLE.game.whatsPrev();\n });\n }\n\n var txt, map, jsonMap, n = 1,\n levelDetails;\n // On supprime tous ce qui doit l'être (mais c'est utile comme commentaire)\n $(\"#selectLevel > article\").empty();\n\n currentWorld.levels.forEach((level, n) => {\n txt = myLoader.getRessource(level.name);\n jsonMap = JSON.parse(txt);\n // affichage d'un tableau\n // $(\"#selectLevel > article\").append(\"<div class='lvlDsc'><span><canvas id='\" + level.name + \"' class='level' width='80px' height='160px'/></span><span id='dsc\" + level.name + \"'></span></div>\");\n $(\"#selectLevel > article\").append(\"<div class='lvlDsc' id='\" + level.name + \"'><span></span></div>\");\n\n //var levelDetails = $('#' + level.name);\n var dsc = $('#' + level.name + ' > span');\n dsc.append($('<div>', {\n text: jsonMap.layers[0].name,\n class: 'title',\n id: 'title_' + level.name\n }));\n var title = $('#title_' + level.name);\n // Affichages des objectifs\n // objectif pourcentages de cubes\n if (jsonMap.properties.objectif != undefined)\n dsc.append($('<div class=\"title\"><img class=\"imgLevel\" src=\"' + convertImgToUri(myLoader.getRessource(\"cube\")) + '\"/><span>' + jsonMap.properties.objectif + '%</span></div>'));\n // Objectif temps\n if (jsonMap.properties.temps != undefined) {\n dsc.append($('<div class=\"title\"><img class=\"imgLevel\" src=\"' + convertImgToUri(myLoader.getRessource(\"clock\")) + '\"/><span>' + jsonMap.properties.temps + '</span></div>'));\n }\n //var ctx = levelDetails[0].getContext(\"2d\");\n var d = new drawGridMap(txt);\n //d.drawMap(ctx);\n var c = d.count();\n\n // Objectif case de fin\n if (c.end != undefined) {\n dsc.append($('<div class=\"title\"><img class=\"imgLevel\" src=\"' + convertImgToUri(myLoader.getRessource(\"next\")) + '\"/><span>Finish</span></div>'));\n }\n // Objectif nombre d'objet\n if (c.objets > 0) {\n dsc.append($('<div class=\"title\"><img class=\"imgLevel\" src=\"' + convertImgToUri(myLoader.getRessource(\"gift\")) + '\"/><span>' + c.objets + '</span></div>'));\n }\n\n //FIXME: a faire autrement\n if (level.ok)\n title.append($('<img class=\"imgLevel\" src=\"' + convertImgToUri(myLoader.getRessource(\"ok\")) + '\"/>'));\n\n // Affectation du click\n dsc.parent().click(function () {\n console.log(\" play \" + this.id);\n DODDLE.game.whatsNext(this.id);\n });\n });\n }", "title": "" }, { "docid": "21b27ac8380e0dd8b87dc3010da80eb5", "score": "0.56984043", "text": "function load_saved_button_states(loader, levelObj, saved_buttons) \r\n{\r\n\tfor(var i=0; i<levelObj.array_of_buttons.length; i++) \r\n\t{\r\n\t\tif(levelObj.array_of_buttons[i].pressed != saved_buttons[i])\r\n\t\t{\r\n\t\t\tlevelObj.array_of_buttons[i].pressed = saved_buttons[i];\r\n\r\n\t\t\t//if button is pressed, load it budged\r\n\t\t\tif(levelObj.array_of_buttons[i].pressed == 1)\r\n\t\t\t{\r\n\t\t\t\t//budge depends on orientation\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 1)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.x -= 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 3)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.x += 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 0)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.z += 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 2)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.z -= 0.05;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//unbudge depends on orientation\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 1)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.x += 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 3)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.x -= 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 0)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.z -= 0.05;\r\n\t\t\t\tif(levelObj.array_of_buttons[i].orientation == 2)\r\n\t\t\t\t\tlevelObj.array_of_buttons[i].mesh.position.z += 0.05;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "b70063aa93e85920a42939656fb6444d", "score": "0.5668399", "text": "function level1CreateUI() {\n var self = this;\n _(this).extend({\n toggle: null\n ,lamp: null\n ,launch_button: null\n ,readout: null\n ,toggle_width: 75\n ,lamp_width: 20\n ,button_width: 100\n ,readout_width: 46\n });\n\n // Create UI elements\n this.status = Crafty.e( 'DotMatrix' )\n .setup({ fontSize: 20 });\n\n this.readout = Crafty.e( 'SevenSegment, Offscreen' )\n .setup({ digits: 2, val: '--', fontSize: 30 });\n\n this.lamp = Crafty.e( '2D, Canvas, lamp_red' );\n\n this.toggle = Crafty.e( 'ToggleSwitch' )\n .switchType( 'small_toggle' )\n .bind( 'Toggle', function(is_on) {\n self.readout.val(is_on ? 'OK' : '--');\n self.readout.setGoodValue(is_on);\n self.lamp.sprite(is_on ? 1 : 0, 0);\n self.launch_button.setLock( !is_on );\n });\n\n this.launch_button = Crafty.e( 'PushButton' )\n .setup({ label: 'LAUNCH', fontSize: 16, sprite: 'large', latch: true })\n .bind( 'ButtonDown', function() { self._show_victory() } );\n}", "title": "" }, { "docid": "4786b91ca3f9b96a9bb04f697c2c8673", "score": "0.56628644", "text": "function createLevel (levelNumber) {\r\n\t\t// Reset the wrong answers counter\r\n\t\twrongAnswers = 0;\r\n\t\t\r\n\t\t// Remove all buttons from the previous level.\r\n\t\t$('.questions button').remove();\r\n\r\n\t\t// Reset audio and image sources.\r\n\t\t$(albumArt).attr('src', levels[levelNumber]['albumCoverSrc']);\r\n\t\t$(musicPlayer).attr('src', levels[levelNumber]['songSrc']);\r\n\r\n\t\t// Create new buttons\r\n\t\tpopulateButtons(answerNumbers, levelNumber);\r\n\t}", "title": "" }, { "docid": "18e73d06183a08e80147c59097498f9b", "score": "0.56555116", "text": "function buildLevelBtnAction () {\n $(\"#invalidLevelText\").hide();\n loadLevel($(\"#levelSelect\").val());\n}", "title": "" }, { "docid": "43a1d6500653c686936407e85b4677cf", "score": "0.56424326", "text": "function Level() {\n\t\n\tPhaser.State.call(this);\n\t\n}", "title": "" }, { "docid": "43a1d6500653c686936407e85b4677cf", "score": "0.56424326", "text": "function Level() {\n\t\n\tPhaser.State.call(this);\n\t\n}", "title": "" }, { "docid": "dc86a91bfc11e24099551693703720b6", "score": "0.5621777", "text": "function Level(levelNumber) {\n this.levelNumber = levelNumber;\n this.maxLevel = 0;\n if (this.levelNumber < 7) {\n this.levelImage = this.levelNumber;\n } else {\n this.levelImage = Math.floor(Math.random() * 6 + 1);\n }\n this.backgroundImage = new Background(0, 0, document.getElementById(\"backgroundImage\" + this.levelImage));\n this.worldWidth = document.getElementById(\"backgroundImage\" + this.levelImage).naturalWidth;\n this.worldHeight = document.getElementById(\"backgroundImage\" + this.levelImage).naturalHeight;\n this.bases = [];\n}", "title": "" }, { "docid": "729f5aed271199df5d8382dd25ff1e1f", "score": "0.5621153", "text": "function assignLevel() {\n $(\"button.difficulty\").on(\"click\", function() {\n ttt.level = ($(this)[0].id);\n chooseXO();\n });\n }", "title": "" }, { "docid": "b7d3f558345a681ef918fee152bd8c48", "score": "0.55999094", "text": "function gameLevel()\n {\n //operationId is used to store the operation button which is clicked i.e, event occurred\n window.operationId = event.target.id;\n document.body.innerHTML = \"\";\n for(var level=0;level<gameLevels.length;level++)\n {\n window.levelButtonElement = document.createElement(\"button\");\n window.node = document.createTextNode(gameLevels[level]);\n levelButtonElement.appendChild(node);\n levelButtonElement.id = gameLevels[level];\n document.body.appendChild(levelButtonElement);\n levelButtonElement.onclick = mathOperation;\n }\n }", "title": "" }, { "docid": "17f870e310eb66e74c8fd4fc76d7cc64", "score": "0.55958587", "text": "function load_saved_buttons (loader, levelObj, saved_buttons) {\r\n\r\n\tfor(var i=0; i<levelObj.buttonsArr.length; i++) {\r\n\r\n\t\t// id, model, x, z, pressed, script function..\r\n\r\n\t\tvar butsy = create_game_object();\r\n\t\tbutsy.gameID = levelObj.buttonsArr[i][0];\r\n\t\tbutsy.name = \"button\" + i;\r\n\t\tbutsy.model = levelObj.buttonsArr[i][1];\r\n\t\tbutsy.pressed = saved_buttons[i];\r\n\t\tbutsy.map_position.set(levelObj.buttonsArr[i][2],0,levelObj.buttonsArr[i][3]);\r\n\t\tbutsy.orientation = levelObj.buttonsArr[i][4];\r\n\t\r\n\t\t//set position depending on orientation\r\n\t\tif(butsy.orientation==0)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2])*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3]+0.5)*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 0, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==1)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2]-0.5)*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3])*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, Math.PI/2, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==2)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2])*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3]-0.5)*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 2*Math.PI/2, 0);\r\n\t\t}\r\n\t\tif(butsy.orientation==3)\r\n\t\t{\r\n\t\t\tbutsy.position.set((levelObj.buttonsArr[i][2]+0.5)*SQUARE_SIZE,0.4*SQUARE_SIZE,(levelObj.buttonsArr[i][3])*SQUARE_SIZE);\r\n\t\t\tbutsy.rotation.set(0, 3*Math.PI/2, 0);\r\n\t\t}\r\n\r\n\t\t//if button is pressed, load it budged\r\n\t\tif(butsy.pressed == 1)\r\n\t\t{\r\n\t\t\t//budge depends on orientation\r\n\t\t\tif(butsy.orientation == 1)\r\n\t\t\t\tbutsy.position.x -= 0.05;\r\n\t\t\tif(butsy.orientation == 3)\r\n\t\t\t\tbutsy.position.x += 0.05;\r\n\t\t\tif(butsy.orientation == 0)\r\n\t\t\t\tbutsy.position.z += 0.05;\r\n\t\t\tif(butsy.orientation == 2)\r\n\t\t\t\tbutsy.position.z -= 0.05;\r\n\t\t}\r\n\r\n\t\t//get js function from string\r\n\t\tvar onPressFn = window[levelObj.buttonsArr[i][5]];\r\n\t\tif(typeof onPressFn === 'function') \r\n\t\t{\r\n\t\t\tbutsy.onPressFunc = onPressFn;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tbutsy.onPressFunc = missing_click_function;\r\n\t\t}\r\n\r\n\t\tloadGameObjectCheck(loader, butsy);\r\n\t\t\r\n\t\tlevelObj.array_of_buttons.push(butsy);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "229ec801c24833d5ef3f4b2896991bd7", "score": "0.5573061", "text": "getLevelList() {\n const levelList = this.state.levelList.map((level, i) => {\n const selectLevel = this.selectLevel.bind(this, level, i);\n const className = this.state.levelIndex === i\n ? 'list-group-item list-group-item-info' : 'list-group-item';\n\n const nActors = level.getActors().length;\n const nActorsShow = nActors ? 'A:' + nActors : '';\n const nItems = level.getItems().length;\n const nItemsShow = nItems ? 'I:' + nItems : '';\n\n return (\n <a className={className}\n href='#'\n key={level.getID()}\n onClick={selectLevel}\n >\n L{level.getID()}:\n {level.getMap().cols}x{level.getMap().rows}|{nActorsShow}|\n {nItemsShow}\n <button\n className='btn-xs btn-danger pull-right'\n id={i}\n onClick={this.deleteLevel}\n >X</button>\n </a>\n );\n });\n return levelList;\n }", "title": "" }, { "docid": "82ad0c6f0a0b0df691700275eeccf31a", "score": "0.553643", "text": "selectLevel(level, i) {\n this.setState({level: level, levelIndex: i});\n }", "title": "" }, { "docid": "fbc8ccf1c600ed6fbfbff2bdaeec20c6", "score": "0.5510441", "text": "#typeOfLevelButton(button, isUnlocked, level){\n\n button.textContent = level;\n button.setAttribute(LEVEL_BUTTONS_NAME_OF_ATTRIBUTE_WITH_LEVEL, level);\n button.setAttribute(LEVEL_BUTTONS_NAME_OF_ATTRIBUTE_WITH_STATUS, isUnlocked);\n button.classList.add(LEVEL_BUTTONS_CLASS);\n\n if(isUnlocked) button.classList.add(UNLOCKED_LEVEL_BUTTON_CLASS)\n else{\n button.classList.add(LOCKED_LEVEL_BUTTON_CLASS)\n button.innerHTML += `<span class=\"fas fa-lock\"></span>`\n } \n }", "title": "" }, { "docid": "78f7d54bc07640db1365f6f9b519ac0e", "score": "0.5508635", "text": "function loadLevels(){\n var customLevelDiv = $('#customLevels');\n customLevelDiv.empty();\n customLevelDiv.show();\n for(var i = 0; i < customLevels.length; i++){\n var div = $('<div/>');\n div.addClass(\"customLevelButtonDiv\");\n\n var button = $('<input>');\n var label = $('<label>');\n button.attr({class: 'levelButton', 'type': 'button', 'data-level': i, 'id': \"level\" + i});\n label.text(i+1);\n label.attr('for', \"level\" + i);\n button.click(loadLevel);\n div.append(button, label);\n\n var name = $('<p/>');\n name.text(customLevels[i].name);\n div.append(name);\n customLevelDiv.append(div);\n\n var deleteButton = $('<button/>').text('Delete Level');\n deleteButton.click(deleteLevel);\n deleteButton.addClass(\"btn btn-danger\");\n deleteButton.css('font-size', '10px');\n div.append(deleteButton);\n }\n}", "title": "" }, { "docid": "67c24d489d1f73921c6afdb868195251", "score": "0.5446754", "text": "init({ level }) {\n this.level = level\n }", "title": "" }, { "docid": "e5e716cdf073df87846c433ed40528dd", "score": "0.5442033", "text": "constructor(x, y, w, h, gs, color) {\n if (buttons_constructor) console.log(\"Creating Button\");\n if (buttons_constructor) console.log(\"x: \" + x + \" y: \" + y + \" w: \" + w + \" h: \" + h);\n this.x = x; // pixel values\n this.y = y; // pixel values\n this.w = w;\n this.h = h;\n this.gs = gs; // game state\n this.LeftX = x + w / 2;\n this.RightX = x - w / 2;\n this.TopY = y - h / 2;\n this.BotY = y + h / 2;\n\n this.round = 20;\n this.id = \"\";\n\n this.text = \"Test\"\n this.hoverColor = 0;\n this.color = color;\n this.currentColor = this.color;\n\n this.invalid = false;\n\n this.border = 0;\n this.borderWeight = 0;\n\n this.textColor = 0;\n }", "title": "" }, { "docid": "231070210f6fa842a6957c733993ce0f", "score": "0.5436088", "text": "function Level(levelMap, spriteManager, backgroundCanvasId, actorsCanvasId, statusCanvasId) {\n\tvar mapWidth = levelMap.width*levelMap.tilewidth;\n\tvar mapHeight = levelMap.height*levelMap.tileheight;\n\n\tthis.spriteManager = spriteManager;\n\tthis.background = new Background(backgroundCanvasId, mapWidth, mapHeight, spriteManager);\n\t//this.spriteBackground = new SpriteBackground(backgroundCanvasId, mapWidth, mapHeight, spriteManager);\n\tthis.actors = new Actors(actorsCanvasId, mapWidth, mapHeight, spriteManager); \n\tthis.statusbar = new Statusbar(statusCanvasId, mapWidth, mapHeight, spriteManager);\n\tthis.tileWidth = levelMap.tilewidth;\n\tthis.tileHeight = levelMap.tileheight;\n\tthis.levelMap = levelMap;\n\tthis.collisionEngine = new CollisionEngine(levelMap.width, levelMap.height);\n\n\tconsole.log(\"Loading map\");\n}", "title": "" }, { "docid": "2693cfc8c433bb5fcc7a24899ca3f150", "score": "0.53600115", "text": "addLevelToEditor(level) {\n level.getMap()._optimizeForRowAccess();\n level.editorID = this.state.idCount++;\n\n const levelList = this.state.levelList;\n levelList.push(level);\n // Show the newly added level immediately\n const levelIndex = levelList.length - 1;\n this.setState({level: level, levelList, levelIndex});\n }", "title": "" }, { "docid": "8ebd9a089333484db7e37e3825478333", "score": "0.5276996", "text": "function Level1() {\n\t\n\tPhaser.State.call(this);\n\t\n}", "title": "" }, { "docid": "adbe469e2032677c5770d137bf806133", "score": "0.52407414", "text": "function NZButton(x, y, rMin, rMaj, clr, meta){\n this.pos = {\n x: x,\n y: y\n };\n\n this.rMin = rMin;\n this.rMaj = rMaj;\n\n this.dotArcs = 6;\n this.dotLvls = clr.length;\n this.nTxtr = 10;\n\n this.isClicked = false;\n\n\n // this.txtr = [];\n\n\n // for (var i = 0; i < this.nTxtr; i++) {\n // this.txtr[i] = this.makeTexturePad(clr, i);\n // }\n\n // this.minDot = new PIXI.Sprite(Geometri.drawCircleTexture(clr, r));\n\n this.curLvl = 0;\n this.btn = new PIXI.Sprite(this.makeTexturePad(clr));\n this.btn.interactive = true;\n this.btn.buttonMode = true;\n this.btn.anchor.x = 0.5;\n this.btn.anchor.y = 0.5;\n this.btn.position = this.pos;\n // this.btn.position.y = y;\n this.btn.meta = meta;\n // this.c.i = clr.i;\n //\n\n this.defaultScale = 0.4;\n this.activity = 0;\n this.unclicked();\n this.breathTime = 200;\n this.breathed = (new Date()).getTime();\n}", "title": "" }, { "docid": "c5f765b9706f8e94829e8c48b0088d62", "score": "0.5230602", "text": "function Level(plan) {\n this.width = (plan.background)[0].length;\n this.height = plan.background.length;\n this.background = [];\n this.actors = [];\n this.resArea = [];\n this.display = document.getElementById(\"gamePanel\");\n this.gems = +$(\"#gems\").text();\n var y,x,r,g;\n\n for (y = 0; y < this.height; y++) {\n var line = plan.background[y],\n gridLine = [];\n for (x = 0; x < this.width; x++) {\n var ch = line[x],\n bgType = BgChars[ch];\n gridLine.push(bgType);\n }\n this.background.push(gridLine);\n }\n\n for (r = 0; r < this.height; r++) {\n var lineA = plan.actors[r];\n for (g = 0; g < this.width; g++) {\n var chA = lineA[g],\n Actor = ActorChars[chA];\n if (Actor)\n this.actors.push(new Actor(new Vector(g, r), chA));\n }\n }\n\n for (y = 0; y < this.height; y++) {\n for (x = 0; x < this.width; x++) {\n if (plan.restArea[y][x] === \"r\")\n this.resArea.push(new Vector(x, y));\n }\n }\n //use filter method to find the player object.\n this.player = this.actors.filter(function (actor) {\n return actor.type === \"player\";\n })[0];\n /*status stands for whether the level is over or not, when the level is over, it will be set\n *to \"won\" or \"lost\". If level is over, the finishDelay will be set to 1 second to keep the \n *level active for a short period.\n */\n this.status = this.finishDelay = null;\n //running means the level is running, not paused.\n this.running = true;\n}", "title": "" }, { "docid": "e0d16a03db58f8b2fda84be36c77df6b", "score": "0.52160084", "text": "function reload_buttons(levelObj)\r\n{\r\n\tfor(var i=0; i<levelObj.array_of_buttons.length;i++)\r\n\t{\r\n\t\tscene.add(levelObj.array_of_buttons[i].mesh);\r\n\t}\r\n}", "title": "" }, { "docid": "b9f17fbff211db30db98a77ae6c392bf", "score": "0.5208471", "text": "function LevelSelect(options) {\n\n\t\toptions = options || {};\n\n\t\tthis.unlocked = localStorage.Sol_progress ? parseInt(localStorage.Sol_progress) : 0;\n\n\t\t//not sure, but scrollPosition needs to be the negative of selection, probably because it's an offset from 0\n\t\tthis.scrollPosition = 0;\n\t\tthis.scrollVelocity = 0;\n\n\t\tthis.selection = 0;\n\t\tthis.highlight = -1;\n\n\t\tthis.beingDragged = false;\n\t\tthis.animatingToSelection = false;\n\n\t\tthis.clickPoint = null;\n\t\tthis.clickTime = null;\n\n\t\tthis.xy = options.xy || [0, 0];\n\n\t\tthis.size = options.size || [0, 0];\n\n\t\tthis.bounds = new global.Rectangle(this.xy.slice(), this.size);\n\n\t\tthis.positions = [global.gameDimensions[1] - this.size[1], global.gameDimensions[1]];\n\n\t\tthis.slideProgress = 1;\n\t\tthis.slideDirection = 0;\n\t\tthis.visible = false;\n\n\t\tthis.fontSize = options.fontSize || 100;\n\t\tthis.spaceBetween = this.fontSize + 50;\n\n\t\t//animation helper values\n\t\tthis.dt = 0;\n\t\tthis.lastMousePosition = 0;\n\n\t\tthis.oldSelection = 0;\n\t\tthis.newSelection = 0;\n\t\tthis.selectionTime = 0;\n\n\t}", "title": "" }, { "docid": "07fd4b55570cf53e9eef07f8247002c0", "score": "0.51933306", "text": "constructor(x, y, id, type, state) {\n\n this.x = x;\n this.y = y;\n this.id = id;\n this.children = {};\n this.activePath = null;\n this.state = state;\n \n switch (type) {\n case 'base' :\n var sprite = this.state.layer1.create(x, y, 'base');\n sprite.scale.setTo(0.5, 0.5);\n sprite.anchor.setTo(0.5, 0.5);\n this.idText = new Phaser.Text(state.game, x, y, id, { font: '25px Arial', fill: '#ffffff' });\n this.idText.anchor.setTo(0.5, 0.5)\n state.layer1.add(this.idText);\n break;\n case 'honeypot' :\n var sprite = this.state.layer1.create(x, y, 'honeypot');\n sprite.scale.setTo(0.5, 0.5);\n sprite.anchor.setTo(0.5, 0.5);\n this.idText = new Phaser.Text(state.game, x, y, id, { font: '25px Arial', fill: '#ffffff' });\n this.idText.anchor.setTo(0.5, 0.5)\n state.layer1.add(this.idText);\n break;\n case 'node' :\n var sprite = this.state.layer1.create(x, y, 'node');\n sprite.scale.setTo(0.25, 0.25);\n sprite.anchor.setTo(0.5, 0.5);\n this.idText = new Phaser.Text(state.game, x, y, id, { font: '25px Arial', fill: '#ffffff' });\n this.idText.anchor.setTo(0.5, 0.5)\n state.layer1.add(this.idText);\n break;\n }\n\n this.selectChild = function(id) {\n if (id in this.children) {\n this.activePath = this.children[id];\n }\n }\n\n this.addChild = function(node) {\n this.children[node.id] = node;\n };\n\n this.destroy = function() {\n this.idText.destroy();\n };\n }", "title": "" }, { "docid": "bf66c150bc8832ea18847c6142e0d25e", "score": "0.51915574", "text": "constructor(building, that) {\r\n\r\n super();\r\n this.building = building;\r\n this.that = that;\r\n for(let x=0; x<Object.keys(building).length; x++) {\r\n name = Object.keys(building)[x];\r\n this[name] = building[name];\r\n }\r\n this.buttons = [];\r\n\r\n this.bing();\r\n\r\n let b = {}; // new Button();\r\n b.x = 50;\r\n b.y = 125;\r\n b.w = 50;\r\n b.h = 50;\r\n b.offset = {\"x\": 100, \"y\": 100}; \r\n b.type = \"upgrade\";\r\n b.text = \"Upgrade\";\r\n b.color = \"#00ff00\";\r\n b.active = false;\r\n b.action = this.upgradeBuilding;\r\n let bb = new Button(b);\r\n this.buttons.push(new Button({\"active\": true, \"x\": 400, \"y\": 300, \"w\": 100, \"h\": 30, \"text\": \"Exit\", \"screen\": this, \"action\": this.exitScreen}));\r\n //this.buttons.push(new Button({\"active\": true, \"x\": 400, \"y\": 350, \"w\": 100, \"h\": 30, \"text\": \"Details\", \"screen\": this, \"action\": this.detailsScreen}));\r\n this.buttons.push(bb);\r\n console.log(this);\r\n \r\n cities[currentCity].active = false;\r\n buildingHandler.highlightGrid = false;\r\n }", "title": "" }, { "docid": "6968ac9446e467269c36dd79ed9d47ac", "score": "0.519132", "text": "function initLevel(){\n var xPos;\n var yPos;\n var bType = 0;\n //create obstacle ojects\n for (i=0;i<levelAr.length;i++){\n // if (levelAr[i] > 0){\n\t\t\tyPos = Math.floor(i/levelArSize[0])* levelBlockSize[1] + boardPosition[1];\n\t\t\txPos = (i - (Math.floor(i/levelArSize[0]) *levelArSize[0])) * levelBlockSize[0] + boardPosition[0];\n\t\t\t//check if box is a board peice or not\n\t\t\tif (levelAr[i] == 1) bType = BOARDBOX;\n\t\t\telse bType = EMPTYBOX;\n\t\t\tmakeGameBox(xPos ,yPos,levelBlockSize[0],levelBlockSize[1],\"#990000\",\"#ff3333\",bType,i);// red\n //}\n }\n //create moveable game objects\n for (i=0;i<levelGamePeices;i++){\n yPos = (levelArSize[1]*levelBlockSize[1]) - ((i+1) * levelBlockSize[1])+ boardPosition[1];// Math.floor(i/levelArSize[0])* levelBlockSize[1] + boardPosition[1];\n xPos = 250;\n //make playable blocks. their board index is -1 because they are not on the board yet\n makeGameBox(xPos ,yPos,levelBlockSize[0],levelBlockSize[1],\"#6666cc\",\"#ccccff\",PLAYABLEBOX,-1);//blue\n }\n //create shadowBox object\n initBox(shadowBox,0,0,levelBlockSize[0],levelBlockSize[1],\"#6666cc\",\"#ccccff\",0);\n\n}", "title": "" }, { "docid": "afff19420a9522af9109c190a5e30a4a", "score": "0.5186101", "text": "__generateLevelActionButtonHandlers() {\n let deleteButtons = document.querySelectorAll(\".delete-level\");\n\n let ref = this;\n\n for (let i = 0; i < deleteButtons.length; i++) {\n let deletebutton = deleteButtons[i];\n deletebutton.addEventListener(\"click\", function(event) {\n ref.deleteLevel(parseInt(deletebutton.dataset.levelindex));\n });\n }\n }", "title": "" }, { "docid": "e8027e4c2f3acc8c81db6733916b872d", "score": "0.51855284", "text": "function levelStyle() {\n $('.gameLevel').html('');\n for (let i = 0; i < 20; i++) {\n $('.gameLevel').html($('.gameLevel').html() + `<div class=\"gameBrick\"></div>`)\n }\n $('.gameBrick').each((ind, elem) => {\n brickStyle = `${levelKeys[levelNumber][ind]}`;\n if (brickStyle.slice(0, 1) == '1') {\n $(elem).addClass('rotatable');\n $(elem).css({\n 'backgroundImage': 'none',\n 'borderRadius': '50%',\n 'backgroundColor': 'rgb(167, 167, 167)'\n });\n if (brickStyle.slice(1, 2) == '1') {\n $(elem).addClass('rotateKey');\n }\n }\n if (brickStyle.slice(4, 5) != '_') {\n $(elem).html(svgArr[0] + lineArr[brickStyle.slice(3, 4)] + lineArr[brickStyle.slice(4, 5)] + svgArr[1]);\n }\n else {\n $(elem).html(svgArr[0] + lineArr[brickStyle.slice(3, 4)] + svgArr[1]);\n }\n\n });\n\n // setting rotate-function to round gamebricks\n let randomDegIndex = () => Math.round(Math.random() * 3);\n let degrees = ['0deg', '90deg', '180deg', '270deg'];\n\n $('.rotatable').each((ind, elem) => {\n let index = randomDegIndex();\n $(elem).css({\n transform: `rotate(${degrees[index]})`\n })\n });\n $('.rotatable').click(function () {\n let elemDegress = getDegrees($(this));\n if (elemDegress == 270) {\n $(this).css({\n transform: `rotate(0deg)`\n })\n } else {\n $(this).css({\n transform: `rotate(${elemDegress + 90}deg)`\n })\n };\n moves++;\n $('.moves').text(`Moves: ${moves}`);\n checkResult();\n })\n }", "title": "" }, { "docid": "1d5cc34ea54948ed00328c02f7ebb060", "score": "0.5185208", "text": "addLayerButton(layer) {\n let layerItem = document.createElement(\"div\");\n layerItem.textContent = `${layer.name}`;\n layerItem.setAttribute(\"ref\", `${layer.id}-toggle`);\n layerItem.addEventListener(\"click\", e => this.toggleMapLayer(layer.id));\n this.refs.buttons.appendChild(layerItem);\n }", "title": "" }, { "docid": "7dc6bab761338e31428d8d6593ae1751", "score": "0.51788497", "text": "constructor(parent, level) {\n this.dom = elt(\"div\", {class: \"game\"}, drawGrid(level));\n this.actorLayer = null;\n parent.appendChild(this.dom);\n }", "title": "" }, { "docid": "2dca31c7daa6f6088736b5a8189d29bf", "score": "0.51784754", "text": "function createLevel(number) {\n\tplatforms.length = 0\n\t\t\t\t\t\t$('.platform, .platform1, .goal, .ground').remove(); /*\tFor level creation\t*/\n\t$('.enemy, .enemy1, .lifePiece, .spike, .button, .pitcher').remove();\n\tobstacleNumber = 0;\n\ti = 0;\n\n\tbackPositionX=0;\n\tparallaxPositionX=0;\n\n\tinstructionNumber = 0;\n\n\t$('#instructions').html(\"\");\n\t$('#instructions').css('display','none')\n\n\tlevel=number;\n\n\t$('#parallax').attr('src','imgs/map' + number + '_parallax.jpg');\n\t$('.back').attr('src','imgs/map' + number + '_back.png');\n\t$('.front').attr('src','imgs/map' + number + '_front.png');\n\t$('.constant_front').attr('src','imgs/map' + number + '_constant_front.png');\n\n\n\tif (number == 1){\n\t\tcreateObject(i,0,563,592,60,'platform');\n\t i++;\n\t\tcreateObject(i,337,344,220,90,'platform1');\n\t i++;\n\t\tcreateObject(i,805,560,190,60,'platform');\n\t i++;\n\t\tcreateObject(i,773,238,212,128,'platform1');\n\t i++;\n\t\tcreateObject(i,853,160,60,60,'goal');\n\n\t\tinstructionTotal = 3;\n\n\t\tplayerPositionX = 50;\n\t\tif (lives < 3){\n\t\t\tplayerPositionX = 150;\n\t\t}\n\n\t\tplayerPositionY = 560;\n\n\t\tbackWidth = 1000;\n\n\t\t$('#instructions').html('<h1>Use <span class=\"key\">A</span> and <span class=\"key\">D</span> to move around.</h1>');\n\t\t\t\t\t\t$('.platform, .platform1, .goal').remove(); /*\tFor level creation\t*/\n\t}\n\n\tif (number == 2){\n\t\t$('#rocket').remove();\n\n\t\tcreateObject(i,0,263,200,350,'platform');\n\t i++;\n\t\tcreateObject(i,200,554,720,90,'platform');\n\t i++;\n\t\tcreateObject(i,520,440,140,200,'platform1');\n\t i++;\n\t\tcreateObject(i,660,490,70,100,'platform1');\n\t i++;\n\t\tcreateObject(i,220,494,97,60,'enemy',6,260,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,873,438,212,28,'platform1');\n\t i++;\n\t\tcreateObject(i,964,60,30,30,'lifePiece');\n\t i++;\n\t\tcreateObject(i,1026,378,97,60,'enemy',-3,142,'horizontal');\n\t i++;\n\t\tcreateObject(i,1475,248,250,362,'platform');\n\t i++;\n\t\tcreateObject(i,1650,150,125,510,'platform');\n\t i++;\n\t\tcreateObject(i,1650,150,300,20,'platform');\n\t i++;\n\t\tcreateObject(i,1650,246,600,30,'platform');\n\t i++;\n\t\tcreateObject(i,1650,268,400,400,'platform');\n\t i++;\n\t\tcreateObject(i,2200,563,1000,400,'platform');\n\t i++;\n\t\tcreateObject(i,1400,202,75,402,'platform');\n\t i++;\n\t\tcreateObject(i,1300,524,250,362,'platform');\n\t i++;\n\t\tcreateObject(i,2350,88,200,72,'platform1');\n\t\ti++;\n\t\tcreateObject(i,1475,188,97,60,'enemy',6,125,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,1820,188,97,60,'enemy',8,350,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,1800,198,30,30,'lifePiece');\n\t i++;\n\t\tcreateObject(i,2220,513,30,30,'lifePiece');\n\t i++;\n\t\tcreateObject(i,2200,350,140,70,'platform1');\n\t i++;\n\t\tcreateObject(i,2400,28,60,60,'goal');\n\t i++;\n\t\tcreatePitcher(i,1310,370,79,160);\n\n\t\tinstructionTotal = 3;\n\n\t\tplayerPositionX = 100;\n\t\tplayerPositionY = 200;\n\n\t\tbackWidth = 2593;\n\n\t\t$('#instructions').html(\"<h1>Watch Out! <img src='imgs/monster.png'/>s can kill you. Jump on their heads to kill them.</h1>\");\n\t\t\t\t\t\t\t$('.platform, .platform1, .pitcher').remove(); /*\tFor level creation\t*/\n\n\t}\n\n\tif (number == 3){\n\t\tinstructionTotal = 0;\n\n\t\tplayerPositionX = 20;\n\t\tplayerPositionY = 233;\t\n\n\t\tbackWidth = 2008;\n\n\t\tcreateObject(i,0,263,250,30,'platform');\n\t\ti++;\n\t\tcreateObject(i,0,363,450,70,'platform');\n\t\ti++;\n\t\tcreateObject(i,80,303,97,60,'enemy',5,250,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,0,433,120,70,'platform');\n\t\ti++;\t\t\n\t\tcreateObject(i,0,293,70,70,'platform');\n\t\ti++;\n\t\tcreateObject(i,135,448,30,30,'lifePiece');\n\t\ti++;\n\t\tcreateObject(i,700,303,102,600,'platform');\n\t\ti++;\n\t\tcreateObject(i,802,453,202,600,'platform');\n\t\ti++;\n\t\tcreateObject(i,892,433,60,27,'button',0,10,'vertical');\n\t\ti++;\n\t\tcreateObject(i,984,303,262,600,'platform');\n\t\ti++;\n\t\tcreateObject(i,1018,353,174,60,'spike',0,100);\n\t\ti++;\n\t\tcreateObject(i,-1018,120,174,60,'spike1',0,100);\n\t\ti++;\n\t\tcreateObject(i,1004,00,132,110,'platform');\n\t\ti++;\n\t\tcreateObject(i,1008,248,97,60,'enemy',4,138,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,1206,463,602,223,'platform');\n\t\ti++;\n\t\tcreateObject(i,000,510,700,600,'platform');\n\t\ti++;\n\t\tcreateObject(i,120,450,584,60,'spike',0,'none');\n\t\ti++;\n\t\tcreateObject(i,1004,-100,202,140,'platform');\n\t\ti++;\n\t\tcreateObject(i,1004,110,202,130,'platform');\n\t\ti++;\n\t\tcreateObject(i,1146,50,30,30,'lifePiece');\n\t\ti++;\n\t\tcreateObject(i,1608,303,200,330,'platform');\n\t\ti++;\n\t\tcreateObject(i,1808,0,200,1600,'platform');\n\t\ti++;\n\t\tcreateObject(i,1308,303,240,100,'platform');\n\t\ti++;\n\t\tcreateObject(i,1248,403,97,60,'enemy',6,300,'horizontal');\n\t\ti++;\n\t\tcreateObject(i,1398,403,60,60,'goal');\n\t\ti++;\n\t\tcreateObject(i,80,318,30,30,'lifePiece');\n\t\t\t\t\t\t$('.platform, .platform1, .goal').remove(); /*\tFor level creation\t*/\n\n\t}\n\n\tif (number == 4){\n\t\tcreateObject(i,0,563,592,60,'platform');\n\t\ti++;\n\t\tcreateObject(i,500,503,532,60,'platform');\t\n\t\ti++;\n\t\tcreateObject(i,-250,473,532,60,'platform');\t\n\t\ti++;\n\t\tcreateObject(i,-200,533,532,60,'platform');\t\t\n\t\ti++;\n\t\tcreateObject(i,-200,173,532,60,'platform',3,400,'horizontal');\t\t\n\t\ti++;\n\t\tcreateObject(i,335,503,90,90,'enemy1',2,100,'horizontal');\t\n\t\ti++;\n\t\tcreateObject(i,750,443,97,60,'enemy',5,200,'horizontal');\t\n\t\ti++;\n\t\tcreateObject(i,500,443,97,60,'enemy',2,50,'horizontal');\t\n\t\ti++;\n\t\tcreateObject(i,700,173,532,60,'platform');\t\t\n\t\ti++;\n\t\tcreateObject(i,1000,113,60,60,'goal');\t\n\n\t\tinstructionTotal = 1;\n\n\t\tplayerPositionX = 100;\n\t\tplayerPositionY = 460;\t\n\n\t\tbackWidth = 3000;\n\t}\n}", "title": "" }, { "docid": "148b17341ed3835bb14e3b035f81af66", "score": "0.51745445", "text": "deleteLevel(levelindex) {\n //First tell the viewmanager to delete the levels\n Registry.viewManager.deleteLayerBlock(levelindex);\n //Next delete the ux buttons\n let buttongroups = this.__toolBar.querySelectorAll(\".layer-block\");\n\n for (let i = 0; i < buttongroups.length; i++) {\n if (buttongroups[i].dataset.levelindex === levelindex) {\n this.__toolBar.removeChild(buttongroups[i]);\n }\n }\n\n this.__levelCount -= 1;\n\n this.__generateUI();\n\n Registry.currentLayer = Registry.currentDevice.layers[0];\n this.setActiveLayer(\"0\");\n Registry.viewManager.updateActiveLayer();\n }", "title": "" }, { "docid": "b6f86e221499f0248d0a5809b94a3c54", "score": "0.5169082", "text": "constructor(tile) {\n\n super();\n\n this.tile = tile;\n console.log(this.tile);\n\n this.selectedTroops = [];\n this.troopsAvailable = [];\n this.name = \"Marching\";\n this.load = 0;\n\n // for(let x=0; x<Object.keys(troopBuilding).length; x++) {\n // name = Object.keys(troopBuilding)[x];\n // this[name] = troopBuilding[name];\n // }\n\n // get the troops into a list we can use better\n for(let x=0; x<troopList.length; x++) {\n if(troopList[x]) {\n for(let y=0; y<troopList[x].levels.length; y++) {\n if(troopList[x].levels[y] != null) {\n this.troopsAvailable.push(troopList[x].levels[y]);\n let troopType = troopList[x].type;\n let tier = troopList[x];\n }\n }\n }\n }\n console.log(\"troops \" + this.troopsAvailable);\n\n\n console.log(\"this is March constructor\");\n\n this.buttons = [];\n\n this.buttons.push(new Button({\"active\": true, style: \"circle\", radius: 50, \"x\": 500, \"y\": 100, \"w\": 100, \"h\": 30, \"text\": \"Exit\", \"screen\": this, \"action\": this.exitScreen}));\n this.buttons.push(new Button({\"active\": true, \"name\": \"march\", \"x\": 365, \"y\": 500, \"w\": 100, \"h\": 30, \"text\": \"March\", \"screen\": this, \"action\": this.march}));\n // this.buttons.push(new Button({\"active\": true, \"drawButton\": false, \"direction\": \"left\", \"name\": \"troopleft\", \"x\": 75, \"y\": 200, \"w\": 128, \"h\": 128, \"text\": \"Left\", \"screen\": this, \"action\": this.viewTiers}));\n // this.buttons.push(new Button({\"active\": true, \"drawButton\": false, \"direction\": \"right\", \"name\": \"troopright\", \"x\": 420, \"y\": 200, \"w\": 128, \"h\": 128, \"text\": \"Right\", \"screen\": this, \"action\": this.viewTiers}));\n\n this.inputs = [];\n if(troopList) {\n let counter = 0;\n for(let x=0; x<troopList.length; x++) {\n if(troopList[x]) {\n for(let y=0; y<troopList[x].levels.length; y++) {\n //this.troopsAvailable.push(troopList[x].levels[y]);\n if(troopList[x].levels[y] != null) {\n let availableQuantity = troopList[x].levels[y].quantity;\n\n let i = {};\n i.id = 'quantityInput';\n i.name = 'quantityInput[]';\n i.type = 'number'; \n i.min = 0;\n i.max = availableQuantity;\n i.value = 0;\n\n let iData = {x: 268 + this.x, y: (160 + (counter * 35))};\n let newI = new NewInput(i, iData);\n\n this.inputs.push(newI);\n counter ++;\n }\n\n }\n }\n }\n }\n\n mapScreen.active = false;\n cities[currentCity].active = false;\n buildingHandler.highlightGrid = false;\n\n this.setStartLoad();\n }", "title": "" }, { "docid": "3771d00de845bf93e105b436d4a2d358", "score": "0.51646674", "text": "constructor() {\n\t\tthis.buttonsIdx = Object.freeze({\n\t\t\tstart: 0,\n\t\t\thighscores: 1,\n\t\t\texit: 2,\n\t\t\tlength: 3,\n\t\t});\n\t\tthis.renderer = window.GAME.renderManager.menuRenderer;\n\n\t\tthis.currentButtonIdx = this.buttonsIdx.start;\n\n\t\tthis.map = Object.freeze({\n\t\t\t38: 0, // Up\n\t\t\t40: 2, // Down\n\t\t\t75: 0, // Vim up\n\t\t\t74: 2, // Vim down\n\t\t\t87: 0, // W\n\t\t\t83: 2, // S\n\t\t\t13: 4 //Enter\n\t\t});\n\n\t\tthis.boundKeydownfunction = this.eventKeyDownFunction.bind(this);\n\t}", "title": "" }, { "docid": "57a6cb841ac56a87e0eaf9e0a468a32b", "score": "0.515128", "text": "function createLevel(){\n\ttimeLimit = 100;\n\tcurrentRobotId = 1+Math.round(Math.random()*(numberOfRobots-1));\n\tlevelCoordinates = difficultyManager.getLevelCoordinates();\n\toddImageId = Math.round(Math.random()*(levelCoordinates.length-1));\n\toddAsset = difficultyManager.getOddAsset(currentRobotId);\n\tanimationEffect = 0;\n\tsetupClickableObjects();\n\tanimatedDraw();\n}", "title": "" }, { "docid": "d0f08976b7063bbc3ca39c967425b8dd", "score": "0.5126208", "text": "function Game (level) {\n log.info(\"Setting up game parameters\");\n \n this.stage = new PIXI.Stage(0x000000);\n this.renderer = new PIXI.autoDetectRenderer(800,600);\n $(\"#gameScene\").append(this.renderer.view);\n this.actors = [];\n this.player = {};\n this.level = {};\n this.levelDataFromJSON = null;\n \n // Load the level\n ////////////////////\n this.loadLevelFile(level);\n}", "title": "" }, { "docid": "2dcad5f217d272f8e739b3ae1ddc9d0d", "score": "0.51078796", "text": "createSelections() {\r\n let textOptions = {fontFamily : 'Nunito', fontSize: 48, fill : 0x000000, align : 'center', fontWeight: 'bold'};\r\n \r\n this.singlePlayer_btn = new DisplayObject(\r\n new PIXI.Text('Single Player', textOptions),\r\n {\r\n interactive: true,\r\n position: {\r\n x: this.screenWidth/2,\r\n y: this.screenHeight/2 - this.screenHeight * .25},\r\n anchor: {\r\n x: .5,\r\n y: .5},\r\n onClick: () => this.playersSelected(true),\r\n layer: this.mainLayer,\r\n parent: this\r\n });\r\n\r\n this.twoPlayers_btn = new DisplayObject(\r\n new PIXI.Text('Two Players', textOptions),\r\n {\r\n interactive: true,\r\n position: {\r\n x: this.screenWidth/2,\r\n y: this.screenHeight/2 + this.screenHeight * .25},\r\n anchor: {\r\n x: .5,\r\n y: .5},\r\n onClick: () => this.playersSelected(),\r\n layer: this.mainLayer,\r\n parent: this\r\n });\r\n }", "title": "" }, { "docid": "bfce3d919afce2a079bff4577b0f6218", "score": "0.51070684", "text": "function chosenLevel(btn) {\r\n playLevelSound()\r\n document.querySelector('.smiley').innerHTML = '😁';\r\n gLevel = gLevels[btn]\r\n gSafeClicks = 3;\r\n document.querySelector('.safeCount').innerHTML = gSafeClicks;\r\n init()\r\n}", "title": "" }, { "docid": "88f465cad9b6cb307e75d3210a99d50b", "score": "0.50984806", "text": "function generateLevel(levelnum) {\n\t//comment this line out if normal play required\n\t//levelnum = lastlevel\t; //force particular level to play for testing\n addScoreInfo(screen);\n\tlevelUpdateCallBack = null;\n\t\n\t//this line replaces the entire switch statement used previously\n\tactivelevel = Reflect.construct(levelarray[levelnum][0], levelarray[levelnum][1]);\n\t\n\tcreateStartBall();\n\tpaddle = new Paddle(screen, new vector2(210, 550));\n\tshowCredits(activelevel.author, activelevel.constructor.name);\n}", "title": "" }, { "docid": "a45e70e14071d285a8aaa0bb17ec34cb", "score": "0.50943637", "text": "function ButtonObject(glContext) {\n // Local storage variables and \"constants\"\n var gl = glContext;\n var button;\n var buttonPosition = { x: 0, y: 0, z: 0 };\n var active = true; // Current state\n var clicked = false; // Current state\n var buttonValue = 0;\n\n // Arrays that hold Object details\n var vertArray = [];\n var texCoordsArray = [];\n var textureArray = [];\n var buttonTextures = [];\n\n // Basic texture coordinates\n var textureCoords = [\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 0.0, 0.0\n ];\n\n // Simple vertex values describing a rectangle\n var buttonVertices = [\n vec3.fromValues(0.13, 0.08, 0.1),\n vec3.fromValues(-0.13, 0.08, 0.1),\n vec3.fromValues(0.13, -0.08, 0.1),\n vec3.fromValues(-0.13, -0.08, 0.1)\n ];\n\n /**\n * This method creates the object's geometry and texture assignment.\n * @param textureArray An array of textures, an active texture and an inactive texture for the button.\n * @param shaderProgram The reference to the Shader Program Object to be used for rendering this object.\n */\n this.create = function (textureArray, shaderProgram) {\n // Create a copy of the textures\n buttonTextures = textureArray.slice();\n var currentTexturesArray = [];\n\n // Create the geometry, texture coordinates and texture arrays and assign the first (active) texture to it by default\n vertArray.push(buttonVertices);\n texCoordsArray.push(textureCoords);\n currentTexturesArray.push(textureArray[0]);\n\n // Finally create the actual 3d object\n button = new WebGL.object3d(gl);\n if (!button.initGeometry(vertArray, texCoordsArray))\n console.log(\"Button error. Error initializing Geometry!\");\n if (!button.assignTextures(currentTexturesArray))\n console.log(\"Button error. Error assigning Textures!\");\n button.assignShaderProgram(shaderProgram);\n };\n\n /**\n * This method is used to render the object onto the canvas\n * @param movementMatrix The 4x4 matrix describing the offset from origin for this object\n */\n this.draw = function (movementMatrix) {\n // Translate the object's frame of reference by the one passed as parameter and the x, y and z offset of the object's relative position\n var translation = vec3.fromValues(buttonPosition.x, buttonPosition.y, buttonPosition.z);\n var translationMatrix = mat4.create();\n mat4.translate(translationMatrix, movementMatrix, translation);\n\n // Draw the object\n if (!button.draw(translationMatrix))\n console.log(\"Button Drawing error!\");\n };\n\n /**\n * This method sets the relative position of the object\n * @param position An array indicating the relative x, y and z-axis position of this object\n */\n this.setPosition = function (position) {\n buttonPosition.x = position[0];\n buttonPosition.y = position[1];\n buttonPosition.z = position[2];\n };\n\n /**\n * This function is a click handler for the button object\n */\n this.click = function () {\n // If the button is active (clickable) and not already clicked (to prevent super rapid clicking)\n if ((!clicked) && (active)) {\n // Offset the button into the screen a little bit, and set the clicked flag\n buttonPosition.z -= 0.05;\n clicked = true;\n\n // Increase or reduce player bet (used if this is a betting button)\n if ((window.numberValues.playerBet + buttonValue) >= 0) {\n // Make sure the bet does not exceed the total amount of money the player has\n if ((window.numberValues.playerBet + buttonValue) <= window.numberValues.playerMoney) {\n window.numberValues.playerBet += buttonValue;\n }\n } else {\n // Ensure the player cannot make a sub-zero bet\n window.numberValues.playerBet = 0;\n }\n\n // Reset the button's z-axis position after 0.1 seconds, so it can be clicked again\n setTimeout(depressButton, 100);\n }\n };\n\n /**\n * This function simply restores the button's z-axis position and resets clicked flag to false\n */\n function depressButton() {\n if (clicked) {\n buttonPosition.z += 0.05;\n clicked = false;\n }\n }\n\n /**\n * This function sets how much this button should add (or subtract) to the bet (only useful for betting buttons)\n * @param value The value to add to the player bet. Negative values will be subtracted from the bet.\n */\n this.setValue = function (value) {\n buttonValue = value;\n };\n\n /**\n * This function activates (or de-activates) the button, and changes the textures appropriately\n * @param state A boolean value. True (or blank) to activate the button, false to de-activate the button\n */\n this.activate = function (state) {\n if ((state === undefined) || (state)) {\n if (!button.assignTextures([buttonTextures[0]])) {\n console.log(\"Button error. Error re-assigning new Textures!\");\n } else {\n active = true;\n }\n } else {\n if (!button.assignTextures([buttonTextures[1]])) {\n console.log(\"Button error. Error re-assigning new Textures!\");\n } else {\n active = false;\n }\n }\n };\n\n /**\n * This function returns whether or not the button is active\n * @returns The active status of the button\n */\n this.isActive = function () {\n return active;\n };\n}", "title": "" }, { "docid": "4ca2cf772123fd9d1811cb1b67205689", "score": "0.5076511", "text": "constructor(px, py, type, level) {\n super(px, py);\n let self = this;\n this.type = type;\n this.id = \"tower\" + Math.round(px) +Math.round(py);\n this.level = level;\n this.damage = type[1] - level[0]; // increase level according to level\n this.cool_down = type[2] - level[1]; // decrease cd according to level\n this.cost = type[3];\n this.range = type[4];\n this.debuff = type[6];\n this.buff = undefined;\n this.buff_list = new Array();\n this.target = undefined;\n this.cd_ready = false;\n\n console.log(\"position: \" + px + \", \" + py);\n console.log(this.type[0] + \", \" + this.damage +\", \" + this.cool_down);\n // attack_range\n // level\n // bullet_list\n this.bullet_list = new Array();\n // keep track of the bullet img by id\n this.bullet_id = 0;\n\n // set timer for this tower\n this.timer = 0.0\n this.buffTimer = 0.0;\n this.timeInterval = setInterval(function(){\n if (game.game_state != gameState.PAUSE) {\n self.calculateCoolDown()\n self.buffTime();\n }\n }, 100);\n }", "title": "" }, { "docid": "cf1ef930e64878f4e393b9866de6c762", "score": "0.50753033", "text": "createTiles(){\n //Create tiles in the DOM\n for (let i = 0; i < 19; i++) {\n for (let j = 0; j < 18; j++) {\n $('.center').append(`<button class=\"tile\" id=\"button_${i}_${j}\"></button>`)\n }\n $('.center').append(`<button class=\"tile\" id=\"button_${i}_18\" style=\"float:none;\"/>`);\n }\n\n //Attach click listener to tiles\n for (let i = 0; i < 19; i++) {\n this.board.push(['']);\n for (let j = 0; j < 19; j++) {\n $(`#button_${i}_${j}`).on('click', this.tileClickHandler.bind(this));\n }\n }\n }", "title": "" }, { "docid": "7e9474b1db9fccbb7487c091b555a77f", "score": "0.50681657", "text": "drawButtonsLevels(){\n for (var i = 0; i < this.buttonsLevels.length; i++) {\n this.buttonsLevels[i].draw();\n }\n }", "title": "" }, { "docid": "6c1e8adab692eeec7df0405418799e70", "score": "0.50636786", "text": "function initLevels()\n{\n // levels.push(levelTallTest);\n // levels.push(levelTall);\n // levels.push(levelRainbowBridge);\n\n\n //Part 1 - Introduce Core Mechanics\n levelStart.slides = ['slidesIntro1','slidesIntro2', 'slidesIntro3', 'slidesIntro4'];\n levels.push(levelStart);\n levels.push(levelSep);\n levels.push(levelTeam);\n levels.push(levelCorner);\n levels.push(levelStuff2);\n // levels.push(levelSnake);\n \n //Part 2 - Enemies\n levelE.slides = ['slidesEnemy1', 'slidesEnemy2'];\n levels.push(levelE);\n levels.push(level2);\n levels.push(levelRampage);\n // levels.push(levelGrid);\n // levels.push(levelTower);\n \n //Part 3 - Boundaries\n levelOpenStart.slides = ['slidesEdges1', 'slidesEdges2'];\n levels.push(levelOpenStart);\n levels.push(levelOpen0);\n levels.push(levelOpen1);\n // levels.push(levelOpen2);\n // levels.push(levelOpen3);\n \n //Part 4 - Gates\n levelColored.slides = ['slidesGates1', 'slidesGates2'];\n levels.push(levelColored);\n levels.push(lvlBridge2);\n // levels.push(lvlGreenBridge);\n // levels.push(levelColored2); \n \n //Part 5 - Switches\n levelSwitch.slides = ['slidesSwitches1', 'slidesSwitches2'];\n levels.push(levelSwitch);\n levels.push(levelSwitch2);\n levels.push(levelHard);\n //Brainy Hero\n //RainbowBridges\n\n\n\n // levels.push(mapMarco);\n // levels.push(levelBase);\n // levels.push(levelMaze); \n \n}", "title": "" }, { "docid": "35cd784cd205eac97c0aca4462a71fee", "score": "0.5060746", "text": "nextLevel() {\n //initialize a sublevel in zero\n this.sublevel = 0;\n //it calls the light up sequence\n this.lightUpSequence();\n //it adds click events to each button\n this.addClickEvents();\n }", "title": "" }, { "docid": "c68d2f727aa9f9a445e9a5dbb11beb8d", "score": "0.5056956", "text": "render(){\n return(\n <div>\n <button className='hvr-sweep-to-right' \n style={{display: this.props.showLevelInfo ? 'none ' : 'block'}}\n onClick={() => this.props.loadLevelInfo()} >{this.props.name}\n </button> \n <div style={{display: this.props.showLevelInfo ? 'block ' : 'none'}}>\n <div className='info-container'>\n <button className='hvr-sweep-to-right-start'\n onClick={() => this.props.loadLevel(this.props)}>Start!\n </button> \n <p className='text' style={{marginLeft: '10%'}}> {this.props.name} {this.props.name === 'Boss Fight!' ? ': Take out the Voyager 1! Destory 12 Asteroids To Make The Boss Appear, And Do As Much Damage As You Can Before It Dissapears Again! Watch Out For Bombs, And Consider A Serious Weapon Upgrade...' : `: Finish The Level With At Least ${this.props.goal} Points!`}</p>\n <div className='gif-container'>\n <img className='level-gif' src={this.getGif(this.props.name)} alt=\"gameplay gif\"/>\n <p className='text' style={{display: this.props.playedOnce ? 'none' : 'block'}}>^ This Is Your In-Game Display. Your Health Meter Is On The Left, Your Game in The Center, And Your \"Strikes\" For Hitting Aliens And Current Score Are Underneath</p>\n </div>\n </div>\n </div> \n </div>\n )\n \n }", "title": "" }, { "docid": "187b259cdb446c5047cc23c1a0080c8c", "score": "0.50530726", "text": "function MyGame(levelID) {\n //Load Texture\n this.kTexture = \"assets/kTexture.png\";\n// this.kWood = \"assets/RigidShape/Wood.png\";\n this.kWood = \"assets/Brick.png\";\n this.kRole = \"assets/Role.png\";\n this.kWin = \"assets/WinPage.png\";\n this.kLose = \"assets/LosePage.png\";\n this.kEnergyBar = \"assets/EnergyBar.png\";\n this.kButton = \"assets/Button.png\";\n this.kBG = \"assets/Background.png\";\n this.kTrap = \"assets/trap.png\";\n //Load Music and sound\n this.kGameBGM = \"assets/AudioTest/PlayBGM.mp3\";\n this.kArrowfast = \"assets/AudioTest/Arrowfast.mp3\";\n this.kArrowslow = \"assets/AudioTest/Arrowslow.mp3\";\n this.kFail = \"assets/AudioTest/Fail.mp3\";\n this.kHurray = \"assets/AudioTest/Hurray.mp3\";\n this.kHit = \"assets/AudioTest/Hit.mp3\";\n this.kFallinlove = \"assets/AudioTest/Fallinlove.mp3\";\n this.kWinSound = \"assets/AudioTest/Win.mp3\";\n this.mButtonSelect = null;\n this.mBackButton = null;\n this.mRestartButton = null;\n this.mWinButton = null;\n // The camera to view the scene\n this.mCamera = null;\n this.mWinPage = null;\n this.mCurrentLevel = levelID;\n this.mBackground = null;\n this.mWin = null;\n this.mTrapSet = null;\n}", "title": "" }, { "docid": "a2c074b51b5555cea5e36830c95ec316", "score": "0.5036163", "text": "function Layer() {\r\n this.renderables = new Array();\r\n this.opacity = 1;\r\n this.hasTransformations = true;\r\n this.transformation = new Transformation();\r\n this.visible = true;\r\n}", "title": "" }, { "docid": "67d515e5f4c2344fbe492cf7af87bfb1", "score": "0.50225157", "text": "constructor(x,y,z,dir,tile,collisionLayers,stack){\n\t\tsuper(x,y,z,dir,tile,collisionLayers)\n\t\tthis.collisionLayers.push(\"Item\")\n\t\tthis.stack = stack\n\t}", "title": "" }, { "docid": "ceff8779b2c8791dd84d62aa45776e5d", "score": "0.5013933", "text": "constructor(x, y, dir, id) {\n super(x, y);\n this.dir = dir;\n this.id = id;\n this.notSolid = false;\n this.type = \"portal\";\n\n this.spriteW = 3;\n this.spriteH = 1;\n this.hitbox = {\n x: 0,\n y: 0,\n w: 0,\n h: 0\n };\n\n this.action = 0;\n /*\n 0 : closed,\n 1 : opening,\n 2 : open,\n 3 : closing\n */\n this.actionX = [\n [15],\n [15, 15, 15, 15, 15, 15, 15, 15, 15],\n [15],\n [15, 15, 15, 15, 15, 15, 15, 15, 15]\n ]\n this.actionY = [\n [19],\n [19, 20, 21, 22, 23, 24, 25, 26, 27],\n [27],\n [27, 26, 25, 24, 23, 22, 21, 20, 19]\n ]\n\n this.rot = 0;\n if (this.dir[0]) {\n if (this.dir[0] == 1) {\n // portal to the right\n this.rot = 90;\n } else {\n // portal to the left\n this.rot = -90;\n }\n } else {\n if (this.dir[1] == 1) {\n // portal to the bottom\n this.rot = 180;\n } else {\n // portal to the top\n this.rot = 0;\n }\n }\n }", "title": "" }, { "docid": "4d1f7f7ef77176bfed7ae00a8d7a381c", "score": "0.5003141", "text": "function change_level(event) {\r\n if (event.target.id === 'easier') {\r\n level--;\r\n tile_border.className = level_classes[level];\r\n }\r\n else if (event.target.id === 'harder') {\r\n level++;\r\n tile_border.className = level_classes[level];\r\n }\r\n if (level < 0) {\r\n document.getElementById('easier').disabled = true;\r\n } else if (level >= level_classes.length - 1) {\r\n document.getElementById('harder').disabled = true;\r\n } else {\r\n document.getElementById('easier').disabled = false;\r\n document.getElementById('harder').disabled = false;\r\n }\r\n}", "title": "" }, { "docid": "c27462d8388cb38669194e233c10a971", "score": "0.5002923", "text": "createMenuButtons(){\r\n var numButtons = 5;\r\n //create and style all button divs\r\n for(let i = 0; i < numButtons; i++){\r\n // create a button and place it on the DOM tree\r\n var button = document.createElement('div');\r\n document.getElementById(\"menuDiv\").appendChild(button);\r\n // place a button image on the button\r\n var buttImg = new Image();\r\n buttImg.src = \"images/buttons/mb01.png\";\r\n buttImg.id = \"bi\";\r\n button.appendChild(buttImg);\r\n // Add event listeners to images (not buttons)\r\n buttImg.addEventListener('mouseover',buttonMouseOverHandler,false);\r\n buttImg.addEventListener('mouseout',buttonMouseOutHandler,false);\r\n buttImg.addEventListener('click',buttonMouseClickHandler,false);\r\n // style buttons\r\n button.style.float = \"left\";\r\n button.style.marginTop = \"50px\";\r\n button.style.marginLeft = \"5px\";\r\n\r\n //push button into buttons array\r\n this.menuButtons.push(button);\r\n }\r\n\r\n }", "title": "" }, { "docid": "accb1496efce24e975c608db48fb105b", "score": "0.5001883", "text": "function genButtons(doses) {\n \n for (let i = 1; i <= doses; i++) {\n \n var levelButton = document.createElement(\"button\");\n if(i <= localStorage.unlockedLevels) { // alla upplåsta blir klickbara\n levelButton.classList.add(\"levelButtonStyle\");\n levelButton.onclick = function() {\n startLevel(i);\n };\n }\n else { // alla låsta blir gråa och oklickbara\n levelButton.classList.add(\"lockedButton\");\n levelButton.onclick = function () {};\n }\n \n var buttonText = document.createTextNode(i.toString());\n levelButton.appendChild(buttonText);\n \n document.body.appendChild(levelButton);\n levelButtons.push(levelButton);\n \n }\n \n}", "title": "" }, { "docid": "bb2a7084976d29ef9a35380e5de43507", "score": "0.50006664", "text": "function OnGUI(){\n\tvar top: float = buttonPosition == ButtonPosition.upLeft ? 10 : Screen.height - 50 -10;\n\tif(GUI.Button(Rect(10, top, 150, 50), \"Try Another Level\")){\n\t\t//increment the level counter; using % makes the number revert back to 0 once we have reached the limit\n\t\tcurrentLevel = (currentLevel + 1) % levelData.Length;\n\t\t//now build the level (BuildLevel uses the blocks variable to find and destroy any previous blocks)\n\t\tBuildLevel(levelData[currentLevel], levelGrid);\n\t}\n}", "title": "" }, { "docid": "59a65f1be654b8e14ced245b1dbd11c4", "score": "0.4998987", "text": "function Layer(x, y, width, height) {\n\n // an array of objects that define different drawings\n var drawings = [];\n\n var invalid = new Rect(-1, -1, -1, -1);\n\n var offset = new Rect(-1, -1, -1, -1);\n\n this.Add = function (d)\n {\n drawings.push(d);\n };\n\n\n this.Remove = function (d)\n {\n //TODO\n };\n\n this.IsCurrent = function(pageX, pageY)\n {\n\n };\n\n this.OnClick = function(e)\n {\n\n };\n}", "title": "" }, { "docid": "50b93c088ba347efd3404a94e3b05b82", "score": "0.49954328", "text": "constructor(player, level)\n {\n this.player = player;\n this.level = level;\n this.foreground = new Ground();\n this.middleground = new Layer(images.get(ImageName.Skyline), 3);\n this.middleground.position = Level.MIDDLEGROUND_OFFSET;\n this.background = new Layer(images.get(ImageName.Background));\n this.distance = 0;\n this.target = level * Level.TARGET_MULTIPLIER;\n this.score = 0;\n this.obstacles = [];\n this.traffic = [];\n\n this.distance = 0;\n this.lastSpawn = -1;\n this.lastObstacle = null;\n this.lastPoutine = -1000;\n\n this.lastScoreDistance = 0;\n this.complete = false;\n\n\t\tthis.messageBox = new MessageBox(\"TARGET DISTANCE: \" + Level.formatDistance(this.target, 0));\n\n canvas.addEventListener(EventName.GameOver, () =>\n {\n // Have to play and stop tires sound here because of weird bug\n if (!settings.muteSound) sounds.stop(SoundName.Tires);\n if (!settings.muteMusic) sounds.stop(SoundName.GameMusic);\n\n if (this.score > settings.highScores[0])\n {\n settings.highScores[0] = this.score;\n } \n\n settings.saveSettings();\n\n stateMachine.change(GameStateName.GameOver, { level: this, player: this.player });\n });\n }", "title": "" }, { "docid": "b9ad1444c7f908ae25d09223ecd64ae5", "score": "0.49918103", "text": "initMenuButton() {\n\t\t// Create button\n\t\tconst btn = document.createElement( 'button' );\n\t\tbtn.setAttribute( 'aria-expanded', 'false' );\n\t\tbtn.setAttribute( 'class', 'button button--borderless' );\n\t\tbtn.innerHTML = this.label.innerHTML;\n\t\tthis.container.insertBefore( btn, this.label );\n\t\tthis.container.removeChild( this.label );\n\n\t\t// Wrap menu\n\t\tconst linkList = this.container.querySelector( '.link-list' );\n\t\tconst menu = document.createElement( 'div' );\n\t\tconst menuList = document.createElement( 'ul' );\n\t\tconst arrow = document.createElement( 'span' );\n\t\tmenu.classList.add( 'menu-button__menu' );\n\t\tarrow.classList.add( 'menu-button__menu__arrow' );\n\t\tarrow.setAttribute( 'data-popper-arrow', '' );\n\t\tmenuList.innerHTML = linkList.innerHTML;\n\t\tArray.prototype.forEach.call( menuList.children, menuItem => {\n\t\t\tmenuItem.removeAttribute( 'class' );\n\t\t} );\n\t\tmenu.insertBefore( menuList, menu.firstChild );\n\t\tmenu.insertBefore( arrow, menu.firstChild );\n\t\tthis.container.insertBefore( menu, linkList );\n\t\tthis.container.removeChild( linkList );\n\n\t\treturn { btn, menu };\n\t}", "title": "" }, { "docid": "9a2a2252842deb4b0ebbca0e69d3cc30", "score": "0.49896133", "text": "changeLevel(levelName) {\n this.setState({level: levelName})\n }", "title": "" }, { "docid": "b7bddb6303381c22a6d1cb1b3752cad9", "score": "0.4982731", "text": "function update() { ctx.clearRect(0,0, Game.width, Game.height);\n \n\t\t \n if (level >= 50 && level < 80) {menuV = true}\n \n \n \n\t\t\n // level \nendHeight[-1]=0;\nendHeight[0]= 300; \nendHeight[1]= 1000; \nendHeight[2]= 2000; \nendHeight[3]= 2500; \nendHeight[4]= 2700; \nendHeight[5]= 4000; \nendHeight[6]= 4000; \nendHeight[38]= 9999; \nendHeight[98]= 99999999999;\nimageA[0]=document.getElementById(\"triangle\");\nimageA[1]=document.getElementById(\"earth\");\nimageA[2]=document.getElementById(\"player\");\nimageA[3]=document.getElementById(\"ground\");\nimageA[4]=document.getElementById(\"ground2\");\nimageA[5]=document.getElementById(\"cloud\");\nimageA[6]=document.getElementById(\"1\");\nimageA[7]=document.getElementById(\"1\");\nimageA[8]=document.getElementById(\"1\");\nimageA[9]=document.getElementById(\"1\");\nimageA[10]=document.getElementById(\"1\");\nimageA[11]=document.getElementById(\"1\");\nimageA[12]=document.getElementById(\"play\");\nimageA[13]=document.getElementById(\"dropper\");\nimageA[14]=document.getElementById(\"play2\");\nimageA[15]=document.getElementById(\"sl\");\nimageA[16]=document.getElementById(\"sl2\");\nimageA[17]=document.getElementById(\"menu\");\nimageA[18]=document.getElementById(\"menu2\");\nimageA[19]=document.getElementById(\"background\");\nimageA[10]=document.getElementById(\"1\");\nimageA[21]=document.getElementById(\"1\");\nif (level == 97) { \nlevelButton(100,150,100,50,1,1,10);\nlevelButton(225,150,100,50,2,2,10);\nlevelButton(350,150,100,50,3,3,10);\nlevelButton(475,150,100,50,4,4,10);\nlevelButton(600,150,100,50,5,5,10);\nlevelButton(100,225,100,50,6,6,10);\nlevelButton(225,225,100,50,7,7,10);\nlevelButton(300,400,200,50,\"Endless\",38,50);\n\n }\n// level end \n\nenemyCount[0]= 1; \nenemyCount[1]= 2;\nenemyCount[2]= 8;\nenemyCount[3]= 1;\nenemyCount[4]= 1;\nenemyCount[5]= 1;\nenemyCount[6]= 1;\nenemyCount[7]= 1;\nenemyCount[8]= 1;\nenemyCount[9]= 1;\nenemyCount[10]= 1;\nenemyCount[11]= 1;\nenemyCount[12]= 1;\n \n \n \nif (restart == true) {yPos = 10; startBox = Game.width}; \n backgroundF() \n lockF();\n levelS() \n wall(); \n reset(); \n menuF() \n \n//-----------neeeded each level\n \nendBox(0, endHeight[level], 0, 0, \"green\", 99, 4)\nif(level < 90) {box(0, 70, startBox, 10, \"black\", 99)} ;// start box \n\n\nebox(600, 300, 64, 64, \"blue\", 1, 5); \nebox(Game.width/2, 300, 128, 128, \"blue\", 1, 5); \n \n // 3333333333333333333333333333 (2)\nlevel3()\n //444444444444444444444444444 (3)\n\n level4() \n level5()\nlevel6()\nlevel7()\nendless()\nhighscore()\n \n \n \n \n\n\n//--------------------------------------------\n// lock = 70 \n//------------------------end \n \n var abc;\nabc = lock \nabc += \" , \"\nabc += level \nabc += \" , \"\nabc += enemyY\nabc += \" , \"\nabc += endHeight[level] \n\n player();\ntext('Press \"A or ←\" to move left and \"D or →\" to move right.', 160, Game.height -30, \"black\", \"20px Arial\", 0)\ntext('Press \"Space bar to start', Game.width/2 - 100, Game.height -10, \"black\", \"20px Arial\", 0)\nif (level < 90) {text('Level: ' + (level + 1), 10, 40, \"#00ce97\", \"30px Arial\", 99)}\n// text(abc, Game.width/2 - 130, Game.height -50, \"black\", \"20px Arial\", 99)\ntext('Avoid clouds and get to the ground', Game.width/2 - 170, Game.height -10, \"black\", \"20px Arial\", 1)\n\nif (level < 90) {text('Score: ' +enemyY, 10, Game.height - 20, \"#00ce97\", \"30px Arial\", 99)}\n\n\n \n// text('', 20, Game.height -30, \"black\", \"20px Arial\", 0)\n \n mouseClick = false\n \t\t\t\t\t\t\t } //----------Update End ----------------- ", "title": "" }, { "docid": "407b5cb8220154f74ebcff6fe35693a3", "score": "0.49798074", "text": "constructor(name, id) {\n\n // 3. Call the parent constructor function using the super function\n super()\n // 4. Assign a name and id instance property to the incoming name and id arguments\n this.name = name\n this.id = id\n // 5. This method will show the button on the screen, no changes necessary\n this.renderButton()\n }", "title": "" }, { "docid": "704d3fda605e1d8a9fc5be761d07a0d3", "score": "0.49786696", "text": "inicialize() {\n this.toggleStartBtn();\n this.level = 1;\n this.colors = {\n lightBlue,\n violet,\n orange,\n green,\n };\n //with bind we maintain the reference to \"this\"\n //this = Game\n //if we don't bind it, when we work with events: this = each target button\n this.chooseColor = this.chooseColor.bind(this);\n //if we don't bind it, when we work with setTimeout: this = Window object\n //setTimeout delegates taks to the browser, so \"this\" is the Windows object unless we bind it\n this.nextLevel = this.nextLevel.bind(this);\n }", "title": "" }, { "docid": "e26f905bccde791ec126ffc2a8b14e3a", "score": "0.49726644", "text": "function LayerControlGroup(layers, name, options)\n{\n var self = this;\n options = options || [];\n options.display = options.display || \"show\";\n options.label = options.label || \"unchecked\";\n options.selectedItemName = options.selectedItemName || \"\";\n\n // Convert single layer to array if necessary\n if (!(layers && layers.constructor === Array)) { layers = [layers]; }\n\n this.layers = layers;\n this.name = name;\n\n // Assign group name to every layer. \n // Note: This means a layer can only appear in a single group.\n for (var i in layers)\n {\n this.layers[i].groupName = name;\n }\n\n // Toggle the display icon\n this.setDisplay = function (checked)\n {\n if (this.displayElement)\n {\n if (checked) {\n this.displayElement.classList.add('leaflet-control-display-checked');\n this.displayElement.classList.remove('leaflet-control-display-unchecked');\n } else {\n this.displayElement.classList.remove('leaflet-control-display-checked');\n this.displayElement.classList.add('leaflet-control-display-unchecked');\n }\n //this.displayElement.src = checked ? \"../img/display.png\" : \"../img/display_gray.png\";\n }\n };\n\n // Get the display icon state\n this.getDisplay = function ()\n {\n // default is true (for base layers)\n return !this.displayElement || this.displayElement.classList.contains(\"leaflet-control-display-checked\");\n }\n\n // Toggle the label icon\n this.setLabeled = function (checked)\n {\n if (this.labelElement)\n {\n if (checked)\n {\n this.labelElement.classList.add('leaflet-control-label-checked');\n this.labelElement.classList.remove('leaflet-control-label-unchecked');\n } else\n {\n this.labelElement.classList.remove('leaflet-control-label-checked');\n this.labelElement.classList.add('leaflet-control-label-unchecked');\n }\n //this.labelElement.src = checked ? \"../img/label.png\" : \"../img/label_gray.png\";\n }\n };\n\n // Get the label icon state\n this.getLabeled = function ()\n {\n return !this.labelElement || this.labelElement.classList.contains(\"leaflet-control-label-checked\");\n };\n\n // Get the selected layer for this group.\n this.getSelectedLayer = function ()\n {\n if (this.layers.length === 1) { return this.layers[0]; }\n if (this.selectElement)\n {\n var layerName = this.selectElement.options[this.selectElement.selectedIndex].value;\n var layer = this._getLayerByName(layerName);\n return layer;\n }\n return null;\n };\n\n this.setSelectedLayer = function (layer)\n {\n if (this.selectElement) {\n var index = this.layers.indexOf(layer);\n if (index >= 0)\n {\n this.selectElement.options[index].selected = true;\n }\n }\n };\n\n // Create the display element\n if (options.display !== \"hide\")\n {\n this.displayElement = document.createElement(\"div\");\n this.displayElement.LayerControlAction = LayerControlAction.ToggleDisplay;\n this.displayElement.groupName = this.name;\n this.setDisplay(false);\n }\n\n // Create the label element\n if (options.label !== \"hide\")\n {\n this.labelElement = document.createElement(\"div\");\n this.labelElement.LayerControlAction = LayerControlAction.ToggleLabels;\n this.labelElement.groupName = this.name;\n this.setLabeled(options.label === \"checked\");\n }\n\n // Create the name element\n this.nameElement = document.createElement('span');\n this.nameElement.innerHTML = ' ' + this.name;\n this.nameElement.groupName = this.name;\n\n // Create the select element\n if (layers && layers.constructor === Array && layers.length > 1)\n {\n // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)\n // NOTE: Opening the select element and displaying the options list fires the select.onmouseout event which \n // propagates to the div container and collapses the layer control. The onmouseout handler below will\n // stop this event from propagating. It has an if-else clause because IE handles this differently than other browsers.\n var selectHtml = '<select class=\"leaflet-control-layers-selector\" onmouseout=\"if (arguments[0]) {arguments[0].stopPropagation();} else {window.event.cancelBubble();}\">';\n for (var i = 0; i < this.layers.length; i++)\n {\n var currentLayer = this.layers[i];\n var name = currentLayer.options.name;\n var isSelected = ((options.selectedItemName === currentLayer.options.labelSource)) ? \"selected\" : \"\";\n selectHtml += '<option ' + isSelected + ' value=\"' + name + '\">' + name + \"</option>\";\n }\n selectHtml += '</select>';\n\n var selectFragment = document.createElement('div');\n selectFragment.innerHTML = selectHtml;\n selectFragment.firstChild.LayerControlAction = LayerControlAction.SelectLayer;\n selectFragment.firstChild.groupName = this.name;\n this.selectElement = selectFragment.firstChild;\n }\n\n // Find a layer by its name.\n this._getLayerByName = function (name)\n {\n var matches = this.layers.filter(function (element) { return element.options.name === name; });\n return (matches.length > 0) ? matches[0] : null;\n };\n\n // Return true if any layer in this group is visible.\n this._anyLayerVisible = function (map)\n {\n return this.layers.filter(function (layer) { return map.hasLayer(layer); }).length > 0;\n };\n\n // Toggle the display icon based on map state.\n this.init = function (map)\n {\n var visibleLayers = this.layers.filter(function (layer) { return map.hasLayer(layer); });\n this.setDisplay(visibleLayers.length > 0);\n if (visibleLayers.length > 0) this.setSelectedLayer(visibleLayers[0]);\n };\n}", "title": "" }, { "docid": "e5459a4ce7cbc0dac66b0ee30053111d", "score": "0.49673805", "text": "constructor(level, posX, posY){\n this.level = level;\n this.posX = posX;\n this.posY = posY;\n this.animFrame = 0;\n this.moveCycles = 0;\n this.damageFrame = 0;\n switch (level) {\n case 0:\n this.totalLife = 1;\n this.points = 1;\n this.slowness = 1;\n break;\n case 1:\n this.totalLife = 2;\n this.points = 3;\n this.slowness = 5;\n break;\n case 2:\n this.totalLife = 3;\n this.points = 5;\n this.slowness = 3;\n break;\n case 3:\n this.totalLife = 25;\n this.points = 30;\n this.slowness = 7;\n break;\n default:\n this.totalLife = 0;\n this.points = 0;\n this.slowness = 0;\n }\n this.life = this.totalLife;\n }", "title": "" }, { "docid": "84b475c1befe89d2aaefa3f583a1f7f0", "score": "0.49617034", "text": "function Tetris(id){\n\tthis.id = id;\n\tthis.init();\n}", "title": "" }, { "docid": "395bb11096849212c51eea1f1a2e4772", "score": "0.49580213", "text": "constructor(name, id) {\n // 3. Call the parent constructor function using the super function\n super ();\n\n // 4. Assign a name and id instance property to the incoming name and id arguments\n this.name = name;\n this.id = id;\n\n // 5. This method will show the button on the screen, no changes necessary\n this.renderButton()\n }", "title": "" }, { "docid": "629ff549806d214922480be5d0fc0e38", "score": "0.49567774", "text": "constructor(id) {\n this.parent = document.getElementById(id);\n this.addBoxButton = document.createElement('button');\n this.removeBoxButton = document.createElement('button');\n this.startGameButton = document.createElement('button');\n this.refreshPageButton = document.createElement('button');\n this.start = document.createElement('div');\n }", "title": "" }, { "docid": "055fe9a4d6d1a03ee466b63c80b7b1a4", "score": "0.49446717", "text": "function loadLevel (levelId) {\n $.getJSON(\"levels/level_\" + levelId + \".json\", function (data) {\n buildField(data.config, data.startpoint, data.walls);\n });\n}", "title": "" }, { "docid": "7ac18773f0f4568773ee3a163070d2f9", "score": "0.4943691", "text": "function Game() {\n //File\n this.kFileLevel = \"assets/Level1.xml\";\n\n this.kTextures = {\n //background and shadowBackground\n background: \"assets/images/backgrounds/background.png\",\n shadowBackground: \"assets/images/backgrounds/shadow_background.png\",\n\n //Tileset\n bottom_left_edge: \"assets/images/walls/bottom_left_edge.png\",\n bottom_right_edge: \"assets/images/walls/bottom_right_edge.png\",\n bottom_tile: \"assets/images/walls/bottom_tile.png\",\n color: \"assets/images/walls/color.png\",\n color_medium: \"assets/images/walls/color_medium.png\",\n inner_corner_bottom_left: \"assets/images/walls/inner_corner_bottom_left.png\",\n inner_corner_bottom_right: \"assets/images/walls/inner_corner_bottom_right.png\",\n inner_corner_top_left: \"assets/images/walls/inner_corner_top_left.png\",\n inner_corner_top_right: \"assets/images/walls/inner_corner_top_right.png\",\n left_edge_repeating: \"assets/images/walls/left_edge_repeating.png\",\n platform_inner_repeating: \"assets/images/walls/platform_inner_repeating.png\",\n platform_left_edge: \"assets/images/walls/platform_left_edge.png\",\n platform_right_edge: \"assets/images/walls/platform_right_edge.png\",\n platform_single: \"assets/images/walls/platform_single.png\",\n left_tile: \"assets/images/walls/left_tile.png\",\n right_edge_repeating: \"assets/images/walls/right_edge_repeating.png\",\n right_tile: \"assets/images/walls/right_tile.png\",\n top_left_edge: \"assets/images/walls/top_left_edge.png\",\n top_right_edge: \"assets/images/walls/top_right_edge.png\",\n top_tile: \"assets/images/walls/top_tile.png\",\n toxic_tile: \"assets/images/walls/toxic_tile.png\",\n\n //Platform\n platform: \"assets/images/platform/platform.png\",\n\n //Waves\n wave_fire: \"assets/images/wave/wave_fire.png\",\n wave_water: \"assets/images/wave/wave_water.png\",\n\n //Door\n door_water: \"assets/images/door/door_water.png\",\n door_fire: \"assets/images/door/door_fire.png\",\n\n //PushButton\n push_button: \"assets/images/push_button/push_button.png\",\n\n //Diamons\n diamond_for_water: \"assets/images/diamonds/diamond_for_water.png\",\n diamond_for_fire: \"assets/images/diamonds/diamond_for_fire.png\",\n\n //Particles\n particle: \"assets/images/particle/particle.png\",\n\n //Characters\n water_character: \"assets/images/characters/water_character.png\",\n fire_character: \"assets/images/characters/fire_character.png\"\n\n };\n\n this.kNormals = {\n //background and shadowBackground\n background: \"\",\n shadowBackground: \"\",\n\n //Tileset\n bottom_left_edge: \"assets/images/walls/bottom_left_edge_normal.png\",\n bottom_right_edge: \"assets/images/walls/bottom_right_edge_normal.png\",\n bottom_tile: \"assets/images/walls/bottom_tile_normal.png\",\n color: \"assets/images/walls/color_normal.png\",\n color_medium: \"assets/images/walls/color_medium_normal.png\",\n inner_corner_bottom_left: \"assets/images/walls/inner_corner_bottom_left_normal.png\",\n inner_corner_bottom_right: \"assets/images/walls/inner_corner_bottom_right_normal.png\",\n inner_corner_top_left: \"assets/images/walls/inner_corner_top_left_normal.png\",\n inner_corner_top_right: \"assets/images/walls/inner_corner_top_right_normal.png\",\n left_edge_repeating: \"assets/images/walls/left_edge_repeating_normal.png\",\n platform_inner_repeating: \"assets/images/walls/platform_inner_repeating_normal.png\",\n platform_left_edge: \"assets/images/walls/platform_left_edge_normal.png\",\n platform_right_edge: \"assets/images/walls/platform_right_edge_normal.png\",\n platform_single: \"assets/images/walls/platform_single_normal.png\",\n left_tile: \"assets/images/walls/left_tile_normal.png\",\n right_edge_repeating: \"assets/images/walls/right_edge_repeating_normal.png\",\n right_tile: \"assets/images/walls/right_tile_normal.png\",\n top_left_edge: \"assets/images/walls/top_left_edge_normal.png\",\n top_right_edge: \"assets/images/walls/top_right_edge_normal.png\",\n top_tile: \"assets/images/walls/top_tile_normal.png\",\n toxic_tile: \"assets/images/walls/toxic_tile_normal.png\",\n\n //Platform\n platform: \"assets/images/platform/platform_normal.png\",\n\n //Waves\n wave_fire: \"\",\n wave_water: \"\",\n\n //Door\n door_water: \"\",\n door_fire: \"\",\n\n //PushButton\n push_button: \"\",\n\n //Diamons\n diamond_for_water: \"\",\n diamond_for_fire: \"\",\n\n //Particle\n particle: \"\",\n\n //Characters\n water_character: \"assets/images/characters/water_character_normal.png\",\n fire_character: \"assets/images/characters/fire_character_normal.png\"\n };\n\n this.kSounds = {\n background: \"assets/sounds/background.mp3\",\n death: \"assets/sounds/death.mp3\",\n diamond: \"assets/sounds/diamond.mp3\",\n ending: \"assets/sounds/ending.mp3\",\n finish: \"assets/sounds/finish.mp3\",\n fire_character_jump: \"assets/sounds/fire_character_jump.mp3\",\n water_character_jump: \"assets/sounds/water_character_jump.mp3\"\n };\n\n this.kMenuPause = {\n menu_pause_activate_sound: \"assets/images/menu_pause/menu_pause_activate_sound/menu_pause_activate_sound.png\",\n menu_pause_activate_sound_finish_game: \"assets/images/menu_pause/menu_pause_activate_sound/menu_pause_activate_sound_finish_game.png\",\n menu_pause_activate_sound_resume: \"assets/images/menu_pause/menu_pause_activate_sound/menu_pause_activate_sound_resume.png\",\n menu_pause_desactivate_sound: \"assets/images/menu_pause/menu_pause_desactivate_sound/menu_pause_desactivate_sound.png\",\n menu_pause_desactivate_sound_finish_game: \"assets/images/menu_pause/menu_pause_desactivate_sound/menu_pause_desactivate_sound_finish_game.png\",\n menu_pause_desactivate_sound_resume: \"assets/images/menu_pause/menu_pause_desactivate_sound/menu_pause_desactivate_sound_resume.png\",\n };\n\n this.mAllCameras = null;\n this.mGlobalLightSet = null;\n this.mAllWalls = null;\n this.mAllPlatforms = null;\n this.mAllWaves = null;\n this.mAllDoors = null;\n this.mAllPushButtons = null;\n this.mAllCharacters = null;\n this.mMenuPause = null;\n this.mMsg = null;\n this.mIsVisibleMap = false;\n this.mIsVisibleMenuPause = false;\n this.mParser = null;\n this.mAllParticles = new ParticleGameObjectSet();\n\n this.mPause = false;\n this.mLoadSelection = null;\n this.mCont = 0;\n this.mPrefixMenuPase = \"\";\n\n}", "title": "" }, { "docid": "1afc9deb39023d7b709e4372e8710766", "score": "0.49417335", "text": "function addLevel(levelIdx) {\n // Escape hatch -- don't add if the text input already exists.\n // This happens when edit.html.erb pre-creates the boxes\n if ($('#funding_levels_text_' + levelIdx).length != 0) {\n return;\n }\n // Don't go crazy, user.\n if (levelIdx > 5) {\n return;\n }\n // Remove the buttons from the previous row\n if (levelIdx > 0) {\n $('#level_buttons_' + (levelIdx - 1)).remove();\n }\n\n // line break\n if (levelIdx > 0) {\n $('#funding_levels')\n .append('<br id=\"funding_levels_br_' + levelIdx + '\"/>');\n }\n\n // Text box\n $('#funding_levels')\n .append(\n '<input type=\"text\" name=\"funding_levels[]\" id=\"funding_levels_text_' +\n levelIdx + '\" class=\"form-control string fund-entry\" />');\n\n // Button group\n $('#funding_levels')\n .append(\n '<div id=\"level_buttons_' + levelIdx +\n '\" class=\"btn-group btn-space\" role=\"group\">');\n\n // Removal button\n if (levelIdx > 0 && levelIdx < 5) {\n $('#level_buttons_' + levelIdx)\n .append(\n '<button name=\"button\" type=\"button\" id=\"remove_level_button_' +\n levelIdx + '\" onclick=\"removeLevel(' + levelIdx +\n ')\" class=\"btn btn-default\">-</button>');\n }\n\n // Addition button\n if (levelIdx < 4) {\n $('#level_buttons_' + levelIdx)\n .append(\n '<button name=\"button\" type=\"button\" id=\"add_level_button_' +\n levelIdx + '\" onclick=\"addLevel(' + (levelIdx + 1) +\n ')\" class=\"btn btn-default\">+</button>');\n }\n}", "title": "" }, { "docid": "4b4716be74568bad6a738949b892ad84", "score": "0.4936084", "text": "levelNumber(state) {\n if (state.easy == true) {\n state.timer = 10;\n state.number = 10;\n state.randomNumbers = Math.floor(Math.random() * (10 - 1 + 1)) + 1;\n state.botName = 'Wall-E';\n state.botImg = 'http://gb.images.s3.amazonaws.com/wp-content/uploads/2012/01/WALLE.png';\n }\n else if (state.medium == true) {\n state.timer = 20;\n state.number = 30;\n state.randomNumbers = Math.floor(Math.random() * (30 - 1 + 1)) + 1;\n state.botName = 'R2-D2';\n state.botImg = 'http://icons.iconarchive.com/icons/artua/star-wars/256/R2D2-icon.png';\n }\n else if (state.hard == true) {\n state.timer = 30;\n state.number = 50;\n state.randomNumbers = Math.floor(Math.random() * (50 - 1 + 1)) + 1;\n state.botName = 'Terminator';\n state.botImg = 'https://i.dlpng.com/static/png/328494_preview.png';\n }\n else if (state.chuck == true) {\n state.timer = 10;\n state.number = 1000;\n state.randomNumbers = Math.floor(Math.random() * (1000 - 1 + 1)) + 1;\n state.botName = 'Chuck Norris';\n state.botImg = 'chucknorris.png';\n }\n }", "title": "" }, { "docid": "e8227e3e745d45884124aad07ea1059f", "score": "0.49318686", "text": "function PlayingState() {\r\n myLibrary.IGameLoopObject.call(this);\r\n\r\n /* Variable that will hold the index of the currently active level stored in the levels array. by default is -1 */\r\n this.currentLevelIndex = -1;\r\n\r\n /* Array that will hold instances of the Level class representing each of the levels declared in the global LEVELS variable */\r\n this.levels = [];\r\n\r\n /* When creating an instance of this class I automatically call this two methods defined underneath */\r\n this.loadLevelsStatus();\r\n this.loadLevels();\r\n}", "title": "" }, { "docid": "02f51e7ad41558995f6e94923a6792b9", "score": "0.4921433", "text": "function Button ( name, led ){\r\n\t//Button Constructor: instance data\r\n\tthis.name = name;\r\n\tthis.led = led;\t\r\n}", "title": "" }, { "docid": "4a044456ca3c73cd947c5ac6fae08745", "score": "0.49195087", "text": "loadLevel() {\n let level = this.levels[this.level];\n\n // delete all current bricks from group\n this.manager.removeEntitiesByGroup(level.group);\n\n let width = level.dimensions.width;\n let height = level.dimensions.height;\n let types = level.types;\n\n let startingX = 67;\n let startingY = 147;\n\n for(var row = 0; row < level.entities.length; row++) {\n for(var col = 0; col < level.entities[row].length; col++) {\n if(level.entities[row][col] === 0) {\n continue;\n };\n let x = startingX + (col * width) + col;\n let y = startingY + (row * height) + row;\n let color = types[level.entities[row][col] - 1].color;\n let health = types[level.entities[row][col] - 1].health;\n let entity = this.manager.createEntity(level.group);\n this.manager.addComponent(entity,\n new DimensionComponent(width, height),\n new RenderComponent('rect', color),\n new CollisionComponent(true),\n new HealthComponent(health),\n new PositionComponent(x, y)\n );\n }\n }\n }", "title": "" }, { "docid": "9425f597142611d35142a7e472e63533", "score": "0.49175456", "text": "setHudDraggables() {\n // this.buttons = game.levelsData[game.level].buttons;\n game.levelObj.buttons = JSON.parse(JSON.stringify(game.levelsData[game.level].buttons));\n this.clearDrop();\n this.clearDrag();\n\n for (const [key, value] of Object.entries(game.levelsData[game.level].buttons)) {\n //console.log(`${key}: ${value}`);\n if (value > 0) this.appendDragable(key, value)\n }\n }", "title": "" }, { "docid": "23b31ea0e9a8b298c260f6ba2aaad581", "score": "0.4911998", "text": "initLevel(level) {\n\n\t\tthis.ship = new Ship({pos:new Vect(50,50)});\n\t\tthis.asteroids = [];\n\t\tfor (let i = 0; i < level; i++) {\n\n\t\t\t// Generates an asteroid with random position, velocity and shape\n\t\t\tlet velMag = randomBetween(1,3);\n\t\t\tlet newDr = randomBetween(-2,2);\n\t\t\tlet newPos = new Vect(randomBetween(200,constants.gameBounds.width), randomBetween(200,constants.gameBounds.width));\n\t\t\tlet newVel = new Vect(velMag,0).rotate(randomBetween(0,360));\n\n\t\t\tthis.asteroids.push(new Asteroid({pos : newPos, vel:newVel, dr: newDr}));\n\t\t}\n\t\tthis.bullets = [];\n\t}", "title": "" }, { "docid": "202355bb79b10710fdf16bfeca724e29", "score": "0.49046576", "text": "constructor(_t, _p,_i){\n super(_t,_p);\n this._target = new PIXI.Point(0,0);\n //tint\n this.tintMin = 1;\n this._tintAmount = 1;\n this._targetTint = 1;\n this._vel = 0.1;\n this.toShow = false;\n this.index= 0;\n this._circle = 0;\n this._bros = [];\n this._brosLen = 0;\n this._isArtist = false;\n this.idTime = 0;\n this.width=\n this.height = \n this._targetSize = 3;\n this.type = 0; //0-->grid 1-->tag 2-->button\n\n //assign parameters \n this.index = _i;\n }", "title": "" }, { "docid": "2f61df98b2e11c6d8ad13c6804a784e0", "score": "0.49007645", "text": "function setupNewLevel() {\n var secsToFinish = Math.floor(levelFinishTime - levelStartTime) / 1000;\n var addToScore = Math.floor(100 - 4 * secsToFinish);\n // Update score (based on level completion time) and level.\n // If time machine cheat is active, score will be subtracted and level\n // will be displayed as a question mark.\n if (gamestate.activeCheats.time) {\n if (addToScore > 0) {\n gamestate.score -= addToScore;\n }\n gamestate.level -= 1;\n $(\"#level\").html('?');\n } else {\n if (addToScore > 0) {\n gamestate.score += addToScore;\n }\n gamestate.level += 1;\n $(\"#level\").html(gamestate.level);\n }\n // Start the clock for this level.\n levelStartTime = Date.now();\n // Once the player gets to the dark levels (25+) start increasing\n // the game speed with each level, but maximum game speed is 2.5.\n if (gamestate.level > DARK_LEVELS && gamestate.speed < 2.5) {\n gamestate.speed += 0.05;\n }\n\n\n map = createMap();\n // Set player x and y-coordinates.\n player.startX().startY();\n allEnemies = createEnemies();\n allItems = createItems();\n allAttacks = [];\n if (!player.isUdacious) {\n player.hasKey = false;\n }\n }", "title": "" }, { "docid": "55ce94aae81fd7d34133c4b2b4782e81", "score": "0.48978233", "text": "initShow(){\n this._layerLab.node.active = true;\n this._layerMine.node.active = true;\n this._layerFlag.node.active = true;\n this.showBtn(true);\n for (var i = 0; i < this._iTotal; i++) {\n var iR = i % this._iRow;\n var iL = Math.floor (i / this._iRow);\n this._layerBtn.setTileGIDAt(1, iR, iL);\n this._layerFlag.setTileGIDAt(4, iR, iL);\n this._layerMine.setTileGIDAt(4, iR, iL);\n this._layerLab.setTileGIDAt(4, iR, iL);\n };\n if (GLB.iType == 1)\n this.tPB = [];\n bMove = true;\n this.node.active = true;\n }", "title": "" }, { "docid": "b6813d04160a62bf75db7dd652f74800", "score": "0.48954588", "text": "function ControlPlayer(Level, key) {\n //only affects the player object which matches its id with that of the level\n //something happens where the gameloop continues to affect the previous level's player object\n //this bypasses that stupidity\n if (Level.player.id == Level.id) {\n if (key == \"w\") {\n //sets dx, dy based on the key\n Level.player.attr({ dx: 0, dy: -0.5 });\n //calls a function which handles the players movement\n MovePlayer(Level);\n } else if (key == \"a\") {\n Level.player.attr({ dx: -0.5, dy: 0 });\n MovePlayer(Level);\n } else if (key == \"s\") {\n Level.player.attr({ dx: 0, dy: 0.5 });\n MovePlayer(Level);\n } else if (key == \"d\") {\n Level.player.attr({ dx: 0.5, dy: 0 });\n MovePlayer(Level);\n }\n //for shooting\n else if (key == \"ArrowUp\") {\n //only available on level 3\n if (Level.id == 3) {\n for (let i = 0; i < Level.player.ammo.length; i++) {\n //only 4 bullets allowed at a time\n if (Level.player.ammo[i] == null) {\n //initializes the bullet in the null element in the player.ammo array\n Level.player.ammo[i] = draw\n .polygon(\"3,0 6,3 6,20 3,17 0,20 0,3\")\n .fill(\"#f00\")\n .x(Level.player.x())\n .y(Level.player.y())\n .attr({ dx: 0, dy: -0.1 });\n //return forces only a single shot\n //fixes multiple multidirectional bullet bug\n return;\n }\n }\n }\n } else if (key == \"ArrowDown\") {\n if (Level.id == 3) {\n for (let i = 0; i < Level.player.ammo.length; i++) {\n if (Level.player.ammo[i] == null) {\n Level.player.ammo[i] = draw\n .polygon(\"0,0 3,3 6,0 6,17 3,20 0,17\")\n .fill(\"#f00\")\n .x(Level.player.x())\n .y(Level.player.y())\n .attr({ dx: 0, dy: 0.1 });\n return;\n }\n }\n }\n } else if (key == \"ArrowLeft\") {\n if (Level.id == 3) {\n for (let i = 0; i < Level.player.ammo.length; i++) {\n if (Level.player.ammo[i] == null) {\n Level.player.ammo[i] = draw\n .polygon(\"5,0 20,0 17,3 20,6 5,6 2,3\")\n .fill(\"#f00\")\n .x(Level.player.x())\n .y(Level.player.y())\n .attr({ dx: -0.1, dy: 0 });\n return;\n }\n }\n }\n } else if (key == \"ArrowRight\") {\n if (Level.id == 3) {\n for (let i = 0; i < Level.player.ammo.length; i++) {\n if (Level.player.ammo[i] == null) {\n Level.player.ammo[i] = draw\n .polygon(\"0,0 15,0 18,3 15,6 0,6 3,3\")\n .fill(\"#f00\")\n .x(Level.player.x())\n .y(Level.player.y())\n .attr({ dx: 0.1, dy: 0 });\n return;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "581f65d2f73e15b4e359ecb3fffe331f", "score": "0.4890758", "text": "constructor(x,y,z,dir,tile,collisionLayers){\n\t\tsuper(x,y,z,dir,tile,collisionLayers)\n\t\tthis.collisionLayers.push(\"Tile\")\n\t}", "title": "" }, { "docid": "2e2b0b3c2e15260be6c4e64d27c43bb5", "score": "0.48841256", "text": "function startGame() {\n\tlet levelSelected = document.querySelector(\".btn-level.selected\").dataset.level;\n\n\tinitialiseGame(levelSelected);\n}", "title": "" }, { "docid": "1e380b80bc6e1005873755b4dda0867d", "score": "0.4882792", "text": "function PlayState(config, level)\r\n{\r\n this.config = config;\r\n this.level = level;\r\n\r\n // Game state.\r\n this.invaderCurrentVelocity = 10; //enemy speed, will grow with level\r\n this.invaderCurrentDropDistance = 0; // how far they've moved downwards when they hit the edge of the screen\r\n this.enemyAreDropping = false; //a flag for whether they're dropping\r\n\r\n // Game entities.\r\n this.endLine = null; //create a LIMIT LINE\r\n this.enemy = []; //create a set of the enemy\r\n}", "title": "" }, { "docid": "7f90c89e56e183d6791fd7a826cfbd28", "score": "0.4880659", "text": "function LevelIntroState(level)\r\n{\r\n this.level = level; //Has a state of it's own. Gets the current level.\r\n this.countdownMessage = \"3\"; // IT'S THE FINAL COUNTDOOOOOOOWWWWWWNNNNNN\r\n}", "title": "" }, { "docid": "19b68d2ab1e8a8ee2ebe39a2874656d3", "score": "0.4877209", "text": "function LevelTransitionScreenState() {\n\n this.setup = function () {\n\n log('Game State: transition after level ' + current_level_number);\n\n touchControlsVisible(false);\n\n // clear the stopwatch timer if any\n if (game_timer) window.clearInterval(game_timer);\n\n transitionEndtime = new Date().valueOf() + TRANSITION_LENGTH_MS; // five seconds\n\n game_paused = true; // no clock updates\n\n if (transition_mode == TRANSITION_GAME_OVER) {\n sfxdefeat();\n }\n\n if (transition_mode == TRANSITION_LEVEL_COMPLETE) {\n current_level_number++; // upcoming level\n sfxvictory()\n }\n\n } // transition screen setup function\n\n // transition screen\n this.update = function () {\n\n // wobble just for fun\n msgboxSprite.scaleTo(0.75 + (Math.sin(new Date().valueOf() * 0.001) / (Math.PI * 2)));\n\n if (particles_enabled) updateParticles();\n\n // fireworks!\n if (Math.random() > 0.92) {\n startParticleSystem(jaws.width / 4 + Math.random() * jaws.width / 2, jaws.height / 2 - 200 + (Math.random() * 400));\n }\n\n if (use_parallax_background) {\n // update parallax background scroll\n titleparallax.camera_x += 4;\n }\n\n if (transitionEndtime < (new Date().valueOf())) {\n\n log('transition time is up');\n\n game_paused = false; // keyboard doesn't reset this\n\n if (transition_mode == TRANSITION_GAME_OVER) {\n log('transitioning from game over to titlescreen');\n gameOver(false);\n }\n else {\n if (level[current_level_number]) {\n log('about to play level ' + current_level_number);\n sfxstart();\n jaws.switchGameState(PlayState); // begin the next level\n }\n else {\n log('no more level data: the player BEAT the game!');\n gameOver(true);\n }\n }\n }\n\n } // transition screen update function\n\n this.draw = function () {\n\n if (use_parallax_background) titleparallax.draw();\n msgboxSprite.draw();\n if (transition_mode == TRANSITION_GAME_OVER) {\n gameoverSprite.draw();\n outOfTimeSprite.draw();\n }\n else {\n if (level[current_level_number]) // more to come?\n {\n //log('Next world (level ' + current_level_number + ') exists...');\n levelcompleteSprite.draw();\n }\n else // game over: final level completed!\n {\n //log('Next world (level ' + current_level_number + ') does not exist. GAME COMPLETED!');\n gameoverSprite.draw();\n beatTheGameSprite.draw();\n }\n }\n if (particles_enabled) particles.draw();\n\n } // transition screen draw function\n\n }", "title": "" }, { "docid": "00f2843c066475242ac02da55b2b27f8", "score": "0.48760378", "text": "function pageLevel(catTitle)\n\t{\n\t\tcurState = 2;\n\t\tmoveBackground(SLIDE_STEP * 2);\n\t\t\n\t\tvar levelContainer = stateLevel.find('.buttonItemsConainer');\n\t\t\n\t\tlevelContainer.empty();\n\t\t\n\t\t// hide this state:\n\t\tstateCat.css('display','none');\n\t\t\n\t\t// Show Levels:\n\t\tstateLevel.css('display','block');\n\t\tstateLevel.find('.titleHeader .titleText').addClass('rightIn').text(catTitle);\n\t\t\n\t\t// Get number of levels for this category \n\t\t\t// (add +1, due to levels doesn't start at 0):\n\t\tvar nrOfLvls = numberOfLevels( allCatgories[catTitle] ) + 1;\n\t\t\n\t\t// Add levels to view:\n\t\tfor (var i = 1; i < nrOfLvls; i++)\n\t\t{\n\t\t\tvar itemlevel =\n\t\t\t[\n\t\t\t\t'<a role = \"level\" class = \"buttonItems\"',\n\t\t\t\t'href=\"game.html?c=' + catTitle + '&l=' + i + '\">',\n\t\t\t\t'level '+ i +'</a>'\n\t\t\t].join('');\n\t\t\t\n\t\t\tlevelContainer.append(itemlevel);\n\t\t\tsetTimeout(function()\n\t\t\t{\n\t\t\t\tlevelContainer.find('.buttonItems').addClass('popIn');\n\t\t\t},POPUP_TIME);\n\t\t}\n\t\t\n\t\tsetToPosition();\n\t}", "title": "" }, { "docid": "e28ee62dda4c8530ad8999b829bc3a58", "score": "0.48734245", "text": "constructor(properties, id){\r\n /* Gameplay elements */\r\n this.playground = document.getElementsByClassName('playground')[0];\r\n this.field = document.getElementsByClassName('field')[0];\r\n this.ball = null;\r\n this.menu = null;\r\n\r\n /* Game settings */\r\n this.id = id;\r\n this.name = properties.name;\r\n this.color = properties.backgroundColor;\r\n this.image = properties.backgroundImage;\r\n this.border = properties.borderColor;\r\n this.shell = properties.shell;\r\n this.speed = properties.shellTransition;\r\n\r\n /* Gameplay slots and timers */\r\n this.freeSlots = [];\r\n this.usedSlots = [];\r\n this.reservedSlots = [];\r\n this.enemyTimer = null;\r\n this.timeToEnemyTimer = null;\r\n this.collisionTimer = null;\r\n\r\n /* Init game */\r\n this.prepareGame(); // prepares page for game mode\r\n if (this.menu) // if menu - game is on, so, exit from curent game\r\n this.exitGame();\r\n this.createMenu(); // create menu\r\n }", "title": "" }, { "docid": "cb09b19855a595ce1947a30db7ba995c", "score": "0.48675257", "text": "constructor(name, location, width, height, color,options) {//creates button objects that assigns properties based on the parameters\n this.name = name\n this.location = location\n this.width = width\n this.height = height\n this.color = color\n this.hover = false\n this.down = false\n this.options = options\n }", "title": "" }, { "docid": "f6b2c7864dbd7726a284e62303f760af", "score": "0.48654997", "text": "constructor(index, initialState, x, y) {\n this.state = initialState || false;\n this.index = index;\n\n // Create a new game object for the lever\n this.object = new GameObject({\n sprite: {\n spriteSheet: \"assets/img/objects/lever-off.png\",\n tileCount: 1,\n tickRate: 0,\n tileWidth: 36,\n tileHeight: 36,\n renderWidth: 64,\n renderHeight: 64,\n renderPixelated: true\n },\n interactable: true,\n name: \"lever\",\n renderLayer: 14, // 1 under the player\n animated: false,\n onInteract: this.onInteract.bind(this),\n interactionSound: sounds.leverOn\n }, x, y);\n\n // Render the lever\n this.renderState();\n }", "title": "" }, { "docid": "148ee4ed0813b363a66b7eecb5beee25", "score": "0.4861271", "text": "constructor(id, pos, color) {\n this.gold = 0;\n this.id = id;\n this.name = \"\";\n this.units = [];\n this.listpos = pos;\n this.settlers = 10;\n this.color = color; //ID for color tile\n this.ownedTiles = [];\n }", "title": "" }, { "docid": "92d0189cae6b2c1fcce4b88524a07245", "score": "0.48492026", "text": "function PowerButtonObject(glContext) {\n // Local storage variables and \"constants\"\n var gl = glContext;\n var button;\n var buttonPosition = { x: 0, y: 0, z: 0 };\n\n // Arrays that hold Object details\n var vertArray = [];\n var texCoordsArray = [];\n var textureArray = [];\n var buttonTextures = [];\n\n // Basic texture coordinates\n var textureCoords = [\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 0.0, 0.0\n ];\n\n // Simple vertex values describing a square\n var buttonVertices = [\n vec3.fromValues(0.15, 0.15, 0.1),\n vec3.fromValues(-0.15, 0.15, 0.1),\n vec3.fromValues(0.15, -0.15, 0.1),\n vec3.fromValues(-0.15, -0.15, 0.1)\n ];\n\n /**\n * This method creates the object's geometry and texture assignment.\n * @param textureArray An array of textures, an active texture and an inactive texture for the Power button.\n * @param shaderProgram The reference to the Shader Program Object to be used for rendering this object.\n */\n this.create = function (textureArray, shaderProgram) {\n // Create a copy of all the texures for local use\n buttonTextures = textureArray.slice();\n var currentTexturesArray = [];\n\n // Create the geometry, texture coordinates and texture arrays and assign the first (active) texture to it by default\n vertArray.push(buttonVertices);\n texCoordsArray.push(textureCoords);\n currentTexturesArray.push(textureArray[0]);\n\n // Finally create the actual 3d object\n button = new WebGL.object3d(gl);\n if (!button.initGeometry(vertArray, texCoordsArray))\n console.log(\"Power Button error. Error initializing Geometry!\");\n if (!button.assignTextures(currentTexturesArray))\n console.log(\"Power Button error. Error assigning Textures!\");\n button.assignShaderProgram(shaderProgram);\n };\n\n /**\n * This method is used to render the object onto the canvas\n * @param movementMatrix The 4x4 matrix describing the offset from origin for this object\n */\n this.draw = function (movementMatrix) {\n // Translate the object's frame of reference by the one passed as parameter and the x, y and z offset of the object's relative position\n var translation = vec3.fromValues(buttonPosition.x, buttonPosition.y, buttonPosition.z);\n var translationMatrix = mat4.create();\n mat4.translate(translationMatrix, movementMatrix, translation);\n\n // Draw the object\n if (!button.draw(translationMatrix))\n console.log(\"Power Button Drawing error!\");\n };\n\n /**\n * This method sets the relative position of the object\n * @param position An array indicating the relative x, y and z-axis position of this object\n */\n this.setPosition = function (position) {\n buttonPosition.x = position[0];\n buttonPosition.y = position[1];\n buttonPosition.z = position[2];\n };\n\n /**\n * This function is a click handler for the Power button object\n */\n this.click = function () {\n // Reset all game values, set game state to inactive and push button inward a little along z-axis.\n window.currentGameState = window.gameState.Inactive;\n window.numberValues.losses = 0;\n window.numberValues.wins = 0;\n window.numberValues.totalTurns = 0;\n window.numberValues.moneyWon = 0;\n window.numberValues.playerBet = 0;\n window.numberValues.playerMoney = 1000;\n\n buttonPosition.z -= 0.05;\n setTimeout(depressButton, 100);\n };\n\n /**\n * This function simply restores the button's z-axis position and resets clicked flag to false\n */\n function depressButton() {\n buttonPosition.z += 0.05;\n }\n}", "title": "" }, { "docid": "0bf59b0328a9e924f28065632bfa0ee5", "score": "0.4846946", "text": "constructor(levelcount)\n\t{\n\t\tthis.numberOfPicks = levelcount;\n\t\tthis.demopicks = new Array(this.numberOfPicks);\n\t\tthis.clearDemoPicks();\n\t}", "title": "" } ]
c74cbfcd3a5c74367c793ad49db21960
p : geolocation object
[ { "docid": "0c5229e8cd933bf140fa93bd8158f2eb", "score": "0.60992354", "text": "function success_callback(p){\n // p.latitude : latitude value\n // p.longitude : longitude value\n \n //alert(\"Found you at latitude \" + p.coords.latitude +\n // \", longitude \" + p.coords.longitude);\n \n //getting current user location\n latitude = p.coords.latitude;\n longitude = p.coords.longitude;\n \n //I guess we call it in here?\n $( \"#address\" ).val(latitude + \" ,\" + longitude);\n }", "title": "" } ]
[ { "docid": "f85606c8f09b8bedfdbe73851c669742", "score": "0.72297704", "text": "function locationToGeoCode() {\n\n }", "title": "" }, { "docid": "70534c1ccfc1ff58b5df1abc918e8fb1", "score": "0.6874542", "text": "function getGeoLocation(data){\n if(data.length < 1){\n return false;\n }\n else {\n return {\n loc : data[0]['geometry']['location'],\n formatted_address : data[0]['formatted_address']\n };\n } \n }", "title": "" }, { "docid": "191b37905ee7e82b1eadd848d4c56e95", "score": "0.6760736", "text": "function getLocation() {\n currentLat = geoplugin_latitude();\n currentLon = geoplugin_longitude();\n handleGetData();\n}", "title": "" }, { "docid": "ccd9971290e567aa599def42e9df2aca", "score": "0.6562877", "text": "function Location(data){\n this.formatted_query = data.formatted_address;\n this.latitude = data.geometry.location.lat;\n this.longitude = data.geometry.location.lng;\n}", "title": "" }, { "docid": "95eedb8e7c007ebda52b087d3974115f", "score": "0.6533746", "text": "function onGeoSuccess(location) {\n self.latitude = location.coords.latitude;\n self.longitude = location.coords.longitude;\n self.city = location.address.city;\n self.region = getUF(location.address.region);\n self.area = self.city + self.region;\n return self;\n }", "title": "" }, { "docid": "7c5e8b6d8f3481395dfa051c2f716b36", "score": "0.6526297", "text": "function Geolocation() {\n /**\n * The last known GPS position.\n */\n this.lastPosition = null;\n this.lastError = null;\n\n var self = this;\n GapGeolocation.positionUpdated.connect(function(position) {\n self.lastPosition = position;\n });\n GapGeolocation.error.connect(function(error) {\n self.lastError = error;\n });\n}", "title": "" }, { "docid": "f040a46e631b4e02b47d6c3349a84e10", "score": "0.6457723", "text": "async getGeoData(){return this.geo;}", "title": "" }, { "docid": "27a8738fec0591087d12d253af52b140", "score": "0.64206785", "text": "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = {\n lat : position.coords.latitude,\n lng : position.coords.longitude\n };\n });\n }\n}", "title": "" }, { "docid": "8e5adb68d8647c70960e8227baedd46f", "score": "0.6402124", "text": "function geoLocation\n(\n) \n{\n if (navigator.geolocation) \n {\n navigator.geolocation.getCurrentPosition(function(position) \n {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n if (typeof autocomplete != 'undefined')\n {\n autocomplete.setBounds(\n new google.maps.LatLngBounds(geolocation,\n geolocation));\n } \n });\n }\n}", "title": "" }, { "docid": "acbdeab79e73c4e7fad97ffc270bee42", "score": "0.6362492", "text": "function GeoPoint () {\n return _default({\n '_type': 'GeoPoint'\n });\n}", "title": "" }, { "docid": "17df472f35f559f58b46cd69f7cbfc41", "score": "0.633549", "text": "function getLocation() {\n\n if (navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(setLocation);\n\n }\n else {\n }\n}", "title": "" }, { "docid": "932e526ff5fd7e463c353eec9f668604", "score": "0.6326633", "text": "getLatitude()\n {\n return this.location.latitude;\n }", "title": "" }, { "docid": "5f4dc702620672d4bd4b97642d1b243c", "score": "0.6314532", "text": "function success(p)\n{\n\tvar lat = p.coords.latitude;\n\tvar lng = p.coords.longitude;\n\tvar acc = p.coords.accuracy;\n\tcallbackReportLocation(lat, lng, acc)\n}", "title": "" }, { "docid": "ad23edee41255f113fd9fc4ae7c6669b", "score": "0.63131356", "text": "function getLngLat() {\n\t\n}", "title": "" }, { "docid": "be7cf4643ac62f37e8a2e158d2ede946", "score": "0.63057244", "text": "function onGeoSuccess(location) {\n console.log('SUCCESS');\n console.log(location);\n }", "title": "" }, { "docid": "83abda49b499dcf6f1ad66aa56b26ce6", "score": "0.62894326", "text": "function geoLocate() {\n if(\"geolocation\" in navigator)\n navigator.geolocation.getCurrentPosition(geoLocSearch);\n else\n return;\n }", "title": "" }, { "docid": "d48256e72387afb37594c8505bf42510", "score": "0.62864304", "text": "function geolocationSuccess(position)\r\n{\r\n // Sets value of attribute q of geocoder object to coordinates to 7 decimal places \r\n geocoderData.q = position.coords.latitude.toFixed(7) + \",\" + position.coords.longitude.toFixed(7);\r\n console.log(geocoderData.q);\r\n}", "title": "" }, { "docid": "67a4c846dc651b0322700bd295d56ff6", "score": "0.6279776", "text": "function pointToGeo(point) {\n return {\n longitude: point[0],\n latitude: point[1]\n };\n}", "title": "" }, { "docid": "12b31d2965761029c0014d4ccb0133d8", "score": "0.6278494", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(recordPosition);\r\n } else {\r\n console.log(\"Geolocation is not supported by this browser.\");\r\n\t coords = {latitude: 90,\r\n longitude: 0};\r\n\t }\r\n}", "title": "" }, { "docid": "67a2881543a8b016867b68e60991734e", "score": "0.6274557", "text": "get geo() {\r\n return this.payload.geo;\r\n }", "title": "" }, { "docid": "ba147a2840f3d3a4be95e718c8295e20", "score": "0.62718344", "text": "function getGeoPoint( address )\n{\n\tconsole.error( \"Hiiii\" );\n\tconsole.error( address );\n\tParse.Cloud.httpRequest({\n\n\t\t\tmethod: \"POST\",\n\t\t\turl: 'https://maps.googleapis.com/maps/api/geocode/json',\n\n\t\t\tparams: {\n\t\t\t\taddress : address,\n\t\t\t\tkey: \"AIzaSyADYKV1S-640B-KTxkkD-HXb8slGMCvb2I\"\n\t\t\t}\n\t\t}).then(\n\t\t\t function( googleResponse ) \n\t\t\t {\n\n\t\t\t\tvar data = googleResponse.data;\n\t\t\t\tconsole.error( \"Working !!\" );\n\n\t\t\t\tif( data.status == \"OK\")\n\t\t\t\t{\n\t\t\t\t\tvar langLat = data.results[0].geometry.location;\n\t\t\t\t\tvar point = new Parse.GeoPoint( { latitude: langLat.lat, longitude: langLat.lng } );\n\t\t\t\t\treturn point;\n\t\t\t\t}\n\t\t\t\treturn \n\t\t\t },\n\t\t\t function( error )\n\t\t\t {\n\t\t\t \treturn error;\n\t\t\t }\n\t\t\t);\n}", "title": "" }, { "docid": "d48e23e8a55e4efecb467f75dc151afa", "score": "0.62702155", "text": "function GeolocationService() {\n this.ns = \"http://webinos.org/api/geolocation\";\n this.name = \"geolocation\";\n this.invoke = geolocationInvoke; // as seen from app\n this.onResult = null; // callback function for 'on result'\n this.result = function(lat, lon) { // called by webinosImpl when result is avail\n if (this.onResult) (this.onResult)(lat, lon);\n };\n this.onError = null; // callback function for 'on result'\n this.error = function(err) { // called by webinosImpl when query failed\n if (this.onError) (this.onError)(err);\n };\n}", "title": "" }, { "docid": "a378190115278f784094b037ca12bb2f", "score": "0.62611", "text": "getLocation(){\n Geolocation.getCurrentPosition(\n\t\t\tposition => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n console.log(this.latitude);\n console.log(this.longitude);\n },\n\t\t\terror => Alert.alert(error.message),\n\t\t\t{ enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 }\n\t\t);\n }", "title": "" }, { "docid": "da68c4dc3453f95e2c7d830a8e5fbd0c", "score": "0.6253384", "text": "getLongitude()\n {\n return this.location.longitude;\n }", "title": "" }, { "docid": "50c8b0636c27da2498150f26a8a40b11", "score": "0.6219467", "text": "async getGeolocation() {\n const location = (await axios.get(`https://ipwhois.app/json/`)).data;\n const geolocation = {\n location: location.country,\n countryCode: location.country_code,\n isp: location.isp\n };\n return geolocation;\n }", "title": "" }, { "docid": "5c90cc581e761a35175a99130df54d99", "score": "0.6218657", "text": "function location(lat, longi) {\n this.latitude = lat;\n this.longitude = longi;\n}", "title": "" }, { "docid": "b4078b790274c7d98d3a08872016177e", "score": "0.62119764", "text": "function basicGeolocate() {\n navigator.geolocation.getCurrentPosition(geolocateSuccess, null, { enableHighAccuracy: true });\n}", "title": "" }, { "docid": "9eeb8ceea23dfb858b55ccf6e81796f6", "score": "0.62048596", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(setPosition);\r\n } else {\r\n pos = [40.692908,-73.9896452];\r\n }\r\n}", "title": "" }, { "docid": "7fc9684a2ca1df218a1300d6b224a14e", "score": "0.62015533", "text": "function lat_lng(lat,lng)\n{\n this.lat = lat\n this.lng = lng\n}", "title": "" }, { "docid": "0cc663545b43de37e29cd8397192ff22", "score": "0.6195863", "text": "function getLocation(){\n navigator.geolocation.getCurrentPosition(geoCallback, onError)\n }", "title": "" }, { "docid": "8377e8c966da08682c606e3d227786b7", "score": "0.619288", "text": "function get_location(location) {\n navigator.geolocation.getCurrentPosition(show_map);\n}", "title": "" }, { "docid": "3cd7602106d247d7297051b65ac9b6d8", "score": "0.6187797", "text": "function loadGeoObjects()\n {\n navigator.geolocation.getCurrentPosition(gotPosition);\n }", "title": "" }, { "docid": "9aadc7ee15957823123d63614a8645b1", "score": "0.61861837", "text": "function updateLocation() {\r\n\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n coordinates = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n });\r\n }\r\n setMapPosition();\r\n //console.log(coordinates);\r\n}", "title": "" }, { "docid": "47c6ec66f80aaadd9ba367104698075b", "score": "0.6178947", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(recordPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n\t coords = {latitude: 90,\n longitude: 0};\n\t }\n}", "title": "" }, { "docid": "b525f227fd20267e917c03c37727d7b5", "score": "0.61784494", "text": "function getLocation(){\n navigator.geolocation.getCurrentPosition(geoCallback, onError)\n }", "title": "" }, { "docid": "e1fbac6def3fbaf3f51f886168349cfa", "score": "0.61729425", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n mapObject.innerHTML = \"Geolocation is not supported by this browser.\";\n };\n}", "title": "" }, { "docid": "23828ebfe79ff5a86060d825d3941cde", "score": "0.6169383", "text": "function getLocation(){\n // Once the position has been retrieved, an JSON object\n // will be passed into the callback function (in this case geoCallback)\n // If something goes wrong, the onError function is the \n // one that will be run\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "e8d437c330951b91be78027d353e4d4f", "score": "0.6165496", "text": "function LatLng() {\n var defer = $q.defer();\n $ionicLoading.show();\n geoService.nearBy().then(function(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n defer.resolve();\n }, function(error) {\n $ionicLoading.hide();\n self.mapEnable = false;\n defer.reject();\n console.log(error);\n }).catch(function(err) {\n defer.reject();\n $ionicLoading.hide();\n\n });\n return defer.promise;\n }", "title": "" }, { "docid": "31834ec9193a9d2f9d6f8073d5c0017b", "score": "0.6150544", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(displayPosition);\n}", "title": "" }, { "docid": "4816581f62224c7ae015a893d83bc92b", "score": "0.6142381", "text": "constructor(longitude, latitude){\r\n this._lng = longitude;\r\n this._lat = latitude;\r\n }", "title": "" }, { "docid": "c43a0865f4b16b7ae08af53b0e80123c", "score": "0.61353457", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(blockPage, showError);\n}", "title": "" }, { "docid": "629a789e820a4d7aa7751365c8ffbd38", "score": "0.61314607", "text": "function geolocate() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(geoSuccess, geoError);\n\t\t} else {\n\t\t\tconsole.log('geolocation not supported');\n\t\t}\n\t}", "title": "" }, { "docid": "f086b51e5de5d1d43ca291b3d8c8f0a7", "score": "0.6126279", "text": "function geoFindMe() {\n\tlet success = (position) => {\n\t\tlatitude = position.coords.latitude;\n\t\tlongitude = position.coords.longitude;\n\t\tconsole.log(latitude, longitude);\n\t};\n\tlet error = () => {\n\t\talert('Errore geolocalizzazione non disponibile nel tuo Browser');\n\t};\n\tnavigator.geolocation.getCurrentPosition(success, error);\n}", "title": "" }, { "docid": "b5deb435237ed600348895ec632b6ac7", "score": "0.61255884", "text": "function myGeoloc(){\r\n\r\n\tif (navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(myGeolocSuccess, myGeolocError,{enableHighAccuracy:true});\r\n\t} else {\r\n\t\terror('Geolocation not supported');\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "de5136503162a59e009dfbcd9820a7be", "score": "0.6125514", "text": "get location() {\n return new Point(this.x, this.y);\n }", "title": "" }, { "docid": "41d4bf4aaef3b19f13fafddbbb1eae4c", "score": "0.61184037", "text": "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude\n this.longitude = position.coords.longitude\n this.autoLocation = true\n this.handleSubmit(null)\n })\n }\n }", "title": "" }, { "docid": "a4f494b3fef2c612dff97abf5bc6dde6", "score": "0.6115057", "text": "function GeoCalc() {\n}", "title": "" }, { "docid": "de62863b4b5f522bde8fca584c8dc630", "score": "0.6093953", "text": "constructor(latitude, longitude) {\n this.latitude = latitude;\n this.longitude = longitude;\n }", "title": "" }, { "docid": "363412fcd662c76ee712fa112aa70ace", "score": "0.608991", "text": "_getGeolocation() {\n if (this._geolocation !== undefined) {\n return this._geolocation;\n }\n\n let source = this.get('flexberry-geolocation-source');\n\n if (!source && navigator && navigator.geolocation) {\n source = navigator.geolocation;\n }\n\n if (!source) {\n throw new Error('Geolocation source is not defined.');\n }\n\n return this._geolocation = source;\n }", "title": "" }, { "docid": "f73a29511e1f6bb27bf33b76e2c3614b", "score": "0.60854656", "text": "function getLatLng() {\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(onPositionUpdate);\n } else {\n alert(\"navigator.geolocation is not available\");\n }\n }", "title": "" }, { "docid": "eaa2e50b426391030a7e60948880a297", "score": "0.6084385", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(insertPosition);\n }\n}", "title": "" }, { "docid": "41b8927a723ffa08b9b63ae175d73bc4", "score": "0.6083634", "text": "function getGeolocation() {\n\t\t\t$.mobile.loading('show', {\n\t\t\t\ttheme: \"a\",\n\t\t\t\ttext: \"Aguarde...\",\n\t\t\t\ttextonly: true,\n\t\t\t\ttextVisible: true\n\t\t\t});\n\t\t\t// get the user's gps coordinates and display map\n\t\t\tvar options = {\n\t\t\tmaximumAge: 3000,\n\t\t\ttimeout: 5000,\n\t\t\tenableHighAccuracy: true\n\t\t\t};\n\t\t\tnavigator.geolocation.getCurrentPosition(loadMap, geoError, options);\n\t\t}", "title": "" }, { "docid": "5e4103768a3c5cb8cb1608cb51511ff3", "score": "0.607972", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(locationSuccess, locationFailure);\n}", "title": "" }, { "docid": "a3275a38fbca1efe4a8e762884494674", "score": "0.6076085", "text": "function getLocation(){\n latLng = {lat: current_location.getPosition().lat(),\n lng: current_location.getPosition().lng()};\n console.log('Current position: ' + JSON.stringify(latLng));\n return latLng;\n}", "title": "" }, { "docid": "a0aac3cfc0c64437e0cfe3ff2875ad0a", "score": "0.6075687", "text": "function initMap() {\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(position)\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n\n }, function() {\n\n });\n } else {\n\n }\n }", "title": "" }, { "docid": "3bbd8b2f074ee6e84f005dfb483dc724", "score": "0.6069524", "text": "coordinates() {\n return {\n latitude: this.latitude(),\n longitude: this.longitude(),\n }\n }", "title": "" }, { "docid": "6b2f685f004a0d676d973068794be733", "score": "0.60668695", "text": "getLocation() {\r\n\t\t\t\t\tif (navigator.geolocation) {\r\n\t\t\t\t\t\tnavigator.geolocation.getCurrentPosition(app.showPosition);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\talert(\"Geolocation is not supported by this browser.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "990015171dc5a2bcebc3d671656195c8", "score": "0.6056715", "text": "function getGeoLocation() {\n navigator.geolocation.getCurrentPosition(setGeoCookie);\n}", "title": "" }, { "docid": "918bca0e82f6f87b39e331d48f9548af", "score": "0.60503006", "text": "function getLocation()\n{\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(getPosition,showError);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n}", "title": "" }, { "docid": "2500c5b2f76938f354e325740efccdf7", "score": "0.604642", "text": "_getPosition() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n this._loadMap.bind(this),\n //failure function\n function () {\n alert('Unable to get your position');\n }\n );\n }\n //if browser does not support geolocation\n else {\n alert('This browser does not support geolocation');\n }\n }", "title": "" }, { "docid": "1c61f8a7a680da1d483a04adba73606d", "score": "0.6045946", "text": "function getLocation()\n {\n if (navigator.geolocation)\n\t{\n\tnavigator.geolocation.getCurrentPosition(showPosition,showError);\n\t}\n else{x.innerHTML=\"Geolocation is not supported by this browser.\";}\n }", "title": "" }, { "docid": "785015f4d97e68939d63658d33e72113", "score": "0.60365486", "text": "function getCurrentLocation() {\n var options = {\n enableHighAccuracy: true\n };\n\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (pos) {\n $scope.position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);\n var point = JSON.parse(JSON.stringify($scope.position));\n if (_.isObject(point)) {\n $scope.map.center = {\n latitude: point.lat,\n longitude: point.lng\n };\n geoService.findPostCodeFromCoordinates(point.lat, point.lng)\n .success(function (response) {\n var result = _.head(response.result);\n if (result) {\n $scope.postCode = result.postcode;\n $scope.findWard(result.postcode, true);\n }\n });\n }\n },\n function () {\n }, options);\n }\n }", "title": "" }, { "docid": "bb3ca4718be6af02b6564ab1ea985c01", "score": "0.60358846", "text": "function getGeoLocation() {\r\n var options = { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 };\r\n \r\n function success(pos) {\r\n geoLocation = pos.coords;\r\n }\r\n function error(err) {\r\n alert(\"ERROR (\"+ err.code + \"): \" + err.message);\r\n }\r\n return navigator.geolocation.getCurrentPosition(success, error, options);\r\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6021314", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "9d7d59501ebdc1d383a1d450ee9c2d70", "score": "0.60128593", "text": "function getGeoPoint( params, callback )\n{\n\tif( exists( params[\"coords\"] ) ) \n\t{\n\t\tvar point = new Parse.GeoPoint( { latitude: params[\"coords\"][\"lat\"], \n\t\t\tlongitude: params[\"coords\"][\"lng\"] } );\n\n\t\tparams[\"coords\"] = point;\n\n\t\tcallback.success( params ) ;\n\t}\n\telse\n\t{\n\t\tParse.Cloud.httpRequest({\n\t\t\t\n\t\t\tmethod: \"POST\",\n\t\t\turl: 'https://maps.googleapis.com/maps/api/geocode/json',\n\n\t\t\tparams: {\n\t\t\t\taddress : params[\"address\"],\n\t\t\t\tkey: \"AIzaSyADYKV1S-640B-KTxkkD-HXb8slGMCvb2I\"\n\t\t\t}}).then(\n\t\t\t function( googleResponse ) \n\t\t\t {\n\n\t\t\t\tvar data = googleResponse.data;\n\n\t\t\t\tif( data.status == \"OK\")\n\t\t\t\t{\n\t\t\t\t\tvar langLat = data.results[0].geometry.location;\n\t\t\t\t\tvar point = new Parse.GeoPoint( { latitude: langLat.lat, longitude: langLat.lng } );\n\n\t\t\t\t\tparams[\"coords\"] = point;\n\t\t\t\t}\n\n\t\t\t\tcallback.success( params ) ;\n\t\t\t },\n\t\t\t function( error )\n\t\t\t {\n\t\t\t \t callback.error( error );\n\t\t\t }\n\t\t\t);\n\t}\n}", "title": "" }, { "docid": "aabb057558c4704f2c9051547f363442", "score": "0.6011757", "text": "function getPosition(){\n navigator.geolocation.getCurrentPosition(query);\n}", "title": "" }, { "docid": "28bf6e64d3ae59259375012e1d31876b", "score": "0.60018355", "text": "function geo_get_info(){\n\treturn {\n\t\tmote_id\t\t: this.moteid,\n\t\thub_id\t\t: this.hubid\n\t};\n}", "title": "" }, { "docid": "3f0c2c68a41df7d29afd4d141173d4b8", "score": "0.5999666", "text": "function getLocation(){\n var location = navigator.geolocation.getCurrentPosition(handleSuccessLocation);\n}", "title": "" }, { "docid": "2ed5885cdc17998b10429463ed59f42c", "score": "0.59919477", "text": "function Location(query, location){\n this.search_query = query;\n this.formatted_query = location.formatted_address;\n this.latitude = locationgeometry.location.lat;\n this.longtitude = locaiton.geometry,location.lng;\n}", "title": "" }, { "docid": "c2fc66993ad4daccb41f05c23e0324cb", "score": "0.5985917", "text": "function getLocation() {\r\n\r\n if (navigator.geolocation) {\r\n\r\n navigator.geolocation.getCurrentPosition(onPositionReceived, locationNotReceived)\r\n }\r\n}", "title": "" }, { "docid": "e5b9a303aa8a8701d56df736b3fec068", "score": "0.5984988", "text": "function GEOloc(query, fmtQ, lat, long) {\n this.search_query = query;\n this.formatted_query = fmtQ;\n this.latitude = lat;\n this.longitude = long;\n\n}", "title": "" }, { "docid": "dcb9fab777fa080fd7e3c5e4ca053f99", "score": "0.5982795", "text": "function Location(query, geoData) {\n this.search_query = query;\n this.formatted_query = geoData.results[0].formatted_address;\n this.latitude = geoData.results[0].geometry.location.lat;\n this.longitude = geoData.results[0].geometry.location.lng;\n}", "title": "" }, { "docid": "cbfd473050252351aa63aacb863381c3", "score": "0.5980661", "text": "function locations() {\n \n function latitudeLongtitude(possition){ // to get latitude and longtitude\n const coordinate = possition.coords;\n \n console.log(`This is the Latitude : ${coordinate.latitude.toFixed(15)}`);//decimal 16 digit after point\n console.log(`This is the Longitude: ${coordinate.longitude}`);\n }\n\n navigator.geolocation.getCurrentPosition(latitudeLongtitude);\n }", "title": "" }, { "docid": "889370064a467fc8dfb2d31497956596", "score": "0.59712607", "text": "function GoogleGEOGetLocation(success) {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, GoogleGEOLocationErrorHandler);\n }\n else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "f1e00c9d34a5d41637a2d4c3b5a2cc69", "score": "0.5965067", "text": "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showLocation, showError);\n }\n else{\n showErrorResponse(\"Browser does not support Geolocation\");\n }\n}", "title": "" }, { "docid": "66c17bfb22c792cb4e370996f625f5c0", "score": "0.595654", "text": "function getLocation() {\n\n // ActivateSlot and geolocError is a callback.\n navigator.geolocation.getCurrentPosition(activateSlot, geolocError) \n}", "title": "" }, { "docid": "0ab59589ba51ff58439a61b1c8929fc4", "score": "0.5956051", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n // navigator.geolocation.getCurrentPosition(getJobs);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "a03a6e83f91ba69720db1b94fb7db4e8", "score": "0.59558886", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(sendGeolocation);\n }\n }", "title": "" }, { "docid": "dc457e8357c6fe796fbac2f1e042d0e0", "score": "0.5952408", "text": "function obtenirLocalisation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(determinerPosition, annulerAffichage);\r\n } else {\r\n alert(\"Geolocalisation non implementee.\");\r\n }\r\n }", "title": "" }, { "docid": "d0ae29038c26c135e8a85a828b45ff54", "score": "0.59515905", "text": "function getGeoLocation() {\n var xhr = new XMLHttpRequest();\n xhr.addEventListener('load', gotLocation);\n xhr.open(\"GET\", \"http://ip-api.com/json\");\n xhr.send();\n}", "title": "" }, { "docid": "d9c95519a99c9073869b60ef9bddc1f5", "score": "0.59466755", "text": "function getGeoLocation(){\n\tif (navigator.geolocation) { \n\t\tfunction success(pos) {\n\t\t var crd = pos.coords;\n\t\t conData.position = crd.latitude + crd.longitude;\n\t\t};\n\n\t\tfunction error(err) {\n\t\t console.warn('ERROR(' + err.code + '): ' + err.message);\n\t\t};\n\n\t\tnavigator.geolocation.getCurrentPosition(success, error);\n\t}\n}", "title": "" }, { "docid": "9634c0315a580a1bceb4cf92bc9fb642", "score": "0.59438896", "text": "function geoGeoLocation(longitude, latitude) {\n $scope.organization.address.latitude = latitude;\n $scope.organization.address.longitude = longitude;\n $scope.latlng = [latitude, longitude];\n if ((longitude == null || longitude == \"\" || longitude == undefined) && (latitude == null || latitude == \"\" || latitude == undefined)) {\n $scope.locationPointer = [89.99989983053331, -133.41796875];\n $scope.mapCenter = \"19,83\";\n $scope.mapZoom = 3;\n }\n else {\n $scope.locationPointer = [latitude, longitude];\n $scope.mapCenter = latitude + \",\" + longitude;\n $scope.mapZoom = 5;\n }\n }", "title": "" }, { "docid": "d442f8578a1d05e940be48cd64473c20", "score": "0.59365135", "text": "function convertToGeocode(name, location){\n\t\t\t\t\treturn {\n\t\t\t\t\t\tformatted_address: name,\n\t\t\t\t\t\tgeometry: {\n\t\t\t\t\t\t\tlocation: location\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}", "title": "" }, { "docid": "ad4be78b876a84fb73ecfbbeb3d554df", "score": "0.5934236", "text": "function Location(query, data) {\r\n this.search_query = query;\r\n this.formatted_query = data.formatted_address;\r\n this.latitude = data.geometry.location.lat;\r\n this.longitude = data.geometry.location.lng;\r\n}", "title": "" }, { "docid": "f9aca50e9a3db1c4d8f1f1a940ea2e26", "score": "0.5933125", "text": "get _latlng() {\n console.log(\"calling WasabeePortal._latlng() compat\");\n return new L.LatLng(parseFloat(this.lat), parseFloat(this.lng));\n }", "title": "" }, { "docid": "340ea15724b60ab5fe974d90002a864b", "score": "0.593016", "text": "function get_location(){\n console.log('start_get_log');\n console.log(navigator.geolocation);\n navigator.geolocation.getCurrentPosition(\n function(position) {\n console.log('get_log');\n console.log(position);\n createPoint(position);\n },\n function(error) {alert(error.message);}\n );\n}", "title": "" }, { "docid": "5c97af438bfc666488b864583b7da683", "score": "0.59263295", "text": "function getLatLong() {\r\nvar geocoder = new GClientGeocoder();\r\nvar address = document.getElementById(\"address\");\r\n geocoder.getLatLng(\r\n address.value,\r\n function(point) {\r\n if (!point) {\r\n alert(address.value + \" not found\");\r\n } \r\n else {\r\n document.getElementById(\"latitude\").value=point.lat();\r\n document.getElementById(\"longitude\").value=point.lng();\r\n }\r\n }\r\n );\r\n}", "title": "" }, { "docid": "87e5503edf474beabd025a63f338f3bb", "score": "0.5924702", "text": "function geoToPoint(geoPoint) {\n return {\n x: geoPoint.longitude,\n y: geoPoint.latitude\n };\n}", "title": "" }, { "docid": "79488b0aeefda02eaa9a86d74ea99cbe", "score": "0.59144366", "text": "function getOpen()\n{\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(getMap,showError);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n}", "title": "" }, { "docid": "2a377bce1bf4c0b1e3a0c4aa0897b30a", "score": "0.59115", "text": "function getLocation() {\n\n var options = {\n enableHighAccuracy: true,\n maximumAge: 0\n };\n\n function success(pos) {\n var crd = pos.coords;\n\n console.log('Your current position is:');\n console.log(`Latitude : ${crd.latitude}`);\n console.log(`Longitude: ${crd.longitude}`);\n }\n\n function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }\n\n return new Promise(function (success, error) {\n navigator.geolocation.getCurrentPosition(success, error, options);\n });\n}", "title": "" }, { "docid": "98b2b10d735020d8367d5e9d5aba0545", "score": "0.5910147", "text": "function getCurrentLocation(){\n var xhr = new XMLHttpRequest();\n xhr.open('post', 'https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyBc_ZPpAaLuPC3My03ZuZ2NBWThEPPxOj8');\n xhr.onreadystatechange = function () {\n var DONE = 4; // readyState 4 means the request is done.\n var OK = 200; // status 200 is a successful return.\n if (xhr.readyState === DONE) {\n if (xhr.status === OK) {\n currentLoc = JSON.parse(xhr.response).location;\n // if (map){\n // map.panTo(currentLoc);\n // }\n } else {\n console.log('Error: ' + xhr.status);\n currentLoc = {lat: 32.050593605888004, lng: 34.766852259635925};\n }\n search();\n }\n };\n xhr.send(null);\n}", "title": "" }, { "docid": "4514faf91305d4489f04adc09fdc4d9a", "score": "0.5908521", "text": "function toGeoPoint(latitude, longitude) {\r\n var fakeGeoPoint = { latitude: latitude, longitude: longitude };\r\n validateLocation(fakeGeoPoint);\r\n return fakeGeoPoint;\r\n}", "title": "" }, { "docid": "c656be2721998903700c1e47cb08f514", "score": "0.59074813", "text": "function getLocation() {\n // Check if feature is present\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Browser doesn't support geolocation API.\")\n }\n}", "title": "" }, { "docid": "774ea98345a2105bce233303733afb57", "score": "0.5902914", "text": "function getLocation() {//Check for Geolocation and get it.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition,showError);\n\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "12c58f30fad48c3e6070b091129f0db1", "score": "0.590211", "text": "function p(e,o){if(t(e)&&t(o))return null;const i={};return u(o)&&(i.geometry=o.toJSON()),u(e)&&(i.where=e),i}", "title": "" } ]
0d712d4854ef3ad14b89665f0ff9f772
navigate to register screen
[ { "docid": "8317695f6b4942d2ba62c132ff7e4f9c", "score": "0.69895613", "text": "_onNewUserPress() {\n\t\tthis.props.navigation.navigate('Register');\n\t}", "title": "" } ]
[ { "docid": "1d64399c61f65fb93424cd4826f42c85", "score": "0.7973815", "text": "function handleRegister() {\n navigation.navigate('SignUp');\n }", "title": "" }, { "docid": "cebc855653e12cfc953c78149255c7f0", "score": "0.77600497", "text": "function openRegistrationPage() {\n $state.go('triangular.admin-default-no-scroll.registration');\n ToastService.showToast('Please create a account before play');\n }", "title": "" }, { "docid": "ed0ce77a2b47ad5a594146b49ac6dc58", "score": "0.7559847", "text": "navigateToRegistrationPage() {\n return this._navigate(this.buttons.registration, 'registrationPage.js');\n }", "title": "" }, { "docid": "cc8ffc518df956622a207a9ca21dafc1", "score": "0.7525227", "text": "async goToRegister() {\n try {\n this.props.history.push(\"/register\")\n } catch (error) {\n console.log('Error in goToRegister()', handleError(error));\n }\n }", "title": "" }, { "docid": "863b1cd5cbea4a768965151877ba5807", "score": "0.73310924", "text": "function goToRegisterHandler() {\n ProductList.beforeRegisterModal.hide();\n $timeout(function() {\n $state.go('main.productRegister.step1', {\n category: 'user',\n step: 1,\n method: 'create'\n });\n }, 100);\n }", "title": "" }, { "docid": "e7f881d07165138fdcb736e95dc9ec24", "score": "0.72957116", "text": "function showRegister() {\n clearErrorMsg();\n showLinks(['loginLink']);\n showView('registerForm');\n}", "title": "" }, { "docid": "5bbbb45371d784182f206f214d7e566b", "score": "0.7216488", "text": "function register() {\n Auth.register(authCtrl.user).then(function(){\n $state.go('home');\n });\n }", "title": "" }, { "docid": "a35cf97b9304bde9c994428fed7b29d5", "score": "0.71785384", "text": "register() {\n this.jquery(\"#register\").on(\"click\", function (event) {\n event.preventDefault();\n navigateTo(\"/sign\");\n });\n }", "title": "" }, { "docid": "713b943eb935f14f46a2fd22bd6df744", "score": "0.6982822", "text": "onRegister(e){\n wx.navigateTo({\n url: '../register/register'\n })\n }", "title": "" }, { "docid": "f78b89aea6f4a21147f24329eba66ce8", "score": "0.6973256", "text": "toSignUp() {\n this.navigation.navigate('SignUp', {});\n }", "title": "" }, { "docid": "e723b889d8eaa6944753ceb39c1f5d86", "score": "0.6905415", "text": "goRegister() {\n Store.changeProperties({\n \"login.name\": \"\", \"login.password\": \"\", \"login.errors\": {},\n \"register.name\": \"\", \"register.password\": \"\", \"register.confirm_password\": \"\", \"register.errors\": {},\n \"activeScreen\": Screens.REGISTER\n })\n }", "title": "" }, { "docid": "d74ba7d5f5937c64810e138774502cbb", "score": "0.6902484", "text": "onRegisterClicked(){\r\n //this.Nav.push(RegisterPage);\r\n }", "title": "" }, { "docid": "775f263d6b8285bd107876f7d81aaa06", "score": "0.67550236", "text": "switchToRegister() {\n document.getElementById(\"login-form-container\").classList.add('right-panel-active');\n this.clearFeedback();\n updatePageTitle(\"Lag konto\");\n }", "title": "" }, { "docid": "97315292ad37d22b84ad4efe59b3aa8e", "score": "0.67319983", "text": "function start_registration(){\r\n window.location.href = \"registration.html\"\r\n }", "title": "" }, { "docid": "ca6406cbb4a164a4e3434d5125a76f54", "score": "0.6723088", "text": "function displayRegister() {\n Reddcoin.messenger.getReddidStatus(function(data){\n Reddcoin.popup.updateRegister({action: 'open'});\n Reddcoin.popup.updateRegister({registration: data});\n });\n}", "title": "" }, { "docid": "09b14359b2bd8c43e67107eb6e5d7895", "score": "0.6713004", "text": "function showRegistrationScreenset() {\r\n gigya.accounts.showScreenSet({\r\n screenSet: 'default-Register'\r\n });\r\n}", "title": "" }, { "docid": "cc3d011ce89abdf4876ebdcf6ac5b47d", "score": "0.66983056", "text": "goToSignup(){\n this.props.navigator.push({\n component: Signup\n });\n }", "title": "" }, { "docid": "e53b61a5c5245efff7c35b8ae180da87", "score": "0.66954875", "text": "function newReg(){\n history.push('/register')\n }", "title": "" }, { "docid": "c75ff9c6c9c862ccad5ea2546ea45ad4", "score": "0.6670827", "text": "function RegisterNowButton(event) { // register button click, redirect to register template\n event.preventDefault()\n\n console.log(event.target.href)\n\n navigate(event.target.href)\n}", "title": "" }, { "docid": "a9bc4d768ae5e6bc8be4b90fb81018c3", "score": "0.6625606", "text": "function registerPage(){\r\n window.location=\"../login/register_ui.html\";\r\n}", "title": "" }, { "docid": "5ea6d6d9a3acc86ec15773d764bf2522", "score": "0.6601208", "text": "goToSignup(){\n this.props.navigator.push({\n component: Signup\n });\n }", "title": "" }, { "docid": "e1c8293a0ce297f84d759915376e7d4f", "score": "0.6600844", "text": "function handleRegistration() {\n registrationUser(name, email, password)\n .then(response => {\n if (response.status === 200) {\n history.push('/auth/login')\n } else {\n alert(response.statusText)\n }\n })\n }", "title": "" }, { "docid": "c4f0696a25d57c734bcb150fb38daccc", "score": "0.6569369", "text": "function register () {\n var features = \n \"height=440\"\t+ \",\" +\n \"location=no\"\t+ \",\" +\n \"menubar=no\"\t+ \",\" +\n \"status=no\"\t\t+ \",\" +\n \"toolbar=no\"\t+ \",\" +\n \"scrollbar=yes\"\t+ \",\" +\n \"width=600\";\n\n window.open (\n \"http://earth:8080/maps/bin/registerform.cgi?userid=Andrew;[email protected]\",\n \"register\",\n features);\n} // register", "title": "" }, { "docid": "a5a2247d5a02ada2452f0d8ca2a1beeb", "score": "0.6532148", "text": "function receiveRegister(data) {\n if (data.err) {\n showErrorMsg(data.err);\n } else {\n showLogin();\n }\n}", "title": "" }, { "docid": "4af90e1ee81c63ebe0ef397744bece86", "score": "0.64843935", "text": "function register()\n {\n validateRegisterInput();\n registerInfoToSite();\n\n\n \n \n }", "title": "" }, { "docid": "ce63c8286787fd4ddf107d97030650bd", "score": "0.64676607", "text": "handleBackToLogin() {\n this.props.displayRegister(false);\n }", "title": "" }, { "docid": "d9b084b900a9c3894933fe520b9d4bd6", "score": "0.6462436", "text": "switchToRegister(){\n this.setState({registerScreen:true})\n\n}", "title": "" }, { "docid": "6646911585427eba8144905eed8cae32", "score": "0.6452013", "text": "register() {\n this.props.clearMsg();\n this.props.history.push('/register');\n }", "title": "" }, { "docid": "2c02d32071580f1f234d5faf17666c6f", "score": "0.6426535", "text": "function load_register_page() {\n page = 'register';\n load_page();\n}", "title": "" }, { "docid": "14ef42b852a9463af76ff2b090f2b864", "score": "0.64141953", "text": "signUp() {\n browserHistory.push('registration');\n }", "title": "" }, { "docid": "48524349e33f3abee47b7607be1280ed", "score": "0.6413923", "text": "function register(){\n\tusername = document.getElementById('usernameRegister').value;\n\temail = document.getElementById('emailRegister').value;\n\tpassword = document.getElementById('passwordRegister').value;\n\n\tvar registrationData = {\n \t\tdisplayName: username,\n \t\temail : email,\n \t\tpassword: password\n\t};\n\n\tvar newUser = new Stamplay.User().Model;\n\tnewUser.signup(registrationData).then(function(){\n\t\tdocument.getElementById('usernameRegister').value = \"\";\n\t\tdocument.getElementById('emailRegister').value = \"\";\n\t\tdocument.getElementById('passwordRegister').value = \"\";\n\t\twindow.location = \"home.html\";\n\t});\n}", "title": "" }, { "docid": "4136c15d18b01ef30e3640cb1e60bd1e", "score": "0.63956654", "text": "handleGoToSignup() {\n this.props.navigator.replace({ \n title: 'Signup',\n component: Signup,\n leftButtonTitle: ' ',\n passProps: {\n start: this.props.navigator.navigationContext._currentRoute\n }\n })\n }", "title": "" }, { "docid": "3b8aceef636ee3c3d2ee9b431e2f0066", "score": "0.6393062", "text": "function register() {\n setLoading(true);\n fetch(\"https://password-reset-task3.herokuapp.com/users/signup\", {\n method: \"POST\",\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(v)\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(\"-----SUCCESSFULL REGISTRATION------\", data);\n\n if (data.newuser.name) {\n afterlogin(\"Registration success !!!\");\n history.push(\"/login\");\n e.target.reset();\n }\n })\n .catch((err) => {\n console.log(\"err in registration !!!\", err.message);\n\n afterlogin(\"Error in Registration\");\n });\n }", "title": "" }, { "docid": "cbe99ea680773f10429e4aba34a5bd56", "score": "0.63595486", "text": "function register(req, h){\n if(req.state.user){\n return h.redirect('/')\n }\n return h.view('register',{\n title: 'registro',\n user: req.state.user\n })\n}", "title": "" }, { "docid": "e8e41ce8053b2545373b9411bbe6029a", "score": "0.63581383", "text": "function nextScreen(navigation,id,name,desc){\r\n if(name==''){alert('Enter a valid name')}\r\n navigation.navigate('Create2',{id:id,name:name,desc:desc})\r\n}", "title": "" }, { "docid": "c00e0146332f6d6c8285ead599da4a07", "score": "0.63372856", "text": "function register(){\n\t\telement(by.id('accname')).sendKeys('testusername')\n\t\telement(by.id('emailaddr')).sendKeys('[email protected]')\n\t\telement(by.id('phonenum')).sendKeys('1234567890')\n\t\telement(by.id('birthday')).sendKeys('05282011')\n\t\telement(by.id('zip')).sendKeys('12345')\n\t\telement(by.id('pwd')).sendKeys('abcde')\n\t\telement(by.id('pwdConfirm')).sendKeys('abcde')\n\t\telement(by.id('registerBtn')).click()\n\t}", "title": "" }, { "docid": "30c302386eacc17d1b59c0f7a600eacf", "score": "0.6330527", "text": "function registreren(){\n\t window.location.href = \"registreren.html\";\n }", "title": "" }, { "docid": "b06295b90ca86c29f59049b26d81d8ba", "score": "0.6291497", "text": "function register() {\n User.register(self.user, handleLogin);\n }", "title": "" }, { "docid": "eddcf238296161bf7bd2cf6cb66d3adf", "score": "0.62879175", "text": "createAccount() {\n this.props.nav.navigate(\"Create Student User\");\n }", "title": "" }, { "docid": "30ce76ea11742b4b0058e1dfae1d35b2", "score": "0.62868935", "text": "navigateToSignupScreen(event, onSuccess, onFailure) {\n event.preventDefault();\n this.props.navigation.navigate(\"Signup\", this.state.formValues);\n onSuccess && onSuccess();\n }", "title": "" }, { "docid": "1e0fb0e06749694e09bd8abde8295a3a", "score": "0.6240109", "text": "function AddNewDetail() {\r\n navigation.navigate('DetailRegister', { edit: false, step: {} });\r\n }", "title": "" }, { "docid": "2d27a0d818df4150c601a0e9efbd0b21", "score": "0.62226635", "text": "function RegisterScreen(props) {\n const handleCancel = () => {\n props.history.push(\"/\");\n };\n\n return (\n <React.Fragment>\n <PageLayout\n header={\n <AppHeader\n actionTitle=\"Cancel\"\n isActionRequired={true}\n actionHandler={handleCancel}\n title=\"Consult Doctor Online\"\n />\n }\n content={<RegisterForm />}\n footer={<AppFooter />}\n />\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "06b19184a8f804a8a14a9170677f8d72", "score": "0.6219663", "text": "goToSignupPage() {\n Linking.openURL('https://signup.sbaustralia.com');\n //Actions.signup();\n }", "title": "" }, { "docid": "a0062457ecd9a8e752b248ecbceeb33f", "score": "0.6193522", "text": "async function registration() {\n try {\n const requestBody = JSON.stringify({\n name: name,\n username: username,\n password: password\n });\n\n const response = await api.post('/users', requestBody);\n\n // Get the returned user and update a new object.\n const user = new User(response.data);\n\n // Store the token into the sessionStorage.\n sessionStorage.setItem('token', user.token);\n sessionStorage.setItem('id', user.id);\n sessionStorage.setItem('intro', 'true');\n\n // Login successfully worked --> navigate to the route /game in the GameRouter\n history.push(`/home`);\n\n } catch (error) {\n alert(`Something went wrong during the registration: \\n${handleError(error)}`);\n }\n }", "title": "" }, { "docid": "2ea440384a15e5121cceb09bc52470d6", "score": "0.6186003", "text": "function registerPage() {\n\t\tsignPg.style.display = \"none\"\n\t\tregPg.style.display = \"block\";\n\t\tmyOutput.style.display = \"none\";\n\n\t\t//Create the captcha\n\t\tgenerateCaptcha();\n\t}", "title": "" }, { "docid": "a6a4f714234e8290057446adf0f7560b", "score": "0.6185133", "text": "function RegisterAccounts(){\n return(\n <Stack.Navigator>\n <Stack.Screen options={{headerShown: false}} name=\"LoggedOut\" component={LoggedOut} />\n <Stack.Screen options={{headerShown: false}} name=\"EmailRegister\" component={EmailRegister} />\n <Stack.Screen options={{headerShown: false}} name=\"PhoneRegister\" component={PhoneRegister} />\n </Stack.Navigator>\n )\n}", "title": "" }, { "docid": "f0ce9a9d58722ca4aac437416dcf80e1", "score": "0.6152449", "text": "async onRegisterPressed() {\n try {\n let response = await fetch('http://localhost:3000/users', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n user:{\n name: this.state.name,\n email: this.state.email,\n password: this.state.password,\n\n }\n })\n\n });\n let res = await response.text();\n if (response.status >= 200 && response.status < 300) {\n //if user is authenticated, go to profile\n const {navigate} = this.props.navigation;\n navigate('Profile', { user_id: JSON.parse(res).id, name: JSON.parse(res).name });\n } else {\n //if user is not authenticated, stay on login page\n let error = res;\n throw error;\n }\n } catch(errors) {\n\n }\n\n }", "title": "" }, { "docid": "092035f8f1c219bcc0076f6281aa1d14", "score": "0.60783476", "text": "onClick() {\n return <Redirect to=\"/register\" />\n }", "title": "" }, { "docid": "3381ad700034b18e74a7f98e8753b01c", "score": "0.60686857", "text": "function registerViewSubController() {\n if (appState.session.currentView !== 'register') {\n clearCurrentPage();\n executeFunctionAfterDOMContentLoaded(DOMelements.mainContent, registerNewUserController, apiData.infoMessages.unknown);\n \n mainView.renderRegistrationForm();\n appState.session.currentView = 'register'; \n }\n}", "title": "" }, { "docid": "181efb8e3caf95014ea68dd613182edf", "score": "0.6061242", "text": "function clickRegisterLink(e){\n $('#sign-in-form').addClass('hidden');\n $('#register-form').removeClass('hidden');\n $('#register-username').focus();\n e.preventDefault();\n}", "title": "" }, { "docid": "38ba60ef9745b499919f36d191c399ac", "score": "0.60500187", "text": "function register(){ // rencer the register screen, hide main\n document.getElementById(\"main\").style.display = \"none\";\n\tlet src = document.getElementById(\"registerTemplate\").innerHTML;\n\tlet template = Handlebars.compile(src);\n\tlet context = {}; // {{ N/A }}\n\tlet html = template(context);\n\trender(html);\n\tlet registerButton = document.getElementById(\"registerButton\");\n\tregisterButton.addEventListener(\"click\", (e) => {\n\t\te.preventDefault();\n\t\tregisterClick();\n\t});\n}", "title": "" }, { "docid": "24b7ff81a1085196823ce99de9d0baca", "score": "0.60474324", "text": "function RegisterAction() {\n if(username === \"\" || password === \"\" || firstName === \"\" || lastName === \"\" || \n username == null || password == null || firstName == null || lastName == null){\n setRegister(\"* fields are requerd!\");\n }else {\n fetch('/user/register', {\n method: 'POST',\n body: JSON.stringify({\n username: username,\n password: password,\n firstName: firstName,\n lastName: lastName\n }),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(response =>\n response.json()).then((data) => {\n if(data.register !== 0){\n setRegister(\"That username already exists!\");\n } else{\n setSuccess(\"Successfully registered!\");\n setTimeout(() => {\n switchToLogin();\n }, 500);\n }; \n });\n };\n }", "title": "" }, { "docid": "e00f2bdd82c1238414c1933bcb326caf", "score": "0.60378647", "text": "function registerNewUserController() {\n attachEventListener([DOMelements.mainContent], 'submit', [registerSubmitEvent]);\n appState.registeredClickEvents.registerForm = true;\n}", "title": "" }, { "docid": "ee0696443c7aa88d59e011a8760c252d", "score": "0.602596", "text": "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, '[email protected]');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggleAgreeToTermsAndConditions);\n I.click(this.signupLocators.signUpRegistration);\n }", "title": "" }, { "docid": "fc9cd93a259fda8c2d88b920b7fdbe2b", "score": "0.60250175", "text": "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "title": "" }, { "docid": "b748e6a4614bcab74d8d5a39c4a96bc2", "score": "0.60009795", "text": "async redirectToLoginScreen() {\n await removeMnemonicNotSaved();\n this.props.navigation.navigate('LoginScreen');\n }", "title": "" }, { "docid": "9028430b166cd6630d76eba5e6e481ba", "score": "0.59954005", "text": "function setRegisterButtonInit(event){\n\t\t\tjQuery('#registerLabel')\n\t\t\t\t.click(function(){\n\t\t\t\t\twindow\n\t\t\t\t\t\t.location\n\t\t\t\t\t\t.assign('http://goo.gl/forms/A6SJ9c2jx7');\n\t\t\t\t})\n\t\t}", "title": "" }, { "docid": "e46df4192286b7015b3be23d3cca6551", "score": "0.5960829", "text": "function in_register() {\n\t$('#register-submit').on(\"click\", function () {\n\t\tconsole.log(\"entra register click\");\n\t\tregister();\n\n\t})\n\n\n\t$('#form_register').on(\"keydown\", function (e) {\n\t\tconsole.log(\"clickpass\")\n\t\tif (e.which == 13) {\n\t\t\tconsole.log(\"entra register\");\n\n\t\t\tregister();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2ab8d9f9e440b63acb446ea7c264889c", "score": "0.59585583", "text": "function signUp() {\r\n var newLocation = \"#signUpPage\";\r\n window.location = newLocation;\r\n}", "title": "" }, { "docid": "a896d8df7fba1eadd0ccd5d86ee8f6a3", "score": "0.59567076", "text": "signUp() {\n\t\tipcRenderer.send('openSignUp', true);\n\t}", "title": "" }, { "docid": "ae3d53bb759f2e62cac6628ebda7fa52", "score": "0.592732", "text": "function goSignUp() {\n \n body.innerHTML = renderSignupDiv(first, \n last, email1, pass1, '', message1);\n assignListener('signup2');\n }", "title": "" }, { "docid": "798b494838a14297a704633f79685ba4", "score": "0.590141", "text": "function register() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n var pass2 = $(\"#confirmPasswordFld\").val();\r\n if (pass == pass2 && username.length > 0) {\r\n console.log(\"Registering \" + username + \":\" + pass);\r\n userService.register(username, pass).then(goToProfile,\r\n function(resp) {\r\n console.log(\"no login\" + resp);\r\n }\r\n )\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }", "title": "" }, { "docid": "70a8584e610857394202bb9adeab24e1", "score": "0.5896665", "text": "async gotoSignupPage(testController) {\n await this.ensureLogout(testController);\n await testController.click('#login-dropdown');\n await testController.click('#login-dropdown-sign-up');\n }", "title": "" }, { "docid": "a7895e2120ae722ddde30eefadd2b0a5", "score": "0.5895607", "text": "function renderRegister(req, res) {\n if (! auth.isAuthenticated(req)) {\n //Show the registration form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'register'\n });\n }\n else if (User.isGuest(req.user.username)) {\n //Show the 'conversion' form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'convert'\n });\n }\n else {\n //Redirect to 'next' URL (or base page).\n res.redirect(req.query.next || base_page);\n }\n}", "title": "" }, { "docid": "c519848d2720923496cd9bd6285cc98b", "score": "0.58948874", "text": "function setRegisterStart() {\n $('#kreator > div.kreator-section.rejestracja-container > div.buttonWrap > div.dalej.waves-effect.z-depth-2.rejestrujButton').fadeIn();\n registerGoStep(1);\n\n $('#register-form > div > section.step1 > input[name=\"lat\"]').val('');\n $('#register-form > div > section.step1 > input[name=\"lng\"]').val('');\n $('#register-form > div > section.step2 > div:nth-child(3) > input[type=\"text\"]').val('');\n $('#register-form > div > section.step2 > div:nth-child(4) > input[type=\"password\"]').val('');\n $('#register-form > div > section.step1 input[name=\"vicinity\"]').val('');\n $('#register-form > div > section.step2 > p.warning').html('');\n }", "title": "" }, { "docid": "b6bbe732e4781a5ce3d9259a2d06c304", "score": "0.5890033", "text": "handleSignupButton() {\n browserHistory.push('/signup');\n }", "title": "" }, { "docid": "f11916eb58dad4058b6e6cb2198c9ce8", "score": "0.5878687", "text": "async registration() {\n try {\n const requestBody = JSON.stringify({\n username: this.state.username,\n name: this.state.name,\n password: this.state.password\n });\n const response = await api.post('/users', requestBody);\n\n // Get the returned user and update a new object.\n new User(response.data);\n\n // Registration successfully worked --> navigate to the route /login in the AppRouter\n this.props.history.push(`/login`);\n } catch (error) {\n this.handleErrorDesigned(error);\n this.setState({hasNoErrorMessage: false});\n }\n }", "title": "" }, { "docid": "7375c145a028d4b65584fa3255b35166", "score": "0.58762276", "text": "function Register() {\n const [registerForm, setRegisterForm] = useState({\n name: '',\n email: '',\n password: '',\n });\n const dispatch = useDispatch();\n let history = useHistory();\n\n const onRegister = (e) => {\n e.preventDefault();\n dispatch(registerUser(registerForm));\n // Si se registro con exito, se envia a la pagina de Login para que ingrese.\n history.push('/login');\n };\n\n const onChangeRegister = (e) => {\n const { name, value } = e.target;\n setRegisterForm({ ...registerForm, [name]: value });\n };\n\n return (\n <Container className=\"mr-3 margin-top\">\n <h1 className=\"text-center mt-3 mb-3\">Register</h1>\n\n <Row className=\"mt-3 mb-3\">\n <Col></Col>\n <Col xs={6}>\n <Form onSubmit={(e) => onRegister(e)}>\n <Form.Group className=\"mb-2\" controlId=\"formBasicName\">\n <Form.Control\n type=\"name\"\n name=\"name\"\n placeholder=\"Enter your Name\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Form.Group className=\"mb-2\" controlId=\"formBasicEmail\">\n <Form.Control\n type=\"email\"\n name=\"email\"\n placeholder=\"Enter email\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Form.Group className=\"mb-1\" controlId=\"formBasicPassword\">\n <Form.Control\n type=\"password\"\n name=\"password\"\n placeholder=\"Password\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Button variant=\"primary\" type=\"submit\" className=\"mt-3 mb-3\">\n Create Account\n </Button>\n <p className=\"mt-1 mb-3\">\n If you already have an account\n <Link to={`/login`}> CLICK HERE </Link> to access your account.\n </p>\n </Form>\n </Col>\n <Col></Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "9e00e61152c43a8be4faa1b91a36b4c7", "score": "0.58753973", "text": "function setupRegisterForm()\n{\n $(\"#go\").addEventListener(\"click\", sendRegistration);\n\n let inputs = $(\"input, select\");\n for (let i = 0; i < inputs.length; i++)\n {\n inputs[i].addEventListener(\"keyup\", function(e)\n {\n if (e.keyCode === KEY.ENTER && !e.shiftKey && !e.ctrlKey && !e.altKey)\n {\n $(\"#go\").click();\n }\n });\n }\n\n let user = $$(\"input[name='username']\");\n let pass = $$(\"input[name='password']\");\n let conf = $$(\"input[name='confirm']\");\n\n user.addEventListener(\"focusout\", focusOutEvent);\n pass.addEventListener(\"focusout\", focusOutEvent);\n conf.addEventListener(\"focusout\", focusOutEvent);\n $$(\"input[type='button']\").addEventListener(\"focusout\", focusOutEvent);\n\n user.addEventListener(\"focus\", focusInEvent);\n pass.addEventListener(\"focus\", focusInEvent);\n conf.addEventListener(\"focus\", focusInEvent);\n $$(\"input[type='button']\").addEventListener(\"focus\", focusInEvent);\n\n user.addEventListener(\"keyup\", userKeyup);\n pass.addEventListener(\"keyup\", keyDownEvent);\n conf.addEventListener(\"keyup\", keyDownEvent);\n\n user.focus();\n}", "title": "" }, { "docid": "a92f6399894f55b6f32ed7a731f87431", "score": "0.5868649", "text": "function handleLogin() {\r\n if ((!assetEmpty(email) && !assetEmpty(password))\r\n && assertEquals(email, registeredState.email)\r\n && assertEquals(password, registeredState.password)\r\n ) {\r\n setPassword('');\r\n global.nameLogin = registeredState.name;\r\n navigation.replace('BottomStack');\r\n } else {\r\n Alert.alert(\r\n 'Não foi possível entrar:',\r\n 'E-mail/senha incorretos!'\r\n );\r\n }\r\n }", "title": "" }, { "docid": "133e6ac9eadf2b7a388d45946810c19d", "score": "0.5855537", "text": "onRegisterPress() {\n const {\n name,\n age,\n address,\n birthday,\n mothersName,\n fathersName,\n guardiansName,\n email,\n password\n } = this.props;\n this.props.saveUserDetails({\n name,\n age,\n address,\n birthday,\n mothersName,\n fathersName,\n guardiansName,\n email,\n password\n });\n }", "title": "" }, { "docid": "c1833dededc92614904741c589e04ec9", "score": "0.583601", "text": "function register(event) {\n event.preventDefault();\n\n userCredentials = {\n username: $name.val().trim(),\n email: $email.val().trim(),\n password: $password.val().trim()\n };\n\n console.log(\"register button clicked!\", userCredentials);\n window.location.href = \"/instruction\";\n if (\n userCredentials.username === \"\" ||\n userCredentials.email === \"\" ||\n userCredentials.password === \"\"\n ) {\n alert(\"Must provide name, email, and password\");\n } else {\n credentials(userCredentials);\n return true;\n }\n}", "title": "" }, { "docid": "ac02e16e0ca9658eb32c7783f90b1aa8", "score": "0.58356243", "text": "function showPassword() {\n register((data, err)=>{\n if(data === -1) {\n showErr(err);\n }\n else {\n data = JSON.parse(data);\n userId = data.userId;\n attempt = 3;\n listenNextButton();\n $(\"#password1\").text(data.password_1);\n $(\"#password2\").text(data.password_2);\n $(\"#password3\").text(data.password_3);\n $(\"#ui_2\").fadeIn();\n }\n });\n}", "title": "" }, { "docid": "526cb0dc0d46e5a8f4666fd70327a245", "score": "0.58238846", "text": "function regresar(){\n window.location.href = \"/home\";\n}", "title": "" }, { "docid": "526cb0dc0d46e5a8f4666fd70327a245", "score": "0.58238846", "text": "function regresar(){\n window.location.href = \"/home\";\n}", "title": "" }, { "docid": "097f3abf484f77747dd52928bc8bb283", "score": "0.58187413", "text": "render() {\n\t\treturn this.renderRegisterPage();\n\t}", "title": "" }, { "docid": "4534ccbdeb4587abad0dad6e4e723c7f", "score": "0.580436", "text": "register(request, response) {\n\t\tresponse.render('auth/register');\n\t}", "title": "" }, { "docid": "5d88a0eb6b0de27a978d43c7b6c71eba", "score": "0.57960725", "text": "function TakeRegisterAction(e) {\n\n var enterkeyPressed = IsEnterKeyPressed(e);\n\n if (enterkeyPressed) {\n\n if (window.event) {\n event.returnValue = false;\n event.cancel = true;\n }\n else {\n e.returnValue = false;\n e.cancel = true;\n }\n\n var actionButton = GetActionButton(\"registerButton\");\n\n if (actionButton != null) {\n actionButton.click();\n }\n }\n}", "title": "" }, { "docid": "c5d06a3f199c32e590a086bdfd9ee55d", "score": "0.57919294", "text": "async handleRegistration(event) {\n try {\n\n //prevent actual submit and page refresh\n event.preventDefault();\n\n const userRepository = new UserRepository();\n\n const firstName = $(this).find(\"[name='register-firstname']\").val();\n const lastName = $(this).find(\"[name='register-lastname']\").val();\n const username = $(this).find(\"[name='register-username']\").val();\n const password = $(this).find(\"[name='register-password']\").val();\n const passwordRepeat = $(this).find(\"[name='register-passwordrepeat']\").val();\n\n if (!firstName || !lastName || !username || !password) {\n notificationManager.alert(\"warning\", \"Vul alle velden in!\");\n return false;\n }\n\n if (password.length < 6) {\n notificationManager.alert(\"warning\", \"Wachtwoord is te kort!\");\n return false;\n }\n\n if (password != passwordRepeat) {\n notificationManager.alert(\"warning\", \"Wachtwoorden komen niet overeen!\");\n return false;\n }\n\n const user = await userRepository.register(firstName.toLowerCase(), lastName.toLowerCase(), username.toLowerCase(), password);\n\n notificationManager.alert(\"success\", \"U bent geregistreerd!\");\n sessionManager.set(\"userID\", user.userID);\n location.reload();\n } catch (e) {\n (e.code === 401) ? notificationManager.alert(\"error\", e.reason) : console.log(e);\n }\n }", "title": "" }, { "docid": "685026e49556b1f9b223d5a9d25685a6", "score": "0.5782157", "text": "function loginAfterRegister()\n {\n UserService.login($scope.user)\n .then(function(response) {\n if (response.status === 200) {\n //Should return a token\n $window.localStorage[\"userID\"] = response.data.userId;\n $window.localStorage['token'] = response.data.id;\n $ionicHistory.nextViewOptions({\n historyRoot: true,\n disableBack: true\n });\n $state.go('lobby');\n } else {\n // invalid response\n $state.go('landing');\n }\n resetFields();\n }, function(response) {\n // something went wrong\n $state.go('landing');\n resetFields();\n });\n }", "title": "" }, { "docid": "90f140df74032a9a1eb84d70d8d0689c", "score": "0.57817554", "text": "register() {\n let self = this;\n if (self.registerForm.$invalid) {\n return;\n }\n self.loader.show();\n let copy = angular.copy(self.userRegister);\n self.defaultValues();\n self.UserService.register(copy).then(\n // Success\n ()=> {\n self.loader.hide();\n self.$state.go('center');\n }).catch(\n // Errors\n (err)=> {\n self.loader.hide();\n self.$l.debug(\"Err\", err);\n let msg;\n switch (err.status) {\n case 400:\n msg = err.data.message;\n break;\n case 500:\n msg = 'Błąd serwera';\n break;\n default:\n msg = 'Nieznany błąd serwera';\n break;\n }\n notie.alert(3, msg, 3);\n });\n }", "title": "" }, { "docid": "e1f5c854273921bb2fe926e7658f1fca", "score": "0.5776708", "text": "BlockedAccounts() {\r\n this.props.navigation.navigate('BlockedAccounts');\r\n }", "title": "" }, { "docid": "f5664f7c356991e9451bedf807c4db3b", "score": "0.57755464", "text": "register(event) { // handle register request\n\t\tAxios.post('http://localhost:8081/register', { username: this.state.username, password: this.state.password }).then(\n\t\t\tres => {\n\t\t\t\tif (res.data.status === 'success') {\n\t\t\t\t\tstore.set('loggedIn', true); // on success, set this value to true, redirect to other pages\n\t\t\t\t\tconsole.log(\"Register Success!\");\n\t\t\t\t\tthis.setState({ isLoggedIn: true }); // this order is important, make sure setState is the last thing, or\n\t\t\t\t} else if (res.data.status === 'fail') { // it will not redirect !\n\t\t\t\t\talert(\"User Already Exist!\");\n\t\t\t\t}\n\t\t\t}, err => {\n\t\t\t\tconsole.log(\"Add User Error: \", err);\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "801c1fb3ca1ae37c8623301320c7d009", "score": "0.57732815", "text": "function showSignupPage(){\n showPagesHelper(\"#signUpPage\");\n}", "title": "" }, { "docid": "7ba82519a6b573c86f18b6ad1ad42af6", "score": "0.5765334", "text": "function register() {\n var model = vm.model;\n usSpinnerService.spin('spinner-1');\n\n if (model.password !== model.confirmPassword) {\n toaster.pop({\n type: 'error',\n title: 'Register',\n body: 'Passwords do not match',\n showCloseButton: true,\n onHideCallback: function () {\n usSpinnerService.stop('spinner-1');\n }\n });\n\n model.password = '';\n model.confirmPassword = '';\n return;\n }\n\n var addUserRequest = {\n pwd: vm.model.password,\n cpwd: vm.model.confirmPassword,\n alias: vm.model.username,\n firstName: vm.model.firstName,\n lastName: vm.model.lastName,\n email: vm.model.email,\n phone: vm.model.phoneNumber\n }\n\n registerFactory.registerNewUser(addUserRequest).then(\n function (registerNewUserResponse) {\n //success\n var data = registerNewUserResponse.data;\n vm.userId = data;\n\n var customer = {\n FirstName: vm.model.firstName,\n LastName: vm.model.lastName,\n PhoneNumber: vm.model.phoneNumber,\n // alias: vm.alias,\n EmailAddress: vm.model.email,\n CustomerDuplicateCheckIndicator: 0,\n SendEmailReceipts: model.sendEmailReceipts\n }\n\n customerFactory.createCustomer(customer).then(\n function (createCustomerResponse) {\n //success\n vm.customerId = createCustomerResponse.data;\n customerAccount.customerId = vm.customerId;\n\n var accountModel= {\n merchantId: vm.merchantId,\n customerId: createCustomerResponse.data.customerId,\n accountNumber: vm.model.accountNumber\n }\n\n registerFactory.createMerchantCustomerXref(accountModel).then(\n function (createMerchantCustomerXrefResponse) {\n //success\n\n registerFactory.updatecustomerAccount(customerAccount).then(\n function (updatecustomerAccountResponse) {\n //success\n $location.path('login');\n },\n function (updatecustomerAccountResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'updatecustomerAccount',\n body: updatecustomerAccountResponse.data,\n showCloseButton: true\n });\n });\n },\n function (createMerchantCustomerXrefResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'createMerchantCustomerXref',\n body: createMerchantCustomerXrefResponse.data,\n showCloseButton: true\n });\n });\n },\n function (createCustomerResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'createCustomer',\n body: createCustomerResponse.data,\n showCloseButton: true\n });\n });\n },\n function (registerNewUserResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'registerNewUser',\n body: registerNewUserResponse.data,\n showCloseButton: true\n });\n });\n }", "title": "" }, { "docid": "69008d312d5cc6e3f9ac6cefa24acb79", "score": "0.5764844", "text": "function add_success() {\n window.location.href = \"/registration_part2/\"\n }", "title": "" }, { "docid": "ac2a94f2d8eb7b243a2b3cbc2a3418f3", "score": "0.5759659", "text": "function returnloginScreen() {\r\n alert(\"New user has been added!\");\r\n var newLocation = \"#pageHome\";\r\n window.location = newLocation;\r\n}", "title": "" }, { "docid": "4965ed26739b617e92f18b2d2513880c", "score": "0.57474524", "text": "function initRegistration(args, stateMachine){\n\n console.log(\"Initializing UX registration\");\n let uxBus = args[0];\n\n //Routing all the event through the state machine\n uxBus.on(Common.UXMessage.REGISTER_SUCCESS, stateMachine.handle.registrationSuccess)\n uxBus.on(Common.UXMessage.REGISTER_ERROR, stateMachine.handle.registrationError);\n uxBus.on(Common.UXMessage.REGISTER_PROGRESS, (subscriptionId)=>{\n domUtil.$(\"#register-vault-btn\").setAttribute(\"disabled\", true)\n stateMachine.handle.start()\n\n })\n let registrationBlock = UI.bakeRegistrationBlock(()=>{\n let password = domUtil.$(\"#new-passwd\");\n let confirm = domUtil.$(\"#confirm-passwd\");\n uxBus.emit(Common.UXMessage.REGISTER_CLICK, {password: password, confirm: confirm})\n })\n\n\n domUtil.appendChildren(\"#main-container\", registrationBlock)\n}", "title": "" }, { "docid": "564261c4aa9068c6e91a598abe03e1c2", "score": "0.5744132", "text": "MutedAccounts() {\r\n this.props.navigation.navigate('MutedAccounts');\r\n }", "title": "" }, { "docid": "b673cc18dfe3ea4bd2ab452ddf5e870d", "score": "0.5741517", "text": "function Register(event) {\n event.preventDefault();\n CollapseElements(error_message);\n\n const agreed_to_terms = sign_form[4].checked;\n console.log(\"Agreed to terms: \" + agreed_to_terms);\n\n if (!agreed_to_terms) {\n ShowFormError(\"You have to agree with Terms of Use.\");\n return;\n }\n\n const email = sign_form[2].value;\n if (!email) {\n ShowFormError(\"Email is empty.\");\n return;\n }\n const user = JSON.parse(localStorage.getItem(email));\n console.log(\"user read : \" + user);\n\n if (user) {\n ShowFormError(\"The user with this email already exists\");\n } else {\n const name = sign_form[0].value;\n const surname = sign_form[1].value;\n const password = sign_form[3].value;\n\n if (\n !CheckIfStringsNotEmpty(\n [\"Name\", \"Surname\", \"Password\"],\n name,\n surname,\n password\n )\n )\n return;\n\n user_data = {\n email: email,\n name: name,\n surname: surname,\n password: HashText(password),\n lists: [],\n };\n\n console.log(\"Hashed password to \" + HashText(password));\n\n try {\n localStorage.setItem(email, JSON.stringify(user_data));\n console.log(\"Registered: \" + email);\n current_user_data = user_data;\n console.log(JSON.stringify(current_user_data));\n SetClassVisible(\"loggedIn\", true);\n SetClassVisible(\"loggedOut\", false);\n ShowDashboard();\n } catch (error) {\n ShowFormError(\"Error while signing up.\");\n console.log(\"Error while signing up: \" + error);\n }\n }\n}", "title": "" }, { "docid": "c7fea5498ccca79b5e77128a1ed19d3b", "score": "0.57399154", "text": "function activateSignup() {\n activateNewAccount(true)\n\n }", "title": "" }, { "docid": "4e1418ef5f57c8684fd63ea99a920be8", "score": "0.5738959", "text": "function getFormRegister(request,response) {\n response.render('pages/login/signUp')\n}", "title": "" }, { "docid": "574196d2733cbca667adf909d1a56fb5", "score": "0.5737924", "text": "function showRegister(req, res){\n \n var userstat_si_so=\"<a class=\\\"index\\\" id=\\\"signin\\\" href=\\\"/login\\\">התחבר</a>\";\n var userstat_su_un=\"<a class=\\\"index\\\" id=\\\"signup\\\" href=\\\"/register\\\">הרשם</a>\"+\" | \";\n \n //check if the user is conected\n if (req.isAuthenticated()){\n userstat_su_un = \" שלום \"+req.user.local.username+\" | \";\n userstat_si_so = \"<a class=\\\"index\\\" id=\\\"signout\\\" href=\\\"/logout\\\">התנתק</a>\";\n \n res.render('pages/register', {message: req.flash('signupMessage'),userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so});\n// ,'errors: req.flash('errors')});\n // res.render('pages/register', {userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so,\n // errors: req.flash('errors'),message: req.flash('signupMessage')});\n }\n \n // return a view with data in case user didn't connect\n else{\n \n res.render('pages/register', {message: req.flash('signupMessage'), userstat_su_un: userstat_su_un ,userstat_si_so:userstat_si_so });\n// ,errors: req.flash('errors') });\n }\n//\tres.render('pages/register', {\n// \t\terrors: req.flash('errors')\n// \t});\n}", "title": "" }, { "docid": "afd0ef913d8b867c0692043d470b50ef", "score": "0.5732116", "text": "function registerUser() {\n addUser()\n }", "title": "" }, { "docid": "bc97c995b830360d52e1d7bd3ca76491", "score": "0.5718069", "text": "register() {\n if(this.state.usernameAvailable && this.state.username.length > 0\n && this.state.password.length > 0 && this.state.confirmPassword === this.state.password &&\n this.state.firstName.length > 0 && this.state.lastName.length >0 &&\n this.state.dateOfBirth.length > 0){\n const credentials = {\n username: this.state.username,\n password: this.state.password,\n firstName: this.state.firstName,\n lastName: this.state.lastName,\n role: this.state.role,\n dateOfBirth: this.state.dateOfBirth,\n collegeLists: []\n };\n\n this.userService.register(credentials).then(user => {\n\n\n // Redirect back to home\n if (user) {\n window.location = '/';\n }\n });\n\n\n\n }\n\n else{\n alert('One more fields is incorrect!');\n }\n }", "title": "" }, { "docid": "febb8fd319cadd312567d802aa3c53fe", "score": "0.5710158", "text": "function clickSignUp() {\n\tvar email = ($('.email-signup').find('input[type=email]')).val();\n\tvar password = (($('.email-signup').find('input[type=password]')).eq(0)).val();\n\tvar confirm = (($('.email-signup').find('input[type=password]')).eq(1)).val();\n\t\n\tif (password == confirm) {\n\t\t$.ajax({\n\t\t\turl: '\\/register',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {email, password}\n\t\t}).done(function(jsondata) {\n\t\t\twindow.location.href = '/EditProfileHTML';\n\t\t}).fail(function (){\n\t\t\talert(\"Creation Error\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "827adaf5aee78e9ec2afc2b5bee26396", "score": "0.5705576", "text": "async function register(event) {\n event.preventDefault();\n const formData = new FormData(event.target);\n const data = Object.fromEntries(formData);\n const jsonData = JSON.stringify(data);\n const response = await createAccount(jsonData);\n \n updateState('account', response);\n navigate('/dashboard');\n}", "title": "" }, { "docid": "77164ed08abc2f10351795b4f6694037", "score": "0.56999916", "text": "function showLogin() {\n clearErrorMsg();\n showView('loginForm');\n showLinks(['registerLink']);\n}", "title": "" }, { "docid": "d79982d085c0e0541faadc91877ff998", "score": "0.569723", "text": "function register(){\n\t$.get(\"RegisterServlet\", {\n\t\tuserName : $('#email').val(),\n\t\tpassword : $('#password').val()\n\t},function(){\n\t\twindow.location.replace(\"login.html\");\n\t});\n}", "title": "" }, { "docid": "89c301c3a4d33cb56e89a409c1c1b0df", "score": "0.56960577", "text": "requirePassword() {\n this.navigateTo('walletResetRequirePassword');\n }", "title": "" } ]
e0712ece2dbe3f6ed3cc9668b4b58a4c
Clean up the dom of this component
[ { "docid": "da737493d47fe4e0e26926a2fc5c034b", "score": "0.0", "text": "ngOnDestroy() {\n super.ngOnDestroy();\n }", "title": "" } ]
[ { "docid": "707737b9f67fcdf0530514895f7c1609", "score": "0.8358208", "text": "_clean() {\n for (let i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "d6a778d8c953229f298a515cb9e2a167", "score": "0.7918415", "text": "cleanDOM() {\n\t\tparentElement.removeChild( this.node );\n\t}", "title": "" }, { "docid": "33223b69822468aaf2d9cdd4bea3b735", "score": "0.7774633", "text": "removeFromDOM() {\n let parent = this.container.parentNode;\n parent.removeChild(this.container);\n }", "title": "" }, { "docid": "2aafa1a142247c29406417b2f309e092", "score": "0.7662342", "text": "destroy(){\n if(this._container !== null){\n this._container.innerHTML = '';\n\n this._container = null;\n this._context = null; \n }\n\n }", "title": "" }, { "docid": "c40472d770d1cbb537c8fac1c4bec70c", "score": "0.7589782", "text": "destroy() {\n document.body.removeChild(this.element);\n }", "title": "" }, { "docid": "f41a17f2a0a90209c76dfc34f8e866fd", "score": "0.75633353", "text": "destroy() {\n this.$el.empty();\n this.$el = null;\n }", "title": "" }, { "docid": "6424a379aa6008e027f48e247c65452e", "score": "0.7548592", "text": "$$destroy() {\n super.$$destroy();\n\n this.$_tagName = '';\n this.$_children.length = 0;\n this.$_nodeType = Node.ELEMENT_NODE;\n this.$_unary = null;\n this.$_notTriggerUpdate = false;\n this.$_dataset = null;\n this.$_classList = null;\n this.$_style = null;\n this.$_attrs = null;\n }", "title": "" }, { "docid": "e067af7007d81575671bc5a354f30104", "score": "0.7545075", "text": "destroy() {\n this.el.remove();\n }", "title": "" }, { "docid": "051ae3af7c3b4807acdf70ea0d157702", "score": "0.7499869", "text": "function cleanDOM() {\r\n clearChildren('yt-container')\r\n clearChildren('side-panel')\r\n clearChildren('results-panel')\r\n clearChildren('comment-input-container')\r\n clearChildren('comment-threads')\r\n clearChildren('card-deck-wrapper')\r\n ytBuilder()\r\n\r\n const results = document.getElementById('results-panel')\r\n results.classList.remove('hidden')\r\n const hideComments = document.getElementById('comments-container')\r\n hideComments.classList.add('hidden')\r\n const wrapper = document.getElementById('card-deck-wrapper')\r\n wrapper.classList.add('hidden')\r\n const player = document.getElementById('yt-container')\r\n player.classList.add('hidden')\r\n}", "title": "" }, { "docid": "be30ef972a66757c14bf6d4692b641f6", "score": "0.7427989", "text": "destroy() {\r\n\t\tthis.element.remove();\r\n\t}", "title": "" }, { "docid": "1dc0217323d1e938887ce28f76859f19", "score": "0.7411345", "text": "destroy() {\n\t\tthis.element.remove();\n\t}", "title": "" }, { "docid": "813a836f4116ef9097db330d971e2949", "score": "0.7404352", "text": "destroy() {\n this.domElement().outerHTML = \"\";\n SketchPad.removeElement(this.id);\n }", "title": "" }, { "docid": "02de60bdb5a35a3a6b9892bf3955b459", "score": "0.7369361", "text": "destroy() {\n this.logInfo(\"destroy()...\");\n this.clear();\n this.resizeObserver.disconnect();\n this.element.innerHTML = \"\";\n // Remove all event handlers\n this.element.outerHTML = this.element.outerHTML;\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.7323393", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "054e88d072eeb448c0ba509345d9563c", "score": "0.7315009", "text": "destroy() {\n\t\tif (this.destroyed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.destroyed = true;\n\t\tthis.enabled = false;\n\t\tthis.registry.destroy(this);\n\t\tlet types = this.components.types;\n\t\tfor (let type of types) {\n\t\t\tthis.components[type].destroy();\n\t\t}\n\t\tlet child = this.firstChild;\n\t\twhile (child) {\n\t\t\tchild.destroy();\n\t\t\tchild = child.next;\n\t\t}\n\t}", "title": "" }, { "docid": "9ddc4584c66811780eb4ba08f17f9bff", "score": "0.73139757", "text": "detachHtml() {\n this.Dom.detachContents(this.el, this.$el);\n }", "title": "" }, { "docid": "8e2d457d46b9db4e4b2b76d492d7e83b", "score": "0.72962666", "text": "destroy () {\n\t\tconst node = this.node;\n\t\t\n\t\t// unset node\n\t\tmap.delete(node);\n\t\tthis.node = null;\n\t\t\n\t\t// set rendered attr, fire renderedChange event\n\t\tthis._set('rendered', false, true);\n\t\t\n\t\t// clean up DOM\n\t\tif (node) {\n\t\t\tif (node.parentNode) {\t\t// node may not have been appended to DOM: widget.render(document.createElement('div')))\n\t\t\t\tnode.parentNode.removeChild(node);\n\t\t\t}\n\t\t\t\n\t\t\t// clear event listeners and subscriptions\n\t\t\tfor (let {eventType, cb} of this._nodeListeners) {\n\t\t\t\tnode.removeEventListener(eventType, cb);\n\t\t\t}\n\t\t\tthis._nodeListeners = [];\n\t\t}\n\t\t\n\t\t// unsub\n\t\tfor (let sub of this._subscriptions) {\n\t\t\tsub.unsubscribe();\n\t\t}\n\t\tthis._subscriptions = [];\n\t}", "title": "" }, { "docid": "ad0accead66db87be7cd60868d9a7590", "score": "0.72744584", "text": "destroy() {\n this.html.querySelector('.site-container').removeChild(this.element);\n }", "title": "" }, { "docid": "41b13bb76b05b7a8d30d798acfe1dc69", "score": "0.72216874", "text": "destructor() {\n this.removeChildren();\n delete doc.componentRegistry[this._id]\n\n this.getDOMObject(this.htmlId).remove();\n delete this;\n }", "title": "" }, { "docid": "8b2cfb49f939498b64a1fe919fdbd1a5", "score": "0.7218359", "text": "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "title": "" }, { "docid": "d67822e34e3f80094d70bc77b0b88856", "score": "0.7197559", "text": "function _visualClear(){\n _els.each(function (i, el){\n jQuery(el)\n .children()\n .filter('[data-repository-item]')\n .remove();\n\n _components[i] = [];\n });\n }", "title": "" }, { "docid": "932b0ab6157b04c9ea929e7a635981e5", "score": "0.7171024", "text": "function cleanUp() {\n viewportElement.parentNode.removeChild(viewportElement);\n viewportElement = null;\n\n containerElem.style.position = '';\n\n for (let i = 0; i < instrumentViews.length; i++) {\n instrumentViews[i].cleanUp();\n }\n\n PIXI.glContexts.length = 0;\n PIXI.instances.length = 0;\n }", "title": "" }, { "docid": "53c21aa12ecf97bf17940e29bd4109e1", "score": "0.7169139", "text": "clear() {\n this._el.innerHTML = '';\n }", "title": "" }, { "docid": "e92efb715bb6e9ec4da3d47b28edf1ea", "score": "0.71573937", "text": "destroy() {\n\t\t\n\t\tthis.container.removeChild(this.icon);\n\t\tthis.icon = null;\n\t\t\n\t\tthis.container.removeChild(this.label);\n\t\tthis.label = null;\n\t\t\n\t\tthis.container.parentNode.removeChild(this.container);\n\t\tthis.container = null;\n\t}", "title": "" }, { "docid": "04f80c9013b9139f8eb24c917d21bb8e", "score": "0.71327364", "text": "destroyAndRemove() {\n this.destroy();\n\n // Remove element\n const root = this._root.root;\n root.parentElement.removeChild(root);\n\n // remove .pcr-app\n const app = this._root.app;\n app.parentElement.removeChild(app);\n\n // There are references to various DOM elements stored in the pickr instance\n // This cleans all of them to avoid detached DOMs\n const pickr = this;\n Object.keys(pickr).forEach(key => pickr[key] = null);\n }", "title": "" }, { "docid": "389978116a578edabc627983cbb2bf65", "score": "0.71248853", "text": "__destroy () {\n this.__stateWatcher()\n this.__resizeWatcher = false\n this.terminate()\n try {\n this.element.remove()\n } catch ( e ) {}\n delete this.parent.moduxComponent\n }", "title": "" }, { "docid": "653faab0738cde08ef8e238fcdf86d30", "score": "0.7117649", "text": "destroyChildren () {\n\n if (this._container) {\n this._container.innerHtml = '';\n\n }\n if (this.children.size === 0) return;\n\n this.children.forEach(this.removeChildView, this);\n this.children.clear();\n\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.71058106", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "b59ca15d64c4bb899d038ffca22aba3e", "score": "0.7073912", "text": "dispose() {\r\n if (this.element.parentElement !== null) {\r\n this.element.parentElement.removeChild(this.element);\r\n }\r\n }", "title": "" }, { "docid": "91d4e02672212078a84d8ecd9852cf88", "score": "0.7061052", "text": "destroy() {\n // We wrap this next part in try...catch in case the element is already gone for some reason\n try {\n // Remove the node\n this.container.removeChild(this.wrapper);\n // Delete worker instance\n delete this.container.iwideo.worker;\n // Delete the instance\n delete this.container.iwideo;\n } catch (e) {\n // Nothing to do when error is invoked\n }\n }", "title": "" }, { "docid": "4b027b52a4659d89d87b68055189d705", "score": "0.70379037", "text": "detach() {\n // First iterate through each ref and delete the component so there are no dangling component references.\n _.each(this.refs, (ref) => {\n if (typeof ref === NodeList) {\n ref.forEach((elem) => {\n delete elem.component;\n });\n }\n else if (ref) {\n delete ref.component;\n }\n });\n this.refs = {};\n this.removeEventListeners();\n this.detachLogic();\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n }", "title": "" }, { "docid": "37635072df72cebeef6ca59268fbb394", "score": "0.70373577", "text": "_cleanupList() {\n this._emptyTargetDiv();\n delete this.elemDivs;\n delete this.targetDiv;\n }", "title": "" }, { "docid": "b96255d5d77954c8b5572506855146bd", "score": "0.70274955", "text": "destroy() {\n destroyExtraLabels(this, 'destroyElements');\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.70123935", "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": "cfa309d0458c5cc45ba98548323d4e22", "score": "0.7009848", "text": "_destroy() {\n var self = this;\n Object.keys(this.elements).forEach(function (element) {\n self.elements[element].remove();\n });\n }", "title": "" }, { "docid": "17bc95977d8f85ddde6717e6043cc631", "score": "0.7000821", "text": "destroy () {\n this.element.remove()\n }", "title": "" }, { "docid": "06b7a9776745365e1b8d03d72430b972", "score": "0.6999427", "text": "destroy() {\n this.element.remove();\n this.toDispose.forEach((d) => d.dispose());\n }", "title": "" }, { "docid": "fc205df49006c5b92aaf0eedd3364a48", "score": "0.699878", "text": "destroy() {\n nodes.splice(nodes.indexOf(el), 1);\n }", "title": "" }, { "docid": "25f176d281a7d833df1d99b105f74df2", "score": "0.6997767", "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": "45c1e13fd7211cc572ed63c21fa04746", "score": "0.6989609", "text": "function destroy () {\n // Remove event listeners\n \n // Only do these, if we could have moved the element nodes\n if (usedOptions.moveable) {\n document.body.removeEventListener(\"dragstart\", dragStart);\n document.body.removeEventListener(\"dragend\", dragEnd);\n document.body.removeEventListener('dragover', dragOver);\n document.body.removeEventListener('dragenter', dragEnter);\n document.body.removeEventListener('dragleave', dragLeave);\n document.body.removeEventListener('drop', dragDrop);\n }\n \n // Only do these, if the controls was shown on hover, not click\n if (usedOptions.showControlsOnHover) {\n document.body.removeEventListener(\"mouseover\", docMousedOver);\n document.body.removeEventListener(\"mouseout\", docMousedOut);\n }\n \n // Remove the global click\n document.body.removeEventListener(\"click\", docClicked);\n \n // Remove the visual tree from the DOM\n treeViewContainer.innerHTML = \"\";\n \n // Nullify what should be nullified, so that it can be garbage collected\n editingNode = null;\n _editingNode = null;\n treeViewContainer = null;\n originalNodes = null;\n nodeTree = null;\n movingNode = null;\n elementBefore = null;\n elementAfter = null;\n }", "title": "" }, { "docid": "bf119115d30617b9b8697d0f4355feca", "score": "0.6985793", "text": "clear() {\n\t\tlet children = Array.from(this._element.children);\n\n\t\tfor(let c in children) {\n\t\t\tthis._element.removeChild(children[c]);\n\t\t}\n\t}", "title": "" }, { "docid": "bf164572afd92d03cbe07b792305ed3b", "score": "0.69819707", "text": "destroy() {\n\t\tthis._container.innerHTML = '';\n\t\tthis._container.classList.remove('formula-js-container');\n\t\tthis._options = null;\n\t}", "title": "" }, { "docid": "d342edf22d6762a0bbe28705444ef6b4", "score": "0.6974955", "text": "destroy() {\n this.onDestroy();\n this.eventBus.clear();\n while (this._events.length > 0) {\n this._events.shift().remove();\n }\n\n while (this._globalEvents.length > 0) {\n this._globalEvents.shift().remove();\n }\n\n destroy(this.children);\n\n if (this.elGroup !== undefined && this.el !== undefined) {\n this.elGroup.delete(this.el);\n }\n if (this.root && this.root.remove) {\n this.root.remove();\n }\n\n delete this.el;\n\n }", "title": "" }, { "docid": "d342edf22d6762a0bbe28705444ef6b4", "score": "0.6974955", "text": "destroy() {\n this.onDestroy();\n this.eventBus.clear();\n while (this._events.length > 0) {\n this._events.shift().remove();\n }\n\n while (this._globalEvents.length > 0) {\n this._globalEvents.shift().remove();\n }\n\n destroy(this.children);\n\n if (this.elGroup !== undefined && this.el !== undefined) {\n this.elGroup.delete(this.el);\n }\n if (this.root && this.root.remove) {\n this.root.remove();\n }\n\n delete this.el;\n\n }", "title": "" }, { "docid": "43d1ece10b9c923dfdc26f281e316197", "score": "0.69723064", "text": "teardown() {\n if (this.$el) this.$el.remove();\n super.teardown();\n }", "title": "" }, { "docid": "6485b8f7854d04cdb4b424a13c59f447", "score": "0.6966719", "text": "_clear() {\n this._parentElement.innerHTML = '';\n }", "title": "" }, { "docid": "c33c129142ac4787bace500bd1a426ca", "score": "0.69489336", "text": "destroy() {\r\n // leave these comments for now\r\n\r\n // this.PGwidget.delete();\r\n // this.actor.getMapper().delete();\r\n // this.actor.delete();\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderer.delete();\r\n\r\n // this.renderer.delete();\r\n // this.renderer = null;\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderWindow = null;\r\n\r\n this.element = null;\r\n this._genericRenderWindow.delete();\r\n this._genericRenderWindow = null;\r\n\r\n if (this.actor) {\r\n this.actor.getMapper().delete();\r\n this.actor.delete();\r\n this.actor = null;\r\n }\r\n\r\n if (this._planeActor) {\r\n this._planeActor.getMapper().delete();\r\n this._planeActor.delete();\r\n this._planeActor = null;\r\n }\r\n\r\n if (this.PGwidgetElement) {\r\n this.PGwidgetElement = null;\r\n this.PGwidget.getCanvas().remove();\r\n this.PGwidget.delete();\r\n this.PGwidget = null;\r\n this.gaussians = null;\r\n }\r\n\r\n if (this._cropWidget) {\r\n this._cropWidget.delete();\r\n this._cropWidget = null;\r\n }\r\n }", "title": "" }, { "docid": "080590a574a570fe72b09b3b12e2264d", "score": "0.69371563", "text": "function detachDom() {\n while (dom.container.firstChild) {\n dom.container.removeChild(dom.container.firstChild);\n }\n }", "title": "" }, { "docid": "bec1954ad1261af7095807a96492000e", "score": "0.6916404", "text": "destroy() {\n this._restore.parent.replaceChild(this._restore.element, this.containerEl);\n }", "title": "" }, { "docid": "25387d70faeb20dd1e3bf4a367029209", "score": "0.69113004", "text": "_clear() {\n this._parentElement.innerHTML = \"\";\n }", "title": "" }, { "docid": "47a2b14351d035526ccdf522acf82fb9", "score": "0.6909538", "text": "reset() {\n this.dom = {};\n }", "title": "" }, { "docid": "08acf3664096a34fa6c3a49093c3e29d", "score": "0.6899677", "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'];\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "e3a9c272ada077de01f66fcd6489b1f1", "score": "0.6892321", "text": "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "title": "" }, { "docid": "e3a9c272ada077de01f66fcd6489b1f1", "score": "0.6892321", "text": "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "title": "" }, { "docid": "e3a9c272ada077de01f66fcd6489b1f1", "score": "0.6892321", "text": "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "title": "" }, { "docid": "e3a9c272ada077de01f66fcd6489b1f1", "score": "0.6892321", "text": "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "title": "" }, { "docid": "e3a9c272ada077de01f66fcd6489b1f1", "score": "0.6892321", "text": "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "title": "" }, { "docid": "48bebd93e37107a3f216f4e408d1d164", "score": "0.68849295", "text": "destroy() {\n this.element.remove()\n }", "title": "" }, { "docid": "48bebd93e37107a3f216f4e408d1d164", "score": "0.68849295", "text": "destroy() {\n this.element.remove()\n }", "title": "" }, { "docid": "fd9f735ff049947f0762533f47425121", "score": "0.6881755", "text": "destroy() {\n if (this.initialised === false) return;\n\n // Remove all event listeners\n this._removeEventListeners();\n\n // Reinstate passed element\n this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);\n this.passedElement.removeAttribute('tabindex');\n this.passedElement.removeAttribute('style', 'display:none;');\n this.passedElement.removeAttribute('aria-hidden');\n this.passedElement.removeAttribute('data-choice', 'active');\n\n // Re-assign values - this is weird, I know\n this.passedElement.value = this.passedElement.value;\n\n // Move passed element back to original position\n this.containerOuter.parentNode.insertBefore(this.passedElement, this.containerOuter);\n // Remove added elements\n this.containerOuter.parentNode.removeChild(this.containerOuter);\n\n // Clear data store\n this.clearStore();\n\n // Nullify instance-specific data\n this.config.templates = null;\n\n // Uninitialise\n this.initialised = false;\n }", "title": "" }, { "docid": "0a75966724bf53b57f2b5581b690b527", "score": "0.68747276", "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": "402955c92d6f4a86781616afdefff77c", "score": "0.68677336", "text": "clear() {\n this.root.innerHTML = \"\";\n }", "title": "" }, { "docid": "77a6242d3857d79babe60356ed950020", "score": "0.68449336", "text": "function cleanElement() {\n destroyListener();\n\n element\n .removeClass('md-active')\n .attr('aria-hidden', 'true')\n .css({\n 'display': 'none',\n 'top': '',\n 'right': '',\n 'bottom': '',\n 'left': '',\n 'font-size': '',\n 'min-width': ''\n });\n element.parent().find('md-select-value').removeAttr('aria-hidden');\n\n announceClosed(opts);\n\n if (!opts.$destroy && opts.restoreFocus) {\n opts.target.focus();\n }\n }", "title": "" }, { "docid": "09c466ddc7a727ad23261d2ea0b4e513", "score": "0.6843519", "text": "function clearDom(){\n Array.from(allBooks).forEach(book => {\n book.remove();\n });\n}", "title": "" }, { "docid": "8aaac96eb934966e729aa37b8970413a", "score": "0.6841214", "text": "_clear() {\n // Bail if there is no work to do.\n if (!this.widgets.length) {\n return;\n }\n // Remove all of our widgets.\n let length = this.widgets.length;\n for (let i = 0; i < length; i++) {\n let widget = this.widgets[0];\n widget.parent = null;\n widget.dispose();\n }\n // Clear the display id map.\n this._displayIdMap.clear();\n // When an output area is cleared and then quickly replaced with new\n // content (as happens with @interact in widgets, for example), the\n // quickly changing height can make the page jitter.\n // We introduce a small delay in the minimum height\n // to prevent this jitter.\n let rect = this.node.getBoundingClientRect();\n this.node.style.minHeight = `${rect.height}px`;\n if (this._minHeightTimeout) {\n clearTimeout(this._minHeightTimeout);\n }\n this._minHeightTimeout = window.setTimeout(() => {\n if (this.isDisposed) {\n return;\n }\n this.node.style.minHeight = '';\n }, 50);\n }", "title": "" } ]
c6141f033552180788a2f90b7e758e91
Display the card's symbol (put this functionality in another function that you call from this one)
[ { "docid": "6cb51b03531d77783e72ca2c279c9a62", "score": "0.0", "text": "function toggleCard(clickTarget) {\n clickTarget.classList.toggle('open');\n clickTarget.classList.toggle('show');\n}", "title": "" } ]
[ { "docid": "a2b6888bfa9fdcab75946c6964fd8908", "score": "0.8227161", "text": "function displaySymbol(card){\n card.className = \"card open show\";\n card.style.pointerEvents = \"none\"; // make it non-clickable\n matchOrNoMatch(card);\n}", "title": "" }, { "docid": "9af4b4b3653ba94befcf1f05e2e21b5c", "score": "0.7763865", "text": "function displayCardSymbol(card) {\n card.setAttribute('class', 'card open show');\n}", "title": "" }, { "docid": "63718f836402337c51219d87095eef49", "score": "0.7728362", "text": "function showCardSymbol(card){\n \tcard.addClass(\"show\");\n \tcard.addClass(\"disabled\"); // This will ensure the card is not clickable when it is showed and is facing up.\n}", "title": "" }, { "docid": "589565a59b63fc807fc66d2b89dce623", "score": "0.7720006", "text": "displaySymbol() {\r\n if (this.pokeCard.classList.contains('open') === false) {\r\n this.pokeCard.classList.add('open');\r\n this.pokeCard.children[0].classList.remove('hide-it');\r\n }\r\n }", "title": "" }, { "docid": "79a60c0602feafcbf9b0ce1cca322e7c", "score": "0.7374843", "text": "function showSymbol(card){\n card.classList.add('open', 'show');\n }", "title": "" }, { "docid": "5f53ab68fa98fb35f54d46988aa018a8", "score": "0.725143", "text": "function displaySymbol(selectCard) {\n selectCard.classList.add('show');\n console.log('Symbol class has been added to classList', selectCard);\n }", "title": "" }, { "docid": "be464c78a1442383a67168309f714030", "score": "0.71943843", "text": "function showSymbol(card) {\n card.classList.add('open', 'show');\n }", "title": "" }, { "docid": "1413b2e762a7f82ec229496a7c2ea6cf", "score": "0.70614934", "text": "function setYourSymbol() {\n document.getElementById('yourSymbol').innerHTML = yourSymbol;\n}", "title": "" }, { "docid": "731fcf4c8df336cc8bdd2cccb5989376", "score": "0.69033235", "text": "function showSymbol(card) {\n card.classList.add('open','show', 'disabled');\n}", "title": "" }, { "docid": "3cd938f1efc41f2d9daed13548adc3b7", "score": "0.68443996", "text": "showCard() {\n // console.log(`${this.name} of ${this.suit}`);\n }", "title": "" }, { "docid": "e70acbe68215cf631fb0ac80f2e5a3ae", "score": "0.675324", "text": "function cardSymbol(card) {\n let cardSymbols = card.firstElementChild.classList;\n for(let i=0; i<cardSymbols.length; ++i) {\n if (cardSymbols[i] != \"fa\"){\n return cardSymbols[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "741689065966f1958cb84d465f59fb2b", "score": "0.6748983", "text": "function displaySymbol (){\n this.classList.toggle(\"open\");\n this.classList.toggle(\"show\");\n this.classList.toggle(\"disabled\");\n }", "title": "" }, { "docid": "312ea2ae33bb1bfa11d9b9de1f82efd5", "score": "0.6680401", "text": "function displayCardFromDeck(card){\n return card.value + \" of \" + card.suit;\n}", "title": "" }, { "docid": "4888df9229ef3b15f4b1cc556469037a", "score": "0.65999347", "text": "function outputCard() {\r\n output.innerHTML += \"<span style='color:\" + cards[cardCount].bgcolor + \"'>\"\r\n + cards[cardCount].cardnum + \"&\" + cards[cardCount].icon + \";\" + \"</span> \";\r\n }", "title": "" }, { "docid": "3d1d137235015182661906f9169107d9", "score": "0.64551824", "text": "function displayPTFromCard(card) {\n var cardExp = document.getElementById(\"card-exp\");\n var cardName = \"<em>\" + card.name + \"</em>\";\n cardExp.innerHTML = \"<div class='center'><h2>Power and Toughness</h2></div><p>These are \" + cardName + \"<em>'s</em> <span class='jargon'>power</span> and <span class='jargon'>toughness</span> attributes. These are important for when you send it to fight your opponents and their creatures!</p><p>\" + cardName + \" has \" + card.power + \" power and \" + card.toughness + \" toughness.</p>\";\n}", "title": "" }, { "docid": "b2ecc701678d1e4b1614766b26be4e5d", "score": "0.64288527", "text": "function cardOutput(n, x) {\r\n var hpos = (x > 0) ? x * 60 + 100 : 100;\r\n return '<div class=\"icard '+ cards[n].icon +'\" style=\"left: '+hpos+'px;\"><div class=\"card-top-section suit\">'+cards[n].cardnum+'<br></div><div class=\"card-middle-section suit\"></div><div class=\"card-bottom-section suit\">'+cards[n].cardnum+'<br></div></div>';\r\n }", "title": "" }, { "docid": "baa529da0c15a4719f4c591ee0cf5a97", "score": "0.64211714", "text": "cardToString(){\n return this.number + \" of \" + this.suit + \" (\" + this._isFaceUp + \")\";\n }", "title": "" }, { "docid": "e7f9f72e4858a3897ad66afa30982db9", "score": "0.63871866", "text": "function showPlayerCard(card, ele) {\n ele.html('')\n .append(\n $('<div>')\n .attr('class', 'playing-card-body')\n .append(\n $('<h5>')\n .attr('class', `card-title ${card.getSuite()}`)\n .append(\n $('<span>')\n .attr('class', `face`)\n .append(card.getFace())\n )\n .append(\n $('<span>')\n .attr('class', `suite`)\n .append(card.getSuiteDisplayChar())\n )\n .append(\n $('<span>')\n .attr('class', `points`)\n .append(card.getValue())\n )\n .show()\n )\n );\n}", "title": "" }, { "docid": "e34e9eed601559d38cb13249d990d63e", "score": "0.63704383", "text": "function showCard() {\n\n myDeck = shuffle(myDeck);\n for(var i=0; i < myDeck.length; i++){\n div = document.createElement('div');\n div.className = 'card';\n\n \n var ascii_char = '&' + myDeck[i].suit.toLowerCase() + ';';\n }\n div.innerHTML = '<span class=\"number\">' + myDeck[i].name + '</span><span class=\"suit\">' + ascii_char + '</span>';\n document.getElementById(\"cardDeck\").appendChild(div);\n}", "title": "" }, { "docid": "60d014b263dd71f80940ba68fa9090ec", "score": "0.6360732", "text": "function paintCard(charObj, card) {\n\tcard.innerHTML = `\n\t<div class=\"card__innerline\">\n\t\t<div class=\"img__container\">\n\t\t\t<img src=\"${charObj.avatar}\" alt=\"\" id=\"avatar\" />\n\t\t</div>\n\t\t<div class=\"description__container\">\n\t\t\t<div class=\"char__name-title\">\n\t\t\t\tName: <span id=\"char__name\" class=\"text-danger fs-2 text-capitalize\">${\n\t\t\t\t\tcharObj.charName\n\t\t\t\t}</span>\n\t\t\t</div>\n\t\t\t<div class=\"char__ability-title\">\n\t\t\t\tAbility: <span id=\"char__ability\" class=\"text-danger fs-2 text-capitalize\">${\n\t\t\t\t\tcharObj.charAbility\n\t\t\t\t}</span>\n\t\t\t</div>\n\t\t\t<div class=\"char__size\">\n\t\t\t\t<div class=\"char__size-height\">\n\t\t\t\t\tHeight: <span id=\"char__height\" class=\"text-danger\">${\n\t\t\t\t\t\tcharObj.charHeight * 10\n\t\t\t\t\t}cm ${\" \"}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"char__size-weight\">\n\t\t\t\t\tWeight: <span id=\"char__weight\" class=\"text-danger\">${\n\t\t\t\t\t\tcharObj.charWeight / 10\n\t\t\t\t\t}kg</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`;\n}", "title": "" }, { "docid": "eb4a117b5c4995355a3b11a43e015842", "score": "0.63564205", "text": "function showFront() {\n // Just update the text with the current card's front word\n const innerText = `<p style=\"font-size:32px\" align=\"center\">${CURRENT_CARD[CURRENT_CARD.front]}</p>`;\n\n CURRENT_CARD.showingFront = true;\n document.getElementById('flashcard').innerHTML = innerText;\n}", "title": "" }, { "docid": "b9c3854dedaa13d7c6ba384a949731a1", "score": "0.63419825", "text": "function showCard(i) {\n firstDeck[i].classList.add('selected');\n return firstDeck[i].innerText;\n}", "title": "" }, { "docid": "c1ea5af2ecb76901ce7ec16c8f35751e", "score": "0.62963283", "text": "display() {\n if (this.cards.length) {\n // show the top card and make all cards move towards the position\n // of the deck\n this.cards[0].display(this.pos.x, this.pos.y, true);\n this.cards.forEach(c => c.approach(this.pos));\n } else {\n //show the empty slot\n stroke(0);\n strokeWeight(3);\n fill(255, 255, 255, 100);\n rect(this.pos.x, this.pos.y, CARDWIDTH, CARDHEIGHT);\n }\n }", "title": "" }, { "docid": "335b149c38f8bfdf9f9ea8f6ec288272", "score": "0.6265917", "text": "function removeSymbol(card) {\n card.classList.remove('open', 'show');\n }", "title": "" }, { "docid": "fb6e95cba7c56c9659a9218b9cbbe407", "score": "0.62608874", "text": "function symbolClick() {\n var symbol = $(this).text();\n updateFormula(function(text) {\n return text + symbol;\n });\n }", "title": "" }, { "docid": "d35b6829354eb22772611e5bc21c0592", "score": "0.62552875", "text": "function displayCard(card) {\n card.setAttribute('class', 'card show open');\n openCards.push(card);\n}", "title": "" }, { "docid": "7e6589b50e8ae95876034ed9b8ee46cb", "score": "0.6219322", "text": "function getCardUI(card) {\n var el = document.createElement('div');\n var icon = '';\n if (card.Suit == 'Hearts')\n icon = '&hearts;';\n else if (card.Suit == 'Spades')\n icon = '&spades;';\n else if (card.Suit == 'Diamonds')\n icon = '&diams;';\n else\n icon = '&clubs;';\n el.className = 'card';\n el.innerHTML = card.Value + '<br/>' + icon;\n return el;\n}", "title": "" }, { "docid": "558202c4d62d9d2cb4f14d32b029bc14", "score": "0.61863023", "text": "function displayChar(c) {\n LaunchBar.displayInLargeType({\n\ttitle: c.name,\n\tstring: c.c,\n });\n}", "title": "" }, { "docid": "df13cfcbcfc9470e05d3cefe256b75ae", "score": "0.6184417", "text": "show(hideFirstCard = false)\n\t{\n\t\tif (this.numCards == 0)\n\t\t\treturn;\n\n\t\tif (hideFirstCard == true)\n\t\t\tcout(\"** \");\n\t\telse\n\t\t{\n\t\t\tthis.cards[0].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\n\t\tfor (let x = 1; x < this.numCards; x++)\n\t\t{\n\t\t\tthis.cards[x].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\t}", "title": "" }, { "docid": "211b592cfb16d09818b887396e0e5b74", "score": "0.61434805", "text": "function turnCard() {\n\tcount++;\n\tif (count % 2 === 0) {\n\t\tthis.innerText = 'X';\n\t} else {\n\t\tthis.innerText = 'O';\n\t}\n\n}", "title": "" }, { "docid": "bb924349da0f7eb6d4bc814aa907369a", "score": "0.6136845", "text": "function displayIcon(card){\n card.className +=\" \"+\"show open\"; \n}", "title": "" }, { "docid": "0ec2d50e6acc2e89bf778c20a7faaf24", "score": "0.6126173", "text": "function showCardDOM(player, card) {\n let cardNumber = player[card - 1].number;\n let cardSuit = player[card - 1].suit;\n\n let output = cardNumber\n //+ ' ' + cardSuit;\n return output;\n}", "title": "" }, { "docid": "f591674b528f212545946721d520edd5", "score": "0.6114526", "text": "showLetter() {\n if(this.isGuessed) {\n return this.character;\n } else {\n return \"_\"\n }\n }", "title": "" }, { "docid": "7eddff17005082d409a49f8fff45ab92", "score": "0.60995644", "text": "function displaySymbol(evt){\n evt.target.classList.add('open', 'show');\n}", "title": "" }, { "docid": "749d242d3a7c4bac00f1ab92c209406c", "score": "0.60931426", "text": "function renderUnicodeMode ({ rank, suit, faceup, style, connectDragSource, handleDoubleClick }) {\n const className = \"card card-\" + suit;\n const unicodeCard = CardSymbols.cards[rank + '-' + suit];\n\n if(faceup) {\n return connectDragSource(\n <div className={ className } style={ style } onDoubleClick={ handleDoubleClick }>\n <div className='card-symbol'>\n { unicodeCard }\n </div>\n </div>\n );\n }\n else {\n return connectDragSource(\n <div className='card' style={ style }>\n { CardSymbols.cards['card-back'] }\n </div>\n );\n }\n}", "title": "" }, { "docid": "477f072d400ce7b7d0309e08b92c03f6", "score": "0.60883766", "text": "render() {\r\n if (this.cardSuit === heart || this.cardSuit === gem) {\r\n faceOfCard.style.color = '#f00a47'; // red\r\n faceOfCard.style.border = '5px solid #f00a47';\r\n } else {\r\n faceOfCard.style.color = '#05ccf0'; // blue\r\n faceOfCard.style.border = '5px solid #05ccf0';\r\n }\r\n\r\n faceOfCard.innerHTML = `\r\n <h1>${this.cardNumber}</h1>\r\n <i class=\"${this.cardSuit}\"></i>\r\n `;\r\n }", "title": "" }, { "docid": "73213521795fdcaddf7481bf73af4528", "score": "0.6083749", "text": "function cardToOutputString(card) {\n var faceValue = cardFaceValue(card);\n\n if (faceValue >= royalStartNumeric) {\n return royalNames[faceValue - royalStartNumeric];\n }\n return numberNames[faceValue - 1];\n}", "title": "" }, { "docid": "3929d5f93fb89a795d1519eb51f877d1", "score": "0.6069598", "text": "function showSymbols(e) {\n let letters = findSymbols(e.target.value, names, nameMap);\n let list = '';\n for (const index in letters) {\n list +=\n `<div class='label'> ${letters[index][0]} </div>` +\n `<textarea onclick='copyToClipboard(\"${letters[index][1]}\")' class='symbol' readonly='true' rows='1' cols='1' >${letters[index][1]}</textarea>`;\n }\n nameList.innerHTML = list;\n}", "title": "" }, { "docid": "edd6b4202579ca1844151512ad703272", "score": "0.6067996", "text": "function displaySymbol(x, y, symbol) {\n //double loop - if i === x and j === y .text(symbol)\n const stringCoords = x.toString() + y.toString();\n for(let i = 0; i < 3; i++) {\n for(let j = 0; j < 3; j++) {\n if (i == x && j == y) {\n $(\"#\" + stringCoords).text(symbol);\n \n }\n }\n }\n}", "title": "" }, { "docid": "e81a65a0cf9420c2b65921caa2584d76", "score": "0.6051807", "text": "function clickOver() {\n document.getElementById('moneyEarn').innerHTML = \" ༼ง ◉ω◉༽ง \";\n}", "title": "" }, { "docid": "76b0da60ed993c4bf9eabf5c5830eb39", "score": "0.60459167", "text": "function card(number, symbol){\n\tthis.number = parseInt(number);\n\tthis.symbol = symbol;\n\tthis.getNumber = function(){\n\t\treturn this.number;\n\t}\n}", "title": "" }, { "docid": "7c3a29dbfedf1aae2230b13044f59d34", "score": "0.6044704", "text": "function charClick (e) {\n console.log(\"ez a charClick fgv.\")\n console.log(props.value)\n setHide(!hide) // if card is hidden, show it on click, if it's shown hide it\n\n // setCharacter(props.value) \n }", "title": "" }, { "docid": "8c730d394ba92639c73e2d0ea8db70e0", "score": "0.6031125", "text": "function getSymbol(volume) {\n if (volume >= 0.5) return '🔊';//0.5 - 1.0\n if (volume >= 0.1) return '🔉';//0.1 - 0.49\n if (volume > 0) return '🔈';//0.01 - 0.09\n return '🔇';//0\n}", "title": "" }, { "docid": "ed8f8055f093b524665e8cf0b903ccc3", "score": "0.6021275", "text": "function generateCard(card) {\n\treturn `<li class=\"card\" data-card=${card}>\n\t\t\t\t<i class=\"fa ${card}\"></i>\n\t\t\t</li>`;\n}", "title": "" }, { "docid": "3efd3e8830a91368c034c2636e660e8c", "score": "0.601732", "text": "function displayComputerChoice(ch){\n showcompChooses()\n var cmpch = \"\"\n switch(ch){\n case \"paper\": cmpch = \"✋\"; break;\n case \"rock\": cmpch = \"✊\"; break;\n case \"scissors\": cmpch = \"✌\"; break;\n }\n compChooses.innerHTML = cmpch\n}", "title": "" }, { "docid": "2a5c2f08056b1f339e8ab79468e6fe04", "score": "0.6014631", "text": "function displayCard(card) {\n card.className = \"card open show disable\";\n}", "title": "" }, { "docid": "76d80a98a0aa829095c9df70e43f793d", "score": "0.60131705", "text": "function generateCard(card) {\n\t\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\t\t\t\n}", "title": "" }, { "docid": "46d90a3965c207dcb41ef68a5eb1a5fc", "score": "0.6003106", "text": "function cardDrawTitle(card, isPlayerCard){\n\n var font = cardTitleFont;\n var fontSize = cardTitleFontSize; \n var fontColor = cardTitleFontColor;\n\n if(isPlayerCard){\n var cardTitle = playerCards[card.id].name;\n }else{\n var cardTitle = mobCards[card.id].name;\n }\n \n var cardName = new PIXI.Text(cardTitle);\n\n cardName.setStyle({font:\"\"+fontSize+\"px \"+font, fill:fontColor});\n \n cardName.position.x = cardFrameOriginalWidth/2 - getXOffsetFromCenterForText(cardTitle, cardTitleFontCharSize);\n cardName.position.y = 100;\n \n card.addChildAt(cardName, 4);\n }", "title": "" }, { "docid": "e3c29128ff2d60b739e066df16b10e58", "score": "0.59943825", "text": "function displaySetFromCard(card) {\n var cardExp = document.getElementById(\"card-exp\");\n var cardName = \"<em>\" + card.name + \"</em>\";\n var rarityColour;\n // this switch case updates rarity colour\n switch (card.rarity) {\n case \"common\":\n rarityColour = \"black\";\n break;\n case \"uncommon\":\n rarityColour = \"blue/silver\";\n break;\n case \"rare\":\n rarityColour = \"gold\";\n break;\n case \"mythic\":\n rarityColour = \"orange\";\n break;\n }\n cardExp.innerHTML = \"<div class='center'><h2>Set and Rarity</h2></div><p>This <span class='jargon'>set symbol</span> indicates the card\\'s rarity and what <span class='jargon'>set</span> it comes from. \" + cardName + \" is from the <em>\" + card.set_name + \"</em> set and is <span class='jargon'>\" + card.rarity + \"</span>, as indicated by the \" + rarityColour + \" colour of the symbol.</p>\";\n}", "title": "" }, { "docid": "c8d013b6dfc0f13d712f7f7ac287df1b", "score": "0.5965358", "text": "function cardClick(card, array) {\n \n var letter = array.slice();\n $(card).text(letter);\n lastCardId = $(card).attr(\"id\");\n}", "title": "" }, { "docid": "8f9d8f66de5d90a9fc9d60462186e917", "score": "0.59569937", "text": "function changeDisplaySign() {\n\t// Change display sign\n\tvar x = document.querySelector('.clear-entry');\n\tx.innerHTML = \"&times;\";\n\tx.className = \"clear-entry\";\n}", "title": "" }, { "docid": "0274e4498a4e2dd5c424cec0e02d210e", "score": "0.5955519", "text": "function showCard(card)\n\t{\n\t\tcard.addClass('show open');\n\t\taddOpened(card);\n\t}", "title": "" }, { "docid": "2b688143cc7a231d86798ad3fd32d9d4", "score": "0.5950147", "text": "function displayCard(card) {\n\treturn $(card).toggleClass('open show animated');\n}", "title": "" }, { "docid": "b73cc6a5269a8c8d9d4b7ee9d4d31fc4", "score": "0.5927725", "text": "function getCardString(card){\n return card.value + ' of ' + card.suit;\n}", "title": "" }, { "docid": "7785f90d96dc0bc900578a2fbaf0275d", "score": "0.5923062", "text": "function createSymbolPreviewInnerHTML(font) {\n var html, abc, numbers, i, f, e;\n html = '';\n abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];\n html += '<br><br><br><br>';\n for (i = 0; i < abc.length; i++) {\n html += '<div>' + abc[i] + ': <span style=\"font-family:' + font + ';\">' + abc[i] + '</span><span>&nbsp;&nbsp;</span></div>';\n }\n html += '<br><br>';\n for (f = 0; f < abc.length; f++) {\n html += '<div>' + abc[f].toUpperCase() + ': <span style=\"font-family:' + font + ';\">' + abc[f].toUpperCase() + '</span><span>&nbsp;&nbsp;</span></div>';\n }\n html += '<br><br>';\n for (e = 0; e < numbers.length; e++) {\n html += '<div>' + numbers[e] + ': <span style=\"font-family:' + font + ';\">' + numbers[e] + '</span><span>&nbsp;&nbsp;</span></div>';\n }\n return html;\n }", "title": "" }, { "docid": "a569cb89b24fb85c98af1f2b3fd75d92", "score": "0.59226555", "text": "function showCard(cardNum, cardName) {\r\n\tflipCardSnd.play();\r\n\t$(\"#cardImg\" + cardNum).attr(\"src\", \"/Resources/deck/\" + cardName + \".gif\");\r\n}", "title": "" }, { "docid": "c3399fab2334c4cc0bcd79571ecb6c24", "score": "0.59191525", "text": "function cardToString(){ \n // not sure if is prototype or just function\n\n var number; //rank \n var suit;\n\n switch (this.number) {\n case \"A\" :\n number = \"Ace\";\n break;\n case \"2\" :\n number = \"Two\";\n break;\n case \"3\" :\n number = \"Three\";\n break;\n case \"4\" :\n number = \"Four\";\n break;\n case \"5\" :\n number = \"Five\";\n break;\n case \"6\" :\n number = \"Six\";\n break;\n case \"7\" :\n number = \"Seven\";\n break;\n case \"8\" :\n number = \"Eight\";\n break;\n case \"9\" :\n number = \"Nine\";\n break;\n case \"10\" :\n number = \"Ten\";\n break;\n case \"J\" :\n number = \"Jack\"\n break;\n case \"Q\" :\n number = \"Queen\"\n break;\n case \"K\" :\n number = \"King\"\n break;\n }\n\n switch (this.suit) {\n case \"C\" :\n suit = \"Clubs\";\n break;\n case \"D\" :\n suit = \"Diamonds\"\n break;\n case \"H\" :\n suit = \"Hearts\"\n break;\n case \"S\" :\n suit = \"Spades\"\n break;\n }\n\n return number + \"_of_\"+ suit;\n //will reference to find and change for the picture.\n}", "title": "" }, { "docid": "77a612a724d341d53453a143ffdb2cae", "score": "0.5918284", "text": "function getCardString(card) {\n return card.value + ' of ' + card.suit;\n}", "title": "" }, { "docid": "93b6d2d77720ae9f32229ffb5260d674", "score": "0.5907417", "text": "displayOutcomeCard(){\n // Prepare card value\nconst span = document.createElement('span');\nspan.innerHTML = `${this.outcomeCard.join(\"\")}`;\n// Prepare holder of suit and value\nconst li = document.createElement('li');\nli.classList.add('poker');\n// Load holder with value and background image \nli.appendChild(span);\n// Add composed card to ul container document\nconst ul = document.querySelector('ul');\nul.appendChild(li);\nreturn this.outcomeCard;\n }", "title": "" }, { "docid": "1d36b6e7fe58c892fb4a6d303c060f07", "score": "0.5903896", "text": "function updateSymbol() {\n const symbol = this.paused ? `►` : `▮▮`;\n toggle.textContent = symbol;\n}", "title": "" }, { "docid": "d275b49f8ae268e30e64f35ae06541ef", "score": "0.5893875", "text": "function displayCard(currentCard) {\n currentCard.classList.toggle('open');\n currentCard.classList.toggle('show');\n }", "title": "" }, { "docid": "3972875b74659f73d4a745900450ff90", "score": "0.58784765", "text": "function getCardString(card) {\n return card.value + \" of \" + card.suit;\n}", "title": "" }, { "docid": "bc318fbfd02a0eaa9473b02f49d9d771", "score": "0.5876797", "text": "function getSymbol() {return symbolField().value}", "title": "" }, { "docid": "443cc340b3c4c6e8bb6a551bebda1414", "score": "0.5870968", "text": "function displayHandUpdate(){\r\n displayHand = [`Cards:`];\r\n \r\n for (let i=0; i<cards.length; i++){\r\n displayHand.push(\" \"+ cards[i])\r\n\r\n } displayHand = displayHand.join(\"\");\r\n hand.textContent = displayHand;\r\n \r\n}", "title": "" }, { "docid": "b315412886e8361c6644c012e325dced", "score": "0.5862777", "text": "function showBack() {\n // return all words that are not on the front of the card and that have a value for their key\n const backWords = ['english', 'kana', 'kanji']\n .map(k => k !== CURRENT_CARD.front && CURRENT_CARD[k])\n .filter(j => !!j);\n const innerText = `<p style=\"font-size:28px\" align=\"center\">${backWords.join('<br><br>')}</p>`;\n\n CURRENT_CARD.showingFront = false;\n document.getElementById('flashcard').innerHTML = innerText;\n\n}", "title": "" }, { "docid": "eab779afa98637f266c61449be7faf66", "score": "0.5856868", "text": "function showCard(card) {\n if((card.className === 'card') && (cardsOpen.length<2)){\n card.classList.add('flip');\n moveCounter();\n openedCards(card);\n }\n}", "title": "" }, { "docid": "145c470c8cb285c66e6f8b7bfd8d1ad5", "score": "0.58508945", "text": "function displayNameSymbol(company) {\n //Clearing previous company data\n document.getElementById(\"name-symbol\").innerHTML = '';\n let nameSymbol = document.createElement('h3');\n let description = document.createElement('p');\n description.innerText = `${company.description}`;\n nameSymbol.innerText = `${company.name} (${company.symbol})`;\n document.getElementById(\"name-symbol\").appendChild(nameSymbol);\n document.getElementById(\"name-symbol\").appendChild(description);\n }", "title": "" }, { "docid": "15da0d368824a22ef46b853181bd292e", "score": "0.58427095", "text": "function displayCard(cardClick) {\n\tcardClick.classList.toggle(\"open\");\n\tcardClick.classList.toggle(\"show\");\n}", "title": "" }, { "docid": "f51844252b9dab648c2af2952863a0ad", "score": "0.5840052", "text": "function generateCard(card) { \n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "4f628d902ec84d05f4741f44bf2dd069", "score": "0.5833953", "text": "function cardDrawAttackAttribute(card, font, fontColor, fontSize, isPlayerCard){\n \n if(isPlayerCard){\n var cardAttack = playerCards[card.id].attack;\n }else{\n var cardAttack = mobCards[card.id].attack;\n }\n \n var atkNumber = new PIXI.Text(cardAttack);\n \n atkNumber.setStyle({font:\"\"+fontSize+\"px \"+font, fill:fontColor});\n \n //TOP LEFT \n atkNumber.position.x = topLeftAttributeSlotXOffset - getXOffsetFromCenterForText(cardAttack, cardAttributeFontCharSize);\n atkNumber.position.y = topLeftAttributeSlotYOffset - cardAttributeFontCharSize;\n \n card.addChildAt(atkNumber, 0);\n \n }", "title": "" }, { "docid": "7c19043545c8037c606bc5793fcead17", "score": "0.5829007", "text": "function renderPupCard(pup) {\n // Grab dog bar\n let dogBar = document.getElementById('dog-bar')\n // dogBar.innerHTML = \"\"\n \n // Create dog spans\n let span = document.createElement('span')\n span.innerText = pup.name\n dogBar.appendChild(span)\n \n span.addEventListener('click', () => showPupInfo(pup))\n \n}", "title": "" }, { "docid": "9d632cac55890c969478801c5d6b9491", "score": "0.58182555", "text": "function open_sim_card(){\r\n\tdocument.getElementById('sim_card_info').style.display=\"block\";\r\n}", "title": "" }, { "docid": "a7b023e22bdde76d35a03d31de5b9353", "score": "0.5815804", "text": "show() {\n // circle(this.x, this.y, this.circ);\n // args: image(image var, top edge, left edge, width, height);\n image(charImg, this.x, this.y, this.circ, this.circ);\n }", "title": "" }, { "docid": "84cb560b944f28b855ef7318ffa41c0d", "score": "0.5811055", "text": "function selectCard() {\n chosenCard = $(this).text();\n $(\"#selectCardMenu\").text(chosenCard);\n choseCardType = true;\n}", "title": "" }, { "docid": "8d881c8c38ac7b046ef2e8f6ddf241d5", "score": "0.58098626", "text": "function displayCardData(data) {\n\t\tlet pokemonData = data;\n\t\tmyPokemonMaxHP = pokemonData.hp;\n\t\tqs(\"#my-card .name\").innerText = pokemonData.name;\n\t\tqs(\"#my-card .hp\").innerText = pokemonData.hp + \"HP\";\n\t\tqs(\"#my-card .info\").innerText = pokemonData.info.description;\n\t\tqs(\"#my-card .pokepic\").setAttribute(\"src\", endPoint + pokemonData.images.photo);\n\t\tqs(\"#my-card .pokepic\").setAttribute(\"alt\", pokemonData.name.toLowerCase());\n\t\tqs(\"#my-card .type\").setAttribute(\"src\", endPoint + pokemonData.images.typeIcon);\n\t\tqs(\"#my-card .weakness\").setAttribute(\"src\", endPoint + pokemonData.images.weaknessIcon);\n\n\t\tlet moveSlot = qsa(\"#my-card .moves button\");\n\t\tlet moveSlotName = qsa(\"#my-card .moves .move\");\n\t\tlet moveSlotDmg = qsa(\"#my-card .moves .dp\");\n\t\tlet moveSlotImg = qsa(\"#my-card .moves img\");\n\t\tlet numberOfMoves = pokemonData.moves.length;\n\t\tfor (let i = 0; i < numberOfMoves; i++) {\n\t\t\tlet pokemonMove = pokemonData.moves[i];\n\t\t\tmoveSlotName[i].innerText = pokemonMove.name;\n\t\t\tmoveSlotImg[i].setAttribute(\"src\", endPoint + \"icons/\" + pokemonMove.type + \".jpg\");\n\t\t\tif (pokemonMove.hasOwnProperty(\"dp\")){\n\t\t\t\tmoveSlotDmg[i].innerText = pokemonMove.dp + \" DP\";\n\t\t\t} else {\n\t\t\t\tmoveSlotDmg[i].innerText = \"\";\n\t\t\t}\n\t\t\tmoveSlot[i].classList.remove(\"hidden\");\n\t\t}\n\t\tfor (let i = numberOfMoves; i < 4; i++) {\n\t\t\tmoveSlot[i].classList.add(\"hidden\");\n\t\t}\n\t}", "title": "" }, { "docid": "26f69dc2f037c012ec10a92f84da8d14", "score": "0.5808259", "text": "function ticker_markup(symbol) {\n\t$('.js-tickers').prepend(`\n <div class=\"col s12 m12 l4\">\n <div class=\"card js-toggle-ticker align-left\" id=\"${symbol}\" style=\"min-height: 80px;\">\n <div class=\"card-content\">\n <span class=\"card-title pull-left\">${symbol}</span>\n <a id=\"${symbol}\" class=\"js-remove-ticker pull-right\" style=\"cursor: pointer;\">\n <i class=\"fa fa-times\" aria-hidden=\"true\">\n </i></a>\n </div>\n </div>\n </div>\n `);\n\n\t/**\n\t * since our HTML is brand-new we must \n\t * re-add our event listeners.\n\t */\n\t$(`a#${symbol}`).click(el => {\n\t\tdeleteStockEvent(el, deleteStock);\n\t});\n\n\t$(`div#${symbol}`).click(el => {\n\t\ttoggleStockChart(el, c3_chart.draw);\n\t})\n}", "title": "" }, { "docid": "90e5f8412ac65db6af44ffcb9078249b", "score": "0.5797986", "text": "getButtonText() { return this.state.cardState == \"Question\" ? \"See Answer\" : \"See Question\"; }", "title": "" }, { "docid": "9eb3d7d4e9004e7d27e2f7c68a94febc", "score": "0.5797103", "text": "function drawSymbol(entity, loc, filter, isHero) {\n\t// If hero, draw without filter\n\t var rgb = isHero ? entity.getRGB() : entity.getRGB(filter);\n if (rgb.isBlack()) {\n rgb = RGB.DarkGrey\n }\n var color = rgb.toString();\n\t\n\t// Get loc in canvas space\n\tcanvasLoc = toCanvasSpace(loc, this.centerLoc);\n\tvar txt = entity.getRepr();\n\tdrawText.call(this, txt, canvasLoc, color);\n\t// Stroke white outline for visibility on creeps\n\t// This doesnt look that good, but might bring it back later\n\t/*if (!isHero) {\n\t\tthis.context.save();\n\t\tthis.context.strokeStyle = RGB.White.toString();\n\t\tthis.context.lineWidth = .5;\n\t\tthis.context.strokeText(txt,\n\t\t\tcanvasLoc.x - txtWidth/2, \n\t\t\tcanvasLoc.y + txtHeight/2);\n\t\tthis.context.restore();\n\t}*/\n}", "title": "" }, { "docid": "0a1a0197c716755673e0b816a09da6b8", "score": "0.57964605", "text": "function displayCard(e){\n e.target.setAttribute(\"class\",\"card open show\");\n addToOpenCards(e.target);\n}", "title": "" }, { "docid": "b780391e1360ab6ffa58d6e01f585588", "score": "0.5783267", "text": "function draw_show_cards(deck) {\n drawn_cards = jsPsych.randomization.sampleWithoutReplacement(deck, 4)\n left_card = drawn_cards[0];\n right_card = drawn_cards[1];\n left_with_tag = \"<img class='card_left' src='\" + left_card + \"'>\"\n right_with_tag = \"<img class='card_right' src='\" + right_card + \"'>\"\n return left_with_tag + right_with_tag + fixation;\n}", "title": "" }, { "docid": "8ae580ae51b91a1d46f9611fe2be9448", "score": "0.5782392", "text": "display() {\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Title of planet\n push();\n let tag;\n let symbol_xPos = this.x + 20;\n let symbol_yPos = this.y + 30;\n let text_xPos = this.x - 20;\n let text_yPos = this.y + 30;\n\n fill(green.r, green.g, green.b);\n\n // Symbol\n textFont(symbolFont);\n textSize(this.symbolSize);\n text(this.symbol, symbol_xPos, symbol_yPos);\n\n // Title\n textFont(globalFont);\n textSize(this.titleSize);\n text(this.title, text_xPos, text_yPos);\n pop();\n\n // Custom colour of our Venus\n // RGB parameters + position\n // Pale pink\n pointLight(this.fill.r, this.fill.g, this.fill.b, this.fill.lightPosition);\n\n // Calling the superclass Planet.js' display method\n super.display();\n pop();\n }\n }\n }", "title": "" }, { "docid": "f6934ed99a706c4e921626d7c85b6508", "score": "0.5778204", "text": "function cardBack(number) {\r\n document.getElementById('back').innerHTML = fullCards[number].back;\r\n}", "title": "" }, { "docid": "4c7876040772744f88f241d60ec76929", "score": "0.577775", "text": "function getDisplayTerm(card){\n return card.givenTerm;\n}", "title": "" }, { "docid": "c254ea5dbc9394ec7a3a52969c197a64", "score": "0.57696795", "text": "function createCard(card) {\n // if card isn't faceUp\n if (!card.faceUp) {\n return unknownCard;\n\n }\n\n var cardText = (card.rank != \"10\" ? `______\n|R S|\n| |\n|S R|\n` + (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\") : `______\n|R S|\n| |\n|S R|\n`+ (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\"));\n var s;\n switch(card.suit) {\n case \"Spades\":\n s = (unicode ? \"\\u2660\" : \"S\");\n break;\n case \"Hearts\":\n s = (unicode ? \"\\u2665\" : \"H\");\n break;\n case \"Clubs\":\n s = (unicode ? \"\\u2663\" : \"C\");\n break;\n case \"Diamonds\":\n s = (unicode ? \"\\u2666\" : \"D\");\n break;\n }\n\n var r = card.rank;\n\n // replace all instances of \"R\" with rank\n cardText = cardText.replace(/R/g, r);\n\n // replace all instances of \"S\" with rank\n cardText = cardText.replace(/S/g, s);\n\n // if card is black, replace all spaces with a \"/\"\n if (isBlack(card.suit)) {\n cardText = cardText.replace(/ /g, \"/\");\n }\n\n return cardText;\n}", "title": "" }, { "docid": "0e371782b135a950d4ed9f08214b2fbd", "score": "0.5769159", "text": "function renderCard(card, player) {\n var hand = document.getElementById('hand_' + player);\n hand.appendChild(getCardUI(card));\n}", "title": "" }, { "docid": "74d4113ab05722a5745acd5209ea7465", "score": "0.57653356", "text": "function changeToCards(number) {\n switch (number) {\n case -1:\n return \"J -\";\n case 0:\n return \"J +\";\n case 1:\n return \"&#9734\";\n case 2:\n return \"10 &#9825\";\n case 3:\n return \"9 &#9825\";\n case 4:\n return \"8 &#9825\";\n case 5:\n return \"7 &#9825\";\n case 6:\n return \"7 &#9827\";\n case 7:\n return \"8 &#9827\";\n case 8:\n return \"9 &#9827\";\n case 9:\n return \"10 &#9827\";\n case 10:\n return \"10 &#9824\";\n case 11:\n return \"K &#9825\";\n case 12:\n return \"6 &#9825\";\n case 13:\n return \"5 &#9825\";\n case 14:\n return \"4 &#9825\";\n case 15:\n return \"4 &#9827\";\n case 16:\n return \"5 &#9827\";\n case 17:\n return \"6 &#9827\";\n case 18:\n return \"K &#9827\";\n case 19:\n return \"10 &#9671\";\n case 20:\n return \"9 &#9824\";\n case 21:\n return \"6 &#9824\";\n case 22:\n return \"Q &#9825\";\n case 23: \n return \"3 &#9825\";\n case 24: \n return \"2 &#9825\";\n case 25: \n return \"2 &#9827\";\n case 26: \n return \"3 &#9827\";\n case 27: \n return \"Q &#9827\";\n case 28: \n return \"6 &#9671\";\n case 29:\n return \"9 &#9671\";\n case 30:\n return \"8 &#9824\";\n case 31:\n return \"5 &#9824\";\n case 32:\n return \"3 &#9824\";\n case 33:\n return \"Q &#9824\";\n case 34:\n return \"A &#9825\";\n case 35:\n return \"A &#9827\";\n case 36:\n return \"Q &#9671\";\n case 37:\n return \"3 &#9671\";\n case 38:\n return \"5 &#9671\";\n case 39:\n return \"8 &#9671\";\n case 40:\n return \"7 &#9824\";\n case 41: \n return \"4 &#9824\";\n case 42: \n return \"2 &#9824\";\n case 43: \n return \"A &#9824\";\n case 44: \n return \"K &#9824\";\n case 45: \n return \"K &#9671\";\n case 46: \n return \"A &#9671\";\n case 47: \n return \"2 &#9671\";\n case 48: \n return \"4 &#9671\";\n case 49: \n return \"7 &#9671\";\n default:\n return \"-2\";\n }\n}", "title": "" }, { "docid": "c96ede52be215c79a7867062a96c4213", "score": "0.5762811", "text": "function cardClick() {\n\n}", "title": "" }, { "docid": "d062803c64c7a34021655aed0f2bd25d", "score": "0.5762048", "text": "get symbolButton() {\n return {\n symbolTypes: [\"symbols\"],\n type: \"rich-text-editor-symbol-picker\",\n };\n }", "title": "" }, { "docid": "3320aad9e73312da47503a00092dbda1", "score": "0.5757392", "text": "function format_single(card) {\n return card[0] + \" \" + cardNames[card[1]];\n }", "title": "" }, { "docid": "be3e435b38ab385106e7eae1b47ba8c2", "score": "0.5756376", "text": "function flipCard(card) {\n\tif (card.getAttribute('data-card') === 'queen') {\n\t\tcard.innerHTML = '<img src=\"queen.png\" alt=\"queen\" />';\n\t\t// cardElement.innerHTML = '<img src=\"my_king.png\" alt=\"King of Spades\" />';.\n\t} else {\n\t\tcard.innerHTML = '<img src= \"king.png\" alt=\"king\"/>';\n\t}\n}", "title": "" }, { "docid": "8e1673c83ddf5e7041526a4cca01e91f", "score": "0.5755171", "text": "function drawSymbol( ctx, symbol, fc, cx, cy, cw, ch ) {\n\tctx.beginPath();\n\tswitch ( symbol ) {\n\t\tcase \"0\":\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw/2),(cw/2)-fc,deg2rad(180),0, false);\n\t\t\tctx.arc(cx+(cw/2),(cy+ch)-(cw/2),(cw/2)-fc,0,deg2rad(180), false);\n\t\t\tctx.closePath();\n\t\tbreak;\n\t\tcase \"1\":\n\t\t\tctx.moveTo(cx+(cw*0.1)+fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.moveTo(cx+(cw*0.666666),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.666666),cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.25),cy+(ch*0.25));\n\t\tbreak;\n\t\tcase \"2\":\n\t\t\tctx.moveTo(cx+cw-fc,cy+(ch*0.8));\n\t\t\tctx.lineTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+fc,cy+ch-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.425),(cw*0.425)-fc,deg2rad(45),deg2rad(-180), true);\n\t\tbreak;\n\t\tcase \"3\":\n\t\t\tctx.moveTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-90),deg2rad(180), false);\n\t\tbreak;\n\t\tcase \"4\":\n\t\t\tctx.moveTo(cx+(cw*0.75),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\n\t\t\tctx.moveTo(cx+cw-fc,cy+(ch*0.666666));\n\t\t\tctx.lineTo(cx+fc,cy+(ch*0.666666));\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\n\t\t\tctx.moveTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.5),cy+ch-fc);\n\t\tbreak;\n\t\tcase \"5\":\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-80),deg2rad(180), false);\n\t\tbreak;\n\t\tcase \"6\":\n\t\t\tctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\tbreak;\n\t\tcase \"7\":\n\t\t\tctx.moveTo(cx+(cw*0.5),cy+ch-fc);\n\t\t\tctx.lineTo(cx+cw-fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.25)-fc);\n\t\tbreak;\n\t\tcase \"8\":\n\t\t\tctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-205), true);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-135),deg2rad(-45), true);\n\t\t\tctx.closePath();\n\t\t\tctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));\n\t\t\tctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));\n\t\tbreak;\n\t\tcase \"9\":\n\t\t\tctx.moveTo(cx+cw-fc,cy+(cw*0.5));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.5),(cw*0.5)-fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.bezierCurveTo(cx+cw-fc,cy+ch-fc,cx+cw-fc,cy+ch-fc,cx+(cw*0.1)+fc,cy+ch-fc);\n\t\tbreak;\n\t\tcase \"%\":\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.75));\n\t\t\tctx.lineTo(cx+cw-fc,cy+(ch*0.25));\n\t\t\tctx.moveTo(cx+(cw*0.505),cy+(cw*0.3));\n\t\t\tctx.arc(cx+(cw*0.3),cy+(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.moveTo(cx+(cw*0.905),cy+ch-(cw*0.3));\n\t\t\tctx.arc(cx+(cw*0.7),cy+ch-(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);\n\t\tbreak;\n\t\tcase \".\":\n\t\t\tctx.moveTo(cx+(cw*0.25),cy+ch-fc-fc);\n\t\t\tctx.arc(cx+(cw*0.25),cy+ch-fc-fc,fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.closePath();\n\t\tbreak;\n\t\tcase \"M\":\n\t\t\tctx.moveTo(cx+(cw*0.083),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.083),cy+fc);\t\n ctx.moveTo(cx+(cw*0.083),cy+fc);\t\n ctx.lineTo(cx+(cw*0.4167),cy+ch-fc);\n ctx.moveTo(cx+(cw*0.4167),cy+ch-fc);\n ctx.lineTo(cx+(cw*0.75),cy+fc);\t\n\t\t\tctx.moveTo(cx+(cw*0.75),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\t\t\n\t\tbreak;\n\t\tcase \"G\":\n ctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(180),deg2rad(-15), true);\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*1.00),cy+(ch*0.5));\n\t\t\tctx.lineTo(cx+(cw*0.60),cy+(ch*0.5));\n\t\tbreak;\n\t\tcase \"b\":\n\t\t\tctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.2)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\tbreak;\n\t\tcase \"B\":\n\t\t\tctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-165), true);\t\t\t\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-215),deg2rad(-45), true);\n\t\t\tctx.closePath();\n\t\t\tctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));\n\t\t\tctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));\n\t\tbreak;\n\t\tdefault:\n\t\tbreak;\n\t}\t\n\tctx.stroke();\n}", "title": "" }, { "docid": "3206d4fcc6981bc2a2559e608b064c4d", "score": "0.5751387", "text": "function cardFront(number) {\r\n document.getElementById('front').innerHTML = fullCards[number].front;\r\n}", "title": "" }, { "docid": "47c40d1ba78a12df2c6004914bae3b7f", "score": "0.5746782", "text": "function displayPet(pet) {\n var icon = '';\n if (pet.anType === \"Dog\") {\n icon = \"🐕\";\n }\n if (pet.anType === \"Cat\") {\n icon = '🐈';\n }\n if (pet.anType === \"Bird\") {\n icon = '🐦';\n }\n\n var card = `\n <div id=\"\" class=\"card shadow m-3\" style=\"width: 15rem;\">\n <div class-\"card-body\">\n <h5 class=\"card-title text-center py-3\">\n ${pet.name}\n </h5>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\"><b>Service:</b> ${pet.service}</li>\n <li class=\"list-group-item\"><b>Price:</b> $${pet.price}.00</li>\n <li class=\"list-group-item\"><b>Owner:</b> ${pet.owner}</li>\n <li class=\"list-group-item\"><b>Phone:</b> ${pet.phone}</li>\n <li class=\"list-group-item\">${icon}</li>\n <button class=\"my-2 mx-5 btn btn-sm btn-outline-danger\" onclick=\"deletePet(${pet.petId})\">Remove Pet</button>\n </ul>\n </div>\n </div>\n `\n\n var newCard = document.createElement(\"div\");\n newCard.innerHTML = card;\n document.getElementById(\"pets\").appendChild(newCard);\n}", "title": "" }, { "docid": "3baadce8e6f75cdb59917b68ba79447f", "score": "0.57410246", "text": "function printSymbol(e) {\n let obj = e.target;\n console.log(e.target.id);\n \n if(obj.id == 'period') {\n result.value += obj.textContent;\n } else if(obj.id == 'leftP') {\n result.value = obj.textContent;\n } else if (result.value != 0) {\n result.value += obj.textContent;\n }\n}", "title": "" }, { "docid": "26b0bd3c3db0cbee2992a07dd7ebaa52", "score": "0.5740447", "text": "function show(card) {\n\tcard.setAttribute(\"class\", \"card show open\");\n}", "title": "" }, { "docid": "eb6c3565851d5f19ecf6e7fa352a686c", "score": "0.5738722", "text": "function makeCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "40a6242ba6cba11009db9374aed90504", "score": "0.572697", "text": "function renderCard() {\n window.question.style.display = \"block\";\n window.cardTitle.style.display = \"none\";\n window.answer.style.display = \"none\";\n\n const card = window.cardList[window.currentPage];\n console.log(card.language_id);\n window.language.innerText = languageList[card.language_id - 1].name;\n window.cardTitle.innerText = card.title;\n window.answer.innerText = card.answer;\n window.question.innerText = card.question;\n\n // creating deleteButton that appears on each card\n let cardItem = document.getElementById(\"card-item\");\n}", "title": "" }, { "docid": "cc2a6951b86e8d37f37d13963ed927f7", "score": "0.5725128", "text": "function symbolGet() {\n\t\tlet symbolCode = undefined;\n\t\t\tfor (let i = 0; i < symbolsArray.length; i++) {\n\t\t\t\tlet digitLetter = Math.random();\n\n\t\t\t\t/* 'digitLetter' values are between two Math.random() ranges (0 < symbolTaken < 0.5 or 0.5 > symbolTaken > 1).\n\t\t\t\tThis describes 50% chance for getting digit or letter every time. 'symbolCode' ranges 48-57 and 65-90 are for getting HTML charcode symbols (&#48-&#57 for digits and &#65-&#90 for letters) */\n\t\t\t\tdigitLetter < 0.5 ? symbolCode = Math.ceil(Math.random() * 9 + 48) : symbolCode = Math.ceil(Math.random() * 25 + 65);\n\n\t\t\t\t/* Making a symbol from HTML character code and put it into an array */\n\t\t\t\tsymbolsArray[i].innerHTML = `&#${symbolCode}`;\n\t\t\t\tsymbolString.push(String.fromCharCode(symbolCode));\n\t\t\t}\n\t}", "title": "" }, { "docid": "6bb01b84d7ab98c1869b331d3a487d75", "score": "0.57228196", "text": "function getSymbol(sym) {\n switch (sym) {\n case \"$\":\n return \"USD\";\n break;\n case \"£\":\n return \"GBP\";\n break;\n case \"€\":\n return \"EUR\";\n break;\n default:\n return \"USD\";\n break;\n }\n\n}", "title": "" }, { "docid": "08e275906f0e7d55d921da0b104dde1d", "score": "0.57203007", "text": "function BasicCard(front, back){\n this.front = front;\n this.back = back;\n this.cardInfo = function(front, back){\n console.log(\"\\n{front: '\" + this.front + \"',\" + \n \"\\nback: '\" + this.back + \"'},\");\n }\n}", "title": "" }, { "docid": "134a721fc1007539879e546e6906c550", "score": "0.5718661", "text": "displayPlayerChips() {\r\n utilFunctions.documents[utilFunctions.players.indexOf(this)].playerMoneyEl.textContent = `${this.name} has $${this.chips} chips available`\r\n }", "title": "" } ]
109c529996977f7f8eb79cf4fa886907
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
[ { "docid": "95ce5af6631cbc450f5ed0f00b4725e3", "score": "0.0", "text": "function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }", "title": "" } ]
[ { "docid": "8c0b14d2801e8ce4149b70875da26280", "score": "0.7179153", "text": "function getPropType(propValue) { // 392\n var propType = typeof propValue; // 393\n if (Array.isArray(propValue)) { // 394\n return 'array'; // 395\n } // 396\n if (propValue instanceof RegExp) { // 397\n // Old webkits (at least until Android 4.0) return 'function' rather than // 398\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // 399\n // passes PropTypes.object. // 400\n return 'object'; // 401\n } // 402\n if (isSymbol(propType, propValue)) { // 403\n return 'symbol'; // 404\n } // 405\n return propType; // 406\n} // 407", "title": "" }, { "docid": "23e4c816dd3b18f3cfb48dc32bd8ed6a", "score": "0.7138065", "text": "function getPropType(propValue) { // 479\n var propType = typeof propValue; // 480\n if (Array.isArray(propValue)) { // 481\n return 'array'; // 482\n } // 483\n if (propValue instanceof RegExp) { // 484\n // Old webkits (at least until Android 4.0) return 'function' rather than // 485\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // 486\n // passes PropTypes.object. // 487\n return 'object'; // 488\n } // 489\n if (isSymbol(propType, propValue)) { // 490\n return 'symbol'; // 491\n } // 492\n return propType; // 493\n } // 494", "title": "" }, { "docid": "19e1c387ca254274d900b30cf69a07cf", "score": "0.69010895", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "19e1c387ca254274d900b30cf69a07cf", "score": "0.69010895", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.68783313", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "eb92f819b6233fabb9e9dbb84890a272", "score": "0.6873306", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n return propType;\n }", "title": "" }, { "docid": "f979c1e204a3e7accc60d583ecfbf378", "score": "0.6854933", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "9dec1fe7de6a6f2436efd00713d97564", "score": "0.6845094", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n return propType;\n}", "title": "" }, { "docid": "57ed907680ef73f38b43a333667434aa", "score": "0.68398035", "text": "function getPropType(propValue) {\n var propType = typeof propValue\n if (Array.isArray(propValue)) {\n return 'array'\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object'\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol'\n }\n return propType\n }", "title": "" }, { "docid": "900c7f44e7a82704ea55f6a2cdd906cf", "score": "0.68397087", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "title": "" }, { "docid": "18757c894a27fb88ec9827998af6a204", "score": "0.6837768", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "title": "" }, { "docid": "cc0a7a2086a64477e263fcccfdeb8cc4", "score": "0.6836981", "text": "function getPropType(propValue) {\n var propType = typeof propValue\n if (Array.isArray(propValue)) {\n return 'array'\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object'\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol'\n }\n return propType\n }", "title": "" }, { "docid": "dcae62a0b768bfa17561e03d7779b0e4", "score": "0.68266666", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "84dd3e42061414632552daf4014564aa", "score": "0.68260926", "text": "function getPropType(propValue) {\n\t\t\t var propType = typeof propValue;\n\t\t\t if (Array.isArray(propValue)) {\n\t\t\t return 'array';\n\t\t\t }\n\t\t\t if (propValue instanceof RegExp) {\n\t\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t\t // passes PropTypes.object.\n\t\t\t return 'object';\n\t\t\t }\n\t\t\t if (isSymbol(propType, propValue)) {\n\t\t\t return 'symbol';\n\t\t\t }\n\t\t\t return propType;\n\t\t\t }", "title": "" }, { "docid": "d1cee4a495131d7a145c6856914fdb49", "score": "0.6819408", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68153584", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68153584", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" } ]
f6e92ec6ea5aae7a171e1b7f06c40f41
functions to handle button clicks.
[ { "docid": "be36233247ea415eb3f1a4c0c3c69eba", "score": "0.0", "text": "function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}", "title": "" } ]
[ { "docid": "89f0b366c60e0a2b51a1d6f90df622da", "score": "0.77276444", "text": "handleButton() {}", "title": "" }, { "docid": "5e12254edf7de1452b94dfe219ff3795", "score": "0.7657491", "text": "_buttonClickHandler() { }", "title": "" }, { "docid": "635a0c0e93398600323fe308615e9ec4", "score": "0.746948", "text": "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "title": "" }, { "docid": "1f47b091e89fcfe27c334cb3cfd6ca1f", "score": "0.7430268", "text": "handleClick() {}", "title": "" }, { "docid": "1a43d0d60d621222d01eb1aee5277ddc", "score": "0.7379523", "text": "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "title": "" }, { "docid": "1bef7f89bf81203c81e684665c71d4cd", "score": "0.72783524", "text": "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "title": "" }, { "docid": "44c510106a70123cc86bc9d1fcc8b371", "score": "0.7244731", "text": "handleClick( event ){ }", "title": "" }, { "docid": "a9fd4d9048e5e925cd48b52190c7a622", "score": "0.72319996", "text": "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "title": "" }, { "docid": "499360a4a041bfef57457958754cb129", "score": "0.7219825", "text": "function handleBtnClick(event) {\n handleEvent(event);\n}", "title": "" }, { "docid": "d9c8641d15cd2a0a722fdd25dc7afae7", "score": "0.721604", "text": "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "title": "" }, { "docid": "33ced31b1fc687135766a6dd71051928", "score": "0.7203905", "text": "function buttonClickListener(event) {\n var element = event.target;\n\n // Pop up and alert to say which button was pressed.\n \t/*if (element.type && element.type === \"button\") {\n \t\talert(\"You clicked the \" + element.id + \" button with value \" + element.value);\n \t}\n\t*/\n\tif(element.value==3)\n\t{\n\t\t\n\t\tdoMandala();\n\t}\n\telse if(element.value==4)\n\t{\n\t\t\n\t\tdoPolygon();\n\t}\n\telse if(element.value==8)\n\t{\n\t\t\n\t\tdoOctagon();\n\t}\n \t //Call the generic event logging function\n \tlogDrawings( event );\n}", "title": "" }, { "docid": "26930060b77ecc8dfc40d20a8ea05d33", "score": "0.71852344", "text": "function clickHandler() {\n console.log(\"Button 2 Pressed\");\n }", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7162041", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7162041", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "69ca728435b4fc8b38d2ae3f6ae2ed27", "score": "0.7071674", "text": "function handleClick(event)\n{\n}", "title": "" }, { "docid": "25c0477f3eb1e2d657599efae10fb88f", "score": "0.70286983", "text": "handleJDotterClick() {}", "title": "" }, { "docid": "2d969044556fedae187f428e8d2f6af7", "score": "0.7019346", "text": "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateCourse\":\n onCreateCourse();\n break;\n case \"btnModifyCourse\":\n onModifyCourse();\n break;\n case \"btnDeleteCourse\":\n onDeleteCourse();\n break;\n case \"btnRefreshCourses\":\n onRefreshCourse();\n break;\n }\n }", "title": "" }, { "docid": "902f93d05e573c534c228deaa30aec24", "score": "0.6984762", "text": "handleButtonClick(){\n\t\tconsole.log(\"handleButtonClick\");\n\n\t\teventsActions.createEvent(this.state.event);\n\t}", "title": "" }, { "docid": "a58bc22c5939ccafb02bb9aa9ccd97b0", "score": "0.6979498", "text": "function handleButtons(event) {\r\n // the button pressed in found in the click event under the value of event.target.dataset.value\r\n // using the data attribute included for this purpose in the HTML\r\n let buttonPressed = event.target.dataset.value;\r\n\r\n // trigger different functions based on the button pressed\r\n if(buttonPressed == \"ec\") {\r\n clearMainDisplay();\r\n }\r\n else if(buttonPressed == \"ac\") {\r\n clearMainDisplay(); \r\n clearChainDisplay();\r\n }\r\n else if(regexDigits.test(buttonPressed)) {\r\n displayDigit(buttonPressed);\r\n }\r\n else if(buttonPressed == \".\") {\r\n displayDecimalPoint();\r\n }\r\n else if(regexOperators.test(buttonPressed)) {\r\n displayOperator(buttonPressed);\r\n } \r\n else if(buttonPressed == \"=\") {\r\n displayResult();\r\n }\r\n else {\r\n fourOhFour();\r\n }\r\n}", "title": "" }, { "docid": "59d6a0b063a8bbd2320a54c232f788fb", "score": "0.6977986", "text": "function handleClick()\n\t{\n\t\tvar count = buttons.length,\n\t\t clicked = window.event.srcElement,\n\t\t form = clicked.form;\n\t\t \n\t\t// Disable all the buttons\n\t\tfor (var i = 0; i < count; i++)\n\t\t\tbuttons[i].disabled = true;\n\t\t\t\n\t\t// Set the hidden field to have the details of the clicked button\n\t\tvalueEl.type = 'hidden';\n\t\tvalueEl.name = clicked.name;\n\t\tvalueEl.value = clicked.attributes.getNamedItem('value').nodeValue;\n\t\t// Insert it into the form containing the clicked button\n\t\tform.appendChild(valueEl);\n\t\n\t\tform.submit();\t\n\t\t\n\t\t// Re-enable all the buttons after the form is submitted\n\t\tsetTimeout(function()\n\t\t{\n\t\t\tfor (var i = 0; i < count; i++)\n\t\t\t\tbuttons[i].disabled = false;\n\t\t}, 50);\n\t}", "title": "" }, { "docid": "e0f9acfe73c57f0b7b175ba6c34a29d9", "score": "0.69559383", "text": "clickHandler(e) {\n // Only activate if there is a buttonHandler\n if (this.buttonHandler !== false) {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }\n }", "title": "" }, { "docid": "55c39d1399bde7c2df54e1fe53b91c75", "score": "0.6926824", "text": "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "title": "" }, { "docid": "9d86ed7b48ebfe5f64ba43cfb1482d42", "score": "0.6892882", "text": "menuButtonClicked() {}", "title": "" }, { "docid": "0b7f4268fb6af1432fcf54fc6426699a", "score": "0.68799484", "text": "function clickBtn(ev){\r\n\r\n //Brightspace ref: week 6\r\n let clickedButton = ev.target;\r\n\r\n let btnsArray=[\r\n ctrlBtns[0],\r\n ctrlBtns[1],\r\n ctrlBtns[2],\r\n ];\r\n\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\r\n let index = btnsArray.indexOf(clickedButton);\r\n p(index);\r\n\r\n // /MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n p(clickedButton.id);\r\n //handle moving id-active to the currently clicked button\r\n //remove currently present id 'active'\r\n for(let i=0; i < ctrlBtns.length ; i++){\r\n if(ctrlBtns[i].id){\r\n //MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute\r\n ctrlBtns[i].removeAttribute('id')\r\n }\r\n }\r\n //assign id=\"active\" to currently clicked button\r\n clickedButton.id=\"active\";\r\n //Load corresponding data into the container div\r\n cntnr.innerHTML = `<h2>${pages[index].heading}</h2> \r\n <img src=\"${pages[index].img}\" alt=\"${pages[index].alt}\">\r\n <p>${pages[index].bodyText}</p>\r\n `;\r\n\r\n }", "title": "" }, { "docid": "d63f4377076f7159f3c19f11da687c8d", "score": "0.6874791", "text": "function buttonClick(event){\n //Conditional to limit click triggering to the buttons only\n if(event.target.tagName != \"BUTTON\"){\n return\n }\n //Conditional determining the behavior when the correct answer is selected\n else if (event.target.id === \"a\"){\n colorButtons();\n score++;\n // localStorage.setItem(\"score\", score);\n clearDelay()\n }\n //Conditional determining the behavior when the wrong answer is selected\n else if(event.target.id === \"f\"){\n colorButtons();\n score--; \n // localStorage.setItem(\"score\", score);\n secondsLeft -= 10;\n clearDelay();\n }\n}", "title": "" }, { "docid": "bb10199acfbdc45c4b1d7261c8ed2773", "score": "0.68730366", "text": "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "4dbcc42635d238123a6cb7967a350cea", "score": "0.6862656", "text": "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "title": "" }, { "docid": "e1844779c8cd744e6d03645abdac62d1", "score": "0.6824218", "text": "function buttonHandler(event) {\n event.preventDefault();\n if (event.target.id == \"post-btn\") {\n show();\n } else if (event.target.id == \"submit-btn\") {\n submit(event);\n } else if (event.target.id == \"cancel-btn\") {\n cancel(event);\n } else if (\n String(event.target.id).substring(0, 4) == \"edit\" &&\n event.target.tagName == \"BUTTON\"\n ) {\n editPost(event);\n } else if (event.target.id.substring(0, 6) == \"delete\") {\n deletePost(event);\n }\n}", "title": "" }, { "docid": "3892508179700c220e27e1f3c93cfda7", "score": "0.6809502", "text": "clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }", "title": "" }, { "docid": "5925f32b886089e7a53c59f487b83a3d", "score": "0.6780341", "text": "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateStudent\":\n onCreateStudent();\n break;\n case \"btnModifyStudent\":\n onModifyStudent();\n break;\n case \"btnDeleteStudent\":\n onDeleteStudent();\n break;\n case \"btnRefreshStudents\":\n onUpdateStudent();\n break;\n }\n }", "title": "" }, { "docid": "2dfb6cfde53bbe5237f14c125bfecf17", "score": "0.677667", "text": "function buttonsClick(e) {\n var target = e.target;\n while (target.id != \"story_content\") {\n switch (target.className) {\n case \"top\":\n moveBlockUp(target);\n return;\n case \"bottom\":\n moveBlockDown(target);\n return;\n case \"delete\":\n deleteBlock(target);\n return;\n case \"addmarker\":\n setactiveMarker(target);\n return;\n case \"addmarkerArtifact\":\n setactiveMarker(target);\n return;\n case \"removemarker\":\n removeMarker(target);\n return;\n case \"image_story gallery\":\n galleryChangePicture(target);\n return;\n case \"block_story\":\n editBlock(target);\n return;\n }\n target = target.parentNode;\n }\n}", "title": "" }, { "docid": "2872f41e745b74e7b6b24b7768d5c9ba", "score": "0.67589873", "text": "function handleClick(){\n console.log(\"clicked\");\n}", "title": "" }, { "docid": "52d12762a2b3a8e5959e92be33988c93", "score": "0.67582816", "text": "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "title": "" }, { "docid": "18681845ca3666e7d4c38c6d54a4a90d", "score": "0.674921", "text": "onClick() {\n }", "title": "" }, { "docid": "4bacd7ce2614a880cbb9545edc75f9f7", "score": "0.6741057", "text": "_evtClick(event) { }", "title": "" }, { "docid": "45a6601f03db978f5e7f19c0ab9e8f2d", "score": "0.6739648", "text": "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "title": "" }, { "docid": "71ff178e2f5fde179ceb8e3c17a19376", "score": "0.670728", "text": "buttonTwoClick(evt) {\n alert(\"Button Two Clicked\");\n }", "title": "" }, { "docid": "20701449af5aa71df871f2557a55d1ac", "score": "0.6698263", "text": "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "title": "" }, { "docid": "2fc4311f76e2abd242fbaba3fd76cb8d", "score": "0.6697176", "text": "function clickHandle( event ) {\n\t\tvar tagName = event.target.tagName.toLowerCase();\n\t\t\n\t\tif ( tagName !== 'button' || window.isGiveUp ) {\n\t\t\treturn;\n\t\t}\n\t\t// console.log( window.isGiveUp )\n\t\tvar id = event.target.id;\n\t\tvar obj = {\n\t\t\tcards : window.myCards\n\t\t};\n\n\t\tswitch( id ) {\n\t\t\tcase 'giveUp':\n\t\t\t\tsend( socket, 'giveUp', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'double':\n\t\t\t\tsend( socket, 'double', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'compare':\n\t\t\t\twindow.isClickCompare = true;\n\t\t\t\tbreak;\n\t\t\tcase 'goOn':\n\t\t\t\tsend( socket, 'goOn', obj );\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "title": "" }, { "docid": "33bed9ed4d62984cf2178c63b77205a0", "score": "0.66848415", "text": "buttonHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet conditions = this.props.hey.conditions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst action = this.props.action;\n\t\tconst increment = this.props.increment;\n\t\tconst hide = this.props.hideState;\n\t\tsendButtonHandler(items,conditions,counter,action,increment,hide);\n\t}", "title": "" }, { "docid": "8782e6d164419b6942699f6be81f215a", "score": "0.66811275", "text": "clickOnButton() {\n if (!this._disabled) {\n this.cancelBlur();\n this.focusOnButton();\n\n if (this._triggers === 'click') {\n this.toggleMenuVisibility();\n }\n }\n }", "title": "" }, { "docid": "591b805b48a47b3356d35033e6816933", "score": "0.66758525", "text": "function actionButton() {\n\t\t\tif ($('#status').hasClass('play')) {\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\t// capture screenshot\n\t\t\t\t\tvar xml = capture.captureXml();\n\n\t\t\t\t\t// log screenshot data to database\n\t\t\t\t\tdbService.saveProgram(xml);\n\n\t\t\t\t\t// capture blockly and run generated code\n\t\t\t\t\tvar code = Blockly.JavaScript.workspaceToCode(vm.workspace);\n\t\t\t\t\teval(code);\n\t\t\t\t} else {\n\t\t\t\t\t// capture screenshot and save to database\n\t\t\t\t\tcapture.capturePng('.program-inner');\n\n\t\t\t\t\t// convert program in to list of instructions\n\t\t\t\t\tvar program = [];\n\n\t\t\t\t\tfor (var i = 0; i < vm.program.length; i++) {\n\t\t\t\t\t\tvar ins = vm.program[i];\n\t\t\t\t\t\tprogram.push(ins.name);\n\t\t\t\t\t}\n\n\t\t\t\t\tdbService.saveProgram(program);\n\t\t\t\t}\n\n\t\t\t\t// run program\n\t\t\t\trun();\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('play');\n\n\t\t\t} else if ($('#status').hasClass('stop')) {\n\n\t\t\t\t// stop program\n\t\t\t\tstate.current = state.STOPPED;\n\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\tvm.program.length = 0;\n\t\t\t\t}\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('stop');\n\n\t\t\t} else if ($('#status').hasClass('rewind')) {\n\t\t\t\trewind();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cc24fa9949842796a913b903e4bb249c", "score": "0.66664493", "text": "function __fBtnClick(event) {\n\t\tvar jBuyer = this.el.data('btnData');\n\t\t/**\n\t\t * 0: Push Info\n\t\t * 1: Contact Now\n\t\t * 2: View Detail\n\t\t */\n\t\tvar _data;\n\t\tswitch (parseInt(jBuyer.action, 10)) {\n\t\t\tcase 0:\n\t\t\t\t_data = {\n\t\t\t\t\tbuyerId: jBuyer.buyerId,\n\t\t\t\t\tbuyerName: jBuyer.buyerName\n\t\t\t\t};\n\t\t\t\tCan.util.canInterface('pushInfo', [_data]);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tvar _id = parseInt(jBuyer.buyerId, 10);\n\t\t\t\t//if NFCid then\n\t\t\t\tif (isNaN(_id)) {\n\t\t\t\t\tbuyerView(jBuyer.buyerId);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t_data = {\n\t\t\t\t\t\taddress: {\n\t\t\t\t\t\t\tvalue: jBuyer.buyerId,\n\t\t\t\t\t\t\ttext: jBuyer.buyerName\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tCan.util.canInterface('writeEmail', [Can.msg.MESSAGE_WINDOW.WRITE_TIT, _data]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tCan.util.canInterface('readEmail', [\n\t\t\t\t\t{messageId: jBuyer.eventId},\n\t\t\t\t\ttrue\n\t\t\t\t]);\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tCan.util.canInterface('whoSay');\n\t\t}\n\t}", "title": "" }, { "docid": "7d83561f65198145ada16f59134b9f6a", "score": "0.66423863", "text": "function button2Click(button) {\r\n\t//debugOut(\"button 2 click, button=\"+button);\r\n}", "title": "" }, { "docid": "51c831c3251f7c76ae41efda6eca65bd", "score": "0.6618322", "text": "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "4b38103ee40a26433a04880b99beddeb", "score": "0.66049236", "text": "function buttons() {\n\t$('#cardForm').on('click', '#newGame', function() {\n\t\tevent.preventDefault();\n\t\tgetCard();\n\t\t$('#newGame').hide();\n $('#newCard').show();\n $('#prevCard').show();\n $('#btnRules').show();\n $('#answerBtn').show();\n\t\t$('#rules').hide();\n\t});\n\n\t$('#cardForm').on('click', '#newCard', function() {\n\t\tevent.preventDefault();\n\t\tflipped=false;\n\t\tgetCard();\n });\n \n $('#cardForm').on('click', '#prevCard', function() {\n\t\tevent.preventDefault();\n\t\tflipped=false;\n\t\tgetPrevCard();\n });\n \n $('#cardForm').on('click', '#answerBtn', function() {\n event.preventDefault();\n\t\tdisplayAnswer();\n\t});\n\n\t$('#cardForm').on('click', '#btnRules', function() {\n\t\tevent.preventDefault();\n\t\t$('#rules').toggle();\n\t});\n}", "title": "" }, { "docid": "a0f9dfd8506db392cdc97490603c8997", "score": "0.6603437", "text": "function buttonClick(){\r\n\r\n var buttonTriggered = this.innerHTML;\r\n clickPress(buttonTriggered);\r\n buttonAnimation(buttonTriggered);\r\n\r\n}", "title": "" }, { "docid": "1d5a19e48b408323bc9d00e2860c14aa", "score": "0.6601059", "text": "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "title": "" }, { "docid": "9ff7f67900fc9c11f8301a2897d3bfd7", "score": "0.65951073", "text": "function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.disabled = true;\nevent.target.classList.add (\"chosen\")\n// if (event.target.tagName === \"BUTTON\")\napp.handleInteraction(event.target.innerHTML.toLowerCase());\n}", "title": "" }, { "docid": "39e37edc03e266bab468b6f7e3c7da73", "score": "0.65699273", "text": "handleInteraction() {\r\n document.querySelector('button').onclick=function() {\r\n alert('clicked');\r\n }\r\n }", "title": "" }, { "docid": "916da7fc0474182123337b54a798d11d", "score": "0.65513057", "text": "function addButtonEvent() {\n\t\t\tbtnList.begin.click(API.begin);\n\t\t\tbtnList.fastBackward.click(function () {API.backward(FAST_STEP_NUM); });\n\t\t\tbtnList.backward.click(function () {API.backward(1); });\n\t\t\tbtnList.forward.click(function () {API.forward(1); });\n\t\t\tbtnList.fastForward.click(function () {API.forward(FAST_STEP_NUM); });\n\t\t\tbtnList.end.click(API.end);\n\t\t\tbtnList.flag.click(API.flag);\n\t\t\tbtnList.auto.click(API.setAuto);\n\t\t}", "title": "" }, { "docid": "5d9f82c1ea887ce2f11b8a7c1d57a604", "score": "0.6532256", "text": "function getButtonClicked(e) {\n if (e.target.nodeName === \"BUTTON\") {\n categoryName = e.target.getAttribute(\"id\");\n loadQuestionsRandom(categoryName);\n showSection(sectionQuestion);\n setTimeout(() => {\n $(\"#category\").text(categoryName);\n loadQuiz();\n }, 500);\n }\n }", "title": "" }, { "docid": "4e52e6dbf0e3ce912d772190506abdcc", "score": "0.6531343", "text": "function button1Click(button) {\r\n\t//debugOut(\"button 1 click, button=\"+button);\r\n}", "title": "" }, { "docid": "3460061a51695d64947be9d83ff2b966", "score": "0.65299463", "text": "function buttonActions() {\n\t\t$(\".button\").on(\"click\", function() {\n\t\t\tvar routeGiven = $(this).attr(\"id\");\n\t\t\tif ($(this).hasClass(\"clicked\")) {\n\t\t\t\t$(this).removeClass(\"clicked\");\n\t\t\t\troutes[routeGiven][\"vRefresh\"] = false;\n\t\t\t\t$(\".route_\" + routeGiven + \",\" + \".path_\" + routeGiven).css({\n\t\t\t\t\t\"visibility\": \"hidden\"\n\t\t\t\t});\n\t\t\t\t$(\"#\"+routeGiven).css({\n\t\t\t\t\t\"background-color\": \"#fff\",\n\t\t\t\t\t\"color\": \"#000\"\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$(this).addClass(\"clicked\");\n\t\t\t\troutes[routeGiven][\"vRefresh\"] = true;\n\t\t\t\t$(\".route_\" + routeGiven + \",\" + \".path_\" + routeGiven).css({\n\t\t\t\t\t\"visibility\": \"visible\"\n\t\t\t\t});\n\t\t\t\t$(\"#\"+routeGiven).css({\n\t\t\t\t\t\"background-color\": \"#\" + routes[routeGiven][\"color\"],\n\t\t\t\t\t\"color\": \"#fff\"\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}", "title": "" }, { "docid": "861ec1f62a25290fc5fe2b6bc3c22ba9", "score": "0.6526829", "text": "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "title": "" }, { "docid": "31991affc40a9e7d0c27ce8b26f47748", "score": "0.6526276", "text": "function keyboardButtonClick(e)\n{\n\t//find the parent btn\n\te.stopPropagation();\n\te.preventDefault();\n\tvar btn = e.target, step = 0;\n\n\twhile(!btn.dataset.label && step < 5){\n\t\tstep++;\n\t\tbtn = btn.parentNode;\n\t}\n\n\tvar label, code, which;\n\n\twhich\t= btn.dataset.shift && SHIFT_STATE ? 'shift' : 'label';\n\tlabel\t= btn.dataset[which];\n\tcode\t= btn.dataset[which+'_code'] || label;\n\n\tconsole.log('btn: ' + label);\n\n\t//Check predefined function\n\tif( KEYBOARD_FUNCTION [label] )\n\t{\n\t\tKEYBOARD_FUNCTION [label].apply(btn);\n\t}else{\n\t\t//After keypress\n\n\t\tWS.send('K' + code);\n\t\tif( SHIFT_STATE == 1)\n\t\t{\n\t\t\tkeyboardSetShiftButton(0);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bb5f7e6b64ce9f2ae2e15c65278b4553", "score": "0.6519302", "text": "function onClick() {\n}", "title": "" }, { "docid": "b65b9d31361464245c809cb8ff916072", "score": "0.6517953", "text": "function setupButtons(){\n //speak(quiz[currentquestion]['question'])\n\t\t$('.choice').on('click', function(){\n\t\tsynth.cancel();\n is_on = 0;\n\t\tpicked = $(this).attr('data-index');\n\t\tspeak(quiz[currentquestion]['choices'][picked], LINGUA_RISPOSTA);\n\t\tshow_button();\n\t\t// risposte in francese\n\t\t$('.choice').removeAttr('style').off('mouseout mouseover');\n\t\t$(this).css({'font-weight':'900', 'border-color':'#51a351', 'color':'#51a351', 'background' : 'gold'});\n\t\tif(submt){\n\t\t\t\tsubmt=false;\n\t\t\t\t$('#submitbutton').css({'color':'#fff','cursor':'pointer'}).on('click', function(){\n\t\t\t\t$('.choice').off('click');\n\t\t\t\t$(this).off('click');\n\t\t\t\tprocessQuestion(picked);\n //\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "897277d0b54fa2b6e5e6e801dff951eb", "score": "0.65175617", "text": "function delegateButtonClicks(evt, that, theSenderName, locObj) {\n\n if (!locObj.theTarget.disabled) {\n // console.log(\"delegateButtonClicks> evt: \" + evt + \" that: \" + that + \" theSenderName: \" + theSenderName + \"locObj.theTarget : \" + locObj.theTarget + \"locObj.theTargetType: \" + locObj.theTargetType);\n\n //var theSource = locObj.theTargetName;\n // The Image of Button\n //var str = locObj.theTarget.firstChild;\n\n switch (theSenderName) {\n case \"previous\":\n case \"next\":\n toggleSequence(theSenderName);\n break;\n case \"notesb\":\n handleNotes(theSenderName);\n break;\n case \"goBack\" :\n UpALevel();\n break;\n case \"audiopl\":\n case \"audiorew\":\n case \"audiofor\":\n handleAudio(theSenderName);\n break;\n case \"tapescr\":\n tapescriptShow(theSenderName);\n break;\n case \"checkB\" :\n case \"showB\" :\n case \"resetB\" :\n case \"showtext\" :\n case \"showjust\" :\n case \"showgrammar\" :\n case \"showLF\" :\n case \"showUE\" :\n case \"showCU\" :\n case \"videoB\" :\n case \"showaudio\" :\n assignFooterExtraTextButtons(locObj);\n break;\n\t\t\tcase \"showgrade\" :\n\t\t\t\t$(\"#grade\").toggle();\n\t\t\t\tbreak;\n default :\n }\n }\n}", "title": "" }, { "docid": "9f92db47ae098be2553feff498055064", "score": "0.6515571", "text": "function handleButtonClick(){\n // Don't allow clicks on already filled buttons\n if(this.hasAttribute('readonly')) return\n // Update the button's attributes\n updateButtonAttributes(this)\n // Reset the animation classes for every button\n for (let el of buttons) el.classList.remove('animate', 'row', 'column')\n // Create query selectors needed to check if corresponding rows, columns\n // and diagonals are entirely filled\n let setQs = buildQuerySelectors(this)\n // Calculate and fill the value with the query selectors\n fillSetValue(setQs)\n // Keep track of the amount of rolls\n roll++\n // Check if the game is finished\n if (roll == 25) finishGame()\n // If not finished, roll the dice again\n else rollDice()\n}", "title": "" }, { "docid": "247fd817f753f5fd385ad3bd09941c4a", "score": "0.65044194", "text": "function button_click(e) {\n e.preventDefault();\n var $this = e.target,\n name = $this.ancestor('.plugin.well').getAttribute('data-key'), // Get addon name.\n action = $this.getAttribute('data-action');\n if ($this.hasClass('disabled')) {\n return;\n }\n Y.log($this);\n // Get the addon object key to add to action list.\n\n Y.log('Button '+action+' started for '+name);\n // Add addon to actions array.\n if (action in M.local_rlsiteadmin.data_actions) {\n M.local_rlsiteadmin.data_actions[action][name] = name;\n Y.log(M.local_rlsiteadmin.data_actions);\n } else {\n Y.log('Unknown action requested: '+action);\n }\n\n // Disable button for this plugin.\n $this.addClass('disabled');\n M.local_rlsiteadmin.action_dropdown_update();\n }", "title": "" }, { "docid": "afd466638eb8f8ab6d62d4ecfe8d42a1", "score": "0.6500745", "text": "function handleClick() {\n $('button').click(function(event){\n emptyAbilities();\n renderAbilities(event.currentTarget.innerHTML);\n showAbilities();\n });\n }", "title": "" }, { "docid": "ebe4a39e894893506a31a5cfa969aba4", "score": "0.6500732", "text": "click(x, y, _isLeftButton) {}", "title": "" }, { "docid": "bc3322973617b8202c0e0d105805c1f5", "score": "0.6488438", "text": "function onSelectButtonClick() {\n //alert( 'onSelectButtonClick' );\n }", "title": "" }, { "docid": "f2ee3d7ad74479fa05c0bff8a154f8f5", "score": "0.6487626", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppMsdcLivTrackDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "3668ab4973e2bf58b3ecf58994667756", "score": "0.6483585", "text": "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "title": "" }, { "docid": "deb9d508e0a4e816991c159b98b4786a", "score": "0.64824736", "text": "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "title": "" }, { "docid": "6eaaf97699507a81211c488dd8b07589", "score": "0.64787096", "text": "function attachButtonEvents() {\n $(\"#joinBtn\").click(function (event) {\n openJoinScreen();\n });\n $(\"#joinCancelBtn\").click(function (event) {\n openHomeScreen($(\"#joinGameScreen\"));\n });\n $(\"#codeForm\").submit(function (event) {\n event.preventDefault();\n joinGame();\n });\n $(\"#leaveGameBtn\").click(function (event) {\n leaveGame();\n });\n $(\"#chatForm\").submit(function (event) {\n event.preventDefault();\n sendMessage();\n });\n}", "title": "" }, { "docid": "eb92d92a522151921284597d4675ece6", "score": "0.6467681", "text": "function ButtonClick(event) {\n // store which button has been clicked in currentButton\n //let currentButton = event.currentTarget; <- one way of getting a ref to the button\n let currentButton = event.currentTarget;\n switch (currentButton.getAttribute(\"id\")) {\n case \"HideButton\":\n FirstProjectImage.style.display = \"none\";\n break;\n case \"HalfSizeButton\":\n FirstProjectImage.style.maxWidth = \"50%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ThreeQuarterSizeButton\":\n FirstProjectImage.style.maxWidth = \"75%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ShowButton\":\n FirstProjectImage.style.display = \"block\";\n FirstProjectImage.style.maxWidth = \"100%\";\n break;\n }\n }", "title": "" }, { "docid": "bf39c2b5ece39389dce64af482634c9d", "score": "0.6464331", "text": "click() { }", "title": "" }, { "docid": "764199a7af41f9b603b8270286b48a65", "score": "0.6460269", "text": "unsignedButtonClicked()\n\t{\n\t\tthis.db.set( 'letterType', 3 );\n\t\treturn this.router.navigateToRoute( 'voting-form' );\n\t}", "title": "" }, { "docid": "b613274fc4c0ed11993500c39be914fd", "score": "0.64578485", "text": "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"cppcmf.js\\n\";\n\t\tinfo += \"Charged particle in perpendicular \";\n\t\tinfo += \"constant magnetic field\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "6eae3e67e79bacf119a16c5ab2e76116", "score": "0.64564365", "text": "click(btn) {\r\n\r\n canvas.addEventListener(\"click\",\r\n function buttonClick(e) {\r\n\r\n let x = fix_X(e.clientX);\r\n let y = fix_Y(e.clientY);\r\n\r\n // Check for collision.\r\n if (x >= btn.x - btn.w / 2 & x <= btn.x + btn.w / 2) {\r\n if (y >= btn.y - btn.h / 2 & y <= btn.y + btn.h / 2) {\r\n btn.click_extra();\r\n btn.action();\r\n }\r\n\r\n }\r\n });\r\n }", "title": "" }, { "docid": "3995af258604451c94532efadcd45bc7", "score": "0.645405", "text": "function onClick(event) {\n\t\t//console.log(event);\t\t\n\t\tvar target = event.target;\n\t\tif (target.classList.contains(\"ui-selector-indicator\")) {\n\t\t\t//console.log(\"Indicator clicked\");\n\t\t\tvar ItemClicked = event.srcElement.textContent;\n\t\t\tconsole.log(\"Item Clicked on home page was: \" + ItemClicked);\n\n\t\t\t//Handel home page click events\n\t\t\tif(ItemClicked == \"Switches\"){\n\t\t\t\ttau.changePage(\"switchesPage\");\n\t\t\t}else if(ItemClicked == \"Clear Database\"){\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t\t//This should be moved to it's own function.\n\t\t\t\tconsole.log(\"Clearing Database\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tAccess_Token = null;\n\t\t\t\tAccess_Url = null;\n\t\t\t\tswitches_DB = null;\n\t\t\t\talert(\"Database Cleared\");\n\t\t\t\t//Maybe we should exit here?\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t}else if(ItemClicked == \"Routines\"){\n\t\t\t\ttau.changePage(\"routinesPage\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "fe159419b379ecabdac6df05b87516ef", "score": "0.6450836", "text": "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"windpend.js\\n\";\n\t\tinfo += \"Wind blows a simple pendulum\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "9a4777112853592fb8740a9de669aca7", "score": "0.6449468", "text": "function onButton(){\n input();\n output();\n\n}", "title": "" }, { "docid": "bd5ef8c1f4abf215bf64614363400ba3", "score": "0.64454603", "text": "onInternalClick(event) {\n const me = this,\n bEvent = {\n event\n };\n\n if (me.toggleable) {\n // Clicking the pressed button in a toggle group should do nothing\n if (me.toggleGroup && me.pressed) {\n return;\n }\n\n me.toggle(!me.pressed);\n }\n /**\n * User clicked button\n * @event click\n * @property {Core.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n\n me.trigger('click', bEvent);\n /**\n * User performed the default action (clicked the button)\n * @event action\n * @property {Core.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n // A handler may have resulted in destruction.\n\n if (!me.isDestroyed) {\n me.trigger('action', bEvent);\n } // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onClick and onAction\n\n if (!this.href) {\n // stop the event since it has been handled\n event.preventDefault();\n event.stopPropagation();\n }\n }", "title": "" }, { "docid": "fe9418ce7702054901b49ef4a7ece0d0", "score": "0.6445335", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppIdecNavOprDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "c20ead0025c39228bdee7900078dbf93", "score": "0.64387393", "text": "function btnClick(e) {\n\t\n\t// Variables for storing mouse position on click\n\tvar mx = e.pageX,my = e.pageY; //-225 559\n\t//$(\"#isReadyPlayer\").append(\"ep:\"+e.pageX+\",mx:\"+mx+\",H:\"+H);\n\t// Click start button\n\tif( verifyClick(mx,my,startBtn) && usuario_id !== -1 ){\n\t\tplayerReady();\n\t\t//animloop();\n\t\t\n\t\t// Delete the start button after clicking it\n\t\tstartBtn = {};\n\t}\n\t\n\t// If the game is over, and the restart button is clicked\n\tif(over == 1) {\n\n\t\tif( verifyClick(mx,my,restartBtn) && usuario_id !== -1 ) {\n\t\t\tball.x = 20;\n\t\t\tball.y = 20;\n\t\t\tpoints = 0;\n\t\t\tball.vx = 4;\n\t\t\tball.vy = 8;\n\t\t\t//animloop();\n\t\t\t\n\t\t\tover = 0;\n\t\t\tplayerReady();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "41d8bdee9caec4061dd5f9ea0e2bc693", "score": "0.64336663", "text": "function bindButtons() {\n $('button', context).click(function() {\n switch(this.name) {\n case 'cancel':\n mainWindow.overlay.toggleWindow('export', false);\n break;\n\n case 'reset':\n mainWindow.resetSettings();\n break;\n\n case 'reselect':\n exportData.pickFile(function(filePath) {\n if (filePath) {\n exportData.filePath = filePath;\n mainWindow.overlay.toggleWindow('overlay', true);\n }\n });\n break;\n\n case 'export':\n exportData.saveData();\n break;\n\n case 'print':\n exportData.enqueueData();\n break;\n }\n });\n\n // Bind ESC key exit.\n // TODO: Build this off data attr global bind thing.\n $(context).keydown(function(e){\n if (e.keyCode === 27) { // Global escape key exit window\n $('button[name=cancel]', context).click();\n }\n });\n }", "title": "" }, { "docid": "0950df86c3b32af5216695b09a70ae6e", "score": "0.6426749", "text": "function buttonOkClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tconsole.log(\"button ok clicked!\");\r\n\t\tif(self.buttonOkCallback!=null){\r\n\t\t\tself.buttonOkCallback();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "9555ca5564d9d9289674fd403a914a74", "score": "0.6424807", "text": "function click_on() {\n console.log('called click function');\n}", "title": "" }, { "docid": "40b3285bfa6244c8790147b72ea38c34", "score": "0.64171153", "text": "function onClick(e) {\n }", "title": "" }, { "docid": "0ac44498176f27e714a9fa854ada2d7f", "score": "0.64020115", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppWzskShtDetailDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "cd6570ac88b775f76356e4bead17e771", "score": "0.63980824", "text": "function clickButton()\n {\n // Update requested value\n var btn = this ;\n var setval = \"\" ;\n if ( btn.toggle )\n {\n switch (btn.request)\n {\n case \"Off\": btn.request = \"On\" ; setval = \"F\" ; break ;\n case \"On\": btn.request = \"Off\" ; setval = \"N\" ; break ;\n }\n }\n logDebug(\"clickButton: \", btn, \n \", target: \", btn.target, \", request: \", btn.request) ;\n // Now proceed to set requested value\n if ( btn.target != null )\n {\n // Send update command, refresh selector state when done\n setButtonState(btn, \"Pending\") ;\n var def = doTimedXMLHttpRequest(btn.target+setval, 4.9) ;\n def.addBoth(pollNow) ;\n }\n else\n {\n logError(\"clickButton (no target)\") ;\n }\n return false ; // Suppresss any default onClick action\n }", "title": "" }, { "docid": "448d4f38930f983d5d429a8b28c5129f", "score": "0.6394175", "text": "function buttonClick(e) {\n\n var editor = this,\n buttonDiv = e.target,\n buttonName = $.data(buttonDiv, BUTTON_NAME),\n button = buttons[buttonName],\n popupName = button.popupName,\n popup = popups[popupName];\n\n // Check if disabled\n if (editor.disabled || $(buttonDiv).attr(DISABLED) === DISABLED)\n return;\n\n // Fire the buttonClick event\n var data = {\n editor: editor,\n button: buttonDiv,\n buttonName: buttonName,\n popup: popup,\n popupName: popupName,\n command: button.command,\n useCSS: editor.options.useCSS\n };\n\n if (button.buttonClick && button.buttonClick(e, data) === false)\n return false;\n\n // Toggle source\n if (buttonName === \"source\") {\n \n // Show the iframe\n if (sourceMode(editor)) {\n delete editor.range;\n editor.$area.hide();\n editor.$frame.show();\n buttonDiv.title = button.title;\n }\n\n // Show the textarea\n else {\n editor.$frame.hide();\n editor.$area.show();\n\t\t\t\teditor.$main.find(\".cleditorSizing\").hide();\n buttonDiv.title = \"リッチテキストに切り替え\";//\"Show Rich Text\";\n }\n\n }\n\n // Check for rich text mode\n else if (!sourceMode(editor)) {\n\n // Handle popups\n if (popupName) {\n var $popup = $(popup),\n\t\t\t\t\tframeDocument=editor.$frame.contents(),\n\t\t\t\t\tframeBody=editor.$frame.contents().find(\"body\");\n\n // URL\n if (popupName === \"url\") {\n\n // Check for selection before showing the link url popup\n if (buttonName === \"link\" && selectedText(editor) === \"\") {\n showMessage(editor, \"A selection is required when inserting a link.\", buttonDiv);\n return false;\n }\n\n // Wire up the submit button click event handler\n $popup.children(\":button\")\n .off(CLICK)\n .on(CLICK, function () {\n\n // Insert the image or link if a url was entered\n var $text = $popup.find(\":text\"),\n url = $.trim($text.val());\n if (url !== \"\")\n execCommand(editor, data.command, url, null, data.button);\n\n // Reset the text, hide the popup and set focus\n $text.val(\"http://\");\n hidePopups();\n focus(editor);\n\n });\n\n }\n\n // Paste as Text\n else if (popupName === \"pastetext\") {\n\n // Wire up the submit button click event handler\n $popup.children(\":button\")\n .off(CLICK)\n .on(CLICK, function () {\n\n // Insert the unformatted text replacing new lines with break tags\n var $textarea = $popup.find(\"textarea\"),\n text = $textarea.val().replace(/\\n/g, \"<br />&#10;\");\n if (text !== \"\")\n execCommand(editor, data.command, text, null, data.button);\n\n // Reset the text, hide the popup and set focus\n $textarea.val(\"\");\n hidePopups();\n focus(editor);\n\n });\n\n }\n\n\t\t\t\t//insert textbox\n\t\t\t\telse if(buttonName === \"textbox\"){\n\n\t\t\t\t\t// Wire up the submit button click event handler\n $popup.children(\"div\")\n .off(CLICK)\n .on(CLICK, function (e) {\n\t\t\t\t\t\t// Build the html\n\t\t\t\t\t\tvar scrTop=$(frameBody).scrollTop(),\n\t\t\t\t\t\t\tvalue = $(e.target).css(\"background-color\"),\n\t\t\t\t\t\t\thtml = \"<textarea style='position:\"+editor.options.position+\";top:\"+scrTop\n\t\t\t\t\t\t\t\t\t+\"px;left:0px;width:100px;height:20px;background-color:\"\n\t\t\t\t\t\t\t\t\t+value+\";'></textarea>&#10;\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Insert the html\n\t\t\t\t\t\tif (html)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\texecCommand(editor,data.command,html,null,data.button);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thidePopups();\n focus(editor);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//insert table\n\t\t\t\telse if(buttonName === \"table\")\n\t\t\t\t{\t\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\n\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\tcols = parseInt($text[0].value),\n\t\t\t\t\t\t\trows = parseInt($text[1].value);\n\n\t\t\t\t\t\t// Build the html\n\t\t\t\t\t\tvar html;\n\t\t\t\t\t\tif (cols > 0 && rows > 0) {\n\t\t\t\t\t\t\thtml=\"&#10;<table style='border-collapse:collapse;border:1px solid black;\"\n\t\t\t\t\t\t\t\t\t+\"background-color:white;position:\"+editor.options.position+\";top:0px;left:0px'>&#10;\";\n\t\t\t\t\t\t\tfor (y = 0; y < rows; y++) {\n\t\t\t\t\t\t\t\thtml += \"&#09;<tr>\";\n\t\t\t\t\t\t\t\tfor (x = 0; x < cols; x++)\n\t\t\t\t\t\t\t\t\thtml += \"<td style='border:1px solid black;min-width:30px;height:15px'></td>\";\n\t\t\t\t\t\t\t\thtml += \"</tr>&#10;\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += \"</table>&#10;<br />&#10;\";\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t// Insert the html\n\t\t\t\t\t\tif (html)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\texecCommand(editor,data.command,html,null,data.button);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Reset the text, hide the popup and set focus\n\t\t\t\t\t\t$text.val(\"4\");\n\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert rows and columns in table\n\t\t\t\telse if (buttonName === \"insertrowcol\")\n\t\t\t\t{\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\t// Get insert position\n\t\t\t\t\t\t\tvar $radi=$popup.find(\"input[name='insertFR']:checked\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\t\tcols = parseInt($text[0].value),\n\t\t\t\t\t\t\t\trows = parseInt($text[1].value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Click event\n\t\t\t\t\t\t\tif($(focusedObj).closest(\"table\").length==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar html;\n\t\t\t\t\t\t\t\t//insert columns part\n\t\t\t\t\t\t\t\tif(cols>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thtml=$(\"<td style='\"+$(focusedObj).attr(\"style\")+\";min-width:2em'></td>\")\n\t\t\t\t\t\t\t\t\t\t.css({\"border-top\":objStyle.top,\"border-bottom\":objStyle.bottom,\n\t\t\t\t\t\t\t\t\t\t\t\t\"border-left\":objStyle.left,\"border-right\":objStyle.right});\n\t\t\t\t\t\t\t\t\t//Get current column index\n\t\t\t\t\t\t\t\t\tvar c=parseInt($(focusedObj).closest(\"tr\").children().index($(focusedObj)));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//loop each tr\n\t\t\t\t\t\t\t\t\tvar targetTable=$(focusedObj).closest(\"table\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(targetTable).find(\"tr\").each(function(idx,elem)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($radi.val()===\"front\")\n\t\t\t\t\t\t\t\t\t\t{//front\n\t\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<cols;i++)\n\t\t\t\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$(elem).find(\"td:nth-child(\"+(1+c)+\")\").before(html[0].outerHTML);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{//rear\n\t\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<cols;i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$(elem).find(\"td:nth-child(\"+(1+c)+\")\").after(html[0].outeHTML);\n\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});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//insert rows part\n\t\t\t\t\t\t\t\tif(rows>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//Get current row\n\t\t\t\t\t\t\t\t\tvar thisTr=$(focusedObj).closest(\"tr\");\n\t\t\t\t\t\t\t\t\tvar r=parseInt($(thisTr).closest(\"table\").find(\"tr\").index());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//Get column number\n\t\t\t\t\t\t\t\t\tvar cs=$(thisTr).find(\"td\").length;\n\t\t\t\t\t\t\t\t\thtml=\"&#09;<tr style='\"+$(thisTr).attr(\"style\")+\"'>\";\n\t\t\t\t\t\t\t\t\t$(thisTr).find(\"td\").each(function(idx,elem)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\thtml+=$(\"<td style='\"+$(elem).attr(\"style\")+\";min-height:1em'></td>\")\n\t\t\t\t\t\t\t\t\t\t\t.css({\"border-top\":objStyle.top,\"border-bottom\":objStyle.bottom,\n\t\t\t\t\t\t\t\t\t\t\t\t\"border-left\":objStyle.left,\"border-right\":objStyle.right})[0].outerHTML;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\thtml+=\"</tr>&#10;\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($radi.val()===\"front\")\n\t\t\t\t\t\t\t\t\t{//front\n\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<rows;i++)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$(thisTr).before(html);\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\telse\n\t\t\t\t\t\t\t\t\t{//rear\n\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<rows;i++)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$(thisTr).after(html);\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\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\teditor.$frame.contents().off(CLICK);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reset the text\n\t\t\t\t\t\t\t$text.val(\"0\");\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//resize cell\n\t\t\t\telse if (buttonName === \"resizecell\")\n\t\t\t\t{\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\t\twid = parseInt($text[0].value),\n\t\t\t\t\t\t\t\thei = parseInt($text[1].value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(focusedObj).is(\"td\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//change width size\n\t\t\t\t\t\t\t\tif(wid>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"min-width\",wid+\"px\");\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//change height size\n\t\t\t\t\t\t\t\tif(hei>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"height\",hei+\"px\");\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\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}\n\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\teditor.$frame.contents().off(\"click\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reset the text\n\t\t\t\t\t\t\t$text.val(\"0\");\t\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//border style\n\t\t\t\telse if (buttonName === \"borderstyle\")\n\t\t\t\t{\n\t\t\t\t\tvar borderColor,bdColor,bdImage,\n\t\t\t\t\t\tcurrentStyle=$(focusedObj).attr(\"style\"),\n\t\t\t\t\t\tcbs = $popup.find(\".appobj\");\n\t\t\t\t\t\t\n\t\t\t\t\t$popup.find(\".colorpicker\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e){\n\n\t\t\t\t\t\tvar rgbColor=$(e.target).css(\"background-color\")!=\"transparent\" ?\n\t\t\t\t\t\t\t\t\t\t$(e.target).css(\"background-color\") : \"0,0,0,0\";\n\t\t\t\t\t\tborderColor=$popup.find(\".bordersample\").css(\"border-color\");\n\t\t\t\t\t\tvar rgb=rgbColor.replace(\"rgb(\",\"\").replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$popup.find(\".rgbaColor.r\").val(parseInt(rgb[0]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.g\").val(parseInt(rgb[1]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.b\").val(parseInt(rgb[2]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.a\").val(rgb.length!=3 ? 0 : 1 );\n\t\t\t\t\t\tbdColor=\"rgba(\"+rgb[0]+\",\"+rgb[1]+\",\"+rgb[2]+\",\"+ (rgb.length!=3 ? 0 : 1)+\")\";\n\t\n\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bdColor);\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\tvar cb = $(popup).find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//switch background color visibility by checkbox\n\t\t\t\t\t\tif($(cb[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",bdColor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\n\t\t\t\t\t//drag and drop\n\t\t\t\t\tdndImage(\".sampleimage\",focusedObj,popup,buttonName);//sampleimage\n\t\t\t\t\t\n\t\t\t\t\t//on change RGBA number\n\t\t\t\t\t$popup.find(\".rgbaColor\")\n\t\t\t\t\t\t.on(\"change input paste\", function (e) {\n\t\t\t\t\t\t\tbdColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()\n\t\t\t\t\t\t\t\t\t+\",\"+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bdColor);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",bdColor);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//on change Select tag\n\t\t\t\t\t$popup.find(\".border\")\n\t\t\t\t\t\t.on(\"change\",function(e){\n\t\t\t\t\t\t\t// Get the which positions are ON\n\t\t\t\t\t\t\tvar cb = $(popup).find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//color\n\t\t\t\t\t\t\tfor(var i=0;i<4;i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-style\",$(popup).find(\".border.Style\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-width\",$(popup).find(\".border.Width\").val());\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\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-style\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-width\",\"\");\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\t\n\t\t\t\t\t//on change Check Box \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change\",\"input[type=checkbox]\", function (e) {\n\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\tvar cb=$popup.find(\"input[type=checkbox]\");\n\n\t\t\t\t\t\t\t//remove all border (or initilize)\n\t\t\t\t\t\t\tif($(cb[4]).prop(\"checked\")==true && e.target==cb[4])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(cb).not(cb[4]).prop(\"checked\",false);\n\t\t\t\t\t\t\t\tif($(focusedObj).is(\"td\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border\",\"1px solid black\");\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\t$(focusedObj).css(\"border\",\"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(e.target!=cb[4] && $(e.target).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(cb[4]).prop(\"checked\",false);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//switch background color or image visibility by checkbox\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(var i=0;i<4;i++){\n\t\t\t\t\t\t\t\t//color\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-color\",bdColor);\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\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-color\",\"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//image\n\t\t\t\t\t\t\t\tif($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\"url('\"+imageObj+\"')\");\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\t$(focusedObj).css(\"border-image-source\",\"\");\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\t//on change check Box of image type \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\"input[type=radio],.imageOptions,.appobj\", function (e) {\n\t\t\t\t\t\t\tif($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//check selection with URL or Gradient\n\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//URL\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-slice\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='slice']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-width\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='width']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-outset\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='outset']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-repeat\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='repeat']\").val());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//Gradient\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\n\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-slice\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='slice']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-width\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='width']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-outset\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='outset']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-repeat\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='repeat']\").val());\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\t\t\n\t\t\t\t\t// Wire up the apply button click event handler\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\tif($(e.target).prop(\"class\")==\"apply\")\n\t\t\t\t\t\t\t{//apply\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//stack current style\n\t\t\t\t\t\t\t\tcurrentStyle=$(focusedObj).attr(\"style\")\n\t\t\t\t\t\t\t\t//stack the border style of target object\n\t\t\t\t\t\t\t\tobjStyle.top=$(focusedObj).css(\"border-top\");\n\t\t\t\t\t\t\t\tobjStyle.bottom=$(focusedObj).css(\"border-bottom\");\n\t\t\t\t\t\t\t\tobjStyle.left=$(focusedObj).css(\"border-left\");\n\t\t\t\t\t\t\t\tobjStyle.right=$(focusedObj).css(\"border-right\");\n\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($(e.target).prop(\"class\")==\"cancel\")\n\t\t\t\t\t\t\t{//cancel\n\t\t\t\t\t\t\t\t//roll back\n\t\t\t\t\t\t\t\t$(focusedObj).attr(\"style\",currentStyle);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{//close\n\t\t\t\t\t\t\t\t//off event\n\t\t\t\t\t\t\t\t$(frameDocument).off(CLICK);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//Changes background image and color\n\t\t\t\telse if (buttonName === \"background\")\n\t\t\t\t{\n\t\t\t\t\tvar imageObj,bgColor,\n\t\t\t\t\t\tcurrentBG=$(focusedObj).attr(\"style\"),\n\t\t\t\t\t\tcbs = $popup.find(\".appobj\");\t\n\t\t\t\t\t\n\t\t\t\t\t//Get clicked color code \n\t\t\t\t\t$popup.find(\".colorpicker\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\n\t\t\t\t\t\t\t//Get the background-color from color picker\n\t\t\t\t\t\t\tvar rgbColor=$(e.target).css(\"background-color\")!=\"transparent\" ?\n\t\t\t\t\t\t\t\t\t\t\t$(e.target).css(\"background-color\") : \"0,0,0,0\";\n\t\t\t\t\t\t\tbgColor=$popup.find(\".samplecolor\").css(\"background-color\");\n\t\t\t\t\t\t\tvar rgb=rgbColor.replace(\"rgb(\",\"\").replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.r\").val(parseInt(rgb[0]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.g\").val(parseInt(rgb[1]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.b\").val(parseInt(rgb[2]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.a\").val(rgb.length!=3 ? 0 : 1 );\n\t\t\t\t\t\t\tbgColor=\"rgba(\"+rgb[0]+\",\"+rgb[1]+\",\"+rgb[2]+\",\"+ (rgb.length!=3 ? 0 : 1)+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\tvar cb = $popup.find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//switch background color visibility by checkbox\n\t\t\t\t\t\t\tif($(cb[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",\"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//drag and drop\n\t\t\t\t\tdndImage(\".sampleimage\",focusedObj,$popup,buttonName);\n\t\t\t\t\t\n\t\t\t\t\t//on change RGBA number\n\t\t\t\t\t$popup.find(\".rgbaColor\")\n\t\t\t\t\t\t.on(\"change\", function (e) {\n\t\t\t\t\t\t\t\tbgColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()\n\t\t\t\t\t\t\t\t\t\t+\",\"+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//on change Check Box \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change\",\"input[type=checkbox]\", function (e) {\n\t\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//switch background color or image visibility by checkbox\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",bgColor);\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\t$(focusedObj).css(\"background-color\",\"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\"url('\"+imageObj+\"')\");\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\t$(focusedObj).css(\"background-image\",\"\");\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\n\t\t\t\t\t//on change check Box of image type \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\"input[type=radio],.imageOptions,.appobj\", function (e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar imageOptions=$popup.find(\".imageOptions[name='repeat']\");\t\n\t\t\t\t\t\t\t\t//check selection with URL or Gradient\n\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//url\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\tif($(imageOptions).val()==\"cover\" || $(imageOptions).val()==\"contain\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-size\",\n\t\t\t\t\t\t\t\t\t\t\t$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-repeat\",\n\t\t\t\t\t\t\t\t\t\t\t$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//gradient\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background\",\n\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\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\n\t\t\t\t\t//Submit\n\t\t\t\t\t$popup.find(\"input[type='button']\") \n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\tbgColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()+\",\"\n\t\t\t\t\t\t\t\t\t+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//forced fire when button was 'Apply to body'\n\t\t\t\t\t\t\tif($(e.target).prop(\"class\")==\".apply\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Apply the image to cell\n\t\t\t\t\t\t\t\tdrawBackground(focusedObj);\n\t\t\t\t\t\t\t\tcurrentBG=$(focusedObj).attr(\"style\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($(e.target).prop(\"class\")==\".cancel\")\n\t\t\t\t\t\t\t{//cancelation\n\t\t\t\t\t\t\t\t$(focusedObj).attr(\"style\",currentBG);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//close\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//common draw procedure\n\t\t\t\t\t\t\tfunction drawBackground(target)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($(target).is(\"td\") || $(target).is(\"hr\") || $(target).is(\"body\")\n\t\t\t\t\t\t\t\t|| $(target).is(\"img\") || $(target).is(\"textarea\") || $(target).is(\"input\"))\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-color\",bgColor);\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\tvar imageOptions=$popup.find(\".imageOptions[name='repeat']\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{//url\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-image\",\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\t\tif($(imageOptions).val()==\"cover\" || $(imageOptions).val()==\"contain\")\n\t\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-size\",$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-repeat\",$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{//gradient\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-image\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\n\t\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\t\t$(frameDocument).off(\"click\");\n\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}\n\t\t\t\t\n\t\t\t\t//rotation\n\t\t\t\telse if (buttonName === \"rotation\")\n\t\t\t\t{\n\t\t\t\t\tvar target=\"\",defX,defY,defD,defS,$tempObj=$(focusedObj);\n\t\t\t\t\tif($(focusedObj).is(\"body\"))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(\"Please select object except body.\");\n\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t\tif($(focusedObj).is(\"td\") || $(focusedObj).is(\"th\"))\n\t\t\t\t\t\t\t$tempObj=$(focusedObj).closest(\"table\");\n\t\t\t\t\t\tif($tempObj.css(\"position\")==\"static\") $tempObj.css(\"position\",editor.options.position);\n\t\t\t\t\t\tvar tempPos= $tempObj.css(\"transform-origin\")!=undefined ? \n\t\t\t\t\t\t\t$tempObj.css(\"transform-origin\").split(\" \") : [0,0] ,\n\t\t\t\t\t\t\ttempD=$tempObj.css(\"transform\");\n\t\t\t\t\t\tdefX=parseInt(tempPos[0]);\n\t\t\t\t\t\tdefY=parseInt(tempPos[1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar tempH=$tempObj.outerHeight(),\n\t\t\t\t\t\t\ttempW=$tempObj.outerWidth();\n\t\t\t\t\t\t$popup.find(\".XPosition:nth-child(\"+(parseInt(defX/tempW*2)+1)+\")\").prop(\"selected\",true);\n\t\t\t\t\t\t$popup.find(\".YPosition:nth-child(\"+(parseInt(defY/tempH*2)+1)+\")\").prop(\"selected\",true);\n\t\t\t\t\t\tif(tempD==\"none\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdefD=0;\n\t\t\t\t\t\t\tdefS=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttempD=tempD.replace(\"matrix(\",\"\");\n\t\t\t\t\t\t\tvar aryD=tempD.split(\",\");\n\t\t\t\t\t\t\tdefD=Math.atan2(parseFloat(aryD[1]),parseFloat(aryD[0]))*180/Math.PI;\n\t\t\t\t\t\t\tdefS=Math.sqrt(Math.pow(parseFloat(aryD[0]),2)+Math.pow(parseFloat(aryD[1]),2));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$popup.find(\".deg\").val(defD);\n\t\t\t\t\t\n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\".deg,.XPosition,.YPosition\",function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$(focusedObj).is(\"html\") )\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tvar x=$popup.find(\".XPosition\").val(),\n\t\t\t\t\t\t\t\t\ty=$popup.find(\".YPosition\").val(),\n\t\t\t\t\t\t\t\t\tdeg=$popup.find(\".deg\").val();\n\t\t\t\t\t\t\t\t$tempObj.css({\"transform-origin\":x+\" \"+y,\n\t\t\t\t\t\t\t\t\t\"transform\":\"rotate(\"+deg+\"deg) scale(\"+defS+\")\"});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Please select object.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t$popup.find(\"input[type='button']\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\tif($(e.target).attr(\"class\")!=\"apply\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tempObj.css({\"transform-origin\":defX+\" \"+defY,\n\t\t\t\t\t\t\t\t\t\"transform\":\"rotate(\"+defD+\"deg) scale(\"+defS+\")\"});\n\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//perspect\n\t\t\t\telse if (buttonName === \"perspect\")\n\t\t\t\t{\n\t\t\t\t\t$popup.find(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\tvar perspect=$(e.target).attr(\"class\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tperspective(focusedObj,perspect);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//perspective control\n\t\t\t\t\tfunction perspective(target,perspect)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar children=$(frameBody).children(),\n\t\t\t\t\t\t\tmaxid;\n\t\t\t\t\t\tzidx=0;\n\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($(item).css(\"z-index\")!=\"auto\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(zidx <= parseInt($(item).css(\"z-index\")))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tzidx=parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\tmaxid=idx;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(item).css(\"z-index\",$(children).index(item));\n\t\t\t\t\t\t\t\tif(zidx < parseInt($(children).index(item)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tzidx=parseInt($(children).index(item));\n\t\t\t\t\t\t\t\t\tmaxid=idx;\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\tif(perspect ==\"toFront\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar z=parseInt($(target).css(\"z-index\"));\n\t\t\t\t\t\t\tvar dz= (zidx - z) < 0 ? 0 : zidx -z ;\n\t\t\t\t\t\t\tvar pair=maxid;\t\n\t\t\t\t\t\t\t//check if same value as z was existed\n\t\t\t\t\t\t\tif(dz!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar c = parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\t\tif(dz>c-z && c-z > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdz=c-z;\n\t\t\t\t\t\t\t\t\t\t\tpair=idx;\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\t\t//convert\n\t\t\t\t\t\t\t\t$(target).css(\"z-index\",z+dz);\n\t\t\t\t\t\t\t\t$($(children).get(pair)).css(\"z-index\",z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toBack\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar z=parseInt($(target).css(\"z-index\"));\n\t\t\t\t\t\t\tvar dz= z,\n\t\t\t\t\t\t\t\tpair=parseInt($(children).index(target));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//check if same value as z was existed\n\t\t\t\t\t\t\tif(dz>0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar c = parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\t\tif(dz>=z-c && z-c >= 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdz=z-c;\n\t\t\t\t\t\t\t\t\t\t\tpair=idx;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(z,c,idx);\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\t\t//convert\n\t\t\t\t\t\t\t\t$(target).css(\"z-index\",z - dz);\n\t\t\t\t\t\t\t\t$($(children).get(pair)).css(\"z-index\",z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toMostFront\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tzidx++;\n\t\t\t\t\t\t\t$(target).css(\"z-index\",zidx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toMostBack\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(target).css(\"z-index\",0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar zz=parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\tzz++;\n\t\t\t\t\t\t\t\t\t$(item).css(\"z-index\",zz);\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\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\teditor.$frame.contents().off(\"click\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//body style\n\t\t\t\telse if (buttonName === \"bodystyle\")\n\t\t\t\t{\n\t\t\t\t\t//insert style of body\n\t\t\t\t\t$popup.find(\"textarea\").val($(frameBody).attr(\"style\"));\n\t\t\t\t\t//Submit\n\t\t\t\t\t$popup.find(\"input[type='button']\") //children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t}\n\n // Show the popup if not already showing for this button\n if (buttonDiv !== $.data(popup, BUTTON)) {\n showPopup(editor, popup, buttonDiv);\n return false; // stop propagination to document click\n }\n\n // propaginate to document click\n return;\n\n }\n\t\t\t\n\t\t\t\n // Print\n else if (buttonName === \"print\")\n editor.$frame[0].contentWindow.print();\n\n // All other buttons\n else if (!execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))\n return false;\n\n }\n\n // Focus the editor\n focus(editor);\n\n }", "title": "" }, { "docid": "eb4d0b7979ccc143f2fc2b4b5b165dfa", "score": "0.63919723", "text": "function pressed(num){\n\tif (num == 1) {\n\t\teensButton.style.background = \"green\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = true;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse if (num == 2) {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"green\";\n\t\thuidig = false;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = null;\n\t\tsubmitButton.style.display = \"none\"\n\t}\n}", "title": "" }, { "docid": "e00111f5a5b253ebf7834ff02c863ea3", "score": "0.638929", "text": "function onButtonClick(e) {\n var elem = e.target;\n // Here we send a button click event, letting the server know which button was clicked\n socket.emit('button_click', { id: elem.id });\n}", "title": "" }, { "docid": "25aece0d3ab2ea45a1cd751b8dc79018", "score": "0.63861656", "text": "function cb_beforeClick(cb, pos) { }", "title": "" }, { "docid": "3d8d6963d5a19fa6d88d8e0eb24069ba", "score": "0.6385442", "text": "function whenButtonPressed(){\n\tconsole.log(\"you pushed button!\");\n}", "title": "" }, { "docid": "372f2a5e4258a33291b3dfb3d60f88a7", "score": "0.6383631", "text": "_addClickFunctionality(button, option){\n\t\tvar config = this;\n\t\tbutton.click(function(){\n\t\t\tconfig.clicked_button = event.target;\n\t\t\tconfig._updatePrice(config.clicked_button)\n\t\t\tconfig._sortButtonColoring(config.clicked_button);\n\t\t\tconfig._updateMagento(config.clicked_button);\n\t\t\tconfig._eraseCategories(config.clicked_button);\n\t\t\tconfig._hideCategories(config.clicked_button);\n\t\t\tconfig._decideNext(config.clicked_button, option);\n\t\t});\n\t}", "title": "" }, { "docid": "81770283754b94493de3076776849800", "score": "0.638199", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppWdbeUsrDetailDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "6d43cb28abb000171f6963def11274e3", "score": "0.6379372", "text": "onInternalClick(event) {\n const me = this,\n bEvent = { event };\n\n if (me.toggleable) {\n // Clicking the pressed button in a toggle group should do nothing\n if (me.toggleGroup && me.pressed) {\n return;\n }\n\n me.toggle(!me.pressed);\n }\n\n /**\n * User clicked button\n * @event click\n * @property {Common.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n me.trigger('click', bEvent);\n\n /**\n * User performed the default action (clicked the button)\n * @event action\n * @property {Common.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n // A handler may have resulted in destruction.\n if (!me.isDestroyed) {\n me.trigger('action', bEvent);\n }\n\n // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onClick and onAction\n\n // stop the event since it has been handled\n event.preventDefault();\n event.stopPropagation();\n }", "title": "" }, { "docid": "8f3eed0f322a3086ed0da9f2ea6c38b7", "score": "0.6378855", "text": "function handleClick(ev)\r\n {\r\n /* \r\n Remove the id active-button from the element that\r\n contains it prior to the click-event. \r\n\r\n This will require the loop throught the NODE LIST of buttons. \r\n Inside the loop, use conditional and the element object method\r\n hasAttribute() to check if the current button in the loop containes the id.\r\n If it does, use element-object property removeAttribute()\r\n to remove the id. */\r\n let currentItem = ev.target;\r\n \r\n for(let i=0; i< myNodelist.length; i++)\r\n {\r\n \r\n if(myNodelist[i].hasAttribute('id')) \r\n {\r\n \r\n myNodelist[i].removeAttribute('id');\r\n }\r\n\r\n\r\n /*\r\n Use the element-object method setAttribute() to set the id active-button \r\n to the currently clicked button. */\r\n currentItem.setAttribute('id', 'btn-active');\r\n \r\n } \r\n /* \r\n Use conditional and event-object to check which button is clicked\r\n and based on that, create HTML with the data inside the backticks:\r\n `<h1>${headingContent}</h1>\r\n <img src=\"${imgUrl}\" alt=\"${imgAlt}\">\r\n <p>${bodyText}</p>`\r\n Assign this content to to your HTML-container that will \r\n be dynamically loaded (you already got the reference to \r\n this container before you started the function handleSelection) */ \r\n if(ev.target == myNodelist[0])\r\n {\r\n $dc.innerHTML = markupElements.solar;\r\n }\r\n else if(ev.target == myNodelist[1])\r\n {\r\n $dc.innerHTML = markupElements.hydro;\r\n }\r\n else if(ev.target == myNodelist[2])\r\n {\r\n $dc.innerHTML = markupElements.biogas;\r\n }\r\n /* \r\n Close your handleSelection function here. */ \r\n }", "title": "" }, { "docid": "aebcd0a1a42c74a66bc6995571df7345", "score": "0.63700414", "text": "function doClick(button) {\r\n\r\n inputBox.focus();\r\n\r\n if (button.textOp) {\r\n\r\n if (undoManager) {\r\n undoManager.setCommandMode();\r\n }\r\n\r\n var state = new TextareaState(panels);\r\n\r\n if (!state) {\r\n return;\r\n }\r\n\r\n var chunks = state.getChunks();\r\n\r\n // Some commands launch a \"modal\" prompt dialog. Javascript\r\n // can't really make a modal dialog box and the WMD code\r\n // will continue to execute while the dialog is displayed.\r\n // This prevents the dialog pattern I'm used to and means\r\n // I can't do something like this:\r\n //\r\n // var link = CreateLinkDialog();\r\n // makeMarkdownLink(link);\r\n // \r\n // Instead of this straightforward method of handling a\r\n // dialog I have to pass any code which would execute\r\n // after the dialog is dismissed (e.g. link creation)\r\n // in a function parameter.\r\n //\r\n // Yes this is awkward and I think it sucks, but there's\r\n // no real workaround. Only the image and link code\r\n // create dialogs and require the function pointers.\r\n var fixupInputArea = function () {\r\n\r\n inputBox.focus();\r\n\r\n if (chunks) {\r\n state.setChunks(chunks);\r\n }\r\n\r\n state.restore();\r\n previewManager.refresh();\r\n };\r\n\r\n var noCleanup = button.textOp(chunks, fixupInputArea);\r\n\r\n if (!noCleanup) {\r\n fixupInputArea();\r\n }\r\n\r\n }\r\n\r\n if (button.execute) {\r\n button.execute(undoManager);\r\n }\r\n }", "title": "" }, { "docid": "fc2ca0e3710f813a2b81100e459839e7", "score": "0.635429", "text": "function userButtonPressAction() {\n $(\".btn\").click(function() {\n if(!isClickPatternOrderedSubsetOfGamePattern()) {\n gameOver();\n return;\n }\n if(userClickPattern.length < gamePattern.length)\n return;\n\n /*if user gets to this point, then the clickPattern must equal the\n gamePattern. So, the user will go on to the next level*/\n userClickPattern = [];\n setTimeout(nextLevel, 1000);\n\n });\n}", "title": "" }, { "docid": "41a60d8b701b190b8f2b760522595933", "score": "0.635097", "text": "clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }", "title": "" }, { "docid": "6d492564d071002d762dba212c93ae81", "score": "0.6344568", "text": "function click(e){\n \n var nameOfClass=e.target.className;\n\n if(nameOfClass===\"navigation__container_wrapper_button\"){\n\n var btnId=e.target.id;\n\n if(btnId===\"button-button2\"){\n \n validateFlag=checkForm1();\n }\n else if(btnId===\"button-button1\"){\n storeActiveButtonId(btnId);\n modifyApperance(btnId);\n }\n else if(btnId===\"button-button3\"){\n validateFlag=checkForm2();\n }\n else if(btnId===\"button-button4\"){\n \n validateFlag=checkForm3();\n }\n if(validateFlag==1){\n storeActiveButtonId(btnId);\n storeInSessionStorage(btnId);\n modifyApperance(btnId);\n }\n else{\n alert(\"Fill the complete form\");\n }\n \n var pageData=getDataFromSessionStorage();\n\n if(pageData!=null){\n modifyData(pageData,0 );\n }\n \n \n \n \n }\n else if(nameOfClass===\"footer__container_wrapper_button\"){\n \n var activeBtnId=JSON.parse(window.sessionStorage.getItem('activeBtnId'));\n var validateFlag=0;\n \n \n if(e.target.id===\"button-nextButton\"){\n if(activeBtnId===\"button-button1\"){\n validateFlag=checkForm1();\n }\n else if(activeBtnId===\"button-button2\"){\n validateFlag=checkForm2();\n }\n else if(activeBtnId===\"button-button3\"){\n validateFlag=checkForm3();\n var active=getActiveSideBarOption();\n getCheckedOption(active);\n }\n if(validateFlag==1){\n if(parseInt(activeBtnId[13])==4){\n var newBtnNumber=parseInt(activeBtnId[13]);\n }\n else{\n var newBtnNumber=parseInt(activeBtnId[13])+1;\n }\n var newBtnId=\"button-button\"+newBtnNumber;\n if(newBtnId===\"button-button4\"){\n var id=getActiveQuestion();\n showSelectedQuestion(id);\n highlightQuestion(id);\n storeActiveQuestion(id);\n }\n storeActiveButtonId(newBtnId);\n storeInSessionStorage(newBtnId);\n var pageData=getDataFromSessionStorage(newBtnId);\n modifyApperance(newBtnId);\n if(pageData!=null){\n modifyData(pageData,0);\n }\n \n }\n \n \n }\n else if(e.target.id===\"button-backButton\"){\n //storeInSessionStorage(activeBtnId);\n if(parseInt(activeBtnId[13])==1){\n var newBtnNumber=parseInt(activeBtnId[13]);\n }\n else{\n var newBtnNumber=parseInt(activeBtnId[13])-1;\n }\n var newBtnId=\"button-button\"+newBtnNumber;\n \n storeActiveButtonId(newBtnId);\n \n var pageData=getDataFromSessionStorage(newBtnId);\n console.log(\"data on coming back \",pageData);\n modifyData(pageData,0);\n modifyApperance(newBtnId);\n \n }\n else if(e.target.id===\"button-submitButton\"){\n console.log(\"in submit button\");\n var validateFlag=checkButtonStatus();\n if(validateFlag==1){\n storeInSessionStorage(\"button-submitButton\");\n alert(\"Submitted Successfully\");\n }\n }\n \n \n\n }\n}", "title": "" }, { "docid": "06e53bf46abc60de1f042e526b84b989", "score": "0.6343647", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('right.scpt');\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "1ad1dd5d7cadeac84dbcac5dbc5641c5", "score": "0.6342842", "text": "function clickHandler(e) {\n // cleanup the event handlers\n yesbutton.removeEventListener('click', clickHandler);\n nobutton.removeEventListener('click', clickHandler);\n\n // Hide the dialog\n screen.classList.remove('visible');\n\n // Call the appropriate callback, if it is defined\n if (e.target === yesbutton) {\n if (yescallback)\n yescallback();\n }\n else {\n if (nocallback)\n nocallback();\n }\n\n // And if there are pending permission requests, trigger the next one\n if (pending.length > 0) {\n var request = pending.shift();\n window.setTimeout(function() {\n requestPermission(request.message,\n request.yescallback,\n request.nocallback);\n }, 0);\n }\n }", "title": "" }, { "docid": "a2371d1a9040712df59d7b3a2595387d", "score": "0.63403654", "text": "function clickedTheButton(){\r\n greet();\r\n}", "title": "" } ]
0bd5b1788672411f50661da6a28acf8d
Shortcut function for checking if an object has a given property directly on itself (in other words, not on a prototype). Unlike the internal `has` function, this public version can also traverse nested properties.
[ { "docid": "97608b870fe9ad097ff1f9408886f7bf", "score": "0.0", "text": "function has$1(obj, path) {\n path = toPath$1(path);\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (!has(obj, key)) return false;\n obj = obj[key];\n }\n return !!length;\n }", "title": "" } ]
[ { "docid": "e466ae8c8070b824e7a348e4bc38490d", "score": "0.7480185", "text": "function has(obj, property) {\n if (property === null || property === undefined) {\n return false;\n }\n return getImpl(obj, property) !== undefined;\n}", "title": "" }, { "docid": "5e74ce4aea50bdbf1a6d652acfb79410", "score": "0.7330887", "text": "hasProperty(property) {\n return Object.prototype.hasOwnProperty.call(propertiesMap.get(this), property);\n }", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.72886735", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4cc3c7e67c8c2cc666cc23f0d18ea376", "score": "0.72738785", "text": "function contains(obj, prop) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}", "title": "" }, { "docid": "4cc3c7e67c8c2cc666cc23f0d18ea376", "score": "0.72738785", "text": "function contains(obj, prop) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}", "title": "" }, { "docid": "4cc3c7e67c8c2cc666cc23f0d18ea376", "score": "0.72738785", "text": "function contains(obj, prop) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}", "title": "" }, { "docid": "4cc3c7e67c8c2cc666cc23f0d18ea376", "score": "0.72738785", "text": "function contains(obj, prop) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}", "title": "" }, { "docid": "3e14dfc5b5f8780c5885b29acae5ae28", "score": "0.7266761", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "806dd05c2162f109afc8c6bf2fd34dc0", "score": "0.72512424", "text": "function hasOwnProperty$1(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }", "title": "" }, { "docid": "370666c15bb64c8dac722c77581fcde6", "score": "0.72291297", "text": "function hasOwnProperty$1(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "9230e54ff2552b69126e6507a3868d0e", "score": "0.7196996", "text": "function objectHasProperty(thing, property) {\n return typeof thing === \"object\" && property in thing;\n}", "title": "" }, { "docid": "88a5507e69e9336bdad527116ef8d5f6", "score": "0.7184335", "text": "function hasOwnProperty$1(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }", "title": "" }, { "docid": "dcec578dde819ddd4cb01666ae09baeb", "score": "0.71385306", "text": "function hasDirectProperty(o, p) {\n return Object.prototype.hasOwnProperty.call(o, p);\n}", "title": "" }, { "docid": "d636d003cef9f6326540f6db665cb85b", "score": "0.71047246", "text": "function has(obj, prop) {\n\treturn hasOwn.call(obj, prop);\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "87c43750da7a55619e1892c4cbd68e0d", "score": "0.6983102", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName)\n}", "title": "" }, { "docid": "992dd31ed157b559d26790ee9e79a7b8", "score": "0.69521344", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "3c461d073108bd6ed9fc762c74c06353", "score": "0.69507647", "text": "function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" } ]
1d82c733247d13fcea890d8549f94772
Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
[ { "docid": "9a84d91ce7acf5e07a9479cbd6c7d434", "score": "0.72540075", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null;\n ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" } ]
[ { "docid": "122b6d82274ba0527e86f5ae2b4cdcc6", "score": "0.75169235", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst\n ? getParentInstance(targetInst)\n : null;\n traverseTwoPhase(\n parentInst,\n accumulateDirectionalDispatches,\n event\n );\n }\n }", "title": "" }, { "docid": "b543f957b66af19c8c32b067502c4140", "score": "0.7413693", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b543f957b66af19c8c32b067502c4140", "score": "0.7413693", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b543f957b66af19c8c32b067502c4140", "score": "0.7413693", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b543f957b66af19c8c32b067502c4140", "score": "0.7413693", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "74a7c67ce502c10ee55a834431cc51b9", "score": "0.7402934", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "74a7c67ce502c10ee55a834431cc51b9", "score": "0.7402934", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "2605b2a72f4df00ad2369b5613aeadf1", "score": "0.7377648", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? getParentInstance(targetInst) : null;\n\t traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2605b2a72f4df00ad2369b5613aeadf1", "score": "0.7377648", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? getParentInstance(targetInst) : null;\n\t traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2605b2a72f4df00ad2369b5613aeadf1", "score": "0.7377648", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? getParentInstance(targetInst) : null;\n\t traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2605b2a72f4df00ad2369b5613aeadf1", "score": "0.7377648", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? getParentInstance(targetInst) : null;\n\t traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "0907664bb8f0c804a0cf92a071274713", "score": "0.7346131", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n const targetInst = event._targetInst\n const parentInst = targetInst ? getParentInstance(targetInst) : null\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event)\n }\n}", "title": "" }, { "docid": "e7b9fe3d243b7ae8efdd716fb61ee42d", "score": "0.73452187", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "c1a4fa35ed2387dd0f117bc179144ab8", "score": "0.73203343", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t\t var targetInst = event._targetInst;\n\t\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t\t }\n\t\t}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "609ec185b85b0c8b6bf01e8867b52f8e", "score": "0.7298529", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "a8104dc15a2703e1f48422b97ba99ea9", "score": "0.7285104", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;\n\t EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "10776dc4e15a85e78b0468e460f2f774", "score": "0.72736967", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?ReactTreeTraversal.getParentInstance(targetInst):null;ReactTreeTraversal.traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "caea178fb56b6ea0f64221e5835e0c37", "score": "0.7253393", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "caea178fb56b6ea0f64221e5835e0c37", "score": "0.7253393", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "caea178fb56b6ea0f64221e5835e0c37", "score": "0.7253393", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "caea178fb56b6ea0f64221e5835e0c37", "score": "0.7253393", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "caea178fb56b6ea0f64221e5835e0c37", "score": "0.7253393", "text": "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" } ]
c3c6d05e5ada155924db634e8e5932ca
scopeExists(validators.Subscription, 'default') > true scopeExists(validators.Subscription, 'update') > false
[ { "docid": "587157f9719ff1fca99123937ee88e04", "score": "0.62262374", "text": "function scopeExists(validator, scope) {\n return Object.keys(validator.scopes).find(key => key === scope) !== undefined\n}", "title": "" } ]
[ { "docid": "67fcdad15f31ed48ba1cb648051d6635", "score": "0.59661514", "text": "static existsFilter() {\n return new SubscriptionFilter([{ exists: true }]);\n }", "title": "" }, { "docid": "67fcdad15f31ed48ba1cb648051d6635", "score": "0.59661514", "text": "static existsFilter() {\n return new SubscriptionFilter([{ exists: true }]);\n }", "title": "" }, { "docid": "f72238e336ef1269156ad96f01162e74", "score": "0.5679254", "text": "function validateSubscription(){\n\n // validate specific form elements when keyup fires\n // if all of the below are fully validated then the code blocde will execute\n\n /* separate verifiable items for batch logic\n\n * combining this logic into a simple (one && two && three) wont be feasable\n * because two and three wont evaluate unless one is also true. This is why\n * all of the verifications must be evaluated prior to comparison */\n\n var vName, vMail, vPhone;\n\n var _RS = {verify: 'required', msgFailed: ''}; // shorthand so it takes up less memory\n\n vName = TMvalidator.validateField(subName, [\n _RS,\n {verify: 'full-name-display'},\n {verify: 'length', min: 1, max: 50}\n ], subNameMsg);\n\n vMail = TMvalidator.validateField(subEmail, [\n _RS,\n {verify: 'email'}\n ], subEmailMsg);\n\n vPhone = TMvalidator.validateField(subPhone, [\n _RS,\n {verify: 'phone'}\n ], subPhoneMsg);\n\n if (vName && vMail && vPhone){\n // if all of the above are validated then the form will be submittable\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "258dec294966c4df56b648556c22eec0", "score": "0.56544465", "text": "validate() {\n this.exists()\n return true\n }", "title": "" }, { "docid": "aff3289ddad54853b06fc5be00c1a6b1", "score": "0.56295955", "text": "function checkSubscription ( spaceId )\n{ // checks if spaceId is currently subscribed\n if ( subscriptions.includes( spaceId ) )\n { return true; }\n else\n { return false; }\n}", "title": "" }, { "docid": "76350152df87a5b50fe8f9f89bffa267", "score": "0.5583051", "text": "function checkUsrSubscription() {\n\tif (checkCookieCor(\"rcsSubscriptions\")){\n\t\tvar rcsSubscriptions = getCookieClient(\"rcsSubscriptions\");\n\t\tvar currentAppId = getCurrentAppId();\n\t\tvar ca = rcsSubscriptions.split('|');\n\t\tfor(var i=0;i < ca.length;i++) {\n\t\t\tvar appId = ca[i];\n\t\t\tif (appId == currentAppId)\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "7c44605f56ab2bc26c4e74411b9ae325", "score": "0.55762637", "text": "function _formUpdateValid(){\n \tif ($scope.updateuser.$valid){\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t\t}\n }", "title": "" }, { "docid": "6ffd30d584b5a65afdedaa5a6a3197ec", "score": "0.55475485", "text": "async validateScope(user,client,scope){\n\t\tconsole.log(`validateScope:code=${JSON.stringify(code)},client=${JSON.stringify(client)},scope=${JSON.stringify(scope)}`)\n\t\treturn true\n\t}", "title": "" }, { "docid": "4e848353bde4accc08dba1a9326235ff", "score": "0.54779035", "text": "function checkSwagger2Scopes(scope, definition) {\n return Boolean(definition.scopes && definition.scopes[scope]);\n}", "title": "" }, { "docid": "097ec87053827ba9eb850dbbc3d1b166", "score": "0.537576", "text": "function fnStudentNotificationDefaultandValidate(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\tswitch (operation) {\n\t\tcase 'View':\n\t\t\t/*if (!fnDefaultNotifificationID($scope))\n\t\t\t\treturn false; */\n\n\t\t\tbreak;\n\n\t\tcase 'Save':\n\t\t\tif (!fnDefaultNotifificationID($scope))\n\t\t\t\treturn false;\n\n\t\t\tbreak;\n\n\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "a94ae66cf27f7a6a25c6431d512c70c2", "score": "0.53696215", "text": "has(subscriber) {\n return this.sub1 === subscriber || this.sub2 === subscriber;\n }", "title": "" }, { "docid": "43787faa477c2f3e448adaa917000002", "score": "0.5352442", "text": "supportsSubscriptions() {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "e669958dc8d106e1e9d348d935cc86a6", "score": "0.5335666", "text": "_shouldUnregisterRpcClient()\n{\n if (0 != this._subscriptions.tickers.count || this._subscriptions.tickers.subscribed)\n {\n return false;\n }\n if (0 != this._subscriptions.orderBooks.count)\n {\n return false;\n }\n if (0 != this._subscriptions.trades.count)\n {\n return false;\n }\n if (0 != this._subscriptions.markets.count)\n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e9edffe53c996121eb8001781fba43f0", "score": "0.5335096", "text": "get canSubscribe()\n\t{\n\t\treturn true;\n\t}", "title": "" }, { "docid": "156adb5c9492202580fe89155b08c8bb", "score": "0.5263368", "text": "valid() {\r\n return true\r\n }", "title": "" }, { "docid": "91fa3b67a4db691e2c2c814bb636aa4e", "score": "0.5247954", "text": "supportsSubscriptions() {\n return false;\n }", "title": "" }, { "docid": "dbb908e2ad81b269973b9b23a657ad78", "score": "0.51250225", "text": "valid() {\n return true\n }", "title": "" }, { "docid": "68b7cf4586c3a4cea7bd9493faee34d0", "score": "0.51147074", "text": "function isValidScope() {\n return indicatorStack.some(item => item);\n }", "title": "" }, { "docid": "b59fd9244d13c3814af89f15c39132de", "score": "0.5114698", "text": "isReady() {\n return this.age >= this.period;\n }", "title": "" }, { "docid": "9827947df77a6d7ff4ae3b68d347a233", "score": "0.5065475", "text": "exists() {\n return !!this.$exists;\n }", "title": "" }, { "docid": "972e8ab40ae4b26d67178141d622c075", "score": "0.50632733", "text": "function validateScope(scope) {\n if (typeof scope !== 'string') {\n return false;\n }\n\n return scopes.includes(scope);\n}", "title": "" }, { "docid": "bce480291eeccad08a591cbd14598ba9", "score": "0.5058836", "text": "function checkOAS3Scopes(scope, definition) {\n let scopeIsDefined = false;\n if (definition.flows) {\n Object.keys(definition.flows).forEach(flowType => {\n if (\n definition.flows[flowType].scopes &&\n definition.flows[flowType].scopes[scope]\n ) {\n scopeIsDefined = true;\n return;\n }\n });\n }\n // scopes for openIdConnet are not definied in the document\n if (definition.type && definition.type === 'openIdConnect') {\n scopeIsDefined = true;\n }\n return scopeIsDefined;\n}", "title": "" }, { "docid": "1b2af3491abe577d1cf287c02eba27b3", "score": "0.5058525", "text": "has(subscriber) {\n return this.sub1 === subscriber || this.sub2 === subscriber;\n }", "title": "" }, { "docid": "73479a201ba8c9391fc6ba104e9eeba0", "score": "0.503604", "text": "validateInscription() {\n \n }", "title": "" }, { "docid": "d2bc99479d2a833dcf2824e1a6f932ac", "score": "0.5012004", "text": "function isSubscribed(username) {\n\treturn getSubscribedList()[username] != undefined;\n}", "title": "" }, { "docid": "8242f1f1e1dd45b856435afa0fc45e49", "score": "0.5010286", "text": "function isSubscribed(username) {\n return (getSubscribedUsers().length > 0 ? (getSubscribedList()[username] != undefined) : false);\n /*if (getSubscribedUsers() != []) { return (getSubscribedUsers()[username] != null); }\n else { return false; }*/\n }", "title": "" }, { "docid": "2be9bb2409cbabc4406f9883371c1d3c", "score": "0.50064754", "text": "function isUpdateValid() {\n\n\t\tvar modelNum,\n\t\t\tmaxNum;\n\n\t\tif (vm.tagModel.valType === 'P') {\n\n\t\t\tmodelNum = Number(vm.percentSlider.model);\n\t\t\tmaxNum = 100;\n\t\t} else {\n\n\t\t\tmodelNum = Number(vm.currencySlider.model);\n\t\t\tmaxNum = Number(vm.currencySlider.options.max);\n\t\t}\n\n\t\treturn modelNum > 0 && modelNum <= maxNum;\n\t}", "title": "" }, { "docid": "c330531b0a3ffa5919157d57c9ec9c6d", "score": "0.5006111", "text": "exists(){}", "title": "" }, { "docid": "c747ba04ef93c1a0f3e7ee1fa7a47657", "score": "0.5001326", "text": "validOperation(verb, obj) {\n let result = true\n if ((verb === defaultVerbs.SAVE_NEW || verb === defaultVerbs.SAVE_UPDATE) && !obj.isValid()) {\n result = false\n }\n return result\n }", "title": "" }, { "docid": "e755c0350aa99af84e86737f4604239a", "score": "0.49895597", "text": "repeats() {\n return this.rules.length > 0\n }", "title": "" }, { "docid": "836ced0468bba386d9f69602d4c685f4", "score": "0.49539012", "text": "function validateVendor(scope) {\n return scope.InvoiceService.validateVendor(scope.form.vendorId.$viewValue);\n}", "title": "" }, { "docid": "932030066415d027e7f6a83b87377080", "score": "0.49380147", "text": "isValid () {\n return this.validHasGamblingDebt() &&\n this.validGamblingDebt()\n }", "title": "" }, { "docid": "b737ab7a34e39c046ecc2d4948720477", "score": "0.49324778", "text": "function isValidScope(val) {\n if (val) {\n // At this point `null` is filtered out\n var type = typeof val;\n return type === 'object' || type === 'function';\n }\n return false;\n }", "title": "" }, { "docid": "9dc44aacc8f8b026d610760a32bb00ae", "score": "0.48759028", "text": "function r(e) {\n return !!(e && (e.accessToken || e.idToken || e.refreshToken) && Array.isArray(e.scopes));\n }", "title": "" }, { "docid": "8a7d1778165aa76920c095ab42c68784", "score": "0.48719358", "text": "whenValid() {\n\n }", "title": "" }, { "docid": "7580e2c6277c56d816012c7294f7fe38", "score": "0.48660246", "text": "hasUniqueConstraint () {\n\t\treturn this.unique;\n\t}", "title": "" }, { "docid": "7daa60fbf6248e6d8df78e10e5838246", "score": "0.4865374", "text": "validateTaxPayer() {\n let result = false;\n let taxPayerId = this.taxesView.accountID;\n let state = this.taxesView.accountState;\n let taxPayerExist = this.bank.players.some(p => p.id === taxPayerId);\n\n if (taxPayerExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "98fbfce390586f8bb31ec4255c7afbd3", "score": "0.4860869", "text": "isValid() {\n return true;\n }", "title": "" }, { "docid": "98fbfce390586f8bb31ec4255c7afbd3", "score": "0.4860869", "text": "isValid() {\n return true;\n }", "title": "" }, { "docid": "a30e5fe5c8e9a0a8d504c080fec6cc40", "score": "0.48599657", "text": "function IsThereChanges(){\n\t\t\t\n\t\t\tif($scope.PatientID_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.Forename_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.FirstSurname_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.SecondSurname_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.PatientEmail_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.PatientPhone_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.JoinDate_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.Gender_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.CompanyID_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.Department_FieldValue !== \"NONE\")return true;\n\t\t\telse if ($scope.Site_FieldValue !== \"NONE\")return true;\n\t\t\telse return false;\t\n\t\t\t\n\t\t}", "title": "" }, { "docid": "46c27955aa3327b4faf273938d536ea8", "score": "0.4851012", "text": "function fnInstituteOtherActivityDefaultandValidate(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\tswitch (operation) {\n\t\tcase 'View':\n\t\t\tif (!fnDefaultGroupId($scope))\n\t\t\t\treturn false;\n\n\t\t\tbreak;\n\n\t\tcase 'Save':\n\t\t\tif (!fnDefaultGroupId($scope))\n\t\t\t\treturn false;\n\n\t\t\tbreak;\n\n\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "1c837bd99e56c555fcd1588c3a27907a", "score": "0.4843729", "text": "get valid() {\n return this.request(`${this.prefix}is_valid`, []);\n }", "title": "" }, { "docid": "7e89bfbdae401d65018b11a07e2ce9fc", "score": "0.48434263", "text": "function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new _GraphQLError.GraphQLError(node.name ? \"Subscription \\\"\".concat(node.name.value, \"\\\" must select only one top level field.\") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}", "title": "" }, { "docid": "7e89bfbdae401d65018b11a07e2ce9fc", "score": "0.48434263", "text": "function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new _GraphQLError.GraphQLError(node.name ? \"Subscription \\\"\".concat(node.name.value, \"\\\" must select only one top level field.\") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}", "title": "" }, { "docid": "dfcd49ccf28fbb7beca06c95380d9458", "score": "0.48409173", "text": "checkValidity() {\n return this._staticallyValidateConstraints().result === constraintValidationPositiveResult;\n }", "title": "" }, { "docid": "9b7c9316cc0048b085ab230ee9792a5f", "score": "0.48408034", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "9b7c9316cc0048b085ab230ee9792a5f", "score": "0.48408034", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "9b7c9316cc0048b085ab230ee9792a5f", "score": "0.48408034", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "9b7c9316cc0048b085ab230ee9792a5f", "score": "0.48408034", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "9b7c9316cc0048b085ab230ee9792a5f", "score": "0.48408034", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}", "title": "" }, { "docid": "c2a52ceed4746e924bec2c0b2c88b2ad", "score": "0.4832827", "text": "companyExists(company) {\n const watchlist = this.customWatchlist;\n return watchlist.includes(company)\n }", "title": "" }, { "docid": "d3d65f69091e032d978e572cb5fc92ea", "score": "0.48268637", "text": "validateUpdate(selector){\n for(const update of this.#updateCollection){\n if(update.selector === selector){\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "85c90b9dcc2a4eb992e9ad7967b9ee8c", "score": "0.48079818", "text": "userHasScopes(scopes) {\n const grantedScopes = (_scopes || \"\").split(\" \")\n return scopes.every(scope => grantedScopes.includes(scope))\n }", "title": "" }, { "docid": "e2c7905b5412720df8fd3325b98dac73", "score": "0.48024136", "text": "function detectValidationChanges() {\n var intervalFunc = function() {\n //if user hasn't clicked the \"book\" button, then we are not ready to show validation messagnig\n if (!vm.showValidations) return;\n\n //validate\n vm.validate();\n };\n $interval(intervalFunc, 1000, 0, true);\n }", "title": "" }, { "docid": "9aef1cfe87df24454cb9c47b052575f6", "score": "0.47948894", "text": "function fnComparisonAccrossAllSectionDefaultandValidate(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\tswitch (operation) {\n\t\tcase 'View':\n\t\t\treturn true\n\t\t\tbreak;\n\n\t\tcase 'Save':\n\t\t\t\treturn true;\n\n\t\t\tbreak;\n\n\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "40e0a5f1e233886bf26bd990cc93ef72", "score": "0.47932371", "text": "get active() {\n return !!this.subs;\n }", "title": "" }, { "docid": "82d94916e3b4d126a6abec3231d82e99", "score": "0.47927606", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n }", "title": "" }, { "docid": "df0161fd41caa35e9c3ac867d8a0be2c", "score": "0.47921148", "text": "validate() {\n const valid = this.required ? this.hasValue : true;\n this.invalid = !valid;\n return valid;\n }", "title": "" }, { "docid": "85f4b9045f89ee854d8b82e4e0266806", "score": "0.47805285", "text": "function checkInvalidation() {\n if(ctrl.pending_invalidations.length > 0){\n ctrl.$http({\n method: 'GET',\n url: \"/pages/invalidate-status\",\n params: {invalidations: ctrl.pending_invalidations}\n }).then(function successCallback(response) {\n var data = response.data;\n var keys = Object.keys(data);\n for(var i=0; i<keys.length; i++){\n var key = keys[i];\n if(data[key]){\n ctrl.pending_invalidations.splice(ctrl.pending_invalidations.indexOf(key), 1);\n }\n }\n\n if(ctrl.pending_invalidations.length <= 0){\n ctrl.flags.is_invalidating = false;\n if(ctrl.flags.is_generating_preview){\n ctrl.flags.is_generating_preview = false;\n ctrl.flags.preview_generated = true;\n ctrl.preview_url = ctrl.configurations[\"lynx\"][\"domains\"][ctrl.current_url.domain][\"home_page\"][\"url\"]\n if(subdomain.length > 0){\n ctrl.preview_url = \"http://\" + subdomain + \".\" + ctrl.preview_url + \"/preview\";\n }else{\n ctrl.preview_url = \"http://\" + ctrl.preview_url + \"/preview\"\n }\n ctrl.$window.open(ctrl.preview_url,\"_blank\")\n }\n }\n }, function errorCallback(response) {\n console.log(\"Could not check invalidations\")\n });\n }\n }", "title": "" }, { "docid": "b2e43d36cb5dd578a77c9e17a05f9f3f", "score": "0.4770879", "text": "function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](node.name ? \"Subscription \\\"\".concat(node.name.value, \"\\\" must select only one top level field.\") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}", "title": "" }, { "docid": "b2e43d36cb5dd578a77c9e17a05f9f3f", "score": "0.4770879", "text": "function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](node.name ? \"Subscription \\\"\".concat(node.name.value, \"\\\" must select only one top level field.\") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}", "title": "" }, { "docid": "867f656b98b5ab4a3230e16754f7433d", "score": "0.4753682", "text": "function validateOnSave()\n{\n\tvar approver = nlapiGetFieldValue('custrecord_approver_coa');\n if (approver == null || approver == '') \n\t{\n alert('There is no Approver assigned for this Record.');\n return false;\n }\n\t//check for sub account type validation to its parent type\n var subAccount = nlapiGetFieldText('custrecord_subaccount_info');\n var currentAccountType = nlapiGetFieldText('custrecord_account_type');\n if (subAccount) \n\t{\n\t\t//if Sub account is of Update accounts\n\t\tvar filters = new Array();\n\t\tvar columns = new Array();\n\t\tfilters[0] = new nlobjSearchFilter('custrecord_accntname', null, 'is', subAccount);\n\t\tcolumns[0] = new nlobjSearchColumn('custrecord_account_type');\n\t\tcolumns[1] = new nlobjSearchColumn('custrecord_approval_status_coa');\n\t\tvar records = nlapiSearchRecord('customrecord_accounts', null, filters, columns);\n\t\tvar accountType = '';\n\t\tif (records) {\n\t\t\taccountType = records[0].getText('custrecord_account_type');\n\t\t\tvar status = records[0].getText('custrecord_approval_status_coa');\n\t\t\tif (status == 'Pending Approval') {\n\t\t\t\talert('The Subaccount chosen has not been approved. Please select any other account.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t\t//Validation for single subsidiary on Bank and credit card\n\t\tvar subs = nlapiGetFieldValues('custrecord_subs_coa');\n\t\tvar subLen = subs.length;\n\t\tvar child = nlapiGetFieldValue('custrecord_coa_include_children');\n\t\tif ((currentAccountType == 'Bank' || currentAccountType == 'Credit Card') && (subLen > 1 || child == 'T')) {\n\t\t\talert('Bank Accounts and Credit Card Accounts must be restricted to a single Subsidiary');\n\t\t\treturn false;\n\t\t}\n\t\t// If the Bank/Credit card account type is assigned to an elimination Subsidiary //\n\t\tvar subEliminationid = 6; //'Splunk Inc. : Splunk Consolidation Elimination'\n\t\tif (currentAccountType == 'Bank' || currentAccountType == 'Credit Card') \n\t\t{\n\t\t\tfor (var x = 0; x < subs.length; x++) \n\t\t\t{\n\t\t\t\tif (subs[x] == subEliminationid) \n\t\t\t\t{\n\t\t\t\t\talert('This record may not be assigned to an elimination Subsidiary.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Check for Deferral Account\n\t\tvar deferralAccount = nlapiGetFieldValue('custrecord_def_account_ea');\n\t\tvar deferralAccountName = nlapiGetFieldText('custrecord_def_account_ea');\n\t\tif (deferralAccount) \n\t\t{\n\t\t\tvar customSub = nlapiGetFieldValues('custrecord_subs_coa');\n\t\t\tvar accountRec = nlapiLoadRecord('account', deferralAccount);\n\t\t\tvar stdSubsidiary = accountRec.getFieldValues('subsidiary');\n\t\t\tvar includchild = accountRec.getFieldValue('includechildren');\n\t\t\tvar stdSub = '';\n\t\t\tif (stdSubsidiary) \n\t\t\t{\n\t\t\t\tvar subs = stdSubsidiary.toString();\n\t\t\t\tstdSub = subs.split(',');\n\t\t\t}\n\t\t\tif (customSub.length > stdSub.length) \n\t\t\t{\n\t\t\t\talert('The subsidiary restrictions on this record are incompatible with those defined for account:' + deferralAccountName + '.' + 'Subsidiary access on this record must be a subset of those permitted by the account.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (includchild != 'T') {\n\t\t\t\t\tvar aresult = [];\n\t\t\t\t\tvar index = {};\n\t\t\t\t\tcustomSub = customSub.sort();\n\t\t\t\t\tfor (var c = 0; c < stdSub.length; c++) \n\t\t\t\t\t{\n\t\t\t\t\t\tindex[stdSub[c]] = stdSub[c];\n\t\t\t\t\t}\n\t\t\t\t\tfor (var d = 0; d < customSub.length; d++) \n\t\t\t\t\t{\n\t\t\t\t\t\tif (!(customSub[d] in index)) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taresult.push(customSub[d]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (aresult.length > 0) {\n\t\t\t\t\t\talert('The subsidiary restrictions on this record are incompatible with those defined for account:' + deferralAccountName + '.' + 'Subsidiary access on this record must be a subset of those permitted by the account.');\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\t\tvar accntName = nlapiGetFieldValue('custrecord_accntname');\n var accntNumber = nlapiGetFieldValue('custrecord_accntnumber');\n\t\tvar filter = new Array();\n filter[0] = new nlobjSearchFilter('custrecord_accntnumber', null, 'is', accntNumber);\n filter[1] = new nlobjSearchFilter('custrecord_accntnumber', null, 'isnotempty', null);\n\t\tfilter[2] = new nlobjSearchFilter('internalid',null,'noneof',nlapiGetRecordId());\n var result = nlapiSearchRecord('customrecord_accounts', null, filter);\n if (result != null) {\n alert('The account number you have chosen is already used.Go back, change the number and resubmit.');\n return false;\n }\n \n var newFilter = new Array();\n newFilter[0] = new nlobjSearchFilter('custrecord_accntname', null, 'is', accntName);\n\t\tnewFilter[1] = new nlobjSearchFilter('internalid',null,'noneof',nlapiGetRecordId());\n var records = nlapiSearchRecord('customrecord_accounts', null, newFilter);\n if (records != null) {\n alert('The account name you have chosen is already used.Go back, change the name and resubmit.');\n return false;\n }\n\t\treturn true;\n}", "title": "" }, { "docid": "339d1cbfeea522320375968bb517dcc2", "score": "0.47527498", "text": "get active() {\n return !!this.subs;\n }", "title": "" }, { "docid": "4bc88952ed8b81a6136e186a3fcd77f2", "score": "0.47523084", "text": "async validate() {\n return true\n }", "title": "" }, { "docid": "b19a13937308b2d4ae15d2f4934fecc0", "score": "0.47332618", "text": "validateBeforeUpdate (id, newData, prevData) { return true }", "title": "" }, { "docid": "0d6db6c9350b2f5bc918c808e7ce1667", "score": "0.47297347", "text": "onRulesUpdated({ rules }) {\n this.loading.init = false;\n\n if (rules) {\n this.isActivityStepVisible = some(\n [\n 'organisation',\n 'vat',\n 'nationalIdentificationNumber',\n 'companyNationalIdentificationNumber',\n 'corporationType',\n ],\n (fieldName) => get(rules, `${fieldName}`) !== undefined,\n );\n\n let invalid = 0;\n\n Object.entries(rules).forEach(([key, value]) => {\n const modelItem = this.model[key];\n\n if (\n modelItem !== undefined &&\n (value.in &&\n !(typeof value.in[0] === 'string'\n ? value.in?.includes(modelItem)\n : !!value.in?.find((item) => item.value === modelItem)),\n value.regularExpression && modelItem\n ? !new RegExp(value.regularExpression).test(modelItem)\n : false,\n value.mandatory && !modelItem)\n ) {\n invalid += 1;\n }\n });\n\n this.isValid = invalid === 0;\n }\n }", "title": "" }, { "docid": "6bdfb8259212d380bb40ced213393c24", "score": "0.47282687", "text": "newValidation(){\n\n return (this.lean.id==undefined);\n\n }", "title": "" }, { "docid": "ed2c2c1351ad8c888e61e04df677635d", "score": "0.4728009", "text": "isSubscribed() {\n return new Promise((resolve) => {\n try {\n this.storageManager.isSubscribed(false, false, true).then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n } catch (err) {\n resolve(false);\n }\n\n /*\n if (window.Notification.permission === 'granted') {\n if (navigator.serviceWorker) {\n if (location.protocol === 'https:') {\n this.getActiveWorkerRegistration().then((serviceWorkerRegistration) => {\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (!subscription) {\n log.debug('Status: Subscription invalid');\n resolve(false);\n } else {\n this.storageManager.isSubscribed().then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n }\n }).catch((e) => {\n log.error(e);\n Raven.captureException(e);\n resolve(false);\n });\n }).catch((e) => {\n if (e) {\n log.error(e);\n Raven.captureException(e);\n }\n\n this.storageManager.isSubscribed().then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n });\n } else {\n this.storageManager.isSubscribed().then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n }\n } else {\n this.storageManager.isSubscribed().then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n }\n } else {\n this.storageManager.isSubscribed().then((storageStatus) => {\n log.debug('Status: storage status:', storageStatus);\n resolve(storageStatus);\n });\n\n // TODO: Notification not available in iframe!\n\n // log.debug('Status: Permission not granted');\n // resolve(false);\n }\n */\n });\n }", "title": "" }, { "docid": "71c5020a163a85fd53f12db04bcb0060", "score": "0.4698526", "text": "function SingleFieldSubscriptions(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new _error.GraphQLError(singleFieldOnlyMessage(node.name && node.name.value), node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}", "title": "" }, { "docid": "3f90cbbcedbdbcc51665282ada2258e0", "score": "0.4698511", "text": "createScopedRequired() {\n // On compute engine, scopes are specified at the compute instance's\n // creation time, and cannot be changed. For this reason, always return\n // false.\n messages.warn(messages.COMPUTE_CREATE_SCOPED_DEPRECATED);\n return false;\n }", "title": "" }, { "docid": "c338fb46d857f04dd8bc359321a5b554", "score": "0.46860427", "text": "async function nameSpaceCheckNameAvailability() {\n const subscriptionId = \"29cfa613-cbbc-4512-b1d6-1b3a92c7fa40\";\n const parameters = {\n name: \"sdk-Namespace-2924\",\n };\n const credential = new DefaultAzureCredential();\n const client = new NotificationHubsManagementClient(credential, subscriptionId);\n const result = await client.namespaces.checkAvailability(parameters);\n console.log(result);\n}", "title": "" }, { "docid": "b83f0097828c30aeca657e1562771f51", "score": "0.4683635", "text": "checkAndUpdate() {\n console.log(\"sub class must implement checkAndUpdate function\");\n return false;\n }", "title": "" }, { "docid": "6cdcc573ca3e18ac07a2474481b5a5d9", "score": "0.46825406", "text": "scope() {\n return new ValidationComponents();\n }", "title": "" }, { "docid": "394123839c725b12a239fd67e420fbf3", "score": "0.4673306", "text": "isRequireSolved(){\n return Object.keys(this.requirePending).every((serviceName) => {\n return this.requirePending[serviceName].length === 0\n })\n }", "title": "" }, { "docid": "6fc9a74dc71d16314de10689b7343eae", "score": "0.46731362", "text": "get active() {\n return !!this.subs;\n }", "title": "" }, { "docid": "6fc9a74dc71d16314de10689b7343eae", "score": "0.46731362", "text": "get active() {\n return !!this.subs;\n }", "title": "" }, { "docid": "3c5b93546037793203a81305c55c0fdb", "score": "0.4672256", "text": "get hasAcceptedEvents() {\n return this.hasOwnProperty('acceptedEvents');\n }", "title": "" }, { "docid": "9bf5addfdded149d33854ad73bcf993e", "score": "0.4670477", "text": "has(fn) {\n if (!fn) return false;\n return this._subscriptions.some(sub => sub.handler == fn);\n }", "title": "" }, { "docid": "43cc2ed7983ca84d1f70ac573ff23f35", "score": "0.46704644", "text": "verifyResource() {\n let match = false;\n\n if (this.event) {\n const requestedApiId = this.event.methodArn\n .split(':')[5]\n .split('/')[0];\n\n const apiIds = this.resourceGroup.apiIds;\n\n apiIds.forEach((apiId) => {\n if (apiId.api_name === requestedApiId) {\n match = true;\n }\n });\n }\n return match;\n }", "title": "" }, { "docid": "ee97345b674bdec53905d8d045f99396", "score": "0.46601817", "text": "function TopicResource_SubscriptionPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('endpoint', cdk.requiredValidator)(properties.endpoint));\n errors.collect(cdk.propertyValidator('endpoint', cdk.validateString)(properties.endpoint));\n errors.collect(cdk.propertyValidator('protocol', cdk.requiredValidator)(properties.protocol));\n errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));\n return errors.wrap('supplied properties not correct for \"SubscriptionProperty\"');\n }", "title": "" }, { "docid": "53b9c7993f8e49ec81463ff5368e9b2a", "score": "0.46407846", "text": "function checkIfUserHasQueryPermission() {\n var index = $scope.permissions.indexOf(Permissions.CONSULTAR_SALIDAS);\n if (index > -1) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e4f8a144a2de6bb5b924bd50378a3624", "score": "0.4639589", "text": "function form_saveRecord()\n{\n var valid = true;\n valid = hasClientAgreedToTerms();\n\treturn valid;\n}", "title": "" }, { "docid": "45565bb730b9fe56f417fe7338348e96", "score": "0.4634041", "text": "function validatePut() {\n return true\n}", "title": "" }, { "docid": "19a91b5c889a33bd13df3508891cafc3", "score": "0.4633694", "text": "validatePartner() {\n if (this.partner()) {\n this.partner().$validate();\n }\n }", "title": "" }, { "docid": "c5c7abdc2dc7718fadef5079f5a8dac9", "score": "0.46311635", "text": "function isValidRegistration(){\n\treturn compose()\n\t// Attach user to request\n\t\t.use(function(req, res, next) {\n\t\t\tconsole.log(\"body id: \", req.params.id);\n\t\t\tuserModel.findOne({'registration.authenticationHash' : req.params.id }, function (err, trainer) {\n\t\t\t\tif (err) return next(err);\n\t\t\t\tif (!trainer){\n\t\t\t\t\tconsole.log(\"shit\", trainer);\n\t\t\t\t\treturn res.send(\"That authorization link has already been used\");\n\t\t\t\t}\n\n\t\t\t\treq.trainer = trainer;\n\t\t\t\tconsole.log(\"isValidRegistration() FOUND A REGISTRATION:\", trainer, \" and set it as req.registration\");\n\t\t\t\tnext();\n\t\t\t});\n\t\t});\n}", "title": "" }, { "docid": "fd1e5b67f7087e387d9cb60ba8a35c36", "score": "0.46304798", "text": "function validate(){\n return true;\n}", "title": "" }, { "docid": "119f9fa8766a327225d60c51868e26f4", "score": "0.46296167", "text": "function getCanSave(services) {\n return function() {\n return services.$scope.initialized;\n };\n}", "title": "" }, { "docid": "d58c25927182085c37212ccb3b9963b8", "score": "0.46262276", "text": "static isScopeable(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.Parameter;\r\n }", "title": "" }, { "docid": "ed2a835d447b5769eaba8f2451a41010", "score": "0.46251902", "text": "_isreg(_ctrl) {\n return this.isntNullOrUndefined(this._listeners.byId[_ctrl.viewId]);\n }", "title": "" }, { "docid": "ed2a835d447b5769eaba8f2451a41010", "score": "0.46251902", "text": "_isreg(_ctrl) {\n return this.isntNullOrUndefined(this._listeners.byId[_ctrl.viewId]);\n }", "title": "" }, { "docid": "f63f366cab841c05677045b089ca8760", "score": "0.46247283", "text": "get validated() {\n return this.sizeValidator.validated && this.extensionValidator.validated;\n }", "title": "" }, { "docid": "74374048aa2d30eba5bab0fa5347a5a0", "score": "0.4616541", "text": "validateSaleBuyAcount() {\n let result = false;\n let acountID = this.saleAndBuy.acountID;\n let state = this.saleAndBuy.acountState;\n\n //Primero verifico que es una cuenta exsitente\n let acountExist = this.bank.players.some(p => p.id === acountID);\n\n if (acountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "d6cd0bf3284fc82876e4ce60f1007096", "score": "0.4615764", "text": "isValid() {\n return this.refs.to.isValid() || this.refs.cc.isValid() || this.refs.bcc.isValid();\n }", "title": "" }, { "docid": "c5cffc83447a70067360a45984bbe25b", "score": "0.46146983", "text": "static validateSubscriptionRequest(schema, subscriptionRequest) {\n var _a;\n // parse will throw an error if there are any parse errors\n const gqlDocument = graphql_1.parse((_a = subscriptionRequest.gql_query_string) !== null && _a !== void 0 ? _a : '');\n const executionParams = { query: gqlDocument };\n if (!is_subscription_operation_1.isASubscriptionOperation(gqlDocument, subscriptionRequest.operation_name)) {\n throw new Error('query for subscription must be a graphql subscription');\n }\n const errors = graphql_1.validate(schema, gqlDocument, graphql_1.specifiedRules);\n if (errors.length) {\n // todo add explict tracing\n throw new Error(errors.toString());\n }\n if (subscriptionRequest.query_attributes) {\n // will throw if invalid\n executionParams.variables = JSON.parse(subscriptionRequest.query_attributes);\n }\n executionParams.operationName = subscriptionRequest.operation_name;\n return executionParams;\n }", "title": "" }, { "docid": "7fce81162e5ba053dc86cc4a90ec4cb9", "score": "0.461122", "text": "function CheckIfPatientExists(){\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "debf4080b547d50b6667d0aa4e137400", "score": "0.46069464", "text": "canAddSub() {\n return this.subaddable().length > 0;\n }", "title": "" }, { "docid": "677d395ba111172e6e47f791aefc253f", "score": "0.46063256", "text": "function CfnTopic_SubscriptionPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('endpoint', cdk.requiredValidator)(properties.endpoint));\n errors.collect(cdk.propertyValidator('endpoint', cdk.validateString)(properties.endpoint));\n errors.collect(cdk.propertyValidator('protocol', cdk.requiredValidator)(properties.protocol));\n errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));\n return errors.wrap('supplied properties not correct for \"SubscriptionProperty\"');\n}", "title": "" }, { "docid": "39fa119459c4f1ed0fe281144114808f", "score": "0.46058875", "text": "scope(required) {\n logger.debug(`Creating scope check middleware (${required})`)\n return (ctx, next) => {\n const result = this.checkScope(required, ctx.state.oauth.token)\n if (result !== true) {\n const err = result === false ? `Required scope: \\`${required}\\`` : result\n\n handleError(new InvalidScopeError(err), ctx)\n return\n }\n\n return next()\n }\n }", "title": "" }, { "docid": "48393bf5f608285a30415da23943791d", "score": "0.45967114", "text": "isSubscribed(event) {\n if (this.connection) {\n return this.connection.isSubscribed(event)\n }\n return Promise.reject({code: 'qi-call/no-connection', message: 'Connection object not found.'})\n }", "title": "" }, { "docid": "065f4e92d52507ed2d3d7c5238c037cd", "score": "0.4596249", "text": "function canPublish() {\n\n var hasSomethingToPublish = false;\n\n vm.variants.forEach(variant => {\n // if varaint is mandatory and not already published:\n if (variant.publish === false && notPublishedMandatoryFilter(variant)) {\n return false;\n }\n if (variant.publish === true) {\n hasSomethingToPublish = true;\n }\n });\n\n return hasSomethingToPublish;\n }", "title": "" } ]
e46463672edd27d0053103b9016e5da1
get formatted actual date and time if secs=true resultion up to seconds
[ { "docid": "c0ef53a2bdea9c630a839b7dcbae05b7", "score": "0.66524917", "text": "function getNow(secs) {\n\tvar now = new Date();\n\tvar yyyy = now.getFullYear().toString();\n\tvar m = now.getMonth() + 1;\n\tvar mm = m.toString();\n\tif (mm.length == 1) mm = '0' + mm;\n\tvar dd = now.getDate().toString();\n\tif (dd.length == 1) dd = '0' + dd;\n\tvar hh = now.getHours().toString();\n\tif (hh.length == 1) hh = '0' + hh;\n\tvar mn = now.getMinutes().toString();\n\tif (mn.length == 1) mn = '0' + mn;\n\tif (!secs) return yyyy + mm + dd + \"_\" + hh + \":\" + mn;\n\tvar ss = now.getSeconds().toString();\n\tif (ss.length == 1) ss = '0' + ss;\n\treturn yyyy + mm + dd + \"_\" + hh + \":\" + mn + \":\" + ss;\n}", "title": "" } ]
[ { "docid": "9447a50d5b545682432b18b0ad92c46a", "score": "0.7238327", "text": "formatTime(secs) {\n var minutes = Math.floor(secs / 60) || 0;\n var seconds = Math.floor(secs - minutes * 60) || 0;\n return minutes + \":\" + (seconds < 10 ? \"0\" : \"\") + seconds;\n }", "title": "" }, { "docid": "d730523ae69f3f6c125108173eb0cd71", "score": "0.704425", "text": "formatTime(seconds) {\n var hrs = ~~(seconds / 3600);\n var mins = ~~((seconds % 3600) / 60);\n var secs = ~~seconds % 60;\n\n var time = \"\";\n\n if (hrs > 0) {\n time += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n time += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n time += \"\" + secs;\n return time;\n }", "title": "" }, { "docid": "edeaf1ac5b6c93d38991868ce1f9e2bf", "score": "0.7013648", "text": "function formatTime(secs) {\n\t var minutes = Math.floor(secs / 60) || '00';\n\t var seconds = (secs - minutes * 60) || '00';\n\n\t return minutes + ':' + (((seconds < 10) && (seconds !== '00')) ? '0' : '') + seconds;\n\t}", "title": "" }, { "docid": "c007e64d04aa75dfce7a209e373e3782", "score": "0.6908439", "text": "function getTimeS(date){ \n\t\t\tfunction formatNumber(value){ \n\t\t\t\treturn (value < 10 ? '0' : '') + value; \n\t\t\t} \n\t\t\t \n\t\t\tvar tt = [formatNumber(date.getHours()), formatNumber(date.getMinutes())]; \n\t\t\tif (opts.showSeconds){ \n\t\t\t\ttt.push(formatNumber(date.getSeconds())); \n\t\t\t} \n\t\t\treturn tt.join($(target).datetimebox('spinner').timespinner('options').separator); \n\t\t}", "title": "" }, { "docid": "790a126f739cb82eff75e756cf9015cf", "score": "0.68925595", "text": "function strTimeDelta(secs) {\n var hours = Math.floor(secs/60/60);\n secs = secs - hours*60*60;\n var minutes = Math.floor(secs/60);\n secs = secs - minutes * 60;\n var txt = secs + \"s\";\n if(minutes > 0) txt = minutes + \"m \" + txt;\n if(hours > 0) txt = hours + \"h \" + txt;\n return txt;\n}", "title": "" }, { "docid": "67e689e185ce6ff7ec0ffa6189aa7b59", "score": "0.67767584", "text": "function secondsToString(secs) {\r\n\tif (secs >= 60) { \r\n\t\tvar wholeMins = Math.floor(secs/60);\r\n\t\tvar wholeSeconds = secs-(wholeMins*60);\r\n\t\t\r\n\t\tif (wholeMins == 1) { \r\n\t\t\tvar minWord = \"minute\";\r\n\t\t}\r\n\t\telse { \r\n\t\t\tvar minWord = \"minutes\";\r\n\t\t}\r\n\t\r\n\t\tif (wholeSeconds == 1) { \r\n\t\t\tvar secWord = \"second\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar secWord = \"seconds\";\r\n\t\t}\r\n\t\t\r\n\t\tif (wholeSeconds) { \r\n\t\t\treturn (\"\"+wholeMins+\" \"+minWord+\" and \"+wholeSeconds+\" \"+secWord);\r\n\t\t}\r\n\t\telse { \r\n\t\t\treturn (\"\"+wholeMins+\" \"+minWord);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif (secs == 1) { \r\n\t\t\tvar secWord = \"second\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar secWord = \"seconds\";\r\n\t\t}\r\n\t\r\n\t\treturn \"\"+secs+\" \"+secWord;\r\n\t}\r\n}", "title": "" }, { "docid": "15364245aba73ff84bada090c8a82dea", "score": "0.67727983", "text": "function local_time (secs, fmt)\n{\n return format_date_time (new Date (secs * 1000), fmt);\n}", "title": "" }, { "docid": "1f6b6ced76ea9efc1ac6787ce4a96060", "score": "0.67527735", "text": "function formatTime(seconds) {\n return new Date(seconds * 1000)\n .toISOString()\n .substr(11, 8);\n }", "title": "" }, { "docid": "34eb2ed83bd862fd27bff6723cab41da", "score": "0.6711599", "text": "function formatDate(_t) {\n\tlet min = Math.floor(_t / 60000);\n\tlet sec = Math.floor((_t % 60000) / 1000);\n\tlet csec = Math.round(((_t % 60000) % 1000) / 10);\n\tif (min < 10){\n\t\tmin = \"0\" + min;\n\t}\n\tif (sec < 10){\n\t\tsec = \"0\" + sec;\n\t}\n\tif(csec < 10){\n\t\tcsec = \"0\" +csec;\n\t}\n\n\t// Round up if x.995+\n\tif(((_t % 60000) % 1000) / 10 > 99.5){\n\t\tsec++;\n\t\tif (sec < 10){\n\t\t\tsec = \"0\" + sec;\n\t\t}\n\t\tcsec = \"00\";\n\t}\n\n\tif(_t < 60 * 1000){\n\t\treturn sec + \",\" + csec + \" s\";\n\t} else{\n\t\treturn min + \":\" + sec;\n\t}\n}", "title": "" }, { "docid": "283edb972ee2ea2114d1aa08ed977813", "score": "0.6698276", "text": "function timeOutput(time) \r\n\t{\r\n\t\ttime = new Date(time);\r\n\r\n\t\tvar minutes = time.getMinutes().toString();\r\n\t\tvar seconds = time.getSeconds().toString();\r\n\t\t\r\n\t\tif (minutes >= 1)\r\n\t\t{\r\n\t\t\treturn minutes + \" min \" + seconds + \" sec\";\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\treturn seconds + \" sec\";\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "32c944b2897c5705bf4b8950175e56a8", "score": "0.66923934", "text": "function formatTime() {\n let minutes = (\"0\" + Math.floor(((getTime / 60000) % 60))).slice(-2).toString();\n let seconds = (\"0\" + Math.floor(((getTime / 1000) % 60))).slice(-2).toString();\n let formattedTime = minutes + \":\" + seconds; \n \n return formattedTime;\n }", "title": "" }, { "docid": "23f9ca0a16719672de8d4be1beeac28d", "score": "0.66812027", "text": "_formatTime(time) {\n let minsPassed = Math.floor(time / 60); //seconds in a min\n let secPassed = time - minsPassed * 60;\n return (\n (minsPassed < 10 ? \"0\" : \"\") +\n minsPassed +\n \":\" +\n (secPassed < 10 ? \"0\" : \"\") +\n secPassed\n );\n }", "title": "" }, { "docid": "6ae7fb5b6768411514fee9ecb7dad852", "score": "0.6673551", "text": "format(times) {\n return `${pad0(times.minutes)}:${pad0(times.seconds)}:${pad0(Math.floor(times.miliseconds))}`;\n }", "title": "" }, { "docid": "cc2321b23bd8b487de534e4cd6829f2d", "score": "0.66462445", "text": "function convertTime(secs) {\r\n\t\t\tvar minutes = Math.floor(secs / 60);\r\n\t\t\tvar seconds = secs - minutes*60;\r\n\t\t\tvar hours = Math.floor(minutes / 60);\r\n\t\t\tvar days = Math.floor(hours / 24);\r\n\r\n\t\t\tminutes = minutes - hours*60;\r\n\t\t\thours = hours - days*24;\r\n\r\n\t\t\treturn ( (days > 0 ? (days + ' днів ') : '' ) + ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2));\r\n\t\t}", "title": "" }, { "docid": "64871370a57013afb861df5f9287c528", "score": "0.6635828", "text": "static timeFormat(rawDate){\n\n let fullDate = new Date(rawDate)\n let hours\n let minutes\n let seconds\n\n if (fullDate.getHours() < 10){\n hours = \"0\"+fullDate.getHours()\n }else{\n hours = fullDate.getHours()\n }\n if (fullDate.getMinutes() < 10){\n minutes= \"0\"+fullDate.getMinutes()\n }else{\n minutes = fullDate.getMinutes()\n }\n if (fullDate.getSeconds() < 10){\n seconds = \"0\"+fullDate.getSeconds()\n }else{\n seconds = fullDate.getSeconds()\n }\n\n return `${hours}:${minutes}:${seconds}`\n }", "title": "" }, { "docid": "dbf4ad38dfe789fb48ed42c5ab8f52e2", "score": "0.66320044", "text": "formatTime(seconds){\n // Minutes\n var minutes = Math.floor(seconds/60);\n // Seconds\n var partInSeconds = seconds%60;\n // Adds left zeros to seconds\n partInSeconds = partInSeconds.toString().padStart(2,'0');\n // Returns formated time\n return `${minutes}:${partInSeconds}`;\n }", "title": "" }, { "docid": "a1d7291e5b9f9af56062e9dc28b2e758", "score": "0.6624237", "text": "function formatTime(sec) {\r\n const dateObj = new Date(sec * 1000)\r\n const hours = dateObj.getUTCHours();\r\n const minutes = dateObj.getUTCMinutes();\r\n const seconds = dateObj.getUTCSeconds();\r\n const timeObj = hours.toString().padStart(2, '0') + ':' +\r\n minutes.toString().padStart(2, '0') + ':' +\r\n seconds.toString().padStart(2, '0');\r\n return timeObj;\r\n}", "title": "" }, { "docid": "f10153599cbb407e832f1213ae1bb6e8", "score": "0.66063684", "text": "function format_time(sec) //from 1:1 to 01:01\r\n{\r\n if(sec < 60 * 60)\r\n return to_2digit(Math.floor(sec/60)) + \":\" + to_2digit(sec%60);\r\n else\r\n return Math.floor(sec/(60*60)).toString() + \":\" + format_time(Math.floor(sec/60));\r\n}", "title": "" }, { "docid": "8a18c41cb2c3a7db43d1ea8d5fa84690", "score": "0.6604852", "text": "function formatTimeFromDate(date, showsecs) {\n\n var formattedTime;\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var seconds = date.getSeconds();\n var ampm = (hours>=12 ? \" PM\" : \" AM\");\n\n minutes = (minutes < 10 ? \"0\" : \"\") + minutes;\n hours = hours%12;\n\n if(hours == 0) hours = 12;\n\n formattedTime = hours + \":\" + minutes;\n if(showsecs) \n formattedTime += \":\" + (seconds<10?\"0\" + seconds : seconds);\n formattedTime += ampm;\n\n return formattedTime;\n }", "title": "" }, { "docid": "e355a12d83fed4aab497b693a5d5e2ba", "score": "0.6603325", "text": "getFormattedTime() {\n let min = Math.floor(this.remainingTime/60);\n let sec = this.remainingTime%60;\n\n min = min >= 10 ? min : '0' + min;\n sec = sec >= 10 ? sec : '0' + sec;\n\n return min + \":\" + sec;\n }", "title": "" }, { "docid": "def1ee88b6220c74603b9296de8314f2", "score": "0.6586659", "text": "get currentTimeString() {\n return format({\n hours: this.hours || 0,\n minutes: this.minutes || 0,\n seconds: this.seconds || 0,\n milliseconds: 0\n }, this.isShowSeconds ? TimeFormat.HHmmss : TimeFormat.HHmm);\n }", "title": "" }, { "docid": "7d62333e078223a1fceddf6efc74760a", "score": "0.65531874", "text": "function formatTime(seconds) {\n minutes = Math.floor(seconds / 60);\n minutes = (minutes >= 10) ? minutes : \"0\" + minutes;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n return minutes + \":\" + seconds;\n }", "title": "" }, { "docid": "6ffa21fabd704d85b75d1983d5b891cb", "score": "0.65525675", "text": "function ConvertSecondsToDateTimeString(sec)\n{\t\n\tvar hours = parseInt((sec % 86400) / 3600);\t\n\tvar mins = parseInt(((sec % 86400) % 3600) / 60);\n\tvar secs = parseInt((((sec % 86400) % 3600) % 60) % 60);\n\t\n\treturn ((hours < 10 ? \"0\" + hours : hours) + \":\" + \n\t\t\t(mins < 10 ? \"0\" + mins : mins) + \":\" + \n\t\t\t(secs < 10 ? \"0\" + secs : secs) + \" \" +\n\t\t\t(hours < 13 ? \"AM\" : \"PM\"));\n}", "title": "" }, { "docid": "fc2fb366ccb060d0770889954bc98167", "score": "0.6542944", "text": "function displayTime() {\n var prettySecs = secs;\n if (secs.toString().length < 2) {\n prettySecs = \"0\" + secs.toString();\n }\n\n pomoInner.innerHTML = mins + \":\" + prettySecs;\n}", "title": "" }, { "docid": "6be831b555abd095d46ed54ac44f4861", "score": "0.6535219", "text": "function format(sec) {\n\n sec = sec || 0;\n\n var h = Math.floor(sec / 3600),\n min = Math.floor(sec / 60);\n\n sec = sec - (min * 60);\n\n if (h >= 1) {\n min -= h * 60;\n return h + \":\" + zeropad(min) + \":\" + zeropad(sec);\n }\n\n return zeropad(min) + \":\" + zeropad(sec);\n}", "title": "" }, { "docid": "a07470a5b724e2b7f7f7c15c24b3d541", "score": "0.65268207", "text": "printTime(){\n let min = Math.floor(this.project._pot/60);\n let sec = Math.floor(this.project._pot)-min*60;\n let msec = Math.floor((this.project._pot-Math.floor(this.project._pot))*1000);\n if(sec<10) sec = \"0\"+sec;\n if(min<10) min = \"0\"+min;\n return min+\":\"+sec+\":\"+msec;\n }", "title": "" }, { "docid": "207c3c211bbcf89a170788969b7f5967", "score": "0.65240276", "text": "function seconds_to_string(secs) {\n let hrs = Math.trunc(secs / 3600);\n let mins = Math.trunc(secs / 60) - hrs * 60;\n if (hrs < 10)\n hrs = `0${hrs}`;\n if (mins < 10)\n mins = `0${mins}`;\n return `${hrs}:${mins}`;\n}", "title": "" }, { "docid": "03deec3db88a348d4c655b1ea59f1d11", "score": "0.6522562", "text": "function getFormattedTime() {\n var difference = currentTime - startTime;\n hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60));\n seconds = Math.floor((difference % (1000 * 60)) / 1000);\n centiseconds = Math.floor((difference % 1000) / 10);\n hours = hours < 10 ? \"0\" + hours : hours;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n centiseconds = centiseconds < 10 ? \"0\" + centiseconds : centiseconds;\n}", "title": "" }, { "docid": "9198c7f9396da545242a2ae100eeccb4", "score": "0.65221035", "text": "function formatTime(sec) {\n\t\t\tvar min = Math.floor(sec / 60);\n\t\t\tmin = (min >= 10) ? min : \"0\" + min;\n\t\t\tvar sec = Math.floor(sec % 60);\n\t\t\tsec = (sec >= 10) ? sec : \"0\" + sec;\n\t\t\treturn min + \":\" + sec;\n\t\t}", "title": "" }, { "docid": "7978294ab23f8620eb4531a4e171157c", "score": "0.6503969", "text": "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10){ \n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "title": "" }, { "docid": "ab23bef1d9e5f541045efc152193693e", "score": "0.65011865", "text": "function formatTime(seconds) {\n\tvar time = Math.round(seconds);\n\tvar minutes = Math.floor(time / 60);\n\tvar seconds = time - minutes * 60;\n\n\tvar extraZero;\n\n\tif(seconds < 10) {\n\t\textraZero = \"0\";\n\t}\n\telse {\n\t\textraZero = \"\";\n\t}\n\n\t//var extraZero = (seconds < 10) ? \"0\" : \"\";\n\n\treturn minutes + \":\" + extraZero + seconds;\n}", "title": "" }, { "docid": "603ed504b324306593f06832fe36d83b", "score": "0.649217", "text": "function formatSeconds2(d) {\n var sign = (d<0 ? \"-\" : \"\");\n d = Math.abs(d);\n var sec_num = parseInt(d, 10); // don't forget the second parm\n var days = Math.floor(sec_num / 86400);\n var hours = Math.floor((sec_num - (days * 86400)) / 3600);\n var minutes = Math.floor((sec_num - (days * 86400 + hours * 3600)) / 60);\n var seconds = sec_num - (days * 86400 + hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\"+hours; }\n if (minutes < 10) { minutes = \"0\"+minutes; }\n if (seconds < 10) { seconds = \"0\"+seconds; }\n\n\n\n var time = sign + (days>0 ? days+'j ' : '' ) + (days>10 ? '' : (hours == \"00\" ? \"\": hours)+(days>0 ? (hours == \"00\" ? \"\": \"h \") : (hours == \"00\" ? \"\": \"h \")+minutes+'m '+ (hours>0 ? \"\":seconds+ 's') ) );\n return ( d == 0 ? '0' : time);\n }", "title": "" }, { "docid": "cde7936e8180c3030d346b57015cc782", "score": "0.64917797", "text": "function Seconds2Time(seconds, showdays) {\r\n\r\n\tvar numdays, numhours, numminutes, numseconds, returntime, empty, printNext; \r\n\r\n\tnumdays = Math.floor(seconds / 86400.0);\r\n\tseconds = seconds % 86400; \r\n\tnumhours = Math.floor(seconds / 3600.0);\r\n\tseconds = seconds % 3600; \r\n\tnumminutes = Math.floor(seconds / 60.0);\r\n\tnumseconds = seconds % 60;\r\n\r\n\treturntime = \"\";\r\n\r\n\tempty = true; \r\n\tprintNext = showdays == 1 && numdays > 0; \r\n\tif (printNext) {\r\n\t\treturntime += numdays + \"d:\";\r\n\t\tempty = false; \r\n\t}\r\n\r\n\tprintNext = printNext || numhours > 0; \r\n\tif (printNext) {\r\n\t\tif (empty)\r\n\t\t\treturntime += numhours + \"h:\";\r\n\t\telse\r\n\t\t\treturntime += padlength(numhours) + \"h:\";\r\n\t\tempty = false; \r\n\t}\r\n\r\n\tprintNext = printNext || numminutes > 0; \r\n\tif (printNext) {\r\n\t\tif (empty)\r\n\t\t\treturntime += numminutes + \"m:\";\r\n\t\telse\r\n\t\t\treturntime += padlength(numminutes) + \"m:\";\r\n\t\tempty = false; \r\n\t}\r\n\r\n\tprintNext = printNext || numseconds > 0; \r\n\tif (printNext) {\r\n\t\tif (empty)\r\n\t\t\treturntime += numseconds + \"s\";\r\n\t\telse\r\n\t\t\treturntime += padlength(numseconds) + \"s\";\r\n\t} else {\r\n\t\treturntime = \"0\"; \r\n\t}\r\n\t\r\n\treturn returntime;\r\n}", "title": "" }, { "docid": "96234ec0c8e12ff2fd51ad6fc511ee8a", "score": "0.6483745", "text": "function formatTime(seconds) {\r\n let min = Math.floor(seconds / 60);\r\n let sec = Math.floor(seconds - min * 60);\r\n if (sec < 10) {\r\n sec = `0${sec}`;\r\n }\r\n return `${min}:${sec}`;\r\n}", "title": "" }, { "docid": "638f014336eb4fbc82cf1fdbf39e84c9", "score": "0.648243", "text": "format(value) {\n const SECONDS_IN_DAY = 24 * 60 * 60;\n const SECONDS_IN_HOUR = 60 * 60;\n const SECONDS_IN_MINUTE = 60;\n\n let seconds = parseInt(value, 10);\n\n const days = parseInt(seconds / SECONDS_IN_DAY, 10);\n\n if (days > 0) {\n seconds = seconds % SECONDS_IN_DAY;\n }\n\n const hours = parseInt(seconds / SECONDS_IN_HOUR, 10);\n\n if (hours > 0) {\n seconds = seconds % SECONDS_IN_HOUR;\n }\n\n const minutes = parseInt(seconds / SECONDS_IN_MINUTE, 10);\n\n if (minutes > 0) {\n seconds = seconds % SECONDS_IN_MINUTE;\n }\n\n let output = \"\";\n\n if (days > 0) {\n output += `${days}d `;\n }\n\n if (hours > 0) {\n output += `${hours}h `;\n }\n\n if (minutes > 0) {\n output += `${minutes}m `;\n }\n\n if (seconds > 0) {\n output += `${seconds}s `;\n }\n\n this.timeTarget.innerText = output;\n }", "title": "" }, { "docid": "863a2f17f737dbeac96a6b40c220dc1d", "score": "0.6476593", "text": "function t_format2(s) {\r\n\tif (s > -1) {\r\n\t\tstunden = Math.floor(s/3600);\r\n\t\tminuten = Math.floor(s/60) % 60;\r\n\t\tsekunden = s % 60;\r\n\t\tt = stunden + \":\";\r\n\t\tif (minuten < 10) {\r\n\t\t\tt += \"0\";\r\n\t\t}\r\n\t\tt += minuten + \":\";\r\n\t\tif (sekunden < 10){\r\n\t\t\tt += \"0\";\r\n\t\t}\r\n\t\tt += sekunden;\r\n\t} else {\r\n\t\tt = \"0:00:0?\";\r\n\t}\r\n\treturn t;\r\n}", "title": "" }, { "docid": "8fcff835cf0ece9f6a6b02babbe0d1a5", "score": "0.64570814", "text": "function formatTime(seconds) {\n var time = Math.round(seconds);\n var minutes = Math.floor(time / 60); //rounds to the number\n var seconds = time - (minutes * 60); //takes the remaining in seconds\n\n //if statement in shorthand\n var extraZero = (seconds < 10) ? \"0\" : \"\"; //to get the 0 in the format, say 8 min 5 secs\n \n return minutes + \":\" + extraZero + seconds;\n}", "title": "" }, { "docid": "15bd835a0fa6a8397dd3842939ba7518", "score": "0.6450989", "text": "function format(sec) {\n\n sec = sec || 0;\n\n var h = Math.floor(sec / 3600),\n min = Math.floor(sec / 60);\n\n sec = sec - (min * 60);\n\n if (h >= 1) {\n min -= h * 60;\n return h + \"h:\" + zeropad(min); // + \":\" + zeropad(sec);\n }\n\n return zeropad(min) + \":\" + zeropad(sec);\n}", "title": "" }, { "docid": "08b072fc1d0f4e6c1d4e79150de80f74", "score": "0.6449869", "text": "formatTime(seconds) {\n const minsRemaining = \n (Math.floor((seconds % (60*60)) / 60))\n // https://stackoverflow.com/questions/8043026/how-to-format-numbers-by-prepending-0-to-single-digit-numbers\n .toLocaleString('en-US', {minimumIntegerDigits: 2, useGrouping:false});\n const secsRemaining = \n (Math.floor((seconds % 60)))\n .toLocaleString('en-US', {minimumIntegerDigits: 2, useGrouping:false});\n\n return `${minsRemaining}:${secsRemaining}`;\n }", "title": "" }, { "docid": "25f933078cfeebb223e161845e91cd35", "score": "0.6448481", "text": "function secondsToDisplayTime(seconds) {\n var date = new Date(null);\n date.setSeconds(seconds || 0);\n var dateISO = date.toISOString();\n return seconds >= 3600 ? dateISO.substr(11, 8) : dateISO.substr(14, 5);\n}", "title": "" }, { "docid": "e663bd6a2455da220a8497a9334f4c5e", "score": "0.64450425", "text": "formatSecondsAsTime(seconds) {\n const displayMinutes = Math.floor(seconds / 60)\n const displaySeconds = Math.floor(seconds % 60)\n return `${displayMinutes}:${('0' + displaySeconds).slice(-2)}`\n }", "title": "" }, { "docid": "25f362470f2454aca7bc7c265f8738ee", "score": "0.64442086", "text": "function showTime(seconds) {\r\n if (seconds >= 0 && seconds < 60) {\r\n return seconds.toString() + 's';\r\n } else if (seconds >= 60 && seconds < 3600) {\r\n return Math.floor(seconds / 60).toString() + 'm';\r\n } else {\r\n return Math.floor(seconds / 3600).toString() + 'h' + Math.floor((seconds % 3600) / 60).toString();\r\n }\r\n}", "title": "" }, { "docid": "53ec37e2c10a9afbd4d80fd304abf1a3", "score": "0.64258707", "text": "function rfs_format_time(s) {\r\n if (s<120) {\r\n return s+\"s\";\r\n } else {\r\n var s60=s%60;\r\n var m=(s-s60)/60;\r\n if ((m<10) && (s60>9)) {\r\n return m+\":\"+s60+\"min\";\r\n } if (m<120) {\r\n return m+\"min\";\r\n } else {\r\n var m60=m%60;\r\n var h=(m-m60)/60;\r\n if ((h<12) && (m60>9)) {\r\n\treturn h+\":\"+m60+\"h\";\r\n } if (h<48) {\r\n\treturn h+\"h\";\r\n } else {\r\n\tvar h24=h%24;\r\n\tvar d=(h-h24)/24;\r\n\tif ((d<7) && (h24>0)) {\r\n\t return d+\" days \"+h24+\"h\";\r\n\t} if (d<60) {\r\n\t return d+\" days\";\r\n\t} else {\r\n\t var d30=d%30;\r\n\t var mt=(d-d30)/30;\r\n\t return mt+\" months\";\r\n\t}\r\n }\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "618bf7f072302a72a9aef44757b46113", "score": "0.642157", "text": "function formatSeconds(d) {\n var sign = (d<0 ? \"-\" : \"\");\n d = Math.abs(d);\n var sec_num = parseInt(d, 10); // don't forget the second parm\n var days = Math.floor(sec_num / 86400);\n var hours = Math.floor((sec_num - (days * 86400)) / 3600);\n var minutes = Math.floor((sec_num - (days * 86400 + hours * 3600)) / 60);\n var seconds = sec_num - (days * 86400 + hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\"+hours; }\n if (minutes < 10) { minutes = \"0\"+minutes; }\n if (seconds < 10) { seconds = \"0\"+seconds; }\n\n\n var time = sign + (days>0 ? days+'j ' : '' ) + (days>10 ? '' : (hours == \"00\" ? \"\": hours)+(days>0 ? (hours == \"00\" ? \"\": \"h \") : (hours == \"00\" ? \"\": \"h \")+minutes+'m '+seconds+ 's'));\n return ( d == 0 ? '0' : time);\n }", "title": "" }, { "docid": "618bf7f072302a72a9aef44757b46113", "score": "0.642157", "text": "function formatSeconds(d) {\n var sign = (d<0 ? \"-\" : \"\");\n d = Math.abs(d);\n var sec_num = parseInt(d, 10); // don't forget the second parm\n var days = Math.floor(sec_num / 86400);\n var hours = Math.floor((sec_num - (days * 86400)) / 3600);\n var minutes = Math.floor((sec_num - (days * 86400 + hours * 3600)) / 60);\n var seconds = sec_num - (days * 86400 + hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\"+hours; }\n if (minutes < 10) { minutes = \"0\"+minutes; }\n if (seconds < 10) { seconds = \"0\"+seconds; }\n\n\n var time = sign + (days>0 ? days+'j ' : '' ) + (days>10 ? '' : (hours == \"00\" ? \"\": hours)+(days>0 ? (hours == \"00\" ? \"\": \"h \") : (hours == \"00\" ? \"\": \"h \")+minutes+'m '+seconds+ 's'));\n return ( d == 0 ? '0' : time);\n }", "title": "" }, { "docid": "419d3b17aa6971ecf390f44d2b0586a2", "score": "0.64179194", "text": "function formatTime(seconds) {\n minutes = Math.floor(seconds / 60);\n minutes = (minutes >= 10) ? minutes : \"\" + minutes;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n return minutes + \":\" + seconds;\n }", "title": "" }, { "docid": "d58f7a229527cb435334e7e19eeace8f", "score": "0.64112246", "text": "function formatTime(seconds) {\n var time = Math.round(seconds);\n var minutes = Math.floor(time / 60);\n var seconds = time - (minutes * 60);\n\n if(seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n return minutes + \":\" + seconds;\n}", "title": "" }, { "docid": "102afe7a2254bd7111bb519fc93447c3", "score": "0.64103603", "text": "getDateAndTimeAsString(date) {\n var d = this.getDateAsString(date);\n var hh = date.getHours();\n hh = this.addMissingDigit(hh);\n var mm = date.getMinutes();\n mm = this.addMissingDigit(mm);\n //var ss = date.getSeconds();\n //ss = this.addMissingDigit(ss);\n return d + ' ' + hh + ':' + mm;// + ':' + ss;\n }", "title": "" }, { "docid": "bef857d8acf50134845d3ea622158b48", "score": "0.6404373", "text": "function formatTime(t) {\n var hours, mins, secs;\n t = Math.ceil(t / 1000);\n hours = Math.floor(t / (60 * 60));\n t = t % (60 * 60);\n mins = Math.floor(t / 60);\n t = t % 60;\n secs = Math.floor(t);\n if (hours > 0) {\n return hours + ':' + padZeros(mins, 2) + ':' + padZeros(secs, 2);\n }\n return padZeros(mins, 2) + ':' + padZeros(secs, 2);\n }", "title": "" }, { "docid": "40508da6d4d76b3f5ca1575f86946665", "score": "0.6400607", "text": "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10) {\n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "title": "" }, { "docid": "7008fd1a532ac2feeb3bf9e0437f4f20", "score": "0.6391505", "text": "function secondsAsText(s) {\n\treturn (s - (s %= 60)) / 60 + (9 < s ? \":\" : \":0\") + s;\n}", "title": "" }, { "docid": "a60d6d54e77bccf6a4c01eef343459b5", "score": "0.63890165", "text": "function formatDate(date){\n var hour = date.getSeconds();\n var minute = date.getMinutes();\n var second = date.getSeconds();\n var year = date.getFullYear();\n var month = date.getMonth();\n month = month + 1;\n\n if(month < 10){ month = \"0\" + month;}\n\n var ngay = date.getDate();\n\n if(ngay<10){ ngay = \"0\" + ngay;}\n\n return year + \"-\" + month + \"-\" + ngay + \" \" + hour + \":\" + minute + \":\" + second;\n\n}", "title": "" }, { "docid": "696a8dcf0cbc8a8018fbe00f76ceaec8", "score": "0.63871247", "text": "function formatTime(ss) {\r\n let date = new Date(0);\r\n date.setSeconds(ss || 0);\r\n return date.toISOString().substr(14, 5);\r\n }", "title": "" }, { "docid": "c6925e7a1e46649942a056a7d980df3f", "score": "0.63842815", "text": "function formatTime(seconds) {\n let sec = (seconds % 60).toString();\n let min = seconds === 3600\n ? 60 // display 60 min if sec === 3600\n : Math.floor((seconds / 60) % 60).toString();\n if (sec.length === 1) { sec = '0' + sec }\n if (min.length === 1) { min = '0' + min }\n return (min + ':' + sec).replace(/-1:-1/, '00:00')\n}", "title": "" }, { "docid": "78f71f671f52eeaf96ef30ceb4baf308", "score": "0.63787764", "text": "formatMinSec(ms) {\n const sec = Math.floor((ms / 1000) % 60);\n // const secCalc = (ms / 1000) % 60;\n const min = ((ms / 1000) - ((ms / 1000) % 60)) / 60;\n // const sec = Math.trunc(secCalc * Math.pow(10, 3)) / 100;\n const results = { seconds: sec, minutes: 0 };\n if (min < 1) {\n results.minutes = 0;\n }\n else {\n results.minutes = min;\n }\n // console.log(\"Formatting Time\");\n // console.log(this.timerData);\n return results;\n }", "title": "" }, { "docid": "1f3ef0a9b40a113d3dd3d1e6a891cd86", "score": "0.63731676", "text": "function friendlytime(seconds)\t{\r\n\tvar seconds = parseInt(seconds);\r\n\tvar days = Math.floor(seconds / (3600*24));\r\n\tseconds -= days*3600*24;\r\n\tvar hrs = Math.floor(seconds / 3600);\r\n\tseconds -= hrs*3600;\r\n\tvar mnts = Math.floor(seconds / 60);\r\n\tseconds -= mnts*60;\r\n\treturn (days+\" Días, \"+(hrs<10?'0':'')+hrs+\":\"+(mnts<10?'0':'')+mnts+\":\"+(seconds<10?'0':'')+seconds);\r\n}", "title": "" }, { "docid": "b59d278e93f0ea2f7fd52c9942caaa04", "score": "0.63731223", "text": "function formatTime(min, sec) {\n $('#time').html(((min < 10) ? \"0\" + min : min) + \":\" + ((sec < 10) ? \"0\" + sec : sec));\n }", "title": "" }, { "docid": "41e97c640b22e8decea2e55b77741fdd", "score": "0.6371296", "text": "ss (date) {\n return pad(date.getSeconds())\n }", "title": "" }, { "docid": "08d284f5bc255987abdf28224f1b1bbb", "score": "0.6366578", "text": "function elapsedTime() {\n const min = Math.floor(seconds / 60);\n const sec = seconds % 60;\n return ((min < 10) ? \"0\" + min : min) + \":\" + ((sec < 10) ? \"0\" + sec : sec);\n }", "title": "" }, { "docid": "dbefd94ddf6d2ce91d16bc7ab410cd7c", "score": "0.6359556", "text": "function msToString(ms)\n{\n var h = Math.floor(ms / 3600000)\n ms -= (h * 3600000)\n\n var m = Math.floor(ms / 60000)\n ms -= (m * 60000)\n\n var s = Math.floor(ms / 1000)\n ms -= (s * 1000)\n\n var finalTime = \"\"\n if (h)\n finalTime += ((h < 10) ? \"0\" + h : h) + \":\"\n\n finalTime += ((m < 10) ? \"0\" + m : m) + \":\"\n finalTime += ((s < 10) ? \"0\" + s : s)\n if (ms)\n finalTime += \".\" + ((ms < 10) ? \"0\" + parseInt(ms) : parseInt(ms))\n\n return finalTime\n}", "title": "" }, { "docid": "e1afe212ff1028974ed0addebb885569", "score": "0.63594025", "text": "function getTimeDiffString(createdtime) {\n\tvar now = Date.now();\n\tvar timeDiff = now - createdtime;\n\t//console.log(\"timeDiff: \", timeDiff);\n\tvar secs = Math.floor(timeDiff/1000);\n\t//console.log(\"secs = \", secs);\n\tvar mins = 0; \n\tvar hour = 0;\n\t\n\tif(secs >= 60 && secs < 3600)\n\t{\n\t\t\n\t\tmins = Math.floor(secs / 60);\n\t\tsecs = secs % 60;\n\t\t//console.log(\"when a minute or more mins, secs = \" + secs + \", and mins = \" + mins);\n\t\t\n\t}else if(secs >= 3600)\n\t{\n\t\thour = Math.floor(secs / 3600);\n\t\tmins = Math.floor((secs % 3600) / 60);\n\t\tsecs = Math.floor((secs % 3600) % 60);\n\t}\n\t\n\t//console.log(\"hour, mins, secs: \" + hour + \", \" + mins + \", \" + secs);\n\tvar createdStr = \"\";\n\tif(secs < 1 && mins == 0)\n\t{\n\t\tcreatedStr = \"a few seconds\";\n\t}else if(secs == 1 && mins == 0)\n\t{\n\t\tcreatedStr = \"1 second\";\n\t}else if(secs > 1 && secs < 60 && mins == 0)\n\t{\n\t\tcreatedStr = secs + \" seconds\";\n\t}else if(mins == 1 && secs == 0)\n\t{\n\t\tcreatedStr = \"1 minute\";\n\t}else if(mins >= 1 && mins < 60)\n\t{\n\t\t//console.log(\"inside of more than 1 minute...\");\n\t\tcreatedStr = mins + \" minutes\";\n\t\tif(secs > 0 && secs < 60)\n\t\t{\n\t\t\tcreatedStr += \" and \" + secs + \" seconds\";\n\t\t}\n\t}else if(hour >= 1)\n\t{\n\t\tcreatedStr = hour + \" hours, \" + mins + \" minutes and \" + secs + \" seconds\";\n\t}\n\t//console.log(\"timeDiffString: \" + createdStr);\n\t\n\treturn createdStr;\n}", "title": "" }, { "docid": "aa17184f050b03d0111cd09913354d89", "score": "0.63586485", "text": "getFormattedTime() {\n let result = \"\";\n const date = new Date();\n\n const month = date.getMonth() + 1;\n result += (month < 10 ? \"0\" : \"\") + month + \"/\";\n\n const day = date.getDate();\n result += (day < 10 ? \"0\" : \"\") + day + \"/\";\n\n const year = date.getFullYear();\n result += year + \" \";\n\n const hour = date.getHours();\n result += (hour < 10 ? \"0\" : \"\") + hour + \":\";\n\n const minute = date.getMinutes();\n result += (minute < 10 ? \"0\" : \"\") + minute + \":\";\n\n const seconds = date.getSeconds();\n result += (seconds < 10 ? \"0\" : \"\") + seconds;\n\n return result;\n }", "title": "" }, { "docid": "5671c95135d2b275c89491dcf5b593bd", "score": "0.6357652", "text": "function getFormattedDateTime() {\n const date = new Date();\n\n const secs = date.getSeconds();\n const mins = date.getMinutes();\n const hours = date.getHours();\n\n return `${hours}:${mins}:${secs} ${getFormattedDate()}`;\n}", "title": "" }, { "docid": "457c17fe572c8290afd39888f75df104", "score": "0.6354738", "text": "function date_time_datatable_format_render_seconds(data, type, row, meta) {\n if (moment(data).isValid()) {\n date_format = moment(data).format(\"MM/DD/YY hh:mm:ssA (dd)\")\n date_format_from = moment(data).fromNow()\n } else {\n date_format = moment(data, \"MM-DD-YYYY h:mm a\").format(\"MM/DD/YY hh:mmA (dd)\")\n date_format_from = moment(data, \"MM-DD-YYYY h:mm a\").fromNow()\n }\n return '<span title=\"' + date_format_from + '\">' + date_format + '</span>'\n //$(td).attr('title',moment(cellData).fromNow())\n //$(td).html(date_format);\n}", "title": "" }, { "docid": "457c17fe572c8290afd39888f75df104", "score": "0.6354738", "text": "function date_time_datatable_format_render_seconds(data, type, row, meta) {\n if (moment(data).isValid()) {\n date_format = moment(data).format(\"MM/DD/YY hh:mm:ssA (dd)\")\n date_format_from = moment(data).fromNow()\n } else {\n date_format = moment(data, \"MM-DD-YYYY h:mm a\").format(\"MM/DD/YY hh:mmA (dd)\")\n date_format_from = moment(data, \"MM-DD-YYYY h:mm a\").fromNow()\n }\n return '<span title=\"' + date_format_from + '\">' + date_format + '</span>'\n //$(td).attr('title',moment(cellData).fromNow())\n //$(td).html(date_format);\n}", "title": "" }, { "docid": "d580c6ee64a9b2e7a91a5a31bd7014a8", "score": "0.63541186", "text": "function msToString(ms)\n{\n var h = Math.floor(ms / 3600000);\n ms -= (h * 3600000);\n\n var m = Math.floor(ms / 60000);\n ms -= (m * 60000);\n\n var s = Math.floor(ms / 1000);\n ms -= (s * 1000);\n\n var finalTime = \"\";\n if (h) {\n finalTime += ((h < 10) ? \"0\" + h : h) + \":\";\n }\n finalTime += ((m < 10) ? \"0\" + m : m) + \":\";\n finalTime += ((s < 10) ? \"0\" + s : s);\n if (ms) {\n finalTime += \".\" + ((ms < 10) ? \"0\" + parseInt(ms) : parseInt(ms));\n }\n return finalTime;\n}", "title": "" }, { "docid": "b3e49726a6f60cdfe2fa4d37a031d1af", "score": "0.6353926", "text": "function secondsToString(seconds) {\n /* var dias = Math.floor(seconds / (3600*24));\n dias = (dias < 10)? '0' + dias : dias; */\n var hour = Math.floor(seconds / 3600);\n hour = (hour < 10)? '0' + hour : hour;\n var minute = Math.floor((seconds / 60) % 60);\n minute = (minute < 10)? '0' + minute : minute;\n var second = seconds % 60;\n second = (second < 10)? '0' + second : second;\n return /* dias */ hour + ':' + minute + ':' + second;\n \n }", "title": "" }, { "docid": "e4ea256dd81d5900774928686ecca34d", "score": "0.6341108", "text": "function formatTime(s) {\n var h = Math.floor(s / 60 / 60);\n var m = Math.floor((s - (h * 60 * 60)) / 60);\n if (m < 10) m = '0' + m;\n return h + ':' + m;\n }", "title": "" }, { "docid": "bfc19ec0ce98b181ddf812423c9b06c5", "score": "0.6315496", "text": "formatTime(t) {\n let date = new Date(t);\n let hours = String('0000' + date.getUTCHours()).slice(-4);\n let minutes = date.getUTCMinutes();\n let seconds = date.getUTCSeconds();\n let milliseconds = String(date.getUTCMilliseconds()).substring(0,2);\n let formattedTime = `${hours}:${minutes}:${seconds}.${milliseconds}`;\n return formattedTime;\n }", "title": "" }, { "docid": "71f7045887e6f5d48228173e9a4ad578", "score": "0.6310663", "text": "function changeTimeFormat(sec) {\n seconds = Math.round(sec);\n min = Math.floor(sec / 60);\n minutes = (min >= 10) ? min : \"0\" + min;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n return minutes + \":\" + seconds;\n}", "title": "" }, { "docid": "78ea8b4cd4eeec2abdb4f7f58c79510d", "score": "0.6305736", "text": "function formatTime(time) {\n\tvar hours = Math.floor(time / 3600);\n\tvar mins = Math.floor((time % 3600) / 60);\n\tvar secs = Math.floor(time % 60);\n\n\tif (secs < 10) {\n\t\tsecs = \"0\" + secs;\n\t}\n\n\tif (hours) {\n\t\tif (mins < 10) {\n\t\t\tmins = \"0\" + mins;\n\t\t}\n\n\t\t\treturn hours + \":\" + mins + \":\" + secs; // hh:mm:ss\n\t\t\n\t} else {\n \n\t\treturn mins + \":\" + secs; // mm:ss\n\t}\n}", "title": "" }, { "docid": "23dbddd826f9cec57380294053d46ae7", "score": "0.6299651", "text": "function formatDuration(seconds) {\n\n if (seconds === 0) {\n return \"now\";\n }\n\n // calculate years\n let years = Math.floor(seconds / 31536000);\n seconds = seconds - years * 31536000;\n // calculate days\n let days = Math.floor(seconds / 86400);\n seconds = seconds - days * 86400;\n // calculate hours\n let hours = Math.floor(seconds / 3600);\n seconds = seconds - hours * 3600;\n // calculate minutes\n let mins = Math.floor((seconds / 60));\n seconds = seconds - mins * 60;\n // calculate seconds\n let secs = seconds % 60;\n\n function buildString(value, unit) {\n if (value > 0) {\n // return value + unit + s if more than 1 plus a comma\n return value + ' ' + unit + (value > 1 ? 's' : '') + ', ';\n }\n return '';\n }\n\n // build the string \n let date = buildString(years, 'year');\n date += buildString(days, 'day');\n date += buildString(hours, 'hour');\n date += buildString(mins, 'minute');\n date += buildString(secs, 'second');\n\n // remove trailing comma \n let i = date.lastIndexOf(\", \");\n date = date.substring(0, i);\n\n // replace last comma with and\n let j = date.lastIndexOf(\", \");\n // if there is a last comma then we replace it\n if (j > 0) {\n date = date.substring(0, j) + ' and ' + date.substring(j + 2);\n }\n return date;\n\n\n}", "title": "" }, { "docid": "58c86b517a8c3e7f379660809585ffbe", "score": "0.62969154", "text": "function formatTime(val) {\n var valString;\n secondsLabel = val % 60;\n //making shure seconds label has 2 digits if below 10 seconds\n if(secondsLabel.toString().length < 2){\n // adds 0 infront of seconds\n secondsLabel = \"0\" + secondsLabel;\n }\n minutesLabel = parseInt(val / 60);\n valString = minutesLabel + \":\" + secondsLabel;\n return valString;\n\n}", "title": "" }, { "docid": "cefa387a097aaf2dcc226692d5af0af6", "score": "0.62941253", "text": "function secondsToTime(secs) {\n var hours = Math.floor(secs / (60 * 60));\n\n var divisor_for_minutes = secs % (60 * 60);\n var minutes = Math.floor(divisor_for_minutes / 60);\n\n var divisor_for_seconds = divisor_for_minutes % 60;\n var seconds = Math.ceil(divisor_for_seconds);\n\n var strOut = \"\";\n if (hours > 0) { strOut += hours + ' hours '; }\n if (minutes > 0) { strOut += minutes + ' minutes '; }\n if (seconds > 0) { strOut += seconds + ' seconds'; }\n return strOut;\n}", "title": "" }, { "docid": "e7c3be5783338e6b9c3d816adef8e5aa", "score": "0.62887543", "text": "function timeFormat(timeInSeconds) {\n if (timeInSeconds === Number.POSITIVE_INFINITY) {\n return '';\n }\n var seconds = parseInt(timeInSeconds,10) % 60;\n var hours = parseInt(timeInSeconds / 3600, 10);\n var minutes = parseInt((timeInSeconds - hours * 3600) / 60, 10);\n\n if (hours < 10) {\n hours = '0' + hours;\n }\n\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n\n return (parseInt(hours,10) > 0) ? (hours + \":\" + minutes + \":\" + seconds) : (minutes + \":\" + seconds);\n }", "title": "" }, { "docid": "3510bdb2ef0f740c959f1c3e676dca9a", "score": "0.6288225", "text": "function formatTime() {\n let sec = second > 9 ? String(second) : \"0\" + String(second);\n let min = minute > 9 ? String(minute) : \"0\" + String(minute);\n displayTimer = `${min}:${sec}`;\n return displayTimer;\n}", "title": "" }, { "docid": "77d628e84654d35fa0cda2665df76c8d", "score": "0.62824994", "text": "function formatTime(time){\n time = Math.round(time);\n var minutes = Math.floor(time / 60),\n seconds = time - minutes * 60;\n seconds = seconds < 10 ? '0' + seconds : seconds;\n return minutes + \":\" + seconds;\n}", "title": "" }, { "docid": "2d4196a15252ff946d83225bed9c7ffe", "score": "0.6280289", "text": "function format(minutes, seconds) {\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n $('.time').html(\"<h2>\" + minutes + \":\" + seconds + \"</h2>\");\n }", "title": "" }, { "docid": "e27f4395b4920147d6826617891da25f", "score": "0.62775993", "text": "function formatTimestamp(ms){\r\n var d = new Date(ms);\r\n\r\n var seconds = align(d.getSeconds());\r\n var minutes = align(d.getMinutes());\r\n var hours = align(d.getHours());\r\n\r\n var days = align(d.getDate());\r\n var month = align(d.getMonth());\r\n var year = d.getFullYear();\r\n\r\n var s = year + \"-\" + month + \"-\" + days + \" \" + hours + \":\" + minutes + \":\" + seconds;\r\n\r\n return s;\r\n}", "title": "" }, { "docid": "d4d6f7bfd55f20c3bcb8b6a70e5be3db", "score": "0.62756306", "text": "function getStrTime(time) {\n return time.getMinutes() + \":\" + time.getSeconds() +\n \":\" + Math.round(time.getMilliseconds() / 10);\n}", "title": "" }, { "docid": "40bfd0c7ea63211bca6f70a6bd6713a2", "score": "0.62720495", "text": "function fancyTimeFormat(time) {\n // Hours, minutes and seconds\n //here second converting into hours like time=47000sec is 47000sec/(60*60)=1hrs and 1100sec that will be like time/3600\n var hrs = ~~(time / 3600);\n //and the left second are converted into minutes like 1100sec/60=18minutes and 20sec that will be (time%3600)/60=total minutea+left seconds\n var mins = ~~((time % 3600) / 60);\n //and the left Seconds now devided by 60 if not possible make it remenders like 20/60 not devisible so remaining seconds are 20 sec\n var secs = time % 60;\n //so the answer is 47000sec=1hrs 18 minutes and 20 seconds in following format\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\"; //here creates a local variable string with blank\n\n if (hrs > 0) { //condition check if hours values is greater then 0 then go for next\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\"); //if hour value is greater it shows time in this formate like 01: 18 : 20\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\"); //or if not hours it shows like this one 18 : 20\n ret += \"\" + secs; //if only seconds are presented in time variable the it will shows like 20\n return ret; //after that it will return the value to the function from local variable ret to the storge variable\n}", "title": "" }, { "docid": "b5092111cc2b93a7bc944c12c9cffb00", "score": "0.6268702", "text": "formatTime(time) {\n const minute = Math.floor(time / 60000);\n const second = Math.floor((time - minute * 60000) / 1000);\n const ms = Math.floor((time - minute * 60000 - second * 1000) / 1);\n const minStr = minute < 10 ? '0' + minute : '' + minute;\n const secStr = second < 10 ? '0' + second : '' + second;\n const msStr = ms < 100 ? (ms < 10 ? '00' + ms : '0' + ms) : '' + ms;\n return minStr + ':' + secStr + '.' + msStr;\n }", "title": "" }, { "docid": "69da7e8c69164d28127fe156f5845e22", "score": "0.6262929", "text": "s (date) {\n return date.getSeconds()\n }", "title": "" }, { "docid": "46888f58d38e39871cf3ec751b172ea8", "score": "0.626087", "text": "function formatTime(t) {\n let min = Math.floor(Math.abs(t)/60);\n let sec = Math.floor(Math.abs(t)%60);\n if (sec < 10) {\n sec = '0' + sec;\n }\n return min + ':' + sec; // returns string of time\n }", "title": "" }, { "docid": "fc37c2dc21520f6b594fe1bc319f8cbd", "score": "0.62505555", "text": "function formatSeconds(seconds)\n{\n var date = new Date(1970,0,1);\n date.setSeconds(seconds);\n return date.toTimeString().replace(/.*(\\d{2}:\\d{2}:\\d{2}).*/, \"$1\");\n}", "title": "" }, { "docid": "2ecab790c88b54e76cd393688b7316fb", "score": "0.6242897", "text": "timeToString(ms) {\n let start = ms < 60 * 60 * 1000 ? 14 : 11\n return new Date(ms).toISOString().slice(start, 19);\n }", "title": "" }, { "docid": "cda29b8123ee637cda0f38dfc2d8167c", "score": "0.62398857", "text": "function formatTime(time){ \n let minutes = Math.floor(time / 60);\n if(minutes < 10){\n minutes = \"0\"+minutes\n }\n let seconds = Math.floor(time - minutes * 60);\n if(seconds < 10){\n seconds = \"0\"+seconds\n }\n return `${minutes}:${seconds}`;\n }", "title": "" }, { "docid": "7cad873a15c952ee5aed5f54202e2439", "score": "0.6236538", "text": "function format_time(time) {\n\tvar m = Math.floor(time / 60000) % 60;\n\tvar s = Math.floor(time / 1000) % 60;\n\tvar ms = time % 1000;\n\treturn\t(m < 10 ? '0' + m : m) + ':' +\n\t\t\t\t\t\t\t(s < 10 ? '0' + s : s) + '.' +\n\t\t\t\t\t\t\t(ms < 10 ? '00' + ms : (ms < 100 ? '0' + ms : ms));\n}", "title": "" }, { "docid": "5020e4a62ad4c0e63e35e19c31e1d7b9", "score": "0.6234936", "text": "function getTimeString(seconds){\n var d = new Date(seconds*1000);\n var timestr = ( d.getFullYear() + '-' + \n ('0' + (d.getMonth() + 1)).slice(-2) + '-' + \n ('0' + d.getDate()).slice(-2) + ' ' +\n ('0' + d.getHours()).slice(-2) + ':' +\n ('0' + d.getMinutes()).slice(-2) + ':' +\n ('0' + d.getSeconds()).slice(-2));\n return timestr;\n}", "title": "" }, { "docid": "38d615f38325b8cde67b5eac4e4019e3", "score": "0.6234283", "text": "function formatTime(ms) {\n ms = ms % 86400000; // do not handle days\n const hours = Math.floor(ms / 3600000);\n ms = ms % 3600000;\n const minutes = Math.floor(ms / 60000);\n ms = ms % 60000;\n const seconds = Math.floor(ms / 1000);\n return `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`;\n}", "title": "" }, { "docid": "149ce1efd7a27bd31800f4cfbff85ccd", "score": "0.62286067", "text": "function getTimeString(d){\n\tvar diff = d;\n\tvar weeks = Math.floor(diff / 604800000);\n\tdiff -= weeks * 604800000;\n\tvar days = Math.floor(diff / 86400000);\n\tdiff -= days * 86400000;\n\tvar hours = Math.floor(diff / 3600000);\n\tdiff -= hours * 3600000;\n\tvar minutes = Math.floor(diff / 60000) + 1;\n\tdiff -= minutes * 60000;\n\tvar seconds = Math.floor(diff / 1000);\n\t//return days + ':' + hours + ':' + minutes + ':' + seconds;\n return weeks + ':' + days + ':' + hours + ':' + minutes;\n}", "title": "" }, { "docid": "8043ad27e87f247b4f8c68168767afb6", "score": "0.62275434", "text": "static fmtTime (format) {\n let date = new Date(format)\n let day = (date.getDate() < 10) ? `0${date.getDate()}` : date.getDate()\n let month = ((date.getMonth() + 1) < 10) ? `0${date.getMonth() + 1}` : date.getMonth() + 1\n let hours = (date.getHours() < 10) ? `0${date.getHours()}` : date.getHours()\n let minutes = (date.getMinutes() < 10) ? `0${date.getMinutes()}` : date.getMinutes()\n let seconds = (date.getSeconds() < 10) ? `0${date.getSeconds()}` : date.getSeconds()\n let final = `${date.getFullYear()}-${month}-${day} ${hours}:${minutes}:${seconds}`\n return final\n }", "title": "" }, { "docid": "726b15c3db6302004eaba662d84ac391", "score": "0.6225472", "text": "function displayableTime(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n \n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n if (minutes === 0) {\n minutes = \"00\";\n }\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n \n return minutes + \":\" + seconds;\n }", "title": "" }, { "docid": "e09091b0be0200fe5ca8ded5a156dcd7", "score": "0.62220645", "text": "get_date_string(seconds){\n var date = new Date();\n date.setHours(0,0);\n date.setTime(date.getTime() + seconds*1000);\n return date.toISOString();\n }", "title": "" }, { "docid": "30e122f607f68623891bc3ab78936e08", "score": "0.6215196", "text": "function secsToTime(seconds) {\n\tlet z = n => (n<10? '0' : '') + n; \n\treturn (seconds / 3600 | 0) + ':' +\n\t\t z((seconds % 3600) / 60 | 0)\n }", "title": "" }, { "docid": "4da818b4f8e81ef7a6c9bcd3a323694d", "score": "0.6214369", "text": "function tstodate(ts){\n var a = new Date(ts*1000);\n var now = new Date();\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n\n var time='';\n if(a.getMonth()!=now.getMonth() || date!=now.getDate()){\n time+=date+' '+month;\n if(year!=now.getFullYear()){\n time+=' '+year;\n }\n time+=', ';\n }\n\n if(hour<10){hour='0'+hour;}\n if(min<10){min='0'+min;}\n if(sec<10){sec='0'+sec;}\n time += hour+':'+min+':'+sec ;\n return time;\n}", "title": "" }, { "docid": "1952c3b14a97f5c4838440cc41e58abc", "score": "0.6213005", "text": "function timeFormat(totalSeconds) {\n let seconds = (totalSeconds < 60) ? Math.floor(totalSeconds) : Math.floor(totalSeconds % 60);\n seconds = (Math.floor(totalSeconds % 60) < 10) ? \"0\" + seconds : seconds;\n let minutes = (totalSeconds < 60) ? Math.floor(totalSeconds / 60) : Math.floor(totalSeconds / 60);\n minutes = (Math.floor(totalSeconds / 60) < 10) ? \"0\" + minutes : minutes;\n return {\n seconds: seconds,\n minutes: minutes,\n }\n}", "title": "" }, { "docid": "bc2c945b27dc09a5be9dc31711ab048e", "score": "0.62109923", "text": "function secsToString(count){\n return Math.floor(count/60) + \"m \" + count%60 + \"s\";\n}", "title": "" }, { "docid": "437a34932c1d8107ff05213d142ec847", "score": "0.62099886", "text": "function getCurrentTimeFormatted() {\n var curDateTime = new Date().toISOString(); // Keeping same as iso string\n\n /* let curDate = curDateTime.split(\"T\")[0];\n let curTimeExceptMillis = curDateTime\n .split(\"T\")[1]\n .split(\"Z\")[0]\n .split(\".\")[0];\n let curTimeMillis = curDateTime.split(\"Z\")[0].split(\".\")[1];\n return curDate + \" \" + curTimeExceptMillis + \"+\" + curTimeMillis; */\n\n return curDateTime;\n }", "title": "" }, { "docid": "348a443f84981e4a2bc5f545f3b6d330", "score": "0.6192885", "text": "function getTime(){\n let date = new Date();\n let hour = formatTime(date.getHours());\n let min = formatTime(date.getMinutes());\n let sec = formatTime(date.getSeconds());\n timeFormat == 0 ? display12HrTime(hour, min, sec) : display24HrTime(hour, min, sec)\n}", "title": "" } ]
c9bcbf42fca201bb3642bcb355e43782
Processes the info received from the ACNH API and displays it in the DOM based on time and weather
[ { "docid": "ae2722b599d7ccbfabd2716a75763864", "score": "0.0", "text": "function processAudioData(time, bgmData, weatherDesc) {\n\tlet keys = Object.keys(bgmData)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tif (bgmData[keys[i]].hour == time.getHours()) {\n\t\t\tlet weatherBGM = determineWeather(weatherDesc)\n\t\t\tif (weatherBGM == bgmData[keys[i]].weather) {\n\t\t\t\taudioSource.src = bgmData[keys[i]].music_uri\n\t\t\t\taudioHtml.load()\n\t\t\t\taudioPlayer.style.display = 'block'\n\t\t\t\taudioHtml.play()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "a3144ff5413f3ede42f39622470239be", "score": "0.720972", "text": "function showWeather (response) {\n console.log(response.data)\n let currentTemp = Math.round(response.data.main.temp);\n let currentFeelsLike = Math.round(response.data.main.feels_like);\n let currentHumidity = response.data.main.humidity;\n let currentPressure = response.data.main.pressure;\n let currentWeather = (response.data.weather[0]).description;\n let city = response.data.name;\n let country = response.data.sys.country;\n\n let tempElement = document.querySelector(\".current-temperature\");\n let weatherElement = document.querySelector(\".current-weather\");\n let feelsLikeElement = document.querySelector(\".current-feels-like\");\n let humidityElement = document.querySelector(\".current-humidity\");\n let pressureElement = document.querySelector(\".current-pressure\");\n\n let h1City = document.querySelector(\"h1\");\n h1City.innerHTML = `${city}, ${country}` || h1City.innerHTML;\n\n tempElement.innerHTML = currentTemp;\n weatherElement.innerHTML = currentWeather;\n feelsLikeElement.innerHTML = currentFeelsLike;\n humidityElement.innerHTML = currentHumidity;\n pressureElement.innerHTML = currentPressure;\n}", "title": "" }, { "docid": "435b06d91cac3d9a866b01e9fe76a5c7", "score": "0.72037816", "text": "function showWeather(response) {\n let fahrenheit = response.data.main.temp;\n let temperature = Math.round(fahrenheit);\n let headTemp = `${temperature}°<small>F</small>`;\n let h2 = document.querySelector(\"h2\");\n h2.innerHTML = headTemp;\n\n let maxTemp = response.data.main.temp_max;\n let minTemp = response.data.main.temp_min;\n let highLow = ` H:${Math.round(maxTemp)}° L:${Math.round(minTemp)}°`;\n let hl = document.querySelector(\".topHighLow\");\n hl.innerHTML = highLow;\n\n let time = document.querySelector(\".time\");\n time.innerHTML = `Last updated: ${formatDate(response.data.dt * 1000)}`;\n \n let description =(response.data.weather[0].description);\n let weatherDescription = document.querySelector(\".weather-description\");\n weatherDescription.innerHTML = `Description: ${description}`;\n\n let mph = response.data.wind.speed;\n let windSpeed = Math.round(mph);\n let speed = document.querySelector(\".wind\");\n speed.innerHTML = `Wind Speed: ${windSpeed} mph`;\n \n let humidity =(response.data.main.humidity);\n let humid = document.querySelector(\".humidity\");\n humid.innerHTML = `Humidity: ${humidity}%`;\n \n let icon =document.querySelector(\".topIcon\");\n icon.innerHTML =`${iconTemplate(response.data.weather[0].icon)}`;\n \n getForecast(response.data);\n}", "title": "" }, { "docid": "59e2bdf8ebd0c820fd194b583688caa6", "score": "0.7202581", "text": "function weatherData(response) {\n if(response.results[0]){\n document.getElementById('weather').textContent = response.results[0].atmo_opacity;\n document.getElementById('lowTemp').textContent = response.results[0].min_temp_fahrenheit + \"\\u00B0F\";\n document.getElementById('highTemp').textContent = response.results[0].max_temp_fahrenheit + \"\\u00B0F\";\n document.getElementById('humidity').textContent = response.results[0].abs_humidity;\n document.getElementById('pressure').textContent = response.results[0].pressure;\n document.getElementById('wind_speed').textContent = response.results[0].wind_speed;\n } else {\n document.getElementById('weather').textContent = \"\";\n document.getElementById('lowTemp').textContent = \"\";\n document.getElementById('highTemp').textContent = \"\";\n document.getElementById('humidity').textContent = \"\";\n document.getElementById('pressure').textContent = \"\";\n document.getElementById('wind_speed').textContent = \"\";\n }\n}", "title": "" }, { "docid": "d2a7f2d682f38ca5894ef4fa67e9e1a3", "score": "0.71957874", "text": "function displayWeather(response) {\n document.querySelector(\"#show-city\").innerHTML = response.data.name;\n document.querySelector(\"#degree\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"h3\").innerHTML = response.data.weather[0].main;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document.querySelector(\"#humid\").innerHTML = response.data.main.humidity;\n}", "title": "" }, { "docid": "1a134d71d4ac2458ae9d91ee80765ddb", "score": "0.7184533", "text": "function displayTemp(response) {\n console.log(response.data);\n let currentTempElement = document.querySelector(\"#currentTemp\");\n currentTempElement.innerHTML = Math.round(celsiusTemp);\n\n celsiusTemp = response.data.main.temp;\n\n let currentCityElement = document.querySelector(\"#currentCity\");\n currentCityElement.innerHTML = response.data.name;\n\n let weatherDescriptionElement = document.querySelector(\"#weatherDescription\");\n\n weatherDescriptionElement.innerHTML = response.data.weather[0].description;\n\n let humidityElement = document.querySelector(\"#humidity\");\n humidityElement.innerHTML = response.data.main.humidity;\n\n let windElement = document.querySelector(\"#wind\");\n windElement.innerHTML = Math.round(response.data.wind.speed);\n\n let dateElement = document.querySelector(\"#current-date-time\");\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n\n let iconElement = document.querySelector(\"#weather-icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n}", "title": "" }, { "docid": "af4e4bb8997c756080b72c695fd9ccd2", "score": "0.7159651", "text": "function displayCity(response) {\n let h1 = document.querySelector(\"h1\");\n h1.innerHTML = response.data.name;\n let currentTemp = document.querySelector(\"h2\");\n currentTemp.innerHTML = Math.round(response.data.main.temp);\n let descriptionDay = document.querySelector(\"#description\");\n descriptionDay.innerHTML = response.data.weather[0].description;\n let minTemp = document.querySelector(\"#minTemp\");\n minTemp.innerHTML = Math.round(response.data.main.temp_min);\n let maxTemp = document.querySelector(\"#maxTemp\");\n maxTemp.innerHTML = Math.round(response.data.main.temp_max);\n let feelsLike = document.querySelector(\"#feelsLike\");\n feelsLike.innerHTML = Math.round(response.data.main.feels_like);\n let humitidy = document.querySelector(\"#humidity\");\n humidity.innerHTML = response.data.main.humidity;\n\n celsiusTemp = response.data.main.temp;\n let iconElement = document.querySelector(\"#iconHeading\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "4d95e8b37194e693280068a0f5a259d1", "score": "0.7142028", "text": "function displayWeatherConditions(response) {\n\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#country\").innerHTML = response.data.sys.country;\n document.querySelector(\"#temperature\").innerHTML = Math.round(response.data.main.temp);\n document.querySelector(\"#weather-description\").innerHTML = response.data.weather[0].description;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(response.data.wind.speed);\n document.querySelector(\"#temp-max\").innerHTML = Math.round(response.data.main.temp_max);\n document.querySelector(\"#temp-min\").innerHTML = Math.round(response.data.main.temp_min);\n document.querySelector(\"#feels-like\").innerHTML = Math.round(response.data.main.feels_like);\n \n}", "title": "" }, { "docid": "538561cc5077e3da9d4fd73b717ece91", "score": "0.7139902", "text": "function displayData(response) {\n temperature = response.data.main.temp;\n document.querySelector(\"#current-temperature\").innerHTML =\n Math.round(temperature);\n document.querySelector(\"#city-name\").innerHTML = response.data.name;\n document.querySelector(\"#feels-like\").innerHTML = Math.round(\n response.data.main.feels_like\n );\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].main;\n\n document.querySelector(\"#time\").innerHTML = formatTime(\n response.data.dt * 1000\n );\n document\n .querySelector(\"#icon\")\n .setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n document\n .querySelector(\"#icon\")\n .setAttribute(\"alt\", response.data.weather[0].main);\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "9fa42bf3712753e022c9beb58afdd482", "score": "0.7128085", "text": "function showTemp(response) {\n let city = response.data.name;\n tempC = Math.round(response.data.main.temp);\n let description = response.data.weather[0].description;\n let humidity = response.data.main.humidity;\n let wind = Math.round(response.data.wind.speed);\n let icon = document.querySelector(\"#current-icon\");\n console.log(description);\n let h2 = document.querySelector(\"#current-city\");\n h2.innerHTML = `Current City: ${city}`;\n\n let dateElement = document.querySelector(\"#date\");\n let displayTemp = document.querySelector(\"#temperature\");\n let displayDescrip = document.querySelector(\"#describe\");\n let displayHumidity = document.querySelector(\"#humidity\");\n let displayWind = document.querySelector(\"#wind\");\n displayTemp.innerHTML = `${tempC}`;\n displayDescrip.innerHTML = `${description}`;\n displayHumidity.innerHTML = `${humidity}`;\n displayWind.innerHTML = `${wind}`;\n dateElement.innerHTML = currentDate();\n icon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n icon.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "61f5c0126bf222157a707e599fa79722", "score": "0.712552", "text": "function showWeather(response) {\n //console.log(response.data);\n let city = document.querySelector(\"#city\");\n let temperature = document.querySelector(\"#temperature\");\n let weatherDescription = document.querySelector(\"#weather-description\");\n let humidity = document.querySelector(\"#humidity\");\n let wind = document.querySelector(\"#wind\");\n city.innerHTML = response.data.name;\n temperature.innerHTML = Math.round(response.data.main.temp);\n weatherDescription.innerHTML = response.data.weather[0].main;\n humidity.innerHTML = response.data.main.humidity;\n wind.innerHTML = response.data.wind.speed;\n}", "title": "" }, { "docid": "ff46ccf2073d4ae5fe8580bfe64cfd1e", "score": "0.7105125", "text": "function displayWeatherInfo(){ \n var weather = $(this).attr(\"data-name\");\n\n // other api key\n // var APIKey = \"166a433c57516f51dfab1f7edaed8413\";\n\n // my api key\n var APIKey = \"513fc90bd741df712ec9a2ee8086222d\";\n\n\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?\" +\n \"q=\" + weather + \",Burundi&units=imperial&appid=\" + APIKey;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(response);\n\n var tempF = (response.main.temp - 273.15) * 1.80 + 32;\n $(maintemperature).text(\"Temperature (Kelvin) \" + tempF);\n\n console.log(\"Wind Speed: \" + response.wind.speed);\n console.log(\"Humidity: \" + response.main.humidity);\n console.log(\"Temperature (F): \" + response.main.temp);\n \n var lat = response.coord.lat;\n var lon = response.coord.lon;\n getuvindex(APIKey, lat, lon)\n getfiveday(weather)\n \n\n $(maintemperature).empty();\n $(mainlocation).empty();\n $(mainhumidity).empty();\n $(mainwind).empty();\n $(date1).empty();\n $(temp1).empty();\n $(hum1).empty();\n $(date2).empty();\n $(temp2).empty();\n $(hum2).empty();\n $(date3).empty();\n $(temp3).empty();\n $(hum3).empty();\n $(date4).empty();\n $(temp4).empty();\n $(hum4).empty();\n $(date5).empty();\n $(temp5).empty();\n $(hum5).empty();\n\n $(maintemperature).append(response.main.temp + \"F\");\n $(mainlocation).append(response.name);\n $(mainhumidity).append(response.main.humidity);\n $(mainwind).append(response.wind.speed);\n })\n}", "title": "" }, { "docid": "43e6c009a7010c5518058a83b0a844dc", "score": "0.7075039", "text": "function formatData(wResponse) {\r\n let temp = tempConvert(wResponse.main.temp);\r\n let feelsLike = tempConvert(wResponse.main.feels_like); // Feels like (kelvin)\r\n\r\n let humidity = wResponse.main.humidity; // Humidity (%)\r\n let pressure = wResponse.main.pressure; // Pressure (hPa)\r\n\r\n let city = wResponse.name; // City name\r\n let country = wResponse.sys.country; // Country name\r\n let description = wResponse.weather[0].description; // Description (two words)\r\n let iconid = wResponse.weather[0].icon; // icon ID\r\n let icon = `http://openweathermap.org/img/wn/${iconid}@2x.png`; // icon URL\r\n\r\n let sunrise = wResponse.sys.sunrise; // Sunrise (unix timestamp)\r\n let sunset = wResponse.sys.sunset; // Sunset (unix timestamp)\r\n let fsunrise = timeConvert(sunrise); // Sunrise (00:00)\r\n let fsunset = timeConvert(sunset); // Sunset (00:00)\r\n\r\n // If rain is available, get it:\r\n let rain;\r\n if (wResponse.rain) {\r\n rain = wResponse.rain[\"1h\"]; // Rain for the past hour (ml)\r\n }\r\n\r\n // Convert unix timestamp to UTC\r\n function timeConvert(unix) {\r\n var date = new Date(unix * 1000);\r\n var hours = date.getHours();\r\n var minutes = date.getMinutes();\r\n return `${hours}:${minutes}`;\r\n }\r\n\r\n // Temperature conversions\r\n\r\n function tempConvert(temp) {\r\n let newTemp;\r\n if (dat === 'c') {\r\n newTemp = `${Math.round(temp - 273.15)}&degC`;\r\n }\r\n if (dat === 'f') {\r\n newTemp = `${Math.round((temp - 273.15) * 9 / 5 + 32)}&degF`;\r\n }\r\n if (dat === 'k') {\r\n newTemp = `${temp}K`;\r\n }\r\n return newTemp;\r\n }\r\n\r\n wait = 0\r\n loadIntoDOM(temp, feelsLike, humidity, pressure, city, country, description, icon, fsunrise, fsunset, rain);\r\n isLoading();\r\n }", "title": "" }, { "docid": "11377c8e893ad1dfcde36fc9121ee710", "score": "0.7056522", "text": "function display() {\n if (httpsAdapter.readyState == 4)\n {\n var weather = httpsAdapter.responseText;\n //console.log(weather);\n var weatherObj = JSON.parse(weather);\n console.log(weatherObj);\n document.getElementById(\"city\").innerHTML = weatherObj.name;\n document.getElementById(\"temp\").innerHTML = \"<span><b>Temperature: </b></span> \" + weatherObj.main.temp + \"&deg;\";\n document.getElementById(\"high\").innerHTML = \"<span><b>Temperature High: </b></span> \" + weatherObj.main.temp_max + \"&deg;\";\n document.getElementById(\"low\").innerHTML = \"<span><b>Temperature Low: </b></span> \" + weatherObj.main.temp_min + \"&deg;\";\n document.getElementById(\"humidity\").innerHTML = \"<span><b>Humidity: </b></span> \" + weatherObj.main.humidity + \"&#37;\";\n document.getElementById(\"skyConditions\").innerHTML = \"<span><b>Sky Condition: </b></span> \" + weatherObj.weather[0].description;\n document.getElementById(\"wind\").innerHTML = \"<span><b>Wind Speed: </b></span> \" + weatherObj.wind.speed + \" mph\";\n }\n}", "title": "" }, { "docid": "fa7f9f68d123d2b90e4d147ce6ce3fb9", "score": "0.7013096", "text": "function weatherInfo() {\n var time = json.daily.data[i].time;\n var date = new Date(time * 1000);\n dayArray.push(weekday[date.getDay()]);\n var weatherIcon = json.daily.data[i].icon;\n iconArray.push(weatherIcon);\n tempArray.push(json.daily.data[i].apparentTemperatureMax);\n $(\"#forecast\").html(json.hourly.summary);\n\n }", "title": "" }, { "docid": "94a608a0ab0399620117a3ab46ef166b", "score": "0.7009247", "text": "function showData(response) {\n let temperature = Math.round(response.data.main.temp);\n let city = response.data.name;\n\n let humidity = response.data.main.humidity;\n let wind = Math.round(response.data.wind.speed * 3.6); //default is m/s\n\n let currentLocation = document.querySelector(\"#city-location\");\n currentLocation.innerHTML = `${city}`;\n\n let currentTemp = document.querySelector(\".current-temperature\");\n currentTemp.innerHTML = `${temperature}`;\n\n let currentHumidity = document.querySelector(\"#humidity\");\n currentHumidity.innerHTML = `${humidity} %`;\n\n let currentWind = document.querySelector(\"#wind\");\n currentWind.innerHTML = `${wind} km/h`;\n}", "title": "" }, { "docid": "20c231d517558b0accc203cae93820f6", "score": "0.6986513", "text": "function displayWeather(response) {\n document.querySelector(\n \"#cityHeader\"\n ).innerHTML = `Weather in ${response.data.name}`;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n}", "title": "" }, { "docid": "fd08f43e638e9999f3cd9bca1710e1aa", "score": "0.69766825", "text": "function displayCurrentWeather(response) {\n console.log(response.data);\n let location = response.data.name;\n let locationName = document.querySelector(\"#city\");\n locationName.innerHTML = `${location}`;\n\n let description = response.data.weather[0].description;\n let descriptionElement = document.querySelector(\"#description\");\n descriptionElement.innerHTML = `${description}`;\n\n let temperature = Math.round(response.data.main.temp);\n let currentTemp = document.querySelector(\".temperature-value\");\n currentTemp.innerHTML = `${temperature}`;\n\n let feelLike = Math.round(response.data.main.feels_like);\n let feelLikeTemp = document.querySelector(\".feel-like\");\n feelLikeTemp.innerHTML = `Feels like ${feelLike}ºC`;\n\n let max = Math.round(response.data.main.temp_max);\n let maxTemp = document.querySelector(\"#max\");\n maxTemp.innerHTML = `High ↑ ${max} ºC`;\n\n let min = Math.round(response.data.main.temp_min);\n let minTemp = document.querySelector(\"#min\");\n minTemp.innerHTML = `Low ↓ ${min} ºC`;\n\n let humidity = response.data.main.humidity;\n let humidityPercentage = document.querySelector(\"#humidity\");\n humidityPercentage.innerHTML = `Humidity ${humidity}%`;\n\n let wind = Math.round(response.data.wind.speed);\n let windSpeed = document.querySelector(\"#wind-speed\");\n windSpeed.innerHTML = `Wind ${wind} km/h`;\n\n let dateElement = document.querySelector(\"#date\");\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n\n let timeElement = document.querySelector(\"#time\");\n timeElement.innerHTML = formatHours(response.data.dt * 1000);\n\n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n celsiusTemperature = response.data.main.temp;\n\n maxTemperature = response.data.main.temp_max;\n\n minTemperature = response.data.main.temp_min;\n\n feelLikeTemperature = response.data.main.feels_like;\n}", "title": "" }, { "docid": "bc7efd2b22d5b2acf355671eb3f0f785", "score": "0.6971304", "text": "function displayCurrentWeather(response) {\n\n // City, country, local time\n document.querySelector(\"#city-and-country\").innerHTML = response.data.name + \", \" + response.data.sys.country;\n document.querySelector(\"#current-date-and-time\").innerHTML = formatDate(new Date(), response.data.timezone);\n \n // Current weather icon, description and current temperature (including maximum and minimum temperatures)\n document\n .querySelector(\"#current-weather-icon\")\n .setAttribute(\"src\", getIcon(response.data.weather[0].icon));\n \n document.querySelector(\"#current-weather-description\").innerHTML = response.data.weather[0].description;\n \n celsiusTemperature = response.data.main.temp;\n document.querySelector(\"#current-temperature\").innerHTML =`${Math.round(celsiusTemperature) + \"°\"}`;\n\n document.querySelector(\"#maximum-temperature\").innerHTML =\" \" + Math.round(response.data.main.temp_max) + \"°\";\n document.querySelector(\"#minimum-temperature\").innerHTML =\" \" + Math.round(response.data.main.temp_min) + \"°\";\n celsiusMaxTemperature = response.data.main.temp_max;\n celsiusMinTemperature = response.data.main.temp_min;\n \n // Additional weather details\n document.querySelector(\"#real-feel\").innerHTML = \" \" + Math.round(response.data.main.feels_like) + \"°\";\n celsiusTemperatureFeelsLike = response.data.main.feels_like;\n \n document.querySelector(\"#humidity\").innerHTML = \" \" + response.data.main.humidity + \"%\";\n document.querySelector(\"#wind\").innerHTML = \" \" + Math.round(response.data.wind.speed) + \" km/h\";\n \n let longitude = response.data.coord.lon;\n let latitude = response.data.coord.lat;\n fetchDailyForecast(latitude, longitude);\n}", "title": "" }, { "docid": "c299f34fd88f1c9938e9c5af53686d4f", "score": "0.69614464", "text": "function displayWeather(){\r\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?\" + \"q=\" + city + \"&appid=\" + \"166a433c57516f51dfab1f7edaed8413\";\r\n\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function(response) {\r\n //console log to view object returned by API call\r\n console.log(response);\r\n \r\n var cityDiv = $(\"<div class='city'>\");\r\n //convert degrees K to degrees F\r\n var Ftemp = (response.main.temp - 273.15) *1.8 +32;;\r\n var humidity = (response.main.humidity);\r\n var windSpeed = (response.wind.speed);\r\n \r\n //generates html to page\r\n var hOne = $(\"<h3>\").text(\"Current weather conditions for \" + city);\r\n var pOne = $(\"<p>\").text(\"Temperature: \" + Ftemp.toFixed(0) + \" °F\");\r\n var pTwo = $(\"<p>\").text(\"Humidity: \" + humidity + \"%\");\r\n var pThree = $(\"<p>\").text(\"Wind Speed: \" + windSpeed.toFixed(0) + \" m.p.h.\");\r\n var hTwo = $(\"<h4>\").text(\"5-Day Forecast for \" + city);\r\n \r\n cityDiv.append(hOne, pOne, pTwo, pThree, hTwo);\r\n \r\n //removes prior weather info and updates with latest city click\r\n $(\"#current-weather\").empty();\r\n $(\"#current-weather\").prepend(cityDiv);\r\n\r\n uvNice(response.coord.lat, response.coord.lon);\r\n });\r\n }", "title": "" }, { "docid": "dcf386112d358c3b6f05cd137a2e1625", "score": "0.6951955", "text": "function ShowCityTemp(response) {\n let located_city = document.querySelector(\"h2\");\n let FullDate = document.querySelector(\"#full-date\");\n let month = update.getMonth() + 1;\n let Day = update.getDate();\n let year = update.getFullYear();\n let fullDate = `${month}/${Day}/${year}`;\n let dateElement = document.querySelector(\"#time\");\n let windDirect = document.querySelector(\"#direction\");\n let wind = document.querySelector(\"#wind\");\n let precip = document.querySelector(\"#precip\");\n let temp = document.querySelector(\".current\");\n let iconElement = document.querySelector(\"#icon\");\n let iconInfo = document.querySelector(\"#iconInfo\");\n let iconID = response.data.weather[0].icon;\n let highTemp = document.querySelector(\"#high\");\n let lowTemp = document.querySelector(\"#low\");\n let RealFeel = document.querySelector(\"#Real-feel\");\n let sunrise = document.querySelector(\"#sunrise\");\n let sunset = document.querySelector(\"#sunset\");\n ////////////////////////////////////////////////////\n FahrenheitTemp = response.data.main.temp;\n HighTemp = response.data.main.temp_max;\n LowTemp = Math.round(response.data.main.temp_min);\n Feel = response.data.main.feels_like;\n located_city.innerHTML = response.data.name;\n temp.innerHTML = Math.round(FahrenheitTemp);\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n FullDate.innerHTML = fullDate;\n windDirect.innerHTML = response.data.wind.deg;\n wind.innerHTML = Math.round(response.data.wind.speed);\n precip.innerHTML = response.data.main.humidity;\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconID}@2x.png`\n );\n iconInfo.innerHTML = response.data.weather[0].description.toUpperCase();\n highTemp.innerHTML = Math.round(HighTemp);\n lowTemp.innerHTML = Math.round(LowTemp);\n RealFeel.innerHTML = Math.round(Feel);\n sunrise.innerHTML = FormatHours(response.data.sys.sunrise * 1000);\n sunset.innerHTML = FormatHours(response.data.sys.sunset * 1000);\n //FUnction Calls for Funny sayings function\n let Ftemp = temp.innerHTML;\n Funny(Ftemp);\n let InfoIcon = iconInfo.innerHTML;\n FunnyPT2(InfoIcon);\n //Function for wind direcitions\n let windCode = windDirect.innerHTML;\n windDirection(windCode);\n console.log(windCode);\n}", "title": "" }, { "docid": "08f0635c5709b2562771c3c5ad44ffc0", "score": "0.69305605", "text": "function displayWeather(weather) {\n // displaying place name and country\n console.log(weather);\n let location = document.querySelector(\"#loc\");\n location.textContent = `${weather.name} , ${weather.sys.country}`;\n\n // displaying date\n let today = new Date();\n let date = document.querySelector(\"#date\");\n date.textContent = dateCreator(today);\n\n // displaying temperature\n let temperature = document.querySelector(\"#temp\");\n temperature.textContent = `${Math.round(weather.main.temp)} °C `;\n\n //displaying sky weather\n let sky = document.querySelector(\"#sky\");\n sky.textContent = `${weather.weather[0].description}`;\n\n // displaying max-min temperature\n let maxmin = document.querySelector(\"#max-min\");\n maxmin.textContent = `${Math.round(weather.main.temp_max)} °C / ${Math.round(\n weather.main.temp_min\n )} °C `;\n\n // displaying wind speed\n let windSpeed = document.querySelector(\"#wind-speed\");\n windSpeed.textContent = `wind speed ${weather.wind.speed}`;\n\n //displaying sunrise and sunset time\n const sunrise = gethumanreadbleTime(weather.sys.sunrise);\n document.getElementById(\"sunrise-time\").textContent = sunrise;\n const sunset = gethumanreadbleTime(weather.sys.sunset);\n document.getElementById(\"sunset-time\").textContent = sunset;\n}", "title": "" }, { "docid": "b18df89dc7f62b7560f2f8d51b2beb7a", "score": "0.68899304", "text": "function displayCityInfo() {\n var cityName = $(this).attr(\"data-name\");\n var queryURL = \"http://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&appid=\" + apiKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n //$(\"#weather-view\").text(JSON.stringify(response));\n console.log((response));\n var temp = ((response.main.temp) - 273.15) * 9/5 + 32;\n //console.log(\"temp: \"+temp.toFixed(2));\n\n var temp_p = $(\"<p>\");\n temp_p.text(\"Temperature: \"+temp.toFixed(2)+\"F\");\n\n var humid_p = $(\"<p>\");\n humid_p.text(\"Humidity: \"+response.main.humidity);\n\n var wind_p = $(\"<p>\");\n wind_p.text(\"Wind Speed: \"+response.wind.speed);\n\n /*var uv_p = $(\"<p>\");\n uv_p.text(\"UV Index: \"+response.)*/\n\n $(\".current\").append(temp_p, humid_p, wind_p);\n });\n }", "title": "" }, { "docid": "8e107ee4d23736cb9d2f3164a06c6db3", "score": "0.6876262", "text": "function displayCurrentWeather(response) {\n console.log(response.data);\n console.log(response.data.main.temp);\n let temperature = Math.round(response.data.main.temp);\n let temperatureNow = document.querySelector(\"#today-temperature\");\n let currentLocation = response.data.name;\n let currentLocationNow = document.querySelector(\"h2\");\n currentLocationNow.innerHTML = `${currentLocation}`;\n temperatureNow.innerHTML = `${temperature}°C`;\n}", "title": "" }, { "docid": "dcfa9c88d11e1ddd7e6f729efe4d6159", "score": "0.6864706", "text": "function showTemperature(response) {\n //FORECAST COORDINATES //\n getForecast(response.data.coord);\n\n temp = response.data.main.temp;\n let temperature = document.querySelector(\"#main-temp-display\");\n temperature.innerHTML = Math.floor(temp);\n\n // Display City Name//\n document.querySelector(\"#city-name\").innerHTML =\n response.data.name.toUpperCase();\n\n // Display Icon//\n let icon = document.querySelector(\"#main-icon\");\n icon.setAttribute(\"src\", `images/${response.data.weather[0].icon}.svg`);\n\n // Display Main Description//\n let weatherDescription = response.data.weather[0].description;\n let description = document.querySelector(\"#weather-description\");\n description.innerHTML = weatherDescription;\n\n // Display Humidity Description//\n let humidityValue = response.data.main.humidity;\n let humidity = document.querySelector(\"#humidity\");\n humidity.innerHTML = `Humidity is ${humidityValue}%`;\n\n // Display Wind Description//\n let windSpeed = response.data.wind.speed;\n let realFeel = Math.round(response.data.main.feels_like);\n let wind = document.querySelector(\"#wind\");\n wind.innerHTML = `Wind speed ${windSpeed}mph, Feels like ${realFeel}°C`;\n}", "title": "" }, { "docid": "0b0152d9ef4d73c093cf70e4aa99ded8", "score": "0.6864187", "text": "function showWeather(response) {\n console.log(response);\n let cityName = document.querySelector(\"#city-name\");\n let pageTitle = document.querySelector(\"title\");\n cityName.innerHTML = `${response.data.name}`;\n pageTitle.innerHTML = `Current Weather in ${response.data.name}`;\n\n let currTemp = document.getElementById(\"current-temp\");\n currTemp.innerHTML = `${Math.round(response.data.main.temp)}°`;\n\n let feelsLike = document.getElementById(\"feels-like-temp\");\n feelsLike.innerHTML = `${Math.round(response.data.main.feels_like)}°`;\n feelsLike.classList.add(\"bold\");\n\n let currCond = document.getElementById(\"current-cond\");\n currCond.innerHTML = `${response.data.weather[0].main}`;\n currCond.classList.add(\"bold\");\n\n let currHumidity = document.getElementById(\"current-humidity\");\n currHumidity.innerHTML = `${response.data.main.humidity}%`;\n currHumidity.classList.add(\"bold\");\n\n let currWindDir = document.getElementById(\"current-wind-dir\");\n currWindDir.innerHTML = `${windDirCompass(response.data.wind.deg)}`;\n currWindDir.classList.add(\"bold\");\n\n let currWindSpeed = document.getElementById(\"current-wind-speed\");\n currWindSpeed.innerHTML = `${Math.round(response.data.wind.speed)} mph`;\n currWindSpeed.classList.add(\"bold\");\n\n let currentConditionIcon = document.querySelector(\"#cond-icon\");\n let conditionId = response.data.weather[0].id;\n let time = response.data.dt;\n let sunset = response.data.sys.sunset;\n let sunrise = response.data.sys.sunrise;\n console.log(conditionId, time, sunrise, sunset);\n currentConditionIcon.setAttribute(\n \"class\",\n `${weatherIcon(conditionId, time, sunset, sunrise)}`\n );\n\n backgroundChange(time, sunrise, sunset);\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "83acf5e234cccc74c817a5606dbb0abb", "score": "0.68622553", "text": "function displayWeatherCondition(response){\n document.querySelector(\".city\").innerHTML = response.data.name;\n document.querySelector(\".description\").innerHTML = response.data.weather[0].description;\n let iconElement = document.querySelector(\"#icon\");\n let temperatureElement = document.querySelector(\".degrees\")\n dateElement = document.querySelector(\"#date\");\n let humidityElement = document.querySelector(\".humidity\");\n let windElement = document.querySelector(\".wind\");\n celsiusTemperature = response.data.main.temp;\n temperatureElement.innerHTML = Math.round (celsiusTemperature);\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n let temperatureUnit = document.querySelector(\".units\");\n temperatureUnit.innerHTML = `ºC`\n iconElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\",response.data.weather[0].description);\n dateElement.innerHTML= formatDate(response.data.dt * 1000);\n}", "title": "" }, { "docid": "cbbd8736d1e219a6c6a2a779c006699d", "score": "0.68602645", "text": "function displayCurrentWeather(response) {\n let currentWeatherDescription = document.getElementById(\n \"current-description\"\n );\n let currentTemperature = document.getElementById(\"current-temperature\");\n currentTemperature.innerHTML = Math.round(response.data.current.temp);\n currentWeatherDescription.innerHTML =\n response.data.current.weather[0].description;\n let cloudiness = document.getElementById(\"cloudiness\");\n let feelsLike = document.getElementById(\"feels-like\");\n let humidity = document.getElementById(\"humidity\");\n let pressure = document.getElementById(\"pressure\");\n let sunrise = document.getElementById(\"sunrise\");\n let sunset = document.getElementById(\"sunset\");\n let tempMax = document.getElementById(\"temp-max\");\n let tempMin = document.getElementById(\"temp-min\");\n let wind = document.getElementById(\"wind\");\n let windDirection = getCardinalDirectionArrow(response.data.current.wind_deg);\n let windSpeed = null;\n if (units === \"metric\") {\n windSpeed = Math.round(response.data.current.wind_speed * 3.6);\n } else {\n windSpeed = Math.round(response.data.current.wind_speed);\n }\n\n cloudiness.innerHTML = response.data.current.clouds;\n feelsLike.innerHTML = Math.round(response.data.current.feels_like);\n humidity.innerHTML = response.data.current.humidity;\n pressure.innerHTML = response.data.current.pressure;\n sunrise.innerHTML = convertUnixTime(response.data.current.sunrise);\n sunset.innerHTML = convertUnixTime(response.data.current.sunset);\n tempMax.innerHTML = Math.round(response.data.daily[0].temp.max);\n tempMin.innerHTML = Math.round(response.data.daily[0].temp.min);\n wind.innerHTML = `${windSpeed} ${windDirection}`;\n}", "title": "" }, { "docid": "850e9ef8aa1a8ef5e3c43a93a05dc313", "score": "0.6830346", "text": "function showUI(data){\n document.getElementById('city').innerText=data.name;\n document.getElementById('weatherMain').innerText=data.weather[0].main;\n document.getElementById('tempNow').innerText=kelvinToFarenhheit(data.main.temp);\n document.getElementById('tempUnit').innerText=getTempUnit();\n document.getElementById('windSpeed').innerText=convertSpeed(data.wind.speed);\n document.getElementById('humidity').innerHTML=`Humidity ${data.main.humidity}<sup>%</sup>`;\n //document.getElementById('sunrise').innerText=calcTime(data.sys.sunrise, offset);\n //document.getElementById('sunset').innerText=calcTime(data.sys.sunset, offset);\n\n setDirection();\n setIcon();\n setSunRiseIcon();\n setSunSetIcon();\n\n}", "title": "" }, { "docid": "ee50001936a5edaf51ba16a851035420", "score": "0.6827458", "text": "function displayHourlyForecast(response) {\n let hourlyTitleHeader = document.querySelector('.hourly-title');\n hourlyTitleHeader.classList.remove('hidden');\n let hourlyHeaderCol = document.querySelector('.hourly');\n hourlyHeaderCol.classList.remove('hidden');\n\n for (let i = 0; i < 12; i += 1) {\n //set up hourly div:\n let flexHourlyDiv = document.querySelector('#flex-hourly');\n let hourlyDiv = document.createElement('div');\n hourlyDiv.classList.add(\"daily-forecast-div\");\n\n //display time:\n let time = new Date(response[i].time * 1000);\n let timeHeader = document.createElement('h4');\n const options = {hour: 'numeric'};\n let formattedTime = time.toLocaleDateString('en-US', options);\n formattedTime = formattedTime.split(',').pop();\n timeHeader.innerText = formattedTime;\n timeHeader.classList.add('forecast-component');\n timeHeader.classList.add('short-hourly');\n hourlyDiv.appendChild(timeHeader);\n\n //display temperature:\n let temp = response[i].temperature;\n displayComponent(temp, 'medium-hourly', hourlyDiv);\n\n //display summary:\n let summary = response[i].summary;\n displayComponent(summary, 'long-hourly', hourlyDiv);\n\n //display icon:\n let iconText = response[i].icon;\n insertIcon(iconText, hourlyDiv);\n\n flexHourlyDiv.appendChild(hourlyDiv);\n\n } // close for loop\n } // close displayHourlyForecast fxn", "title": "" }, { "docid": "d70ab3fd5046c8663a555d500346ab62", "score": "0.6820555", "text": "function processAPIResults(data) {\n if (data.name !== undefined) {\n\n // This part of the function shows Today's data in the top \n // to round the temp to a whole number and show the rest of\n // of the weather info in the current weather section\n // var roundedTemp = Math.round(data.main.temp);\n // $('#showTemp').html(roundedTemp);\n $('.deg').html(\"&deg\");\n $('.f').html(\"F\");\n $('.-').html(\"-\");\n\n // $('#showMain').html(data.weather[0].main);\n // $('#humidity').html(data.weather[0].main);\n // $('#name').html(data.weather[0].main);\n // console.log(data.weather.main);\n } else if (data.name == undefined) {\n console.log(data.name);\n $(\"#error\").html('City Could Not Be Located');\n }\n}", "title": "" }, { "docid": "bb48b9fecb9351173f3adc64b04174b1", "score": "0.68157387", "text": "function showTempAndName(response) {\n let tempDisplay = document.querySelector(\"#mainNumber\");\n let cityName = document.querySelector(\".city\");\n let descriptionElement = document.querySelector(\"#description\");\n let humidityElement = document.querySelector(\"#humidity\");\n let windElement = document.querySelector(\"#wind\");\n let iconElement = document.querySelector(\"#icon\");\n let temperature = Math.round(response.data.main.temp);\n \n tempDisplay.innerHTML = temperature;\n cityName.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n iconElement.setAttribute(\n \"src\",\n 'http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png'\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n}", "title": "" }, { "docid": "8a449e1657301e207fc5dfd692d1adc3", "score": "0.6811776", "text": "function showWeather(response) {\n let temperatureElement = document.querySelector(\"#temperature\");\n let cityElement = document.querySelector(\"#city\");\n let descriptionElement = document.querySelector(\"#description\");\n let humidityElement = document.querySelector(\"#humidity\");\n let windElement = document.querySelector(\"#wind\");\n let dateElement = document.querySelector(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n\n tempFahrenheit = response.data.main.temp;\n\n temperatureElement.innerHTML = Math.round(response.data.main.temp);\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "3e7711fc4752d94176f0c769d8d405f2", "score": "0.6805937", "text": "function cityNow(){\nconsole.log(citySearch);\n// one call API\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" +citySearch+ \"&units=imperial&appid=\" + APIKey;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n \n .then(function(response){\n console.log(response);\n\n// Temperature\n var temperature= $(\"<p>\").addClass(\"temp\").text(citySearch+\"Temperature: \"+response.main.temp+\"F\");\n $(\".weatherNow\").append(temperature)\n })\n// Date\n var date = Date()\n\n var currentDate= $(\"<p>\").addClass(\"date\").text(\"Current Date: \" + Date());\n console.log(\"The Date: \" + Date());\n $(\".weatherNow\").append(currentDate);\n// Icon for weather conditions\n var currentIcon = $(\"<p>\").addClass(\"icon\").icon(weather.icon);\n $(\".weatherNow\").append(currentIcon);\n// Humidity\n\n// Wind Speed\n\n// UV Index\n // color indicating conditions (favorable, moderate, severe)\n}", "title": "" }, { "docid": "352d8a624d418cd0df840eebe4ce70c0", "score": "0.68033373", "text": "function displayResult(weather) {\n // console.log(weather); // works great\n\n // changing city name according to input\n\n let city = document.querySelector('.location .city');\n city.textContent = `${weather.name}, ${weather.sys.country}`;\n\n // getting date according the timezone\n let dateNow = new Date();\n // console.log(dateNow);\n let locationDate = document.querySelector('.location .date');\n locationDate.textContent = dateChecker(dateNow);\n\n // setInterval(function(){\n // let dateNow = new Date().toLocaleTimeString();\n // // console.log(dateNow);\n\n // let locationDate = document.querySelector('.location .date');\n // locationDate.textContent = dateChecker(dateNow)}, 1000);\n\n // checking temperature\n let temp = document.querySelector('.current .temp');\n temp.innerHTML = `${Math.round(weather.main.temp)}<span>°c</span>`;\n\n // checking weather statue\n let weatherStatue = document.querySelector('.current .weather');\n // let icon = document.querySelector('.current .icon');\n weatherStatue.textContent = weather.weather[0].main;\n // icon.textContent = weather[0].icon;\n\n // checking the high and low\n let minMax = document.querySelector('.hi-low');\n minMax.innerText = `${Math.round(weather.main.temp_min)}°c / ${Math.round(weather.main.temp_max)}°c`;\n}", "title": "" }, { "docid": "1232db3329f941a752f70ceb231874a4", "score": "0.6803032", "text": "function getWeatherForecast (city) {\n const xhr = new XMLHttpRequest();\n\n // spaces in city name must be replaced with '+' for api call\n let cityStr;\n hasWhiteSpace(city) ? cityStr = city.split(' ').join('+') : cityStr = city;\n\n xhr.open('GET', `http://api.openweathermap.org/data/2.5/forecast?q=${cityStr},us&units=imperial&APPID=${APIKEY}`, true);\n\n xhr.onload = function() {\n if (this.status === 200) {\n // display forecast table\n document.querySelector('#forecast-table').style.display = 'flex';\n document.querySelector('small').style.display = 'block';\n\n const response = JSON.parse(this.responseText);\n // console.log(response);\n\n // populate results data\n let output = `<p>Showing results for ${city}: (5 day forecast at 3 hour intervals)</p>`;\n output += `<li class=\"list-group-item\">Latitude: ${response.city.coord.lat}</li>`;\n output += `<li class=\"list-group-item\">Longitude: ${response.city.coord.lon}</li>`;\n output += '<br><br>';\n \n const responseList = response.list;\n let currentDay = '';\n let count = 0;\n responseList.forEach(function(item, index) {\n const dateTime = item.dt_txt;\n const timestamp = new Date(`${dateTime}`);\n const day = days[timestamp.getDay()];\n // keep track of days for forecast table\n if (day !== currentDay) {\n tableDays.push(day);\n currentDay = day;\n count++;\n }\n const month = months[timestamp.getMonth()];\n const date = timestamp.getDate();\n const year = timestamp.getFullYear();\n const hour = timestamp.getHours();\n const min = timestamp.getMinutes();\n let hourStr, minStr, meridiem; // meridiem -- AM or PM\n\n // make time look uniform and get meridiem\n hour < 10 ? hourStr = `0${hour}` : hourStr = `${hour}`;\n min < 10 ? minStr = `0${min}` : minStr = `${min}`;\n hour >= 12 ? meridiem = 'PM' : meridiem = 'AM';\n\n // push all values to global arrays\n tableHighs.push(item.main.temp_max);\n tableLows.push(item.main.temp_min);\n tableTemps.push(item.main.temp);\n tableMains.push(item.weather[0].main);\n tableIcons.push(item.weather[0].icon);\n\n // create list items from data\n output += `<li class=\"list-group-item day${count}\">${day}, ${month} ${date}, ${year} at ${hourStr}:${minStr} ${meridiem} : ${item.weather[0].main} ${getWeatherIcon(item.weather[0].icon)} -- ${item.weather[0].description} (${item.main.temp} F${String.fromCharCode(176)})</li>`;\n });\n\n // show results\n resultList.innerHTML = output;\n\n // set card titles to next 5 days\n for (let i = 0; i < 5; i += 1) {\n cardTitles[i].textContent = tableDays[i];\n }\n getWeatherAverages();\n // reset global arrays\n tableDays = [];\n tableHighs = [];\n tableLows = [];\n tableTemps = [];\n tableMains = [];\n tableIcons = [];\n } else if (this.status === 404) {\n // show alert for '404 - NOT FOUND' error\n showErrorAlert('The city you entered could not be found. Please try again.');\n }\n }\n\n xhr.onerror = function() {\n // show alert for request error\n showErrorAlert('Error retrieving data. Please try again.');\n }\n\n xhr.send();\n}", "title": "" }, { "docid": "b96ce3c8f5e50ab3cb0c79c5513f8b8a", "score": "0.6788256", "text": "function displayResult(response){\n //console.log(response);\n\n //Error handelling\n if(response.cod === 404){\n var errorMsg = document.querySelector('.error');\n errorMsg.style.display = \"block\";\n //keep search bar to empty\n search.value = \"\";\n } else {\n\n //Get city name and country\n var city = document.querySelector('.location .city');\n\n //declaring a \"country\" variable to use in Music API\n var country = `${response.sys.country}`;\n city.innerText = `${response.name}` + ', ' + country;\n\n //Get temp in metric\n var temp = document.querySelector(\".temp\");\n //REFERENCE:: W3C no decimals\n temp.innerHTML = `Temp: ${Math.round(response.main.temp)} <span>°C</span>`;\n\n //Get weather \n var weather = document.querySelector(\".weather\");\n weather.innerText = `Weather: ${response.weather[0].main}`;\n\n //Get temp range\n var tempRange = document.querySelector(\".temp-range\");\n\n //math round idea in reference to W3C to get no decimals\n tempRange.innerText = `Temp Range: ${Math.round(response.main.temp_min)}°C / ${Math.round(response.main.temp_max)}°C`;\n\n //Reference:: Sean Doyle and reddit article\n var weatherIcon = document.querySelector(\".weather-icon\");\n var iconURL = \"http://openweathermap.org/img/w/\";\n weatherIcon.src = iconURL + response.weather[0].icon + \".png\";\n\n search.value = \"\";\n\n //to figure out date first get today's date -> written in a certain way -> create a function\n var today = new Date();\n var date = document.querySelector(\".location .date\");\n\n //using the function below pass var \"today\"(which is todays date) as a parameter\n date.innerText = cityDate(today);\n\n getMusicTrends(country);\n } \n}", "title": "" }, { "docid": "c5e8bdf453c02c5174b1d66ba3d20459", "score": "0.67828643", "text": "function displayTemperature(response) {\n console.log(response.data);\n let temperatureElement = document.querySelector(\"#temperature\");\n let cityElement = document.querySlectory(\"#city\");\n let descriptionElement = document.querySlectory(\"#description\");\n let humidityElement = document.querySlectory(\"#humidity\");\n let windElement = document.querySlectory(\"#wind\");\n let dateElement = document.querySlectory(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n\n celsiusTemperature = response.data.main.temp;\n\n temperatureElement.innerHTML = Math.round(celsiusTemperature);\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}2x.png`\n );\n iconElement.setAttributeNS(\"alt\", response.data.weather[0].description);\n}", "title": "" }, { "docid": "db5cca04a88b5dc5c7a23be7571fe491", "score": "0.67679405", "text": "function displayWeather(){\n // console.log(\"displayWeather called\");\n var http = new XMLHttpRequest();\n\n //testing Korea App\n // const url = 'http://api.openweathermap.org/data/2.5/weather?lat=37.5665&lon=126.9780&units=metric&appid=c161f2e8363f6ef8be3d9cc89baf322e';\n\n // testing sao paulo App\n // const url = 'http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&units=metric&appid=c161f2e8363f6ef8be3d9cc89baf322e';\n \n //lon and lat parameters\n const url = 'http://api.openweathermap.org/data/2.5/weather?lat='+lat+'&'+'lon='+lon+'&units=metric&appid=c161f2e8363f6ef8be3d9cc89baf322e';\n \n \n\n\n \n http.open(\"GET\", url);\n // console.log(url);\n\n http.onreadystatechange = function () {\n if (http.readyState === 4 && http.status === 200) {\n \n var response = http.responseText;\n response = JSON.parse(response);\n // console.log(response);\n \n temperature = response.main.temp;\n temperature =\"<f id='degree'>\" + temperature + \"&#176 degree </f>\";\n humidity = response.main.humidity;\n condition = response.weather[0].description;\n neighbor = response.name;\n windspeed = response.wind.speed;\n windspeed = windspeed +\" km/h\";\n pressure = response.main.pressure;\n temp_max = response.main.temp_max;\n temp_max = temp_max + \"&#176 degree\";\n temp_min = response.main.temp_min;\n temp_min = temp_min + \"&#176 degree\";\n sunrise = response.sys.sunrise;\n sunset = response.sys.sunset;\n countryCode = response.sys.country;\n\n\n document.getElementById('condition').innerHTML = condition; \n document.getElementById('temperature').innerHTML = temperature; \n document.getElementById('neighbor').innerHTML = neighbor;\n document.getElementById('neighborSelect').innerHTML = neighbor;\n document.getElementById('neighborSelect').value = neighbor;\n document.getElementById('temp_max').innerHTML = temp_max; \n document.getElementById('temp_min').innerHTML = temp_min; \n document.getElementById('windspeed').innerHTML = windspeed; \n document.getElementById('humidity').innerHTML = humidity; \n document.getElementById('pressure').innerHTML = pressure; \n\n //call the timeconverter because uses the variable sunset and sunrise\n timeConverter();\n\n //call the printflag function as the flag URL needs the variable countrycode\n printFlag();\n\n }\n }; \n http.send();\n\n \n}", "title": "" }, { "docid": "a7d3ec5cdd4079d4126c3814e9de1603", "score": "0.6767797", "text": "function parseData(data){\n // console.log(data.hourly.data);\n document.getElementById('weatherData').innerHTML = \"\";\n for (var i=0; i<data.hourly.data.length; i++){\n // console.log(data.hourly.data[i]);\n // console.log(data)\n // console.log(data.daily.data[0].moonPhase)\n showData(data.hourly.data[i]);\n };\n printMoonPhase(data.daily.data[0].moonPhase)\n}", "title": "" }, { "docid": "5d67bdd6a2e73f44188164c1307efcc1", "score": "0.67669964", "text": "function displayWeather(response){\n celsiusTemp = response.data.main.temp;\n let iconElement = document.querySelector(\"#icon\");\n let weekDay = formatDate(response.data.dt * 1000);\n let weekDayDisplay = document.querySelector(\"h2#day\");\n weekDayDisplay.innerHTML = weekDay;\n let timeNow = formatTime(response.data.dt * 1000);\n let timeNowDisplay = document.querySelector(\"h2#time\");\n timeNowDisplay.innerHTML = timeNow;\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"h3#temp\").innerHTML = Math.round(celsiusTemp);\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity + \"%\";\n document.querySelector(\"#winds\").innerHTML = response.data.wind.speed + \" km/h\";\n document.querySelector(\"#weather-description\").innerHTML = response.data.weather[0].main;\n\n\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n}", "title": "" }, { "docid": "c50db668c183554b8022dc8965e601ec", "score": "0.67545563", "text": "function processAPIResults(data) {\n if (data.name !== undefined) {\n\n // This part of the function shows Today's data in the top \n // to round the temp to a whole number and show the rest of\n // of the weather info in the current weather section\n // var roundedTemp = Math.round(data.main.temp);\n // $('#showTemp').html(roundedTemp);\n $('.deg').html(\"&deg\");\n $('.f').html(\"F\");\n $(\".slash\").text(\" /\");\n\n\n // console.log(data.weather.main);\n } else if (data.name == undefined) {\n console.log(data.name);\n $(\"#error\").html('City Could Not Be Located');\n }\n}", "title": "" }, { "docid": "9ba37688256fc59907688875d6d2c8cf", "score": "0.6737771", "text": "function dispalyForecast(response) {\n let forecastElement = document.querySelector(\"#forecast\");\n forecastElement.innerHTML = null;\n let forecast = null;\n\n for (let index = 0; index < 6; index++) {\n forecast = response.data.list[index];\n forecastElement.innerHTML += `\n <div class=\"col-2\">\n <h3>\n ${formatHours(forecast.dt * 1000)}\n </h3>\n <img\n src=\"http://openweathermap.org/img/wn/${\n forecast.weather[0].icon\n }@2x.png\"\n />\n <div class=\"weather-forecast-temperature\">\n <strong>\n ${Math.round(forecast.main.temp_max)}°\n </strong>\n ${Math.round(forecast.main.temp_min)}°\n </div>\n </div>\n `;\n }\n}", "title": "" }, { "docid": "f93995bced834a8cbda583a8853a5881", "score": "0.67335796", "text": "function showTemperature(response) {\n document.querySelector(\"#city-name\").innerHTML = response.data.name;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#weatherDescription\").innerHTML =\n response.data.weather[0].main;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n}", "title": "" }, { "docid": "11f953fb7fc30e9029abde39c0c2c68b", "score": "0.6729404", "text": "function showWeatherAtLocation(response) {\n let city = document.querySelector(\"#city\");\n let temperature = document.querySelector(\"#temperature\");\n let weatherDescription = document.querySelector(\"#weather-description\");\n let humidity = document.querySelector(\"#humidity\");\n let wind = document.querySelector(\"#wind\");\n city.innerHTML = response.data.name;\n temperature.innerHTML = Math.round(response.data.main.temp);\n weatherDescription.innerHTML = response.data.weather[0].main;\n humidity.innerHTML = response.data.main.humidity;\n wind.innerHTML = response.data.wind.speed;\n}", "title": "" }, { "docid": "6167abd4a21c79f7f2b2035d2a5cb203", "score": "0.6728601", "text": "function displayResults(weather) {\n\n let temp = weather.main.temp\n let currentWeather = weather.weather[0].main\n let country = weather.sys.country\n let city = weather.name\n let date = new Date()\n createElement(temp, currentWeather, city, country)\n}", "title": "" }, { "docid": "d2c8b84107e26e1af217e2e7f55e53cf", "score": "0.6720798", "text": "function showTempAndCity(response) {\n document.querySelector(\"#your-city\").innerHTML = response.data.name;\n let temperature = Math.round(response.data.main.temp);\n let tempChange = document.querySelector(\"#maindaytemp\");\n tempChange.innerHTML = `${temperature}`;\n let wind = Math.round(response.data.wind.speed) * 3.6;\n let humidity = Math.round(response.data.main.humidity);\n let desription = (response.data.weather[0].main);\n let windChange = document.querySelector(\"#otherweather\");\n let descriptionChange = document.querySelector (\"#maindescription\");\n windChange.innerHTML = `Humidity: ${humidity} % <br /> Wind: ${wind} km/h`;\n descriptionChange.innerHTML = `${desription}`;\n\n celsiusTemp = response.data.main.temp;\n\n let iconChange = document.querySelector (\"#icon-today\");\n if(response.data.weather[0].icon === \"01d\" || response.data.weather[0].icon === \"01n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-sun weathermain\");\n } else if(response.data.weather[0].icon === \"02d\" || response.data.weather[0].icon === \"02n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-cloud-sun weathermain\");\n } else if(response.data.weather[0].icon === \"03d\" || response.data.weather[0].icon === \"03n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-cloud weathermain\");\n } else if(response.data.weather[0].icon === \"04d\" || response.data.weather[0].icon === \"04n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-cloud weathermain\");\n } else if(response.data.weather[0].icon === \"09d\" || response.data.weather[0].icon === \"09n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-cloud-showers-heavy weathermain\");\n } else if(response.data.weather[0].icon === \"10d\" || response.data.weather[0].icon === \"10n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-cloud-rain weathermain\");\n } else if(response.data.weather[0].icon === \"11d\" || response.data.weather[0].icon === \"11n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-bolt weathermain\");\n } else if(response.data.weather[0].icon === \"13d\" || response.data.weather[0].icon === \"13n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-snowflake weathermain\");\n } else if(response.data.weather[0].icon === \"50d\" || response.data.weather[0].icon === \"50n\") {\n iconChange.setAttribute(\"class\", \"col-6 fas fa-water weathermain\");\n };\n\n}", "title": "" }, { "docid": "c454bdb60bba0dcbdd80597faf8fb97b", "score": "0.67193836", "text": "function displayCity() {\n // Here we run our AJAX call to the OpenWeatherMap API\n\n const API = \"51d7968cfee71b16dc19326d1a6ed198\";\n\n\n var queryURL = 'https://api.openweathermap.org/data/2.5/weather?q=tucson&units=imperial' + \"&APPID=\" + API;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"jsonp\",\n success: function(response) {\n console.log(response);\n }\n })\n // We store all of the retrieved data inside of an object called \"response\"\n .done(function(response) {\n console.log('response' + response);\n\n $(\".city\").html(\"<h1>Weather in \" + response.name + \"</h1>\");\n $(\".city-card\").html(response.name);\n $(\".date\").text(Date());\n let weatherIcon = $(\"<img src='http://openweathermap.org/img/w/\" + response.weather[0].icon + \".png' alt='Icon depicting current weather.'>\");\n weatherIcon.attr('id', 'weatherIcon');\n $('#icon').html(weatherIcon);\n\n let descriptionNav = response.weather[0].description;\n\n $('#nav-description').text(descriptionNav)\n $(\"#temperature\").text(response.main.temp.toFixed(1) + \"°(F)\");\n $(\"#humidity\").text(\"Humidity: \" + response.main.humidity + \"%\");\n $(\"#max-temp\").text(\"Max Temp: \" + response.main.temp_max + \"°(F)\");\n $(\"#min-temp\").text(\"Min Temp: \" + response.main.temp_min + \"°(F)\");\n\n $(\"#wind\").text(\"Wind: \" + response.wind.speed + \" mph\");\n $(\"#rain\").text(\"Rain: \" + response.rain);\n // $(\"#icon\").html(\"time of day \" + response.weather[0].icon);\n $(\"#sunrise\").text(\"Sunrise: \" + response.sys.sunrise);\n // Log the queryURL\n console.log(queryURL);\n\n // Log the resulting object\n console.log(response);\n console.log(response.weather[0].description);\n });\n\n }", "title": "" }, { "docid": "157f421035098ed25c55fed19f8d8ab0", "score": "0.67150223", "text": "function getTemp() {\n let tempURL = \"https://api.openweathermap.org/data/2.5/weather?zip=94024,us&APPID=\" + app1 + app2;\n $.get(tempURL, function(data) {\n if (data.contents != undefined && data.contents.cod == 401) {\n console.log(\" 🥺 ERROR with the weather temp data: \" + data.contents.message);\n }\n else { \n let description = data.weather[0].description;\n let tempK = data.main.temp;\n // Kelvin to F: (280K − 273.15) × 9/5 + 32 = 44.33°F\n let tempF = Math.round( (tempK - 273.15) * 9/5 + 32 );\n let feelsLike = Math.round( (data.main.feels_like - 273.15) * 9/5 + 32 );\n let humidity = data.main.humidity;\n let windDirection = data.wind.deg;\n let windSpeed = data.wind.speed;\n let rain1h = data.rain;\n if (data.rain && (data.rain)[\"1h\"]) {\n rain1h= (data.rain)[\"1h\"];\n }\n \n //let rain3h = data.rain.\"3h\";\n\n let htmlDetails = \"<ul style='list-style-type:none; text-align: center'> \" + \n \"<li>🌡 Feels like: \" + feelsLike + \"ºF </li>\" +\n \"<li>💦 Humidity: \" + humidity + \"% </li>\" +\n \"<li>💨 Wind direction: \" + windDirection + \" deg</li>\" +\n \"<li>🍃 <a href='https://www.windy.com/?gfs,37.421,-122.111,11' target='_blank'>Wind Speed:</a> \" + windSpeed + \" meter/sec</li>\";\n\n if (rain1h) {\n htmlDetails += \"<li>Rain in last hour: \" + rain1h + \"mm </li>\";\n }\n // if (rain3h) {\n // htmlDetails += \"<li>Rain in 3 hours: \" + rain3h + \"mm </li>\";\n // }\n htmlDetails += \"</ul>\";\n \n console.log(\"WEATHER 😎 temp: \" + tempF + \" desc: \" + description);\n console.log(\"feels: \" + feelsLike + \" humidity: \" + humidity + \n \" wind dir: \" + windDirection + \" windSpeed: \" + windSpeed + \"meter/sec\");\n if (tempF > 0) {\n mainTitle.innerHTML = \"<h4>Los Altos Area - <a href='https://weather.com/weather/today/l/8102dc83928b477ba293d2869dcb04509fd361183c4318177dfa28c32af68af6' target='_blank'>\" +\n tempF + \" ºF</a> \" + description + \" </h4>\" + \n \"<details open> <summary>Weather Details</summary>\" + htmlDetails+ \" </details>\";\n }\n }\n });\n}", "title": "" }, { "docid": "2a6a01c75863043af6be2655b3747ec6", "score": "0.6714054", "text": "function showWeather(response) {\n let currentTemp = Math.round(response.data.main.temp);\n let displayTemp = document.querySelector(\"#current-temp\");\n displayTemp.innerHTML = currentTemp;\n\n celsiusTemperature = response.data.main.temp;\n\n let description = response.data.weather[0].description;\n let displayDescription = document.querySelector(\"#weather-description\");\n displayDescription.innerHTML = description;\n\n let humidity = response.data.main.humidity;\n let displayHumidity = document.querySelector(\"#current-humidity\");\n displayHumidity.innerHTML = humidity;\n\n let speed = response.data.wind.speed;\n let displaySpeed = document.querySelector(\"#current-speed\");\n displaySpeed.innerHTML = speed;\n\n let weatherIcon = response.data.weather[0].icon;\n let displayIcon = document.querySelector(\"#icon\");\n displayIcon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${weatherIcon}@2x.png`\n );\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "428bc808f85138e63c70c8b8c2adaeef", "score": "0.6708034", "text": "function showMainTemp(response) {\n document.querySelector(\"#cityId\").innerHTML = response.data.name;\n document.querySelector(\"#mainTemp\").innerHTML =\n Math.round(response.data.main.temp) + \" °C\";\n document.querySelector(\"#minTemp\").innerHTML =\n \"Min \" + Math.round(response.data.main.temp_min) + \" °C\";\n document.querySelector(\"#maxTemp\").innerHTML =\n \"Max \" + Math.round(response.data.main.temp_max) + \" °C\";\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].main;\n}", "title": "" }, { "docid": "ca56f2b3a39fd0354afe30db8ce37579", "score": "0.67076534", "text": "function displayWeather(data) {\n var tempF = data.current_observation.temp_f,\n tempC = data.current_observation.temp_c,\n todayIcon = data.current_observation.icon_url,\n cityName = data.current_observation.display_location.city;\n// tomorrowDay = data.forecast.txt_forecast.forecastday[2].title,\n// tomorrowForcast = data.forecast.txt_forecast.forecastday[2].fcttext,\n// tomorrowIcon = data.forecast.txt_forecast.forecastday[2].icon_url,\n// nextDay = data.forecast.txt_forecast.forecastday[4].title,\n// nextDayForcast = data.forecast.txt_forecast.forecastday[4].fcttext,\n// nextDayIcon = data.forecast.txt_forecast.forecastday[4].icon_url,\n// thirdDay = data.forecast.txt_forecast.forecastday[6].title,\n// thirdDayForcast = data.forecast.txt_forecast.forecastday[6].fcttext,\n// thirdDayIcon = data.forecast.txt_forecast.forecastday[6].icon_url;\n \n \n var weatherHTML = '<div class=\"container\"><div class=\"row\">';\n weatherHTML += '<div class=\"col-md-4 card m-t-3\"><div class=\"weatherCard\">';\n weatherHTML += '<h4 class=\"m-t-1\">' + cityName + '</h4>';\n weatherHTML += '<img class=\"card-img-top\" src=\"' + todayIcon + '\"/>';\n weatherHTML += '<div class=\"card-block\">';\n weatherHTML += '<h5 class=\"card-title\">Temperature Right Now</h5>';\n weatherHTML += '<h6 class=\"card-text\">' + tempF +'&deg; F</h6>';\n weatherHTML += '<p class=\"card-text\">' + tempC + '&deg; C</p>';\n weatherHTML += '</div></div></div></div></div>';\n \n \n var forcastHTML = '<ul class=\"list-group m-t-3\">';\n for (var i = 1; i <= 7; i++) {\n forcastHTML += '<li class=\"list-group-item\">';\n forcastHTML += '<img class=\"pull-md-left img-fluid m-r-2\" src=\"'\n forcastHTML += data.forecast.txt_forecast.forecastday[i].icon_url;\n forcastHTML += '\"/><h4 class=\"list-group-item-heading\">';\n forcastHTML += data.forecast.txt_forecast.forecastday[i].title;\n forcastHTML += '</h4>' + data.forecast.txt_forecast.forecastday[i].fcttext;\n forcastHTML += '</li>';\n }\n forcastHTML += '</ul>';\n \n document.getElementById(\"placeHere\").innerHTML = \"\";\n \n $(\"#placeHere\").append(weatherHTML).append(forcastHTML);\n \n\n }", "title": "" }, { "docid": "1fc2073c47af1f895ce6608d73ae1634", "score": "0.66973054", "text": "function displayForcast(i){\n date = response.list[i].dt_txt;\n date = date.substring(0,10);\n temp = response.list[i].main.temp;\n humidity =response.list[i].main.humidity;\n weather = response.list[i].weather[0].main;\n\n //Logic for adding icons\n if(weather.toString() === \"Clouds\"){\n //console.log(\"itClouds\");\n weather = cloud;\n }\n else if(weather.toString() === \"Clear\"){\n // console.log(\"itclear\");\n weather = sun;\n }\n else if(weather.toString() === \"Rain\"){\n //console.log(\"itRain\");\n weather = rain;\n }\n else if(weather.toString() === \"Snow\"){\n weather = snow;\n }\n\n //console.log(weather);\n //console.log(response);\n // console.log(date);\n //console.log(temp);\n // console.log(humidity);\n\n\n \n }", "title": "" }, { "docid": "fbf94409b148ba237d62ab4bc5ccd015", "score": "0.66913563", "text": "function visualizeData(weather) {\n let city = document.querySelector(\".location .city\");\n city.innerText = `City: ${weather.name}`;\n\n // testo da convertire in formato testuale attraverso una funzione\n let now = new Date();\n let date = document.querySelector(\".location .date\");\n date.innerText = dateBuilder(now);\n\n let weather_field = document.querySelector(\".current-weather .weather\");\n weather_field.innerText = `Weather: ${capitalize(weather.weather[0].description)}`;\n\n let temperature = document.querySelector(\".current-weather .temperature\");\n temperature.innerText = `Temperature: ${weather.main.temp}°C`;\n\n let high_low = document.querySelector(\".current-weather .high-low\");\n high_low.innerText = `Temperature: Min ${weather.main.temp_min}°C / Max ${weather.main.temp_max}°C`;\n\n let feels_like = document.querySelector(\".current-weather .feels-like\");\n feels_like.innerText = `Perceived temperature: ${weather.main.feels_like}°C`;\n\n let humidity = document.querySelector(\".current-weather .humidity\");\n humidity.innerText = `Humidity: ${weather.main.humidity}%`;\n\n let sunrise = document.querySelector(\".current-weather .sunrise\");\n let sunrise_time = timeBuilder(weather.sys.sunrise);\n sunrise.innerText = `Sunrise: ${ sunrise_time }`;\n\n let sunset = document.querySelector(\".current-weather .sunset\");\n let sunset_time = timeBuilder(weather.sys.sunset)\n sunset.innerText = `Sunset: ${ sunset_time }`;\n //`Weather: ${capitalize(weather.weather[0].description)}`\n\n let wind = document.querySelector(\".current-weather .wind\");\n wind.innerText = `Wind speed: ${weather.wind.speed} meter/sec.`;\n\n // recupero l'immagine associata alle condizioni meteo\n let image = document.querySelector(\".image\");\n image.src = `${api.img}${weather.weather[0].icon}@2x.png`;\n\n setVisibility();\n}", "title": "" }, { "docid": "eec9a73226b01c67fd2cf1af1b67a3e3", "score": "0.6682025", "text": "function displayWeatherCondition(response) {\n document.querySelector(\"#city-name\").innerHTML = response.data.name;\n document.querySelector(\"#today-temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document.querySelector(\"#weather-description\").innerHTML = response.data.weather[0].description;\n document.querySelector(\"#updated\").innerHTML = `Updated at ${formatHours(response.data.dt * 1000)}`;\n\n let iconElement = document.querySelector(\"#icon-today\")\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n \n celsiusTemperature = response.data.main.temp; \n\n}", "title": "" }, { "docid": "9365a96a8ce3a3ae89f4f6223e6fb049", "score": "0.6678951", "text": "function viewData(weather){\n tempEl.innerHTML = \"Temp: \" + Math.floor(kvToFa (weather.main.temp)) + \"°F\";\n windEl.innerHTML = \"Wind: \" + weather.wind.speed + \" MPH\"\n humidityEl.innerHTML = \"Humidity: \" + weather.main.humidity + \"%\"\n cityEl.innerHTML = weather.name\n var lat = weather.coord.lat\n var lon = weather.coord.lon;\n var date = (moment(weather.dt * 1000));\n var month = date.format('M');\n var day = date.format('D');\n var year = date.format('YYYY');\n dateEl.innerHTML = (month + \"/\" + day + \"/\" + year);\n imgEl.src = \"http://openweathermap.org/img/w/\" + weather.weather[0].icon +\".png\"\n getUvIndex(lat, lon)\n getForeCast(weather)\n}", "title": "" }, { "docid": "a183a8b598dc99bfa146fd224bfa5e1a", "score": "0.66731536", "text": "function getData(){\n var req = new XMLHttpRequest();\n req.open(\"GET\", api,true);\n req.send();\n req.onload = function(){\n var getText = JSON.parse(req.responseText);\n console.log(getText);\n var temperature = Math.floor(getText.main.temp);\n console.log(temperature);\n var city = getText.name;\n var country =getText.sys.country;\n var condition = getText.weather[0].main;\n condition = condition.toLowerCase();\n setBackground(condition);\n document.getElementById(\"location-condition\").innerHTML = condition;\n document.getElementById(\"location-city\").innerHTML = city;\n document.getElementById(\"location-country\").innerHTML = country;\n document.getElementById(\"location-temperature\").innerHTML = temperature;\n document.getElementById(\"location-icon\").src = getText.weather[0].icon;\n changeUnit(\"italy-temperature\",\"italy-unit\"); \n changeUnit(\"location-temperature\",\"location-unit\");\n changeUnit(\"athens-temperature\",\"athens-unit\");\n }\n \n}", "title": "" }, { "docid": "2bc23e68c1620b603d074fbbbdc3edc2", "score": "0.66723174", "text": "function displayWeatherCondition(response) {\n document.querySelector(\"#current-city\").innerHTML = response.data.name;\n document.querySelector(\"#current-temp\").innerHTML = Math.round(\n response.data.main.temp\n );\n\n document.querySelector(\n \"#humidity\"\n ).innerHTML = `Humidity: ${response.data.main.humidity}%`;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].main;\n\n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n celsiusTemperature = response.data.main.temp;\n\n getForecast(response.data.coord);\n}", "title": "" }, { "docid": "55e83d0d80945625afca3c7b7b119926", "score": "0.66701573", "text": "function currentWeather(response) {\n var lat = response.city.coord.lat\n var lon = response.city.coord.lon\n var weather = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=minutely,hourly&units=imperial&appid=ce4b2cc1bf796919d588834409f184a8\"\n\n $.ajax({\n url: weather,\n method: \"GET\"\n })\n .then(function (response) {\n\n var temp = response.current.temp;\n var humid = response.current.humidity;\n var wind = response.current.wind_speed;\n var uv = response.current.uvi;\n\n $(\"#temp\").append(\"Tempurature: \", temp);\n $(\"#humidity\").append(\"Humidity: \", humid + \"%\");\n $(\"#wind\").append(\"Wind Speed: \", wind);\n $(\"#uvIndex\").append(\"UV Index: \", uv);\n if (uv < 3) {\n $(\"#uvIndex\").addClass(\"p-3 mb-2 bg-success text-white\");\n }\n else {\n $(\"#uvIndex\").addClass(\"p-3 mb-2 bg-danger text-white\");\n };\n for (let i = 0; i < response.daily.length; i++) {\n\n console.log(response.daily)\n console.log(i)\n var time = moment(response.daily[i].dt * 1000).format('DD MMM YYYY')\n console.log(time)\n\n $(`#date-${i}`).append(\"Date: \", time);\n $(`#icon-${i}`).attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.daily[i].weather[0].icon + \"@2x.png\")\n $(`#humidity-${i}`).text(\"Humidity: \" + String(response.daily[i].humidity + \"%\"))\n $(`#temp-${i}`).text(\"Tempurature: \" + String(response.daily[i].temp.day + \"F\"))\n }\n })\n }", "title": "" }, { "docid": "df1165f1668d7c0c17937c963f3fd159", "score": "0.6668735", "text": "getCurrentForecast() {\n // show you API call url\n // pass that secret key, latitude and longitude data with API url to get data.\n // first get our latitude and longitude using navigator object\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(res => {\n // send the those three value from here using string literal\n // create another variable\n\n // remember the format should be like this else it will return error\n // We need to set a proxy server to get our JSON shouldComponentUpdate(nextProps, nextState) {\n // this proxy server 'https://cors-anywhere.herokuapp.com/'\n fetch (\n `https://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${key}/${res.coords.latitude},${res.coords.longitude}`\n )\n .then(res => res.json())\n .then(res => {\n console.log(res);\n\n const {\n temperature,\n summary,\n humidity,\n pressure,\n icon,\n ozone\n } = res.currently;\n date.innerHTML += new Date().toDateString();\n temp.innerHTML += `${Math.floor(\n temperature\n )}\n <i class=\"wi wi-fahrenheit\"></i>`;\n temps.push(Math.floor(temperature))\n temps.push(Math.floor((temperature - 32) * 0.5555))\n desc.innerHTML += summary;\n hum.innerHTML += Math.round(humidity * 100) + \"%\";\n press.innerHTML += Math.round(pressure * 100) + \"%\";\n ozon.innerHTML += ozone;\n // adding some interaction\n //show that icon // download the weather icon css file and put it into your CSS directory\n // also put the font file in the parent directory of the project folder\n // create another method which will dynamically get\n // the icon for our weather condition\n\n // now call that method here and see the magic\n this.getIcon(icon, icons);\n })\n .catch(err => console.log(err)); //check in the url\n // JSON data lets put them in our html filter\n\n });\n } else {\n alert(\"Sorry your browser does not support navigation. Please Update it.\");\n }\n }", "title": "" }, { "docid": "97446e5ed0432fe50aedca02f3d39b85", "score": "0.6665338", "text": "function displayCurrentWeather(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#temp-value\").innerHTML = Math.round(\n response.data.main.temp\n );\n}", "title": "" }, { "docid": "3808b0ac2ad600325e02d67190537e87", "score": "0.66613144", "text": "function displayWeather(periodicData, apiName){\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`;\n tempElement.innerHTML = `${weather.temperature.val}°<span>C</span>`;\n descElement.innerHTML = weather.description;\n cityElement.innerHTML = ` ${weather.city} ${weather.country}`;\n feelsLikeElement.innerHTML = ` ${weather.feels}`;\n windElement.innerHTML = ` ${weather.wind}`;\n humidityElement.innerHTML = ` ${weather.humidity}`;\n if(apiName === \"geoLoc\"){\n document.getElementById(\"hourlyForecast\").innerHTML = renderHourlyForecast(periodicData.hourly);\n document.getElementById(\"dailyForecast\").innerHTML = renderDailyForecast(periodicData.daily);\n } else{\n document.getElementById(\"hourlyForecast\").innerHTML = renderCityHourlyFc(periodicData);\n document.getElementById(\"dailyForecast\").innerHTML = renderCityDailyForecast(periodicData);\n }\n}", "title": "" }, { "docid": "13f7bcfa722b1bca3c11d4b4b9cc97d1", "score": "0.6656585", "text": "function displayResults (weather) {\n let city = document.querySelector('.location .city');\n city.innerText = `${weather.name} , ${weather.sys.country} `;\n\n let temp = document.querySelector('.current .temp');\n temp.innerHTML = `${Math.round(weather.main.temp)} <span>°C</span>`;\n\n let status = document.querySelector('.current .weather');\n status.innerText = weather.weather[0].main;\n\n let hilow = document.querySelector('.hi-low');\n hilow.innerText = `${weather.main.temp_min} / ${weather.main.temp_max}`;\n}", "title": "" }, { "docid": "6bafc9a8326275b6df6b101e6f5d72ae", "score": "0.66533977", "text": "function displayWeather (response) {\n $('#weatherResults').css('display', 'block')\n currentTemp = Math.round(response.current.temp_f)\n feelslikeTemp = Math.round(response.current.feelslike_f)\n currentDescription = response.current.condition.text\n dailyDescription = response.forecast.forecastday[0].day.condition.text\n dailyImg = response.forecast.forecastday[0].day.condition.icon.substring(15)\n $('<p class=\"temp\"></p>').appendTo('.weatherTemp').text(`${currentTemp}°`)\n $('<p class=\"feelslike\"></p>').appendTo('.weatherDetails').text(`Feels like ${feelslikeTemp}°`)\n $(`<img src=./images/${dailyImg}>`).appendTo('.weatherDetails')\n $('<p></p>').appendTo('.weatherDetails').text(`Current: ${currentDescription}`)\n $('<p></p>').appendTo('.weatherDetails').text(`Today's forecast: ${dailyDescription}`)\n //find activities based on weather and scroll to results\n mapWeatherToActivities()\n scrollWeather()\n }", "title": "" }, { "docid": "e4efd58763b786a45b383b53598e0056", "score": "0.6652195", "text": "function showCurrentWeather(data) {\n \n let temp = \"Temperature: \" + (1.8 * (data.main.temp - 273) + 32).toFixed(0) + \" F°\";\n let humidity = \"Humidity: \" + data.main.humidity;\n let wind = \"Wind Speed: \" + data.wind.speed.toFixed(0) + \"mph\";\n \n //Make sure the text areas are empty\n $(\"#currentCity\").empty();\n $(\"#temp\").empty();\n $(\"#humidity\").empty();\n $(\"#wind\").empty();\n $(\"#uvIndex\").empty();\n $(\".dayDate\").empty();\n $(\".dayTemp\").empty();\n $(\".dayHumi\").empty();\n $(\".dayUvi\").empty();\n \n //Put the date into place\n $(\"#currentCity\").append(data.name);\n $(\"#temp\").append(temp);\n $(\"#humidity\").append(humidity);\n $(\"#wind\").append(wind);\n \n\n \n //OneCall API\n let oneCallUrl = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + data.coord.lat + \"&lon=\" + data.coord.lon + \"&exclude=minutely,hourly,alerts&appid=\" + apiKey;\n \n $.ajax({\n url: oneCallUrl,\n method: \"GET\",\n }).then(function (oneCall) {\n console.log(oneCall);\n\n let uvi = \"UV Index: \" + oneCall.daily[0].uvi;\n $(\"#uvIndex\").append(uvi);\n \n //5 day Forecast\n //Day 1 \n let day1Unix = oneCall.daily[1].dt * 1000;\n let day1DateObj = new Date(day1Unix);\n let day1Date = day1DateObj.toLocaleDateString(\"en-US\");\n let day1Temp = \"Temp: \" + (1.8 * (oneCall.daily[1].temp.day - 273) + 32).toFixed(0) + \" F°\";\n let day1Humi = \"Humidity: \" + oneCall.daily[1].humidity;\n let day1Uvi = \"UV Index: \" + oneCall.daily[1].uvi;\n $(\"#date1\").append(day1Date);\n $(\"#date1Temp\").append(day1Temp);\n $(\"#date1Humi\").append(day1Humi);\n $(\"#date1Uvi\").append(day1Uvi);\n \n //Day2\n let day2Unix = oneCall.daily[2].dt * 1000;\n let day2DateObj = new Date(day2Unix);\n let day2Date = day2DateObj.toLocaleDateString(\"en-US\");\n let day2Temp = \"Temp: \" + (1.8 * (oneCall.daily[2].temp.day - 273) + 32).toFixed(0) + \" F°\";\n let day2Humi = \"Humidity: \" + oneCall.daily[2].humidity;\n let day2Uvi = \"UV Index: \" + oneCall.daily[2].uvi;\n $(\"#date2\").append(day2Date);\n $(\"#date2Temp\").append(day2Temp);\n $(\"#date2Humi\").append(day2Humi);\n $(\"#date2Uvi\").append(day2Uvi);\n \n //Day 3\n let day3Unix = oneCall.daily[3].dt * 1000;\n let day3DateObj = new Date(day3Unix);\n let day3Date = day3DateObj.toLocaleDateString(\"en-US\");\n let day3Temp = \"Temp: \" + (1.8 * (oneCall.daily[3].temp.day - 273) + 32).toFixed(0) + \" F°\";\n let day3Humi = \"Humidity: \" + oneCall.daily[3].humidity;\n let day3Uvi = \"UV Index: \" + oneCall.daily[3].uvi;\n $(\"#date3\").append(day3Date);\n $(\"#date3Temp\").append(day3Temp);\n $(\"#date3Humi\").append(day3Humi);\n $(\"#date3Uvi\").append(day3Uvi);\n \n //Day 4\n let day4Unix = oneCall.daily[4].dt * 1000;\n let day4DateObj = new Date(day4Unix);\n let day4Date = day4DateObj.toLocaleDateString(\"en-US\");\n let day4Temp = \"Temp: \" + (1.8 * (oneCall.daily[4].temp.day - 273) + 32).toFixed(0) + \" F°\";\n let day4Humi = \"Humidity: \" + oneCall.daily[4].humidity;\n let day4Uvi = \"UV Index: \" + oneCall.daily[4].uvi;\n $(\"#date4\").append(day4Date);\n $(\"#date4Temp\").append(day4Temp);\n $(\"#date4Humi\").append(day4Humi);\n $(\"#date4Uvi\").append(day4Uvi);\n \n //Day 5\n let day5Unix = oneCall.daily[5].dt * 1000;\n let day5DateObj = new Date(day5Unix);\n let day5Date = day5DateObj.toLocaleDateString(\"en-US\");\n let day5Temp = \"Temp: \" + (1.8 * (oneCall.daily[5].temp.day - 273) + 32).toFixed(0) + \" F°\";\n let day5Humi = \"Humidity: \" + oneCall.daily[5].humidity;\n let day5Uvi = \"UV Index: \" + oneCall.daily[5].uvi;\n $(\"#date5\").append(day5Date);\n $(\"#date5Temp\").append(day5Temp);\n $(\"#date5Humi\").append(day5Humi);\n $(\"#date5Uvi\").append(day5Uvi);\n \n })\n \n }", "title": "" }, { "docid": "6124c2283ba189a5817587fd45e6ee2d", "score": "0.6641388", "text": "function displayForecast (data) {\n let weatherDescription1 = data.data[0].weather.description;\n let weatherDescription2 = data.data[1].weather.description;\n let weatherDescription3 = data.data[2].weather.description;\n let weatherDescription4 = data.data[3].weather.description;\n let weatherDescription5 = data.data[4].weather.description;\n let weatherDescription6 = data.data[5].weather.description;\n let weatherDescriptions = [\n weatherDescription1,\n weatherDescription2,\n weatherDescription3,\n weatherDescription4,\n weatherDescription5,\n weatherDescription6\n ];\n let weatherIcon1 = data.data[0].weather.icon;\n let weatherIcon2 = data.data[1].weather.icon;\n let weatherIcon3 = data.data[2].weather.icon;\n let weatherIcon4 = data.data[3].weather.icon;\n let weatherIcon5 = data.data[4].weather.icon;\n let weatherIcon6 = data.data[5].weather.icon;\n let weatherIcons = [\n weatherIcon1,\n weatherIcon2,\n weatherIcon3,\n weatherIcon4,\n weatherIcon5,\n weatherIcon6\n ];\n let minTemperature1 = '&#8711;' + Math.floor(data.data[0].low_temp)+ '°C';\n let minTemperature2 = '&#8711;' + Math.floor(data.data[1].low_temp)+ '°C';\n let minTemperature3 = '&#8711;' + Math.floor(data.data[2].low_temp)+ '°C';\n let minTemperature4 = '&#8711;' + Math.floor(data.data[3].low_temp)+ '°C';\n let minTemperature5 = '&#8711;' + Math.floor(data.data[4].low_temp)+ '°C';\n let minTemperature6 = '&#8711;' + Math.floor(data.data[5].low_temp)+ '°C';\n let minTemperatures = [\n minTemperature1,\n minTemperature2,\n minTemperature3,\n minTemperature4,\n minTemperature5,\n minTemperature6\n ];\n let maxTemperature1 = '&#8710;' + Math.floor(data.data[0].max_temp)+ '°C';\n let maxTemperature2 = '&#8710;' + Math.floor(data.data[1].max_temp)+ '°C';\n let maxTemperature3 = '&#8710;' + Math.floor(data.data[2].max_temp)+ '°C';\n let maxTemperature4 = '&#8710;' + Math.floor(data.data[3].max_temp)+ '°C';\n let maxTemperature5 = '&#8710;' + Math.floor(data.data[4].max_temp)+ '°C';\n let maxTemperature6 = '&#8710;' + Math.floor(data.data[5].max_temp)+ '°C';\n let maxTemperatures = [\n maxTemperature1,\n maxTemperature2,\n maxTemperature3,\n maxTemperature4,\n maxTemperature5,\n maxTemperature6\n ];\n let dayTemperature1 = Math.floor(data.data[0].temp)+ '°C';\n let dayTemperature2 = Math.floor(data.data[1].temp)+ '°C';\n let dayTemperature3 = Math.floor(data.data[2].temp)+ '°C';\n let dayTemperature4 = Math.floor(data.data[3].temp)+ '°C';\n let dayTemperature5 = Math.floor(data.data[4].temp)+ '°C';\n let dayTemperature6 = Math.floor(data.data[5].temp)+ '°C';\n let dayTemperatures = [\n dayTemperature1,\n dayTemperature2,\n dayTemperature3,\n dayTemperature4,\n dayTemperature5,\n dayTemperature6\n ];\n console.log(weatherDescriptions);\n console.log(weatherIcons);\n let i = 0;\n while (i<6){\n logos[i].src = `https://www.weatherbit.io/static/img/icons/${weatherIcons[i]}.png`;\n descriptions[i].innerHTML = weatherDescriptions[i];\n temperatures[i].innerHTML = dayTemperatures[i] ;\n minTemps[i].innerHTML = minTemperatures[i];\n maxTemps[i].innerHTML = maxTemperatures[i];\n i++;\n }\n}", "title": "" }, { "docid": "e30c85cf7eafc5fa6f3431ac96dbac04", "score": "0.66315556", "text": "function showWeatherConditions(response) {\n document.querySelector(\"#currentLocation\").innerHTML = response.data.name;\n document.querySelector(\"#currentTemperature\").innerHTML = Math.round(response.data.main.temp);\n document.querySelector(\".currentSummary\").innerHTML = response.data.weather[0].main;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(response.data.wind.speed)\n document.querySelector(\"#currentWeatherIcon\").setAttribute(\"src\", `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n document.querySelector(\"#currentWeatherIcon\").setAttribute(\"alt\", response.data.weather[0].description);\n}", "title": "" }, { "docid": "ee61c6d28874a5e2c2a1683ee8a1b58b", "score": "0.66294354", "text": "showData(weather) {\n // Set data from weather API\n this.location.textContent = weather.name;\n\n // Get current date\n function dateBuilder(currentDate) {\n let months = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n let days = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n\n let day = days[currentDate.getDay()];\n let date = currentDate.getDate();\n let month = months[currentDate.getMonth()];\n let year = currentDate.getFullYear();\n\n return `${day} ${date} ${month} ${year}`;\n }\n\n this.date.innerText = dateBuilder(now);\n\n this.icon.setAttribute(\n \"src\",\n \"http://openweathermap.org/img/wn/\" + weather.weather[0].icon + \"@2x.png\"\n );\n this.temp.textContent = `Current: ` + weather.main.temp + `°c`;\n this.details.textContent = `Description: ${weather.weather[0].main} / ${weather.weather[0].description}`;\n this.hiLow.textContent = `Max - Min : ${weather.main.temp_max} °c / ${weather.main.temp_min} °c`;\n this.humidity.textContent = `Relative Humidity: ${weather.main.humidity} %`;\n this.wind.textContent = `Wind: ${weather.wind.deg}° / ${weather.wind.speed} m/s`;\n }", "title": "" }, { "docid": "192909bc1a7137402a9f5e9eac360221", "score": "0.66262984", "text": "function showTemperature(response) {\n let temperatureNumber = document.querySelector(\"#temperature\");\n let cityName = document.querySelector(\"#city\");\n let weatherDescription = document.querySelector(\"#current-status\");\n let humidity = document.querySelector(\"#humidity\");\n let windSpeed = document.querySelector(\"#wind\");\n let date = document.querySelector(\"#current-day-time\")\n let icon = document.querySelector(\"#icon\"); \n\n fahrenheitTemperature = response.data.main.temp;\n\n temperatureNumber.innerHTML = Math.round(fahrenheitTemperature);\n cityName.innerHTML = response.data.name;\n weatherDescription.innerHTML = response.data.weather[0].description;\n humidity.innerHTML = response.data.main.humidity;\n windSpeed.innerHTML = Math.round(response.data.wind.speed);\n date.innerHTML = currentDate(response.data.dt * 1000);\n icon.setAttribute(\"src\", `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n icon.setAttribute(\"alt\", response.data.weather[0].description);\n}", "title": "" }, { "docid": "e997bc04e8dc7a6396afcb71493a4a8c", "score": "0.66242284", "text": "function displayWeather(json) {\n // Get all sols from the API response\n const sols = json.sol_keys;\n\n // Declare the HTML variable\n let html = \"\";\n\n sols.forEach((sol) => {\n let weather = json[sol];\n\n // Get the corresponding earth date\n const earthDate = new Date(weather.First_UTC).toLocaleDateString(\n undefined,\n {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n }\n );\n\n // Function to round down the numbers\n function roundValues(value) {\n return Math.round(value);\n }\n\n // Get the air temperatures\n const maxTemp = roundValues(weather.AT.mx);\n const minTemp = roundValues(weather.AT.mn);\n\n // Get the wind speed\n const maxWind = weather.HWS\n ? roundValues(weather.HWS.mx)\n : \"No reading\";\n const minWind = weather.HWS\n ? roundValues(weather.HWS.mn)\n : \"No reading\";\n\n // Get the wind direction if there are readings available\n const windDirection = weather.WD.most_common\n ? weather.WD.most_common.compass_degrees\n : \"No reading\";\n const compassHeading = weather.WD.most_common\n ? weather.WD.most_common.compass_point\n : \"No reading\";\n\n // Create the html for displaying the weather data\n html += `\n <div class=\"mars__weather__entry\">\n <p class=\"mars__weather__date\">Sol ${sol} | ${earthDate}</p>\n <p class=\"mars__weather__heading\">Air temperature</p>\n <p class=\"mars__weather__details\">\n Low: ${minTemp}&deg; C | High: ${maxTemp}&deg; C\n </p>\n <p class=\"mars__weather__heading\">Wind speed</p>\n <p class=\"mars__weather__details\">Min: ${maxWind} m/s | Max: ${maxWind} m/s</p>\n <p class=\"mars__weather__heading\">Wind direction</p>\n <div class=\"compass\">\n <div class=\"arrow\" style=\"transform: rotate(${windDirection}deg)\"></div>\n </div>\n <p class=\"mars__weather__details\">${windDirection}&deg; ${compassHeading}</p>\n\n </div>\n `;\n });\n\n // get the container to display the weather\n const container = document.querySelector(\".mars__weather__container\");\n\n // Apply the HTML to the container\n container.innerHTML = html;\n\n // Remove the loader\n const loader = document.querySelector(\".mars__weather__display .loader\");\n loader.style.display = \"none\";\n}", "title": "" }, { "docid": "3a4888c66f65ea6ab1c6b22dd6afcd23", "score": "0.6618704", "text": "function weatherGrabber(city) {\nvar queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&appid=61bd6110a742b7f64e0d6364d6a196d9\";\n\n$.ajax({\n url: queryURL,\n method: \"GET\"\n}).then(function(response) {\n \n // Turns response into usable variables\n var cityNameDay = response.city.name;\n var temperatureDay = k2f(response.list[0].main.temp);\n var humidityDay = response.list[0].main.humidity + \"%\";\n var windSpeedDay = response.list[0].wind.speed + \"MPH\";\n var iconDay = response.list[0].weather[0].icon;\n var latitude = response.city.coord.lat;\n var longitude = response.city.coord.lon;\n\n // Logs results\n console.log(response);\n console.log(\"City name: \" + cityNameDay);\n console.log(\"Temperature: \" + temperatureDay);\n console.log(\"Humidity: \" + humidityDay);\n console.log(\"Wind Speed: \" + windSpeedDay);\n console.log(\"Icon: \" + iconDay);\n console.log(\"Latitude: \" + latitude + \" Longitude: \" + longitude);\n\n // Gets current day and logs it\n const currentDate = moment().format(\"MM/DD/YYYY\");\n console.log(\"Today's date is: \" + currentDate);\n \n // Gets UV Index and displays with color based on level\n var uvQueryURL = \"https://api.openweathermap.org/data/2.5/uvi/forecast?lat=\" + latitude + \"&lon=\" + longitude\n + \"&appid=61bd6110a742b7f64e0d6364d6a196d9\" + \"&cnt=1\";\n\n $.ajax({\n url: uvQueryURL,\n method: \"GET\"\n }).then(function(response) {\n var uvIndex = response[0].value;\n if (uvIndex < 3) {\n $(\"#uvIndex\").text(\"UV Index: \" + uvIndex).css(\"color\", \"green\");\n } else if (uvIndex > 3 && uvIndex < 6) {\n $(\"#uvIndex\").text(\"UV Index: \" + uvIndex).css(\"color\", \"yellow\");\n } else if (uvIndex > 6 && uvIndex < 8) {\n $(\"#uvIndex\").text(\"UV Index: \" + uvIndex).css(\"color\", \"orange\");\n } else if (uvIndex > 8 && uvIndex < 10) {\n $(\"#uvIndex\").text(\"UV Index: \" + uvIndex).css(\"color\", \"red\");\n } else {\n $(\"#uvIndex\").text(\"UV Index: \" + uvIndex).css(\"color\", \"purple\");\n }\n });\n\n // Displays the remaining variables\n $(\"#cityName\").text(cityNameDay + \"(\" + currentDate + \")\");\n $(\"#icon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay + \"@2x.png\");\n $(\"#temperature\").text(\"Temperature: \" + temperatureDay);\n $(\"#humidity\").text(\"Humidity: \" + humidityDay);\n $(\"#windSpeed\").text(\"Wind Speed: \" + windSpeedDay);\n\n // FORECAST BEGINS HERE\n // Day one\n var temperatureDay1 = k2f(response.list[1].main.temp);\n var humidityDay1 = response.list[1].main.humidity + \"%\";\n var iconDay1 = response.list[1].weather[0].icon;\n const dateDay1 = moment().add(1, 'days').format(\"MM/DD/YYYY\");\n\n $(\"#oneDate\").text(dateDay1);\n $(\"#oneIcon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay1 + \"@2x.png\");\n $(\"#oneTemp\").text(\"Temperature: \" + temperatureDay1);\n $(\"#oneHumidity\").text(\"Humidity: \" + humidityDay1);\n\n // Day two\n var temperatureDay2 = k2f(response.list[2].main.temp);\n var humidityDay2 = response.list[2].main.humidity + \"%\";\n var iconDay2 = response.list[2].weather[0].icon;\n const dateDay2 = moment().add(2, 'days').format(\"MM/DD/YYYY\");\n\n $(\"#twoDate\").text(dateDay2);\n $(\"#twoIcon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay2 + \"@2x.png\");\n $(\"#twoTemp\").text(\"Temperature: \" + temperatureDay2);\n $(\"#twoHumidity\").text(\"Humidity: \" + humidityDay2);\n\n // Day three\n var temperatureDay3 = k2f(response.list[3].main.temp);\n var humidityDay3 = response.list[3].main.humidity + \"%\";\n var iconDay3 = response.list[3].weather[0].icon;\n const dateDay3 = moment().add(3, 'days').format(\"MM/DD/YYYY\");\n\n $(\"#threeDate\").text(dateDay3);\n $(\"#threeIcon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay3 + \"@2x.png\");\n $(\"#threeTemp\").text(\"Temperature: \" + temperatureDay3);\n $(\"#threeHumidity\").text(\"Humidity: \" + humidityDay3);\n\n // Day four\n var temperatureDay4 = k2f(response.list[4].main.temp);\n var humidityDay4 = response.list[4].main.humidity + \"%\";\n var iconDay4 = response.list[4].weather[0].icon;\n const dateDay4 = moment().add(4, 'days').format(\"MM/DD/YYYY\");\n\n $(\"#fourDate\").text(dateDay4);\n $(\"#fourIcon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay4 + \"@2x.png\");\n $(\"#fourTemp\").text(\"Temperature: \" + temperatureDay4);\n $(\"#fourHumidity\").text(\"Humidity: \" + humidityDay4);\n\n // Day five\n var temperatureDay5 = k2f(response.list[5].main.temp);\n var humidityDay5 = response.list[5].main.humidity + \"%\";\n var iconDay5 = response.list[5].weather[0].icon;\n const dateDay5 = moment().add(5, 'days').format(\"MM/DD/YYYY\");\n\n $(\"#fiveDate\").text(dateDay5);\n $(\"#fiveIcon\").attr(\"src\" , \"https://openweathermap.org/img/wn/\" + iconDay5 + \"@2x.png\");\n $(\"#fiveTemp\").text(\"Temperature: \" + temperatureDay5);\n $(\"#fiveHumidity\").text(\"Humidity: \" + humidityDay5);\n });\n}", "title": "" }, { "docid": "5e09cf3036bddc4e34f3dd742bdd8858", "score": "0.6617687", "text": "function displayForecast(response){\n let forecastElement = document.querySelector(\"#forecast\");\n forecastElement.innerHTML = null;\n let forecast = null;\n\n for (let index = 0; index < 3; index++) {\n forecast = response.data.list[index];\n forecastElement.innerHTML += `\n <div class=\"column\">\n <h4 class=\"hour-one\">\n ${formatHours(forecast.dt * 1000)}\n </h4>\n <img class=\"weather-icon\" \n src=\"https://openweathermap.org/img/wn/${forecast.weather[0].icon}@2x.png\"\n alt=\"\"\n >\n <strong class=\"boldweather\">${Math.round(forecast.main.temp_max)}º</strong>\n ${Math.round(forecast.main.temp_min)}º\n </div>\n `;\n }\n}", "title": "" }, { "docid": "09c721880af64046fe5dc0d406c51acd", "score": "0.6608228", "text": "function displayData(data) {\n let kelvinTemp = data['main']['temp'];\n let fahrenheitTemp = kelvinToFahrenheit(parseInt(kelvinTemp));\n if (data['weather'][0]['main'] == \"Rain\") {\n $(\"#current-day-rain\").show()\n $(\"#current-day-sun\").hide()\n $(\"#current-day-cloud\").hide()\n } else if (data['weather'][0]['main'] == \"Clouds\") {\n $(\"#current-day-cloud\").show()\n $(\"#current-day-sun\").hide()\n $(\"#current-day-rain\").hide()\n } else if (data['weather'][0]['main'] == \"Clear\") {\n $(\"#current-day-sun\").show()\n $(\"#current-day-rain\").hide()\n $(\"#current-day-cloud\").hide()\n }\n\n\n $(\"#current-day-temp\").text(fahrenheitTemp)\n $(\"#current-day-humidity\").text(data['main']['humidity'])\n $(\"#current-day-wind\").text(data['wind']['speed'])\n let uv;\n fetch(\"http://api.openweathermap.org/data/2.5/uvi?appid=1c5b19324e572588393a1d757d289a9e&lat=\" + data['coord']['lat'] + \"&lon=\" + data['coord']['lon']).then(function(response) {\n response.json().then(function(data) {\n uv = data['value']\n if (uv < 4) {\n $(\"#current-day-uv\")\n .text(uv)\n .css(\"background-color\", \"#79c589\")\n } else if (uv >= 4 && uv < 8) {\n $(\"#current-day-uv\")\n .text(uv)\n .css(\"background-color\", \"#ffc105\")\n } else {\n $(\"#current-day-uv\")\n .text(uv)\n .css(\"background-color\", \"#dc3546\")\n }\n })\n })\n \n}", "title": "" }, { "docid": "dbe140718fa69945f2a4815ff41aa6b7", "score": "0.6607235", "text": "function displayCurrentWeather(city) {\n\n // Var for OpenWeather Api Key, Var for text input and a Var to query the database\n\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&APPID=\" + APIKey + \"&units=imperial\";\n\n // To convert to Fahrenheit: To get data in API for both current weather and forecast in Fahrenheit just add units=imperial parameter into your API call like in this example:\n // api.openweathermap.org/data/2.5/weather?q=London&units=imperial\n\n console.log(queryURL);\n\n // Run AJAX call to the OpenWeatherMap API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n // Store retrieved data inside of an object called \"response\"\n .then(function (response) {\n // Log the queryURL\n console.log(queryURL);\n\n $(\".weather-info\").empty()\n\n // Log the response object\n console.log(response);\n\n // Create a var for weather-info div\n\n \n var weatherInfo = $(\".weather-info\");\n\n console.log(weatherInfo);\n\n // Create var for temperature response\n\n var tempResponse = response.main.temp;\n\n // Create div to display temp\n\n var temperature = $(\"<div>\").text(\"Temperature: \" + tempResponse + \"℉\");\n\n // Append the temp to main WeatherInfo div\n\n weatherInfo.append(temperature)\n\n // Create a var for humidity response:\n\n var humidityResponse = response.main.humidity;\n\n // Create div to display humidity\n\n var humidity = $(\"<div>\").text(\"Humidity: \" + humidityResponse + \"%\");\n\n // Append the humidity to main WeatherInfo div\n\n weatherInfo.append(humidity);\n\n // Create var for wind response:\n\n var windResponse = response.wind.speed;\n\n console.log(\"response is: \" , response)\n\n // Create div to display wind\n\n var wind = $(\"<div>\").text(\"Wind Speed: \" + windResponse + \" MPH\");\n\n // Append wind to weatherInfo\n\n weatherInfo.append(wind);\n\n\n // Ending curly bracket for response function \n });\n }", "title": "" }, { "docid": "0ae0dd14c7d193119ba4a81c1ad47fe5", "score": "0.6606536", "text": "function getData(lat, long){\n $.ajax({\n url : \"https://api.wunderground.com/api/473e5ba859e9731e/geolookup/conditions/q/\"+lat+\",\"+long+\".json\",\n dataType : \"jsonp\",\n success : function(data) {\n var cityName = data['location']['city'];\n var state = data['location']['state'];\n var temp_f = data['current_observation']['temp_f'];\n console.log(\"Current temperature in \" + location + \" is: \" + temp_f);\n\n\nlet place = document.getElementById(\"cityDisplay\");\n \n place.innerHTML = cityName + \", \" + state;\n \nlet weather = document.getElementById(\"current_conditions\");\n weather.innerHTML = temp_f + \"°F\";\n \nlet title = document.getElementById(\"title\");\n title.innerHTML = cityName + \"Weather Home\";\n \n \n $(\"#cover\").fadeOut(250);\n }\n });\n\n }", "title": "" }, { "docid": "a5b8d815fa082f1f30d4e69966fd1895", "score": "0.66019946", "text": "function displayCityInfo() {\n console.log(city);\n var queryURL = 'https://api.openweathermap.org/data/2.5/weather?q=' + city + '&units=imperial&appid=99adabcd9b9526ae2fc8e7bbc24f5de4';\n\n $('#city-date').empty();\n $('#wicon').attr('src', '');\n $('#temp').empty();\n $('#humidity').empty();\n $('#windspeed').empty();\n\n $.ajax({\n url:queryURL,\n method: 'GET'\n }).then(function(response) {\n var farTemp = response.main.temp\n var cityName = response.name;\n var humidity = response.main.humidity;\n var windSpeed = response.wind.speed;\n var iconCode = response.weather[0].icon;\n var iconUrl = 'http://openweathermap.org/img/w/' + iconCode + '.png';\n\n $('#city-date').append(cityName + ' ');\n $('#city-date').append(moment().format('[(]M/D/YYYY[)]'));\n $('#wicon').attr('src', iconUrl);\n $('#temp').append('Temperature: ' + farTemp);\n $('#humidity').append('Humidity: ' + humidity);\n $('#windspeed').append('Wind Speed: ' + windSpeed + ' MPH');\n\n var lat = response.coord.lat;\n var long = response.coord.lon;\n\n uvIndex(lat, long);\n\n });\n}", "title": "" }, { "docid": "991972fc242f681feb9d47c6ea5a0695", "score": "0.659696", "text": "function showWeather(response) {\n let weatherMainly = document.querySelector(\"#weatherMainly\");\n let weatherIconCodeToday = response.data.weather[0].icon;\n let weatherIconToday = document.querySelector(\"#currentWeatherIcon\");\n let currentLocation = document.querySelector(\"#currentLocation\");\n let currentHumidity = document.querySelector(\"#currentHumidity\");\n let currentWind = document.querySelector(\"#currentWind\");\n celsiusTemperature = (response.data.main.temp);\n celsiusCurrentTempMax = (response.data.main.temp_max);\n celsiusCurrentTempMin = (response.data.main.temp_min);\n currentTempElement.innerHTML = Math.round(celsiusTemperature);\n currentTempMaxMinElement.innerHTML = \"Max: \" + Math.round(celsiusCurrentTempMax) + \" \" + \"Min: \" + Math.round(celsiusCurrentTempMin) ;\n weatherIconToday.setAttribute(\"src\",`http://openweathermap.org/img/wn/${weatherIconCodeToday}@2x.png`);\n weatherIconToday.setAttribute(\"alt\", response.data.weather[0].description);\n weatherMainly.innerHTML = `${response.data.weather[0].main}`;\n currentLocation.innerHTML = `${response.data.name}, ${response.data.sys.country}`;\n currentHumidity.innerHTML = `Humidity: ${response.data.main.humidity}%`;\n currentWind.innerHTML = `Wind: ${response.data.wind.speed} m/s`;\n\n}", "title": "" }, { "docid": "c028ec5ab00dc2da15e01a3fb106105b", "score": "0.65947545", "text": "function oneday(city){\n $(\".oneDay\").empty();\n //nested ajax call\n //api.openweathermap.org/data/2.5/weather?q={city name}&appid={API key}\n var url= \"http://api.openweathermap.org/data/2.5/weather?q=\"+city+\"&appid=\"+APIKey;\n console.log(url)\n $.ajax({\n url: url,\n method: \"GET\"\n })\n .then(function(response) \n {\n\n \n /*\n <div class=\"card\">\n <div class=\"card-body\">\n <h2>City Date Icon</h2>\n <p>temp</p>\n <p>hum</p>\n <p>wind</p>\n <p>uv index</p>\n </div>\n </div>\n */ \n\n var div1= $(\"<div>\");\n div1.attr(\"class\",\"card\");\n var div2=$(\"<div>\");\n div1.attr(\"class\",\"card-body\");\n var h2=$(\"<h2>\");\n h2.text(city+\" (\" +moment().format('L')+\") \")\n\n var p1=$(\"<p>\");\n console.log(response.main.temp)\n p1.text(\"Temperature: \" + response.main.temp)\n var p2=$(\"<p>\");\n console.log(response.main.humidity)\n p2.text(\"Humidity: \" + response.main.humidity)\n var p3=$(\"<p>\");\n console.log(response.wind.speed)\n p3.text(\"Wind Speed: \" + response.wind.speed)\n var p4=$(\"<p>\");\n\n div2.append(h2);\n div2.append(p1);\n div2.append(p2);\n div2.append(p3);\n div2.append(p4);\n\n div1.append(div2);\n\n $(\".oneDay\").append(div1);\n var lon =response.coord.lon;\n var lat= response.coord.lat;\n //uv data (lon and lat)\n //http://api.openweathermap.org/data/2.5/uvi?lat={lat}&lon={lon}&appid={API key}\n var uvURL=\"http://api.openweathermap.org/data/2.5/uvi?lat=\"+lat+\"&lon=\"+lon+\"&appid=\"+APIKey;\n console.log(uvURL);\n $.ajax({\n url: uvURL,\n method: \"GET\"\n }).then(function(uvObj) {\n console.log(uvObj.value) \n p4.text(\"UV Index: \"+uvObj.value)\n })\n\n \n\n\n })\n}", "title": "" }, { "docid": "15219b7ce468c5ed89f7e9d68f8e6df0", "score": "0.6591971", "text": "function displayWeather(data) {\nconsole.log(data) \n const name =document.querySelector(\"#search\").value \n const weather = data.current.weather[0].main; \n const { temp, humidity } = data.current;\n const { wind_speed } = data.current;\n const { uvi } = data.current;\n\n document.querySelector(\".city\").innerText = \"Weather in \" + name; \n document.querySelector(\".condition\").innerText = weather;\n document.querySelector(\".temp\").innerText = temp + \"°C\";\n document.querySelector(\".humid\").innerText = humidity + \"%\";\n document.querySelector(\".wind\").innerText = wind_speed + \"km/h\"; \n\n if (uvi <= 2.99) {\n document.querySelector(\".uvi\").setAttribute('style', 'background-color: #ccff99; border: 2px solid green; border-radius: 3px; padding: 0px 3px 0px 3px;');\n document.querySelector(\".uvi\").textContent = `Low: ${uvi}`;\n } else if (uvi >= 3.00 && uvi <= 5.00) {\n document.querySelector(\".uvi\").setAttribute('style', 'background-color: #ffff99; border: 2px solid #cccc00; border-radius: 3px; padding: 0px 3px 0px 3px;');\n document.querySelector(\".uvi\").textContent = `Med-Low: ${uvi}`;\n } else if (uvi >= 6.00 && uvi <= 7.00) {\n document.querySelector(\".uvi\").setAttribute('style', 'background-color: #ffd699; border: 2px solid orange; border-radius: 3px; padding: 0px 3px 0px 3px;;');\n document.querySelector(\".uvi\").textContent = `Med-High: ${uvi}`;\n } else {\n document.querySelector(\".uvi\").setAttribute('style', 'background-color: #ffad99; border: 2px solid red; border-radius: 3px; padding: 0px 3px 0px 3px;');\n document.querySelector(\".uvi\").textContent = `High: ${uvi}`;\n }\n\n // 5 Day Weather Forecast Display Loop\n let otherDayForecast = ''\n data.daily.forEach((day, idx) => {\n if (idx == 0) {\n currentTempEl.innerHTML = ` \n <div class=\"other\"> \n <div class=\"day\">${window.moment(day.dt * 1000).format('dddd')}</div>\n <img src=\"http://openweathermap.org/img/wn/${day.weather[0].icon}@2x.png\" alt=\"weather icon\" class=\"w-icon\"> \n <div class=\"temp\">Night: ${day.temp.night}°C</div>\n <div class=\"temp\">Day: ${day.temp.day}°C</div>\n </div> `\n\n } else {\n otherDayForecast += `\n <div class=\"weather-forecast-item\">\n <div class=\"day\">${window.moment(day.dt * 1000).format('ddd')}</div>\n <img src=\"http://openweathermap.org/img/wn/${day.weather[0].icon}@2x.png\" alt=\"weather icon\" class=\"w-icon\"> \n <div class=\"temp\">Night: ${day.temp.night}°C</div>\n <div class=\"temp\">Day: ${day.temp.day}°C</div> \n </div>`\n }\n })\n weatherForecastEl.innerHTML = otherDayForecast\n\n}", "title": "" }, { "docid": "5d0faf52da4946b5965d18b5729c8758", "score": "0.6589622", "text": "function displayCityInfo() {\r\n\r\n var city = $(this).attr(\"data-name\");\r\n console.log(city);\r\n $(\"#weather-forecast\").empty();\r\n \r\n //function to display current weather conditions on selected city\r\n function displayWeather(){\r\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?\" + \"q=\" + city + \"&appid=\" + \"166a433c57516f51dfab1f7edaed8413\";\r\n\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function(response) {\r\n //console log to view object returned by API call\r\n console.log(response);\r\n \r\n var cityDiv = $(\"<div class='city'>\");\r\n //convert degrees K to degrees F\r\n var Ftemp = (response.main.temp - 273.15) *1.8 +32;;\r\n var humidity = (response.main.humidity);\r\n var windSpeed = (response.wind.speed);\r\n \r\n //generates html to page\r\n var hOne = $(\"<h3>\").text(\"Current weather conditions for \" + city);\r\n var pOne = $(\"<p>\").text(\"Temperature: \" + Ftemp.toFixed(0) + \" °F\");\r\n var pTwo = $(\"<p>\").text(\"Humidity: \" + humidity + \"%\");\r\n var pThree = $(\"<p>\").text(\"Wind Speed: \" + windSpeed.toFixed(0) + \" m.p.h.\");\r\n var hTwo = $(\"<h4>\").text(\"5-Day Forecast for \" + city);\r\n \r\n cityDiv.append(hOne, pOne, pTwo, pThree, hTwo);\r\n \r\n //removes prior weather info and updates with latest city click\r\n $(\"#current-weather\").empty();\r\n $(\"#current-weather\").prepend(cityDiv);\r\n\r\n uvNice(response.coord.lat, response.coord.lon);\r\n });\r\n };\r\n \r\n //currently still in development to show UV Index under current weather conditions\r\n function uvNice(lat,lon) {\r\n \r\n var queryURL = \"https://api.openweathermap.org/data/2.5/uvi?appid=166a433c57516f51dfab1f7edaed8413\" + lat + \"&lon=\" + lon;\r\n\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function(response) {\r\n \r\n console.log(response);\r\n \r\n });\r\n };\r\n // API call to return 5-day forecast for selected city\r\n function fiveDay() {\r\n console.log(city);\r\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?\" + \"q=\" + city + \"&appid=\" + \"166a433c57516f51dfab1f7edaed8413\";\r\n\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function(response) {\r\n \r\n console.log(response);\r\n\r\n // create loop through array for forecasted tempts at noon daily\r\n for (var i = 0; i < response.list.length; i++) {\r\n \r\n if (response.list[i].dt_txt.indexOf(\"12:00:00\") !== -1) {\r\n \r\n // create card content for weather forecast\r\n var col = $(\"<div class='col-md-2'>\");\r\n var card = $(\"<div class='bg-primary text-white'>\");\r\n var body = $(\"<div class='card-body p-2'>\");\r\n \r\n var date = $(\"<h5>\").addClass(\"card-title\").text(new Date(response.list[i].dt_txt).toLocaleDateString());\r\n \r\n var png = $(\"<img>\").attr(\"src\", \"http://openweathermap.org/img/w/\" + response.list[i].weather[0].icon + \".png\");\r\n \r\n var pOne = $(\"<p>\").addClass(\"card-text\").text(\"Temp: \" + ((response.list[i].main.temp_max - 273.15) * 1.8 + 32).toFixed(0)+ \" °F\");\r\n var pTwo = $(\"<p>\").addClass(\"card-text\").text(\"Humidity: \" + response.list[i].main.humidity + \"%\");\r\n \r\n //appends data to the page\r\n $(\"#weather-forecast\").append(col);\r\n \r\n col.append(card.append(body.append(date, png, pOne, pTwo)));\r\n $(\"#weather-forecast\").prepend(col);\r\n }\r\n }\r\n });\r\n }\r\n\r\n displayWeather();\r\n fiveDay();\r\n }", "title": "" }, { "docid": "2121bb6393e3da5ba9be69c2047f033e", "score": "0.65892994", "text": "function getData(lat, lon) {\n // Get the data from the wunderground API\n $.ajax({\n url: \"//api.wunderground.com/api/5fabe86224c61a86/geolookup/conditions/forecast/q/\" + lat + \",\" + lon + \".json\",\n dataType: \"jsonp\",\n success: function (data) {\n console.log(data);\n var location = data.location.city + ', ' + data.location.state;\n var temp_f = data.current_observation.temp_f;\n var city = data['location']['city'];\n var state = data['location']['state'];\n var high = data.forecast.simpleforecast.forecastday[\"0\"].high.fahrenheit;\n var low = data.forecast.simpleforecast.forecastday[\"0\"].low.fahrenheit;\n var summary = data.current_observation.weather;\n var icon = data.current_observation.icon;\n var iconurl = \"//icons.wxug.com/i/c/k/\" +icon+ \".gif\";\n var wind = data.current_observation.wind_string;\n console.log('Location is: ' + location);\n console.log('Temp is: ' + temp_f);\n $('.title').append(\" \" + city + \", \" + state);\n $(\"#title\").text(\"Weather Now: \" + city + \", \" + state);\n $(\"#currentTemp\").text(\"Temperature: \" + Math.round(temp_f) + \" \\u00B0F\");\n $(\"#summary\").text(summary);\n $(\"#high\").text(\"Today's High: \" + Math.round(high) + \" \\u00B0F\");\n $(\"#low\").text(\"Today's Low: \" + Math.round(low) + \" \\u00B0F\");\n $(\".nowicon\").html('<img src=' + iconurl + ' alt=' + icon + ' class= nowicon>');\n $(\"#windDescription\").text(wind)\n $(\"#cover\").fadeOut(250);\n }\n });\n}", "title": "" }, { "docid": "2e0d387617652df50f7bd5626699b139", "score": "0.65884477", "text": "function getWeatherInfo(latitude, longitude, city, state) {\n //https://api.darksky.net/forecast/73df02eb733faad1b783530f33626c95/37.8267,-122.4233\n //BaseAPI/APIKey/Lat,Long\n\n $.ajax(\n \"https://api.darksky.net/forecast/\" + darkSkyKey + \"/\" + latitude + \",\" +longitude,\n { dataType: \"jsonp\" }\n )\n .done(function(data) {\n \n let templateHTML = $(\"#template\").html();\n let temperature = data.currently.temperature;\n let conditions = data.currently.summary;\n let currentDayInfo = data.daily.data[0];\n let highTemp = currentDayInfo.temperatureHigh;\n let lowTemp = currentDayInfo.temperatureLow;\n let precipChance = currentDayInfo.precipProbability;\n let weatherImg = data.currently.icon;\n\n templateHTML = templateHTML.replace(\"@@city@@\", city);\n templateHTML = templateHTML.replace(\"@@currentTemp@@\", Math.round(temperature));\n templateHTML = templateHTML.replace(\"@@cityState@@\", city + \" \" + state);\n templateHTML = templateHTML.replace(\"@@conditions@@\", conditions);\n\n templateHTML = templateHTML.replace(\"@@highTemp@@\", Math.round(highTemp));\n templateHTML = templateHTML.replace(\"@@lowTemp@@\", Math.round(lowTemp));\n templateHTML = templateHTML.replace(\"@@precipChance@@\", Math.round(precipChance * 100));\n templateHTML = templateHTML.replace(\"@@imageURL@@\", \"../img/\" + weatherImg + \".jpg\")\n\n for (var i = 0; i < 5; i++) {\n if (i >= 0) {\n let date = new Date();\n date.setDate(date.getDate() + i);\n \n let month = date.getMonth() + 1;\n \n let day = date.getDate();\n \n templateHTML = templateHTML.replace(\"@@date\" + i + \"@@\", month + \"/\" + day);\n }\n \n let currentDayWeatherData = data.daily.data[i];\n templateHTML = templateHTML.replace(\"@@max\" + i + \"@@\", Math.round(currentDayWeatherData.temperatureMax));\n\n templateHTML = templateHTML.replace(\"@@low\" + i + \"@@\", Math.round(currentDayWeatherData.temperatureLow));\n\n templateHTML = templateHTML.replace(\"@@precip\" + i + \"@@\", Math.round(currentDayWeatherData.precipProbability * 100));\n }\n\n\n \n\n\n //add the configured template to our row in the card container\n $(\".row\").append(templateHTML)\n\n\n\n })\n .fail(function(error) {\n console.log(error);\n })\n .always(function() {\n console.log(\"weather call complete\");\n });\n}", "title": "" }, { "docid": "6611634ae2581cca70fe73c36c3edad6", "score": "0.6578746", "text": "function final(a){\n $.ajax({\n type: 'GET',\n url: \"http://cors-anywhere.herokuapp.com/http://www.metaweather.com/api/location/\"+a,\n connection: 'Keep-Alive',\n success: function(data){\n $('#results').find('span').remove();\n //create var fordata.consolidated_weather\n var fiveDay = data.consolidated_weather; \n //iterate through\n $('#results').append(`<span class=\"location\"><h2>${data.title} </h2><div id=\"wrap\"></div></span>`);\n for(var j =0;j<fiveDay.length;j++){\n //create var for max temp\n var high = Math.round(fiveDay[j].max_temp);\n //create var for min temp\n var low = Math.round(fiveDay[j].min_temp);\n var day = new Date(fiveDay[j].applicable_date);\n //sppend each[i] to a span\n $('#wrap').append(`<div id=\"contents\"><h3>${day.toDateString()} </h3>\n <div class=\"cloud\"><img src=\"http://www.metaweather.com/static/img/weather/${fiveDay[j].weather_state_abbr}.svg\"/></div>\n <div class=\"weather_state\">${fiveDay[j].weather_state_name}</div>\n <div class=\"high\">High of ${faren(high)}\\u00B0 F</div>\n <div class= \"low\">Low of ${faren(low)}\\u00B0 F</div></div>`);\n } \n }\n })}", "title": "" }, { "docid": "10be733715327e7ff47f634bff042176", "score": "0.65734076", "text": "function getData(lat, long) {\n $.ajax({\n url: \"https://api.wunderground.com/api/f2d1c7032fa51e18/geolookup/conditions/forecast/hourly/q/\" + lat + \",\" + long + \".json\"\n , dataType: \"jsonp\"\n , success: function (data) {\n //make sure we get something back\n console.log(data);\n \n //set the data to some managable vars\n var location = data.location.city + \", \" + data.location.state;\n $('.location').html(location);\n //get the current temp\n var curTemp = data.current_observation.temp_f;\n $('.temp-large').html(curTemp);\n //sumary image url\n var summary = data.current_observation.icon_url;\n $('.summary-image').attr('src', summary);\n //high and low temps\n var high = data.forecast.simpleforecast.forecastday[0].high.fahrenheit;\n var low = data.forecast.simpleforecast.forecastday[0].low.fahrenheit;\n $('.high').html(high + \"°\" + \"<span>&#8593;</span>\");\n $('.low').html(low + \"°\" + \"<span>&#8595;</span>\");\n //feels like temp\n var feelsLike = data.current_observation.feelslike_f;\n $('.feels-like').html(\"Feels like: \" + feelsLike + \"°\")\n //precipitation (in inches)\n var precip = data.current_observation.precip_today_in;\n $('.precip').html(precip);\n //wind info\n var windSpeed = data.current_observation.wind_mph;\n var windDirection = data.current_observation.wind_dir;\n $('.wind-data').html(\"Wind: \" + windSpeed + \"mph | \" + windDirection);\n \n //hourly temps\n var hourlyArray = data.hourly_forecast;\n $('.hr0').html(hourlyArray[0].temp.english + \"°\");\n $('.hr1').html(hourlyArray[1].temp.english + \"°\");\n $('.hr2').html(hourlyArray[2].temp.english + \"°\");\n $('.hr3').html(hourlyArray[3].temp.english + \"°\");\n $('.hr4').html(hourlyArray[4].temp.english + \"°\");\n $('.hr5').html(hourlyArray[5].temp.english + \"°\");\n $('.hr6').html(hourlyArray[6].temp.english + \"°\");\n $('.hr7').html(hourlyArray[7].temp.english + \"°\");\n $('.hr8').html(hourlyArray[8].temp.english + \"°\");\n $('.hr9').html(hourlyArray[9].temp.english + \"°\");\n $('.hr10').html(hourlyArray[10].temp.english + \"°\");\n $('.hr11').html(hourlyArray[11].temp.english + \"°\");\n $('.hr12').html(hourlyArray[12].temp.english + \"°\");\n $('.hr13').html(hourlyArray[13].temp.english + \"°\");\n $('.hr14').html(hourlyArray[14].temp.english + \"°\");\n $('.hr15').html(hourlyArray[15].temp.english + \"°\");\n $('.hr16').html(hourlyArray[16].temp.english + \"°\");\n $('.hr17').html(hourlyArray[17].temp.english + \"°\");\n $('.hr18').html(hourlyArray[18].temp.english + \"°\");\n $('.hr19').html(hourlyArray[19].temp.english + \"°\");\n $('.hr20').html(hourlyArray[20].temp.english + \"°\");\n $('.hr21').html(hourlyArray[21].temp.english + \"°\");\n $('.hr22').html(hourlyArray[22].temp.english + \"°\");\n $('.hr23').html(hourlyArray[23].temp.english + \"°\");\n \n //5 day forcast\n var fiveDayArray = data.forecast.simpleforecast.forecastday;\n $('.monday').html(\"Monday: \" + fiveDayArray[0].high.fahrenheit + \"°\");\n $('.monday-img').attr('src', fiveDayArray[0].icon_url);\n \n $('.tuesday').html(\"Tuesday: \" + fiveDayArray[1].high.fahrenheit + \"°\");\n $('.tuesday-img').attr('src', fiveDayArray[1].icon_url);\n \n $('.wednesday').html(\"Wednesday: \" + fiveDayArray[2].high.fahrenheit + \"°\");\n $('.wednesday-img').attr('src', fiveDayArray[2].icon_url);\n \n $('.thursday').html(\"Thursday: \" + fiveDayArray[3].high.fahrenheit + \"°\");\n $('.thursday-img').attr('src', fiveDayArray[3].icon_url);\n \n $('.friday').html(\"Friday: \" + fiveDayArray[1].high.fahrenheit + \"°\");\n $('.friday-img').attr('src', fiveDayArray[1].icon_url);\n \n \n \n \n }\n });\n $(\"#cover\").fadeOut(250);\n }", "title": "" }, { "docid": "33226fd9b3e31782f4b1865b82c9fa2b", "score": "0.65728146", "text": "function displayWeather(weather) {\n const locations = {\n lat : weather.location.lat,\n lon : weather.location.lon\n }\n changeBgColorWithWeather(weather.current.weather_code);\n reportArea.setAttribute(\"style\", \"display: block;\");\n cityState.innerText = `${weather.location.name}, ${weather.location.region}`;\n currentWeather.innerText = `${weather.current.temperature}℉ | ${Math.round((weather.current.temperature - 32) * 5/9)}℃`;\n time.innerText = `${getDate().today}`\n iconArea.innerHTML = `<img src=${weather.current.weather_icons[0]}>`\n getForcast(locations);\n}", "title": "" }, { "docid": "1226d13a6944154fd2b4deb74d8e006d", "score": "0.6572539", "text": "function forecastWeather(details) {\n forecast = details;\n // Moved displaySecondaryInfo() function into this fetch() so that I can use the oneCall current temp for the 'today' mins and maxes\n displaySecondaryInfo();\n}", "title": "" }, { "docid": "eb103c111880f554f825f2a4f3e2328d", "score": "0.65699893", "text": "function getData(info) {\n city.innerText = info.name;\n temp.innerText = info.main.temp;\n main.innerText = info.weather[0].main;\n icon.src = `https://openweathermap.org/img/wn/${info.weather[0].icon}@2x.png`;\n}", "title": "" }, { "docid": "834c4154f72da6ef88e9949326ad6f63", "score": "0.6568315", "text": "function displayCityName(cityName) {\n var displayURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&units=imperial&appid=\" + API_KEY;\n $.ajax({\n url: displayURL,\n method: \"GET\"\n }).then(function (response) {\n $(\".city\").html(\"<h1>\" + response.name + \"</h1>\");\n $(\".temp\").text(\"Temperature: \" + response.main.temp + \"F\");\n $(\".humidity\").text(\"Humidity: \" + response.main.humidity + \"%\");\n $(\".wind\").text(\"Wind speed: \" + response.wind.speed + \"s\");\n $(\".mainIcon\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \"@2x.png\");\n $(\".description\").text(response.weather[0].description);\n // provides UV data\n var UVurl = \"https://api.openweathermap.org/data/2.5/uvi?lat=\" + response.coord.lat + \"&lon=\" + response.coord.lon + \"&appid=\" + API_KEY;\n\n $.ajax({\n url: UVurl,\n method: \"GET\"\n }).then(function (response) {\n $(\".uv\").text(\"UV index: \" + response.value);\n var UV = response.value;\n if (UV > 7) {\n $(\".uv\").attr(\"class\", \"uv high\");\n } else if (UV > 5) {\n $(\".uv\").attr(\"class\", \"uv moderate\");\n } else {\n $(\".uv\").attr(\"class\", \"uv low\");\n }\n });\n var forecastURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityName + \"&units=imperial&appid=\" + API_KEY\n $.ajax({\n url: forecastURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n $(\".date0\").text(response.list[5].dt_txt);\n $(\".icon0\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.list[5].weather[0].icon + \"@2x.png\");\n $(\".description0\").text(response.list[5].weather[0].description);\n $(\".date1\").text(response.list[13].dt_txt);\n $(\".icon1\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.list[13].weather[0].icon + \"@2x.png\");\n $(\".description1\").text(response.list[13].weather[0].description);\n $(\".date2\").text(response.list[21].dt_txt);\n $(\".icon2\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.list[21].weather[0].icon + \"@2x.png\");\n $(\".description2\").text(response.list[21].weather[0].description);\n $(\".date3\").text(response.list[29].dt_txt);\n $(\".icon3\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.list[29].weather[0].icon + \"@2x.png\");\n $(\".description3\").text(response.list[29].weather[0].description);\n $(\".date4\").text(response.list[37].dt_txt);\n $(\".icon4\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.list[37].weather[0].icon + \"@2x.png\");\n $(\".description4\").text(response.list[37].weather[0].description);\n $(\".forecastTemp0\").text(\"Temp: \" + response.list[5].main.temp + \"F\");\n $(\".forecastTemp1\").text(\"Temp: \" + response.list[13].main.temp + \"F\");\n $(\".forecastTemp2\").text(\"Temp: \" + response.list[21].main.temp + \"F\");\n $(\".forecastTemp3\").text(\"Temp: \" + response.list[29].main.temp + \"F\");\n $(\".forecastTemp4\").text(\"Temp: \" + response.list[37].main.temp + \"F\");\n $(\".forecastHum0\").text(\"Humidity: \" + response.list[5].main.humidity + \"%\");\n $(\".forecastHum1\").text(\"Humidity: \" + response.list[13].main.humidity + \"%\");\n $(\".forecastHum2\").text(\"Humidity: \" + response.list[21].main.humidity + \"%\");\n $(\".forecastHum3\").text(\"Humidity: \" + response.list[29].main.humidity + \"%\");\n $(\".forecastHum4\").text(\"Humidity: \" + response.list[37].main.humidity + \"%\");\n\n });\n })\n}", "title": "" }, { "docid": "670b4e40f68c19cafca90b482f2748c6", "score": "0.65660065", "text": "function getForecast(searchtext) {\n fetch(apiCoord + \"&lat=\" + lat + \"&lon=\" + long + \"&units=metric\" + apiKey)\n .then(function(response){\n return response.json();\n }\n )\n .then(function(data){\n console.log(data);\n\n //if statements for UV bg color\n if (data.current.uvi <= 5) {\n bgc = \"lightgreen\";\n }\n if (data.current.uvi > 5) {\n bgc = \"lightyellow\";\n }\n if (data.current.uvi > 10) {\n bgc = \"lightorange\";\n }\n \n \n icon = data.current.weather[0].icon;\n //get date\n date = new Date().toLocaleDateString(\"en-US\", {\n timeZone: `${data.timezone}`,\n });\n $(\"#city\").html(\n `${searchtext.toUpperCase()}, ${date} <img src='http://openweathermap.org/img/w/${icon}.png'/>`\n );\n // today's weather conditions\n $(\"#temp\").html(` ${data.current.temp} C`);\n $(\"#wind\").html(` ${data.current.wind_speed} Km/h`);\n $(\"#humidity\").html(` ${data.current.humidity} %`);\n $(\"#uv\").html(`<span id=\"uvI\"> ${data.current.uvi}</span>`);\n $(\"#uvI\").css(\"background-color\", bgc);\n //5 day weather conditions\n $(\".5day\").html(\"\");\n for (let i = 1; i < 6; i++) {\n //get icon\n icon = data.daily[i].weather[0].icon;\n //convert date\n date = new Date(data.daily[i].dt * 1000).toLocaleDateString(\"en-US\", {\n timeZone: `${data.timezone}`,\n });\n //append html\n $(\".5day\").append\n (`<div class=\"col-sm-2 bg-light mr-2\">\n <p id=\"5Date0\">${date}</p>\n <p id=\"5Img0\"><img src='http://openweathermap.org/img/w/${icon}.png'/></p>\n <p>Temp: <span id=\"5Temp0\"> ${data.daily[i].temp.day} C</span></p>\n <p>HumidX: <span id=\"5Humidity0\">${data.daily[i].humidity} %</span></p>\n <p>Wind: <span id=\"5Wind0\">${data.daily[i].wind_speed} </span>kmh</p>\n </div>`)}\n \n })}", "title": "" }, { "docid": "05bb66095f6bab20c578fcef05c2ef2b", "score": "0.65645635", "text": "render(data){\n const city = data.name;\n const country = data.sys.country;\n const currentTempValue = Math.round(data.main.temp);\n const iconName = data.weather[0].icon;\n const humidityValue = data.main.humidity;\n const wndSpdValue = data.wind.speed;\n const weatherCondValue = data.weather[0].description;\n const date = new Date();\n\n/*eslint no-console:0*/\n console.log('current day: ', new Date(1547795276 * 1000).getDate());\n document.getElementById('location').innerHTML = `${city}, ${country}`;\n document.getElementById('current-temp').innerHTML = `${currentTempValue}&deg;C`;\n document.getElementById('current-weather-img').src = `http://openweathermap.org/img/w/${iconName}.png`;\n document.getElementById('humidity').innerHTML = `Влажность: ${humidityValue}%`;\n document.getElementById('wnd-spd').innerHTML = `Ветер: ${wndSpdValue} км/ч`;\n document.getElementById('weather-cond').innerHTML = `${weatherCondValue}`;\n document.getElementById('day-week').innerHTML = date.toLocaleDateString('ru-Ru', {weekday: 'long'});\n }", "title": "" }, { "docid": "c4bef0f126cb44680e2849c5628293c0", "score": "0.65601695", "text": "function getWeather(data) {\n\n var requestUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${data.lat}&lon=${data.lon}&exclude=minutely,hourly,alerts&units=metric&appid=${APIkey}`\n fetch(requestUrl)\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n\n // current weather\n var currentConditionsEl = $('#currentConditions');\n currentConditionsEl.addClass('border border-primary');\n\n // create city name element and display\n var cityNameEl = $('<h2>');\n cityNameEl.text(currentCity);\n currentConditionsEl.append(cityNameEl);\n \n // get date from results and display by appending to city name element\n var currentCityDate = data.current.dt;\n currentCityDate = moment.unix(currentCityDate).format(\"MM/DD/YYYY\");\n var currentDateEl = $('<span>');\n currentDateEl.text(` (${currentCityDate}) `);\n cityNameEl.append(currentDateEl);\n\n // get weather icon and display by appending to city name element \n var currentCityWeatherIcon = data.current.weather[0].icon; // current weather icon\n var currentWeatherIconEl = $('<img>');\n currentWeatherIconEl.attr(\"src\", \"http://openweathermap.org/img/wn/\" + currentCityWeatherIcon + \".png\");\n cityNameEl.append(currentWeatherIconEl);\n\n // get current temp data and display\n var currentCityTemp = data.current.temp;\n var currentTempEl = $('<p>')\n currentTempEl.text(`Temp: ${currentCityTemp}°C`)\n currentConditionsEl.append(currentTempEl);\n \n // get current wind speed and display\n var currentCityWind = data.current.wind_speed;\n var currentWindEl = $('<p>')\n currentWindEl.text(`Wind: ${currentCityWind} KPH`)\n currentConditionsEl.append(currentWindEl);\n\n // get current humidity and display\n var currentCityHumidity = data.current.humidity;\n var currentHumidityEl = $('<p>')\n currentHumidityEl.text(`Humidity: ${currentCityHumidity}%`)\n currentConditionsEl.append(currentHumidityEl);\n\n // get current UV index, set background color based on level and display\n var currentCityUV = data.current.uvi;\n var currentUvEl = $('<p>');\n var currentUvSpanEl = $('<span>');\n currentUvEl.append(currentUvSpanEl);\n\n currentUvSpanEl.text(`UV: ${currentCityUV}`)\n \n if ( currentCityUV < 3 ) {\n currentUvSpanEl.css({'background-color':'green', 'color':'white'});\n } else if ( currentCityUV < 6 ) {\n currentUvSpanEl.css({'background-color':'yellow', 'color':'black'});\n } else if ( currentCityUV < 8 ) {\n currentUvSpanEl.css({'background-color':'orange', 'color':'white'});\n } else if ( currentCityUV < 11 ) {\n currentUvSpanEl.css({'background-color':'red', 'color':'white'});\n } else {\n currentUvSpanEl.css({'background-color':'violet', 'color':'white'});\n }\n\n currentConditionsEl.append(currentUvEl);\n\n // 5 - Day Forecast\n // create 5 Day Forecast <h2> header\n var fiveDayForecastHeaderEl = $('#fiveDayForecastHeader');\n var fiveDayHeaderEl = $('<h2>');\n fiveDayHeaderEl.text('5-Day Forecast:');\n fiveDayForecastHeaderEl.append(fiveDayHeaderEl);\n\n var fiveDayForecastEl = $('#fiveDayForecast');\n\n // get key weather info from API data for five day forecast and display\n for (var i = 1; i <=5; i++) {\n var date;\n var temp;\n var icon;\n var wind;\n var humidity;\n\n date = data.daily[i].dt;\n date = moment.unix(date).format(\"MM/DD/YYYY\");\n\n temp = data.daily[i].temp.day;\n icon = data.daily[i].weather[0].icon;\n wind = data.daily[i].wind_speed;\n humidity = data.daily[i].humidity;\n\n // create a card\n var card = document.createElement('div');\n card.classList.add('card', 'col-2', 'm-1', 'bg-primary', 'text-white');\n \n // create card body and append\n var cardBody = document.createElement('div');\n cardBody.classList.add('card-body');\n cardBody.innerHTML = `<h6>${date}</h6>\n <img src= \"http://openweathermap.org/img/wn/${icon}.png\"> </><br>\n ${temp}°C<br>\n ${wind} KPH <br>\n ${humidity}%`\n \n card.appendChild(cardBody);\n fiveDayForecastEl.append(card);\n }\n })\n return;\n}", "title": "" }, { "docid": "bb4014e6c6a567624293fe32ee454fd6", "score": "0.65595424", "text": "function displayCityInfo(){\n var city = $(this).attr(\"data-name\");\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial&appid=16e99cc70c7cbbdcf35ae6166af0f447\"\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n //console.log(response);\n $(\".currentCity\").text(response.name +\" \"+ moment().format('L'))\n $(\".temp\").text(\"Temperature: \" + (response.main.temp));\n $(\".humid\").text(\"Humidity: \" + (response.main.humidity));\n $(\".wind\").text(\"Wind: \" + (response.wind.speed)); \n \n\n var lat = response.coord.lat\n var lon = response.coord.lon\n var uvURL = \"https://api.openweathermap.org/data/2.5/uvi?lat=\" + lat + \"&lon=\" + lon +\"&appid=16e99cc70c7cbbdcf35ae6166af0f447\"\n $.ajax({\n url: uvURL,\n method: \"GET\"\n }).then(function(response) {\n var UV = $(\".uvIndex\")\n if (response.value < 3){\n UV.removeClass(\"red green yellow orange purple\");\n UV.addClass(\"green\");\n } else if(response.value >= 3 && response.value < 5){\n UV.removeClass(\"red green yellow orange purple\");\n UV.addClass(\"yellow\");\n } else if (response.value >= 5 && response.value < 7){\n UV.removeClass(\"red green yellow orange purple\");\n $(\".uvIndex\").addClass(\"orange\");\n }else if (response.value >= 7 && response.value < 11){\n UV.removeClass(\"red green yellow orange purple\");\n UV.addClass(\"red\");\n }else if (response.value >= 11){\n UV.removeClass(\"red green yellow orange purple\");\n UV.addClass(\"purple\");\n }\n $(\".uvIndex\").text(response.value);\n });\n\n var dayURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&units=imperial&appid=16e99cc70c7cbbdcf35ae6166af0f447\"\n $.ajax({\n url: dayURL,\n method: \"GET\"\n }).then(function(response) {\n //console.log(response);\n\n $(\"#date1\").text(moment().add(1,\"days\").format(\"MMMM Do\"))\n $(\"#icon1\").attr(\"src\", \"https://openweathermap.org/img/wn/\"+response.list[1].weather[0].icon+\"@2x.png\") \n $(\"#temp1\").text(\"Temp: \" + response.list[3].main.temp)\n $(\"#humid1\").text(\"Humidity: \" + response.list[3].main.humidity)\n \n $(\"#date2\").text(moment().add(2,\"days\").format(\"MMMM Do\"))\n $(\"#icon2\").attr(\"src\", \"https://openweathermap.org/img/wn/\"+response.list[10].weather[0].icon+\"@2x.png\")\n $(\"#temp2\").text(\"Temp: \" + response.list[11].main.temp)\n $(\"#humid2\").text(\"Humidity: \" + response.list[11].main.humidity)\n \n $(\"#date3\").text(moment().add(3,\"days\").format(\"MMMM Do\"))\n $(\"#icon3\").attr(\"src\", \"https://openweathermap.org/img/wn/\"+response.list[19].weather[0].icon+\"@2x.png\")\n $(\"#temp3\").text(\"Temp: \" + response.list[19].main.temp)\n $(\"#humid3\").text(\"Humidity: \" + response.list[19].main.humidity)\n \n $(\"#date4\").text(moment().add(4,\"days\").format(\"MMMM Do\"))\n $(\"#icon4\").attr(\"src\", \"https://openweathermap.org/img/wn/\"+response.list[28].weather[0].icon+\"@2x.png\")\n $(\"#temp4\").text(\"Temp: \" + response.list[27].main.temp)\n $(\"#humid4\").text(\"Humidity: \" + response.list[27].main.humidity)\n \n $(\"#date5\").text(moment().add(5,\"days\").format(\"MMMM Do\"))\n $(\"#icon5\").attr(\"src\", \"https://openweathermap.org/img/wn/\"+response.list[37].weather[0].icon+\"@2x.png\")\n $(\"#temp5\").text(\"Temp: \" + response.list[35].main.temp)\n $(\"#humid5\").text(\"Humidity: \" + response.list[35].main.humidity)\n \n });\n });\n\n \n}", "title": "" }, { "docid": "e69626b06aa633bc168a8c105b391144", "score": "0.6558936", "text": "function getConditions(lat, long) {\n $.ajax({\n url: \"https://api.wunderground.com/api/acd28d73045d22e0/conditions/q/\" + lat + ',' + long + \".json\",\n dataType: \"jsonp\"\n }).done(function(condition) {\n \n\n var loc = condition.current_observation.display_location;\n var observe = condition.current_observation;\n var possibleWeather = observe.weather;\n var tempF = observe.temp_f + \" &deg;F\";\n var tempC = observe.temp_c + \" &deg;C\";\n\n //get end of icon url to determine day or night\n var icon = observe.icon_url.split(\"/\").pop();\n var iconRegEx = new RegExp(\"nt_\", \"g\");\n var nightTime = iconRegEx.test(icon);\n\n //call to determine icon and background\n getWeatherFontIcon(possibleWeather, nightTime);\n\n //format update time\n var asOf = observe.observation_time;\n var asOfLength = asOf.length;\n asOf = asOf.slice(16, asOfLength - 4);\n\n //check for bodyImageUrl\n if (bodyImageUrl !== \"\" && bodyImageUrl !== undefined) {\n $('body').css({\n 'background': 'url(' + bodyImageUrl + ') no-repeat #000',\n 'background-size': '100%'\n });\n }\n\n //build html\n var locationDiv = '<p class=\"location\">' + loc.city + ', ' + loc.state + '</p><p class=\"small asof\"> as of ' + asOf + '</p>';\n\n var weatherDiv = '<p>' + observe.weather + '</p><p class=\"temperature\">' + tempF + '</p>';\n\n $('.weather').append(locationDiv + weatherDiv);\n $('.loader').remove();\n\n if (weatherIcon !== undefined) {\n $('.animate-icon').append(weatherIcon);\n\n $('.wi').addClass(\"animated bounceInUp\");\n\n //toggle f and c\n var count = 0;\n $('.scale-change').on('click', function(ev) {\n count++;\n if (count % 2 !== 0) {\n $('.temperature').html(tempC);\n } else {\n $('.temperature').html(tempF);\n }\n });\n }\n })\n }", "title": "" }, { "docid": "9ba34f1b10d6f80773204ab2129e1c91", "score": "0.6542349", "text": "function forCast(){\n var forcastByCityName = \"https://api.openweathermap.org/data/2.5/forecast?q=\"+city+\",\"+stateCode+\",us&units=imperial&appid=a4f1da209176afa0326f9cbeeaa0df17\"\n\n$.ajax({\n url: forcastByCityName,\n method:\"GET\"\n }).then(function(response){\n \n//function to collect date from ajax call\n function displayForcast(i){\n date = response.list[i].dt_txt;\n date = date.substring(0,10);\n temp = response.list[i].main.temp;\n humidity =response.list[i].main.humidity;\n weather = response.list[i].weather[0].main;\n\n //Logic for adding icons\n if(weather.toString() === \"Clouds\"){\n //console.log(\"itClouds\");\n weather = cloud;\n }\n else if(weather.toString() === \"Clear\"){\n // console.log(\"itclear\");\n weather = sun;\n }\n else if(weather.toString() === \"Rain\"){\n //console.log(\"itRain\");\n weather = rain;\n }\n else if(weather.toString() === \"Snow\"){\n weather = snow;\n }\n\n //console.log(weather);\n //console.log(response);\n // console.log(date);\n //console.log(temp);\n // console.log(humidity);\n\n\n \n }\n\n//Still needs refactoring/ call the nessnecessary info then populate the appropriate places\n displayForcast(0);\n\n $(\"#firstDay\").append(\"<h4 id='date1'></h4>\");\n $(\"#date1\").text(date);\n $(\"#firstDay\").append(\"<p id='tempForcast1'></p>\");\n $(\"#tempForcast1\").append(\"Temp: \"+temp+\" °F\");\n $(\"#firstDay\").append(\"<p id='humidForcast1'></p>\");\n $(\"#humidForcast1\").append(\"Humidity: \"+humidity+\"%\");\n $(\"#firstDay\").append(\"<img id= 'weather'></img\");\n $(\"#weather\").attr(\"src\", weather);\n\n displayForcast(8);\n\n $(\"#secondDay\").append(\"<h4 id='date2'></h4>\");\n $(\"#date2\").text(date);\n $(\"#secondDay\").append(\"<p id='tempForcast2'></p>\");\n $(\"#tempForcast2\").append(\"Temp: \"+temp+\" °F\");\n $(\"#secondDay\").append(\"<p id='humidForcast2'></p>\");\n $(\"#humidForcast2\").append(\"Humidity: \"+humidity+\"%\");\n $(\"#secondDay\").append(\"<img id= 'weather2'></p\");\n $(\"#weather2\").attr(\"src\", weather);\n \n displayForcast(17);\n\n $(\"#thirdDay\").append(\"<h4 id='date3'></h4>\");\n $(\"#date3\").text(date);\n $(\"#thirdDay\").append(\"<p id='tempForcast3'></p>\");\n $(\"#tempForcast3\").append(\"Temp: \"+temp+\" °F\");\n $(\"#thirdDay\").append(\"<p id='humidForcast3'></p>\");\n $(\"#humidForcast3\").append(\"Humidity: \"+humidity+\"%\");\n $(\"#thirdDay\").append(\"<img id= 'weather3'></p\");\n $(\"#weather3\").attr(\"src\", weather);\n\n displayForcast(26);\n\n $(\"#fourthDay\").append(\"<h4 id='date4'></h4>\");\n $(\"#date4\").text(date);\n $(\"#fourthDay\").append(\"<p id='tempForcast4'></p>\");\n $(\"#tempForcast4\").append(\"Temp: \"+temp+\" °F\");\n $(\"#fourthDay\").append(\"<p id='humidForcast4'></p>\");\n $(\"#humidForcast4\").append(\"Humidity: \"+humidity+\"%\");\n $(\"#fourthDay\").append(\"<img id= 'weather4'></p\");\n $(\"#weather4\").attr(\"src\", weather);\n\n displayForcast(35);\n\n $(\"#fithDay\").append(\"<h4 id='date5'></h4>\");\n $(\"#date5\").text(date);\n $(\"#fithDay\").append(\"<p id='tempForcast5'></p>\");\n $(\"#tempForcast5\").append(\"Temp: \"+temp+\" °F\");\n $(\"#fithDay\").append(\"<p id='humidForcast5'></p>\");\n $(\"#humidForcast5\").append(\"Humidity: \"+humidity+\"%\");\n $(\"#fithDay\").append(\"<img id= 'weather5'></p\");\n $(\"#weather5\").attr(\"src\", weather);\n \n //console.log(response);\n // console.log(date);\n // console.log(temp);\n // console.log(humidity);\n })\n\n\n\n\n\n\n}", "title": "" }, { "docid": "4a360cfc120c82625f4c946f80f62b2d", "score": "0.65411764", "text": "function getWeather(lat, lon) {\n var api_call = \"https://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/71c3cf1a1b7f6003b89a311cd64c8c9d/\"\n + lat + \",\" + lon + \"?units=si\";\n\n // parse JSON from API call\n $.getJSON(api_call, function(data) {\n\n // current temperature\n $('#temp').html(Math.round(data.currently.temperature));\n\n // weather icon for current weather\n var image = '<img src = /weather/images/' + data.currently.icon + '.svg>';\n $(\"#icon\").html(image);\n \n // weather summary\n $('#summary').html(data.hourly.summary);\n \n // loop for hourly updates\n for(var i = 1; i < 25; i++) {\n\n // hour of each update\n var unix_timestamp = data.hourly.data[i].time;\n var hour_date = new Date(unix_timestamp * 1000);\n var time_hourly = hour_date.getHours();\n\n // icon for each hourly update\n var icon_hourly = '<img src = /weather/images/' + data.hourly.data[i].icon + '.svg>';\n\n // temp for each hourly update\n var temp_hourly = Math.round(data.hourly.data[i].temperature) + \"&#176\";\n\n // append to scrollmenu\n $('#hourly').append(\n '<ul style=\"list-style-type:none\">' +\n '<li>' + time_hourly + ':00</li>' +\n '<li>' + icon_hourly + '</li>' +\n '<li>' + temp_hourly + '</li>' +\n '</ul>'\n );\n\n }\n });\n }", "title": "" }, { "docid": "de5d2fea3676912cf5a11cc415212c69", "score": "0.6538714", "text": "function ShowForecast(response) {\n let forecastElement = document.querySelector(\"#forecast\");\n forecastElement.innerHTML = null;\n let forecast = null;\n for (let index = 0; index <= 4; index++) {\n forecast = response.data.list[index];\n forecastElement.innerHTML += `\n <div class=\"col-2\">\n <div class=\"D1-card\">\n <div class=\"D-body\">\n <strong>\n ${formatDateDay(forecast.dt * 1000)} <br>\n ${FormatHours(forecast.dt * 1000)}\n </strong>\n <br /> \n <span class=\"forecast-temp\">\n ${Math.round(forecast.main.temp)}\n </span>° <br />\n ${response.data.list[0].weather[0].description} <br />\n <img\n src=\"http://openweathermap.org/img/wn/${forecast.weather[0].icon}@2x.png\"\n <br />\n <br/>\n H: <strong> <span class=\"forecast-high\">${Math.round(\n forecast.main.temp_max\n )}</span>°</strong> \n L: <span class=\"forecast-low\">${Math.round(\n forecast.main.temp_min\n )}</span>°\n </div>\n </div>`;\n }\n}", "title": "" }, { "docid": "fca8c293b80b0e7345096a6927ed67e0", "score": "0.65379786", "text": "function weather(city) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=\" + APIKey;\n APIKey;\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n\n fiveDayWeather(city);\n\n //Allows data like the current date, city name, temperature, and wind speed to display//\n var a = new Date(response.dt * 1000).toLocaleDateString();\n console.log(a);\n $(\"#city-name-date\").text(response.name + \" \" + d);\n $(\".humidity\").text(\"Humidity: \" + response.main.humidity);\n $(\".wind\").text(\"Wind Speed: \" + response.wind.speed);\n\n\n //Converts temperature from Kelvin to Farenheit//\n var tempF = (response.main.temp - 273.15) * 1.80 + 32;\n\n $(\".temperature\").text(\"Temperature (F) \" + tempF.toFixed(2));\n });\n}", "title": "" }, { "docid": "72079376a7c76e062a4a68c6c68b42e5", "score": "0.6537838", "text": "function weatherInfo() {\n\n /// API key for weather\n var APIKey = \"999df4c3925000e8f0fcd5765a05caf2\";\n // Here we are building the URL we need to query the database\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?lat=\" + searchLat + \"&lon=\" + searchLong + \"&units=imperial&appid=\" + APIKey;\n console.log(\"Query url is: \" + queryURL);\n // Here we run our AJAX call to the OpenWeatherMap API and store all of the retrieved data inside of an object called \"response\"\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n\n // Log the queryURL\n console.log(queryURL);\n\n // Log the resulting object\n console.log(response);\n\n // Transfer content to HTML\n $(\".city\").html(\"<strong>\" + response.name + \" Weather Details:</strong>\");\n $(\".temp\").text(\"Current Temperature(F): \" + response.main.temp + \"\\xB0\");\n $(\".desc\").text(\"Weather Descritption: \" + response.weather[0].description);\n $(\".humidity\").text(\"Humidity: \" + response.main.humidity + \"\\xB0\");\n $(\".wind\").text(\"Wind Speed: \" + response.wind.speed + \" m/s \");\n $(\".max\").text(\"Maximum Temperature(F): \" + response.main.temp_max + \"\\xB0\");\n $(\".min\").text(\"Minimum Temperature(F): \" + response.main.temp_min + \"\\xB0\");\n\n // Log the data in the console as well\n // console.log(\"Wind Speed: \" + response.wind.speed);\n // console.log(\"Humidity: \" + response.main.humidity);\n // console.log(\"Current Temperature (F): \" + response.main.temp);\n // console.log(\"Weather Descritption: \" + response.weather[0].description);\n // console.log(\"Max: \" + response.main.temp_max + \"\\xB0\");\n // console.log(\"Min: \" + response.main.temp_min + \"\\xB0\");\n });\n}", "title": "" }, { "docid": "69003136f9b3b40601aa93831c79d5b4", "score": "0.65344477", "text": "function showWeatherReport(weather){\n console.log(weather);\n\n let city = document.getElementById('city');\n city.innerText = `${weather.name}, ${weather.sys.country}`;\n\n let tempreature = document.getElementById('temp');\n tempreature.innerHTML = `${Math.round(weather.main.temp)}&deg;C`;\n\n let weatherType = document.getElementById('weather');\n weatherType.innerText = `${weather.weather[0].main}`\n\n let date = document.getElementById('date');\n let todayDate = new Date();\n date.innerText = dateManage(todayDate);\n}", "title": "" }, { "docid": "12f69887f901f408c23992844bab6908", "score": "0.65328807", "text": "function weatherDisplay(city) {\n\n // URL link to desired data\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=\" + apiKey + \"&units=imperial\";\n // Performing ajax call for single day weather data \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n\n var tempF = (response.main.temp);\n var todayDate = moment().format(\"MM/DD/YYYY\");\n var weatherIcon = (response.weather[0].icon);\n var weatherURL = \"https://openweathermap.org/img/wn/\" + weatherIcon + \"@2x.png\";\n\n // Draws APi Data to weather div container\n $(\"#city\").html(\"<h3>\" + response.name + \" \" + todayDate + \"</h3>\");\n $(\"#weatherPicture\").attr(\"src\", weatherURL);\n $(\"#resultTemp\").text(\"Temperature: \" + tempF.toFixed(2) + \" °F\");\n $(\"#resultHum\").text(\"Humidity: \" + response.main.humidity + \"%\");\n $(\"#resultWind\").text(\"Wind Speed: \" + response.wind.speed + \" MPH\");\n retrieveUV(response.coord.lat, response.coord.lon);\n })}", "title": "" }, { "docid": "8c6399599d1923f1602e09ae2bf5e22c", "score": "0.6529113", "text": "function search(event) {\n event.preventDefault();\n let searchInput = document.querySelector(\"#search-text-input\");\n let h1 = document.querySelector(\"h1\");\n if (searchInput.value) {\n h1.innerHTML = `${searchInput.value}`\n } else {\n h1.innerHTML = null;\n alert(\"Please type a city\");\n }\n\n let apiKey = \"ae06093a9e8520231dc7244ee42ea23d\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${searchInput.value}&appid=${apiKey}&&units=metric`;\n\n function showTemperature(response) {\n let temperature = Math.round(response.data.main.temp);\n let pressure = Math.round(response.data.main.pressure);\n let humidity = Math.round(response.data.main.humidity);\n let wind = Math.round(response.data.wind.speed);\n let icon = response.data.weather[0].icon;\n let description = response.data.weather[0].description;\n\n let h2 = document.querySelector(\"#temperature\");\n h2.innerHTML = temperature; \n h6 = document.querySelector(\"#description\");\n h6.innerHTML = description;\n let hum = document.querySelector(\"#humidity\");\n hum.innerHTML = `${humidity} %`;\n let windSpeed = document.querySelector(\"#wind\");\n windSpeed.innerHTML = `${wind} km/h`;\n let press = document.querySelector(\"#pressure\");\n press.innerHTML = `${pressure} Pa`;\n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\"src\",`http://openweathermap.org/img/wn/${icon}@2x.png`);\n iconElement.setAttribute(\"alt\", description);\n }\n\n function displayForecast(response) {\n\n function formatHours(timestamp) {\n date = new Date(timestamp);\n hours = date.getHours();\n if (hours < 10) {\n hours = `0${hours}`;\n }\n minutes = date.getMinutes();\n if (minutes <10) {\n minutes = `0${minutes}`;\n }\n return `${hours}:${minutes}`;\n }\n\n let forecast = null;\n for (let index = 0; index < 6; index++) {\n \n forecast = response.data.list[0];\n let forecastElement = document.querySelector(\"#forecast\");\n forecastElement.innerHTML =\n `<div class=\"row\">\n <div class=\"col-6\">\n ${formatHours(forecast.dt * 1000)}\n </div>\n <div class=\"col-6\" class=\"data\">\n <p>\n <strong>${Math.round(forecast.main.temp_max)}°</strong> \n | ${Math.round(forecast.main.temp_min)}°\n </p>\n </div>\n </div>`;\n\n forecast = response.data.list[1];\n forecastElement = document.querySelector(\"#forecast2\");\n forecastElement.innerHTML =\n `<div class=\"row\">\n <div class=\"col-6\">\n ${formatHours(forecast.dt * 1000)}\n </div>\n <div class=\"col-6\" class=\"data\">\n <p>\n <strong>${Math.round(forecast.main.temp_max)}°</strong> \n | ${Math.round(forecast.main.temp_min)}°\n </p>\n </div>\n </div>`;\n\n forecast = response.data.list[2];\n forecastElement = document.querySelector(\"#forecast3\");\n forecastElement.innerHTML =\n `<div class=\"row\">\n <div class=\"col-6\">\n ${formatHours(forecast.dt * 1000)}\n </div>\n <div class=\"col-6\" class=\"data\">\n <p>\n <strong>${Math.round(forecast.main.temp_max)}°</strong> \n | ${Math.round(forecast.main.temp_min)}°\n </p>\n </div>\n </div>`;\n\n forecast = response.data.list[3];\n forecastElement = document.querySelector(\"#forecast4\");\n forecastElement.innerHTML =\n `<div class=\"row\">\n <div class=\"col-6\">\n ${formatHours(forecast.dt * 1000)}\n </div>\n <div class=\"col-6\" class=\"data\">\n <p>\n <strong>${Math.round(forecast.main.temp_max)}°</strong> \n | ${Math.round(forecast.main.temp_min)}°\n </p>\n </div>\n </div>`;\n\n forecast = response.data.list[4];\n forecastElement = document.querySelector(\"#forecast5\");\n forecastElement.innerHTML =\n `<div class=\"row\">\n <div class=\"col-6\">\n ${formatHours(forecast.dt * 1000)}\n </div>\n <div class=\"col-6\" class=\"data\">\n <p>\n <strong>${Math.round(forecast.main.temp_max)}°</strong> \n | ${Math.round(forecast.main.temp_min)}°\n </p>\n </div>\n </div>`;\n }\n }\n\n let forecastApiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${searchInput.value}&appid=${apiKey}&&units=metric`;\n\n axios.get(apiUrl).then(showTemperature);\n axios.get(forecastApiUrl).then(displayForecast);\n}", "title": "" }, { "docid": "64ba5c49576c03d77b07ce99433c27a3", "score": "0.6525104", "text": "function apiCall(){\n \n $(\"#current-weather-display\").empty();\n if ($(\"input\").val()==\"\"){\n city = cityClicked\n }else{\n city = $(\"input\").val(); \n }\n\n var apiKey = \"bb06c0b8789f5256fcbbe492b33425e3\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=\" + apiKey + \"&units=imperial\";\n // ajax call to get current weather condition\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response){\n \n var lat = response.coord.lat\n var lon = response.coord.lon\n\n var temperature = response.main.temp;\n var humidity = response.main.humidity;\n var windSpeed= response.wind.speed;\n var imageIcon = response.weather[0].icon\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; \n var yyyy = today.getFullYear();\n var currentDate = (mm + \"/\" + dd + \"/\" + yyyy)\n\n // display current date\n h2El=$(\"<h2>\")\n h2El.text(city + \" (\" + currentDate + \")\")\n $(\"#current-weather-display\").append(h2El);\n\n // display weather icon\n imageEl=$(\"<img>\")\n imageEl.attr(\"src\", \"http://openweathermap.org/img/wn/\" + imageIcon + \"@2x.png\")\n imageEl.attr(\"class\", \"weather-icon\")\n $(\"#current-weather-display\").append(imageEl)\n\n // display current temperature\n pEl1=$(\"<p>\")\n pEl1.text(\"Temperature: \" + temperature)\n $(\"#current-weather-display\").append(pEl1)\n\n // display current humidity\n pEl2=$(\"<p>\")\n pEl2.text(\"Humidity: \" + humidity)\n $(\"#current-weather-display\").append(pEl2)\n\n // display current wind speed\n pEl3=$(\"<p>\")\n pEl3.text(\"Wind Speed: \" + windSpeed)\n $(\"#current-weather-display\").append(pEl3)\n\n // horizontal line\n hrEl = $(\"<hr>\")\n $(\"#current-weather-display\").append(hrEl)\n\n\n var queryURL = \"https://api.openweathermap.org/data/2.5/uvi?lat=\" + lat + \"&lon=\" + lon + \"&appid=bb06c0b8789f5256fcbbe492b33425e3\"\n // AJAX call to UV index API\n $.ajax({\n\n url:queryURL,\n method: \"GET\"\n }).then(function(response){\n // display UV index\n uvIndex=response.value\n pEluv=$(\"<p>\")\n pEluv.text(\"UV Index: \" + uvIndex)\n pEluv.attr(\"class\", \"uvindex\")\n $(pEl3).append(pEluv)\n // styling of UV index based on current index\n if(uvIndex<5){\n $(\".uvindex\").css(\"background-color\", \"green\");\n }else if(uvIndex>5 && uvIndex<7){\n $(\".uvindex\").css(\"background-color\", \"yellow\");\n }else{\n $(\".uvindex\").css(\"background-color\", \"red\");\n}\n});\n});\n\n\n var apiKey = \"bb06c0b8789f5256fcbbe492b33425e3\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&appid=\" + apiKey + \"&units=imperial\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response){\n console.log(queryURL)\n console.log (response)\n\n // get future date\n // today+1\n var today = new Date();\n var date1=new Date(today.setDate(today.getDate()+1))\n var dd1 = date1.getDate();\n var mm1 = date1.getMonth()+1\n\n // today+2\n var today = new Date();\n var date2=new Date(today.setDate(today.getDate()+2))\n console.log(date2)\n var dd2 = date2.getDate();\n var mm2 = date2.getMonth()+1\n \n // today+3\n var today = new Date();\n var date3=new Date(today.setDate(today.getDate()+3))\n var dd3= date3.getDate();\n var mm3 = date3.getMonth()+1\n \n // today+4\n var today = new Date();\n var date4=new Date(today.setDate(today.getDate()+4))\n var dd4 = date4.getDate();\n var mm4 = date4.getMonth()+1\n \n //today+5\n var today = new Date();\n var date5=new Date(today.setDate(today.getDate()+5))\n var dd5 = date5.getDate();\n var mm5 = date5.getMonth()+1\n\n var yyyy = today.getFullYear();\n var day1= (mm1 + \"/\" + dd1 + \"/\" + yyyy)\n var day2= (mm2 + \"/\" + dd2 + \"/\" + yyyy)\n var day3= (mm3 + \"/\" + dd3 + \"/\" + yyyy)\n var day4= (mm4 + \"/\" + dd4 + \"/\" + yyyy)\n var day5= (mm5 + \"/\" + dd5 + \"/\" + yyyy)\n\n // display 5 day forecast header\n var h3El=$(\"<h3>\")\n h3El.text(\"5-Day Forecast\")\n $(\"#current-weather-display\").append(h3El);\n\n // display date, weather icon, temperature, and humidity for 5 day forecast\n var divEl1=$(\"<div>\")\n divEl1.attr(\"class\", \"day1\")\n $(\"#current-weather-display\").append(divEl1);\n pEldate1=$(\"<p>\")\n pEldate1.text(day1)\n $(divEl1).append(pEldate1);\n var imageEl1 =$(\"<img>\")\n imageEl1.attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.list[4].weather[0].icon + \"@2x.png\")\n imageEl1.attr(\"class\", \"future-weather-icon\")\n $(divEl1).append(imageEl1)\n var pEltemp1 =$(\"<p>\")\n pEltemp1.text(\"Temp: \" + response.list[4].main.temp)\n $(divEl1).append(pEltemp1)\n var pElhum1 =$(\"<p>\")\n pElhum1.text(\"Humidity: \" + response.list[4].main.humidity)\n $(divEl1).append(pElhum1)\n\n var divEl2=$(\"<div>\")\n divEl2.attr(\"class\", \"day2\")\n $(\"#current-weather-display\").append(divEl2);\n pEldate2=$(\"<p>\")\n pEldate2.text(day2)\n $(divEl2).append(pEldate2);\n var imageEl2 =$(\"<img>\")\n imageEl2.attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.list[12].weather[0].icon + \"@2x.png\")\n imageEl2.attr(\"class\", \"future-weather-icon\")\n $(divEl2).append(imageEl2)\n var pEltemp2 =$(\"<p>\")\n pEltemp2.text(\"Temp: \" + response.list[12].main.temp)\n $(divEl2).append(pEltemp2)\n var pElhum2 =$(\"<p>\")\n pElhum2.text(\"Humidity: \" + response.list[12].main.humidity)\n $(divEl2).append(pElhum2)\n\n var divEl3=$(\"<div>\")\n divEl3.attr(\"class\", \"day3\")\n $(\"#current-weather-display\").append(divEl3);\n pEldate3=$(\"<p>\")\n pEldate3.text(day3)\n $(divEl3).append(pEldate3);\n var imageEl3 =$(\"<img>\")\n imageEl3.attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.list[20].weather[0].icon + \"@2x.png\")\n imageEl3.attr(\"class\", \"future-weather-icon\")\n $(divEl3).append(imageEl3)\n var pEltemp3 =$(\"<p>\")\n pEltemp3.text(\"Temp: \" + response.list[20].main.temp)\n $(divEl3).append(pEltemp3)\n var pElhum3 =$(\"<p>\")\n pElhum3.text(\"Humidity: \" + response.list[20].main.humidity)\n $(divEl3).append(pElhum3)\n\n var divEl4=$(\"<div>\")\n divEl4.attr(\"class\", \"day4\")\n $(\"#current-weather-display\").append(divEl4);\n pEldate4=$(\"<p>\")\n pEldate4.text(day4)\n $(divEl4).append(pEldate4);\n var imageEl4 =$(\"<img>\")\n imageEl4.attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.list[28].weather[0].icon + \"@2x.png\")\n imageEl4.attr(\"class\", \"future-weather-icon\")\n $(divEl4).append(imageEl4)\n var pEltemp4 =$(\"<p>\")\n pEltemp4.text(\"Temp: \" + response.list[28].main.temp)\n $(divEl4).append(pEltemp4)\n var pElhum4 =$(\"<p>\")\n pElhum4.text(\"Humidity: \" + response.list[28].main.humidity)\n $(divEl4).append(pElhum4)\n\n var divEl5=$(\"<div>\")\n divEl5.attr(\"class\", \"day5\")\n $(\"#current-weather-display\").append(divEl5);\n pEldate5=$(\"<p>\")\n pEldate5.text(day5)\n $(divEl5).append(pEldate5);\n var imageEl5 =$(\"<img>\")\n imageEl5.attr(\"src\", \"http://openweathermap.org/img/wn/\" + response.list[36].weather[0].icon + \"@2x.png\")\n imageEl5.attr(\"class\", \"future-weather-icon\")\n $(divEl5).append(imageEl5)\n var pEltemp5 =$(\"<p>\")\n pEltemp5.text(\"Temp: \" + response.list[36].main.temp)\n $(divEl5).append(pEltemp5)\n var pElhum5 =$(\"<p>\")\n pElhum5.text(\"Humidity: \" + response.list[36].main.humidity)\n $(divEl5).append(pElhum5)\n $(\".city-input\").val(\"\");\n});\n\n}", "title": "" } ]
72f69c5e444fe99cec5cf63cf3836c49
Whether selection is limited to one or multiple items (default multiple).
[ { "docid": "9e77ec49483227d71f7b746ce702f7f9", "score": "0.62664866", "text": "get multiple() { return this._multiple; }", "title": "" } ]
[ { "docid": "1f935673a06e8515d5277f2f1ea36f40", "score": "0.73653823", "text": "isMultipleSelection() {\n return this._multiple;\n }", "title": "" }, { "docid": "1f935673a06e8515d5277f2f1ea36f40", "score": "0.73653823", "text": "isMultipleSelection() {\n return this._multiple;\n }", "title": "" }, { "docid": "1f935673a06e8515d5277f2f1ea36f40", "score": "0.73653823", "text": "isMultipleSelection() {\n return this._multiple;\n }", "title": "" }, { "docid": "1f935673a06e8515d5277f2f1ea36f40", "score": "0.73653823", "text": "isMultipleSelection() {\n return this._multiple;\n }", "title": "" }, { "docid": "9c673cd817b62099749e7cd130df2006", "score": "0.6807362", "text": "function selectIsMulti(Select)\n{\n var Fn = \"[util.js selectIsMulti] \";\n \n return Select.multiple;\n}", "title": "" }, { "docid": "1f2bae40a13e633f2544d9970c0b20bb", "score": "0.6471639", "text": "numSelected() {\n // return true if 2 are selected\n if (this.selected.length >= 2) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "1e7af24b0629a18633f870d42962dbb7", "score": "0.6247647", "text": "getSelection() {\n return _.intersection(this.props.items.map(i => `${i.resource_type_id}.${i.id}`), this.state.selected);\n }", "title": "" }, { "docid": "97fc1425412fbab4506c9315fed73e25", "score": "0.6206482", "text": "isPartialSelected() {\n return (!this.isAllSelected() &&\n this._data.some((value, index) => this._selection.isSelected({ value, index })));\n }", "title": "" }, { "docid": "25c9e3fc5173c198adaae6b5a7b475e4", "score": "0.62053216", "text": "function isMultiselect($el) {\n var elSize;\n\n if ($el[0].multiple) {\n return true;\n }\n\n elSize = attrOrProp($el, \"size\");\n\n if (!elSize || elSize <= 1) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "e49705ff548539b46564efbebf600cd7", "score": "0.6176827", "text": "function multipleSelected() {\n if ($(\".chosen_major\").length > 0)\n return true;\n else return false;\n}", "title": "" }, { "docid": "105edb40c1754363d6952092ab428c4a", "score": "0.6143189", "text": "function isMultiselect($el) {\n\t\tvar elSize;\n\n\t\tif ($el[0].multiple) {\n\t\t\treturn true;\n\t\t}\n\n\t\telSize = attrOrProp($el, \"size\");\n\n\t\tif (!elSize || elSize <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.6141074", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.6141074", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.6141074", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.6141074", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "810e7ab1bc59f94a6d385335f392fc29", "score": "0.6133347", "text": "_onMultipleSelect (selection) {\n // no-op\n }", "title": "" }, { "docid": "810e7ab1bc59f94a6d385335f392fc29", "score": "0.6133347", "text": "_onMultipleSelect (selection) {\n // no-op\n }", "title": "" }, { "docid": "45b1fc6c1517e14dd9b230a387748234", "score": "0.61263007", "text": "function limitSelection(idTag, limit) {\r\n gblMultiSelectTriggerOrig = \"onChange\";\r\n var selectedOptions = $(idTag + ' option:selected');\r\n if ($(idTag + ' option').length === (selectedOptions.length + 1) ) {\r\n $(idTag).multiselect('deselectAll', false); //This will cause \"SelectAll\" trigger\r\n resetAllOptions(idTag);\r\n return;\r\n }\r\n\r\n if (selectedOptions.length >= limit) {\r\n // Disable all other checkboxes.\r\n var nonSelectedOptions = $(idTag + ' option').filter(function() {\r\n return !$(this).is(':selected');\r\n });\r\n\r\n nonSelectedOptions.each(function() {\r\n var input = $('input[value=\"' + $(this).val() + '\"]');\r\n input.prop('disabled', true);\r\n input.parent('li').addClass('disabled');\r\n });\r\n } else {\r\n // Enable all checkboxes.\r\n $(idTag + ' option').each(function() {\r\n var input = $('input[value=\"' + $(this).val() + '\"]');\r\n input.prop('disabled', false);\r\n input.parent('li').addClass('disabled');\r\n });\r\n }\r\n}", "title": "" }, { "docid": "18ff8b83a51addabb6c5ff5d3e9ceb6d", "score": "0.6098769", "text": "function getIsMultiPicklist() {\n\t\t\tif (angular.isDefined(vm.FieldType)) {\n\t\t\t\treturn vm.FieldType.toLowerCase() == 'multipicklist';\n\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "7211b48b6ff4fc5fe40f8af73235176d", "score": "0.609816", "text": "get multiple() {\n return this._multiple;\n }", "title": "" }, { "docid": "7211b48b6ff4fc5fe40f8af73235176d", "score": "0.609816", "text": "get multiple() {\n return this._multiple;\n }", "title": "" }, { "docid": "7211b48b6ff4fc5fe40f8af73235176d", "score": "0.609816", "text": "get multiple() {\n return this._multiple;\n }", "title": "" }, { "docid": "ad31c9751257f886fc1cd85a03319ca3", "score": "0.6044775", "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": "5c2ca2ea8c3d16000ed5b87039ae2fe9", "score": "0.6018883", "text": "isAllSelected() {\n const numSelected = this.selection.selected.length;\n const numRows = this.imagesList.filteredData.length;\n return numSelected === numRows;\n }", "title": "" }, { "docid": "ef86dc6c821208093f114d38c42c186c", "score": "0.5996935", "text": "checkSelectionLimit(count) {\n return (!this.selectionlimit || count < this.selectionlimit);\n }", "title": "" }, { "docid": "a147a18c30a4d836db124229fcec9993", "score": "0.5915422", "text": "function limitSelection() {\n\n var last_valid_selection = null;\n\n $('#incidentTypes').change(function(event) {\n\n if ($(this).val().length > 5) {\n\n alert(\"You may only select 5 incident types at a time.\");\n\n //Set current selectino to last valid selection\n $(this).val(last_valid_selection);\n } else {\n last_valid_selection = $(this).val();\n }\n });\n }", "title": "" }, { "docid": "92c64e84d7e3f4224c91a1dbb1d17c3b", "score": "0.5874406", "text": "get _shouldUpdateSelection() {\n return this.selected != null ||\n (this.selectedValues != null && this.selectedValues.length);\n }", "title": "" }, { "docid": "75e5331a0a082a8d4b03695464a25443", "score": "0.58612174", "text": "get selectable() { return this._selectable; }", "title": "" }, { "docid": "75e5331a0a082a8d4b03695464a25443", "score": "0.58612174", "text": "get selectable() { return this._selectable; }", "title": "" }, { "docid": "182730d44091743b8eadb5fb1e217ffb", "score": "0.58610547", "text": "function isNativeMultiSelect(el) {\n return isNativeSelect(el) && el.multiple;\n}", "title": "" }, { "docid": "200b6acb722eeefcf8e0b38841f1f46a", "score": "0.5839046", "text": "function isAtleastOneSelected(obj) {\n var len = obj.length;\n for (var i = 0; i < len; i++) {\n if (obj[i].selected === true) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "3b9949fc86e4b1b029ddfedfcc7db0fa", "score": "0.58318955", "text": "function is_multiselect(element)\n {\n return (element.is('select') && typeof element.attr('multiple') !== 'undefined' && element.attr('multiple') !== false);\n }", "title": "" }, { "docid": "8de87eeb7473ea58ecf63bb60454b31a", "score": "0.58238137", "text": "get selected() {\n const selected = this._selectionModel ? this._selectionModel.selected : [];\n return this.multiple ? selected : (selected[0] || null);\n }", "title": "" }, { "docid": "328e00233bae7ba2b320e5e932e3006d", "score": "0.5787854", "text": "allowSelection(item) {\n return !item.HasEdgeStack;\n }", "title": "" }, { "docid": "714c096ac63ff904549dc4f4a3797320", "score": "0.5776777", "text": "isAllSelected() {\n const numSelected = this.selection.selected.length;\n const numRows = this.dataSource.renderedData.length;\n return numSelected === numRows;\n }", "title": "" }, { "docid": "84f714a50395a0ed610b19cc1a88c818", "score": "0.57558894", "text": "function isSelectedDefined(selected) {\n return Array.isArray(selected) || typeof selected === 'number';\n}", "title": "" }, { "docid": "eef07db8d007e514201af85f768ca831", "score": "0.5738445", "text": "shouldSelectAll() {\n const { formData, items } = this.props;\n return (\n Object.keys(pickBy(formData.values)).length < items.length ||\n items.length === 0\n );\n }", "title": "" }, { "docid": "d9209fccedcab116a3cab328b81e1e94", "score": "0.5738326", "text": "get multiple() { return this._parent && this._parent.multiple; }", "title": "" }, { "docid": "d9209fccedcab116a3cab328b81e1e94", "score": "0.5738326", "text": "get multiple() { return this._parent && this._parent.multiple; }", "title": "" }, { "docid": "616bc7e5814caf49d0c559185c660488", "score": "0.5723453", "text": "static set imeIsSelected(value) {}", "title": "" }, { "docid": "07d2af1bd7c6ea84490a01f02b44e9b2", "score": "0.57174945", "text": "get disallowEmptySelection() {\n return this.state.disallowEmptySelection;\n }", "title": "" }, { "docid": "a6068f4b1b39b83b2ead8b75f02bb42f", "score": "0.57157874", "text": "isAllSelected() {\n const numSelected = this.selection.selected.length;\n const numRows = this.dataSource.data.length;\n return numSelected === numRows;\n }", "title": "" }, { "docid": "ba41a95d378a80167a336ff295212f50", "score": "0.56482667", "text": "get selected() { return this._selected.length ? this._selected : JSON.stringify({\"label\":\"None\", \"value\":\"no\"}); }", "title": "" }, { "docid": "f7407f4a0ca21fde56d3d64c31e19ec5", "score": "0.5647471", "text": "selectItem(item) {\n if (!this.stateless) {\n if (item instanceof HTMLElement) {\n item = this.itemFromElement(item);\n }\n if (item && this.multiple) {\n const value = this.composer.getItemPropertyValue(item, 'selected');\n this.composer.setItemPropertyValue(item, 'selected', !value);\n return true;\n }\n if (item && this.composer.getItemPropertyValue(item, 'selected') !== true) {\n this.clearSelection();\n this.composer.setItemPropertyValue(item, 'selected', true);\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "e70c276844d6a5d3d28935e963d6641e", "score": "0.56101257", "text": "function mergeable () {\n // Only 2 - 4 people may be merged at a time\n return vm.selectedCount >= 2 && vm.selectedCount <= 4;\n }", "title": "" }, { "docid": "f68a525bf3b077c8a68c7278f8d95902", "score": "0.5609086", "text": "_isInlineSelect() {\n const element = this._elementRef.nativeElement;\n return this._isNativeSelect && (element.multiple || element.size > 1);\n }", "title": "" }, { "docid": "40b396cd411e6c2eb443d0e73d949bdf", "score": "0.56017154", "text": "set Multiple(value) {}", "title": "" }, { "docid": "0ce8a54eb2952893d0a4bf4c23d8c499", "score": "0.5570868", "text": "function isAtleastOneSelected(obj) {\n for (var i = 0; i < obj.length; i++) {\n if (obj[i].isVisible === true) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "afa5113f443d2eb76d2db99a1ad9b86a", "score": "0.5568419", "text": "function check_selected() {\r\n var is_valid = true;\r\n if (countC0 === 0 || countC1 === 0 || countC2 === 0 ) {\r\n is_valid = false;\r\n alert(\r\n 'Please select at least one item from each category, or click \"None\".'\r\n );\r\n }\r\n return is_valid;\r\n}", "title": "" }, { "docid": "4a221e1649c937fcae85662b32bad528", "score": "0.5554663", "text": "static get imeIsSelected() {}", "title": "" }, { "docid": "fb49e22ae22862f852428abf3cb10b24", "score": "0.5553965", "text": "constructor({datalist = [], multiple = true, dropDownPosition = 'bottom', mode = 'collapse', name = '', maxSelections, disabled = false, value = []} = {}) {\n\n\t\tthis.callbacks = new Set;\n\t\tthis.selectedValues = new Set();\n\n\t\tthis.datalist = datalist;\n\t\tthis.multiple = multiple;\n\t\tthis.maxSelections = maxSelections;\n\t\tthis.disabled = disabled;\n\t\tthis.dropDownPosition = ['top', 'bottom'].includes(dropDownPosition) ? dropDownPosition : 'bottom';\n\t\tthis.inputName = 'multiselect-' + Math.floor(Math.random() * 10000);\n\t\tthis.name = name;\n\n\t\tthis.mode = MultiSelect.modes.some(x => x.value == mode) ? mode : MultiSelect.modes[0].value;\n\t\tthis.value = value;\n\t}", "title": "" }, { "docid": "5acb71984d00d66f04226e774356b4f6", "score": "0.55514455", "text": "valid() {\n\n return !_.isNil(this.selected) && this.selected !== '';\n\n }", "title": "" }, { "docid": "9a3546b9391f17349236d98b1a8af55c", "score": "0.5530506", "text": "get multiple() {\n return this._parent && this._parent.multiple;\n }", "title": "" }, { "docid": "d18f2207fbd792ba1a61c5d5b5a46e53", "score": "0.55283695", "text": "toggleSelection() {\n this[toggleSelectAllValue] = !this[toggleSelectAllValue];\n this[selectedItemsValue] = /** @type string[] */ ([]);\n if (this[toggleSelectAllValue]) {\n (this.requests || []).forEach((item) => {\n item.requests.forEach((requestItem) => {\n this[selectedItemsValue].push(requestItem.item._id);\n });\n });\n }\n this[notifySelection]();\n this.requestUpdate();\n }", "title": "" }, { "docid": "70729eec4dd7f67764f45ba7c069e1b6", "score": "0.5517945", "text": "function checkSelectedItems(item) {\n for (var i = 0; i < mSelectedItems.items.count; i++) {\n if (item.id == mSelectedItems.items.item(i).id) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "ddcd462748307d3b2978c639fa1475e4", "score": "0.5516034", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "bebe423397ff86c97480d99171ad5aa3", "score": "0.5515437", "text": "function select_key( list_item_to_select , number_of_items )\n\t{\n\t/* -----------------------------------------------------------\n\t*\tPDL:\t\n\t*\tCheck for special case of when there is only ONE list item\n\t*\tIF ONE list item\n\t*\t\tcheck if that item is selected\n\t*\tELSE\n\t*\t\trun through all items and see if AT LEAST ONE item is selected\n\t*\n\t*\treturn selected INSIDE if statements or else function will error and return without return selected\n\t----------------------------------------------------------- */\n\n\t/* -----------------------------------------------------------\n\t*\tThere is a problem when there is only ONE list item.\n\t*\tCheck for this special case and change syntax for this occurrence.\n\t----------------------------------------------------------- */\t\n\t\n\tif ( number_of_items == 1 )\n\t\t{\n\t\tparent.content.document.forms[ 0 ].key.checked = true;\n\t\t}\n\telse\t\n\t\t{\n\t\t/* -----------------------------------------------------------\n\t\t*\tSubtract by one because JavaScript starts index at 0\n\t\t*\twhereas Cold Fusion starts index at 1\n\t\t----------------------------------------------------------- */\t\t\n\t\tparent.content.document.forms[ 0 ].key[ list_item_to_select - 1 ].checked = true;\t\t\t\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "3fc4dd4e3d73299ce02cd953a0f5cc8f", "score": "0.5502151", "text": "function updateSelectedItems() {\n\t\t\t\t\t$scope.selectedItems = _.where($scope.allItems||[], { selected : true });\n\t\t\t\t}", "title": "" }, { "docid": "37e61435ca8f91f401c678b33094bbba", "score": "0.5481215", "text": "isAllSelected() {\n return this._data.every((value, index) => this._selection.isSelected({ value, index }));\n }", "title": "" }, { "docid": "23a2a5518c1ae4d3303511eb0637f110", "score": "0.5480988", "text": "_getAriaSelected() {\n return this.selected || (this.multiple ? false : null);\n }", "title": "" }, { "docid": "23a2a5518c1ae4d3303511eb0637f110", "score": "0.5480988", "text": "_getAriaSelected() {\n return this.selected || (this.multiple ? false : null);\n }", "title": "" }, { "docid": "233557c8e1658f65ddb1e92aaa0a5d8b", "score": "0.5454112", "text": "function isSelectionInList(opts, value) {\n return !(0, _getItemsAtRange2.default)(opts, value).isEmpty();\n}", "title": "" }, { "docid": "467b24199a4f9e46fc919d91b668b609", "score": "0.54442084", "text": "function handleOnClick(item) {\n if (!selection.some(current => current.id === item.id)) {\n if (!multiSelect) {\n setSelection([item]);\n } else if (multiSelect) {\n setSelection([...selection, item]);\n }\n } else {\n let selectionAfterRemoval = selection;\n selectionAfterRemoval = selectionAfterRemoval.filter(\n current => current.id !== item.id\n );\n setSelection([...selectionAfterRemoval]);\n }\n }", "title": "" }, { "docid": "392d5c703ad177aeb330b58b4ab523ec", "score": "0.5435915", "text": "checkSelections() {\n this.hasSelected = _.some(this.notes, 'selected');\n }", "title": "" }, { "docid": "93fc7eecc437f13119897497061f97fd", "score": "0.54269564", "text": "function countSelected() {\n return figma.currentPage.selection.length;\n}", "title": "" }, { "docid": "c519991e0bfef817c69a6b03bd257e62", "score": "0.54244596", "text": "get selectionRequired() {\n return this._selectionRequired;\n }", "title": "" }, { "docid": "15275a4e5b2d9c21c420d8e5e71aad7c", "score": "0.5420738", "text": "function onSelectableChange(e) {\n var dataItems = gridWidget.dataItems(),\n items = gridWidget.items(),\n selectedItems = gridWidget.select();\n\n if(!gridWidget.selectEvent.ctrlKey && !gridWidget.selectEvent.shiftKey) {\n if (selectedItems.length === 1) {\n // Do not attempt to disable if active is not a gridcell\n if (gridWidget.current().attr('role') === 'gridcell') {\n var selectedDataItem = gridWidget.dataItem(selectedItems);\n // disable selection if currently selected\n if (!_.isUndefined(selectedDataItem.selected) && selectedDataItem.selected) {\n selectedItems.removeClass('k-state-selected');\n selectedDataItem.selected = false;\n }\n }\n }\n }\n if(!gridWidget.selectEvent.ctrlKey && gridWidget.options.selectable === 'multiple, row') {\n var persistentSelectedIds = _.chain(dataItems)\n .where({selected: true})\n .pluck('uid')\n .value();\n // Filter Selected Rows from persistent selection list\n selectedItems.each(function() {\n var dataItem = gridWidget.dataItem(this),\n selectedIndex = _.indexOf(persistentSelectedIds, dataItem.uid);\n //dataItem.selected = true; //selectedIndex !== -1;\n if (selectedIndex !== -1) {\n persistentSelectedIds.splice(selectedIndex, 1);\n }\n })\n\n // Create collection from remaining persistent selections\n var persistentItems = $([]);\n items.each(function () {\n if (persistentSelectedIds.length === 0) {\n return false;\n }\n var itemId = this.getAttribute('data-uid'),\n selectedIndex = _.indexOf(persistentSelectedIds, itemId);\n //dataItem.selected = selectedIndex !== -1;\n if (selectedIndex !== -1) {\n persistentItems.push(this);\n persistentSelectedIds.splice(selectedIndex, 1);\n }\n });\n persistentItems.addClass('k-state-selected');\n }\n }", "title": "" }, { "docid": "f242d3ec64808d3edb2000250055ab8d", "score": "0.54148865", "text": "function ensure_selection() {\n \n}", "title": "" }, { "docid": "017e84e2266b4539a437ac1fff302ea5", "score": "0.54097754", "text": "function shouldSelect() {\n var selected = [];\n var unselected = [];\n\n selectableList.forEach(function(item) {\n if (hasCollision(point, item)) {\n\n if (hasSelected(item)) {\n return;\n }\n\n selected.push(item);\n } else {\n unselected.push(item)\n }\n item = null;\n });\n\n function resetList(list) {\n list.length = 0;\n list = null;\n }\n\n // Split into two loops because the browser uses up a lot more resources processing\n // these when nested\n window.requestAnimationFrame(function() {\n function addClassToItem(item) {\n item.className = item.className + ' ' + SELECTED_CLASS;\n }\n\n selected.forEach(addClassToItem);\n resetList(selected);\n });\n\n window.requestAnimationFrame(function() {\n function removeClassFromItem(item) {\n item.className = item.className.replace(' ' + SELECTED_CLASS, '');\n }\n\n unselected.forEach(removeClassFromItem);\n resetList(unselected);\n });\n}", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.54064125", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.54064125", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "de28e52037e872fa7b15628d12f036a3", "score": "0.5400346", "text": "function multiselect() { return { \n\theader: '<li class=\"other\"><a class=\"ui-multiselect-all\" href=\"#\"><span>+ Check all</span></a></li><li class=\"other\"><a class=\"ui-multiselect-none\" href=\"#\"><span>- Uncheck all</span></a></li>',\n\tselectedList: 1, \n\tposition: {my: 'left top', at: 'left bottom', collision: 'none none' },\n\tminWidth: 'auto',\n\theight: 'auto',\n\tautoOpen: true\n}}", "title": "" }, { "docid": "03c569f7de8d80dda4ba3c84c1a16815", "score": "0.53983974", "text": "function sel_individual (d,i)\n{\n // check if point is visible\n if (filtered_selection[i] == 1.0) {\n\n // check for subset exclusion\n if (selections.sel_type() == -1) {\n\n exclude_individual(i);\n\n // check for zoom mode\n } else if (selections.sel_type() == 0) {\n\n // potentially change focus\n selections.change_focus(i);\n\n // in selection mode\n } else {\n\n // update focus and/or selection\n selections.update_sel_focus(i);\n }\n }\n}", "title": "" }, { "docid": "4275261438f0cd2ae920f7b1b75d2247", "score": "0.539749", "text": "_onTabMultiSelect() {\n for (let item of this.rows)\n !!item.tab.multiselected\n ? item.setAttribute(\"multiselected\", true)\n : item.removeAttribute(\"multiselected\");\n }", "title": "" }, { "docid": "bc0f195a660e98ca069435667fb68c68", "score": "0.5385849", "text": "get Multiple() {}", "title": "" }, { "docid": "d02d32ba44870822ad5893af839d7fef", "score": "0.53776634", "text": "select(selection) {\n let list;\n let filter = this._getSelectionFilter(selection);\n if (filter) {\n list = this.dataSet.filter(filter, this);\n } else {\n list = [];\n }\n return this.setItems(list);\n }", "title": "" }, { "docid": "6afa5c27d7f95c8f80557677d10a4a2c", "score": "0.53775716", "text": "selectAll() {\n if (this.selectionMode === \"multiple\") this.state.setSelectedKeys(\"all\");\n }", "title": "" }, { "docid": "9be6ab8b537e74976d39ad5dbee3c7c9", "score": "0.53744704", "text": "function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}", "title": "" }, { "docid": "9be6ab8b537e74976d39ad5dbee3c7c9", "score": "0.53744704", "text": "function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}", "title": "" }, { "docid": "9be6ab8b537e74976d39ad5dbee3c7c9", "score": "0.53744704", "text": "function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}", "title": "" }, { "docid": "9be6ab8b537e74976d39ad5dbee3c7c9", "score": "0.53744704", "text": "function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}", "title": "" }, { "docid": "aa2f56706ae437d8f589e79ea8ef313d", "score": "0.53665394", "text": "disableCheckbox(item) {\n if (!this.numSelected || this.selected.includes(item)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5001854e4bac4874b4febd96dcb95fdf", "score": "0.5344872", "text": "function Selection() {\n var options = []; // Otherwise, arguments require options with `getKey`.\n for (var _i = 0 // Otherwise, arguments require options with `getKey`.\n ; _i < arguments.length // Otherwise, arguments require options with `getKey`.\n ; _i++ // Otherwise, arguments require options with `getKey`.\n ) {\n options[_i] = arguments[_i]; // Otherwise, arguments require options with `getKey`.\n }\n var _a = options[0] || {}, onSelectionChanged = _a.onSelectionChanged, getKey = _a.getKey, _b = _a.canSelectItem, canSelectItem = _b === void 0 ? function () { return true; } : _b, items = _a.items, _c = _a.selectionMode, selectionMode = _c === void 0 ? _Selection_types__WEBPACK_IMPORTED_MODULE_0__[\"SelectionMode\"].multiple : _c;\n this.mode = selectionMode;\n this._getKey = getKey || defaultGetKey;\n this._changeEventSuppressionCount = 0;\n this._exemptedCount = 0;\n this._anchoredIndex = 0;\n this._unselectableCount = 0;\n this._onSelectionChanged = onSelectionChanged;\n this._canSelectItem = canSelectItem;\n this._isModal = false;\n this.setItems(items || [], true);\n this.count = this.getSelectedCount();\n }", "title": "" }, { "docid": "5001854e4bac4874b4febd96dcb95fdf", "score": "0.5344872", "text": "function Selection() {\n var options = []; // Otherwise, arguments require options with `getKey`.\n for (var _i = 0 // Otherwise, arguments require options with `getKey`.\n ; _i < arguments.length // Otherwise, arguments require options with `getKey`.\n ; _i++ // Otherwise, arguments require options with `getKey`.\n ) {\n options[_i] = arguments[_i]; // Otherwise, arguments require options with `getKey`.\n }\n var _a = options[0] || {}, onSelectionChanged = _a.onSelectionChanged, getKey = _a.getKey, _b = _a.canSelectItem, canSelectItem = _b === void 0 ? function () { return true; } : _b, items = _a.items, _c = _a.selectionMode, selectionMode = _c === void 0 ? _Selection_types__WEBPACK_IMPORTED_MODULE_0__[\"SelectionMode\"].multiple : _c;\n this.mode = selectionMode;\n this._getKey = getKey || defaultGetKey;\n this._changeEventSuppressionCount = 0;\n this._exemptedCount = 0;\n this._anchoredIndex = 0;\n this._unselectableCount = 0;\n this._onSelectionChanged = onSelectionChanged;\n this._canSelectItem = canSelectItem;\n this._isModal = false;\n this.setItems(items || [], true);\n this.count = this.getSelectedCount();\n }", "title": "" }, { "docid": "54a5561a35f29c17eb52f6fb12a3dee2", "score": "0.5342817", "text": "function hasOneSelectedValue( f, field_name )\r\n{\r\n for (var i = 0; i < f.elements.length; i++) {\r\n if (f.elements[i].name == field_name) {\r\n var multi = f.elements[i];\r\n for (var y = 0; y < multi.options.length; y++) {\r\n if (multi.options[y].selected && multi.options[y].value!=\"\") {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "28816f9b5152be9de7cc148d8eb4b664", "score": "0.534194", "text": "function isAllSelected(obj) {\n var len = obj.length;\n for (var i = 0; i < len; i++) {\n if (!obj[i].selected) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "909b6e6292bf2e20318242c026e9296e", "score": "0.5334197", "text": "function validateMultItemsChoice(choice, itemList) {\n\t// Check for legal input\n\tif (choice) {\n\t\t// Regex patterns to check if the user entered valid input.\n\t\tconst individuals = /^[0-9]+(,[0-9]+)*$/;\n\t\tconst range = /^[0-9]+-[0-9]+$/\n\t\tconst all = \"ALL\";\n\n\t\tif (individuals.test(choice)) {\n\n\t\t\tlet ilegalIndices = choice.split(\",\").filter(\n\t\t\t\tindex => parseInt(index) < 1 || parseInt(index) > itemList.length\n\t\t\t);\n\t\t\tif (ilegalIndices.length > 0) {\n\t\t\t\tprintToLog(\"Numbers are not in range. Please enter numbers from the specified list.\");\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\treturn CHOICE.INDIVIDUALS;\n\t\t}\n\t\telse if (range.test(choice)) {\n\t\t\tlet [start, end] = choice.split(\"-\");\n\n\t\t\t// Check for ilegal range\n\t\t\tif (parseInt(start) >= parseInt(end) || \n\t\t\t\tparseInt(start) < 1 || \n\t\t\t\tparseInt(end) > itemList.length\n\t\t\t) {\n\t\t\t\tprintToLog(\"The range you've entered is invalid. \" +\n\t\t\t\t\t\"Please select numbers from the list and try again.\");\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\treturn CHOICE.RANGE;\n\t\t}\n\t\telse if (choice === all) {\n\t\t\treturn CHOICE.ALL;\n\t\t}\n\t\t// No match -> ilegal input\n\t\telse {\n\t\t\tprintToLog(\"Illegal choice. Please follow the instructions and try again.\");\n\t\t\treturn \"\";\n\t\t}\n\n\t}\n\t// Player aborted the choice prompt process.\n\telse {\n\t\tprintToLog(\"You chose nothing.\");\n\t\treturn \"\";\n\t}\n}", "title": "" }, { "docid": "e389548ec68e809e178aa3de8ee9a471", "score": "0.53296566", "text": "function isKeySelected( list_item_selected ) \n\t{\n\tvar selected = false;\n\t\n\t/* -----------------------------------------------------------\n\t*\tPDL:\t\n\t*\tCheck for special case of when there is only ONE list item\n\t*\tIF ONE list item\n\t*\t\tcheck if that item is selected\n\t*\tELSE\n\t*\t\trun through all items and see if AT LEAST ONE item is selected\n\t*\n\t*\treturn selected INSIDE if statements or else function will error and return without return selected\n\t----------------------------------------------------------- */\n\t\t\t\n\t/* -----------------------------------------------------------\n\t*\tThere is a problem when there is only ONE list item.\n\t*\tCheck for this special case and change syntax for this occurrence.\n\t----------------------------------------------------------- */\n\tif ( list_item_selected <= 0 )\n\t\t{\n\t\tselected = false;\n\t\t\n\t\treturn selected;\t\t\n\t\t}\n\telse if( list_item_selected == 1 )\t\t\n\t\t{\t\t\t\n\t\t//special case for when only ONE list item is displayed\n\t\tif ( parent.content.document.forms[ 0 ].key.checked )\n\t\t\t{\n\t\t\tselected = true;\n\t\t\t}\n\t\t\t\n\t\treturn selected;\t\t\t\n\t\t}\n\telse\t\t\n\t\t{\n\t\t//case for when MORE THAN ONE list item is displayed\n\t\tfor( var j=0 ; j < parent.content.document.forms[ 0 ].key.length ; j++ )\n\t\t\t{\n\t\t\tif ( parent.content.document.forms[ 0 ].key[ j ].checked )\n\t\t\t\t{\n\t\t\t\tselected = true;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\treturn selected;\n\t\t}\t\n\t}", "title": "" }, { "docid": "9324143df9d35233c8708c3b0dc146ac", "score": "0.5318916", "text": "get selected() { return this._selectionList.selectedOptions.isSelected(this); }", "title": "" }, { "docid": "9324143df9d35233c8708c3b0dc146ac", "score": "0.5318916", "text": "get selected() { return this._selectionList.selectedOptions.isSelected(this); }", "title": "" }, { "docid": "b7b7a760f94995fca700265fcc97a954", "score": "0.53017193", "text": "_populateSubset() {\n const { model } = this;\n if (!model) {\n return false;\n }\n const items = this.node.querySelectorAll(`.${ITEM_CLASS}`);\n const subset = Private.commonSubset(Private.itemValues(items));\n const { query } = model;\n // If a common subset exists and it is not the current query, highlight it.\n if (subset && subset !== query && subset.indexOf(query) === 0) {\n model.query = subset;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "65ac9852c2bcd7907d6f41127f8ff335", "score": "0.52900606", "text": "function asignarMulti(control, ninguno, seleccionarTodos, seleccionarNinguno) {\n\t$(control).multiselect({\n\t selectedList: 100,\n\t checkAllText: seleccionarTodos || \"Todos\",\n\t uncheckAllText: seleccionarNinguno || \"Ninguno\",\n\t noneSelectedText: ninguno\n\t});\n}", "title": "" }, { "docid": "993fe7cb72508e4372dff7d1f42d1155", "score": "0.52833694", "text": "function userOptMultiValidate(id, label, min, max, numOpts) {\n\n\tthis.id = id;\n\tthis.label = label;\n\tthis.min = min;\n\tthis.max = max;\n\tthis.numOpts = numOpts;\n\n\tvar selectCt = 0;\n\tfor (var idx = 0; idx < this.numOpts; idx++) {\n\t\tvar chkBoxID = this.id + \":\" + idx;\n\t\tif (document.getElementById(chkBoxID).checked) {\n\t\t\tselectCt++;\n\t\t}\n\t\tif (selectCt > this.max) {\n\t\t\t/*\n\t\t\t * TODO : Use alert box css that is outlined in style guide.\n\t\t\t */\n\t\t\talert(\"Only \" + this.max + \" selections allowed.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "548bf0aa9cbeba780db8ba74d61b8196", "score": "0.52802074", "text": "function select(target, value, remainText){\r\n\t\tvar opts = $.data(target, 'combobox').options;\r\n\t\tvar values = $(target).combo('getValues');\r\n\t\tif ($.inArray(value+'', values) == -1){\r\n\t\t\tif (opts.multiple){\r\n\t\t\t\tvalues.push(value);\r\n\t\t\t} else {\r\n\t\t\t\tvalues = [value];\r\n\t\t\t}\r\n\t\t\tsetValues(target, values, remainText);\r\n\t\t}\r\n\t}", "title": "" } ]
9721c46f5a75578ca45ac817aabe57be
! vuex v3.6.2 (c) 2021 Evan You
[ { "docid": "622b80c8fc58e3ff4633891488c829da", "score": "0.0", "text": "function r(t){var n=Number(t.version.split(\".\")[0]);if(n>=2)t.mixin({beforeCreate:r});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,e.call(this,t)}}function r(){var t=this.$options;t.store?this.$store=\"function\"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}", "title": "" } ]
[ { "docid": "f5323caff0f3a89aefc4aa395f11a983", "score": "0.681243", "text": "function vuexInit(){var options=this.$options;// store injection\nif(options.store){this.$store=typeof options.store==='function'?options.store():options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "title": "" }, { "docid": "47d56e35335c96c660075e8b695cbf72", "score": "0.62996817", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var actions = vuex.actions;\n\t var getters = vuex.getters;\n\t // handle deprecated state option\n\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "415ea3ff80591d74cbbe0cd3123206f2", "score": "0.62796235", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var actions = vuex.actions;\n\t var getters = vuex.getters;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "2dbf91f3711d3c315addf4d5fd8d7c5d", "score": "0.6257241", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "14ecd7bf292120f8ac7bdeaefb6b158f", "score": "0.6206469", "text": "getProducts({ commit }) {\n axios.get('/products')\n .then(response => {\n commit('GET_PRODUCTS', response.data)\n })\n }", "title": "" }, { "docid": "659d23d1de1d6193bfd56264f70857be", "score": "0.6115157", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "82672b4b55738c3bbd343168f17ce260", "score": "0.6114761", "text": "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "title": "" }, { "docid": "82672b4b55738c3bbd343168f17ce260", "score": "0.6114761", "text": "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60605544", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60605544", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60605544", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60605544", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60605544", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "514899756d62842d954b9b0d8943fa7b", "score": "0.60553247", "text": "function vuexInit () {\n var options = this.$options\n // store injection\n if (options.store) {\n this.$store = options.store\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store\n }\n }", "title": "" }, { "docid": "0986b08a18280be9e37ed8a74f702f52", "score": "0.59898925", "text": "getStateSnapshot() {\n return { items: this.state.items };\n }", "title": "" }, { "docid": "9125140566f31aa9a7d4bb36ffae8ffb", "score": "0.59715754", "text": "function vuexInit() {\n var options = this.$options;\n var store = options.store;\n var vuex = options.vuex;\n // store injection\n\n if (store) {\n this.$store = store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n // vuex option handling\n if (vuex) {\n if (!this.$store) {\n console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n }\n var state = vuex.state;\n var actions = vuex.actions;\n var getters = vuex.getters;\n // handle deprecated state option\n\n if (state && !getters) {\n console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n getters = state;\n }\n // getters\n if (getters) {\n options.computed = options.computed || {};\n for (var key in getters) {\n defineVuexGetter(this, key, getters[key]);\n }\n }\n // actions\n if (actions) {\n options.methods = options.methods || {};\n for (var _key in actions) {\n options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n }\n }\n }\n }", "title": "" }, { "docid": "9125140566f31aa9a7d4bb36ffae8ffb", "score": "0.59715754", "text": "function vuexInit() {\n var options = this.$options;\n var store = options.store;\n var vuex = options.vuex;\n // store injection\n\n if (store) {\n this.$store = store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n // vuex option handling\n if (vuex) {\n if (!this.$store) {\n console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n }\n var state = vuex.state;\n var actions = vuex.actions;\n var getters = vuex.getters;\n // handle deprecated state option\n\n if (state && !getters) {\n console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n getters = state;\n }\n // getters\n if (getters) {\n options.computed = options.computed || {};\n for (var key in getters) {\n defineVuexGetter(this, key, getters[key]);\n }\n }\n // actions\n if (actions) {\n options.methods = options.methods || {};\n for (var _key in actions) {\n options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n }\n }\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.59677", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.59677", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "42982d79171a20cbf6788070af2a9ff5", "score": "0.5965575", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "df1e689c22190ae46d113f7a6734bae9", "score": "0.59508544", "text": "function vuexInit () {\n const options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939581", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" } ]
8c76376f819d7b03cd22b7c85e1fab1e
Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.
[ { "docid": "c07ca05b65e3663fd9b09997227965f8", "score": "0.7851167", "text": "function countPositivesSumNegatives(arr) {\r\n let posCount = 0;\r\n let res = [];\r\n let sumNeg = 0;\r\n for (let i in arr) {\r\n if (arr[i] >= 1) {\r\n posCount++;\r\n } else {\r\n sumNeg += arr[i];\r\n }\r\n }\r\n res.push(posCount, sumNeg);\r\n return res;\r\n}", "title": "" } ]
[ { "docid": "a692d7492c7403026129bd3e75994090", "score": "0.8323341", "text": "function countPositivesSumNegatives(array) {\n\n // if array is empty, return empty\n if (array == [] || array == null || array == undefined || array == \"\") {\n return [];\n }\n\n var negSum = 0;\n var posCounter = 0;\n for (var i = 0; i < array.length; i++) {\n // if positive\n // add 1 to counter\n if (array[i] > 0) {\n posCounter++;\n } else {\n // if negatives\n // add to sum\n negSum += array[i];\n }\n }\n\n return [posCounter, negSum];\n}", "title": "" }, { "docid": "bd690d6f76ad3f94715ba6163f5ab68e", "score": "0.829654", "text": "function countPosSumNeg(arr) {\n if (arr === null || arr.length === 0) {\n return [];\n } else {\n let positive = [], negative = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > 0) positive.push(arr[i]);\n else if (arr[i] < 0) negative.push(arr[i]);\n }\n\n let positiveLength = [], negSumArray = [];\n\n positiveLength.push(positive.length);\n\n const reduceNegative = (accumulator, currentVal) => accumulator + currentVal;\n let negativeSum = negative.reduce(reduceNegative);\n negSumArray.push(negativeSum);\n \n return positiveLength.concat(negSumArray);\n } \n}", "title": "" }, { "docid": "a88a3de470ad75baaeaa54c8f4bb23fc", "score": "0.8193513", "text": "function countPositivesSumNegatives(input) {\n if (!input || input.length === 0) {\n return [];\n } else {\n let negNum = input.filter((value) => value < 0);\n let negSum = !negNum.length ? 0 : negNum.reduce((a, cv) => a + cv);\n let posCount = input.filter((value) => value > 0).length;\n\n return [posCount, negSum];\n }\n}", "title": "" }, { "docid": "4ddb0c06ac3f246e046c9ee229d07d54", "score": "0.81437707", "text": "function countPositivesSumNegatives(input) {\n let answer = [];\n if (input === undefined || !input || input === null) {\n return answer;\n } else if (input.length > 0) {\n let negArr = [];\n let posArr = [];\n input.forEach(int => {\n if(int <= 0) {\n negArr.push(int);\n } else {\n posArr.push(int);\n }\n })\n if (negArr.length === 0) {negArr.push(0)};\n answer.push(posArr.length, negArr.reduce((final, index) => final + index));\n }\n console.log(answer);\n return answer;\n}", "title": "" }, { "docid": "9a6901a29f6a2e73722e2e5014624186", "score": "0.8138948", "text": "function countPositivesSumNegatives (input) {\n if (!input || !input.length) {\n return [];\n }\n\n const positives = input.filter(number => number > 0);\n const negatives = input.filter(number => number < 0);\n\n const sumNegatives = negatives.reduce((a, b) => a + b, 0);\n\n return [positives.length, sumNegatives];\n}", "title": "" }, { "docid": "e159e4c3aae57180c5478444bbfa00b6", "score": "0.8098214", "text": "function countPosSumNeg(arr) {\n if (Array.isArray(arr) && arr.length > 1){\n\t\tconst pos = [...arr].filter(num => num >= 0);\n\t\tconst neg = [...arr].filter(num => num < 0);\n\t\treturn [pos.length,neg.reduce((a,b)=> a+b)]\n\t}else{\n\t\treturn []\n\t}\n\n}", "title": "" }, { "docid": "e731bc07cc376afd1e1850e60eac7f58", "score": "0.79798204", "text": "function countPositivesSumNegatives(input) {\n if (input == null || input.length == 0) { return [] };\n\n var positive = []\n var negative = 0\n\n input.forEach(function (int) {\n if (Math.sign(int) == 1) {\n positive.push(int);\n } else {\n negative += int;\n }\n })\n\n return [positive.length, negative];\n}", "title": "" }, { "docid": "887e06ab2426fb2eb70dfa74a811103b", "score": "0.78878796", "text": "function countPositivesSumNegatives(input) {\n let result = []\n if((input == null) || (input.length === 0)){\n return result\n }else{\n let countOfPos = input.filter(num => num>0)\n result.push(countOfPos.length)\n let sumOfNeg = input.filter(num => num<0).reduce((a,c)=>a+c,0)\n result.push(sumOfNeg)\n return result\n }\n}", "title": "" }, { "docid": "f4c251746679b8fb2a5bb346f8927bf4", "score": "0.7875759", "text": "function countPositivesSumNegatives(input) {\n var p = 0;\n var n = 0;\n if(input === null || input.length < 1) return [];\n input.forEach( value => {\n value > 0 ? p++ : n += value\n })\n return [p , n];\n}", "title": "" }, { "docid": "c0c5454e252b5529ef82d815f1efa88c", "score": "0.77532077", "text": "function countPosSumNeg(nums) {\n if (!nums || nums.length === 0) return []\n let pCount = 0, negSum = 0\n nums.forEach(num => {\n if (num > 0) pCount++\n if (num < 0) negSum += num\n })\n return [pCount, negSum]\n}", "title": "" }, { "docid": "de4b1ceb0405d87ecdc13b8c3ef13a98", "score": "0.76367736", "text": "function positiveSum(arr) {\n for(var i=0, count = 0; i <= arr.length; i++) {\n if(arr[i] >= 0) {\n count += arr[i];\n }\n }\n return count; \n}", "title": "" }, { "docid": "55d0a4be1d1846ace6da826f0278c948", "score": "0.75255924", "text": "function positiveSum(arr) {\n let positiveNums = arr.filter(i => i>=0);\n let sumOfPos = positiveNums.reduce((a,c) =>a+c, 0);\n return sumOfPos\n}", "title": "" }, { "docid": "e16be2cf28b78ec18eb028fc6008fb7b", "score": "0.74201375", "text": "function sumOfN(n) {\n let arr = [0];\n let count = 0;\n let index = Math.abs(n);\n for(let i = 1; i <= index; i++){\n count+= i;\n if (n < 0) {\n arr.push(-count);\n } else {\n arr.push(count);\n }\n }\n return arr;\n}", "title": "" }, { "docid": "91950ed4d2bcd9e87c687fd52336b153", "score": "0.7403006", "text": "function sumPositive (arrayNum){\n let count = 0 \n arrayNum.forEach((num)=>{\n if (num >= 0){\n count += num\n }\n })\n return count\n}", "title": "" }, { "docid": "ce3c1886fec2f4500fdd35ebd17cc5db", "score": "0.73489", "text": "function positiveSum(arr) {\n total = 0\n for(i=0; i<arr.length; i++) {\n if (arr[i] > 0) {\n total += arr[i]\n }\n }\n return total\n }", "title": "" }, { "docid": "ab14593ec9d87da049224cdc37ad750f", "score": "0.73220885", "text": "function positiveSum(arr) {\n let count = 0;\n arr.map(x => x > 0 ? count += x : x = 0);\n return count;\n}", "title": "" }, { "docid": "6d6015b7064d9eaba4d8b670b559d623", "score": "0.7285059", "text": "function sumOfPositive(array){\n\tsum = 0;\n\tfor (var i=0; i<array.length; i++)\n\t\tif (array[i]>0) sum+=array[i];\n\treturn sum;\n}", "title": "" }, { "docid": "8f35d42fd9d09e3713b28a15ede20223", "score": "0.72377485", "text": "function positiveSum(arr) {\n let positiveNumbers = [0]\n arr.forEach(number => {\n if (number >= 0 ) {\n positiveNumbers.push(number)\n }\n })\n return positiveNumbers.reduce((a, b) => {\n return a + b\n })\n}", "title": "" }, { "docid": "76e43df87b1630db91a36604f72e13c3", "score": "0.72369576", "text": "function positiveSum(arr) {\n let result = 0;\n for (let number of arr) {\n if (number > 0) {\n result += number;\n }\n }\n return result;\n}", "title": "" }, { "docid": "da5252ba2f3406debd78991312543269", "score": "0.7194999", "text": "function positives(numberArray){\n let array = []\n for(let i=0; i<numberArray.length; i++){\n if (numberArray[i] > 0){\n array.push(numberArray[i])\n }\n }\n return array\n}", "title": "" }, { "docid": "158f7e887431ae62eaa1771eb610dda5", "score": "0.7178779", "text": "function sumPositiveNumbers(array) {\r\n let sumPositive = array.reduce((sum, current) => {\r\n if (current > 0) {\r\n return sum + current;\r\n } else {\r\n return sum;\r\n }\r\n }, 0);\r\n\r\n return sumPositive;\r\n}", "title": "" }, { "docid": "d7110397d56be94a4c4b7d02088bfbd6", "score": "0.7151538", "text": "function positiveSum(arr) {\n return arr.reduce((prevNum, currNum) => prevNum + currNum);\n}", "title": "" }, { "docid": "039f2c50b6f61d98ed54f2ec6d8d5380", "score": "0.7150884", "text": "function positiveSum(arr) {\n return arr.reduce((sum, item) => sum + (item > 0 ? item : 0), 0);\n}", "title": "" }, { "docid": "e2bf6365c05458ead8819130a18c4d5f", "score": "0.7149627", "text": "function positiveSum(arr) {\n var total = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > 0){\n total = total + arr[i];\n }\n }\n return total;\n}", "title": "" }, { "docid": "5467988ed60edca280ceb9c8b7816781", "score": "0.71313536", "text": "function positiveSum(arr) {\n var length = arr.length;\n\n if (arr.length === 0) {\n return 0\n }\n\n var posNums = [];\n var negNums = [];\n\n for (let i = 0; i < length; i++) {\n\n if (arr[i] <= -1) {\n negNums.push(arr[i])\n console.log(\"NEG\")\n }\n else {\n posNums.push(arr[i])\n console.log(\"POS\")\n }\n\n }\n if (posNums.length === 0) {\n console.log(\"HERE\")\n return 0\n }\n\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n\n return posNums.reduce(reducer)\n}", "title": "" }, { "docid": "2dddad91654af6ad93958e0efe0ae7bc", "score": "0.7109294", "text": "function positiveSum(arr) {\n return arr.reduce((acc, currVal) => {\n return acc + (currVal > 0 ? currVal : 0)\n }, 0)\n}", "title": "" }, { "docid": "e44d45bd10f93683392ec437bc3ed2f3", "score": "0.7089951", "text": "function sumPos(a) {\n var i;\n var rez = 0;\n for (i = 0; i < a.length; i++) {\n if (a[i] > 0) {\n rez += a[i];\n }\n }\n return rez;\n}", "title": "" }, { "docid": "7226df1c29cd3bddd2e5cb7e2afc4a08", "score": "0.707711", "text": "function positives (myArray) {\n let positiveArray = []\n for (let i = 1; i <= myArray.length; i++) {\n if (myArray[i] > 0) {\n positiveArray.push(myArray[i]) \n }\n }\nreturn positiveArray\n}", "title": "" }, { "docid": "03323fe44ac8209f4e25464b92d5943f", "score": "0.70702654", "text": "function PositiveSum(array_num){\n let total = 0;\n for(let i = 0; i < array_num.length; i++){\n if(array_num[i] > 0){\n total += array_num[i]\n }\n }\n return total\n}", "title": "" }, { "docid": "679ba80cb373ccbe4e609a20d767b364", "score": "0.7061571", "text": "function positiveSum(arr) {\n var mySum = 0;\n for (i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n mySum = mySum + arr[i];\n }\n }\n return mySum;\n}", "title": "" }, { "docid": "e789a32acc57b01ea0a115b3d3e808a6", "score": "0.7051237", "text": "function positives (arrayOfNums) {\n let positivesArray = []\n for (let i = 0; i <= arrayOfNums.length + 1; i++) {\n if (arrayOfNums[i] > 0) {\n positivesArray.push(arrayOfNums[i])\n }\n }\n return positivesArray\n}", "title": "" }, { "docid": "19ed08340ce28e87818788440cad0dfa", "score": "0.70417064", "text": "function positiveSum(arr) {\n const reducer = (a, c) => a + (c > 0 ? c : 0)\n return arr.reduce(reducer, 0)\n}", "title": "" }, { "docid": "009a70518cb8fcc91a8116fa5b38e781", "score": "0.702142", "text": "function positives (array) {\n var posArr = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] > 0) {\n posArr.push(array[i]);\n }\n }\n return posArr;\n}", "title": "" }, { "docid": "3171aa5056525401b96f19ddd3ed0068", "score": "0.7000348", "text": "function positives (num){\n var newArray = []\n for (var i = 0; i < num.length; i++){\n if (num[i] > 0) {\n newArray.push(num[i])\n }\n \n }\n return newArray\n}", "title": "" }, { "docid": "0c9924c833b5da9cdd9e46c3965c676c", "score": "0.69756126", "text": "function positiveSum(arr) {\n let sum = 0;\n arr.forEach(function (value) {\n if (Math.sign(value) == 1) {\n sum += value;\n }\n })\n return sum;\n}", "title": "" }, { "docid": "5721d08c61afba76a932938b18a759b6", "score": "0.6973703", "text": "function countPositive(arr){\n\n var count = 0;\n\n\n for ( var i = 0; i< arr.length; i++){\n if( arr[i]>0){\n count = count + 1;\n }\n }\n\n arr[arr.length - 1] = count;\n\n return arr;\n\n\n}", "title": "" }, { "docid": "d9353a172128723365b38ebb60b9a5dd", "score": "0.6958961", "text": "function plusMinus(arr) {\n var negative = 0;\n var positive = 0;\n var zero = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n positive++;\n } else if (arr[i] < 0) {\n negative++;\n } else {\n zero++;\n }\n }\n console.log(positive / arr.length);\n console.log(negative / arr.length);\n console.log(zero / arr.length);\n}", "title": "" }, { "docid": "89c3e360c8be776c86d5359e701d0d26", "score": "0.6958078", "text": "function countNegative(arrayOfIntegers = []) {\n let count = 0;\n for (let i = 0; i < arrayOfIntegers.length; i++) {\n if (arrayOfIntegers[i] < 0) {\n count++;\n }\n }\n console.log('Negativos: ' + count);\n}", "title": "" }, { "docid": "ad6c76c271137cc249b23cfb86968a7b", "score": "0.69214875", "text": "function positiveNumbers (array) {\n \n positiveArray = [];\n \n for (var i = 0; i < array.length; i ++) {\n if (array[i] > 0) {\n positiveArray.push(array[i]);\n }\n }\n\n return positiveArray;\n}", "title": "" }, { "docid": "41f08dbefcaf791bb29ee4de2fe40282", "score": "0.69193286", "text": "function plusMinus() {\n var n = parseInt(readLine());\n arr = readLine().split(' ');\n arr = arr.map(Number);\n var positive = 0;\n var negative = 0;\n var zeros = 0;\n for(var i=0;i<n;i++){\n if(arr[i] > 0){\n positive++;\n }else if(arr[i] < 0){\n negative++;\n }else{\n zeros++;\n }\n }\n console.log(positive/n);\n console.log(negative/n);\n console.log(zeros/n);\n\n}", "title": "" }, { "docid": "1ec7268bf5fb5e84bd92f2bdcacf9bed", "score": "0.68529755", "text": "function positiveSum(r) {\n if (r.length == 0) {\n return 0\n } else if (r.every((i) => i < 0)){\n return 0\n } else if (r.every((i) => i >= 0)){\n return r.reduce((p,n) => p + n)\n } else {\n let c = r.filter((i) => i > 0)\n return c.reduce((a,b) => a + b)\n }\n}", "title": "" }, { "docid": "9bfcb4bb4c901f268e9616816ba6f615", "score": "0.68525964", "text": "function positiveSum(arr) {\n var total = 0;\n arr.forEach(function(num){\n if (num > 0) {\n total = total + num;\n }\n })\n return total;\n}", "title": "" }, { "docid": "e4db94e7ddc32fcedda29cef326e08db", "score": "0.68370295", "text": "function getAbsSum(arr){\n return arr.reduce((count, num) => count + Math.abs(num), 0)\n}", "title": "" }, { "docid": "d22cee587a0db3ff6a256fa9b6b6f8da", "score": "0.6833911", "text": "function plusMinus(arr) {\n const arrLen = arr.length;\n const positives = arr.filter((el) => el > 0).length;\n const negatives = arr.filter((el) => el < 0).length;\n const zeros = arr.filter((el) => el === 0).length;\n console.log((positives / arrLen).toFixed(6));\n console.log((negatives / arrLen).toFixed(6));\n console.log((zeros / arrLen).toFixed(6));\n}", "title": "" }, { "docid": "f5d9bab877af141c5e80a15b6a23fd9a", "score": "0.6826178", "text": "function countPositives(arr){\n var positives = 0;\n for (var i = 0; i < arr.length; i++){\n if (arr[i] > 0){\n positives++;\n }\n }\n arr[arr.length-1] = positives;\n return arr;\n}", "title": "" }, { "docid": "a71031fa40042961e6e9bfee29d2680a", "score": "0.6779472", "text": "function countPositives(arr) {\n var count = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n count += 1;\n } \n }\n arr[arr.length - 1] = count;\n return arr;\n}", "title": "" }, { "docid": "5dd83b44341ba8c1bcff46b396b0324a", "score": "0.67677176", "text": "function plusMinus(arr) {\r\n let positive = 0;\r\n let negative = 0;\r\n let zero = 0;\r\n let length = arr.length;\r\n arr.forEach((n) => {\r\n if (n > 0) positive++;\r\n else if (n < 0) negative++;\r\n else zero++;\r\n });\r\n console.log((positive / length).toFixed(6));\r\n console.log((negative / length).toFixed(6));\r\n console.log((zero / length).toFixed(6));\r\n}", "title": "" }, { "docid": "9a86ac9f371374efc98d2ea3c6252870", "score": "0.67620623", "text": "function positiveNumbers(nums) {\n // var nums = [-1, -2, -3, 0, 1, 2, 3];\n var positiveNumberArray = []\n for (var i=0; i<nums.length; i++) {\n if(nums[i] > 0) {\n positiveNumberArray.push(nums[i])\n }\n \n }\n return positiveNumberArray\n}", "title": "" }, { "docid": "91ad1f5771fb5573e24431768aef315d", "score": "0.6749159", "text": "function plusMinus(arr) {\n\n let sizeArr = arr.length;\n let countsNegative = 0;\n let countsPositive = 0;\n let countsZero = 0;\n\n for ( let num of arr ) {\n if ( num > 0 ) {\n countsPositive += 1;\n } else if ( num < 0 ) {\n countsNegative += 1;\n } else if ( num == 0 ) {\n countsZero += 1;\n }\n }\n\n console.log(div(countsPositive, sizeArr));\n console.log(div(countsNegative, sizeArr));\n console.log(div(countsZero, sizeArr));\n\n}", "title": "" }, { "docid": "22857c6d594a8331c4da5f33d789aa4c", "score": "0.6743364", "text": "function sumwhileneg(myarray) {\n var tot = 0;\n for(i = 0; i < myarray.length; ++i) {\n var x = myarray[i];\n if (x < 0) {\n return tot;\n }\n tot += x; \n }\n return tot;\n}", "title": "" }, { "docid": "df3575b72f38393f36255dae25682695", "score": "0.67262655", "text": "function countPositives(arr) {\r\n\tvar acc = 0;\r\n for (var i=0; i<arr.length; i++) {\r\n\t\tif (arr[i]>=0) {\r\n\t\t\tacc++;\r\n\t\t}\r\n\t}\r\n\tarr[arr.length-1] = acc;\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "36207734ebccaaea988deb2f6e5b288f", "score": "0.6703964", "text": "function plusMinus(arr) {\n let counter = [0, 0, 0];\n\n arr.forEach((e) => {\n if (e > 0) {\n counter[0]++;\n } else if (e < 0) {\n counter[1]++;\n } else {\n counter[2]++;\n }\n });\n for(let result of counter) {\n console.log((result / arr.length).toFixed(6));\n }\n}", "title": "" }, { "docid": "16aff1a8a5239520fc4d169201d3756a", "score": "0.6660557", "text": "function calc (arr){\n var sum=0;\n for (var i=0; i< arr.length; i++) {\n if(arr[i] > 0){\n sum += arr[i];\n }\n } return sum;\n}", "title": "" }, { "docid": "be06ee6d8864e605f50866bb06e2a66c", "score": "0.66556424", "text": "function plusMinus(arr) {\n let pos = 0\n let neg = 0\n let zero = 0\n let total = arr.length\n for (let i of arr) {\n if (i > 0) pos ++\n if (i < 0) neg ++\n if (i == 0) zero ++ \n }\n console.log((pos/total).toFixed(6)), \n console.log((neg/total).toFixed(6)),\n console.log((zero/total).toFixed(6))\n}", "title": "" }, { "docid": "41a6837559ed212f0b6a1f92fa624136", "score": "0.6645328", "text": "function positiveArray(array) {\n let newArray = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i] > 0) newArray.push(array[i]);\n }\n return newArray;\n}", "title": "" }, { "docid": "bfc56691085b2bed03837866af2bd8cf", "score": "0.66336167", "text": "function sumZero(array) {\n for (let i = 0; i < array.length; i++) {\n for (let j = i + 1; j < array.length; j++) {\n if (array[i] + array[j] === 0) return [array[i], array[j]];\n }\n }\n}", "title": "" }, { "docid": "d69bc0459118ebf7daa9fa7e755f2c99", "score": "0.6606385", "text": "function arrays() {\n const negNumArr = negativeNumbers.map((n) => {\n return parseFloat(n, 10);\n })\n negSum = negNumArr.reduce(function(a, b){\n return a + b;\n }, 0);\n\n const posNumArr = positiveNumbers.map((n) => {\n return parseFloat(n, 10);\n })\n posSum = posNumArr.reduce(function(a, b){\n return a + b;\n }, 0);\n}", "title": "" }, { "docid": "26b82d94e40492229b79a55898a6509d", "score": "0.6589679", "text": "function plusMinus(arr) {\n var pos = 0;\n var neg = 0;\n var zero = 0;\n for (let i = 0; i < arr.length; i++){\n if (arr[i] < 0) {\n neg++;\n }\n else if (arr[i] === 0) {\n zero++;\n }\n else {\n pos++;\n }\n }\n var posNum = pos / arr.length;\n var negNum = neg / arr.length;\n var zeroNum = zero / arr.length;\n console.log(posNum.toFixed(6));\n console.log(negNum.toFixed(6));\n console.log(zeroNum.toFixed(6));\n}", "title": "" }, { "docid": "a210c417439bf4d765cc1117bf3be6b0", "score": "0.6553751", "text": "function detectarNumeros(arreglo){\n let contador = [0,0,0];\n for (let i = 0; i<arreglo.length; i++){\n if(arreglo[i] < 0)\n contador[0]++;\n else{\n if(arreglo[i] == 0)\n contador[1]++;\n else{\n contador[2]++;\n }\n }\n }\n return contador;\n}", "title": "" }, { "docid": "9819cd812c2eb5fcbc038c707eeae982", "score": "0.65475976", "text": "function positiveArray(){\n let array = [-3, -1, 2, 4, 5];\n let positive = array.reduce((total,amount) => {\n if(amount < 0){\n return total.concat(amount * (-1));\n }else{\n return total.concat(amount);\n }\n }, []);\n console.log(positive);\n}", "title": "" }, { "docid": "b99b59d31a8c264793a3c4145957d230", "score": "0.6541784", "text": "function countPositives(arr){\n\tvar posi = 0\n\tfor(var i=0;i<arr.length;i++){\n\t\tif(arr[i]>=0){\n\t\t\tposi += 1;\n\t\t}\n\t}\narr[arr.length-1] = posi;\nreturn arr \n}", "title": "" }, { "docid": "874d285b8cdd8a21794fff7396eaebec", "score": "0.6535544", "text": "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++ ) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]]\n }\n }\n }\n}", "title": "" }, { "docid": "dd90803b5a6d616555c16ef0e6761c7c", "score": "0.6530918", "text": "function sumZero(arr) {\n\tfor(let i = 0; i < arr.length; i++) {\n\t\tfor(let j = i+1; j <arr.length; j++) {\n\t\t\tif(arr[i] + arr[j] === 0) {\n\t\t\t\treturn [arr[i], arr[j]];\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bde99fda08015ef52e1b468a9f754ebf", "score": "0.65308225", "text": "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum < 0) { // too far left/negative\n left++;\n } else if (sum > 0) { // too far right/positive\n right--;\n }\n }\n}", "title": "" }, { "docid": "a1e7fd7f679118afe1576557d71dbb35", "score": "0.6513733", "text": "function positiveNumbers(numbers){\n const positiveNumber = [];\n for(let value of numbers){\n if(value >= 0){\n positiveNumber.push(value);\n } else {\n continue;\n } \n }\n return positiveNumber; \n}", "title": "" }, { "docid": "0a288fe98f06f7dc7b6c24f4fc77ac1b", "score": "0.65118587", "text": "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n}", "title": "" }, { "docid": "14dd9d213c16b97b136c71b2c30cbea5", "score": "0.65111715", "text": "function countPositives(arr){\n var count = 0;\n for (i=0;i<arr.length; i++){\n if (arr[i]>0){\n count++;\n }\n }\n arr[arr.length-1] = count;\n return arr;\n}", "title": "" }, { "docid": "efd6d92eac43481d3d5dc8e2830dda48", "score": "0.64888644", "text": "function sumToZero (n) {\n let resultsArray = [];\n\n if (n % 2 === 0) {\n const integer = n / 2;\n\n for (i = 1; i <= integer; i++) {\n resultsArray.push(-i, i);\n }\n } else {\n const integer = (n - 1) / 2;\n\n for (i = 1; i <= integer; i++) {\n resultsArray.push(-i, i);\n }\n resultsArray.push(0);\n }\n\n return resultsArray;\n}", "title": "" }, { "docid": "a969da4940be58c8f1db2c66951ac250", "score": "0.6484404", "text": "function sumZero(arr){\n for(let i = 0; i < arr.length; i++){\n for(let j = i+1; j < arr.length; j++){\n if(arr[i] + arr[j] === 0){\n return [arr[i], arr[j]];\n }\n }\n }\n}", "title": "" }, { "docid": "65046d707bcd21b260ea47c3d98c9cfa", "score": "0.647729", "text": "function sumZeroNaive(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = arr.length - 1; j > i; j--) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "d278afc4cffd40875f2224bbafc49643", "score": "0.6469136", "text": "function naiveSumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) return [arr[i], arr[j]];\n }\n }\n}", "title": "" }, { "docid": "89a1957e33aac3695777367fcb9d3a3e", "score": "0.6455816", "text": "function positives(numbers) {\n\n for (let i = 0; i < numbers.length; i++) {\n\n if (numbers[i] < 0 || numbers[i] % 2 != 0) {\n // numbers that fit either criteria are placed in the badNumbers array\n badNumbers.push(numbers[i]);\n }\n else {\n // numbers that don't fit the criteria are added to the sum\n sum += numbers[i];\n }\n }\n console.log(\"Negative or odd numbers are: \" + badNumbers + \"\\n\");\n return sum;\n}", "title": "" }, { "docid": "409a7e2e0e9601c9dbbeaf403e1ed3a6", "score": "0.64542675", "text": "function plusMinus(arr) {\n \n // console.log(arr)\n \n let neg = 0\n let pos = 0\n let zero = 0\n \n for(let i = 0; i < arr.length; i++){\n \n if(arr[i] < 0){\n neg += 1;\n } else if (arr[i] === 0) {\n zero += 1;\n } else if (arr[i] > 0) {\n pos += 1;\n }\n \n \n }\n \n neg = (neg/(arr.length)).toFixed(6)\n pos = (pos/(arr.length)).toFixed(6)\n zero = (zero/(arr.length)).toFixed(6)\n \n console.log(pos)\n console.log(neg)\n console.log(zero)\n \n}", "title": "" }, { "docid": "24682e4a8ca1f8deccf25b5d9be4f7c4", "score": "0.6426633", "text": "function sumwhileneg(myarray) {\n\tvar tot = 0;\n\tfor(i = 0; i < myarray.length; ++i) {\n\t\tvar x = myarray[i];\n\t\tif (x > 0) {\n\t\t\ttot += x;\n\t\t} else {\n\t\t\treturn tot;\n\t\t}\n\t}\n\treturn tot;\n}", "title": "" }, { "docid": "dd75f5ce5f30903ffd0338a1ab2d35be", "score": "0.6423159", "text": "function sumOfN(n) {\n // place to store the current total\n let total = 0;\n // place to store the result array\n const resultArr = [];\n\n if (n < 0) {\n for (let i = 0; i <= Math.abs(n); i++) {\n if (i === 0) {\n total += i;\n resultArr.push(total);\n } else {\n // add current index to total\n total += i;\n // push total to result array\n resultArr.push(-total);\n }\n }\n } else {\n // iterate up to n\n for (let i = 0; i <= n; i++) {\n // add current index to total\n total += i;\n // push total to result array\n resultArr.push(total);\n }\n }\n // return result array\n return resultArr;\n}", "title": "" }, { "docid": "59f73a4f0862a1f5a19ba8e18df182e1", "score": "0.6411904", "text": "function zeroCount(numbers) {\n var result = 0;\n var index = 0;\n while (index < numbers.length) {\n if (numbers[index] === 0) {\n result += 1;\n }\n index += 1;\n }\n return result;\n}", "title": "" }, { "docid": "67b22f1b6575206f68cc643919646e27", "score": "0.6369223", "text": "function positiveSum(arr) {\n/*declare the sum value to zero, just\nto start off*/\n//this variable will incroment in value\n//while the loop is being iterated\n\tlet sum = 0;\n/*declare the variable of i to zero,\npointing to the first value in the array\nof numbers that need to be added. this \nnumber will incroment after every\nloop, by one, pointing to every value\nin the array starting at the first\nvalue*/\n\tlet i = 0;\n/*loop of FOR, statement 1, i = 0 and is executed\n(one time) before the execution of the code block.\nStatement 1 sets a value to variable before the loop\nstarts (let i = 0). this points to the first value in the array.*/\n/*Statement 2 defines the condition for the loop\nto run or execute the code block (i must be less than\narr.length). i must be less, so that way it loops through\nall the digits in the array, (1,2,3,4,5) and stops\nat the last digit in the array*/\n/*Statment 3 increases the value of i (i++) each time the\ncode block in the loop has been executed. it is incromented\nafter the code block is executed.... And in each incroment\npointing/looping through the next value in the array. in\nthis case it basically goes through each number of the array.\nIt increases in value so it will loop around the next number\nin the array*/\n\tfor(i = 0; i < arr.length; i++) {\n/*if arr at the spot that i has landed is greater than \nzero. this line has to be true to execute the next line.\nthe line will execute*/\n\t\tif (arr[i] > 0) {\n/*if arr at the spot that i has landed is greater than\nzero. this line has to be true to execute the next line in\nthe loop, if it is not true, it will not add the value of \nthat array point to the total sum*/\n\t\tsum += arr[i];\n\t }\n\t}\n//then return the total through the sum variable\n\n\treturn sum;\n}", "title": "" }, { "docid": "a16e80f927a4a8c66f2513da70011f0f", "score": "0.6347628", "text": "function countPositives(arr) {\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n arr[i] > 0 ? count++ : null;\n }\n arr[arr.length - 1] = count;\n return arr;\n}", "title": "" }, { "docid": "05788e135a0fea284ea7e4ac47dd3b3f", "score": "0.6346653", "text": "function signFlipCount(arr)\n{\n\tvar count = 0;\n\n\tfor(var i = 0; i <= arr.length - 1; i++)\n\t{\n\t\tvar num1 = arr[i];\n\t\tvar num2 = arr[i+1];\n\n\t\tif((num1 > 0 && num2 < 0) ||(num1 < 0 && num2 > 0))\n\t\t{\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "50441aa8841cabaf84d692e7fdd6da43", "score": "0.6341546", "text": "function positiveSum(numbers){\n let sum = 0;\n numbers.forEach(function addNums(number){\n if(number > 0){\n sum += number;\n }\n })\n return sum;\n}", "title": "" }, { "docid": "f5a52dc97b993b23883c25f236728850", "score": "0.62957287", "text": "function plusMinus(arr) {\n let p = 0\n let n = 0\n let zero = 0\n let len = arr.length\n\n for (let i = 0; i < len; i++) {\n if (arr[i] > 0) {\n p++\n } else if (arr[i] < 0) {\n n++\n } else {\n zero++\n }\n }\n\n [(p / len).toFixed(6), (n / len).toFixed(6), (zero / len).toFixed(6)].forEach((val) => {\n console.log(val)\n })\n\n}", "title": "" }, { "docid": "124edd02e0b051d38fca867c7eea71d0", "score": "0.629227", "text": "function zeroOutNegativeNumbers(arr){\n\tnewArr = [];\n\tfor(var i = 0; i < arr.length; i++){\n\t\tif(arr[i] < 0){\n\t\t\tarr[i] = 0;\n\t\t\tnewArr.push(arr[i]);\n\t\t} else {\n\t\t\tnewArr.push(arr[i]);\n\t\t}\n\t }\n\t console.log(newArr);\n\t}", "title": "" }, { "docid": "6dd3da772cbf98db764a023f2a820b24", "score": "0.62753016", "text": "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "title": "" }, { "docid": "f14de0319218818c140aaee36b1cd102", "score": "0.62651557", "text": "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n while(left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if(sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "title": "" }, { "docid": "aa4f02b7bc14c8bcddb3be23b950ed9e", "score": "0.626453", "text": "function sumOfN(n) {\n let array = [];\n array[0] = 0;\n for (let i = 1; i < Math.abs(n)+1; i++) {\n if (n > 0) array[i] = array[i-1]+i;\n else array[i] = array[i-1]-i;\n }\n return array;\n}", "title": "" }, { "docid": "a68528f1d8b43e839fc809cf1c442d6c", "score": "0.62602556", "text": "function sumZero(arr) {\n let end = arr.length - 1;\n let start = 0;\n\n while (start < end) {\n let sum = arr[start] + arr[end];\n\n if (sum == 0) return ([arr[start], arr[end]]);\n\n else if (sum > 0) end--;\n\n else start++;\n }\n}", "title": "" }, { "docid": "b412a2bfae56389a7e18682538699856", "score": "0.62452036", "text": "function plusMinus(arr) {\n let res=[];\n const initialObj = { positive: 0, negative: 0, stable: 0 }\n let resArr = arr.reduce( (acc,val) => {\n if( val > 0 ) {\n acc[\"positive\"]++;\n } else if( val < 0) {\n acc[\"negative\"]++;\n } else{\n acc[\"stable\"]++\n }\n return acc; \n }, initialObj)\n\n console.log( resArr );\n //return Object.values( resArr ).map( v => parseFloat((v /arr.length)).toFixed(6)).split(''); \n return Object.values( resArr ).map( v => (v/arr.length).toFixed(6)).split('').join('');\n\n\n return null; \n}", "title": "" }, { "docid": "bcf5b0f5b968439123d340490d217e6b", "score": "0.6241735", "text": "function countZeroes(arr) {\n let firstZero = findFirst(arr);\n if (firstZero === -1) return 0;\n\n return arr.length - firstZero;\n}", "title": "" }, { "docid": "d03a747aa08c5d6374973ca3ba9ba104", "score": "0.624037", "text": "function countZero(nums) {\n let count=0, i=0, n=nums.length-1;\n for(i=0; i<n; i++) {\n if(nums[i]===0 && i!==n) \n count+=1;\n if(nums[i]===0 && i==n) {\n count-=1;\n n-=1;\n }\n }\n return{\n count: count,\n iterate:n,\n }\n}", "title": "" }, { "docid": "2464378c80a779608f8adb7bc3e72e46", "score": "0.6237828", "text": "function sumArray(inputArray){\n\tvar sum = 0;\n\tfor(i=0; i<inputArray.length; i++){\n for(j=0; j<inputArray[i].length; j++){\n if(inputArray[i][j] !== 0){\n\t\t sum += inputArray[i][j];\n }\n }\n\t}\n\treturn sum;\n}", "title": "" }, { "docid": "8dc697bdb55bb9e88e9fbe50c6d5c053", "score": "0.62329394", "text": "function sumZero(arr) {\n let left = 0,\n right = arr.length - 1;\n\n while (left < right) {\n let sum = arr[left] + arr[right];\n\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "title": "" }, { "docid": "28d2349acd000e8dc4d02d71ad4086a4", "score": "0.6230447", "text": "function countZeroes(array) {\n let zeroesCount = 0\n for (let x = 0; x < array.length; x++) {\n if (array[x] === 0) {\n zeroesCount++\n }\n }\n return zeroesCount;\n}", "title": "" }, { "docid": "8fb6c551aa1147e0557302b55e037232", "score": "0.6221854", "text": "function largestSubArrayOfZeroesAndOnes(arr) {\n var length = arr.length,\n sumLeft = [],\n sumRight = [],\n sum = 0,\n i;\n\n // fill out sumLeft\n for (i = 0; i < length; i++) {\n sum += (arr[i] === 0) ? -1 : 1;\n sumLeft[i] = sum;\n }\n \n console.log(sumLeft);\n \n}", "title": "" }, { "docid": "60cff1c67f65f0e09c8fd54362935ffd", "score": "0.62125677", "text": "function sumZero(arr){\n let left = 0;\n let right = arr.length - 1;\n while (left < right){\n let sum = arr[left] + arr[right];\n if(sum === 0){\n return [arr[left], arr[right]];\n }\n else if(sum > 0){\n right--;\n }\n else left++;\n\n }\n}", "title": "" }, { "docid": "9c22cda9717584c8985e3675e50c36e2", "score": "0.61989063", "text": "function plusMinus(arr) {\n var total = arr.length;\n var positive = 0;\n var negative = 0;\n var zero = 0;\n arr.forEach(element => {\n if(element > 0){\n positive += 1;\n } else if(element < 0) {\n negative += 1;\n } else {\n zero += 1;\n }\n });\n if(total != 0 ){\n process.stdout.write('' + (positive/total).toPrecision(6) + '\\n');\n process.stdout.write('' + (negative/total).toPrecision(6) + '\\n');\n process.stdout.write('' + (zero/total).toPrecision(6) + '\\n');\n\n } else {\n process.stdout.write('0');\n process.stdout.write('0');\n process.stdout.write('0');\n\n }\n}", "title": "" }, { "docid": "54441e87f40bf92f06d2334f62ad8eb6", "score": "0.6191843", "text": "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) { // Cannot be less than OR equal to because you end up summing the same number by itself\n let sum = arr[left] + arr[right];\n if (sum > 0) {\n right -= 1;\n }\n if (sum < 0) {\n left += 1;\n }\n if (sum === 0) {\n return [arr[left], arr[right]];\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "a10dbd547d80aebd98f24d03d5bc859f", "score": "0.61751825", "text": "function getPositives(array) {\n var onlyPos = [];\n array.filter(function(number) {\n if(number >= 0) {\n onlyPos.push(number);\n }\n \n })\n \n return onlyPos;\n}", "title": "" }, { "docid": "50573b9cd647a48ca1c038f514f64c96", "score": "0.6144097", "text": "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n \n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "title": "" }, { "docid": "97175dab07f148af0f9a0f1e177bf0a4", "score": "0.6109461", "text": "function sumZero(arr){\n let left = 0;\n let right = arr.length - 1; // last index of the array\n\n if(arr){\n while(left < right){\n let sum = arr[left] + arr[right];\n if(sum == 0){\n return [arr[left], arr[right]];\n } else if(sum > 0){\n right--;\n } else {\n left++;\n }\n }\n }\n}", "title": "" }, { "docid": "71c7143576893f515fffeb5202dc7cc5", "score": "0.61089146", "text": "function sumZeroImproved(arr) {\n // Improved solution - O(n)time, O(1)space\n\n // starting indexes (first and last)\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n const sum = arr[left] + arr[right];\n\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "title": "" } ]
53174ff8df166ee7cd4880a2618d1b9e
Factory method to create a commitment object
[ { "docid": "6b9dd4682bc93d5530a07d59acca9f8d", "score": "0.775632", "text": "static createInstance(committer, randomString, commitDateTime) {\n return new Commitment({ committer, randomString, commitDateTime});\n }", "title": "" } ]
[ { "docid": "73b748c3fcd8ab0413a30d0f7f1259ff", "score": "0.6468229", "text": "function Commitment(id) {\r\n\tthis.id = id;\r\n\tthis.player = null;\r\n\tthis.format = null;\r\n\tthis.value = null;\r\n\tthis.encodedValue = null;\r\n\tthis.isResolved = false;\r\n}", "title": "" }, { "docid": "27f8c8274a1e5c97a20bc0a1941ab4ac", "score": "0.57754976", "text": "function RepoCommitDetail() {\n _classCallCheck(this, RepoCommitDetail);\n\n RepoCommitDetail.initialize(this);\n }", "title": "" }, { "docid": "7c32ba24030f70b1a39ccd8e256ea60a", "score": "0.5771185", "text": "function TransactionFactory() {\n }", "title": "" }, { "docid": "110a95e391443b73c5b3834cda80ba15", "score": "0.5751493", "text": "function createContract(id, custID, contractID, farmID, numLoads, startDate, deliveryByDate, outcome) {\n return { id, custID, contractID, farmID, numLoads, startDate, deliveryByDate, outcome};\n}", "title": "" }, { "docid": "e2aeaeed9fdc0188f03a4940cd013a75", "score": "0.54958844", "text": "static createInstance( issuer, reference, quantité, vaccineRef, fabricationDate, expirationDate ) {\n return new Lot({ issuer, reference, quantité, vaccineRef, fabricationDate, expirationDate });\n }", "title": "" }, { "docid": "3559f7c606597dfcdfc01b036fb3fd22", "score": "0.54779774", "text": "function Amendment(exp, author, isProposal) {\r\n\tconsole.assert(exp instanceof Expression);\r\n\tthis.exp = exp;\r\n\tthis.author = author;\r\n\tthis.isProposal = !!isProposal;\r\n}", "title": "" }, { "docid": "c1a1e981b2d1dae5cdded2ff6ec056c5", "score": "0.54250485", "text": "prepareForCommit() {}", "title": "" }, { "docid": "c1a1e981b2d1dae5cdded2ff6ec056c5", "score": "0.54250485", "text": "prepareForCommit() {}", "title": "" }, { "docid": "9810b9dd9bdfb3bd3290257c288505de", "score": "0.5409012", "text": "Commit(CommitTemplateFlags, string) {\n\n }", "title": "" }, { "docid": "2c452aa1fa458f7e4d35463aaf1a9682", "score": "0.53666246", "text": "create(){}", "title": "" }, { "docid": "dbb5e108543d44dbb9cc9a8c47441c35", "score": "0.53490496", "text": "async createCommit(message, base_commit) {\n const owner = this.owner;\n const repo = this.repo;\n\n const tree = await this.github.gitdata.getTree({\n owner,\n repo,\n sha:base_commit.data.tree.sha,\n recursive: true\n });\n\n //mode: The file mode; one of\n //100644 for file (blob),\n //100755 for executable (blob),\n //040000 for subdirectory (tree),\n //160000 for submodule (commit), or\n //120000r a blob that specifies the path of a symlink\n const filesToAdd = this.fileBlobs.map(({sha, path}) => ({\n mode: '100644',\n type: 'blob',\n sha,\n path,\n }));\n this.fileBlob = [];\n\n const newTree = await this.github.gitdata.createTree({\n owner,\n repo,\n tree: filesToAdd,\n base_tree: tree.data.sha\n });\n\n return this.github.gitdata.createCommit({\n owner,\n repo,\n message,\n tree: newTree.data.sha,\n parents:[ base_commit.data.sha ]\n });\n }", "title": "" }, { "docid": "e7931d4e52a1f087a266bcff67849e00", "score": "0.5304215", "text": "static initialize(obj, commit, name, nodeId, tarballUrl, zipballUrl) { \n obj['commit'] = commit;\n obj['name'] = name;\n obj['node_id'] = nodeId;\n obj['tarball_url'] = tarballUrl;\n obj['zipball_url'] = zipballUrl;\n }", "title": "" }, { "docid": "d0881ea5761a5409743b8f55c37e94a3", "score": "0.5285454", "text": "static createInstance(assetData, now) {\n if (!assetData.monthlyForecast) {\n assetData.monthlyForecast = []\n }\n if (!assetData.creditHistory) {\n assetData.creditNoteHistory = []\n let creditNotePerdiod = {\n startDate: now,\n startQuantity: assetData.quantity,\n endDate: \"\",\n endQuantity: \"\",\n issued: false\n }\n assetData.creditNoteHistory.push(creditNotePerdiod)\n assetData.withdrawal = 0\n assetData.withdrawalHistory = []\n }\n return new Stock(assetData)\n }", "title": "" }, { "docid": "63e518f1d57602ed958521aac418b04f", "score": "0.5275181", "text": "function constructTransaction(e){\r\n\t//construct JSON message and return JSON\r\n\r\n\tvar template = {\r\n\t\tactor: actor,\r\n\t\ttransaction_id: transactionId,\r\n\t\tcontext: {\r\n\t\t\tclass_description: \"\",\r\n\t\t\tclass_instructor_name: \"\",\r\n\t\t\tclass_name: \"\",\r\n\t\t\tclass_period_name: \"\",\r\n\t\t\tclass_school: \"\",\r\n\t\t\tcontext_message_id: \"\",\r\n\t\t\tdataset_level_name1: \"\",\r\n\t\t\tdataset_level_name2: \"\",\r\n\t\t\tdataset_level_type1: \"\",\r\n\t\t\tdataset_level_type2: \"\",\r\n\t\t\tdataset_name: \"\",\r\n\t\t\tproblem_context: problemName,\r\n\t\t\tproblem_name: problemName,\r\n\t\t\tproblem_tutorFlag: \"\",\r\n\t\t\tstudy_condition_name1: \"\",\r\n\t\t\tstudy_condition_type1: \"\"\r\n\t \t},\r\n\t\tmeta: {\r\n\t\t\tdate_time: dateTime,\r\n\t\t\tsession_id: sessionId,\r\n\t\t\tuser_guid: studentId\r\n\t\t},\r\n\t\tsemantic_event: \"\",\r\n\t\ttool_data: {\r\n\t\t\tselection: selection,\r\n\t\t\taction: action,\r\n\t\t\tinput: input,\r\n\t\t\ttool_event_time: toolTime\r\n\t\t},\r\n\t\ttutor_data: {\r\n\t\t\tselection: tutorSelection,\r\n\t\t\taction: tutorAction,\r\n\t\t\tinput: input,\r\n\t\t\taction_evaluation: outcome,\r\n\t\t\tskills: [],\r\n\t\t\tstep_id: stepId,\r\n\t\t\ttutor_advice: \"\",\r\n\t\t\ttutor_event_time: tutorTime\r\n\t\t}\r\n\t}\r\n\r\n\treturn template\r\n}", "title": "" }, { "docid": "91ede26cf3949894d5981627c01117c4", "score": "0.5250292", "text": "static initialize(obj, author, committer, id, message, timestamp, treeId) { \n obj['author'] = author;\n obj['committer'] = committer;\n obj['id'] = id;\n obj['message'] = message;\n obj['timestamp'] = timestamp;\n obj['tree_id'] = treeId;\n }", "title": "" }, { "docid": "d572f6a9d9ac6a0bea233720e5b5243b", "score": "0.5199734", "text": "function makeCommitWith(a) {\n return STM.commit(makeWith(a));\n}", "title": "" }, { "docid": "f36192dd10d4cf8c2fa67a29b4d4b58d", "score": "0.51868695", "text": "function makeCommit(a) {\n return STM.commit(make(a));\n}", "title": "" }, { "docid": "47cd386cab52de92b223f1ba11e4b942", "score": "0.51866645", "text": "create()\n\t{ }", "title": "" }, { "docid": "f38dd65f8995be5ae96d62eade85f771", "score": "0.5152434", "text": "[_create] () {\n return this[_sobject]()\n .then(sobject => sobject.create(this.__changeset))\n // this lowercase id is not a mapping jsforce returns it lowercased for some reason\n .then(({ id }) => {\n this.id = id\n this.__changeset = {}\n return this\n })\n }", "title": "" }, { "docid": "bca03326f1a8d829e224d22139afe847", "score": "0.51502734", "text": "_newRevision(options){\n let pathId, path;\n if (options.path) {\n path = options.path;\n pathId = options.pathId;\n } else if (options.pathId){\n pathId = options.pathId;\n } else {\n pathId = this.pathId;\n path = this.path;\n }\n return new Revision({\n store : this.store,\n pathId : pathId,\n path : path,\n blob : options.blob || this.blob\n });\n }", "title": "" }, { "docid": "34de51942074a4041363b4e0aa568f09", "score": "0.5131392", "text": "createPlacementStatus( statusID, index, object ){\n\t\treturn {\n\t\t\tstatusID: statusID,\n\t\t\tindex: index,\t// Index within listOfEntities\n\t\t\tobject: object\t// actual object\n\t\t}\n\t}", "title": "" }, { "docid": "256c423a6508bec82101f97408a3bc04", "score": "0.5114811", "text": "createTransaction(data) {\n console.log('WHen new Transaction is created @ Time', new Date());\n return new Transaction(data, this);\n }", "title": "" }, { "docid": "c6caefc10a3b31e4c6686ce464e9be55", "score": "0.51112664", "text": "function Commit(predicate) {\n if(!(this instanceof Commit)) return new Commit(predicate);\n else Rule.call(this, function(sandbox) {\n sandbox.commit();\n }, predicate);\n }", "title": "" }, { "docid": "ebeb992eed637f7c65dcf7fecb3d2015", "score": "0.50955325", "text": "constructor(options)\n {\n this.options = options;\n this.commits = [];\n }", "title": "" }, { "docid": "9c9cffaf3db39fbbb0b7915ae3e07931", "score": "0.5093567", "text": "function FileCommitCommit() {\n _classCallCheck(this, FileCommitCommit);\n\n FileCommitCommit.initialize(this);\n }", "title": "" }, { "docid": "ef5e712aff10a822f742aef8fa584202", "score": "0.50613916", "text": "function transCommit(transObject) {\n return qrequest({\n 'headers': {'content-type': 'application/json'},\n 'method': 'POST',\n 'url': transObject.commitUrl\n });\n }", "title": "" }, { "docid": "f74b6b6405c27cef5c4ba2e8fd5216e6", "score": "0.50541013", "text": "static initialize(obj, transaction) { \n obj['transaction'] = transaction;\n }", "title": "" }, { "docid": "0669bc484a3562a1d943313cb4b6eb24", "score": "0.50446665", "text": "create() {\n\t}", "title": "" }, { "docid": "945aca481b72e82f1d6f7e9952840c45", "score": "0.5033669", "text": "function createObject(evento, ref, provento, desconto) {\n\n var obj = new Object();\n obj.evento = evento;\n obj.ref = ref;\n obj.provento = provento;\n obj.desconto = desconto;\n\n return obj;\n}", "title": "" }, { "docid": "2125278b820115d0b1c4757d23d4f6ef", "score": "0.50266564", "text": "function WorkOrderConstructor(owner, contracts, workOrderContract, jobPostContract, logger) {\n const JobPost = require('./job_post.js');\n return new Promise(async (resolve, reject) => {\n try {\n const jobPost = await JobPost.getInstance(owner, contracts, jobPostContract.address, logger);\n const workOrder = new WorkOrder(owner, contracts, workOrderContract, jobPost, logger);\n resolve(workOrder);\n } catch (err) {\n reject(err);\n }\n });\n}", "title": "" }, { "docid": "27cb801226b87debd489673dbd1f2559", "score": "0.5024645", "text": "function createProdotto(){}", "title": "" }, { "docid": "b69af4ae16497584efbdd514eb2694a3", "score": "0.49979734", "text": "create() {\n }", "title": "" }, { "docid": "dc0ee07d86e1b2128314f6f945a7bc79", "score": "0.49944195", "text": "createInstance() {}", "title": "" }, { "docid": "07f8227ffffa0befe5da522323c12ae0", "score": "0.49942338", "text": "function makeTransaction(raw) {\n\t var createdAt = new Date(raw.created_at);\n\n\t var transaction = {\n\t id: raw.id,\n\t amount: raw.amount,\n\t product: raw.product,\n\t productName: raw.product_name,\n\t createdAt: createdAt,\n\t createdAtMonth: createdAt.getMonth(),\n\t createdAtYear: createdAt.getFullYear()\n\t };\n\t return transaction;\n\t}", "title": "" }, { "docid": "01ad4c548a3a499cee7beaed41e0f725", "score": "0.49850178", "text": "studentFactory(studentName, studentEvent) {\n try{\n \n let eventDate = new Date(studentEvent.created_at);\n let today = new Date(Date.now())\n \n const studentObject = Object.create(null, {\n name: {\n value: studentName\n },\n githubHandle: {\n value: studentEvent.actor.login\n },\n avatar: {\n value: studentEvent.actor.avatar_url\n },\n eventType: {\n value: studentEvent.type\n },\n date: {\n value: parseInt((today - eventDate) / (1000 * 60 * 60 * 24))\n },\n repo: {\n value: studentEvent.repo.name.split(\"/\")[1]\n },\n message: {\n value: (studentEvent.type === \"ForkEvent\") ? \"-\" : `\"${studentEvent.payload.commits[studentEvent.payload.commits.length - 1].message}\"`\n },\n repoURL: {\n value: studentEvent.repo.url.split(\"repos/\")[1],\n },\n diffDays: {\n value: this.getDiffDays(eventDate),\n writable: true\n },\n color: {\n value: this.getStudentColor(this.getDiffDays(eventDate)),\n writable: true\n }\n });\n\n return studentObject;\n\n }catch(err){\n console.log(err);\n return {\n name: {\n \"name\": studentName.name,\n \"githubHandle\": studentName.githubHandle\n },\n githubHandle: studentName.githubHandle,\n avatar: \"../img/nopic.png\",\n date: 0\n };\n }\n }", "title": "" }, { "docid": "8552bdf2310029a7c08d18a077762033", "score": "0.49720567", "text": "function createPendingContribution () {\n var createUniqueContribution = createUniqueRecordFactory('Contribution', ['contribution_source']);\n var contact = cvApi('Contact', 'get', {\n nick_name: 'Backstop Contact A',\n sequential: true\n }).values[0];\n\n const pendingContributionData = {\n contact_id: contact.id,\n financial_type_id: \"4\",\n currency: 'USD',\n contribution_status_id: '2',\n payment_instrument_id: '4',\n non_deductible_amount: '0.00',\n total_amount: '0.00',\n fee_amount: '0.00',\n net_amount: '0.00',\n contribution_source: 'CS1',\n is_pay_later: '1',\n is_template: '0',\n civicrm_value_donor_information_3_id: '2',\n contribution_recur_status: 'Pending',\n payment_instrument: 'Check',\n contribution_status: 'Pending',\n instrument_id: '4'\n }\n\n var pendingContribution = createUniqueContribution(pendingContributionData);\n\n if (!pendingContribution.is_error) {\n console.log('Pending Contribution setup successful.');\n }\n}", "title": "" }, { "docid": "fe063004afa7401e931a86d51119f530", "score": "0.49463147", "text": "function creatingObjects (a,b,c,indevelopement){\n \n var newObject={description:'',programingLanguage:'',gitRepository:'',};\n newObject.description = a;\n newObject.programingLanguage = b;\n newObject.gitRepository = c;\n if (indevelopement===\"yes\") {\n newObject.developementStatus = \"Program is in developement\"\n } else newObject.developementStatus = \"Program is not in developement\"\n return console.log(newObject);\n}", "title": "" }, { "docid": "8e9a23b2a46fa151c9cead2f92740ef6", "score": "0.49372894", "text": "function contractCreate(contract, action, _ecb, _scb) {\n contract = contract.toJSON();\n //console.log('AAAA'+JSON.stringify(contract));\n //var _options = options('Contract ' + contractID + ' created!', user.email, tpl.contractCreate({\n // name: {\n // first: user.first_name,\n // last: user.last_name\n // },\n // contractID: contractID,\n // appHost: config.appHost\n //}));\n var _options = options('Contract ' + contract._id +' was '+ action +'!',contract.buyer.email, tpl.confirm({\n name: {\n first: contract.buyer.first_name,\n last: contract.buyer.last_name\n },\n message:'You successfully '+ action + ' contract ' + contract._id + ' .',\n link:'#/jobs/buyer/open',\n link_name:'Go to site',\n appHost: config.appHost\n }));\n _send(_options, _ecb, _scb);\n //console.log('AAAA'+JSON.stringify(contract));\n var freelancerMsg = action == ' created'?'You apply has been accepted!':'Contract with you has been updated.';\n _options = options('Contract ' + contract._id +' was '+ action +'!',contract.seller.email, tpl.confirm({\n name: {\n first: contract.seller.first_name,\n last: contract.seller.last_name\n },\n subMessage:freelancerMsg,\n message:action == ' created'?'Was '+ action +' contract '+ contract._id + '.':'',\n link:'/#/contract/approve/'+contract._id ,\n link_name:' Go to approve or reject',\n appHost: config.appHost\n }));\n _send(_options, '', '')\n}", "title": "" }, { "docid": "73ccd7149f82c236c8d251d3a0856fd4", "score": "0.4931048", "text": "static createInstance(id, estate, owner, tenant, price, startDate, endDate) {\n return new Lease({ id, estate, owner, tenant, price, startDate, endDate });\n }", "title": "" }, { "docid": "43c17bea092c9967191b3e909a310de6", "score": "0.49228033", "text": "createDevObject( { commit } ) {\n window.dev = {\n active: false,\n data: {},\n logs: [],\n addLog: function( msg ) {\n if( this.active ) {\n this.logs.unshift( msg );\n }\n },\n addData: function( collection, value ) {\n if( this.active ) {\n if( !this.data[ collection ] ) {\n this.data[ collection ] = [];\n }\n this.data[ collection ].unshift( value );\n }\n },\n clearAll: function() {\n this.data = {};\n this.logs = [];\n return \"All dev data and logs cleared\"\n },\n clearLogs: function() {\n this.logs = [];\n return \"All dev log messages cleared\"\n },\n clearData: function() {\n this.data = {};\n return \"All dev data cleared\"\n }\n };\n commit( \"setDevObject\", window.dev );\n }", "title": "" }, { "docid": "eb4975f5bc1da33b579ce21811f0f641", "score": "0.49128067", "text": "createFile(owner, repo, path, commit_message, content, branch, committer) {\n let data = {\n message: commit_message,\n content\n };\n if (branch) data.branch = branch;\n if (committer) data.committer = committer;\n return this.request(\"put\", \"/repos/\" + owner + \"/\" + repo + \"/contents\" + path, null, data)\n }", "title": "" }, { "docid": "42cf46f0ba007002ddcf6a1804299209", "score": "0.48823777", "text": "function newEmployee(firstName, lastName, empId, empTitle, annualSalary) {\n const employeeObj = {\n first_name: firstName,\n last_name: lastName,\n employee_id: empId,\n employee_title: empTitle,\n annual_salary: annualSalary\n }\n return employeeObj;\n}", "title": "" }, { "docid": "d42847eee986b179d4e7eca995dcf75e", "score": "0.4878929", "text": "toString() {\n\n\t\treturn `Commit: {chaincodeId: ${this.chaincodeId}, channel: ${this.channel.name}}`;\n\t}", "title": "" }, { "docid": "5f8b8dd11aef34cd752dd63f25119ac4", "score": "0.4871484", "text": "function createArticle(title, body, footer){\n let article = {\n title: title,\n body: body,\n footer: footer,\n comments: [],\n };\n return article;\n}", "title": "" }, { "docid": "1906f1ebfba5d1f62bbb9f52f00c24d3", "score": "0.4862148", "text": "deposit(amt){\n this.amt = parseInt(amt);\n if (amt <= 0){\n console.log (\"Please note, you need to deposit positive balance\")\n } \n if (amt > 0){\n let transaction = new Transaction(amt, this.owner)\n console.log (\"thank you\" + this.owner +\" for your deposit of: \" + this.amt)\n }\n//charges made against the account balance\n charge(payee, amt);{\n let amount = Math.abs(amt) * -1\n let transaction = new Transaction(amount, payee)\n this.transactions.push(transaction)\n }\n}", "title": "" }, { "docid": "06c26ab457aab4e965d7b4a227b58513", "score": "0.4858768", "text": "repo({ owner, repo, branch, commitPrefix } = {}) {\n return new Repo({ github: this, owner, repo, branch, commitPrefix })\n }", "title": "" }, { "docid": "43771cb7ec2ad2c8e8dec5bdefef0f30", "score": "0.48502836", "text": "static get newCargo() {\n return {\n name: '',\n quantity: 1\n };\n }", "title": "" }, { "docid": "482d9f16e04d518cfffe940a0dba24c1", "score": "0.4843554", "text": "get commit() {\n // I make it a getter so that\n // adding action with function signature\n // `function({ commit })` works (blatantly inspired by Vuex)\n let fn = (function commit(type, ...args) {\n _(this).mutations[type](...args);\n _(this).publish();\n }).bind(this);\n\n return fn;\n }", "title": "" }, { "docid": "ed4d7a445b5e01afa30660b5f1ad66b3", "score": "0.48400623", "text": "function create(obj) {\n function Create() {}\n Create.prototype = obj;\n return new Create();\n}", "title": "" }, { "docid": "aa3a1c9bc6f55907975f3031614e08d8", "score": "0.48388034", "text": "Create() {\n\n }", "title": "" }, { "docid": "a9264f9df9ff1bae98387c7cbd07b641", "score": "0.48385617", "text": "createProposal(datum) {\n // Only include cost if account is proposal creator who pays (not receiver who gets funds)\n if (datum[1].op[1].creator === this.address) {\n this.claimed[this.currencies.stable] = -10;\n }\n }", "title": "" }, { "docid": "08e93676cb0c55fe9ea641fcca60fcda", "score": "0.4830838", "text": "message() {\n return GitCommit.justMessage(this._commit)\n }", "title": "" }, { "docid": "add07f08ae31666d32a6eaacb369be0c", "score": "0.4807412", "text": "subscribe(commitment) {\n if (this._sub !== null) {\n return this._sub.ee;\n }\n const ee = new EventEmitter();\n const listener = this.provider.connection.onAccountChange(this.address(), (acc) => {\n const account = this.coder.state.decode(acc.data);\n ee.emit(\"change\", account);\n }, commitment);\n this._sub = {\n ee,\n listener,\n };\n return ee;\n }", "title": "" }, { "docid": "7c64b48207ffc4c8875a07450cf1e037", "score": "0.4807122", "text": "function DoorFactory() {}", "title": "" }, { "docid": "5151d8407748660bc2f0258ab65ff337", "score": "0.47878593", "text": "createAnnouncementType(requestObj) {\n return this.__createAnnouncementType()(requestObj)\n }", "title": "" }, { "docid": "2ef04068e537ac39c5a03b67696dec2b", "score": "0.47822636", "text": "async _defineAcknoledgeTokenTransaction(lenderAccount) {\n // Find Network Mosaic ID\n if (this.networkMosaicId == undefined) {\n const recipientAddress = Address.createFromRawAddress(lenderAccount.address.address);\n this.networkMosaicId = await this._getNetworkMosaicId(recipientAddress);\n }\n\n return TransferTransaction.create(\n Deadline.create(),\n lenderAccount.address,\n [new Mosaic (this.networkMosaicId,\n UInt64.fromUint(1))],\n PlainMessage.create(`send acknoledge token to lender`),\n this.networkType);\n }", "title": "" }, { "docid": "42b7862d1e97dac4146021f4d32ff859", "score": "0.47788355", "text": "static create_event_entity_above(){}", "title": "" }, { "docid": "5b6b240191bfcd84357a17df48611c62", "score": "0.4777389", "text": "static initialize(obj, uuid, name, portfolioType, created, balance, performance, depositReference) { \n obj['uuid'] = uuid;\n obj['name'] = name;\n obj['portfolio_type'] = portfolioType;\n obj['created'] = created;\n obj['balance'] = balance;\n obj['performance'] = performance;\n obj['deposit_reference'] = depositReference;\n }", "title": "" }, { "docid": "c60cb086f5f2d22d864ef0e16f515f77", "score": "0.47750506", "text": "async createObject({id, data, creator, members, allowOverwrite, overrideTimestamp, sensitivity, objectPermission, credentials}) {\n credentials = credentials || this.credentials \n allowOverwrite = allowOverwrite || false\n \n id = id || this.seriesKey\n let dbobject = new this.Subclass({\n id: id,\n dynamoClient: this.dynamoClient,\n s3Client: this.s3Client,\n tableName: this.tableName,\n isTimeOrdered: this.isTimeOrdered,\n overrideTimestamp: overrideTimestamp\n })\n await dbobject.create({\n data, \n creator, \n members, \n allowOverwrite, \n sensitivity, \n objectPermission,\n credentials\n })\n return dbobject\n }", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.4772632", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.4772632", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.4772632", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" }, { "docid": "9fd82af04049fb872adbedbb07739fd3", "score": "0.47724435", "text": "static initialize(obj, creatorId, editorId) { \n obj['creatorId'] = creatorId;\n obj['editorId'] = editorId;\n }", "title": "" }, { "docid": "4e932c803543587a03e9c7df32835bfb", "score": "0.47623244", "text": "function factory() {\n\n /**\n * caches the contract instances by its string representation.\n * @type {{}}\n */\n var contractCache = {};\n\n /**\n * Returns a cached Contract or create a new one for the contractString.\n *\n * @param contractString the string represetation of the contract.\n * @return { Contract } the cached contract instance if it exists or a new one.\n */\n function getContract(contractString) {\n var contract = contractCache[contractString];\n if (!_(contract).isUndefined()) {\n return contract;\n }\n\n var baseContract = parse(contractString);\n contract = new Contract(baseContract, contractString);\n contractCache[contractString] = contract;\n return contract;\n }\n\n\n /**\n * Checks the argument list against the contract.\n * @param argList\n * @param contractString\n */\n function checkArgs(argList, contractString) {\n try {\n var contract = getContract(contractString);\n contract.checkArgs(_.toArray(argList));\n var expressions = _(arguments).toArray().slice(2, arguments.length);\n _(expressions).each(function(expression){\n if(!evalArgListExpression.apply(expression, argList)){\n throw {name: 'ContractViolation', code: 'EXPRESSION_ARGS', expression: expression};\n }\n });\n\n } catch (e) {\n if (e.name === 'ContractError' || e.name === 'ContractViolation') {\n // find a better way to create a stacktrace\n e = createError(e, contractString, argList);\n }\n throw e;\n }\n }\n\n // make cache accessable for the test cases.\n checkArgs._cache = contractCache;\n return checkArgs\n\n }", "title": "" }, { "docid": "c9b729e22fbd63e2669748278bb330e3", "score": "0.47613698", "text": "commit () {\n this.fs.publish('STATE', JSON.stringify(this.state, null, ' '));\n\n try {\n const changes = monitor.generate(this.observer);\n\n if (changes.length) {\n this.emit('changes', changes);\n\n const PACKET_CONTRACT_MESSAGE = Message.fromVector(['CONTRACT_MESSAGE', {\n type: 'CONTRACT_MESSAGE',\n object: {\n contract: this.contract.id,\n ops: changes\n }\n }]).toBuffer();\n\n this.node.broadcast(PACKET_CONTRACT_MESSAGE);\n }\n\n } catch (exception) {\n console.trace(`Unable to get changes: ${exception}`);\n }\n\n return this;\n }", "title": "" }, { "docid": "9ed0dee31369eefb240c594e931beb03", "score": "0.47583207", "text": "create(opts) {\n let dateCreated = opts.dateCreated instanceof Date ? opts.dateCreated : new Date(opts.dateCreated.replace((/\\//g, '-')));\n let course = new Course(this.nextId, opts.name, opts.category, dateCreated, opts.description);\n this.courses[this.nextId] = course;\n this.nextId += 1;\n this.triggerHandlers();\n return course;\n }", "title": "" }, { "docid": "2107ec832ea17719c62dfd9b4e7f9fc4", "score": "0.47575825", "text": "function create(config) {\n var obj = Object.create(entity);\n\n config = ( typeof config === 'object' ) ? config : null ;\n\n if ( config !== null ) {\n obj.initEntity(config);\n }\n\n return obj;\n }", "title": "" }, { "docid": "e1799d7faaf47623bedcec52cc5954b6", "score": "0.4750305", "text": "function newTransaction(currency, amount, type) {\n transaction.counter++;\n transaction.currency = currency;\n transaction.amount = amount;\n transaction.type = type;\n transactionsArray.push(transaction);\n}", "title": "" }, { "docid": "e6f1e5d3b80be043f4dac294dc8676ba", "score": "0.47466284", "text": "function create_person(vorname, nachname, alter) {\n return {\n vorname: vorname,\n nachname: nachname,\n alter: alter\n };\n}", "title": "" }, { "docid": "d00825cec89abd7c490e306ae1fc9762", "score": "0.47451556", "text": "undefined ({ commit }, n) {\n commit(TEST, n)\n }", "title": "" }, { "docid": "c84e69e470f9ff6b65eb62f840a36afa", "score": "0.4743991", "text": "function create () {\n\t\t\t// Create new Comprobante object\n\t\t\tvar comprobante = new comprobantes ({\n\t\t\t\tname: this.name,\n\t\t\t\tletra: this.letra,\n\t\t\t\tpuntoDeVenta: this.puntoDeVenta,\n\t\t\t\tmodoFacturacion: this.modo,\n\t\t\t\tmovimientoStock: this.movimientoStock,\n\t\t\t\tmovimientoCC: this.movimientoCC,\n\t\t\t\tmovimientoOperacionInversa: this.movimientoOperacionInversa,\n\t\t\t\tfuncionalidadSituacion: this.funcionalidadSituacion,\n\t\t\t\tautoAprobar: this.autoAprobar,\n\t\t\t\tenterprise: this.enterprise ? this.enterprise._id : this.user.enterprise._id,\n\t\t\t});\n\n\t\t\t// Redirect after save\n\t\t\tcomprobante.$save(function(response) {\n\t\t\t\tif(response._id) {\n\t\t\t\t\t// agregar sub al array\n\t\t\t\t\t$state.go('home.comprobantes');\n\n\t\t\t\t}\n\t\t\t}, function(errorResponse) {\n\t\t\t\tthis.error = errorResponse.data.message;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "783615cd56fa0c20f8fe660bfbc6650c", "score": "0.474383", "text": "commit() {\n let self = this;\n return Rfc.new({ project: this })\n .notify(req => {\n self.emit(Events.project.commitRequest, req);\n self.emit(Events.requestForChange, req);\n })\n .fulfill(req => true)\n .queue();\n }", "title": "" }, { "docid": "c604a7e5ea36bf29a710c793153d772d", "score": "0.47394955", "text": "function Projector(company,size,price,warrenty)\n{\n this.company = company//this variable refers to current working object\n this.size=size;\n this.price=price;\n this.warrenty=warrenty;\n}", "title": "" }, { "docid": "3ddf89c73e316564179ec32fd455dfaf", "score": "0.47387028", "text": "'git.getCommit'(settings, fallback) {\n return fallback()\n }", "title": "" }, { "docid": "789e101bca1f079762150897a28763a6", "score": "0.47361347", "text": "createTransaction(recipient, amount, blockchain, transactionPool) {\n this.balance = this.calculateBalance(blockchain);\n // check if the amount is not greater than the balance available\n if (amount > this.balance) {\n console.log(\n `Amount ${amount} exceeds the current balance ${\n this.balance\n } in the wallet.`\n );\n return;\n }\n\n // check if the trasaction already exists\n let transaction = transactionPool.existingTransaction(this.publicKey);\n\n // if yes\n if (transaction) {\n // update the transaction\n transaction.update(this, recipient, amount);\n } else {\n // if no\n // create the new transaction\n transaction = Transaction.newTransaction(this, recipient, amount);\n // add it to the mempool\n transactionPool.updateOrAddTransaction(transaction);\n }\n\n return transaction;\n }", "title": "" }, { "docid": "659c47a4d0bfab3844eb7a20edb0d052", "score": "0.47357216", "text": "constructor(creator, name) {\n this.ID = generateId();\n this.name = name;\n this.creator = creator;\n this.opportals = Array();\n this.anchors = Array();\n this.links = Array();\n this.markers = Array();\n this.color = DEFAULT_OPERATION_COLOR;\n this.comment = null;\n this.teamlist = Array();\n this.fetched = null;\n this.stored = null;\n this.localchanged = true;\n this.blockers = Array();\n this.keysonhand = Array();\n }", "title": "" }, { "docid": "b8f833d0726deee32f979386839d3435", "score": "0.47281393", "text": "constructor(owner, currency, pin) {\n this.owner = owner;\n this.currency = currency;\n // this is a protected property below\n // this._pin = pin;\n this.#pin = pin; // now this is a private field\n // this._movements = [];\n // we want to protect the movements array so we put a _ in front of it\n\n // this.locale = navigator.language;\n // console.log(`Thanks for opening a new account, ${this.owner}!`);\n }", "title": "" }, { "docid": "11c8133d54b0655b2e0695b9bb6b3664", "score": "0.47230574", "text": "async createSubmission({ commit }, { identifier, identifierType }) {\n try {\n const response = await API.service.post(SUBMISSION_ENDPOINT + \"/\", {\n identifier: identifier,\n id_type: identifierType\n });\n commit(MUTATIONS.SET_SUBMISSION, response.data);\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "181c62601bd064441d5a3aa65ce43d63", "score": "0.4715593", "text": "function createTeamObj(id, name = \"New Team\", points = 0){\n var teamObj = {}\n teamObj.id = id\n teamObj.name = name.substring(0, 24)\n teamObj.points = points\n\n // Return the object\n return teamObj\n }", "title": "" }, { "docid": "b38547b9176a8cb462bc99b0b2db0f02", "score": "0.47091988", "text": "function creating2(primKey, obj, transaction) {\n var op = {\n op: \"create\",\n key: primKey,\n value: Dexie.deepClone(obj)\n };\n opLog2.push(op);\n if (watchSuccess) {\n this.onsuccess = function (primKey) {\n return successLog2.push(primKey);\n };\n }\n if (watchError) {\n this.onerror = function (e) {\n return errorLog2.push(e);\n };\n }\n if (deliverKeys2[opLog2.length - 1]) return deliverKeys2[opLog2.length - 1];\n }", "title": "" }, { "docid": "fd2bcfb2bab2619f484688bb1ea95e67", "score": "0.4704762", "text": "function _createTodo(txt, imp = '1') {\n return {\n id: makeId(),\n txt: txt,\n isDone: false,\n importance: imp,\n createdAt: getTimeStamp()\n };\n}", "title": "" }, { "docid": "a45bc736b0656e425fd653b5a6ca7df4", "score": "0.47022742", "text": "createTransaction(recipient, amount, blockchain, transactionPool) {\n // first we recalculate user's balance\n this.balance = this.calculateBalance(blockchain);\n\n // invalid transaction\n if (amount > this.balance) {\n console.log(`Amount: ${amount} exceeds the current balance ${this.balance}.`);\n return;\n }\n\n // check for an existing transaction from our address in the transaction pool\n let transaction = transactionPool.existingTransaction(this.publicKey);\n\n if (transaction) {\n transaction.update(this, recipient, amount);\n } else {\n transaction = Transaction.newTransaction(this, recipient, amount);\n transactionPool.updateOrAddTransaction(transaction);\n }\n\n return transaction;\n }", "title": "" }, { "docid": "94aff032365a5ce0313c1ce37f65d3f1", "score": "0.46984035", "text": "static async create() {\n const genesis = new Block_1.default({ data: 'Genesis Block' });\n const blockChain = new Blockchain();\n await blockChain._addBlock(genesis);\n return blockChain;\n }", "title": "" }, { "docid": "651232789c019e4ecac01f0642e531d3", "score": "0.46943787", "text": "function buildTransactionProposal(chaincodeProposal, endorsements, proposalResponse) {\n\n\tconst header = _commonProto.Header.decode(chaincodeProposal.getHeader());\n\n\tconst chaincodeEndorsedAction = new _transProto.ChaincodeEndorsedAction();\n\tchaincodeEndorsedAction.setProposalResponsePayload(proposalResponse.payload);\n\tchaincodeEndorsedAction.setEndorsements(endorsements);\n\n\tconst chaincodeActionPayload = new _transProto.ChaincodeActionPayload();\n\tchaincodeActionPayload.setAction(chaincodeEndorsedAction);\n\n\t// the TransientMap field inside the original proposal payload is only meant for the\n\t// endorsers to use from inside the chaincode. This must be taken out before sending\n\t// to the orderer, otherwise the transaction will be rejected by the validators when\n\t// it compares the proposal hash calculated by the endorsers and returned in the\n\t// proposal response, which was calculated without the TransientMap\n\tconst originalChaincodeProposalPayload = _proposalProto.ChaincodeProposalPayload.decode(chaincodeProposal.payload);\n\tconst chaincodeProposalPayloadNoTrans = new _proposalProto.ChaincodeProposalPayload();\n\tchaincodeProposalPayloadNoTrans.setInput(originalChaincodeProposalPayload.input); // only set the input field, skipping the TransientMap\n\tchaincodeActionPayload.setChaincodeProposalPayload(chaincodeProposalPayloadNoTrans.toBuffer());\n\n\tconst transactionAction = new _transProto.TransactionAction();\n\ttransactionAction.setHeader(header.getSignatureHeader());\n\ttransactionAction.setPayload(chaincodeActionPayload.toBuffer());\n\n\tconst actions = [];\n\tactions.push(transactionAction);\n\n\tconst transaction = new _transProto.Transaction();\n\ttransaction.setActions(actions);\n\n\n\tconst payload = new _commonProto.Payload();\n\tpayload.setHeader(header);\n\tpayload.setData(transaction.toBuffer());\n\n\treturn payload;\n}", "title": "" }, { "docid": "8e0ec178968fddd0cad1e9127905f9f5", "score": "0.46935052", "text": "constructor(gitObj) {\n this.image = gitObj.avatar_url;\n this.title = gitObj.login;\n this.build();\n // this targets the object then builds\n }", "title": "" }, { "docid": "b7118740b1ce9e4dc9be693109504a86", "score": "0.46856552", "text": "constructor(email, amount, tenor, balance = 0, interest = 0.05,\n createdOn = new Date(), status = 'pending', repaid = false) {\n this.email = email;\n this.amount = amount;\n this.tenor = tenor;\n this.interest = interest;\n this.balance = balance;\n this.createdOn = createdOn;\n this.status = status;\n this.repaid = repaid;\n this._id = Loan.counter;\n }", "title": "" }, { "docid": "4e2a5967908b37ecd36c07c25007d832", "score": "0.46848622", "text": "function transaction(type, amount, date) {\n this.type = type; // deposit or withdrawal - string\n this.amount = amount; //string\n this.amountDisplay = (type === \"deposit\") ? amount : \"(\" + amount + \")\"; // display (amount) for withdrawal\n this.dateDisplay = date;//date is already validated and converted to format to be displayed\n\n}", "title": "" }, { "docid": "0dc0c835a8272dbb538c3ade77efd5a5", "score": "0.46824875", "text": "function createToDoItem(newTitle, newDescription, newDate) {\r\n\r\n var todoItem = {\r\n title:newTitle, \r\n description:newDescription, \r\n dueDate:newDate};\r\n\r\n return todoItem;\r\n}", "title": "" }, { "docid": "948a5bf961c411762a428b277cd85c87", "score": "0.46812162", "text": "static initialize(obj, creationHeight, completionTime, initialBalance, sharesDst, balance) { \n obj['creation_height'] = creationHeight;\n obj['completion_time'] = completionTime;\n obj['initial_balance'] = initialBalance;\n obj['shares_dst'] = sharesDst;\n obj['balance'] = balance;\n }", "title": "" }, { "docid": "3d3dc3614dd50e9d9091ae14fd80734e", "score": "0.46810517", "text": "function Contract(){if(this instanceof Contract){instantiate(this,arguments[0]);}else{var C=mutate(Contract);var network_id=arguments.length>0?arguments[0]:\"default\";C.setNetwork(network_id);return C;}}", "title": "" }, { "docid": "db23e96082d243600c79d91fdc1fd7af", "score": "0.4679339", "text": "static createInstance(orderID, type,\n productID, name, weight, price, \n specs, qualifiedOperator, methods, leadTime, \n address, shipMethod, tradeTerm, dispatchDate, \n totalAmount, initPayment, payMethod, \n createdTime, orderer, receiver) \n {\n\n let productObj = {productID, name, weight, price};\n let assuranceObj = {specs, qualifiedOperator, methods, leadTime};\n let shippingObj = {orderer, address, shipMethod, tradeTerm, dispatchDate};\n let paymentObj = {totalAmount, initPayment, payMethod};\n \n if(type == Type.STANDARD) {\n\n console.log('Run type of STANDARD to new Order.');\n return new Order({ orderID, type, productObj, assuranceObj, shippingObj, paymentObj, createdTime, orderer, receiver }, 'New');\n } else if(type == Type.CUSTOMIZED) {\n\n console.log('Run type of CUSTOMIZED to new Order.');\n return new Order({ orderID, type, productObj, assuranceObj, shippingObj, paymentObj, createdTime, orderer, receiver }, 'New');\n }\n }", "title": "" }, { "docid": "c849ef6452f6176aef822b4075c09d5d", "score": "0.46784028", "text": "constructor(cementHelper, logger, configuration) {\n this.cementHelper = cementHelper;\n this.logger = logger;\n this.configuration = configuration;\n }", "title": "" }, { "docid": "fc0f5308b5c2249dbac119e8a5e2b020", "score": "0.46779746", "text": "function createIssue(owner,repo)\n{\n\tvar options = {\n\t\turl: urlRoot +'/repos/'+ owner+'/'+repo+'/issues',\n\t\tmethod: 'POST',\n\t\tbody: {title:'ProblemStatement',body:'Creating an Issue part fot Github'},\n\t\tjson:true,\n\t\theaders: {\n\t\t\t\"User-Agent\": \"EnableIssues\",\n\t\t\t\"content-type\": \"application/json\",\n\t\t\t\"Authorization\": token\n\t\t}\n\t\t};\n\t\t// Send a http request to url and specify a callback that will be called upon its return.\n\trequest(options, function (error,response,body) \n\t{\n\t\t console.log(body);\n\t\t console.log(\"Details about the parameters :\");\n console.log(\"title\"+body.title);\n console.log(\"body\"+body.body);\n\t});\n\n}", "title": "" }, { "docid": "f38c6b6a8ae562cb0656d4ba21e0e0a4", "score": "0.46730086", "text": "function newEject(userId,posX,posY,hue,launchAngle,launchSpeed){\n\treturn {\n\t\tuserId: userId,\n\t\tposX: posX,\n\t\tposY: posY,\n\t\thue: hue,\n\t\tlaunchAngle: launchAngle,\n\t\tlaunchSpeed: launchSpeed\n\t}\n}", "title": "" }, { "docid": "79e362b6d77cdca97d08bb17729a8841", "score": "0.46727565", "text": "connect(signerOrProvider) {\n if (typeof signerOrProvider === \"string\") {\n signerOrProvider = new _abstractSigner.VoidSigner(signerOrProvider, this.provider);\n }\n\n const contract = new this.constructor(this.address, this.interface, signerOrProvider);\n\n if (this.deployTransaction) {\n (0, _properties.defineReadOnly)(contract, \"deployTransaction\", this.deployTransaction);\n }\n\n return contract;\n }", "title": "" }, { "docid": "4e8d00bc437d45ba5b6d4db8dd30a108", "score": "0.46703067", "text": "getCommitter() {\n return this.committer;\n }", "title": "" }, { "docid": "6e20eb7bcea32f1362beb2e50ed674c7", "score": "0.46697912", "text": "function createAccount(){\n// define a starting balance\nlet balance = 0;\n// return a module with methods to deposit, withdraw, and check balance\nreturn {\n deposit(amount){\n return balance += amount;\n },\n withdraw(amount){\n return balance -= amount;\n },\n checkBalance(){\n return 'Account has a balance of ' + balance;\n }\n}\n}", "title": "" }, { "docid": "01f04a09741e471e2e80b2ebe0ff406b", "score": "0.46623215", "text": "function create(c) {\n return new c();\n }", "title": "" }, { "docid": "80446303c407a5587daa39677d916d7b", "score": "0.46623093", "text": "function Repo()\n{\n this.repoData = {};\n this.repoArgs = {};\n return this;\n}", "title": "" }, { "docid": "f4c65ba9bf062820f13eb5390958f60a", "score": "0.46549985", "text": "async function shipmentCreated(transaction, shipment) {\n throw new Error(\"NotImplementedError\");\n // STEP 1: Validation\n // STEP 2: Create the data that the order's API expects\n // STEP 3: Call the order's API\n // Step 4: Create the output data that ShipEngine expects\n}", "title": "" } ]
cb528f24d1c2279e0565276ba85c67ea
this will return the details of the object into HTML drawdetails(deets)
[ { "docid": "c5f1de6e7feb4a1c7271ded41afebe73", "score": "0.6918392", "text": "drawdetails(deets) {\n let detailsTemplate = `\n <div class=\"pokedeets d-flex justify-content-center col-12\">\n <img src=\"${deets.sprites.front_default}\"/>\n `\n document.getElementById(\"stat\").innerHTML = detailsTemplate\n }", "title": "" } ]
[ { "docid": "00970c7d8cad11fb7f823fc93dd1f8ff", "score": "0.70966786", "text": "function drawDetails(j) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Draw details\n\t\t\tlet s;\n\t\t\tvar shivaNode=$.parseJSON(j.shivanode_json.und[0].value);\t\t\t\t\t\t\t// Get shiva data\n\t\t\tvar wid=shivaNode.width ? shivaNode.width+\"px\" : \"100%\";\t\t\t\t\t\t\t// If width set use it \n\t\t\tvar hgt=shivaNode.height ? shivaNode.height+\"px\" : \"calc(100% - 155px)\";\t\t\t// Height \n\t\t\tvar src=shivaNode.dataSourceUrl ? shivaNode.dataSourceUrl : \"\";\t\t\t\t\t\t// Data source\n\t\t\tvar str=`<iframe id='sui-iframe' frameborder='0' scrolling='no' src='${url}' \n\t\t\tstyle='margin-left:auto;margin-right:auto;height:${hgt};width:${wid};display:block;overflow:hidden'></Iframe><br>`;\t\n\t\t\tstr+=\"<div class='sui-sources' style='padding-top:0'>\";\n\t\t\ttry{ if (o.collection_title)\ts=`<a title='Collection' id='sui-imgCol'\thref='#p=${o.collection_uid_s}'>${o.collection_title}</a>`;\n\t\t\telse\t\t\t\t\t\t\ts=\"None\"; } catch(e) {}\n\t\t\tstr+=\"<div style='text-align:center'>\"+d(\"&#xe633\",\"MANDALA COLLECTION\",s)+\"</div>\";\n\t\t\tstr+=\"<hr style='border-top: 1px solid #6e9456;margin-top:12px'>\";\n\t\t\ttry{ str+=d(\"&#xe63b\",\"TITLE\",o.title[0],\"Untitled\"); } catch(e){}\n\t\t\ttry{ str+=d(\"&#xe65f\",\"TYPE\",o.asset_subtype.replace(/:/g,\" | \")) } catch(e){}\n\t\t\ttry{ str+=d(\"&#xe60c\",\"DATE\",o.node_created.substr(0,10)) } catch(e){}\n\t\t\ttry{ str+=\"&#xe600&nbsp;&nbsp;<span class='sui-pageLab'>CREATOR</span>:&nbsp;&nbsp;<span class='sui-pageVal'>\";\n\t\t\t\tstr+=(o.node_user_full) ? o.node_user_full+\"&nbsp;&nbsp\" : \"\" +\"\";\n\t\t\t\tstr+=(o.node_user) ? o.node_user : \"\"; str+=\"</span>\"; } catch(e) {}\n\t\t\t\tif (j.field_kmaps_subjects && j.field_kmaps_subjects.und) {\t\t\t\t\t\t\t// If subjects\n\t\t\t\t\tstr+=\"<p class='sui-pageLab'>SUBJECTS:&nbsp;&nbsp;\";\t\t\t\t\t\t\t// Add header\n\t\t\t\t\tfor (i=0;i<j.field_kmaps_subjects.und.length;++i) {\t\t\t\t\t\t\t\t// For each item\n\t\t\t\t\t\tstr+=j.field_kmaps_subjects.und[i].header;\t\t\t\t\t\t\t\t\t// Add name\n\t\t\t\t\t\tstr+=sui.pages.AddPop(j.field_kmaps_subjects.und[i].domain+\"-\"+j.field_kmaps_subjects.und[i].id);\t// Add drop\n\t\t\t\t\t\tif (i < j.field_kmaps_subjects.und.length-1)\tstr+=\", \";\t\t\t\t\t// Add separator\n\t\t\t\t\t\t}\n\t\t\t\t\tstr+=\"</p>\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// End TERMS\n\t\t\t\t\t}\n\t\t\t\tif (j.field_kmaps_places && j.field_kmaps_places.und) {\t\t\t\t\t\t\t\t// If places\n\t\t\t\t\tstr+=\"<p class='sui-pageLab'>TERMS:&nbsp;&nbsp;\";\t\t\t\t\t\t\t\t// Add header\n\t\t\t\t\tfor (i=0;i<j.field_kmaps_places.und.length;++i) {\t\t\t\t\t\t\t\t// For each item\n\t\t\t\t\t\tstr+=j.field_kmaps_places.und[i].header;\t\t\t\t\t\t\t\t\t// Add name\n\t\t\t\t\t\tstr+=sui.pages.AddPop(j.field_kmaps_places.und[i].domain+\"-\"+j.field_kmaps_places.und[i].id);\t// Add drop\n\t\t\t\t\t\tif (i < j.field_kmaps_places.und.length-1)\tstr+=\", \";\t\t\t\t\t\t// Add separator\n\t\t\t\t\t\t}\n\t\t\t\t\tstr+=\"</p>\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// End PLACES\n\t\t\t\t\t}\n\t\t\t\tif (j.field_kmap_terms && j.field_kmap_terms.und) {\t\t\t\t\t\t\t\t\t// If terms\n\t\t\t\t\tstr+=\"<p class='sui-pageLab'>TERMS:&nbsp;&nbsp;\";\t\t\t\t\t\t\t\t// Add TERMS header\n\t\t\t\t\tfor (i=0;i<j.field_kmap_terms.und.length;++i) {\t\t\t\t\t\t\t\t\t// For each item\n\t\t\t\t\t\tstr+=j.field_kmap_terms.und[i].header;\t\t\t\t\t\t\t\t\t\t// Add name\n\t\t\t\t\t\tstr+=sui.pages.AddPop(j.field_kmap_terms.und[i].domain+\"-\"+j.field_kmap_terms.und[i].id);\t// Add drop\n\t\t\t\t\t\tif (i < j.field_kmap_terms.und.length-1)\tstr+=\", \";\t\t\t\t\t\t// Add separator\n\t\t\t\t\t\t}\n\t\t\t\t\tstr+=\"</p>\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// End TERMS\n\t\t\t\t\t}\t\t\n\t\t\tif (src) \t\tstr+=\"<p>&#xe678&nbsp;&nbsp;<a target='_blank' href='\"+src+\"'>External spreadsheet</a></p>\"; \n\t\t\tif (o.caption)\tstr+=o.caption;\t\t\n\t\n\t\t\tvar urlw=`[iframe src=\"${url}\" width=\"${wid}\" height=\"${hgt}\"]`;\t\t\t\t\t// Wordpress embed code\n\t\t\tvar urli=`&lt;iframe src=\\\"${url}\\\" width=\\\"${wid}\\\" height=\\\"${hgt}\\\"&gt;`;\t\t// Iframe\n\t\t\tstr+=`<hr>&#xe600&nbsp;&nbsp;<span class='sui-pageLab'>SHARE AS</span>:&nbsp;&nbsp;\n\t\t\t\t<a id='sui-share-1' style='display:inline-block;cursor:pointer'>Link&nbsp;&nbsp;&nbsp;</a>\n\t\t\t\t<a id='sui-share-2' style='display:inline-block;cursor:pointer'>WordPress&nbsp;&nbsp;&nbsp;</a>\n\t\t\t\t<a id='sui-share-3' style='display:inline-block;cursor:pointer'>Iframe&nbsp;&nbsp;&nbsp;</a>\n\t\t\t\t<p id='sui-resShare' style='border-radius:4px;background-color:#fff;padding:8px;display:none;border:1px solid #ccc'></p>\n\t\t\t\t</div>`;\n\n\t\t\t$(\"#sui-resShare\").html(\"<b>LINK</b>: ${url}\"); $(\"#sui-resShare\").toggle();\n\t\t\t$(sui.pages.div).html(str.replace(/\\t|\\n|\\r/g,\"\"));\t\t\t\t\t\t\t\t\t// Remove format and add to div\t\n\t\t\tsui.pages.DrawRelatedAssets(o);\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Draw related assets menu if active\n\t\t\n\t\t\t$(\"[id^=sui-share-]\").on(\"click\",(e)=> {\t\t\t\t\t\t\t\t\t\t\t// ON THUMBNAIL CLICK\n\t\t\t\tvar id=e.currentTarget.id.split(\"-\")[2];\t\t\t\t\t\t\t\t\t\t// Get id\n\t\t\t\tif (id == \"1\")\t\t$(\"#sui-resShare\").html(url);\t\t\t\t\t\t\t\t// Link\n\t\t\t\telse if (id == \"2\")\t$(\"#sui-resShare\").html(`[iframe src=\"${url}\" width=\"${wid}\" height=\"${hgt}\"]`);\t\t// Wordpress embed code\n\t\t\t\telse if (id == \"3\")\t$(\"#sui-resShare\").html(`&lt;iframe src=\"${url}\" width=\"${wid}\" height=\"${hgt}\"&gt;`);\t// Iframe\n\t\t\t\t$(\"#sui-resShare\").show();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Toggle state\t\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "67636dadd10230b49de0998d161651ed", "score": "0.68808365", "text": "generateDetailView() {\n var html = \"<div class='details-view'><div class='tag-panel'>\";\n var d = dimensions.find(x => x.id == this.dim);\n html += \"<div class='tag tag-attribute'>attribute</div><div class='tag tag-dimension'>\" + d.toString() + \"</div>\";\n html += \"</div><span class='headline'>\" + this.title + \"</span>\";\n if (this.desc != null && typeof (this.desc) != \"undefined\") {\n html += \"<span class='desc'>\" + this.desc + \"</span>\";\n }\n html += \"<span class='source'><i class='material-icons icon'>import_contacts</i>\" + this.source + \"</span><span class='approaches'><i class='material-icons icon'>list_alt</i>the property is used in the following evaluation approaches:</span>\";\n var a = approaches.filter(x => x.attributes.includes(this.id));\n for (var index in a) {\n html += \"<span class='approach-suggestion approach-invoker' data-approach='\" + a[index].id + \"'>- \" + a[index].toString() + \"</span>\";\n }\n html += \"</div>\";\n return html;\n }", "title": "" }, { "docid": "f994f312d5b1c47c7dda068b24a7b54d", "score": "0.68062335", "text": "get details(){\n return \"Title: \" + this.title + \"<br> Author: \" + this.author + \"<br> Location: \" + this.location + \"<br> Year: \" + this.year + \"<br> Description: \" + this.description +\"<br>\";\n }", "title": "" }, { "docid": "b6fe56aeb89520c4d43218c5873bf418", "score": "0.6749653", "text": "generateDetailView() {\n var id = generateId();\n var html = \"<div id='\" + id + \"' class='details-view'><div class='tag-panel'>\";\n html += \"<div class='tag tag-approach'>approach</div><div class='tag tag-attribute'>\" + this.attributes.length + \" attributes</div>\";\n html += \"</div><span class='headline'>\" + this.name + \"</span>\";\n if (this.short != null && typeof (this.short) != \"undefined\") {\n html += \"<span class='subtitle'>(\" + this.short + \")</span>\";\n }\n if (this.time != null && typeof (this.time) != \"undefined\") {\n html += \"<span class='source'><i class='material-icons icon'>today</i>\" + this.time + \"</span>\";\n }\n for (var index in this.authors) {\n html += \"<span class='source'><i class='material-icons icon'>person</i>\" + this.authors[index] + \"</span>\";\n }\n for (var index in this.sources) {\n html += \"<span class='source'><i class='material-icons icon'>import_contacts</i>\" + this.sources[index] + \"</span>\";\n }\n if (this.procedure.length > 0) {\n html += \"<span class='approaches'><i class='material-icons icon'>list_alt</i>the steps of the procedure:</span>\"\n for (var index in this.procedure) {\n html += this.procedure[index].generateListView();\n }\n }\n html += \"</div>\";\n return {\n html: html,\n id: id\n };\n }", "title": "" }, { "docid": "7d3b051bc00a48ccf2b4a2b8914fa882", "score": "0.67066574", "text": "function linkObjectDisplayDetails() {}", "title": "" }, { "docid": "ae86853407b5e2b78d59ec73d2e0586d", "score": "0.64327055", "text": "function showDetail(d) {\n // kirimkan tag html sebagai value\n return `<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"${d.Poster}\" class=\"img-fluid\">\n </div>\n <div class=\"col-md-8\">\n <ul class=\"list-group\">\n <li class=\"list-group-item\">\n <h3>${d.Title} (${d.Year})</h3>\n </li>\n <li class=\"list-group-item\"><strong>Director : </strong> ${d.Director}</li>\n <li class=\"list-group-item\"><strong>Actors : </strong> ${d.Actors}</li>\n <li class=\"list-group-item\"><strong>Writer : </strong> ${d.Writer}</li>\n <li class=\"list-group-item\"><strong>Plot : </strong> <br> ${d.Plot}</li>\n </ul>\n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "7ff9f73bef2654722fdf304f4d4c9471", "score": "0.6376787", "text": "async function viewObjectDetails(id){\n\t//retrieve object data\n\tconst url = new URL(OBJECT, SERVER);\n\turl.searchParams.append(\"q\", `objectid:${id}`);\n\tconst data = await getSearchData(url);\n\tif (!data) { document.getElementById(\"results\").innerHTML = auth_err; return; }\n\tconst obj = data[0];\n\tlet html = \"\";\n\t//retrieve images through IIIF\n\tfor (let i in obj.images){\n\t\tconst base_uri = obj.images[i].iiifbaseuri;\n\t\tconst json = await getData(base_uri + \"/info.json\"); //can be slower than loading the rest of the info\n\t\tconst info = json.profile[1];\n\t\tconst ext = (info.formats.includes(\"png\") ? \"png\" : \"jpg\");\n\t\tconst full_uri = base_uri + `/full/full/0/native.${ext}`;\n\t\thtml += `<img src='${full_uri}' width='300' onclick=\"viewFullImg('${full_uri}')\">`;\n\t}\n\t//display object properties\n\thtml += \"<table><tr><th colspan='2'>Object Details</th></tr>\";\n\tfor (let prop in obj){\n\t\tif (!obj.hasOwnProperty(prop)){ continue; }\n\t\tlet val = obj[prop];\n\t\thtml += `<tr><td>${prop}</td><td>${val}</td></tr>`;\n\t}\n\thtml += \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "title": "" }, { "docid": "c78f544ec20ad46f1d61e37c770e8a75", "score": "0.63737094", "text": "function displayDetails() {\n $(\".is-3\").css(\"border-left\", \"4px solid lightgray\");\n var text1 = $(this).find(\"p:nth-child(1)\").text();\n var text2 = $(this).find(\"p:nth-child(2)\").text();\n text4 = $(this).find(\"p:nth-child(4)\").attr(\"data-value\");\n text5 = $(this).find(\"p:nth-child(5)\").attr(\"data-qualify\");\n $(info1).innerHTML = \"\";\n $(info2).innerHTML = \"\";\n $(info1).text(text1);\n $(info2).text(text2);\n $(details).text(text5);\n $(this).css(\"border-left\", \"8px solid purple\");\n }", "title": "" }, { "docid": "7dbbf108f87276104d3ad446c0d9fb90", "score": "0.63729966", "text": "function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('stroke', 'white')\n .style(\"cursor\", \"pointer\");\n\n var content = '<p><span class=\"name\">Title: </span><span class=\"value\">' +\n d.name +\n '</span></p>'+\n '<p><span class=\"name\">Author: </span><span class=\"value\">' +\n d.author +\n '</span></p>';\n tooltip.showTooltip(content, d3.event);\n\n d3.select(\"#detail\").style(\"display\",\"block\");\n d3.select(\"#detail-title\").html(d.name);\n d3.select(\"#detail-author\").html(\"Author: \"+d.author);\n d3.select(\"#detail-comments\").html(\"Comments: \"+d.value);\n d3.select(\"#detail-date\").html(timeConverter(d.year));\n var url = \"image/\"+d.id+\".png\";\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if(xhr.readyState == 4 && xhr.status == 200){\n document.getElementById(\"wordcloud-img\").src = \"image/\"+d.id+\".png\";\n }\n };\n xhr.open(\"GET\",url,true);\n xhr.send();\n\n }", "title": "" }, { "docid": "8a92a43d128436f165555e373ff6a3be", "score": "0.62434167", "text": "details() {\n return tardigrade.tardigradeEngine.getPoint(this.rootElement, \"Card\", { \"details\": 0 });\n }", "title": "" }, { "docid": "5f978a95234112707bce129b53cda184", "score": "0.6237542", "text": "function drawMoreInfo(id, data) {\n let moreInfoContainer = '<div>';\n moreInfoContainer += `<img src=\"${data.imgSrc}\" alt=\"#\" >`;\n moreInfoContainer += `<p>USD : ${data.usd}</p>`\n moreInfoContainer += `<p>EUR : ${data.eur}</p>`\n moreInfoContainer += `<p>ILS : ${data.ils}</p>`\n moreInfoContainer += '</div>';\n $(`#${id}`).empty();\n $(`#${id}`).html(moreInfoContainer);\n}", "title": "" }, { "docid": "dafded086cf36bb14ba7acf39ff5596a", "score": "0.6236703", "text": "function debugSide(obj){\n\t\n\tvar html = \"\";\n\tfor(name in obj){\n\t\tvar value = obj[name];\n\t\thtml += name+\" : \" + value + \"<br>\";\t\t\n\t}\n\t\n\tjQuery(\"#debug_side\").show().html(html);\n\n}", "title": "" }, { "docid": "0d888c5f45b01afd5e315cea8aacd0ae", "score": "0.6230638", "text": "function renderDetails(recordID) {\n\t/*\tmarkupInfoItems\n\t\tReturns marked up version of the DOM items passed, putting them into a list if necessary:\n\t\tinput:\tinfoItems - array of DOM elements to insert\n\t\toutput: * 1-element array => just the element\n\t\t\t\t* multi-element array => UL with an LI containing each of the elements\n\t\t\t\t* empty array => undefined\n\t*/\n\tvar markupInfoItems = function (infoItems) {\n\t\tvar result;\n\n\t\tif (infoItems.length == 1) {\n\t\t\tresult = infoItems[0];\n\t\t}\n\t\telse if (infoItems.length > 1) {\n\t\t\tresult = document.createElement('ul');\n\t\t\tjQuery(infoItems).each( function(index) {\n\t\t\t\t\tvar LI = document.createElement('li');\n\t\t\t\t\tresult.appendChild(LI);\n\t\t\t\t\tLI.appendChild(this);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\n\n\t/*\tdetailLineBasic\n\t\tinput:\ttitleElement - DOM element containing the title\n\t\t\t\tdataElement - DOMElement with the information to be displayed\n\t\t\t\tattributes - associative array if attributes added to the resulting elements (optional)\n\t\toutput: Array of DOM elements containing\n\t\t\t\t0:\tDT element with the titleElement\n\t\t\t\t1:\tDD element with the informationElement\n\t*/\n\tvar detailLineBasic = function (titleElement, dataElement, attributes) {\n\t\tvar line;\n\t\tif (titleElement && dataElement) {\n\t\t\tvar rowTitleElement = document.createElement('dt');\n\t\t\tfor (attributeName in attributes) {\n\t\t\t\trowTitleElement.setAttribute(attributeName, attributes[attributeName]);\n\t\t\t}\n\t\t\trowTitleElement.appendChild(titleElement);\n\n\t\t\tvar rowDataElement = document.createElement('dd');\n\t\t\tfor (attributeName in attributes) {\n\t\t\t\trowDataElement.setAttribute(attributeName, attributes[attributeName]);\n\t\t\t}\n\t\t\trowDataElement.appendChild(dataElement);\n\t\t\t\n\t\t\tline = [rowTitleElement, rowDataElement];\n\t\t}\n\t\t\n\t\treturn line;\n\t}\n\n\n\n\t/*\tdetailLine\n\t\tinput:\ttitle - string with element's name\n\t\t\t\tinformationElements - array of DOM elements with the information to be displayed\n\t\toutput: Array of DOM elements containing\n\t\t\t\t0:\tDT element with the row's title\n\t\t\t\t1:\tDD element with the row's data\n\t\t\t\t\t\tIf there is more than one data item, they are wrapped in a list.\n\t*/\n\tvar detailLine = function (title, informationElements) {\n\t\tvar line;\n\t\tif (title && informationElements) {\n\t\t\tvar headingText;\t\n\n\t\t\tif (informationElements.length == 1) {\n\t\t\t\theadingText = localise('detail-label-'+title);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar labelKey = 'detail-label-' + title + '-plural';\n\t\t\t\tvar labelLocalisation = localise(labelKey);\n\t\t\t\tif (labelKey === labelLocalisation) { // no plural form, fall back to singular\n\t\t\t\t\tlabelKey = 'detail-label-' + title;\n\t\t\t\t\tlabelLocalisation = localise(labelKey);\n\t\t\t\t}\n\t\t\t\theadingText = labelLocalisation;\n\t\t\t}\n\n\t\t\tvar infoItems = markupInfoItems(informationElements);\n\n\t\t\tif (infoItems) { // we have information, so insert it\n\t\t\t\tvar labelNode = document.createTextNode(headingText + ':');\n\t\t\t\tvar acronymKey = 'detail-label-acronym-' + title;\n\t\t\t\tif (localise(acronymKey) !== acronymKey) {\n\t\t\t\t\t// acronym: add acronym element\n\t\t\t\t\tvar acronymElement = document.createElement('abbr');\n\t\t\t\t\tacronymElement.title = localise(acronymKey);\n\t\t\t\t\tacronymElement.appendChild(labelNode);\n\t\t\t\t\tlabelNode = acronymElement;\n\t\t\t\t}\n\n\t\t\t\tline = detailLineBasic(labelNode, infoItems);\n\t\t\t}\n\t\t}\n\n\t\treturn line;\n\t}\n\n\n\n\t/*\tdetailLineAuto\n\t\tinput:\ttitle - string with the element's name\n\t\toutput:\tArray of DOM elements for title and the data coming from data[md-title]\n\t\t\t\tas created by detailLine.\n\t*/\n\tvar detailLineAuto = function (title) {\n\t\tvar result = undefined;\n\t\tvar element = DOMElementForTitle(title);\n\n\t\tif (element.length !== 0) {\n\t\t\tresult = detailLine( title, element );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\n\t\n\t/*\tlinkForDOI\n\t\tinput:\tDOI - string with DOI\n\t\toutput: DOM anchor element with link to the DOI at dx.doi.org\n\t*/\n\tvar linkForDOI = function (DOI) {\n\t\tvar linkElement = document.createElement('a');\n\t\tlinkElement.setAttribute('href', 'http://dx.doi.org/' + DOI);\n\t\tturnIntoNewWindowLink(linkElement);\n\t\tlinkElement.appendChild(document.createTextNode(DOI));\n\n\t\tvar DOISpan = document.createElement('span');\n\t\tDOISpan.appendChild(linkElement);\t\t\n\n\t\treturn DOISpan;\n\t}\n\n\n\n\t/*\tDOMElementForTitle\n\t\tinput:\ttitle - title string\n\t\toutput:\tnil, if the field md-title does not exist in data. Otherwise:\n\t\t\t\tarray of DOM elements created from the fields of data[md-title]\n\t*/\n\tvar DOMElementForTitle = function (title) {\n\t\tvar result = [];\n\t\tif ( data['md-' + title] !== undefined ) {\n\t\t\tvar theData = data['md-' + title];\n\t\t\tdeduplicate(theData);\n\n\t\t\tfor (var dataIndex in theData) {\n\t\t\t\tvar rawDatum = theData[dataIndex];\n\t\t\t\tvar wrappedDatum;\n\t\t\t\tswitch\t(title) {\n\t\t\t\t\tcase 'doi':\n\t\t\t\t\t\twrappedDatum = linkForDOI(rawDatum);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twrappedDatum = document.createTextNode(rawDatum);\n\t\t\t\t}\n\t\t\t\tresult.push(wrappedDatum);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\n\n\t/*\tISSNsDetailLine\n\t\tReturns DOMElements with markup for the record’s ISSN information,\n\t\t\ttaking into account the issn, eissn and pissn fields.\n\n\t\toutput: Array of DOM elements containing\n\t\t\t\t0:\tDT element with the row's title ISSN or ISSNs\n\t\t\t\t1:\tDD element with a list of ISSNs\n\t*/\n\tvar ISSNsDetailLine = function () {\n\t\tvar ISSNTypes = {'issn': '', 'pissn': 'gedruckt', 'eissn': 'elektronisch'};\n\t\tvar ISSNList = [];\n\t\tfor (var ISSNTypeIndex in ISSNTypes) {\n\t\t\tvar fieldName = 'md-' + ISSNTypeIndex;\n\t\t\tfor (var ISSNIndex in data[fieldName]) {\n\t\t\t\tvar ISSN = data[fieldName][ISSNIndex].substr(0,9);\n\t\t\t\tif (jQuery.inArray(ISSN, ISSNList) == -1) {\n\t\t\t\t\tif (ISSNTypes[ISSNTypeIndex] !== '') {\n\t\t\t\t\t\tISSN += ' (' + localise(ISSNTypes[ISSNTypeIndex]) + ')';\n\t\t\t\t\t}\n\t\t\t\t\tISSNList.push(ISSN);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar infoElements;\n\t\tif (ISSNList.length > 0) {\n\t\t\tinfoElements = [document.createTextNode(ISSNList.join(', '))];\n\t\t}\n\n\t\treturn detailLine('issn', infoElements);\n\t}\n\n\n\n\t/*\tZDBQuery\n\t\tLoads XML journal info from ZDB via a proxy on our own server\n\t\t\t(to avoid cross-domain load problems).\n\t\tInserts the information into the DOM.\n\n\t\tinput:\telement - DOM element that the resulting information is inserted into.\n\t*/\n\tvar addZDBInfoIntoElement = function (element) {\n\t\t// Do nothing if there are no ISSNs.\n\t\tvar ISSN;\n\t\tif (data['md-issn'] && data['md-issn'].length > 0) {\n\t\t\tISSN = data['md-issn'][0];\n\t\t}\n\t\telse if (data['md-pissn'] && data['md-pissn'].length > 0) {\n\t\t\tISSN = data['md-pissn'][0];\n\t\t}\n\t\tvar eISSN;\n\t\tif (data['md-eissn'] && data['md-eissn'].length > 0) {\n\t\t\teISSN = data['md-eissn'][0];\n\t\t}\n\t\t\n\t\tif ( !(ISSN || eISSN) ) {return;}\n\n\t\tvar serviceID = 'sub:vlib';\n\t\tvar parameters = 'sid=' + serviceID;\n\n\t\tif ( ISSN ) {\n\t\t\tparameters += '&issn=' + ISSN;\n\t\t}\n\t\t\n\t\tif ( eISSN ) {\n\t\t\tparameters += '&eissn=' + eISSN;\n\t\t}\n\n\t\tif (data['md-medium'] == 'article') {\n\t\t\tparameters += '&genre=article';\n\n\t\t\t// Add additional information to request to get more precise result and better display.\n\t\t\tvar year = data['md-date'];\n\t\t\tif (year) {\n\t\t\t\tvar yearNumber = parseInt(year[0], 10);\n\t\t\t\tparameters += '&date=' + yearNumber;\n\t\t\t}\n\n\t\t\tvar volume = data['md-volume-number'];\n\t\t\tif (volume) {\n\t\t\t\tvar volumeNumber = parseInt(volume, 10);\n\t\t\t\tparameters += '&volume=' + volumeNumber;\n\t\t\t}\n\n\t\t\tvar issue = data['md-issue-number'];\n\t\t\tif (issue) {\n\t\t\t\tvar issueNumber = parseInt(issue, 10);\n\t\t\t\tparameters += '&issue=' + issueNumber;\n\t\t\t}\n\n\t\t\tvar pages = data['md-pages-number'];\n\t\t\tif (pages) {\n\t\t\t\tparameters += '&pages=' + pages;\n\t\t\t}\n\n\t\t\tvar title = data['md-title'];\n\t\t\tif (title) {\n\t\t\t\tparameters += '&atitle=' + encodeURI(title);\n\t\t\t}\n\t\t}\n\t\telse { // it’s a journal\n\t\t\tparameters += '&genre=journal';\n\n\t\t\tvar journalTitle = data['md-title'];\n\t\t\tif (journalTitle) {\n\t\t\t\tparameters += '&title=' + encodeURI(journalTitle);\n\t\t\t}\n\t\t}\n\n\t\t// Run the ZDB query.\n\t\tvar ZDBPath = '/zdb/';\n\t\tif (!ZDBUseClientIP) {\n\t\t\tZDBPath = '/zdb-local/';\n\t\t}\n\t\tvar ZDBURL = ZDBPath + 'full.xml?' + parameters;\n\n\t\tjQuery.get(ZDBURL,\n\t\t\t/*\tAJAX callback\n\t\t\t\tCreates DOM elements with information coming from ZDB.\n\t\t\t\tinput:\tresultData - XML from ZDB server\n\t\t\t\tuses:\telement - DOM element for inserting the information into\n\t\t\t*/\n\t\t\tfunction (resultData) {\n\n\t\t\t\t/*\tZDBInfoItemForResult\n\t\t\t\t\tTurns XML of a single ZDB Result a DOM element displaying the relevant information.\n\t\t\t\t\tinput:\tZDBResult - XML Element with a Full/(Print|Electronic)Data/ResultList/Result element\n\t\t\t\t\toutput:\tDOM Element for displaying the information in ZDBResult that's relevant for us\n\t\t\t\t*/\n\t\t\t\tvar ZDBInfoItemForResult = function (ZDBResult) {\n\t\t\t\t\tvar status = ZDBResult.getAttribute('state');\n\t\t\t\t\tvar statusText;\n\n\t\t\t\t\t// Determine the access status of the result.\n\t\t\t\t\tif (status == 0) {\n\t\t\t\t\t\tstatusText = localise('frei verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse if (status == 1) {\n\t\t\t\t\t\tstatusText = localise('teilweise frei verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse if (status == 2) {\n\t\t\t\t\t\tstatusText = localise('verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse if (status == 3) {\n\t\t\t\t\t\tstatusText = localise('teilweise verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse if (status == 4) {\n\t\t\t\t\t\tstatusText = localise('nicht verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse if (status == 5) {\n\t\t\t\t\t\tstatusText = localise('diese Ausgabe nicht verfügbar');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t/*\tRemaining cases are:\n\t\t\t\t\t\t\t\tstatus == -1: non-unique ISSN\n\t\t\t\t\t\t\t\tstatus == 10: unknown\n\t\t\t\t\t\t*/\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Only display detail information if we do have access.\n\t\t\t\t\tif (statusText) {\n\t\t\t\t\t\tvar statusElement = document.createElement('span');\n\t\t\t\t\t\tjQuery(statusElement).addClass('pz2-ZDBStatusInfo');\n\n\t\t\t\t\t\tvar accessLinkURL = jQuery('AccessURL', ZDBResult);\n\t\t\t\t\t\tif (accessLinkURL.length > 0) {\n\t\t\t\t\t\t\t// Having an AccessURL implies this is inside ElectronicData.\n\t\t\t\t\t\t\tstatusElement.appendChild(document.createTextNode(statusText));\n\t\t\t\t\t\t\tvar accessLink = document.createElement('a');\n\t\t\t\t\t\t\tstatusElement.appendChild(document.createTextNode(' – '));\n\t\t\t\t\t\t\tstatusElement.appendChild(accessLink);\n\t\t\t\t\t\t\taccessLink.setAttribute('href', accessLinkURL[0].textContent);\n\t\t\t\t\t\t\tvar linkTitle = jQuery('Title', ZDBResult);\n\t\t\t\t\t\t\tif (linkTitle && linkTitle.length > 0) {\n\t\t\t\t\t\t\t\tlinkTitle = linkTitle[0].textContent;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tlinkTitle = localise('Zugriff');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tturnIntoNewWindowLink(accessLink);\n\n\t\t\t\t\t\t\tvar additionals = [];\n\t\t\t\t\t\t\tvar ZDBAdditionals = jQuery('Additional', ZDBResult);\n\t\t\t\t\t\t\tZDBAdditionals.each( function (index) {\n\t\t\t\t\t\t\t\t\tadditionals.push(this.textContent);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (additionals.length > 0) {\n\t\t\t\t\t\t\t\taccessLink.appendChild(document.createTextNode(additionals.join('; ') + '. '))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\taccessLink.appendChild(document.createTextNode(linkTitle));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (status < 4) {\n\t\t\t\t\t\t\t// Absence of an AccessURL implies this is inside PrintData.\n\t\t\t\t\t\t\t// status > 3 means the volume is not available. Don't print info then.\n\t\t\t\t\t\t\tvar locationInfo = document.createElement('span');\n\t\t\t\t\t\t\tvar infoText = '';\n\n\t\t\t\t\t\t\tvar period = jQuery('Period', ZDBResult)[0];\n\t\t\t\t\t\t\tif (period) {\n\t\t\t\t\t\t\t\tinfoText += period.textContent + ': ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar location = jQuery('Location', ZDBResult)[0];\n\t\t\t\t\t\t\tvar locationText = '';\n\t\t\t\t\t\t\tif (location) {\n\t\t\t\t\t\t\t\tlocationText = location.textContent;\n\t\t\t\t\t\t\t\tinfoText += locationText;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar signature = jQuery('Signature', ZDBResult)[0];\n\t\t\t\t\t\t\tif (signature) {\n\t\t\t\t\t\t\t\tinfoText += ' ' + signature.textContent;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (locationText.search('Göttingen SUB') != -1 && locationText.search('LS2') != -1) {\n\t\t\t\t\t\t\t\tinfoText += ' ' + localise('[neuere Bände im Lesesaal 2]');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlocationInfo.appendChild(document.createTextNode(infoText));\n\t\t\t\t\t\t\tstatusElement.appendChild(locationInfo);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tstatusElement = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\treturn statusElement;\n\t\t\t\t}\n\n\n\n\t\t\t\t/*\tappendLibraryNameFromResultDataTo\n\t\t\t\t\tIf we there is a Library name, insert it into the target container.\n\t\t\t\t\tinput:\t* data: ElectronicData or PrintData element from ZDB XML\n\t\t\t\t\t\t\t* target: DOM container to which the marked up library name is appended\n\t\t\t\t*/\n\t\t\t\tvar appendLibraryNameFromResultDataTo = function (data, target) {\n\t\t\t\t\tvar libraryName = jQuery('Library', data)[0];\n\t\t\t\t\tif (libraryName) {\n\t\t\t\t\t\tvar libraryNameSpan = document.createElement('span');\n\t\t\t\t\t\tjQuery(libraryNameSpan).addClass('pz2-ZDBLibraryName');\n\t\t\t\t\t\tlibraryNameSpan.appendChild(document.createTextNode(libraryName.textContent));\n\t\t\t\t\t\ttarget.appendChild(libraryNameSpan);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t\t/*\tZDBInfoElement\n\t\t\t\t\tCoverts ZDB XML data for electronic or print journals\n\t\t\t\t\t\tto DOM elements displaying their information.\n\t\t\t\t\tinput:\tdata - ElectronicData or PrintData element from ZDB XML\n\t\t\t\t\toutput:\tDOM element containing the information from data\n\t\t\t\t*/\t\t\t\t\n\t\t\t\tvar ZDBInfoElement = function (data) {\n\t\t\t\t\tvar results = jQuery('Result', data);\n\n\t\t\t\t\tif (results.length > 0) {\n\t\t\t\t\t\tvar infoItems = [];\n\t\t\t\t\t\tresults.each( function(index) {\n\t\t\t\t\t\t\t\tvar ZDBInfoItem = ZDBInfoItemForResult(this);\n\t\t\t\t\t\t\t\tif (ZDBInfoItem) {\n\t\t\t\t\t\t\t\t\tinfoItems.push(ZDBInfoItem);\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\tif (infoItems.length > 0) {\n\t\t\t\t\t\t\tvar infos = document.createElement('span');\n\t\t\t\t\t\t\tinfos.appendChild(markupInfoItems(infoItems));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn infos;\n\t\t\t\t}\n\n\n\n\t\t\t\t/*\tZDBInformation\n\t\t\t\t\tConverts complete ZDB XML data to DOM element containing information about them.\n\t\t\t\t\tinput:\tdata - result from ZDB XML request\n\t\t\t\t\toutput: DOM element displaying information about journal availability.\n\t\t\t\t\t\t\t\tIf ZDB figures out the local library and the journal\n\t\t\t\t\t\t\t\t\tis accessible there, we display:\n\t\t\t\t\t\t\t\t\t* its name\n\t\t\t\t\t\t\t\t\t* electronic journal information with access link\n\t\t\t\t\t\t\t\t\t* print journal information\n\t\t\t\t*/\n\t\t\t\tvar ZDBInformation = function (data) {\n\t\t\t\t\tvar container;\n\n\t\t\t\t\tvar electronicInfos = ZDBInfoElement( jQuery('ElectronicData', data) );\n\t\t\t\t\tvar printInfos = ZDBInfoElement( jQuery('PrintData', data) );\n\t\t\t\t\t\n\t\t\t\t\tif (electronicInfos || printInfos) {\n\t\t\t\t\t\tcontainer = document.createElement('div');\n\t\t\t\t\t\tif (ZDBUseClientIP) {\n\t\t\t\t\t\t\tappendLibraryNameFromResultDataTo(data, container);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (electronicInfos) {\n\t\t\t\t\t\tvar electronicHeading = document.createElement('h5');\n\t\t\t\t\t\tcontainer.appendChild(electronicHeading);\n\t\t\t\t\t\telectronicHeading.appendChild(document.createTextNode(localise('elektronisch')));\n\t\t\t\t\t\tcontainer.appendChild(electronicInfos);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (printInfos) {\n\t\t\t\t\t\tvar printHeading = document.createElement('h5');\n\t\t\t\t\t\tcontainer.appendChild(printHeading);\n\t\t\t\t\t\tprintHeading.appendChild(document.createTextNode(localise('gedruckt')));\n\t\t\t\t\t\tcontainer.appendChild(printInfos);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn container;\n\t\t\t\t}\n\n\n\n\t\t\t\tvar availabilityLabel = document.createElement('a');\n\t\t\t\tvar ZDBLinkURL = 'http://services.d-nb.de/fize-service/gvr/html-service.htm?' + parameters;\n\t\t\t\tavailabilityLabel.setAttribute('href', ZDBLinkURL);\n\t\t\t\tavailabilityLabel.title = localise('Informationen bei der Zeitschriftendatenbank');\n\t\t\t\tturnIntoNewWindowLink(availabilityLabel);\n\t\t\t\tavailabilityLabel.appendChild(document.createTextNode(localise('detail-label-verfügbarkeit') + ':'));\n\n\t\t\t\tvar infoBlock = ZDBInformation(resultData);\n\n\t\t\t\tvar infoLineElements = detailLineBasic(availabilityLabel, infoBlock, {'class':'pz2-ZDBInfo'});\n\t\t\t\tvar jInfoLineElements = jQuery(infoLineElements);\n\t\t\t\tjInfoLineElements.hide();\n\t\t\t\tappendInfoToContainer(infoLineElements, element);\n\t\t\t\tif (!jQuery.browser.msie || jQuery.browser.version > 7) {\n\t\t\t\t\tjInfoLineElements.slideDown('fast');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tjInfoLineElements.show();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\t\n\n\n\n\t/*\tappendGoogleBooksElementTo\n\t\tFigure out whether there is a Google Books Preview for the current data.\n\t\tinput:\tDL DOM element that an additional item can be appended to\n\t*/\n\tvar appendGoogleBooksElementTo = function (container) {\n\t\t// Create list of search terms from ISBN and OCLC numbers.\n\t\tvar searchTerms = [];\n\t\tfor (locationNumber in data.location) {\n\t\t\tvar numberField = String(data.location[locationNumber]['md-isbn']);\n\t\t\tvar matches = numberField.replace(/-/g,'').match(/[0-9]{9,12}[0-9xX]/g);\n\t\t\tif (matches) {\n\t\t\t\tfor (var ISBNMatchNumber = 0; ISBNMatchNumber < matches.length; ISBNMatchNumber++) {\n\t\t\t\t\tsearchTerms.push('ISBN:' + matches[ISBNMatchNumber]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumberField = String(data.location[locationNumber]['md-oclc-number']);\n\t\t\tmatches = numberField.match(/[0-9]{4,}/g);\n\t\t\tif (matches) {\n\t\t\t\tfor (var OCLCMatchNumber = 0; OCLCMatchNumber < matches.length; OCLCMatchNumber++) {\n\t\t\t\t\tsearchTerms.push('OCLC:' + matches[OCLCMatchNumber]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (searchTerms.length > 0) {\n\t\t\t// Query Google Books for the ISBN/OCLC numbers in question.\n\t\t\tvar googleBooksURL = 'http://books.google.com/books?bibkeys=' + searchTerms\n\t\t\t\t\t\t+ '&jscmd=viewapi&callback=?';\n\t\t\tjQuery.getJSON(googleBooksURL,\n\t\t\t\tfunction(data) {\n\t\t\t\t\t/*\tbookScore\n\t\t\t\t\t\tReturns a score for given book to help determine which book\n\t\t\t\t\t\tto use on the page if several results exist.\n\t\t\t\t\t\n\t\t\t\t\t\tPreference is given existing previews and books that are\n\t\t\t\t\t\tembeddable are preferred if there is a tie.\n\t\t\t\t\t\n\t\t\t\t\t\tinput: book - Google Books object\n\t\t\t\t\t\toutput: integer\n\t\t\t\t\t*/\n\t\t\t\t\tfunction bookScore (book) {\n\t\t\t\t\t\tvar score = 0;\n\n\t\t\t\t\t\tif (book.preview === 'full') {\n\t\t\t\t\t\t\tscore += 10;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (book.preview === 'partial') {\n\t\t\t\t\t\t\tscore += 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (book.embeddable === true) {\n\t\t\t\t\t\t\tscore += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn score;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf there are multiple results choose the first one with\n\t\t\t\t\t\tthe maximal score. Ignore books without a preview.\n\t\t\t\t\t*/\n\t\t\t\t\tvar selectedBook;\n\t\t\t\t\tjQuery.each(data,\n\t\t\t\t\t\tfunction(bookNumber, book) {\n\t\t\t\t\t\t\tvar score = bookScore(book);\n\t\t\t\t\t\t\tbook.score = score;\n\n\t\t\t\t\t\t\tif (selectedBook === undefined || book.score > selectedBook.score) {\n\t\t\t\t\t\t\t\tif (book.preview !== 'noview') {\n\t\t\t\t\t\t\t\t\tselectedBook = book;\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\n\t\t\t\t\t// Add link to Google Books if there is a selected book.\n\t\t\t\t\tif (selectedBook !== undefined) {\n\t\t\t\t\t\tvar dt = document.createElement('dt');\n\t\t\t\t\t\tvar dd = document.createElement('dd');\n\n\t\t\t\t\t\tvar bookLink = document.createElement('a');\n\t\t\t\t\t\tdd.appendChild(bookLink);\n\t\t\t\t\t\tbookLink.setAttribute('href', selectedBook.preview_url);\n\t\t\t\t\t\tif (selectedBook.embeddable === true) {\n\t\t\t\t\t\t\tbookLink.onclick = openPreview;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar language = jQuery('html').attr('lang');\n\t\t\t\t\t\tif (language === undefined) {\n\t\t\t\t\t\t\tlanguage = 'en';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar buttonImageURL = 'http://www.google.com/intl/' + language + '/googlebooks/images/gbs_preview_button1.gif';\n\n\t\t\t\t\t\tvar buttonImage = document.createElement('img');\n\t\t\t\t\t\tbuttonImage.setAttribute('src', buttonImageURL);\n\t\t\t\t\t\tvar buttonAltText = 'Google Books';\n\t\t\t\t\t\tif (selectedBook.preview === 'full') {\n\t\t\t\t\t\t\tbuttonAltText = localise('Google Books: Vollständige Ansicht');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedBook.preview === 'partial') {\n\t\t\t\t\t\t\tbuttonAltText = localise('Google Books: Eingeschränkte Vorschau');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuttonImage.setAttribute('alt', buttonAltText);\n\t\t\t\t\t\tbookLink.appendChild(buttonImage);\n\n\t\t\t\t\t\tif (selectedBook.thumbnail_url !== undefined) {\n\t\t\t\t\t\t\tbookLink = bookLink.cloneNode(false);\n\t\t\t\t\t\t\tdt.appendChild(bookLink);\n\t\t\t\t\t\t\tvar coverArtImage = document.createElement('img');\n\t\t\t\t\t\t\tbookLink.appendChild(coverArtImage);\n\t\t\t\t\t\t\tcoverArtImage.setAttribute('src', selectedBook.thumbnail_url);\n\t\t\t\t\t\t\tcoverArtImage.setAttribute('alt', localise('Umschlagbild'));\n\t\t\t\t\t\t\tjQuery(coverArtImage).addClass('bookCover');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tjElements = jQuery([dt, dd]);\n\t\t\t\t\t\tjElements.addClass('pz2-googleBooks');\n\t\t\t\t\t\tjElements.hide();\n\t\t\t\t\t\tcontainer.appendChild(dt);\n\t\t\t\t\t\tcontainer.appendChild(dd);\n\t\t\t\t\t\tif (!jQuery.browser.msie || jQuery.browser.version > 7) {\n\t\t\t\t\t\t\tjElements.slideDown('fast');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tjElements.show()\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\n\n\t\t/*\topenPreview\n\t\t\tCalled when the Google Books button is clicked.\n\t\t\tOpens Google Preview.\n\t\t\toutput: false (so the click isn't handled any further)\n\t\t*/\n\t\tvar openPreview = function() {\n\t\t\tvar googlePreviewButton = this;\n\t\t\t// Get hold of containing <div>, creating it if necessary.\n\t\t\tvar previewContainerDivName = 'googlePreviewContainer';\n\t\t\tvar previewContainerDiv = document.getElementById(previewContainerDivName);\n\t\t\tvar previewDivName = 'googlePreview';\n\t\t\tvar previewDiv = document.getElementById(previewDivName);\n\n\n\t\t\tif (!previewContainerDiv) {\n\t\t\t\tpreviewContainerDiv = document.createElement('div');\n\t\t\t\tpreviewContainerDiv.setAttribute('id', previewContainerDivName);\n\t\t\t\tjQuery('#page').get(0).appendChild(previewContainerDiv);\n\n\t\t\t\tvar titleBarDiv = document.createElement('div');\n\t\t\t\tjQuery(titleBarDiv).addClass('googlePreview-titleBar');\n\t\t\t\tpreviewContainerDiv.appendChild(titleBarDiv);\n\n\t\t\t\tvar closeBoxLink = document.createElement('a');\n\t\t\t\ttitleBarDiv.appendChild(closeBoxLink);\n\t\t\t\tjQuery(closeBoxLink).addClass('googlePreview-closeBox');\n\t\t\t\tcloseBoxLink.setAttribute('href', '#');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcloseBoxLink.onclick = new Function('javascript:jQuery(\"#' + previewContainerDivName + '\").hide(200);return false;');\n\t\t\t\tcloseBoxLink.appendChild(document.createTextNode(localise('Vorschau schließen')));\n\n\t\t\t\tpreviewDiv = document.createElement('div');\n\t\t\t\tpreviewDiv.setAttribute('id', previewDivName);\n\t\t\t\tpreviewContainerDiv.appendChild(previewDiv);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tjQuery(previewContainerDiv).show(200);\n\t\t\t}\n\n\t\t\tvar viewer = new google.books.DefaultViewer(previewDiv);\n\t\t\tviewer.load(this.href);\n\n\t\t\treturn false;\n\t\t}\n\n\t} // end of addGoogleBooksLinkIntoElement\n\n\n\t\n\t/*\tlocationDetails\n\t\tReturns markup for each location of the item found from the current data.\n\t\toutput:\tDOM object with information about this particular copy/location of the item found\n\t*/\n\tvar locationDetails = function () {\n\n\t\t/*\tdetailInfoItemWithLabel\n\t\t\tinput:\tfieldContent - string with content to display in the field\n\t\t\t\t\tlabelName - string displayed as the label\n\t\t\t\t\tdontTerminate - boolean:\tfalse puts a ; after the text\n\t\t\t\t\t\t\t\t\t\t\t\ttrue puts nothing after the text\n\t\t*/\n\t\tvar detailInfoItemWithLabel = function (fieldContent, labelName, dontTerminate) {\n\t\t\tvar infoSpan;\n\t\t\tif ( fieldContent !== undefined ) {\n\t\t\t\tinfoSpan = document.createElement('span');\n\t\t\t\tjQuery(infoSpan).addClass('pz2-info');\n\t\t\t\tif ( labelName !== undefined ) {\n\t\t\t\t\tvar infoLabel = document.createElement('span');\n\t\t\t\t\tinfoSpan.appendChild(infoLabel);\n\t\t\t\t\tjQuery(infoLabel).addClass('pz2-label');\n\t\t\t\t\tinfoLabel.appendChild(document.createTextNode(labelName));\n\t\t\t\t\tinfoSpan.appendChild(document.createTextNode(' '));\n\t\t\t\t}\n\t\t\t\tinfoSpan.appendChild(document.createTextNode(fieldContent));\n\n\t\t\t\tif (!dontTerminate) {\n\t\t\t\t\tinfoSpan.appendChild(document.createTextNode('; '));\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn infoSpan;\n\t\t}\n\n\n\n\t\t/*\tdetailInfoItem\n\t\t\tinput:\tfieldName - string\n\t\t\toutput:\tDOM elements containing the label and information for fieldName data\n\t\t\t\t\t\t* the label is looked up from the localisation table\n\t\t\t\t\t\t* data[detail-label-fieldName] provides the data\n\t\t*/\n\t\tvar detailInfoItem = function (fieldName) {\n\t\t\tvar infoItem;\n\t\t\tvar value = location['md-'+fieldName];\n\n\t\t\tif ( value !== undefined ) {\n\t\t\t\tvar label;\n\t\t\t\tvar labelID = 'detail-label-' + fieldName;\n\t\t\t\tvar localisedLabelString = localise(labelID);\n\n\t\t\t\tif ( localisedLabelString != labelID ) {\n\t\t\t\t\tlabel = localisedLabelString;\n\t\t\t\t}\n\n\t\t\t\tvar content = value.join(', ').replace(/^[ ]*/,'').replace(/[ ;.,]*$/,'');\n\n\t\t\t\tinfoItem = detailInfoItemWithLabel(content, label);\n\t\t\t}\n\n\t\t\treturn infoItem;\n\t\t}\n\n\n\n\t\t/* cleanISBNs\n\t\t\tTakes the array of ISBNs in location['md-isbn'] and\n\t\t\t\t1. Normalises them\n\t\t\t\t2. Removes duplicates (particularly the ISBN-10 corresponding to an ISBN-13)\n\t\t*/\n\t\tvar cleanISBNs = function () {\n\t\t\t/*\tnormaliseISBNsINString\n\t\t\t\tVague matching of ISBNs and removing the hyphens in them.\n\t\t\t\tinput: string\n\t\t\t\toutput: string\n\t\t\t*/\n\t\t\tvar normaliseISBNsInString = function (ISBN) {\n\t\t\t\treturn ISBN.replace(/([0-9]*)-([0-9Xx])/g, '$1$2');\n\t\t\t}\n\n\n\t\t\t/*\tpickISBN\n\t\t\t\tinput: 2 ISBN number strings without dashes\n\t\t\t\toutput: if both are 'the same': the longer one (ISBN-13)\n\t\t\t\t if they aren't 'the same': undefined\n\t\t\t*/\n\t\t\tvar pickISBN = function (ISBN1, ISBN2) {\n\t\t\t\tvar result = undefined;\n\t\t\t\tvar numberRegexp = /([0-9]{9,12})[0-9xX].*/;\n\t\t\t\tvar numberPart1 = ISBN1.replace(numberRegexp, '$1');\n\t\t\t\tvar numberPart2 = ISBN2.replace(numberRegexp, '$1');\n\t\t\t\tif (!(numberPart1 == numberPart2)) {\n\t\t\t\t\tif (numberPart1.indexOf(numberPart2) != -1) {\n\t\t\t\t\t\tresult = ISBN1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (numberPart2.indexOf(numberPart1) != -1) {\n\t\t\t\t\t\tresult = ISBN2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\n\n\t\t\tif (location['md-isbn'] !== undefined) {\n\t\t\t\tvar newISBNs = []\n\t\t\t\tfor (var index in location['md-isbn']) {\n\t\t\t\t\tvar normalisedISBN = normaliseISBNsInString(location['md-isbn'][index]);\n\t\t\t\t\tfor (var newISBNNumber in newISBNs) {\n\t\t\t\t\t\tvar newISBN = newISBNs[newISBNNumber];\n\t\t\t\t\t\tvar preferredISBN = pickISBN(normalisedISBN, newISBN);\n\t\t\t\t\t\tif (preferredISBN !== undefined) {\n\t\t\t\t\t\t\tnewISBNs.splice(newISBNNumber, 1, preferredISBN);\n\t\t\t\t\t\t\tnormalisedISBN = undefined;\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 (normalisedISBN !== undefined) {\n\t\t\t\t\t\tnewISBNs.push(normalisedISBN);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlocation['md-isbn'] = newISBNs;\n\t\t\t}\n\t\t}\n\n\n\n\t\t/*\telectronicURLs\n\t\t\tCreate markup for URLs in current location data.\n\t\t\toutput:\tDOM element containing URLs as links.\n\t\t*/\n\t\tvar electronicURLs = function() {\n\t\t\t\n\t\t\t/*\tcleanURLList\n\t\t\t\tReturns a cleaned list of URLs for presentation.\n\t\t\t\t1. Removes duplicates of URLs if they exist, preferring URLs with label\n\t\t\t\t2. Removes URLs duplicating DOI information\n\t\t\t\t3. Sorts URLs to have those with a label at the beginning\n\t\t\t\toutput:\tarray of URL strings or URL objects (with #text and other properties)\n\t\t\t*/\n\t\t\tvar cleanURLList = function () {\n\t\t\t\tvar URLs = location['md-electronic-url'];\n\t\n\t\t\t\tif (URLs) {\n\t\t\t\t\t// Figure out which URLs are duplicates and collect indexes of those to remove.\n\t\t\t\t\tvar indexesToRemove = {};\n\t\t\t\t\tfor (var URLIndex = 0; URLIndex < URLs.length; URLIndex++) {\n\t\t\t\t\t\tvar URLInfo = URLs[URLIndex];\n\t\t\t\t\t\tvar URL = URLInfo;\n\t\t\t\t\t\tif (typeof(URLInfo) === 'object' && URLInfo['#text']) {\n\t\t\t\t\t\t\tURL = URLInfo['#text'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check for duplicates in the electronic-urls field.\n\t\t\t\t\t\tfor (var remainingURLIndex = URLIndex + 1; remainingURLIndex < URLs.length; remainingURLIndex++) {\n\t\t\t\t\t\t\tvar remainingURLInfo = URLs[remainingURLIndex];\n\t\t\t\t\t\t\tvar remainingURL = remainingURLInfo;\n\t\t\t\t\t\t\tif (typeof(remainingURLInfo) === 'object' && remainingURLInfo['#text']) {\n\t\t\t\t\t\t\t\tremainingURL = remainingURLInfo['#text'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (URL == remainingURL) {\n\t\t\t\t\t\t\t\t// Two of the URLs are identical.\n\t\t\t\t\t\t\t\t// Keep the one with the title if only one of them has one,\n\t\t\t\t\t\t\t\t// keep the first one otherwise.\n\t\t\t\t\t\t\t\tvar URLIndexToRemove = URLIndex + remainingURLIndex;\n\t\t\t\t\t\t\t\tif (typeof(URLInfo) !== 'object' && typeof(remainingURLInfo) === 'object') {\n\t\t\t\t\t\t\t\t\tURLIndexToRemove = URLIndex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tindexesToRemove[URLIndexToRemove] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check for duplicates among the DOIs.\n\t\t\t\t\t\tfor (var DOIIndex in data['md-doi']) {\n\t\t\t\t\t\t\tif (URL.search(data['md-doi'][DOIIndex]) != -1) {\n\t\t\t\t\t\t\t\tindexesToRemove[URLIndex] = true;\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\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the duplicate URLs.\n\t\t\t\t\tvar indexesToRemoveArray = [];\n\t\t\t\t\tfor (var i in indexesToRemove) {\n\t\t\t\t\t\tif (indexesToRemove[i]) {\n\t\t\t\t\t\t\tindexesToRemoveArray.push(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tindexesToRemoveArray.sort( function(a, b) {return b - a;} )\n\t\t\t\t\tfor (var j in indexesToRemoveArray) {\n\t\t\t\t\t\tURLs.splice(indexesToRemoveArray[j], 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Re-order URLs so those with explicit labels appear at the beginning.\n\t\t\t\t\tURLs.sort( function(a, b) {\n\t\t\t\t\t\t\tif (typeof(a) === 'object' && typeof(b) !== 'object') {\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (typeof(a) !== 'object' && typeof(b) === 'object') {\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn URLs;\n\t\t\t}\n\n\n\n\t\t\tvar electronicURLs = cleanURLList();\n\n\t\t\tvar URLsContainer;\n\t\t\tif (electronicURLs && electronicURLs.length != 0) {\n\t\t\t\tURLsContainer = document.createElement('span');\n\n\t\t\t\tfor (var URLNumber in electronicURLs) {\n\t\t\t\t\tvar URLInfo = electronicURLs[URLNumber];\n\t\t\t\t\tvar linkText = localise('Link', linkDescriptions); // default link name\n\t\t\t\t\tvar linkURL = URLInfo;\n\t\n\t\t\t\t\tif (typeof(URLInfo) === 'object' && URLInfo['#text'] !== undefined) {\n\t\t\t\t\t\t// URLInfo is not just an URL but an array also containing the link name\n\t\t\t\t\t\tif (URLInfo['@name'] !== undefined) {\n\t\t\t\t\t\t\tlinkText = localise(URLInfo['@name'], linkDescriptions);\n\t\t\t\t\t\t\tif (URLInfo['@note'] !== undefined) {\n\t\t\t\t\t\t\t\tlinkText += ', ' + localise(URLInfo['@note'], linkDescriptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (URLInfo['@note'] !== undefined) {\n\t\t\t\t\t\t\tlinkText = localise(URLInfo['@note'], linkDescriptions);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (URLInfo['@fulltextfile'] !== undefined) {\n\t\t\t\t\t\t\tlinkText = localise('Document', linkDescriptions);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlinkURL = URLInfo['#text'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlinkText = '[' + linkText + ']';\n\n\t\t\t\t\tif (URLsContainer.childElementCount > 0) {\n\t\t\t\t\t\t// add , as separator if not the first element\n\t\t\t\t\t\tURLsContainer.appendChild(document.createTextNode(', '));\n\t\t\t\t\t}\n\t\t\t\t\tvar link = document.createElement('a');\n\t\t\t\t\tURLsContainer.appendChild(link);\n\t\t\t\t\tlink.setAttribute('href', linkURL);\n\t\t\t\t\tturnIntoNewWindowLink(link);\n\t\t\t\t\tlink.appendChild(document.createTextNode(linkText));\n\t\t\t\t}\n\t\t\t\tURLsContainer.appendChild(document.createTextNode('; '));\n\t\t\t}\n\n\t\t\treturn URLsContainer;\t\t\n\t\t}\n\n\n\n\t\t/*\tcatalogueLink\n\t\t\tReturns a link for the current record that points to the catalogue page for that item.\n\t\t\toutput:\tDOM anchor element pointing to the catalogue page.\n\t\t*/\n\t\tvar catalogueLink = function () {\n\t\t\tvar catalogueURL = location['md-catalogue-url'];\n\t\t\t\n\t\t\tif (catalogueURL && catalogueURL.length > 0) {\n\t\t\t\tcatalogueURL = catalogueURL[0];\n\t\t\t\t\n\t\t\t\t/*\tIf the user does not have a Uni Göttingen IP address\n\t\t\t\t\tand we don’t generally prefer using the Opac, redirect Opac links\n\t\t\t\t\tto GVK which is a superset and offers better services for non-locals.\n\t\t\t\t*/\n\t\t\t\tif (!preferSUBOpac && clientIPAddress.search('134.76.') !== 0) {\n\t\t\t\t\tvar opacBaseURL = 'http://opac.sub.uni-goettingen.de/DB=1';\n\t\t\t\t\tvar GVKBaseURL = 'http://gso.gbv.de/DB=2.1';\n\t\t\t\t\tcatalogueURL = catalogueURL.replace(opacBaseURL, GVKBaseURL);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar targetName = localise(location['@name'], catalogueNames);\n\t\t\tif (catalogueURL && targetName) {\n\t\t\t\tvar linkElement = document.createElement('a');\n\t\t\t\tlinkElement.setAttribute('href', catalogueURL);\n\t\t\t\tturnIntoNewWindowLink(linkElement);\n\t\t\t\tjQuery(linkElement).addClass('pz2-detail-catalogueLink')\n\t\t\t\tvar linkTitle = localise('Im Katalog ansehen');\n\t\t\t\tlinkElement.title = linkTitle;\n\t\t\t\tlinkElement.appendChild(document.createTextNode(targetName));\n\t\t\t}\n\n\t\t\treturn linkElement;\n\t\t}\n\n\n\n\t\tvar locationDetails = [];\n\n\t\tfor ( var locationNumber in data.location ) {\n\t\t\tvar location = data.location[locationNumber];\n\t\t\tvar localURL = location['@id'];\n\t\t\tvar localName = location['@name'];\n\n\t\t\tvar detailsHeading = document.createElement('dt');\n\t\t\tlocationDetails.push(detailsHeading);\n\t\t\tdetailsHeading.appendChild(document.createTextNode(localise('Ausgabe')+':'));\n\n\t\t\tvar detailsData = document.createElement('dd');\n\t\t\tlocationDetails.push(detailsData);\n\n\t\t\tif (location['md-medium'] != 'article') {\n\t\t\t\tappendInfoToContainer( detailInfoItem('edition'), detailsData );\n\t\t\t\tappendInfoToContainer( detailInfoItem('publication-name'), detailsData );\n\t\t\t\tappendInfoToContainer( detailInfoItem('publication-place'), detailsData );\n\t\t\t\tappendInfoToContainer( detailInfoItem('date'), detailsData );\n\t\t\t\tappendInfoToContainer( detailInfoItem('physical-extent'), detailsData );\n\t\t\t\tcleanISBNs();\n\t\t\t\tappendInfoToContainer( detailInfoItem('isbn'), detailsData );\n\t\t\t}\n\t\t\tappendInfoToContainer( electronicURLs(), detailsData);\n\t\t\tappendInfoToContainer( catalogueLink(), detailsData);\n\n\t\t\tif (detailsData.childNodes.length == 0) {locationDetails = [];}\n\t\t}\n\n\t\treturn locationDetails;\n\t}\n\n\n\n\t/*\texportLinks\n\t\tReturns list of additional links provided for the current location.\n\t\toutput:\tDOMElement - markup for additional links\n\t*/\n\tvar exportLinks = function () {\n\n\t\t/*\tcopyObjectContentTo\n\t\t\tCopies the content of a JavaScript object to an XMLElement.\n\t\t\t\t(non-recursive!)\n\t\t\tUsed to create XML markup for JavaScript data we have.\n\n\t\t\tinput:\tobject - the object whose content is to be copied\n\t\t\t\t\ttarget - XMLElement the object content is copied into\n\t\t*/\n\t\tvar copyObjectContentTo = function (object, target) {\n\t\t\tfor (var fieldName in object) {\n\t\t\t\tif (fieldName[0] === '@') {\n\t\t\t\t\t// We are dealing with an attribute.\n\t\t\t\t\ttarget.setAttribute(fieldName.substr(1), object[fieldName]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// We are dealing with a sub-element.\n\t\t\t\t\tvar fieldArray = object[fieldName];\n\t\t\t\t\tfor (var index in fieldArray) {\n\t\t\t\t\t\tvar child = fieldArray[index];\n\t\t\t\t\t\tvar targetChild = target.ownerDocument.createElement(fieldName);\n\t\t\t\t\t\ttarget.appendChild(targetChild);\n\t\t\t\t\t\tif (typeof(child) === 'object') {\n\t\t\t\t\t\t\tfor (childPart in child) {\n\t\t\t\t\t\t\t\tif (childPart === '#text') {\n\t\t\t\t\t\t\t\t\ttargetChild.appendChild(target.ownerDocument.createTextNode(child[childPart]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (childPart[0] === '@') {\n\t\t\t\t\t\t\t\t\ttargetChild.setAttribute(childPart.substr(1), child[childPart]);\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\telse {\n\t\t\t\t\t\t\ttargetChild.appendChild(target.ownerDocument.createTextNode(child))\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\n\n\t\t/*\tnewXMLDocument\n\t\t\tHelper function for creating an XML Document in proper browsers as well as IE.\n\n\t\t\tTaken from Flanagan: JavaScript, The Definitive Guide\n\t\t\thttp://www.webreference.com/programming/javascript/definitive2/\n\n\t\t\tCreate a new Document object. If no arguments are specified,\n\t\t\tthe document will be empty. If a root tag is specified, the document\n\t\t\twill contain that single root tag. If the root tag has a namespace\n\t\t\tprefix, the second argument must specify the URL that identifies the\n\t\t\tnamespace.\n\n\t\t\tinputs:\trootTagName - string\n\t\t\t\t\tnamespaceURL - string [optional]\n\t\t\toutput:\tXMLDocument\n\t\t*/\n\t\tnewXMLDocument = function(rootTagName, namespaceURL) {\n\t\t\tif (!rootTagName) rootTagName = \"\";\n\t\t\tif (!namespaceURL) namespaceURL = \"\";\n\t\t\tif (document.implementation && document.implementation.createDocument) {\n\t\t\t\t// This is the W3C standard way to do it\n\t\t\t\treturn document.implementation.createDocument(namespaceURL, rootTagName, null);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// This is the IE way to do it\n\t\t\t\t// Create an empty document as an ActiveX object\n\t\t\t\t// If there is no root element, this is all we have to do\n\t\t\t\tvar doc = new ActiveXObject(\"MSXML2.DOMDocument\");\n\t\t\t\t// If there is a root tag, initialize the document\n\t\t\t\tif (rootTagName) {\n\t\t\t\t\t// Look for a namespace prefix\n\t\t\t\t\tvar prefix = \"\";\n\t\t\t\t\tvar tagname = rootTagName;\n\t\t\t\t\tvar p = rootTagName.indexOf(':');\n\t\t\t\t\tif (p != -1) {\n\t\t\t\t\t\tprefix = rootTagName.substring(0, p);\n\t\t\t\t\t\ttagname = rootTagName.substring(p+1);\n\t\t\t\t\t}\n\t\t\t\t\t// If we have a namespace, we must have a namespace prefix\n\t\t\t\t\t// If we don't have a namespace, we discard any prefix\n\t\t\t\t\tif (namespaceURL) {\n\t\t\t\t\t\tif (!prefix) prefix = \"a0\"; // What Firefox uses\n\t\t\t\t\t}\n\t\t\t\t\telse prefix = \"\";\n\t\t\t\t\t// Create the root element (with optional namespace) as a\n\t\t\t\t\t// string of text\n\t\t\t\t\tvar text = \"<\" + (prefix?(prefix+\":\"):\"\") +\ttagname +\n\t\t\t\t\t\t\t(namespaceURL\n\t\t\t\t\t\t\t ?(\" xmlns:\" + prefix + '=\"' + namespaceURL +'\"')\n\t\t\t\t\t\t\t :\"\") +\n\t\t\t\t\t\t\t\"/>\";\n\t\t\t\t\t// And parse that text into the empty document\n\t\t\t\t\tdoc.loadXML(text);\n\t\t\t\t}\n\t\t\t\treturn doc;\n\t\t\t}\n\t\t};\n\n\n\n\t\t/*\tdataConversionForm\n\t\t\tReturns the form needed to submit data for converting the pazpar2\n\t\t\trecord for exporting in an end-user bibliographic format.\n\t\t\tinputs:\tlocations - pazpar2 location array\n\t\t\t\t\texportFormat - string\n\t\t\t\t\tlabelFormat - string\n\t\t\toutput:\tDOMElement - form\n\t\t*/\n\t\tvar dataConversionForm = function (locations, exportFormat, labelFormat) {\n\n\t\t\t/*\tserialiseXML\n\t\t\t\tSerialises the passed XMLNode to a string.\n\t\t\t\tinput:\tXMLNode\n\t\t\t\touput:\tstring - serialisation of the XMLNode or null\n\t\t\t*/\n\t\t\tvar serialiseXML = function (XMLNode) {\n\t\t\t\tvar result = null;\n\t\t\t\ttry {\n\t\t\t\t\t// Gecko- and Webkit-based browsers (Firefox, Chrome), Opera.\n\t\t\t\t\tresult = (new XMLSerializer()).serializeToString(XMLNode);\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Internet Explorer.\n\t\t\t\t\t\tresult = XMLNode.xml;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t//Other browsers without XML Serializer\n\t\t\t\t\t\t//alert('XMLSerializer not supported');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\n\t\t\t// Convert location data to XML and serialise it to a string.\n\t\t\tvar recordXML = newXMLDocument('locations');\n\t\t\tvar locationsElement = recordXML.childNodes[0];\n\t\t\tfor (var locationIndex in locations) {\n\t\t\t\tvar location = locations[locationIndex];\n\t\t\t\tvar locationElement = recordXML.createElement('location');\n\t\t\t\tlocationsElement.appendChild(locationElement);\n\t\t\t\tcopyObjectContentTo(location, locationElement);\n\t\t\t}\n\t\t\tvar XMLString = serialiseXML(locationsElement);\n\n\t\t\tvar form;\n\t\t\tif (XMLString) {\n\t\t\t\tform = document.createElement('form');\n\t\t\t\tform.method = 'POST';\n\t\t\t\tvar scriptPath = 'typo3conf/ext/pazpar2/Resources/Public/convert-pazpar2-record.php';\n\t\t\t\tvar scriptGetParameters = {'format': exportFormat}\n\t\t\t\tif (pageLanguage !== undefined) {\n\t\t\t\t\tscriptGetParameters.language = pageLanguage;\n\t\t\t\t}\n\t\t\t\tif (siteName !== undefined) {\n\t\t\t\t\tscriptGetParameters.filename = siteName;\n\t\t\t\t}\n\t\t\t\tform.action = scriptPath + '?' + jQuery.param(scriptGetParameters);\n\n\t\t\t\tvar qInput = document.createElement('input');\n\t\t\t\tqInput.name = 'q';\n\t\t\t\tqInput.setAttribute('type', 'hidden');\n\t\t\t\tqInput.setAttribute('value', XMLString);\n\t\t\t\tform.appendChild(qInput);\n\n\t\t\t\tvar submitButton = document.createElement('input');\n\t\t\t\tsubmitButton.setAttribute('type', 'submit');\n\t\t\t\tform.appendChild(submitButton);\n\t\t\t\tvar buttonText = localise('download-label-' + exportFormat);\n\t\t\t\tsubmitButton.setAttribute('value', buttonText);\n\t\t\t\tif (labelFormat) {\n\t\t\t\t\tvar labelText = labelFormat.replace(/\\*/, buttonText);\n\t\t\t\t\tsubmitButton.setAttribute('title', labelText);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn form;\n\t\t}\n\n\n\n\t\t/*\texportItem\n\t\t\tReturns a list item containing the form for export data conversion.\n\t\t\tThe parameters are passed to dataConversionForm.\n\n\t\t\tinputs:\tlocations - pazpar2 location array\n\t\t\t\t\texportFormat - string\n\t\t\t\t\tlabelFormat - string\n\t\t\toutput:\tDOMElement - li containing a form\n\t\t*/\n\t\tvar exportItem = function (locations, exportFormat, labelFormat) {\n\t\t\tvar form = dataConversionForm(locations, exportFormat, labelFormat);\n\t\t\tvar item;\n\t\t\tif (form) {\n\t\t\t\titem = document.createElement('li');\n\t\t\t\titem.appendChild(form);\n\t\t\t}\n\n\t\t\treturn item;\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\tappendExportItemsTo\n\t\t\tAppends list items with an export form for each exportFormat to the container.\n\t\t\tinputs:\tlocations - pazpar2 location array\n\t\t\t\t\tlabelFormat - string\n\t\t\t\t\tcontainer - DOMULElement the list items are appended to\n\t\t*/\n\t\tvar appendExportItemsTo = function (locations, labelFormat, container) {\n\t\t\tfor (var formatIndex in exportFormats) {\n\t\t\t\tcontainer.appendChild(exportItem(locations, exportFormats[formatIndex], labelFormat));\n\t\t\t}\n\t\t}\n\n\n\n\t\t/*\texportItemSubmenu\n\t\t\tReturns a list item containing a list of export forms for each location in exportFormat.\n\t\t\tinputs:\tlocations - pazpar2 location array\n\t\t\t\t\texportFormat - string\n\t\t\toutput:\tDOMLIElement\n\t\t*/\n\t\tvar exportItemSubmenu = function (locations, exportFormat) {\n\t\t\tvar submenuContainer = document.createElement('li');\n\t\t\tjQuery(submenuContainer).addClass('pz2-extraLinks-hasSubmenu');\n\t\t\tvar formatName = localise('download-label-' + exportFormat);\n\t\t\tvar submenuName = localise('download-label-submenu-format').replace(/\\*/, formatName);\n\t\t\tsubmenuContainer.appendChild(document.createTextNode(submenuName));\n\t\t\tvar submenuList = document.createElement('ul');\n\t\t\tsubmenuContainer.appendChild(submenuList);\n\t\t\tfor (var locationIndex in locations) {\n\t\t\t\tvar itemLabel = localise('download-label-submenu-index-format').replace(/\\*/, parseInt(locationIndex) + 1);\n\t\t\t\tsubmenuList.appendChild(exportItem([locations[locationIndex]], exportFormat, itemLabel));\n\t\t\t}\n\t\t\t\n\t\t\treturn submenuContainer;\n\t\t}\n\n\n\n\t\t/*\tKVKItem\n\t\t\tReturns a list item containing a link to a KVK catalogue search for data.\n\t\t\tUses ISBN or title/author data for the search.\n\t\t\tinput:\tdata - pazpar2 record\n\t\t\toutput:\tDOMLIElement\n\t\t*/\n\t\tvar KVKItem = function (data) {\n\t\t\tvar KVKItem = undefined;\n\n\t\t\t// Check whether there are ISBNs and use the first one we find.\n\t\t\t// (KVK does not seem to support searches for multiple ISBNs.)\n\t\t\tvar ISBN = undefined;\n\t\t\tfor (var locationIndex in data.location) {\n\t\t\t\tvar location = data.location[locationIndex];\n\t\t\t\tif (location['md-isbn']) {\n\t\t\t\t\tISBN = location['md-isbn'][0];\n\t\t\t\t\t// Trim parenthetical information from ISBN which may be in\n\t\t\t\t\t// Marc Field 020 $a\n\t\t\t\t\tISBN = ISBN.replace(/(\\s*\\(.*\\))/, '');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar query = '';\n\t\t\tif (ISBN) {\n\t\t\t\t// Search for ISBN if we found one.\n\t\t\t\tquery += '&SB=' + ISBN;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If there is no ISBN only proceed when we are dealing with a book\n\t\t\t\t// and create a search for the title and author.\n\t\t\t\tvar wantKVKLink = false;\n\t\t\t\tfor (var mediumIndex in data['md-medium']) {\n\t\t\t\t\tvar medium = data['md-medium'][mediumIndex];\n\t\t\t\t\tif (medium === 'book') {\n\t\t\t\t\t\twantKVKLink = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (wantKVKLink) {\n\t\t\t\t\tif (data['md-title']) {\n\t\t\t\t\t\tquery += '&TI=' + encodeURIComponent(data['md-title'][0]);\n\t\t\t\t\t}\n\t\t\t\t\tif (data['md-author']) {\n\t\t\t\t\t\tvar authors = [];\n\t\t\t\t\t\tfor (var authorIndex in data['md-author']) {\n\t\t\t\t\t\t\tvar author = data['md-author'][authorIndex];\n\t\t\t\t\t\t\tauthors.push(author.split(',')[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tquery += '&AU=' + encodeURIComponent(authors.join(' '));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (query !== '') {\n\t\t\t\tvar KVKLink = document.createElement('a');\n\t\t\t\tvar KVKLinkURL = 'http://kvk.ubka.uni-karlsruhe.de/hylib-bin/kvk/nph-kvk2.cgi?input-charset=utf-8&Timeout=120';\n\t\t\t\tKVKLinkURL += localise('&lang=de');\n\t\t\t\tKVKLinkURL += '&kataloge=SWB&kataloge=BVB&kataloge=NRW&kataloge=HEBIS&kataloge=KOBV_SOLR&kataloge=GBV';\n\t\t\t\tKVKLink.href = KVKLinkURL + query;\n\t\t\t\tvar label = localise('KVK');\n\t\t\t\tKVKLink.appendChild(document.createTextNode(label));\n\t\t\t\tvar title = localise('deutschlandweit im KVK suchen');\n\t\t\t\tKVKLink.setAttribute('title', title);\n\t\t\t\tturnIntoNewWindowLink(KVKLink);\n\n\t\t\t\tKVKItem = document.createElement('li');\n\t\t\t\tKVKItem.appendChild(KVKLink);\n\t\t\t}\n\n\t\t\treturn KVKItem;\n\t\t}\n\n\n\n\t\tvar exportLinks = document.createElement('div');\n\t\tjQuery(exportLinks).addClass('pz2-extraLinks');\n\t\tvar exportLinksLabel = document.createElement('span');\n\t\texportLinks.appendChild(exportLinksLabel);\n\t\tjQuery(exportLinksLabel).addClass('pz2-extraLinksLabel');\n\t\texportLinksLabel.appendChild(document.createTextNode(localise('mehr Links')));\n\t\tvar extraLinkList = document.createElement('ul');\n\t\texportLinks.appendChild(extraLinkList);\n\n\t\tif (showKVKLink == 1) {\n\t\t\tappendInfoToContainer(KVKItem(data), extraLinkList);\n\t\t}\n\t\t\n\t\tif (data.location.length == 1) {\n\t\t\tvar labelFormat = localise('download-label-format-simple');\n\t\t\tappendExportItemsTo(data.location, labelFormat, extraLinkList);\n\t\t}\n\t\telse {\n\t\t\tvar labelFormatAll = localise('download-label-format-all');\n\t\t\tappendExportItemsTo(data.location, labelFormatAll, extraLinkList);\n\t\t\t\n\t\t\tif (showExportLinksForEachLocation) {\n\t\t\t\tfor (var formatIndex in exportFormats) {\n\t\t\t\t\textraLinkList.appendChild(exportItemSubmenu(data.location, exportFormats[formatIndex]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn exportLinks;\n\t}\n\n\n\n\t\n\tvar data = hitList[recordID];\n\n\tif (data) {\n\t\tvar detailsDiv = document.createElement('div');\n\t\tjQuery(detailsDiv).addClass('pz2-details');\n\t\tdetailsDiv.setAttribute('id', 'det_' + HTMLIDForRecordData(data));\n\n\t\tvar detailsList = document.createElement('dl');\n\t\tdetailsDiv.appendChild(detailsList);\n\t\tvar clearSpan = document.createElement('span');\n\t\tdetailsDiv.appendChild(clearSpan);\n\t\tjQuery(clearSpan).addClass('pz2-clear');\n\n\t\t/*\tA somewhat sloppy heuristic to create cleaned up author and other-person\n\t\t\tlists to avoid duplicating names listed in title-responsiblity already:\n\t\t\t* Do _not_ separately display authors and other-persons whose apparent\n\t\t\t\tsurname appears in the title-reponsibility field to avoid duplication.\n\t\t\t* Completely omit the author list if no title-responsibility field is present\n\t\t\t\tas author fields are used in its place then.\n\t\t*/\n\t\tvar allResponsibility = '';\n\t\tif (data['md-title-responsibility']) {\n\t\t\tallResponsibility = data['md-title-responsibility'].join('; ');\n\t\t\tdata['md-author-clean'] = [];\n\t\t\tfor (var authorIndex in data['md-author']) {\n\t\t\t\tvar authorName = jQuery.trim(data['md-author'][authorIndex].split(',')[0]);\n\t\t\t\tif (allResponsibility.match(authorName) == null) {\n\t\t\t\t\tdata['md-author-clean'].push(data['md-author'][authorIndex]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdata['md-other-person-clean'] = [];\n\t\tfor (var personIndex in data['md-other-person']) {\n\t\t\tvar personName = jQuery.trim(data['md-other-person'][personIndex].split(',')[0]);\n\t\t\tif (allResponsibility.match(personName) == null) {\n\t\t\t\tdata['md-other-person-clean'].push(data['md-other-person'][personIndex]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tappendInfoToContainer( detailLineAuto('author-clean'), detailsList );\n\t\tappendInfoToContainer( detailLineAuto('other-person-clean'), detailsList )\n\t\tappendInfoToContainer( detailLineAuto('abstract'), detailsList )\n\t\tappendInfoToContainer( detailLineAuto('description'), detailsList );\n\t\tappendInfoToContainer( detailLineAuto('series-title'), detailsList );\n\t\tappendInfoToContainer( ISSNsDetailLine(), detailsList );\n\t\tappendInfoToContainer( detailLineAuto('doi'), detailsList );\n\t\tappendInfoToContainer( detailLineAuto('creator'), detailsList );\n\t\tappendInfoToContainer( locationDetails(), detailsList );\n\t\tappendGoogleBooksElementTo(detailsList);\n\t\tif (useZDB === true) {\n\t\t\taddZDBInfoIntoElement( detailsList );\n\t\t}\n\t\tif (exportFormats.length > 0) {\n\t\t\tappendInfoToContainer( exportLinks(), detailsDiv );\n\t\t}\n\t}\n\n\treturn detailsDiv;\n\n}", "title": "" }, { "docid": "0951c6f969272f802c1d72de2b79debb", "score": "0.61824626", "text": "static html(dto) {\n Card.ensureLoaded();\n return tardigrade.tardigradeEngine.buildHtml(\"Card\", dto);\n }", "title": "" }, { "docid": "0cce24db40680093e2cdfb9cc7354949", "score": "0.6175943", "text": "function display()\n{\n console.log(\"The details of the \" + this.designation +\" are follows\");\n console.log(\"Name -> \" + this.name());\n console.log(\"Id -> \" + this.id);\n console.log(\"Designation -> \" + this.designation);\n console.log(\"gender -> \" + this.gender);\n console.log(\"age -> \" + this.age);\n console.log(\"eyecolor -> \" + this.eyecolor);\n console.log(\"salary -> \" + this.salary);\n \n}", "title": "" }, { "docid": "1c2f5eff56c8ebf43b7868491b352977", "score": "0.6140065", "text": "function display(data){\n return \"<h2>name:\"+data.name+\" \"+data.sys.country+\"</h2>\"+\n \"<h2>longtude:\"+data.coord.lon+\"&deg</h2>\"+\n \"<h2>latitude:\"+data.coord.lat+\"&deg</h2>\"+\n \"<h2>weather condition:\"+data.weather[0].main+\"</h2>\"+\n \"<h2>weather description:<img src='http://openweathermap.org/img/w/'+data.weather[0].icon+'&.png'>\"+data.weather[0].description+\"</h2>\"+\n \"<h2>temp:\"+data.main.temp+\"&deg C</h2>\"+\n \"<h2>temp_min:\"+data.main.temp_min+\"&deg C</h2>\"+\n \"<h2>temp_max\"+data.main.temp_max+\"&deg C</h2>\"+\n \"<h2>humidity:\"+data.main.humidity+\"%</h2>\"+\n \"<h2>pressure:\"+data.main.pressure+\"hpa</h2>\"+\n \"<h2>sea_level:\"+data.main.sea_level+\"hpa</h2>\"+\n \"<h2>grnd_level:\"+data.main.grnd_level+\"hpa</h2>\"+\n \"<h2>wind speed:\"+data.wind.speed+\"m/s</h2>\"+\n \"<h2>wind direction:\"+data.wind.deg+\"&deg</h2>\"+\n \"<h2>clouds:\"+data.clouds.all+\"%</h2>\"\n\n}", "title": "" }, { "docid": "a3ad518b800ebac916ec78fa8dfbd686", "score": "0.6129741", "text": "function draw(coffees) {\n var str = \"\";\n\n var list = Object.keys(coffees);\n for (var i = 0; i < list.length; i++) {\n var coffee = coffees[list[i]];\n str += `<div style=\"float: left; height: 450px\" class=\"col-xl-2 col-lg-3 col-md-4 col-sm-6 col-xs-12\">\n <p><strong><big>${coffee.name}</big></strong></p>\n <img src=\"${coffee.img}\" style=\"height: 225px; width: 300px\" />\n <p>${coffee.price}</p>\n <p style=\"height: 60px\">${coffee.description}</p>\n <a href=\"./details.html?idProdus=${i}\">\n <button style=\"bottom: 10px; background-color: #98002d; color: #fbf5e9; width: 120px; height: 30px; border-radius: 8px;\">DETAILS</button>\n </a>\n </div>`\n \n }\n document.querySelector(\"#coffees\").innerHTML = str;\n}", "title": "" }, { "docid": "0299edb9890f74a81f8bc8b6415e6449", "score": "0.61100143", "text": "function display(data) {\n return \"<h2>City: \" + \"<span class='info'>\" + data.name + \"</span>\" + \"</h2>\" +\n \"<h2>Tempurature: \" + \"<span class='info'>\" + tempRound + \"˚F\" + \"</span>\" + \"</h2>\" +\n \"<h2>Humidity: \" + \"<span class='info'>\" + data.main.humidity + \"%\" + \"</span>\" + \"</h2>\" +\n \"<h2>Conditions: \" + \"<span class='info'>\" + data.weather[0].description + \"</span>\" + \"</h2>\"\n }", "title": "" }, { "docid": "90c440d1f83d764e96701cdfda685546", "score": "0.6105365", "text": "function getPlaceHtml(details) {\n\tvar html = \n\t\t\"UserData:&nbsp;&nbsp;\" + details.userData + \"<br/><br/>\" + \n\t\t\"Location:&nbsp;&nbsp;\" + details.lat + \" / \" + details.lng + \"<br/><br/>\" +\n\t\t\"Name:&nbsp;&nbsp;\" + details.name + \"<br/><br/>\" +\n\t\t\"Address:&nbsp;&nbsp;\" + details.street + \n\t\t\t\", \" + details.town + \n\t\t\t\", \" + details.area + \n\t\t\t\", \" + details.postCode + \n\t\t\t\", \" + details.country + \n\t\t\t\"<br/><br/>\" +\n\t\t\"website:&nbsp;&nbsp;<a href='\" + details.website + \"'>website</a><br/>\" +\n\t\t\"g+&nbsp;&nbsp;<a href='\" + details.url + \"'>google+ page</a><br/>\" +\n\t\t\"Tel:&nbsp;&nbsp;\" + details.telNo\n\treturn html;\n}", "title": "" }, { "docid": "078722ec71ddbef745c0e8e2bcc321e1", "score": "0.6102328", "text": "function DisplayObjects(){\r\n\tbody=$('body');\r\n\r\n\r\n// Pogledaj i ovo moze se pisati i vako ako zelis to su 2 nacina pisanja\r\n\r\n// var Test='<div class=\"holder holder1\"><h5> '+student1.Name+'</h5> </div> ';\r\n\r\n//Napomena mozes pisati na dva nacina html code ovaj gore i ovaj dole nacin DisplayStudents\r\n\r\n\r\n\r\n// Var u kojoj je smjesten cisti Html code sa podacima \r\n\tvar DisplayStudents=`\r\n\r\n\t<div class=\"holders holder1\">\r\n\t<h5>${student1.Name}</h5> \r\n\t<h5>${student1.Adresa}</h5>\r\n\t<h5>${student1.Telefon}</h5>\r\n\t<h5>${student1.Kurs}</h5>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"holders holder2\">\r\n\t<h5>${student2.Name}</h5> \r\n\t<h5>${student2.Adresa}</h5>\r\n\t<h5>${student2.Telefon}</h5>\r\n\t<h5>${student2.Kurs}</h5>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"holders holder3\">\r\n\t<h5>${student3.Name}</h5> \r\n\t<h5>${student3.Adresa}</h5>\r\n\t<h5>${student3.Telefon}</h5>\r\n\t<h5>${student3.Kurs}</h5>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"holders holder4\">\r\n\t<h5>${student4.Name}</h5> \r\n\t<h5>${student4.Adresa}</h5>\r\n\t<h5>${student4.Telefon}</h5>\r\n\t<h5>${student4.Kurs}</h5>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"holders holder5\">\r\n\t<h5>${student5.Name}</h5> \r\n\t<h5>${student5.Adresa}</h5>\r\n\t<h5>${student5.Telefon}</h5>\r\n\t<h5>${student5.Kurs}</h5>\r\n\t</div>\r\n\r\n\t`;\r\n\t\t\r\n\tbody.append(DisplayStudents);\r\n\r\n\r\n///Css rad u css sredivanje class holders\r\n\r\n\r\n//Selektovanje svih holdera\r\n\r\n//Posto svi imaju istu classu holders\r\n\r\n//kada ih selektujemo ima ih 5\r\n\r\nvar Holders=$('.holders');\r\n\r\n//Posto ih ima 5 loopamo kroz Arrey i sredujemo ih sve isto\r\nfor(let i=0;i<Holders.length;i++){\r\n\r\n\t$(Holders[i]).css({ border:'1px solid black',background:'orange',\r\n\tmarginTop:'20px',marginLeft:'auto',marginRight:'auto',width:'200px',textAlign:'center'\t\r\n\r\n\r\n\t })\r\n\r\n}\r\n\r\n}", "title": "" }, { "docid": "15df968d22c93e05f654f5b173e5d4ff", "score": "0.6099983", "text": "function show(data){\n return \"<h2> \" + data.name +\", \" + data.sys.country +\"</h2><br>\" +\n \"<h2> <img src='http://openweathermap.org/img/wn/\" + data.weather[0].icon +\"@2x.png'> </h2>\" + \n \"<h4>Weather : \"+ data.weather[0].main + \"</h4>\" +\n \"<h4>Description : \"+ data.weather[0].description + \"</h4>\" +\n \"<h4>Current Temperature : \"+ data.main.temp + \" &deg;F</h4>\" +\n \"<h4>Highest Temperature : \"+ data.main.temp_max + \" &deg;F</h4>\" +\n \"<h4>Lowest Temperature : \"+ data.main.temp_min + \" &deg;F</h4>\" +\n \"<h4>Humidity : \"+ data.main.humidity + \" %</h4>\" +\n \"<h4>Wind Speed : \"+ data.wind.speed + \" mph</h4>\";\n\n }", "title": "" }, { "docid": "4b11e53b70cdd1c98bd29584547ddd0f", "score": "0.6089583", "text": "function generateHTML(data){\n const html = `\n <h1 class=\"temp\">${data.main.temp}°C</h1>\n <h1 class=\"status\">${data.current.weather_descriptions.map(item => item).join(' ')}</h1>\n <div class=\"more-info\">\n <p>Humidity: ${data.current.humidity}%</p>\n <p>Wind Speed: ${data.current.wind_speed}km/h</p>\n <p>Wind Direction: ${data.current.wind_dir}</p>\n <p>Pressure: ${data.current.pressure}MB</p>\n </div>\n <div class = \"query\">${data.request.query}</div>\n `;\n details.innerHTML = html;\n }", "title": "" }, { "docid": "a75cf217037e82c1ac6dc4808fbdadbd", "score": "0.6080991", "text": "function infoString(obj) \n{\n\tvar part = obj.part;\n\tif (part instanceof go.Adornment) part = part.adornedPart;\n\tvar msg = \"\";\n\tif (part instanceof go.Link) \n\t{ //if the object to inspect is an instance of the Link class\n\t\tvar link = part;\n\t\tmsg = \n\t\t\t\"link/\"+\n\t\t\tlink.data.from+\"/\"+\n\t\t\tlink.data.fromPort+\"/\"+\n\t\t\tlink.data.to+\"/\"+\n\t\t\tlink.data.toPort;\n\t} \n\telse if (part instanceof go.Node) \n\t{ //if the object to inspect is an instance of the Node class\n\t\tvar node = part;\n\t\tvar link = node.linksConnected.first();\n\t\tif (node.data.inOut === 2)\n\t\t{ \t//Case if output layer: only show inservices\n\t\t\tmsg = \n\t\t\t\t\"node/\"+\n\t\t\t\tnode.data.key+\"/\"+\n\t\t\t\tnode.data.name+\"/\"+\n\t\t\t\tnode.data.inservices[0].name+\"/\"+\n\t\t\t\t\"0/\"+\n\t\t\t\tnode.data.layer+\"/\"+\n\t\t\t\tnode.data.color;\n\t\t}\n\t\telse\n\t\t{\t//Case if hidden layer or input layer: show inservices & outservices\n\t\t\tmsg = \n\t\t\t\t\"node/\"+\n\t\t\t\tnode.data.key+\"/\"+\n\t\t\t\tnode.data.name+\"/\"+\n\t\t\t\tnode.data.inservices[0].name+\"/\"+\n\t\t\t\tnode.data.outservices[0].name+\"/\"+\n\t\t\t\tnode.data.layer+\"/\"+\n\t\t\t\tnode.data.color;\n\t\t}\n\t}\n\n\t//========================\n\t//INSPECTOR CHANGE HANDLERS\n\t//========================\n\n\n\t//ACTIVATION HANDLER\n\t$( \"#inspectActiv\" ).change(function() { //captures changes on the identified HTML tag\n\t\tconsole.log( \"Handler for .change() called.\" + this.value + \" \" + obj.part.data);\n\t\tmyDiagram.model.startTransaction(\"activation\");\n\t\tmyDiagram.model.setDataProperty(obj.part.data, \"activation\", this.value); // Binds the new input value (this) with the selected GoJs object\n\t\tmyDiagram.model.updateNames();\n\t\tmyDiagram.model.commitTransaction(\"activation\");\n\t});\n\n\t//INPUT SIZE HANDLER (NODE)\n\t$( \"#inspectInput\" ).change(function() { //captures changes on the identified HTML tag\n\t\tconsole.log( \"Handler for .change() called.\" + this.value );\n\t\tmyDiagram.model.startTransaction(\"inservices_input\");\n\t\tconsole.log(obj.part.data);\n\t\tmyDiagram.model.setDataProperty(obj.part.data.inservices[0], \"name\", this.value); // Binds the new input value (this) with the selected GoJs object\n\t\tmyDiagram.model.updateNames();\n\t\tmyDiagram.model.commitTransaction(\"inservices_input\");\n\t});\n\n\t//OUTPUT SIZE HANDLER (NODE)\n\t$( \"#inspectOutput\" ).change(function() { //captures changes on the identified HTML tag\n\t\tconsole.log( \"Handler for .change() called.\" + this.value );\n\t\tmyDiagram.model.startTransaction(\"outservices_output\");\n\t\tconsole.log(obj.part.data.outservices);\n\t\tmyDiagram.model.setDataProperty(obj.part.data.outservices[0], \"name\", this.value); // Binds the new input value (this) with the selected GoJs object\n\t\tmyDiagram.model.updateNames();\n\t\tmyDiagram.model.commitTransaction(\"outservices_output\");\n\t});\n\t\n\t//INSPECT COLOR HANDLER\n\t$( \"#inspectColor\" ).change(function() { //captures changes on the identified HTML tag\n\t\tconsole.log( \"Handler for .change() called.\" + this.value );\n\t\tmyDiagram.model.startTransaction(\"color\");\n\t\tmyDiagram.model.setDataProperty(obj.part.data, \"color\", this.value); // Binds the new input value (this) with the selected GoJs object\n\t\tmyDiagram.model.commitTransaction(\"color\");\n\t});\n\t\n\treturn msg;\n}", "title": "" }, { "docid": "16b736511b2e6b6d956c4ad314f70616", "score": "0.6080119", "text": "static html(dto) {\n BaseCard.ensureLoaded();\n return tardigrade.tardigradeEngine.buildHtml(\"BaseCard\", dto);\n }", "title": "" }, { "docid": "520b5f1aaac3435cc450c81ff9d7a437", "score": "0.60780823", "text": "function html_generateLayerInfoString(layer_object)\n{\n if (layer_object != null)\n {\n return '<p>' + layer_object.name + '</p>';\n }\n return null;\n}", "title": "" }, { "docid": "49c12823aa2a9e758e3889c3a72157d4", "score": "0.6069654", "text": "function showData(d) {\n var dope, html;\n // console.log(d);\n\n html = \"<div>Name:\" + d.Name + \"</div>\";\n html += \"<div>Time:\" + d.Time + \"</div>\";\n html += \"<div>Rank:\" + d.Place + \"</div>\";\n html += \"<div>Year:\" + d.Year + \"</div>\";\n html += \"<div>Nationality:\" + d.Nationality + \"</div>\";\n if (d.Doping === '') {\n dope = \"None!\"\n } else {\n dope = d.Doping\n }\n html += \"<div>Doping:\" + dope + \"</div>\";\n return html;\n }", "title": "" }, { "docid": "8be91b24f061102bb50723062c96849b", "score": "0.60627437", "text": "function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('fill', 'black')\n .attr('stroke', 'black');\n\n var content =\n '<span class=\"name\">Name: </span><span class=\"value\">'+ d.name +\n '</span><br/>' +\n '<span class=\"name\">Talks: </span><span class=\"value\">'\n + d.nof_talks.toString() +\n '</span><br/>' +\n '<span class=\"name\">Total views: </span><span class=\"value\">' + d.total.toLocaleString() +\n '</span><br/>' +\n '<span class=\"name\">Average views: </span><span class=\"value\">' + d.value.toLocaleString() +\n '</span><br/>' +\n '<span class=\"name\">Year of first appearance: </span><span class=\"value\">' + d.year.toString() +\n '</span>';\n\n tooltip.showTooltip(content, d3.event);\n }", "title": "" }, { "docid": "c72dab481506c884caadddb95a6dcf59", "score": "0.6059447", "text": "static display(card_object, spot){\n const card = document.createElement('div')\n const card_name = document.createElement('h3')\n card_name.className = 'black-text'\n const card_pos = document.createElement('p')\n const short_desc = document.createElement('p')\n const br = document.createElement('br')\n const long_desc = document.createElement('p')\n const header = document.createElement('p')\n const long_desc_div = document.createElement('div')\n card.className =''\n card_name.innerText = card_object.value_int + \" \" + card_object.name\n long_desc.innerText = card_object.desc\n header.innerText = 'More'\n if(card_object.upright) {\n card_pos.innerText = \"upright\";\n short_desc.innerText = \"Meaning: \" + card_object.meaning_up\n }else {\n card_pos.innerText = \"reversed\";\n short_desc.innerText = \"Meaning: \" + card_object.meaning_rev\n }\n spot.appendChild(card_name)\n spot.appendChild(card_pos)\n spot.appendChild(short_desc)\n spot.appendChild(long_desc_div)\n long_desc_div.appendChild(long_desc)\n }", "title": "" }, { "docid": "5020e6e3f9537da70225688fbd433e81", "score": "0.60462564", "text": "function display(data) {\n return \"<h2>City: \" + \"<span class='info'>\" + data.name + \"</span>\" + \"</h2>\" +\n \"<h2>Tempurature: \" + \"<span class='info'>\" + tempRound + \"˚F\" + \"</span>\" + \"</h2>\" +\n \"<h2>Humidity: \" + \"<span class='info'>\" + data.main.humidity + \"%\" + \"</span>\" + \"</h2>\" +\n \"<h2>Conditions: \" + \"<span class='info'>\" + data.weather[0].description + \"</span>\" + \"</h2>\"\n }", "title": "" }, { "docid": "5b3bc24ccdcafdbb3555e84079e2d961", "score": "0.60457385", "text": "function showDetails(string){\n d3.select('#details').html(string);\n\t\n}", "title": "" }, { "docid": "17093f1d4629902b05204d43619e4971", "score": "0.6035", "text": "function show_details(data, i, element) {\r\n\t\t\t\t\t d3.select(element).attr(\"stroke\", \"black\");\r\n\t\t\t\t\t var content = \"<span class=\\\"name\\\">Asset:</span><span class=\\\"value\\\"> \" + data.asset + \"</span><br/>\";\r\n\t\t\t\t\t content +=\"<span class=\\\"name\\\">Op Cost:</span><span class=\\\"value\\\"> $\" + data.opcost + \"million </span><br/>\";\r\n\t\t\t\t\t content +=\"<span class=\\\"name\\\">Year:</span><span class=\\\"value\\\"> \" + data.year + \"</span>\";\r\n\t\t\t\t\t tooltip = CustomTooltip(\"tooltip\", 240),\r\n\t\t\t\t\t tooltip.showTooltip(content, d3.event);\r\n\t\t\t\t\t }", "title": "" }, { "docid": "534ce8b271f307db95c62838fb4eb735", "score": "0.603167", "text": "function indToHTML(item){\n return \"Name: \" + item.name + \" Price: \" + item.price + \"<br>\";\n}", "title": "" }, { "docid": "8fe1147829248cccf1f7fbd571adf5c5", "score": "0.6020653", "text": "details() {\n return tardigrade.tardigradeEngine.getPoint(this.rootElement, \"BaseCard\", { \"details\": 0 });\n }", "title": "" }, { "docid": "d26381150032aedfee825bd142586a2c", "score": "0.6020517", "text": "function showDetails(string){\n d3.select('#details').html(string);\n}", "title": "" }, { "docid": "94163a619adef8c9e83082af15feee03", "score": "0.60103506", "text": "function cardDetails(card, printings, rulings) {\n\n // condition for double-faced cards\n if (card.card_faces && card.layout !== 'adventure') {\n var cardFaceFront = card.card_faces[0];\n var cardFaceBack = card.card_faces[1];\n var imageUrl = cardFaceFront.image_uris.large;\n var imageUrlBack = cardFaceBack.image_uris.large;\n var name = cardFaceFront.name;\n var nameBack = cardFaceBack.name;\n var manaCost = cardFaceFront.mana_cost;\n var manaCostBack = cardFaceBack.mana_cost;\n var types = cardFaceFront.type_line;\n var typesBack = cardFaceBack.type_line;\n var cardText = cardFaceFront.oracle_text;\n var cardTextBack = cardFaceBack.oracle_text;\n var flavorText = cardFaceFront.flavor_text;\n var flavorTextBack = cardFaceBack.flavor_text;\n\n if (flavorText === undefined || flavorTextBack === undefined) {\n flavorText = '';\n }\n\n var artist = cardFaceFront.artist;\n var legalities = card.legalities //object\n var tcg_url = card.purchase_uris.tcgplayer;\n\n var cardHTML =\n\n \"<div id='back'class='action-button'>\" +\n \" <button>Back to results</button>\" +\n \"</div>\" +\n \"<section class='result'>\" +\n \" <div class='info-row'>\" +\n \" <div class='card-image'>\" +\n \" <img id='defaultImg' src=\" + imageUrl + \" alt='\" + name + \" // \" + nameBack + \"' />\" +\n \" <div class='resource-links'>\" +\n \" <a href=\" + card.related_uris.edhrec + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>EDHREC</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" <a href=\" + card.related_uris.mtgtop8 + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>MtGTop8</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" <a href=\" + card.related_uris.gatherer + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>Gatherer</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" </div>\" +\n \" </div>\" +\n \" <div class='card-details'>\" +\n \" <div class='spec-row name'>\" +\n \" <img id='flipside' src='resources/images/card-flip-icon.png'>\" +\n \" <p>\" + name + \" //</br>\" + nameBack + \"</p>\" +\n visualizeManaCost(manaCost) +\n \" </div>\" +\n \" <div class='spec-row'>\" +\n \" <p>\" + types + \" // \" + typesBack + \"</p>\" +\n \" </div>\" +\n \" <div class='spec-row oracle'>\" +\n \" <p>\"+\n visualizeOracleText(cardText) +\n \" </p>\" +\n getFlavor(flavorText) +\n \" <p>\" +\n visualizeOracleText(cardTextBack) +\n \" </p>\" +\n getFlavor(flavorTextBack) +\n \" </div>\" +\n \" <div class='spec-row'>\" +\n \" <p id='artist'>Illustrated by \" + artist + \"</p>\" +\n \" </div>\" +\n getLegalities(legalities) +\n \" </div>\" +\n \" <div class='card-prices'>\" +\n getPrintings(printings) +\n \" </div>\" +\n \" </div>\" +\n \" <div class='rulings-row'>\" +\n \" <p id='rulings-header'>Rulings and information for \" + card.name + \"</p>\" +\n \" <div class='rulings'>\" +\n getRulings(rulings) +\n \" </div>\" +\n \" </div>\" +\n \"</section>\";\n\n return cardHTML;\n\n } else {\n\n var imageUrl = card.image_uris.large;\n var name = card.name;\n var manaCost = card.mana_cost;\n var types = card.type_line;\n\n if (card.layout == 'adventure') {\n var cardText = card.card_faces[0].oracle_text + \"</br></br>\" + card.card_faces[1].oracle_text;\n } else {\n var cardText = card.oracle_text;\n }\n\n var flavorText = card.flavor_text;\n\n if (flavorText === undefined) {\n flavorText = '';\n }\n\n var artist = card.artist;\n var legalities = card.legalities //object\n var tcg_url = card.purchase_uris.tcgplayer;\n\n var cardHTML =\n\n \"<div id='back'class='action-button'>\" +\n \" <button>Back to results</button>\" +\n \"</div>\" +\n \"<section class='result'>\" +\n \" <div class='info-row'>\" +\n \" <div class='card-image'>\" +\n \" <img id='defaultImg' src='\" + imageUrl + \"' alt='\" + name + \"' />\" +\n \" <div class='resource-links'>\" +\n \" <a href=\" + card.related_uris.edhrec + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>EDHREC</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" <a href=\" + card.related_uris.mtgtop8 + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>MtGTop8</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" <a href=\" + card.related_uris.gatherer + \" target='_blank'>\" +\n \" <div class='resource-button'>\" +\n \" <p>Gatherer</p>\" +\n \" </div>\" +\n \" </a>\" +\n \" </div>\" +\n \" </div>\" +\n \" <div class='card-details'>\" +\n \" <div class='spec-row'>\" +\n \" <p>\" + name + \"</p>\" +\n visualizeManaCost(manaCost) +\n \" </div>\" +\n \" <div class='spec-row'>\" +\n \" <p>\" + types + \"</p>\" +\n \" </div>\" +\n \" <div class='spec-row oracle'>\" +\n \" <p>\"+\n visualizeOracleText(cardText) +\n \" </p>\" +\n getFlavor(flavorText) +\n \" </div>\" +\n \" <div class='spec-row'>\" +\n \" <p id='artist'>Illustrated by \" + artist + \"</p>\" +\n \" </div>\" +\n getLegalities(legalities) +\n \" </div>\" +\n \" <div class='card-prices'>\" +\n getPrintings(printings) +\n \" </div>\" +\n \" </div>\" +\n \" <div class='rulings-row'>\" +\n \" <p id='rulings-header'>Rulings and information for \" + card.name + \"</p>\" +\n \" <div class='rulings'>\" +\n getRulings(rulings) +\n \" </div>\" +\n \" </div>\" +\n \"</section>\";\n\n return cardHTML;\n }\n\n }", "title": "" }, { "docid": "4c0fcb58f7e4339dae9d9dc13c1f8f3e", "score": "0.6009832", "text": "function details(mydetails) {\n //create element for get the object name\n var h2 = document.createElement(\"h2\")\n h2.textContent = mydetails.name;\n h2.style.color = \"red\";\n article1.appendChild(h2);\n //create h4 tag for email\n let email = document.createElement(\"h4\");\n email.textContent = mydetails.email;\n article1.appendChild(email);\n //create h4 tag for mobile\n let mobile = document.createElemnt(\"h4\");\n mobile.textContent = mydetails.mobile;\n article1.appendChld(mobile);\n //ankle tag creation\n let btn = document.createElement(\"a\");\n btn.textContent = \"profile\";\n btn.href = \"#\";\n btn.style.textDecoration = \"none\";\n article1.appendChild(btn);\n}", "title": "" }, { "docid": "9d26dc93c79b187bcd9a77574d3a9cc5", "score": "0.600438", "text": "function showDetails(string){\n d3.select('#details').html(string);\n}", "title": "" }, { "docid": "9d26dc93c79b187bcd9a77574d3a9cc5", "score": "0.600438", "text": "function showDetails(string){\n d3.select('#details').html(string);\n}", "title": "" }, { "docid": "cf646f1c985ae23aa771ed55c468450c", "score": "0.5993301", "text": "showDEBUG(wv, person) {\n // DEBUG routine for following section\n function mkStr(obj) {\n if (obj) {\n const s = Object.entries(obj)\n .map(([k, v]) => `${k}: ${v}`)\n .join(\"<br/> \");\n return `<p style=\"font-family: 'Courier New',monospace\">${s}</p>`;\n }\n return \"\";\n }\n\n wv.append(`<p>Person</p>${mkStr(person)}`);\n wv.append(`<p>Data Status</p>${mkStr(person.DataStatus)}`);\n wv.append(`<p>Photo Data</p>${mkStr(person.PhotoData)}`);\n wv.append(`<p>Parents</p>${mkStr(person.Parents)}`);\n wv.append(`<p>Children</p>${mkStr(person.Children)}`);\n wv.append(`<p>Siblings</p>${mkStr(person.Siblings)}`);\n if (person.Spouses && Object.keys(person.Spouses).length > 0) {\n let spHTML = \"\";\n let sp = 0;\n for (const spousesKey in person.Spouses) {\n if (person.Spouses.hasOwnProperty(spousesKey)) {\n const spouse = person.Spouses[spousesKey];\n sp += 1;\n spHTML += `<p>Spouse #${sp}</p>${mkStr(spouse)}`;\n spHTML += `<p>Spouse #${sp} Data Status</p>${mkStr(spouse.data_status)}`;\n }\n }\n wv.append(`<p>Spouses</p>${spHTML}`);\n }\n }", "title": "" }, { "docid": "d4b92d0a942ed86460c7b6085dfb2636", "score": "0.5972727", "text": "function renderDogInfoToPage(dogObj) {\n clearChildren(dogInfo);\n\n let showDogImg = document.createElement(\"img\");\n showDogImg.src = dogObj.image;\n showDogName = dogObj.name;\n goodDogButton = document.createElement(\"button\");\n goodDogButton.dataset.action = \"good-dog-toggle\"\n goodDogButton.id = `${dogObj.id}`;\n if (dogObj.isGoodDog) {\n goodDogButton.textContent = \"Good Dog!\";\n } else {\n goodDogButton.textContent = \"Bad Dog!\";\n };\n dogInfo.append(showDogImg);\n dogInfo.append(showDogName);\n dogInfo.append(goodDogButton);\n}", "title": "" }, { "docid": "f906de0703078d168e89ca435d16c2f1", "score": "0.59697604", "text": "function showDetails(movies){\r\n return `\r\n <div class=\"container-flid\">\r\n <div class=\"row\">\r\n <div class=\"col-md-5\">\r\n <img src=\"${movies.Poster}\" alt=\"${movies.Title}\">\r\n </div>\r\n <div class=\"col-md\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><h4>${movies.Title}(${movies.Released})</h4></li>\r\n <li class=\"list-group-item\"><strong>Genre : </strong>${movies.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Director : </strong>${movies.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer : </strong>${movies.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors : </strong>${movies.Actors}</li>\r\n <li class=\"list-group-item\"><strong>Production : </strong>${movies.Production}</li>\r\n <li class=\"list-group-item\"><strong>Plot : </strong>${movies.Plot}</li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>`\r\n}", "title": "" }, { "docid": "7ffba8aa4e2d634e0cb7365bf1c34feb", "score": "0.595904", "text": "function renderOneDrink (obj) {\n\t$('div.drink_results').html('');\n\t$('form#search').addClass('hidden');\n\t$('input.back').removeClass('hidden');\n\t$('div.drink_result').html(`\n\t\t<div class='drink colu-12 border'>\n\t\t\t<img class=\"drinkPage\" src=${API}/${obj.drinkImage} alt=\"${obj.drinkName}\">\n\t\t\t<h2>Name</h2> <span id=\"${obj.drinkName}\" class=\"result\">${obj.drinkName}</span>\n\t\t\t<h2>User</h2> <span id=\"${obj.user}\" class=\"result\">${obj.user}</span>\n\t\t\t<h2>Glass</h2> <span id=\"${obj.glass}\" class=\"result\">${obj.glass}</span>\n\t\t\t<h2>Ingredents</h2> <span id=\"${obj.ingredents}\" class=\"result\">${splitIng(obj.ingredents)}</span>\n\t\t\t<h2>Garnish</h2> <span id=\"${obj.garnish}\" class=\"result\">${obj.garnish}</span>\n\t\t\t<h2>Instructions</h2> <span id=\"${obj.instructions}\" class=\"result\"> ${obj.instructions}</span>\n\t\t\t<span class=\"hidden\">${obj.id}</span>\n\t\t</div>`\n\t\t// <form id=\"comments\">\n\t\t// \t<label for=\"comments\" class\"sr-only\">\n\t\t// \t\t<input type=\"text\" placeholder=\"Comments\" class=\"form-control\"></label>\n\t\t// </form>\n\t\t// \n\t\t)\n}", "title": "" }, { "docid": "0b7fc80ed2a8896b843758b31044a4c4", "score": "0.59545654", "text": "function showDetails(data, status){\r\n\t\tif(status != \"success\"){\r\n\t\t\tdocument.getElementById('detailsOfRec').innerText=status;\r\n\t\t}else{\r\n\t\t\t//clear out old stuff to start over\r\n\t\t\tvar ele = document.getElementById('detailsOfRec');\r\n\t\t\twhile (ele.firstChild) {\r\n\t\t\t\tele.removeChild(ele.firstChild);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Title section\r\n\t\t\tvar titleH = document.createElement('h1');\r\n\t\t\ttitleH.innerText = data[\"title\"];\r\n\t\t\tele.appendChild(titleH);\r\n\r\n\t\t\t// Data retrieval section\r\n\t\t\tif(typeof data[\"facets\"] != 'undefined'){\r\n\t\t\t\tvar downloadH = document.createElement('h1');\r\n\t\t\t\tdownloadH.innerText = \"Data Retrieval\";\r\n\t\t\t\tele.appendChild(downloadH);\r\n\r\n\t\t\t\tvar metaContent = document.createElement('p');\r\n\t\t\t\tfileFormat = \"Raster\";\r\n\r\n\t\t\t\t// figure out file format\r\n\t\t\t\tfor(var i = 0; i < data[\"facets\"].length; i++){\r\n\t\t\t\t\tif(data[\"facets\"][i][\"className\"] == 'gov.sciencebase.catalog.item.facet.ShapefileFacet'){\r\n\t\t\t\t\t\tfileFormat = \"Vector\";\r\n\t\t\t\t\t\tepsg = data[\"facets\"][i][\"nativeCrs\"];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(data[\"facets\"][i][\"className\"] == 'gov.sciencebase.catalog.item.facet.RasterFacet'){\r\n\t\t\t\t\t\tfileFormat = \"Raster\";\r\n\t\t\t\t\t\tepsg = data[\"facets\"][i][\"nativeCrs\"];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((epsg == '') || (typeof epsg == 'undefined')){\r\n\t\t\t\t\tepsg = \"EPSG:4326\";\r\n\t\t\t\t}\r\n\t\t\t\tmetaContent.innerHTML = \"Data layer is in <b>\" + fileFormat + \"</b> format and in projection <b>\" + epsg + \"</b>.\";\r\n\t\t\t\tele.appendChild(metaContent);\r\n\r\n\t\t\t\t// direct download\t\t\t\r\n\t\t\t\tif(typeof data[\"distributionLinks\"] != 'undefined'){\r\n\t\t\t\t\tfor (var i = 0; i < data[\"distributionLinks\"].length; i++) {\r\n\t\t\t\t\t\tif(data[\"distributionLinks\"][i][\"type\"] == \"downloadLink\"){\r\n\t\t\t\t\t\t\tdownloadUrl = data[\"distributionLinks\"][i][\"uri\"];\r\n\t\t\t\t\t\t\tzipFilename = data[\"distributionLinks\"][i][\"name\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar dbutton = document.createElement('button');\r\n\t\t\t\tdbutton.id = 'dbtn';\r\n\t\t\t\t//dbutton.style = \"display:inline-block\";\r\n\t\t\t\tdbutton.innerHTML = \"Download Full\";\r\n\t\t\t\tdbutton.onclick = download;\r\n\t\t\t\tele.appendChild(dbutton);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tvar tip = document.createElement('p');\r\n\t\t\t\ttip.id = \"dbtntipid\";\r\n\t\t\t\ttip.style = \"display:inline-block\";\r\n\t\t\t\ttip.innerHTML = \"&nbsp;&nbsp;[A save link will show up once it is ready]\";\r\n\t\t\t\tele.appendChild(tip);\r\n\t\t\t\tele.appendChild(document.createElement('br'));\r\n\t\t\t\t\r\n\t\t\t\tvar rbutton = document.createElement('button');\r\n\t\t\t\trbutton.id = 'mdbtn';\r\n\t\t\t\t//rbutton.style = \"display:inline-block\";\r\n\t\t\t\trbutton.innerHTML = \"Mask and Download\";\r\n\t\t\t\trbutton.onclick = reproject_download;\r\n\t\t\t\tele.appendChild(rbutton);\r\n\r\n\t\t\t\tvar tip = document.createElement('p');\r\n\t\t\t\ttip.id = \"mdbtntipid\";\r\n\t\t\t\ttip.style = \"display:inline-block\";\r\n\t\t\t\ttip.innerHTML = \"&nbsp;&nbsp;[A save link will show up once it is ready]<br>\";\r\n\t\t\t\tele.appendChild(tip);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t// Interactive map\r\n\t\t\tvar Lmap = document.createElement('div');\r\n\t\t\tLmap.id = \"map\";\t\t\t\r\n\t\t\tele.appendChild(Lmap);\r\n\t\t\t//create a map object\r\n\t\t\tmap = L.map('map').setView([0, 0], 0);\r\n\t\t\t//base layers\r\n\t\t\tvar grayscale = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\r\n\t\t\t\tmaxZoom: 18,\r\n\t\t\t\tid: 'mapbox.light'\r\n\t\t\t}).addTo(map);\r\n\r\n\t\t\tvar streetmap = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\r\n\t\t\t\tmaxZoom: 18,\r\n\t\t\t\tid: 'mapbox.streets'\r\n\t\t\t}).addTo(map);\r\n\r\n\t\t\t// wms layer\r\n\t\t\tvar wmsurl = \"https://www.sciencebase.gov/catalogMaps/mapping/ows/554ce92be4b082ec54129d8b?service=wms&request=getcapabilities&version=1.3.0\";\r\n\t\t\t\r\n\t\t\tif(typeof data[\"distributionLinks\"] != 'undefined'){\r\n\t\t\t\tfor (var i = 0; i < data[\"distributionLinks\"].length; i++) {\r\n\t\t\t\t\tif(data[\"distributionLinks\"][i][\"title\"] == \"ScienceBase WMS Service\"){\r\n\t\t\t\t\t\twmsurl = data[\"distributionLinks\"][i][\"uri\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t// figure out the layer name\r\n\t\t\t$.get(wmsurl, function(res){\r\n\t\t\t\tlyrname = \"\";\r\n\t\t\t\tvar lyrs = res.getElementsByTagName(\"Capability\")[0].getElementsByTagName(\"Layer\");\r\n\t\t\t\tfor(var i = 0; i < lyrs.length; i++){\r\n\t\t\t\t\tvar val = lyrs[i].getElementsByTagName(\"Name\")[0].childNodes[0].nodeValue;\r\n\t\t\t\t\tif(val == \"sb:footprint\" || val == \"footprint\" || val == \"sb:boundingBox\" || val == \"boundingBox\"){\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlyrname = lyrs[i].getElementsByTagName(\"Name\")[0].childNodes[0].nodeValue;\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\t\r\n\t\t\t\twmslyr = L.tileLayer.wms(wmsurl, {\r\n\t\t\t\t layers: lyrname,\t\t\t\t\r\n\t\t\t\t format: 'image/png',\r\n\t\t\t\t transparent: true\r\n\t\t\t\t});\r\n\t\t\t\tmap.addLayer(wmslyr);\r\n\t\t\t\t\r\n\t\t\t\t// unseens layer\r\n\t\t\t\tmaskwmsurl = geoserverws + \"/wms\"; // test only\t\t\t\t\r\n\t\t\t\tmaskwmslyr = L.tileLayer.wms(maskwmsurl, {\r\n\t\t\t\t\tlayers: 'wsguiming:' + (lyrname.split(\":\")[1]).split(\".\")[0],\t\t\t\t\t\r\n\t\t\t\t format: 'image/png',\r\n\t\t\t\t transparent: true\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// proper extent for this layer\r\n\t\t\t\tvar extent = res.getElementsByTagName(\"Capability\")[0].getElementsByTagName(\"EX_GeographicBoundingBox\")[0];\r\n\t\t\t\tlyrlongmin = extent.getElementsByTagName(\"westBoundLongitude\")[0].childNodes[0].nodeValue;\r\n\t\t\t\tlyrlongmax = extent.getElementsByTagName(\"eastBoundLongitude\")[0].childNodes[0].nodeValue;\r\n\t\t\t\tlyrlatmin = extent.getElementsByTagName(\"southBoundLatitude\")[0].childNodes[0].nodeValue;\r\n\t\t\t\tlyrlatmax = extent.getElementsByTagName(\"northBoundLatitude\")[0].childNodes[0].nodeValue;\t\r\n\r\n\t\t\t\t\r\n\t\t\t\tpolygon = L.polygon([\r\n\t\t\t\t\t[parseFloat(latmin), parseFloat(longmin)],\r\n\t\t\t\t\t[parseFloat(latmax), parseFloat(longmin)],\r\n\t\t\t\t\t[parseFloat(latmax), parseFloat(longmax)],\r\n\t\t\t\t\t[parseFloat(latmin), parseFloat(longmax)]\r\n\t\t\t\t], {\r\n\t\t\t\t\tcolor: 'red',\r\n\t\t\t\t\tweight: 1,\r\n\t\t\t\t\tfillColor: '#f03',\r\n\t\t\t\t\tfillOpacity: 0.1\r\n\t\t\t\t}).addTo(map);\r\n\t\t\t\t\r\n\t\t\t\tmap.fitBounds(L.latLngBounds(\r\n\t\t\t\t\t [parseFloat(latmin), parseFloat(longmin)],\r\n\t\t\t\t\t [parseFloat(latmax), parseFloat(longmax)]\r\n\t\t\t\t\t));\r\n\r\n\t\t\t\t/*var baseLayers = {\r\n\t\t\t\t\t\"Grayscale\": grayscale,\r\n\t\t\t\t\t\"Streets\": streetmap\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar overlays = {\r\n\t\t\t\t\t\"Data map\": wmslyr\r\n\t\t\t\t};*/\r\n\t\t\t\t//\r\n\t\t\t\tlayerControl = L.control.layers({\"<br>Street map\": streetmap},{\"<br>Study Area\": polygon, \"<br>Full map\": wmslyr,\"<br>Masked map\": maskwmslyr}).addTo(map);\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t// Dates section\r\n\t\t\tif(typeof data[\"dates\"] != 'undefined'){\r\n\t\t\t\tvar datesH = document.createElement('h1');\r\n\t\t\t\tdatesH.id = \"dt\";\r\n\t\t\t\tdatesH.innerText = \"Dates\";\r\n\t\t\t\tele.appendChild(datesH);\r\n\t\t\t\tvar datesContent = document.createElement('p');\t\r\n\t\t\t\tdatesText = \"\";\r\n\t\t\t\tfor(var i = 0; i < data[\"dates\"].length; i++){\r\n\t\t\t\t\tlbl = data[\"dates\"][i][\"label\"];\r\n\t\t\t\t\tif(lbl == \"\") {\r\n\t\t\t\t\t\tlbl = data[\"dates\"][i][\"type\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdatesText = datesText + \"<b>\" + lbl + \"</b>: \" + data[\"dates\"][i][\"dateString\"] + \"&nbsp;&nbsp;\"\r\n\t\t\t\t}\r\n\t\t\t\tdatesContent.innerHTML = datesText\r\n\t\t\t\tele.appendChild(datesContent);\r\n\t\t\t}\r\n\r\n\t\t\t// Citation section\r\n\t\t\tif(typeof data[\"citation\"] != 'undefined'){\r\n\t\t\t\tvar citationH = document.createElement('h1');\r\n\t\t\t\tcitationH.innerText = \"Citation\";\r\n\t\t\t\tele.appendChild(citationH);\r\n\t\t\t\tvar citationContent = document.createElement('p');\t\t\t\r\n\t\t\t\tcitationContent.innerText = data[\"citation\"];\r\n\t\t\t\tele.appendChild(citationContent);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t// Summary section\r\n\t\t\tif(typeof data[\"summary\"] != 'undefined'){\r\n\t\t\t\tvar summaryH = document.createElement('h1');\r\n\t\t\t\tsummaryH.id = \"summaryid\";\r\n\t\t\t\tsummaryH.innerText = \"Summary\";\r\n\t\t\t\tele.appendChild(summaryH);\r\n\t\t\t\tvar summaryContent = document.createElement('p');\r\n\t\t\t\tsummaryContent.innerHTML = data[\"body\"];\r\n\t\t\t\tele.appendChild(summaryContent);\r\n\t\t\t}\r\n\r\n\t\t\t// Tag section\t\r\n\t\t\tif(typeof data[\"tags\"] != 'undefined'){\t\r\n\t\t\t\ttagText = \"\";\r\n\t\t\t\tfor(var i = 0; i < data[\"tags\"].length; i++){\r\n\t\t\t\t\tif(data[\"tags\"][i][\"type\"] == 'Theme'){\r\n\t\t\t\t\t\ttagText = tagText + data[\"tags\"][i][\"name\"] + \" | \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(tagText != \"\"){\r\n\t\t\t\t\tvar tagH = document.createElement('h1');\r\n\t\t\t\t\ttagH.innerText = \"Tags\";\r\n\t\t\t\t\tele.appendChild(tagH);\r\n\t\t\t\t\tvar tagContent = document.createElement('p');\r\n\t\t\t\t\ttagContent.innerHTML = tagText\r\n\t\t\t\t\tele.appendChild(tagContent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// External link section\r\n\t\t\tvar linkSB = document.createElement('a');\r\n\t\t\tlinkSB.id = \"externalLinkID\";\r\n\t\t\tlinkSB.innerHTML = \"<br>Find out full details on ScienceBase.gov\";\r\n\t\t\tlinkSB.href = data[\"link\"][\"url\"];\r\n\t\t\tlinkSB.target = \"_blank\";\r\n\t\t\tele.appendChild(linkSB);\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "5e5c7a664f349561f7b076352a251ba5", "score": "0.5946489", "text": "function Infos(obj) {\n this.PADDING = 20;\n this.FONT_FAMILY = 'Arial';\n this.FONT_SIZE = '0.9em';\n this.INDENT_SIZE = 20;\n \n this.indentLevel = 0;\n this.obj = obj;\n this.DOM = $('<div></div>');\n \n this.initDOM();\n }", "title": "" }, { "docid": "bb345b089f08f158083e8865c715e39d", "score": "0.5942848", "text": "function fnFormatDetails ( oTable, nTr, details, img, duration ){\n\t\tvar aData = oTable.fnGetData( nTr );\n\t\tsOut = '<div class=\"grid-inner-content\">'+details+'</div>';\n\t\t\n\t\treturn sOut;\n\t}", "title": "" }, { "docid": "170a519aee3e40db7c85ced6f0db2a95", "score": "0.59396505", "text": "function printObject(object) {\n\t\t\tfor(var p in object) {\n\t\t\t\t// Ignore the first element\n\t\t\t\tif(p === \"0-Custom\"){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Create a format HTML element for each amiibo\n\t\t\t\tvar node = document.createElement(\"TR\");\n\t\t\t\tvar remove = document.createElement(\"TD\");\n\n\t\t\t\tvar objectRemove = document.createElement(\"input\");\n\t\t\t\tobjectRemove.type = \"checkbox\";\n\t\t\t\tobjectRemove.id = (object[p][\"Name\"] + \"-Remove\");\n\t\t\t\tobjectRemove.checked = false;\n\t\t\t\tremove.appendChild(objectRemove);\n\t\t\t\tnode.appendChild(remove);\n\t\t\t\t// Create a TD section for Number\n \t \t\t\tvar number = document.createElement(\"TD\");\n\t\t\t\tvar objectNumber = document.createTextNode(object[p][\"Number\"]);\n \t \t\t\tnumber.appendChild(objectNumber);\n \t \t\t\tnode.appendChild(number);\n\t\t\t\t// Create a TD section for Name\n\t\t\t\tvar name = document.createElement(\"TD\");\n\t\t\t\tvar objectName = document.createTextNode(object[p][\"Name\"]);\n\t\t\t\tname.appendChild(objectName);\n\t\t\t\tnode.appendChild(name);\n\t\t\t\t// Create a TD section for the image\n\t\t\t\tvar image = document.createElement(\"TD\");\n\t\t\t\tvar objectImage = document.createElement(\"img\");\n\t\t\t\tobjectImage.src = object[p][\"Image\"];\n\t\t\t\tobjectImage.class = \"amiiboImg\";\n\t\t\t\tobjectImage.id = \"picture\";\n\t\t\t\tobjectImage.style.width = \"100%\";\n\t\t\t\timage.appendChild(objectImage);\n\t\t\t\tnode.appendChild(image);\n\t\t\t\t// Create a TD section for Game Origin\n\t\t\t\tvar gameOrigin = document.createElement(\"TD\");\n\t\t\t\tvar objectGameOrigin = document.createTextNode(object[p][\"GameOrigin\"]);\n\t\t\t\tgameOrigin.appendChild(objectGameOrigin);\n\t\t\t\tnode.appendChild(gameOrigin);\n\t\t\t\t// Create a TD section for Date Release\n\t\t\t\tvar dateRelease = document.createElement(\"TD\");\n\t\t\t\tvar objectDateRelease = document.createTextNode(object[p][\"DateRelease\"]);\n\t\t\t\tdateRelease.appendChild(objectDateRelease);\n\t\t\t\tnode.appendChild(dateRelease);\n\t\t\t\t// Create a TD section for Wave\n\t\t\t\tvar wave = document.createElement(\"TD\");\n\t\t\t\tvar objectWave = document.createTextNode(object[p][\"Wave\"]);\n\t\t\t\twave.appendChild(objectWave);\n\t\t\t\tnode.appendChild(wave);\n\t\t\t\t// Create a TD section for Exclusive\n\t\t\t\tvar exclusive = document.createElement(\"TD\");\n\t\t\t\tvar objectExclusive = document.createTextNode(object[p][\"Exclusive\"]);\n\t\t\t\texclusive.appendChild(objectExclusive);\n\t\t\t\tnode.appendChild(exclusive);\n\t\t\t\t// Create a TD section for Description\n\t\t\t\tvar description = document.createElement(\"TD\");\n\t\t\t\tvar objectDescription = document.createTextNode(object[p][\"Description\"]);\n\t\t\t\tdescription.appendChild(objectDescription);\n\t\t\t\tnode.appendChild(description);\n\t\t\t\t// Create a TD section for Rarity\n\t\t\t\tvar rarity = document.createElement(\"TD\");\n\t\t\t\tvar objectRarity = document.createTextNode(object[p][\"Rarity\"]);\n\t\t\t\trarity.appendChild(objectRarity);\n\t\t\t\tnode.appendChild(rarity);\n\t\t\t\t// Create a TD section for Ownership\n\t\t\t\tvar have = document.createElement(\"TD\");\n\t\t\t\tvar objectHave = document.createElement(\"input\");\n\t\t\t\tobjectHave.type = \"checkbox\";\n\t\t\t\tobjectHave.id = (object[p][\"Name\"] + \"-Checked\");\n\t\t\t\tobjectHave.checked = object[p][\"Have\"];\n\t\t\t\tobjectHave.disabled = true;\n\t\t\t\thave.appendChild(objectHave);\n\t\t\t\tnode.appendChild(have);\n\t\t\t\tdocument.getElementById(\"customAmiiboTable\").appendChild(node);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "773d396292dabfb112faf8534b0e3f71", "score": "0.59387755", "text": "function tr_buildToolDetails(details) {\r\n // build the rental terms freebie list (weekends/holidays free?)\r\n var freebies = \"\";\r\n if (!details.costs.weekday) freebies += \"&bull; Free weekdays!<br/>\";\r\n if (!details.costs.weekend) freebies += \"&bull; Free weekends<br/>\";\r\n if (!details.costs.holiday) freebies += \"&bull; Free holidays<br/>\";\r\n\r\n var detailElm = `<div class=\"tool-detail-new\">\r\n <img src=\"image/tool/${details.code}.png\" style=\"width: 100%; height: 160px;\" />\r\n <div style=\"padding: 5px;\">\r\n ${details.brand} ${details.tooltype}\r\n <br/>$${details.costs.charge} daily charge\r\n <p style=\"margin: 8px 0;\">${freebies}</p>\r\n <span class=\"item-note\">*Item condition may vary</span>\r\n </div>\r\n </div>`;\r\n\r\n return detailElm;\r\n}", "title": "" }, { "docid": "333b5692de73f596809a5c38ac468492", "score": "0.5936725", "text": "function DescriptionOf(product) {\n var dl = document.getElementById(\"productDetail\");\n while (dl.lastChild !== null) { dl.lastChild.remove(); }\n const dt1 = document.createElement(\"h3\");\n dt1.innerText=product.title;\n const dd1 =document.createElement(\"dd\");\n dd1.innerText=\"\";\n dl.appendChild(dt1);\n dl.appendChild(dd1);\n\n if((product.description).toString()!=\" \") {\n\n const dt2 = document.createElement(\"h4\");\n dt2.innerText = \"Introduction\";\n const dd2 = document.createElement(\"dd\");\n dd2.innerText = product.description;\n dl.appendChild(dt2);\n dl.appendChild(dd2);\n }\n\n if((product.rationale).toString()!=\" \"){\n const dt3 =document.createElement(\"h4\");\n dt3.innerText=\"Rationale\";\n const dd3 =document.createElement(\"dd\");\n dd3.innerText=product.rationale;\n dl.appendChild(dt3);\n dl.appendChild(dd3);\n }\n if((product.marketPotential).toString()!=\" \") {\n\n const dt4 = document.createElement(\"h4\");\n dt4.innerText = \"Market Potential\";\n const dd4 = document.createElement(\"dd\");\n dd4.innerText = product.marketPotential;\n dl.appendChild(dt4);\n dl.appendChild(dd4);\n }\n\n if((product.rawMaterial).toString()!=\" \") {\n\n const dt5 = document.createElement(\"h4\");\n dt5.innerText = \"Raw Material\";\n const dd5 = document.createElement(\"dd\");\n dd5.innerText = product.rawMaterial;\n dl.appendChild(dt5);\n dl.appendChild(dd5);\n }\n if((product.technology).toString()!=\" \") {\n\n const dt6 = document.createElement(\"h4\");\n dt6.innerText = \"Technology\";\n const dd6 = document.createElement(\"dd\");\n dd6.innerText = product.technology;\n dl.appendChild(dt6);\n dl.appendChild(dd6);\n }\n if((product.benefits).toString()!=\" \") {\n\n const dt7 = document.createElement(\"h4\");\n dt7.innerText = \"Benefits\";\n const dd7 = document.createElement(\"dd\");\n dd7.innerText = product.benefits;\n dl.appendChild(dt7);\n dl.appendChild(dd7);\n }\n\n const dt8 =document.createElement(\"h4\");\n dt8.innerText=\"Detail study\";\n const dd8 =document.createElement(\"dd\");\n const a = document.createElement(\"a\");\n a.target=\"_blank\";\n a.rel=\"noopener noreferrer\";\n a.href=\"http://www.projectethio.com/\";\n a.classList=\"btn btn-success btn-lg\"\n const span =document.createElement(\"span\");\n span.classList=\"glyphicon glyphicon-download\";\n span.innerText=\"Download\";\n a.appendChild(span);\n dd8.appendChild(a);\n dl.appendChild(dt8);\n dl.appendChild(dd8);\n}", "title": "" }, { "docid": "40140c731fa4ca2334fdaba80adaa1d3", "score": "0.5933393", "text": "function createDetails (jsonElement)\n{\n\tvar size = Math.round(parseInt(Base64.decode(jsonElement.size)) / 1024 / 1024);\n\tvar duration = Math.round(parseInt(Base64.decode(jsonElement.duration)) / 60);\n\tvar file_type = Base64.decode(jsonElement.file_type);\n\tvar resolution_w = Base64.decode(jsonElement.resolution_w);\n\tvar resolution_h = Base64.decode(jsonElement.resolution_h);\n\tvar aspect_ratio = Base64.decode(jsonElement.aspect_ratio);\n\t\n\t$('section.secondary').empty();\n\t$('section.secondary').append('<h2>Details</h2>');\n\t$('section.secondary').append('<p><strong>Size:</strong> ' + size + ' MB</p>');\n\t$('section.secondary').append('<p><strong>Duration:</strong> ' + duration + ' min</p>');\n\t$('section.secondary').append('<p><strong>Type:</strong> ' + file_type + '</p>');\n\t$('section.secondary').append('<p><strong>Resolution:</strong> ' + resolution_w + ' x ' + resolution_h + ' (' + aspect_ratio + ')</p>');\n}", "title": "" }, { "docid": "68c433fbf8b34847313480f75c82d063", "score": "0.5930673", "text": "function data_getDetails(xml_object) {\n\treturn {\n\t\t\t'description': xml_object.children('description').text(),\n\t\t\t'name': \txml_object.attr('name')\n\t};\n}", "title": "" }, { "docid": "8dbebdac937f6102da3ede40d7ddf81e", "score": "0.5921948", "text": "function renderDrink (obj) {\n\t$('div.drink_results').html('');\n\tif (obj.length === 0) {\n\t\t$('div.error').html(`\n\t\t\t<p style='color: red; text-align: center;'>No drinks with that name.</p>`)\n\t}\n\tfor (let i=0; i<obj.length; i++) {\n\t\tconst drink = `\n\t\t<div class='drink_log colu-4 border'>\n\t\t<img class=\"result\" src=${API}/${obj[i].drinkImage} alt=\"${obj[i].drinkName}\">\n\t\t<span class=\"result\">Name: ${obj[i].drinkName}</span>\n\t\t<span class=\"result\">User: ${obj[i].user}</span>\n\t\t<span class=\"result\">Glass: ${obj[i].glass}</span>\n\t\t<button id=${obj[i].id} class=\"drink_btn btn btn-block btn-primary\">Learn more about this drink</button>\n\t\t</div>`\n\t\tconsole.log(obj[i]);\n\t\t$('div.drink_results').append(drink);\n\t};\n}", "title": "" }, { "docid": "9deed2e044a45ff9f4a383fd094a8f55", "score": "0.5891234", "text": "function multiplex_main_info(o){\n \tvar view = '<div>'\n\t+'\t<img src=\"'+o.ctx+'/resources/img/multiplex/theater.jpg\" alt=\"\" />'\n\t+'\t</div>'\n\t+'\t<div id=\"multiplex_info\">'\n\t+'\t\t<h2><strong>'+o.multiplex_name+'</strong></h2>'\n\t+'\t\t<table id=\"multiplex_info_table\">'\n\t+'\t\t\t<tr>'\n\t+'\t\t\t\t<td>'+o.multiplex_addr+' </td>'\n\t+'\t\t\t\t<td><strong>총 상영관수</strong></td>'\n\t+'\t\t\t\t<td>'+o.count+'개관</td>'\n\t+'\t\t\t\t<td><strong>총 좌석수</strong></td>'\n\t+'\t\t\t\t<td>'+o.seat_total+'석</td>'\n\t+'\t\t\t</tr>'\n\t+'\t\t</table>'\n\t+'\t</div>'\n\t+'\t<div id=\"multiplex_info_btn\">'\n\t+'\t\t<ul>'\n\t+'\t\t<li><a href=\"javascript:abb1.jquery.multiplex_main('+o.seq+')\"><strong>상영시간표</strong></a></li>'\n\t+'\t\t<li><a href=\"javascript:abb1.jquery.multiplex_map('+o.seq+')\"><strong>위치정보</strong></a></li>'\n\t+'\t\t</ul>'\n\t+'\t</div>';\n\treturn view;\n}", "title": "" }, { "docid": "865c2aac2c31e2e1320723da507976cd", "score": "0.58800244", "text": "function showDetail(){\n new EJS({url: 'templates/demographics.ejs'}).update('demographics', {demographics: demographics});\n new EJS({url: 'templates/immunizations.ejs'}).update('immunizations', {immunizations: immunizations});\n new EJS({url: 'templates/encounters.ejs'}).update('encounters', {encounters: encounters});\n new EJS({url: 'templates/medications.ejs'}).update('medications', {medications: medications});\n new EJS({url: 'templates/problems.ejs'}).update('problems', {problems: problems});\n new EJS({url: 'templates/procedures.ejs'}).update('procedures', {procedures: procedures});\n}", "title": "" }, { "docid": "d1ab116a9aed9948e3e215e285f1b8da", "score": "0.587151", "text": "function createDetail() {\n inputStr = \"<details id=\" + IDControl + \" name=\" + IDControl + \" title=\" + IDControl + \">\" +\n \"<summary>LogiGear</summary>\"+\n \"<p>Founded in 1994 by top thought leaders in the software testing industry, LogiGear has completed over 3,000 projects </p>\" +\n \"for hundreds of companies across a broad range of industries and technologies.</p>\"+\n \"</details>\";\n document.write(inputStr);\n}", "title": "" }, { "docid": "9523da6cb0ca17d4c4ae04bc51a967c2", "score": "0.5868886", "text": "function showDetails(id){\n var htmlElement = $('#pDetailsTable');\n data = pokemonDict[id];\n\n // empty current details data that is displayed\n $('#pDetails').empty();\n htmlElement.empty();\n \n // atribute name is needed for referencing to it when filtering Pokemons\n // using showCertainType function\n $('#pDetails').attr('name', id);\n\n //insert name and id\n $('#pDetails').append('<h3>' + data.name + ' # ' + id + '</h3>');\n \n // insert picture\n insertPicture(id, $('#pDetails'));\n\n // insert all other characteristics\n \n // go through ecery characteristic\n $.each(characteristics, function(index, value){\n\n if (value == 'types'){\n // add \"Type\" row\n htmlElement.append('<tr><td><p><strong>Type</strong></p></td><td><p id = \"types\"></p></tr>');\n \n // add types to next cell\n $.each(data[value], function(index, value){\n\n $('html #types').append(value.name.toUpperCase() + ' ');\n \n });\n\n } else if (value == 'moves'){\n // insert row with the NUMBER of moves\n htmlElement.append('<tr><td><p><strong>' + capitalizeFirstLetter(value) + ' </strong></p></td><p><td>'+ data[value].length + '</p></tr>');\n } else {\n // add all other characteristics\n htmlElement.append('<tr><td><p><strong>' + capitalizeFirstLetter(value) + ' </strong></p></td><td><p>'+ data[value] + '</p></td></tr>');\n }\n\n });\n\n}", "title": "" }, { "docid": "d54b1ed6d159610d2eeb63a7c67e565e", "score": "0.58588797", "text": "function viewDetails() {\n let detailsElemnt = \"\";\n let stateValue = selectState.value;\n let localGovtValue = localGov.value;\n detailsElemnt += `<p><strong>State:</strong> ${stateValue}</p>\n <p><strong>Local Government:</strong> ${localGovtValue}</p>`;\n document.getElementById(\"details\").innerHTML = detailsElemnt;\n}", "title": "" }, { "docid": "b634a4d972c6e84991aa88dec60cbbf8", "score": "0.5854307", "text": "function detailsView(entry, divName) {\n\tdivName = divName || containerDiv;\n\tconsole.log(\"detailsView(\" + entry.id + \", \" + divName + \")\");\n\tvar container = document.getElementById(divName);\n\n\tvar html = fetchEntryHtml(entry);\n\n\t//only render valid html as snippets, not errors\n\tif (html) {\n\t\t//clear container\n\t\tclearElements(container);\n\t\tvar wrapper = document.createElement(\"div\");\n\t\twrapper.setAttribute(\"class\", \"details-wrapper\");\n\n\t\t//create the head\n\t\t\tvar shead = document.createElement(\"div\");\n\t\t\tshead.setAttribute(\"class\", \"details-head\");\n\t\t\tvar sp = document.createElement(\"p\");\n\n\n\t\t\t//add the <tags>\n\t\t\tvar ss = document.createElement(\"span\");\n\t\t\tss.setAttribute(\"class\", \"tags\");\n\t\t\tif (entry.tags.length > 0) {\n\t\t\t\t//sp.appendChild(document.createTextNode(\" added to '\" + entry.tags.join(\", \") + \"'\"));\n\t\t\t\tfor(var j = 0; j <entry.tags.length; j++ ){\n\t\t\t\t\tvar ta = document.createElement(\"a\");\n\t\t\t\t\tta.setAttribute(\"id\", entry.tags[j]);\n\t\t\t\t\tta.setAttribute(\"href\", \"#\" + entry.tags[j]);\n\t\t\t\t\t//ta.setAttribute(\"onclick\", \"snippetView(getEntriesByTag('\" + entry.tags[j] + \"'));return false;\");\n\t\t\t\t\t//ta.setAttribute(\"onclick\", \"document.location.href='./#\" + entry.tags[j]+\"';\");\n\t\t\t\t\tta.appendChild(document.createTextNode(entry.tags[j]));\n\n\t\t\t\t\tss.appendChild(ta);\n\t\t\t\t\t//if tags in not the only one, or not the last one add separator\n\t\t\t\t\tif (entry.tags.length >1 && j !== entry.tags.length - 1) {ss.appendChild(document.createTextNode(\", \"));}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsp.appendChild(ss);\n\t\t\tsp.appendChild(document.createTextNode(\" \\xBB \"));\n\n\t\t\tvar sa = document.createElement(\"a\");\n\t\t\tsa.setAttribute(\"id\", entry.id);\n\t\t\tsa.setAttribute(\"class\", \"link\");\n\t\t\tsa.setAttribute(\"href\", \"#\" + entry.id);\n\n\t\t\t//add the properties\n\t\t\t//sa.setAttribute(\"onclick\", \"showEntry('\" + entry.id + \"');return false;\");\n\t\t\t//sa.setAttribute(\"onclick\", \"document.location.href='./#\" + entry.id + \"';\");\n\t\t\tvar title = (entry.title.length > 25)? entry.title.slice(0, 25) + \"...\" : entry.title;\n\t\t\tsa.appendChild(document.createTextNode(title));\n\t\t\t//sa.appendChild(shead);\n\n\t\t\tsp.appendChild(sa);\n\n\t\t\t//created on <date/month/year>, pubDate considered valid if only year is mentioned\n\t\t\tif (entry.pubDate.getYear()) {\n\t\t\t\t//var pd = entry.pubDate.getDate();\n\t\t\t\t//var pm = entry.pubDate.getMonth() + 1;\n\t\t\t\t//var py = entry.pubDate.getFullYear();\n\t\t\t\t//sp.appendChild(document.createTextNode(\" added on \" + pd + \"/\" + pm + \"/\" + py));\n\t\t\t\tsp.appendChild(document.createTextNode(\" on \" + entry.pubDate.toLocaleDateString()));\n\t\t\t}\n\t\t\tshead.appendChild(sp);\n\n\t\t//element body - heading and mini version of the content\n\t\t\tvar sbody = document.createElement(\"div\");\n\t\t\tsbody.setAttribute(\"class\", \"details-body\");\n\t\t\t//sbody.setAttribute(\"onclick\", \"showEntry('\" + entry.id + \"');return false;\");\n\t\t\t//sbody.setAttribute(\"onclick\", \"document.location.href='./#\" + entry.id + \"';\");\n\t\t\tsbody.innerHTML = html;\n\n\t\t//add the elemeents\n\t\twrapper.appendChild(shead);\n\t\twrapper.appendChild(sbody);\n\n\t\t//add to container\n\t\tcontainer.appendChild(wrapper);\n\t}\n\tscroll(0,posTop); //scroll to top after the entry loads, set the px value in config depending on header height\n}", "title": "" }, { "docid": "95b4555f05fdacde1121f227de13f00b", "score": "0.58459044", "text": "function printCard() { //Hämta kort från loc och skriv ut dem\n setObjects(\"todo\", todo_info)\n setObjects(\"doing\", doing_info)\n setObjects(\"testing\", testing_info)\n setObjects(\"done\", done_info)\n}", "title": "" }, { "docid": "f64c0cf4446cff7113abc70e66f3e2cb", "score": "0.5839721", "text": "function displayDetailsData(data) {\n const country = data[0];\n const flag = country.flag;//catch country flag\n const name = country.name;// catch country name\n const capital = country.capital;//catch country capital\n const subregion = country.subregion;//catch country subregion\n const callingCodes = country.callingCodes[0];//catch country callingCodes\n const language = country.languages[0].name;//catch country language\n const currency = country.currencies[0].name;//catch country currency\n const area = country.area;//catch country area\n const population = country.population;//catch country population\n const altSpellings = country.altSpellings[1];//catch country altSpellings\n const timezones = country.timezones[0];//catch country timezones\n\n\n //displaying\n getId('country-flag').src = flag;//display country flag\n getId('country-name').innerText = name;//display country name\n getId('country-subregion').innerText = subregion;//display country name\n getId('capital').innerText = capital;//display country capital\n getId('phone-code').innerText = '+' + callingCodes;//display country countryCallingCodes\n getId('language').innerText = language;//display country language\n getId('timezones').innerText = timezones;//display country timezones\n getId('currency').innerText = currency;//display country currency\n if (altSpellings) {\n getId('altSpellings').innerText = altSpellings;//display country altSpellings\n }\n getId('area').innerText = area + ' km²';//display country area\n getId('population').innerText = (population / 1000000).toFixed(1) + \" Million (2019) World Bank.\";//display country population\n\n}", "title": "" }, { "docid": "607b74eda5d3bc8ac6f8c8d424fdc0d4", "score": "0.5822979", "text": "function allDetails(r) {\n document.getElementById('dog').innerHTML += '</br><h1 class=\"jumbotron text-danger\">' + dogs[r].name + '</h1>'\n + '<div class=\"row\">'\n + '<div class=\"col\">'\n + '<img id=\"dog' + id.toString() + '\" class=\"img-thumbnail myDogs\" src=\" ' + dogs[r].photo1 + '\" alt=\"Dog\"/>'\n + '</div>'\n + '<div class=\"col\">'\n + '</br></br> Breed : <h5 class=\"text-danger\" >' + dogs[r].breed + '</h5>'\n + '</br> Age : <h5 class=\"text-danger\" > ' + dogs[r].age + '</h5>'\n + '</br> Height : <h5 class=\"text-danger\" >' + dogs[r].height + '</h5>'\n + '</div>'\n + '</div>';\n id++;\n}", "title": "" }, { "docid": "a6929882a72c4c4f3c4a7d9c304efc32", "score": "0.5817017", "text": "function displayObject(obji, func) {\n if ( obji == null || typeof(obji) == 'undefined'){ return null }\n if ( obji.hasOwnProperty(\"fields\") && obji.fields==undefined ){ return null }\n\n // RECIEVE OBJECT\n // console.log('Display', obji)\n\n // Render Object for each objKey : value pair\n return Object.keys(obji).map(objKey => {\n\tlet keyVal = obji[objKey];\n\n let isArr = Array.isArray( keyVal );\n\tlet isObj = typeof keyVal === 'object'; \n\t// Within a Layers Drawer Create a Drawer to house the a Drawer for each field.\n\tif( isArr ){\n // USE: Display Fields Array from the Dictionary\n\t if( objKey == 'preloadfilter' ){ return null }\n\t console.log( '-- Creating Fields Drawer From Array' )\n\t return <details key={Math.random()} className='settingsDetails' open> \n\t <summary> {objKey} </summary> \n\t {displayObject(keyVal, func)} \n\t </details>\n\t}\n\telse if ( isObj ){\n\t // USE: layer, fields\n let field = createFkey(keyVal); \n if(keyVal.hasOwnProperty(\"alias\")){ field.fkey=keyVal.key+'_'+keyVal.name ; field.flabel=keyVal.alias }\n\t console.log( `-- -- Creating \"${field.flabel}\" Drawer for Field from Object`)\n\t return <details key={Math.random()} className='settingsDetails'>\n\t <summary data-detail={field.fkey} > {field.flabel} </summary> \n\t {displayObject(keyVal, func)} \n\t </details> \n\t}\n\telse{\n // its not an array and its not an obj.\n \t // Render Input\n\t let input = <CreatableSelect isClearable placeholder={ JSON.stringify(keyVal).replace(/['\"]+/g, '') } onChange={func}/>\n let field = createFkey(obji, objKey)\n\t return <div key={Math.random()*100} className={'settingsTextBoxWrapper'} data-detail={field.fkey} ><label> {objKey} </label> : {input} </div>\n\t}\n } )\n}", "title": "" }, { "docid": "cc61bf46c42b4c02d69d6b1fb0db3520", "score": "0.58131176", "text": "function printDetails(detailsArray) {\n document.getElementById('hours').innerHTML = '';\n\n // Break up array of hours, create container for each day\n for (let day of detailsArray[1]) {\n var placeDay = document.createElement('p');\n var placeHours = document.createTextNode(day);\n placeDay.appendChild(placeHours);\n document.getElementById('hours').appendChild(placeDay);\n }\n\n document.getElementById('name').innerHTML = detailsArray[0];\n document.getElementById('rating').innerHTML = detailsArray[3];\n document.getElementById('reviews').innerHTML = detailsArray[4];\n document.getElementById('address').innerHTML = detailsArray[5];\n\n if (typeof detailsArray[2] !== 'undefined') {\n document.getElementById('price').innerHTML = detailsArray[2];\n }\n if (typeof detailsArray[2] !== 'undefined') {\n document.getElementById('website').innerHTML = '<a href=\"' + detailsArray[6] + '\" target=\"_blank\">' + detailsArray[6] + '</a>';\n }\n // Show details div\n if (detailDiv.style.display === 'none') {\n detailDiv.style.display = 'block';\n }\n}", "title": "" }, { "docid": "aceebc0e8c52ac2fa0dbeb18942f73af", "score": "0.5812253", "text": "function showDetails(d) {\n // Changes the person's bubble outline to show you're hovering over it.\n d3.select(this).attr('stroke', 'yellow');\n \n var content = '<span class=\"name\">Country: </span><span class=\"value\">' +\n d.country +\n '</span><br/>' +\n '<span class=\"name\">Sex: </span><span class=\"value\">' +\n d.sex +\n '</span><br/>' +\n '<span class=\"name\">Age: </span><span class=\"value\">' +\n d.age +\n '</span>';\n \n tooltip.showTooltip(content, d3.event);\n }", "title": "" }, { "docid": "0c9aa87d9076ea542ccc74699cca5ef6", "score": "0.58067024", "text": "getDetails(){\n return \" Contact details: \"+this.firstName+\" \"+this.lastName+\" , \"+this.address\n +\" , \"+ this.email;\n }", "title": "" }, { "docid": "a7758aac5438596c8329f8cf904520ed", "score": "0.58054936", "text": "function showObjectsAttributes(leObject, whereToShow) {\n var text = \"<ul>\";\n for(var key in leObject) {\n text += \"<li>\";\n text += \"<strong>\" + leObject[key][0] + \"</strong> \";\n for(i=1; i<leObject[key].length-1; i++) {\n text += leObject[key][i] + \", \";\n }\n text += leObject[key][leObject[key].length-1];\n text += \"</li>\"\n }\n text += \"</ul>\";\n $(whereToShow).html(text);\n}", "title": "" }, { "docid": "f65ca658f62c9f3de2162eec9dac39bb", "score": "0.5804681", "text": "function all_info() {\n\n for (var key in object) {\n var property = object[key];\n switch (key) {\n case \"organisasjonsnummer\":\n var description = document.createElement(\"p\");\n description.textContent = object[key];\n orgnr.appendChild(description);\n break;\n case \"navn\":\n var description = document.createElement(\"p\");\n description.textContent = object[key];\n navn.appendChild(description);\n break;\n case \"organisasjonsform\":\n var description = document.createElement(\"p\");\n description.textContent = object[key];\n orgform.appendChild(description);\n break;\n case \"forretningsadresse\":\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"adresse\"];\n adresse.appendChild(description);\n\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"postnummer\"] + \" \" + value[\"poststed\"];\n postnummer.appendChild(description);\n\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"kommunenummer\"] + \" \" + value[\"kommune\"];\n kommune.appendChild(description);\n\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"land\"];\n land.appendChild(description);\n break;\n case \"maalform\":\n var description = document.createElement(\"p\");\n description.textContent = object[key];\n malform.appendChild(description);\n break;\n case \"registreringsdatoEnhetsregisteret\":\n var description = document.createElement(\"p\");\n description.textContent = object[key];\n enhetsregisteret.appendChild(description);\n break;\n case \"stiftelsesdato\":\n var description = document.createElement(\"p\");\n description.textContent = object[\"stiftelsesdato\"];\n stiftelsesdato.appendChild(description);\n break;\n case \"naeringskode1\":\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"kode\"] + \" \" + value[\"beskrivelse\"];\n naeringskode1.appendChild(description);\n break;\n case \"institusjonellSektorkode\":\n var description = document.createElement(\"p\");\n var value = object[key];\n description.textContent = value[\"kode\"] + \" \" + value[\"beskrivelse\"];\n institusjonellSektorkode.appendChild(description);\n break;\n case \"frivilligRegistrertIMvaregisteret\":\n var description = document.createElement(\"p\");\n description.textContent = object[\"frivilligRegistrertIMvaregisteret\"];\n frivilligmva.appendChild(description);\n break;\n case \"sisteInnsendteAarsregnskap\":\n var description = document.createElement(\"p\");\n description.textContent = object[\"sisteInnsendteAarsregnskap\"];\n aarsregnskap.appendChild(description);\n break;\n case \"antallAnsatte\":\n var description = document.createElement(\"p\");\n description.textContent = object[\"antallAnsatte\"];\n ansatte.appendChild(description);\n break;\n case \"hjemmeside\":\n var description = document.createElement(\"a\");\n var linkText = document.createTextNode(\"Hjemmeside\");\n description.appendChild(linkText);\n description.href = \"https://\" + object[\"hjemmeside\"];\n hjemmeside.appendChild(description);\n break;\n default:\n break;\n }\n }\n }", "title": "" }, { "docid": "5a6302d7f75de6c59e7bf2b1c10b58ac", "score": "0.5800677", "text": "function dom(foodObj) {\n let string = `<div>\n <h1>${foodObj.name}</h1> \n <p>${foodObj.countryOfOrigin}</p>\n <p>${foodObj.sugarPerServing}</p>\n <p>${foodObj.CaloriesPerServing}</p>\n <p>${foodObj.fatPerServing}</p>\n `\n string +=`<p>`\n\n\n// looks through ingredients because it was an object in database\n foodObj.ingredients.forEach(ing => {\n string += ing.text + ', '\n })\n\n string += `</p>`\n\n string += `</div>`\n container.innerHTML += string;\n}", "title": "" }, { "docid": "1eb103fb34e453f3e1ece2723560fede", "score": "0.579993", "text": "function buildEventDetailElement(object){\n var title = object.get(\"title\");\n var location = object.get(\"location\");\n var time = object.get(\"time\");\n var visibility = object.get(\"visibility\");\n var description = object.get(\"description\");\n var commentNumber = object.get(\"commentNumber\");\n var holder = object.get(\"owner\");\n var goingId = object.get(\"goingId\");\n if (typeof(goingId) == \"undefined\") {\n goingId = [];\n }\n var goingNumber = goingId.length;\n var interestId = object.get(\"interestId\");\n if (typeof(interestId) == \"undefined\") {\n interestId = [];\n }\n var interestNumber = interestId.length;\n var id = object.id;\n var newElement = \"\";\n newElement = newElement + \"<div id=\\'body-event-detail-\"+id+\"\\'>\";\n newElement = newElement + \"<div class='custom-corners-public custom-corners'>\";\n newElement = newElement + \"<div class='ui-bar ui-bar-a' style='cursor:pointer' onclick=\\\"$.mobile.changePage(\\'#page-display-user-profile\\');\\\">\";\n newElement = newElement + \"<div><strong id=\\'body-top-bar-event-detail-\"+id+\"-owner-name\\'></strong></div>\";\n newElement = newElement + \"<div id=\\'body-top-bar-event-detail-\"+id+\"-owner-gender\\' class=\\'ui-icon-custom-gender\\'></div>\";\n newElement = newElement + \"</div>\";\n newElement = newElement + \"<div class='ui-body ui-body-a'>\";\n newElement = newElement + \"<p class='ui-custom-event-title'>\" + title + \"</p>\";\n if (description.length == 0) {\n newElement = newElement + \"<p class='ui-custom-event-description-less-margin'></br></p>\";\n } else {\n newElement = newElement + \"<p class='ui-custom-event-description'>\" + description.replace(\"\\n\",\"</br>\") + \"</p>\";\n }\n newElement = newElement + \"<p class='ui-custom-event-location'>\" + location + \"</p>\";\n newElement = newElement + \"<p class='ui-custom-event-time'>\" + time + \"</p>\";\n newElement = newElement + \"<div class='event-statistics comment-statistics-\"+id+\"' style='clear:both'>\" + commentNumber + \" Comments</div><div class='event-statistics interest-statistics-\"+id+\"'>\" + interestNumber + \" Interests</div><div class='event-statistics going-statistics-\"+id+\"'>\" + goingNumber + \" Goings</div>\";\n newElement = newElement + \"</div>\";\n newElement = newElement + \"<div class='ui-footer ui-bar-custom'>\";\n if (interestId.indexOf(Parse.User.current().id) < 0) {\n newElement += \"<div class='ui-custom-float-left'><a href='#' class='ui-btn ui-bar-btn-custom ui-mini ui-icon-custom-favor-false interest-button-\"+id+\"' onclick='addInterestEvent(\\\"\"+id+\"\\\")'>\"+\"Interest\"+\"</a></div>\"\n } else {\n newElement += \"<div class='ui-custom-float-left'><a href='#' class='ui-btn ui-bar-btn-custom ui-mini ui-icon-custom-favor-true interest-button-\"+id+\"' onclick='removeInterestEvent(\\\"\"+id+\"\\\")'>\"+\"Interest\"+\"</a></div>\"\n }\n if (goingId.indexOf(Parse.User.current().id) < 0) {\n newElement = newElement + \"<div class='ui-custom-float-left'><a href='#' class='ui-btn ui-bar-btn-custom ui-mini ui-icon-custom-going-false going-button-\"+id+\"' onclick='addGoingEvent(\\\"\"+id+\"\\\")'>\"+\"Going\"+\"</a></div>\";\n } else {\n newElement = newElement + \"<div class='ui-custom-float-left'><a href='#' class='ui-btn ui-bar-btn-custom ui-mini ui-icon-custom-going-true going-button-\"+id+\"' onclick='removeGoingEvent(\\\"\"+id+\"\\\")'>\"+\"Going\"+\"</a></div>\";\n }\n newElement = newElement + \"</div>\";\n newElement = newElement + \"</div>\";\n newElement = newElement + \"</div>\";\n\n return newElement;\n}", "title": "" }, { "docid": "9e39fdb6a0ecc50531d0e59d9eb4783d", "score": "0.5797875", "text": "function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('stroke', 'black');\n\n var content = '<span class=\"name\">Title: </span><span class=\"value\">' +\n d.name +\n '</span><br/>' +\n '<span class=\"name\">Amount: </span><span class=\"value\">$' +\n addCommas(d.value) +\n '</span><br/>' +\n '<span class=\"name\">Percent of Total Income: </span><span class=\"value\">' +\n d.percentTotal +\n '%</span>';\n\n tooltip.showTooltip(content, d3.event);\n }", "title": "" }, { "docid": "970ddc5297a1f75cbace88c8be74be54", "score": "0.5795337", "text": "function foodInfoDetails(foodInfo) {\n console.log(foodInfo);\n var result = \"<p> No information to display. </p>\"\n if (Object.keys(foodInfo).length != 0) {\n result = \"<p> Allergens: \" + foodInfo.allergens + '</p>' +\n \"<p> Serving Size: \" + foodInfo.serving_size + '</p>' +\n \"<p> Calories: \" + foodInfo.calories + '</p>' +\n \"<p> Calories from Fat: \" + foodInfo.calories_from_fat + '</p>' +\n \"<p> Protein: \" + foodInfo.protein + '</p>' +\n \"<p> Total Fat: \" + foodInfo.total_fat + '</p>'\n }\n return result;\n}", "title": "" }, { "docid": "f580b3454a9ef58103d81832d5b4d8a5", "score": "0.5792329", "text": "function fnFormatDetails(nTr, id) {\r\n\t\t\t\t\t\tvar dataEntry = opentox.oTable.fnGetData(nTr);\r\n\t\t\t\t\t\tvar sOut = '<div class=\"ui-widget\" style=\"margin-top: 5x;\" >';\r\n\t\t\t\t\t\tsOut += '<div style=\"min-height:250px\">';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsOut += '<table width=\"100%\" style=\"min-height:250px\"><tbody><tr>';//outer table, can't get the style right with divs\r\n\r\n\t\t\t\t\t\t//structure\r\n\t\t\t\t\t\tsOut += '<td valign=\"top\" style=\"min-height:250px;max-width:260px\">';\r\n\t\t\t\t\t\tsOut += '<a href=\"'+dataEntry.compound.URI+'\">';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar cmpURI = dataEntry.compound.URI;\r\n\t\t\t\t\t\tif (dataEntry.compound.URI.indexOf(\"/conformer\")>=0) {\r\n\t\t\t\t\t\t\tcmpURI = dataEntry.compound.URI.substring(0,dataEntry.compound.URI.indexOf(\"/conformer\"));\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\tsOut += '<img class=\"ui-widget-content ui-corner-top ui-corner-bottom\" style=\"min-height:250px;min-width:250px\" src=\"' \r\n\t\t\t\t\t\t\t\t\t+ cmpURI + '?media=image/png\" title=\"'+cmpURI+'\" border=\"0\">';\r\n\t\t\t\t\t\tsOut += '</a><br>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar identifier = false;\r\n\t\t\t\t\t\t//names\r\n\t\t\t\t\t $.each(opentox.feature, function(k, value) {\r\n\t\t\t\t\t\t if (value.sameAs == \"http://www.opentox.org/api/1.1#ChemicalName\") {\r\n\t\t\t\t\t\t \tif (dataEntry.values[k]) {\r\n\t\t\t\t\t\t \t\tsOut += '<strong>' + dataEntry.values[k] + '</strong>';\r\n\t\t\t\t\t\t \t\tsOut += '<br>';\r\n\t\t\t\t\t\t \t\tidentifier=true;\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t }; \r\n\t\t\t\t\t\t });\r\n\t\t\t\t\t\t//cas\r\n\t\t\t\t\t if (!identifier)\r\n\t\t\t\t\t $.each(opentox.feature, function(k, value) {\r\n\t\t\t\t\t\t if (value.sameAs == \"http://www.opentox.org/api/1.1#CASRN\") {\r\n\t\t\t\t\t\t \tif (dataEntry.values[k]) {\r\n\t\t\t\t\t\t \t\tsOut += '<strong>CAS RN</strong> ' + dataEntry.values[k];\r\n\t\t\t\t\t\t \t\tsOut += '<br>';\r\n\t\t\t\t\t\t \t\tidentifier=true;\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t }; \r\n\t\t\t\t\t\t });\r\n\t\t\t\t\t\t//einecs\r\n\t\t\t\t\t if (!identifier)\r\n\t\t\t\t\t $.each(opentox.feature, function(k, value) {\r\n\t\t\t\t\t\t if (value.sameAs == \"http://www.opentox.org/api/1.1#EINECS\") {\r\n\t\t\t\t\t\t \tif (dataEntry.values[k]) {\r\n\t\t\t\t\t\t \t\tsOut += '<strong>EINECS</strong> ' + dataEntry.values[k];\r\n\t\t\t\t\t\t \t\tsOut += '<br>';\r\n\t\t\t\t\t\t \t\tidentifier=true;\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t }; \r\n\t\t\t\t\t\t });\r\n\t\t\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t\t\t\t//reach\r\n\t\t\t\t\t if (!identifier)\r\n\t\t\t\t\t $.each(opentox.feature, function(k, value) {\r\n\t\t\t\t\t\t if (value.sameAs == \"http://www.opentox.org/api/1.1#REACHRegistrationDate\") {\r\n\t\t\t\t\t\t \tif (dataEntry.values[k]) {\r\n\t\t\t\t\t\t \t\tsOut += '<strong>REACH registration date:</strong> ' + dataEntry.values[k];\r\n\t\t\t\t\t\t \t\tsOut += '<br>';\r\n\t\t\t\t\t\t \t\tidentifier=true;\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t }; \r\n\t\t\t\t\t\t });\r\n\t\t\t\t\t \r\n\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//properties\r\n\t\t\t\t\t\tsOut += '<td>';\r\n\t\t\t\t\t\tsOut += '<table id=\"'+ id +'\" class=\"values\" >';\r\n\t\t\t\t\t\tsOut += '<thead><tr><th>Type</th><th>Calculated</th><th>Property</th><th>Value</th></tr></thead>';\r\n\t\t\t\t\t\tsOut += '<tbody>';\r\n\t\t\t\t\t\tfor (key in dataEntry.values) \r\n\t\t\t\t\t\t\tif (dataEntry.values[key]) {\r\n\t\t\t\t\t\t\t\tsOut += '<tr>';\r\n\r\n\t\t\t\t\t\t\t\t//type (sameas)\r\n\t\t\t\t\t\t\t\tvar sameAs = opentox.feature[key][\"sameAs\"]; \t\r\n\t\t\t\t\t\t\t\tsOut += '<td title=\"Same as the OpenTox ontology entry defined by '+sameAs+'\">';\r\n\t\t\t\t\t\t\t\tif (sameAs.indexOf(\"http\")>=0) {\r\n\t\t\t\t\t\t\t\t\tvar hash = sameAs.lastIndexOf(\"#\");\r\n\t\t\t\t\t\t\t\t\tif (hash>0) sOut += sameAs.substring(hash+1).replace(\"_\",\" \").substring(0,30);\r\n\t\t\t\t\t\t\t\t\telse sOut += sameAs.substring(0,30);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\t\t\t\t\t//calculated\r\n\t\t\t\t\t\t\t\tvar source = opentox.feature[key][\"source\"][\"type\"];\r\n\t\t\t\t\t\t\t\tvar hint = \"Imported from a dataset\";\r\n\t\t\t\t\t\t\t\tif (source==\"Algorithm\" || source==\"Model\") {\r\n\t\t\t\t\t\t\t\t\thint = \"Calculated by \" + source;\r\n\t\t\t\t\t\t\t\t\tsource = '<a href=\"'+opentox.feature[key][\"source\"][\"URI\"]+'\">Yes</a>';\r\n\t\t\t\t\t\t\t } else source=\"\";\r\n\t\t\t\r\n\t\t\t\t\t\t\t\tsOut += '<td title=\"'+hint+'\">';\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsOut += source;\r\n\t\t\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t//name, units\r\n\t\t\t\t\t\t\t\tsOut += '<td title=\"OpenTox Feature URI: '+key+'\">';\r\n\t\t\t\t\t\t\t\tsOut += '<a href=\"' + key + '\">';\r\n\t\t\t\t\t\t\t\tsOut += opentox.feature[key][\"title\"];\r\n\t\t\t\t\t\t\t\tsOut += '</a>';\r\n\t\t\t\t\t\t\t\tsOut += opentox.feature[key][\"units\"];\r\n\t\t\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\thint = 'Numeric:&nbsp;'+opentox.feature[key][\"isNumeric\"];\r\n\t\t\t\t\t\t\t\thint += '\\nNominal:&nbsp;'+opentox.feature[key][\"isNominal\"];\r\n\t\t\t\t\t\t\t\thint += '\\nSource:&nbsp;'+opentox.feature[key][\"source\"][\"URI\"];\r\n\t\t\t\t\t\t\t\thint += '\\nSource type:&nbsp;'+opentox.feature[key][\"source\"][\"type\"];\r\n\t\t\t\t\t\t\t\tsOut += '<td title=\"' + hint + '\">';\r\n\t\t\t\t\t\t\t\t//for handling the broken Toxtree html output...\r\n\t\t\t\t\t\t\t\tsOut += decodeEntities(dataEntry.values[key]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\t\t\t\t\tsOut += '</tr>\\n';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsOut += '</tbody></table>\\n';\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tsOut += '</td>';\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t//outer table\r\n\t\t\t\t\t\tsOut += '</tr></tbody></table>';\r\n\t\t\t\t\t\t//sOut += '</div>\\n';//widget header\r\n\t\t\t\t\t\tsOut += '</div>\\n';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn sOut;\r\n\t\t\t\t\t}", "title": "" }, { "docid": "ed45c21fc4002ee16641ed841962781d", "score": "0.57904214", "text": "function printObjectElement(obj, idElement) {\n var content = \"\";\n for (var property in obj) {\n content += \"<li><strong>\" + property + \":</strong> \" + obj[property] + \"</li>\";\n }\n idElement.innerHTML = content;\n}", "title": "" }, { "docid": "0e228539db7cad3746bd1c0f35e8a109", "score": "0.577764", "text": "function generateHtml(photoInfo) {\r\n\tlogError(\"Made it all the way through for \" + photoInfo.ID)\r\n\t\r\n\ttext = \"<pre>\" +\r\n\t\t\"photoInfo.license: \" + photoInfo.license + \"\\n\" +\r\n\t\t\"photoInfo.username: \" + photoInfo.username + \"\\n\" +\r\n\t\t\"photoInfo.smallURL: \" + photoInfo.smallURL + \"\\n\" +\r\n\t\t\"photoInfo.smallWidth: \" + photoInfo.smallWidth + \"\\n\" +\r\n\t\t\"photoInfo.smallHeight: \" + photoInfo.smallHeight + \"\\n\" +\r\n\t\t\"photoInfo.photoID: \" + photoInfo.photoID + \"\\n\" +\r\n\t\t\"photoInfo.userID: \" + photoInfo.userID + \"\\n\" +\r\n\t\t\"</pre>\"\r\n\t\t\r\n\t// Mark Pilgrim's thumbnail + attribution, from http://diveintomark.org/archives/2007/01/16/spaceships\r\n\t// <div class=\"punch\">\r\n\t// <img width=\"240\" height=\"152\" title=\"\" alt=\"[spaceship]\" src=\"http://diveintomark.org/public/2007/01/spaceship.jpg\"/>\r\n\t// <br/>\r\n\t// <span>\r\n\t// <a href=\"http://flickr.com/photos/mamchenkov/172181935/\">Spaceship</a>\r\n\t// ý\r\n\t// <a href=\"http://flickr.com/people/mamchenkov/\">Leonid Mamchenkov</a>\r\n\t// /\r\n\t// <a href=\"http://creativecommons.org/licenses/by/2.0/\" title=\"used under Creative Commons Attribution 2.0 License\">CC</a>\r\n\t// </span>\r\n\t// </div>\r\n\t\r\n\thtml = \"<div style='width:\" + photoInfo.smallWidth + \"; float:right; text-align:right; font-size:xx-small; border-width:1px; border-color:#444444; border-style:solid; padding:3px; margin-bottom:30px; margin-left:30px;'>\\n\" + \r\n\t\t\"<img width='\" + photoInfo.smallWidth + \"' height='\" + photoInfo.smallHeight + \"' \" +\r\n\t\t\t\"alt='\" + photoInfo.title + \"' src='\" + photoInfo.smallURL + \"'>\\n\" +\r\n\t\t\"<br/>\\n\" +\r\n\t\t\"<a href='http://flickr.com/photos/\" + photoInfo.userID + \"/\" + photoInfo.photoID + \"/'>\" +\r\n\t\t \tphotoInfo.title + \"</a>\\n\" +\r\n\t\t\"<br/>&copy;\\n\" +\r\n\t\t\"<a href='http://flickr.com/people/\" + photoInfo.userID + \"'>\" + photoInfo.userName + \"</a>\\n\" +\r\n\t\t\"<br/><a href='\" + photoInfo.licenseUrl + \"'>\" +\r\n\t\t\t\"<img src='\" + photoInfo.licenseImg + \"' title='used under a Creative Commons \" + photoInfo.licenseName + \"' \" +\r\n\t\t\t\t\"width='80' height='15' border='0'/></a>\\n\" +\r\n\t\t\"</div>\\n\"\r\n\r\n\thtmlEscaped = html.replace(\"&\", \"&amp;\")\r\n\ttext = \"<table cellspacing='10'><tr><td valign='top'><textarea cols='60' rows='20'>\" + htmlEscaped + \"</textarea></td><td valign='top'>\" + html + \"</td></tr></table>\"\r\n\r\n\toutputDiv.innerHTML = text\r\n}", "title": "" }, { "docid": "00ae5395c0b6300ca2d249ae0f6403db", "score": "0.5768225", "text": "function displayPlaneDetails(planeIndex) {\n\tvar span ;\n\tvar thisPlane = allPlanes[planeIndex] ;\n\n\tspan = document.getElementById('reservationDetails') ;\n\tspan.innerHTML = '<b>' + thisPlane.id + '</b><br/>' ;\n\tif (thisPlane.commentaire) span.innerHTML += '<i>' + thisPlane.commentaire + '</i><hr>' ;\n\tif (thisPlane.ressource == 0) { // Engine index only valid for planes\n\t\tspan.innerHTML += 'Compteur relev&eacute; par ' + thisPlane.compteur_pilote_nom + ' en date du ' + thisPlane.compteur_pilote_date + ': ' + thisPlane.compteur_pilote + '<br/>' ;\n\t\tspan.innerHTML += 'Compteur relev&eacute; par le club en date du ' + thisPlane.compteur_date + ': ' + thisPlane.compteur ;\n\t\tif (thisPlane.actif == 2)\n\t\t\tspan.innerHTML += \"<br/><span style=\\\"color: red\\\">\\nCet avion est r&eacute;serv&eacute; aux instructeurs et &agrave; leurs &eacute;l&egrave;ves.\\n</span>\\n\" ;\n\t}\n\tspan.style.backgroundColor = 'lightGray' ;\n\tspan.style.visibility = 'visible' ;\n}", "title": "" }, { "docid": "a7f79c5bbd67311e0cda89d291fbe2a0", "score": "0.5760362", "text": "function showEdition(d){\n\n \tdetail.html(\n \t\t\"<h5 style='margin:0px;'>\" + d.EDITION + \"</h5><br/>\" +\n \t\t\"<strong>Winner: </strong>\" + d.TEAMS + \"<br/>\" + \n \t\t\"<strong>Goals: </strong>\" + d.GOALS + \"<br/>\" + \n \t\t\"<strong>Ave Goals: </strong>\" + d.AVERAGE_GOALS + \"<br/>\" + \n \t\t\"<strong>Matches: </strong>\" + d.MATCHES + \"<br/>\" + \n \t\t\"<strong>AVe Atten: </strong>\" + d.AVERAGE_ATTENDANCE\n\t\t);\n \treturn detail.style(\"border\", \"1px solid black\");\n\t}", "title": "" }, { "docid": "7e5d29b8ed0c184b19e64552bad6aac9", "score": "0.57587737", "text": "function _draw() {\n let template = ''\n let houses = _houseService.Houses\n\n houses.forEach((house, index) => {\n template += house.Template\n })\n document.querySelector(\"#houses\").innerHTML = template\n}", "title": "" }, { "docid": "e045fec42266ab43960e3c44b5b7b404", "score": "0.5758299", "text": "function renderGuest(guestObj) {\n for (var guest in guestObj) {\n html = \"<tr><td><span class='freind_name'>\" + guestObj[guest].name\n + \"</span></td></tr>\"\n $('#guest_list').append(html);\n }\n}", "title": "" }, { "docid": "114ba6ff93890f79ead9de5c11a0d439", "score": "0.5757399", "text": "function ObjectPanelInfo(){\n\n\tvar Info = new Object;\n\n\t//static render info\n\tInfo.m_StaticRenderInfo = {\n\t\t'topPad': 3,\n\t\t'bottomPad': 3,\n\t\t'leftPad': 3,\n\t\t'rightPad': 3,\n\n\t\t//pad in a part\n\t\t'withinoriginXPad': 3,\n\t\t'withinoriginYPad': 3,\n\n\t\t//height pad between different parts\n\t\t'titleoriginPad':3,\n\t\t'origindefinedPad': 3\n\t};\n\n\tInfo.m_ObjectRenderInfo = {\n\t\t'ltwidth': 20,\n\t\t'lrwidthgap': 5,\n\t\t'tbheightgap': 5,\n\t\t'ltheight': 10,\n\t\t'fontSize': 10,\n\t\t'bheight': 10\n\t};\n\n\tInfo.m_titleFontSize = 12;\n\n\t/* Geo Info */\n\tInfo.m_ObjectGroupRenderInfo = {};//the whole group panel\n\tInfo.m_mapGroupIdRenderInfo = {};//the map from group id to its render info \n\n\t//left,top,width,height\n\tInfo.m_TitleRenderInfo = {};//the title part\n\tInfo.m_OriginGroupsRenderInfo = {};//the origin group part\t\n\tInfo.m_DefinedGroupsRenderInfo = {};//the defined group part\n\n\t/* Geo Info */\n\t//generate render info\n\tInfo.computeObjectPanelRenderInfo = function(panelWidth){\n\n\t\tvar self = this;\n\n\t\tself.m_ObjectGroupRenderInfo['width'] = panelWidth;\t\n\n\t\t//compute title part\n\t\tself.computeTitleRenderInfo();\n\n\t\t//compute origin part\n\t\tself.computeOriginRenderInfo();\n\n\t\t//compute defined part\n\t\tself.computeDefinedRenderInfo();\n\t\n\t\tself.m_OriginGroupsRenderInfo['height'] = self.m_DefinedGroupsRenderInfo['top'] + self.m_DefinedGroupsRenderInfo['height'] + self.m_StaticRenderInfo['bottomPad'];\n\t}\n\n\t//compute the renderinfo of title\n\tInfo.computeTitleRenderInfo = function(){\n\t\tvar TitleSize = getTextSize(self.m_TitleContent, self.m_titleFontSize + 'px');\n\t\tthis.m_TitleRenderInfo['left'] = this.m_StaticRenderInfo['leftPad'];\n\t\tthis.m_TitleRenderInfo['top'] = this.m_StaticRenderInfo['topPad'];\n\t\tthis.m_TitleRenderInfo['width'] = TitleSize['w'];\n\t\tthis.m_TitleRenderInfo['height'] = TitleSize['h'];\n\t}\n\n\t//compute the renderinfo of origin part\n\tInfo.computeOriginRenderInfo = function(){\n\t\tvar self = this;\n\n\t\t//left-top point\t\n\t\tself.m_OriginGroupsRenderInfo['left'] = self.m_StaticRenderInfo['leftPad'], \n\t\tself.m_OriginGroupsRenderInfo['top'] = self.m_TitleRenderInfo['top'] + self.m_TitleRenderInfo['height'] + self.m_StaticRenderInfo['titleoriginPad'];\n\n\t\t//for the origin group\n\t\tvar ltpos = {\n\t\t\t'x': self.m_OriginGroupsRenderInfo['left'],\n\t\t\t'y': self.m_OriginGroupsRenderInfo['top']\n\t\t};\n\n\t\tvar originGroupHeight = 0;\n\t\tvar originGroupWidth = self.m_ObjectGroupRenderInfo['width'] - self.m_StaticRenderInfo['leftPad'] - self.m_StaticRenderInfo['rightPad'];\n\t\t\n\t\tvar liGroupId = g_ObjectGroupManager.getGroupIdList();\n\t\t$.each(liGroupId, function(i, iGroupId){\n\n\t\t\tvar liEleIds = g_ObjectGroupManager.getEleIdsbyGroupId(iGroupId),\n\t\t\t\tEleNum = liEleIds.length;\n\t\t\tvar sAbstract = g_ObjectGroupManager.getAttrsbyGroupId(iGroupId);\n\t\t\tvar sType = sAbstract['name'];\n\t\t\tvar OGroupRenderSize = self.computeOGroupRenderSize(sType, EleNum); //width, height\n\n\t\t\tvar objectRenderInfo = {};\n\t\t\tobjectRenderInfo['left'] = ltpos['x'];\n\t\t\tobjectRenderInfo['top'] = ltpos['y'];\n\n\t\t\tif (originGroupHeight == 0)\n\t\t\t\toriginGroupHeight += OGroupRenderSize['height'];\n\n\t\t\tif (ltpos['x'] + OGroupRenderSize['width'] >= originGroupWidth) {\n\t\t\t\tvar rowHeight = (OGroupRenderSize['height'] + self.m_StaticRenderInfo['withinoriginYPad']);\n\t\t\t\toriginGroupHeight['height'] += rowHeight;\n\t\t\t\tltpos['x'] = self.m_OriginGroupsRenderInfo['left'];\n\t\t\t\tltpos['y'] += rowHeight;\n\t\t\t} else {\n\t\t\t\tltpos['x'] += OGroupRenderSize['width'] + self.m_StaticRenderInfo['withinoriginXPad'];\n\t\t\t}\n\t\t\tobjectRenderInfo['width'] = OGroupRenderSize['width'];\n\t\t\tobjectRenderInfo['height'] = OGroupRenderSize['height'];\n\t\t\tself.m_mapGroupIdRenderInfo[iGroupId] = objectRenderInfo;\n\t\t});\n\n\t\tself.m_OriginGroupsRenderInfo['width'] = originGroupWidth;\n\t\tself.m_OriginGroupsRenderInfo['height'] = originGroupHeight;\n\t}\n\n\t//compute the renderinfo of defined part\n\tInfo.computeDefinedRenderInfo = function(){\n\t\tvar self = this;\n\t\tself.m_DefinedGroupsRenderInfo['top'] = self.m_OriginGroupsRenderInfo['top'] + self.m_OriginGroupsRenderInfo['height'] + self.m_StaticRenderInfo['origindefinedPad'];\n\t\tself.m_DefinedGroupsRenderInfo['left'] = self.m_StaticRenderInfo['leftPad'];\n\t\tself.m_DefinedGroupsRenderInfo['width'] = 0;\n\t\tself.m_DefinedGroupsRenderInfo['height'] = 0;\n\t}\n\n\t//compute the renderinfo of a group, return {width, height}\n\tInfo.computeOGroupRenderSize = function(sType, EleNum){\n\t\tvar OGroupRenderInfo = {};\n\t\tvar textSize = getTextSize('' + EleNum, this.m_ObjectRenderInfo['fontSize']);\n\t\tOGroupRenderInfo['width'] = this.m_ObjectRenderInfo['ltwidth'] + this.m_ObjectRenderInfo['lrwidthgap'] + textSize['w'];\n\t\tOGroupRenderInfo['height'] = textSize['h'] + this.m_ObjectRenderInfo['tbheightgap'] + this.m_ObjectRenderInfo['bheight'];\n\t\treturn OGroupRenderInfo;\n\t}\n\n\t/*** get info ***/\n\t//get the object-panel width\n\tInfo.getPanelWidth = function(){\n\t\treturn this.m_ObjectGroupRenderInfo['width'];\n\t}\n\t//get the object-panel height\n\tInfo.getPanelHeight = function() {\n\t\treturn this.m_ObjectGroupRenderInfo['height'];\n\t}\n\t//get the renderinfo given a group id\n\tInfo.getGroupRenderInfo = function(iGroupId){\n\t\treturn this.m_mapGroupIdRenderInfo[iGroupId];\n\t}\n\t//get the renderinfo of the original group\n\tInfo.getOriginGroupRenderInfo = function(){\n\t\treturn this.m_OriginGroupsRenderInfo;\n\t}\n\t//get the renderinfo of the defined group\n\tInfo.getDefinedGroupRenderInfo = function(){\n\t\treturn this.m_DefinedGroupsRenderInfo;\n\t}\n\t//clear\n\tInfo.clear = function(){\t\t\n\t\tthis.m_OriginGroupsRenderInfo = {};\n\t\tthis.m_ObjectGroupRenderInfo = {};\n\t\tthis.m_mapGroupIdRenderInfo = {};\n\t\tthis.m_DefinedGroupsRenderInfo = {};\n\t}\n\n\tInfo.__init__();\n\treturn Info;\n}", "title": "" }, { "docid": "10fda07517cc1fe7c8df27cbb9c9d8b8", "score": "0.5753865", "text": "function displayTeddies(teddy) {\n document.querySelector('#presentations').innerHTML += `\n <div class=\"card mt-2\" style=\"width: 70%;\"> \n <img src=\"${teddy.imageUrl}\" class=\"card-img-top\" alt=\"${teddy.name}\">\n <div class=\"card-body d-flex flex-column justify-content-center\">\n <h3 class=\"card-title\">${teddy.name}</h3>\n <a href=\"produit.html?id=${teddy._id}\" class=\"btn btn-secondary\">Découvre moi</a>\n </div>\n </div>\n ` \n}", "title": "" }, { "docid": "90cb54b4851e0cc116a2cf70870e6383", "score": "0.57470405", "text": "function fnFormatDetails ( nTr )\n {\n var aData = oTable.fnGetData( nTr );\n var sOut = '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">';\n sOut += '<tr><td>Rendering engine:</td><td>'+aData[2]+' '+aData[5]+'</td></tr>';\n sOut += '<tr><td>Link to source:</td><td>Could provide a link here</td></tr>';\n sOut += '<tr><td>Extra info:</td><td>And any further details here (images etc)</td></tr>';\n sOut += '</table>';\n\t\t\t\t\t \n return sOut;\n }", "title": "" }, { "docid": "e58c452a05983d5ce70763ef9cd97e9c", "score": "0.5736628", "text": "function showDetails(){\n\n\tvar out = document.getElementById(\"details\");\n\tvar currentdate = new Date(); \n\tvar minutes;\n\tif(currentdate.getMinutes()<10){\n\t minutes = \"0\"+currentdate.getMinutes();\n\t}\n\telse{\n\tminutes = currentdate.getMinutes();\n\t}\n\tvar datetime = (currentdate.getMonth()+1) + \"/\"\n + currentdate.getDate() + \"/\" \n + currentdate.getFullYear() + \" @ \" \n + currentdate.getHours() + \":\" \n + minutes;\n\t\t\t\t\n\tvar header = '<span id=\"plant_name\">'+plant+'</span><br/><span id=\"datetime\">'+datetime+'</span>';\n\tvar tableSetup = '<br/><br/><table name=\"details_table\" style=\"border:1px solid black;padding:6px;border-spacing:2px;padding:8px;\"><tr><th>PARAMETER</th><th>CONCENTRATION&nbsp&nbsp&nbsp&nbsp</th><th>CONDUCTIVITY</th></tr>';\n\tvar blank_row = \"<tr><td></td><td></td><td></td></tr>\";\n\t\n\tvar fullTable = header+tableSetup;\n\tfor(var i=0;i<speciesArray.length;i++){\n\t\tfullTable += blank_row + getDetails(speciesArray[i]);\n\t}\n\t\n\tvar h_row = '<tr><td>&nbsp &nbsp Hydronium Ion (H +)</td><td>'+H.toExponential(2)+'&nbsp mol/kg</td><td>'+precise_round((H*lH*1000),4)+'&nbsp uS/cm</td></tr>';\n\tvar oh_row = '<tr><td>&nbsp &nbsp Hydroxyl Ion (OH -)</td><td>'+OH.toExponential(2)+'&nbsp mol/kg</td><td>'+precise_round((OH*lOH*1000),4)+'&nbsp uS/cm</td></tr>';\n\t\n\tfullTable += h_row+oh_row+\"</table>\";\n\t\n\tout.innerHTML = fullTable; // print the table on the page\n}", "title": "" }, { "docid": "a7386ff66e198fd24b96580bc667e0db", "score": "0.5735765", "text": "function getText(obj) {\n var rtn = {status:\"generated\"};\n var txt = \"MyHospital admission\";\n /*\n txt += \"<div>Identifiers</div><ul>\";\n _.each(obj.identifier,function(ident){\n txt += \"<li>Use:\" + ident.use + \": \" + ident.value + \" (\" + ident.system + \")</li>\"\n })\n txt += \"</ul>\";\n */\n rtn.div = \"<div>\" + txt + \"</div>\";\n return rtn;\n}", "title": "" }, { "docid": "fa6b37c492516a39375762a6e4fb315c", "score": "0.5732145", "text": "function getDetailPageSpecsTemplate(data) {\n return '<li>\\n <dl class=\"main-specs\">\\n <dt>Specs</dt>\\n <dd>Avg. Price: <span>$' + data.price + '</span></dd>\\n <dd>Camera: <span>' + data.camera + '</span></dd>\\n <dd>Max Flight Time: <span class=\"\">' + data.max_flight_time + '</span></dd>\\n <dd>Max Range: <span>' + data.max_range + '</span></dd>\\n <dd>Max Speed: <span>' + data.max_speed + '</span></dd>\\n <dd>GPS?: <span>' + data.gps + '</span></dd>\\n <dd>3-axis gimbal: <span>' + data.gimbal + '</span></dd>\\n <dd>Flips: <span>' + (data.flips || 'NO') + '</span></dd>\\n </dl>\\n </li>\\n <li>\\n <dl class=\"mode-specs\">\\n <dt>Modes</dt>\\n <dd>Intelligent Flight: <span>' + data.intelligent_flight + '</span></dd>\\n <dd>Avoidance: <span>' + (data.avoidance || 'NO') + '</span></dd>\\n <dd>Return Home: <span>' + (data.return_home || 'NO') + '</span></dd>\\n <dd>Follow-Me Mode: <span>' + (data.follow_me_mode || 'NO') + '</span></dd>\\n <dd>Tracking Mode: <span>' + (data.tracking_mode || 'NO') + '</span></dd>\\n </dl>\\n </li>';\n}", "title": "" }, { "docid": "ae6175d89243552646691c82888e5b5c", "score": "0.5731385", "text": "static details() {\n return 'This class represents a person. It has name, last name, age, weight and gender.\\nYou can add and modify its properties as many times as you want.'\n }", "title": "" }, { "docid": "b67669cb7212374ff4587e21ff81f7d2", "score": "0.5724376", "text": "function renderEachCard(object) {\n let container = document.querySelector('.filtered_container');\n let divElem = document.createElement('div');\n divElem.classList.add('card');\n let pElem = document.createElement('p');\n let linkElem = document.createElement('a');\n let img = document.createElement('img');\n pElem.textContent = object.INSTNM;\n let link = object.INSTURL.substring(0,5);\n if(link != 'https') {\n linkElem.href = 'https://' + object.INSTURL;\n } else {\n linkElem.href = object.INSTURL;\n }\n linkElem.target = '_blank';\n img.src = 'img/college.png';\n divElem.appendChild(img);\n divElem.appendChild(pElem);\n linkElem.appendChild(divElem);\n container.appendChild(linkElem);\n }", "title": "" }, { "docid": "e3d45d52d8fed9980ef87851432b5c82", "score": "0.5720926", "text": "function displayCardInfo(cardJson) {\n var statsLine;\n if (cardJson.power == undefined && cardJson.toughness == undefined) {\n statsLine = \"\";\n } else {\n statsLine = cardJson.power + \" / \" + cardJson.toughness;\n }\n return `\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">${cardJson.name} ${cardJson.mana_cost}</div>\n <div class=\"panel-body\">\n <p>${cardJson.type_line}</p>\n <p>${cardJson.oracle_text}</p>\n <p id=\"stats\">${cardJson.power} / ${cardJson.toughness}</p>\n </div>\n <div class=\"panel-footer\">Art by ${cardJson.artist}</div>\n </div>\n `;\n}", "title": "" }, { "docid": "ea9e6ea10db019a3e4ee320ae2e51281", "score": "0.5714236", "text": "function displayPerson(person){\n let personInfo = \"ID: \" + person.id + \"\\n\";\n personInfo += \"First Name: \" + person.firstName + \"\\n\";\n personInfo += \"Last Name: \" + person.lastName + \"\\n\";\n personInfo += \"Gender: \" + person.gender + \"\\n\";\n personInfo += \"Date of Birth: \" + person.dob + \"\\n\";\n personInfo += \"Height: \" + person.height + \"\\n\";\n personInfo += \"Weight: \" + person.weight + \"\\n\";\n personInfo += \"Eye Color: \" + person.eyeColor + \"\\n\";\n personInfo += \"Occupation: \" + person.occupation + \"\\n\";\n personInfo += \"Current Spouse ID: \" + person.currentSpouse;\n return personInfo;\n}", "title": "" }, { "docid": "60ff072ca51370726079047e27cbc14d", "score": "0.57118523", "text": "renderInfo(){\n const { rt } = this.state;\n const {classes} = this.props;\n return <div className={classes.root}>\n <Paper className={classes.paper} square={false} elevation={6}>\n <Typography variant=\"subtitle1\">\n DISPOSITIVO: {rt.ID}\n </Typography>\n <Divider />\n <Typography>\n TEMPERATURA: {rt.TEMPERATURE}\n </Typography>\n <Typography>\n FECHA: {rt.DATETIME}\n </Typography>\n <Typography>\n CONCENTRACIÓN: {rt.CONCENTRATION}\n </Typography>\n <Typography>\n HUMEDAD: {rt.HUMIDITY}\n </Typography>\n <Typography>\n PRESIÓN: {rt.PRESSURE}\n </Typography> \n </Paper>\n </div>\n }", "title": "" }, { "docid": "a174a74cfb3e2746b62864a6a6a9e681", "score": "0.57105976", "text": "function showMovieDetail(m) {\n return `<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-3\">\n <img src=\"${m.Poster}\" alt=\"\" class=\"img-fluid\" />\n </div>\n <div class=\"col-md\">\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><h4>${m.Title} (${m.Year})</h4></li>\n <li class=\"list-group-item\">\n <strong>Director : </strong> ${m.Director}\n </li>\n <li class=\"list-group-item\">\n <strong>Actor : </strong> ${m.Actors}\n </li>\n <li class=\"list-group-item\"><strong>Writer: </strong>${m.Writer}</li>\n <li class=\"list-group-item\"><strong>Plot : </strong>${m.Plot}</li>\n </ul>\n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "6d9c41daeefe439132d1260f7b0b01fb", "score": "0.57062936", "text": "function fullInfo() {\n return `Name: ${this.name}, Weight: ${this.weight}, Gender: ${this.gender}.`;\n }", "title": "" }, { "docid": "f7eb6b693055b08cde1a3c637059c310", "score": "0.5702473", "text": "function format(d) {\n return d.details;\n}", "title": "" }, { "docid": "1e88c13644d4ee6a142d1fc5dec381ae", "score": "0.5702079", "text": "function generate_detail_table(rowDetails) {\n var classRow = 'detailRow';\n var sOut = '<div class=\"innerDetails\"><table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">';\n sOut += '<tr class=\"detailHead\"><td>Deliver Date</td>';\n sOut += '<td>Packing Number</td>';\n sOut += '<td>Septa P/N</td>';\n sOut += '<td>Vendor P/N</td>';\n sOut += '<td>U of M</td>';\n sOut += '<td>Quantity</td>';\n sOut += '<td>Price Unit</td>';\n sOut += '<td>Price Subtotal</td>';\n for (var i in rowDetails) {\n console.log(i);\n if (i % 2 == 0) {\n classRow = 'detailRowOdd'\n }\n sOut += '<tr class=\"' + classRow + '\"><td>' + rowDetails[i].date_received + '</td>';\n sOut += '<td>' + rowDetails[i].picking_number + '</td>';\n sOut += '<td>' + rowDetails[i].septa_part_number + '</td>';\n sOut += '<td>' + rowDetails[i].vendor_part_number + '</td>';\n sOut += '<td>' + rowDetails[i].unit_of_measure[1] + '</td>';\n sOut += '<td>' + rowDetails[i].quantity + '</td>';\n sOut += '<td>' + rowDetails[i].price_unit + '</td>';\n sOut += '<td>' + rowDetails[i].price_subtotal + '</td>';\n }\n sOut += '</table></div>';\n return sOut;\n }", "title": "" }, { "docid": "0503ea48f9c988eeb790cd4743060e85", "score": "0.5701093", "text": "displayInfo() {\n\n \n \n for (let prop in this.projDt) {\n \n\n switch (prop) {\n\n case \"title\":\n this.projTitle.innerHTML = this.projDt[prop]\n break;\n\n case \"description\":\n this.projDesc.innerHTML = this.projDt[prop]\n break;\n\n case \"startDate\":\n this.projDate.innerHTML = `Data de Início: ${this.projDt[prop]}`;\n break;\n\n case \"checklist\":\n this.displayChecklistfromDB();\n break;\n\n case \"vulnerabilities\":\n\n this.displayVnTable();\n this.riskCounter();\n this.getDetailsTab()\n break;\n\n\n }\n \n \n \n\n }\n \n \n\n\n }", "title": "" }, { "docid": "5c79391bcd3ee47e096577e580fb5c10", "score": "0.57001805", "text": "function displayNewToy(object) {\n const newToyDiv = document.createElement('div')\n newToyDiv.classList.add('card')\n newToyDiv.id = object.id\n newToyDiv.appendChild(createH2Attributes(object))\n newToyDiv.appendChild(createImgAttributes(object))\n newToyDiv.appendChild(createLikeCountAttributes(object))\n newToyDiv.appendChild(createPAttributes(object))\n newToyDiv.appendChild(createButtonAttributes(object))\n toyCollection.appendChild(newToyDiv)\n }", "title": "" }, { "docid": "bc428e54f988b300da71101880ce2933", "score": "0.56969166", "text": "function display_object(object) {\n if (typeof object === 'string') {\n self.echo(object);\n } else if (object instanceof Array) {\n self.echo($.map(object, function(object) {\n return JSON.stringify(object);\n }).join(' '));\n } else if (typeof object === 'object') {\n self.echo(JSON.stringify(object));\n } else {\n self.echo(object);\n }\n }", "title": "" }, { "docid": "ed580086a48c3a246c92d62bba8c09f7", "score": "0.5695381", "text": "function eventDetails(){\n var summaryDiv = document.getElementById(\"summarySection\");\n summaryDiv.innerHTML += (\"<p>Guest of Honor: \" + this.guestOfHonor + \"</p>\");\n summaryDiv.innerHTML += (\"<p>School: \" + this.schoolName + \"</p>\");\n summaryDiv.innerHTML += (\"<p>Event date: \" + this.eventDate + \"</p>\");\n summaryDiv.innerHTML += (\"<p>Event location: \" + this.eventLocation + \"</p>\");\n summaryDiv.innerHTML += (\"<p>Event cost: \" + this.eventCost.toLocalString() + \"</p>\");\n}", "title": "" }, { "docid": "8f33af936f99077078554e07903b714c", "score": "0.56930345", "text": "function detail(analyteText, specieObject, ionicStrength, molalConcentration){\n\t\treturn '<tr><td>&nbsp &nbsp '+analyteText+'</td><td>'+parseFloat(ionicStrength).toExponential(2)+'&nbsp mol/kg</td><td>'+precise_round((ionicStrength*molalConcentration*1000),4)+'&nbsp uS/cm</td></tr>';\n}", "title": "" }, { "docid": "e1deb9766c4335a2155cc9cda2010bfc", "score": "0.5690922", "text": "function detailedBusinessInfoPage() {\n generateDetailedBusinessInfoPageHeader();\n generateDetailedBusinessInfoPageMapContent();\n generateDetailedBusinessInfoPageMainContent();\n}", "title": "" }, { "docid": "9b888249232dc4ddd2843b510dea4133", "score": "0.5689298", "text": "function createFullDetailDOM(discussion) {\n var e = document.createElement('div');\n e.setAttribute('class', 'discFullDetail');\n \n message =document.createElement('p');\n var text = discussion.detail;\n text = text.replace(/(?:\\r\\n|\\r|\\n)/g, '<br />'); // so that line break appears\n message.innerHTML = text;\n\n e.appendChild(message);\n\n return e;\n}", "title": "" }, { "docid": "58f92b2e8007d2b8234e28391d749147", "score": "0.5684173", "text": "function createMoreInfoHtml(flight) {\n\tvar commentsHtml = flight.comments ?\n\t escapeHtml(flight.comments)\n\t : \"<span style='color: gray'>\" + escapeHtml(\"<no comments>\") + \"</span>\";\n\treturn siteHtml(flight.site) + \" \" + wingHtml(flight.wing) + \" - \" + dateHtml(flight.date) + \"<br/><br/>\"\n\t + commentsHtml + \"<br/>\"\n\t + (flight.doarama ? \"<br/><a href='https://doarama.com/view/\" + flight.doarama + \"'>View flight on Doarama</a>\" : \"\");\n }", "title": "" } ]
6b879c40d05ea09e732f0c81b4f153da
Drill down (through composites and empty components) until we get a host or host text component. This is pretty polymorphic but unavoidable with the current structure we have for `_renderedChildren`.
[ { "docid": "7288686885da6b3213f2de87cefee5bc", "score": "0.0", "text": "function getRenderedHostOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" } ]
[ { "docid": "231f826f37c7412881ba102f78f1344b", "score": "0.5791907", "text": "GetComponentsInChildren() {}", "title": "" }, { "docid": "231f826f37c7412881ba102f78f1344b", "score": "0.5791907", "text": "GetComponentsInChildren() {}", "title": "" }, { "docid": "231f826f37c7412881ba102f78f1344b", "score": "0.5791907", "text": "GetComponentsInChildren() {}", "title": "" }, { "docid": "231f826f37c7412881ba102f78f1344b", "score": "0.5791907", "text": "GetComponentsInChildren() {}", "title": "" }, { "docid": "faa2caf56e50d251629aa5e6ef57d4c6", "score": "0.55964756", "text": "function traverseNextElement(tNode){if(tNode.child){return tNode.child;}else if(tNode.next){return tNode.next;}else{// Let's take the following template: <div><span>text</span></div><component/>\n\t// After checking the text node, we need to find the next parent that has a \"next\" TNode,\n\t// in this case the parent `div`, so that we can find the component.\n\twhile(tNode.parent&&!tNode.parent.next){tNode=tNode.parent;}return tNode.parent&&tNode.parent.next;}}", "title": "" }, { "docid": "019e332d4e5e0c7c055236a192c7d7ec", "score": "0.5360052", "text": "_adjustDown() {\n if (this.state.testChildren === '') {\n this.setState({ testChildren: this.props.children });\n this._callDeffered(this._adjustDown);\n } else if (this._checkHeight(true)) {\n this._setChildren();\n } else {\n this.setState({ testChildren: this.state.testChildren.slice(0, -1) });\n this._callDeffered(this._adjustDown);\n }\n }", "title": "" }, { "docid": "7d6502853c47fe5d3b1130f4e6ba865a", "score": "0.53417265", "text": "get _childComponents() {\n return [\n { linkCaption: 'Overview', component:<Overview /> },\n { linkCaption: 'Transaction', component: <Transaction /> },\n { linkCaption: 'Reaching Your Target', component: <ReachingTarget /> }\n ]\n }", "title": "" }, { "docid": "938aab4f0ea3d437ef6a2a5568ffa146", "score": "0.53065485", "text": "render() {\n this.element.style.display = '';\n for(let child in this.children) {\n this.children[child].render();\n }\n }", "title": "" }, { "docid": "c29f9b41788e162d001dec433f2d4b3f", "score": "0.53005433", "text": "collectInteractiveChildren() {\n if (undefined === this.targetElement) {\n // eslint-disable-next-line no-console\n console.error(\n 'No `targetElement` specified for collectInteractiveChildren'\n );\n return;\n }\n\n const interactiveElements = this.targetElement.querySelectorAll(\n this.selectors\n );\n this.interactiveChildElements = Array.prototype.filter.call(\n interactiveElements,\n (child) =>\n this.constructor.isVisible(child)\n );\n }", "title": "" }, { "docid": "d72e13cca5b6ee5655bdbd91686b5448", "score": "0.5211622", "text": "_render() {\n return this.content.render(this.container.group())\n .then(() => {\n let box, paths;\n\n // Contents must be transformed based on the repeat that is applied.\n this.content.transform(this.repeat.contentPosition);\n\n box = this.content.getBBox();\n\n // Add skip or repeat paths to the container.\n paths = _.flatten([\n this.repeat.skipPath(box),\n this.repeat.loopPath(box)\n ]);\n\n this.container.prepend(\n this.container.path(paths.join('')));\n\n this.loopLabel();\n });\n }", "title": "" }, { "docid": "7ee2bb9de60eb47fbb863fe284f1c123", "score": "0.51753694", "text": "getContainer(component){\n if (!this.dataObject){\n return null\n }\n while (component && component.$parent){\n if (component.isNestable && component.dndModel && component.dndZone == this && !this.isSubset(component.dndModel,this.dataObject)){\n return component\n }else{\n component = component.$parent\n }\n }\n return null\n }", "title": "" }, { "docid": "7eea210a561e72d868547343a41294cb", "score": "0.5163823", "text": "get distributedChildren() {\n return expandContentElements(this.children, false);\n }", "title": "" }, { "docid": "61dae7a6850ee02b8fbe4564727017f0", "score": "0.51112324", "text": "function renderChildComponents(hostLView, components) {\n for (var i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "d8cbf1dfb1df999c3643b4866e54c3c5", "score": "0.50937295", "text": "outChildComponents() {\n if(Array.isArray(this.props.loopedComponents)) {\n this.props.loopedComponents.forEach((component) => {\n if(Array.isArray(component.renderedComponents)) {\n Array.from(component.renderedComponents).forEach(comp => {\n comp.out();\n })\n component.renderedComponents = [];\n }\n })\n }\n if(typeof this.childsObj == \"object\") {\n Object.values(this.childsObj).map((component) => {\n component.out();\n })\n }\n }", "title": "" }, { "docid": "2a0e296b8cf53365d07e78f4d0c691ee", "score": "0.50828326", "text": "getUI(entries){\n if(!entries){\n //if container node has no children, return empty container\n return (\n <BuiltInUI data={this.props.node.getData()} updatePosition={this.props.updatePosition}>\n <ul className=\"grid-ul\" style={{display: \"grid\"}}>\n </ul>\n </BuiltInUI>\n )\n }\n // locations of the children\n let uiList = [];\n for(let arr of entries){ \n let node = arr[0];\n let style = arr[1];\n if(node.isContainer()){ \n uiList.push((\n <li key={node.getID()} style={style} className=\"grid-ui-container-li\">\n <GridUI node={node} updatePosition={this.props.updatePosition} />\n </li>\n ));\n } else{\n // node is a BuiltInUI\n let ui = (<BuiltInUI data={node.getData()}/>);\n uiList.push((\n <li key={node.getID()} className=\"grid-ui-comp-wrapper-li\" style={style}>\n <CompWrapper ui={ui} data={node.getData()} />\n </li>\n ));\n } \n };\n let gridDisplay = this.gridDisplay();\n return (\n <BuiltInUI data={this.props.node.getData()} updatePosition={this.props.updatePosition}>\n <ul className=\"grid-ul\" style={{...gridDisplay, display: \"grid\"}}>\n {uiList}\n </ul>\n </BuiltInUI>\n )\n }", "title": "" }, { "docid": "570c93fbc25eed5582b486fbad2efd35", "score": "0.5079314", "text": "function U(Z,$){if(!(Z._flags&X.hasCachedChildNodes)){var J=Z._renderedChildren,ee=$.firstChild;outer:for(var te in J)// We assume the child nodes are in the same order as the child instances.\n// We reached the end of the DOM children without finding an ID match.\nif(J.hasOwnProperty(te)){var ne=J[te],oe=I(ne)._domID;if(0!==oe){for(;null!==ee;ee=ee.nextSibling)if(1===ee.nodeType&&ee.getAttribute(Y)===oe+\"\"||8===ee.nodeType&&ee.nodeValue===\" react-text: \"+oe+\" \"||8===ee.nodeType&&ee.nodeValue===\" react-empty: \"+oe+\" \"){N(ne,ee);continue outer}H(\"32\",oe)}}Z._flags|=X.hasCachedChildNodes}}", "title": "" }, { "docid": "248a66558375a633af4273b96ba96c82", "score": "0.5063043", "text": "get childComponents() {\n\t\tconst _children = this._childElements.filter((childComponent) => {\n\t\t\treturn !childComponent.args.skipProxy;\n\t\t});\n\n\t\tthis.debug(`childComponents: `, _children);\n\t\treturn _children;\n\t}", "title": "" }, { "docid": "059be09b319360bd00d2aedeba338eed", "score": "0.50573397", "text": "function renderedChildrenOfInst(inst) {\n\t return _version.REACT013 ? inst._renderedComponent._renderedChildren : inst._renderedChildren;\n\t}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "058489c77a8ae915ff2759ecbad0ccfc", "score": "0.5038719", "text": "function renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.50323385", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.50323385", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.50323385", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.50323385", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "25eff51324aa80e377af22b0f2837e5c", "score": "0.4996909", "text": "_bubbleDown() {\n let index = 0;\n while(this._hasLeftChild(index)) {\n let rootCandidateIndex = this._getLeftChildIdx(index);\n\n if( this._hasRightChild(index)\n && this._compareItems(this.item(this._getRightChildIdx(index)), this.item(this._getLeftChildIdx(index)))\n ) {\n rootCandidateIndex = this._getRightChildIdx(index);\n }\n\n if(this._compareItems(this.item(index), this.item(rootCandidateIndex))){\n break;\n }\n else {\n this._swapItems(index,rootCandidateIndex);\n }\n index = rootCandidateIndex;\n }\n }", "title": "" }, { "docid": "dcfed8f299cad38297aeab5edbf181b0", "score": "0.49922752", "text": "populateChildren() {\n return (\n <div>\n {React.Children.map(this.props.children, (child, i) => {\n const id = this.navBarId + i;\n let display = \"none\";\n if (child.props.itemActive) {\n display = \"block\";\n this.activeId = id;\n }\n return <div key={i} style={{display: display}} id={id}>\n {child.props.componentToShow}\n </div>\n })}\n </div>\n )\n }", "title": "" }, { "docid": "0fc4e69eecb0ec4f8eb76172aae58d19", "score": "0.49897477", "text": "parseNode(parentNode: NodeInterface, parentConfig: NodeConfig): React$Node[] {\n const { noHtml, noHtmlExceptMatchers, disableWhitelist } = this.props;\n let content = [];\n let mergedText = '';\n\n // eslint-disable-next-line complexity\n Array.from(parentNode.childNodes).forEach((node) => {\n // Create React elements from HTML elements\n if (node.nodeType === ELEMENT_NODE) {\n const tagName = node.nodeName.toLowerCase();\n const config = this.getTagConfig(tagName);\n\n // Never allow these tags\n if (TAGS_BLACKLIST[tagName]) {\n return;\n }\n\n // Persist any previous text\n if (mergedText) {\n content.push(mergedText);\n mergedText = '';\n }\n\n // Apply node filters\n const nextNode = this.applyNodeFilters(tagName, node);\n\n if (!nextNode) {\n return;\n }\n\n // Only render when the following criteria is met:\n // - HTML has not been disabled\n // - Whitelist is disabled OR the child is valid within the parent\n if (\n !(noHtml || noHtmlExceptMatchers) &&\n (disableWhitelist || this.canRenderChild(parentConfig, config))\n ) {\n this.keyIndex += 1;\n\n // Build the props as it makes it easier to test\n const attributes = this.extractAttributes(nextNode);\n const elementProps: Object = {\n key: this.keyIndex,\n tagName,\n };\n\n if (attributes) {\n elementProps.attributes = attributes;\n }\n\n if (config.void) {\n elementProps.selfClose = config.void;\n }\n\n content.push((\n <Element {...elementProps}>\n {this.parseNode(nextNode, config)}\n </Element>\n ));\n\n // Render the children of the current element only.\n // Important: If the current element is not whitelisted,\n // use the parent element for the next scope.\n } else {\n content = content.concat(\n this.parseNode(nextNode, config.tagName ? config : parentConfig),\n );\n }\n\n // Apply matchers if a text node\n } else if (node.nodeType === TEXT_NODE) {\n const text = (noHtml && !noHtmlExceptMatchers)\n ? node.textContent\n : this.applyMatchers(node.textContent, parentConfig);\n\n if (Array.isArray(text)) {\n content = content.concat(text);\n } else {\n mergedText += text;\n }\n }\n });\n\n if (mergedText) {\n content.push(mergedText);\n }\n\n return content;\n }", "title": "" }, { "docid": "5274985b1a2734be09d5895740d5ec34", "score": "0.49587622", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i)\n onNode(child, locals, deco.forChild(offset, child), i)\n offset += child.nodeSize\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0)\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]) }\n if (widgets) {\n widgets.sort(function (a, b) { return a.type.side - b.type.side; })\n widgets.forEach(onWidget)\n } else {\n onWidget(widget)\n }\n }\n\n var child$1 = (void 0)\n if (restNode) {\n child$1 = restNode\n restNode = null\n } else if (parentIndex < parent.childCount) {\n child$1 = parent.child(parentIndex++)\n } else {\n break\n }\n\n for (var i$1 = 0; i$1 < active.length; i$1++) { if (active[i$1].to <= offset) { active.splice(i$1--, 1) } }\n while (decoIndex < locals.length && locals[decoIndex].from == offset) { active.push(locals[decoIndex++]) }\n\n var end = offset + child$1.nodeSize\n if (child$1.isText) {\n var cutAt = end\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from }\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to < cutAt) { cutAt = active[i$2].to } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset)\n child$1 = child$1.cut(0, cutAt - offset)\n end = cutAt\n }\n }\n\n onNode(child$1, active.length ? active.slice() : nothing, deco.forChild(offset, child$1), parentIndex - 1)\n offset = end\n }\n}", "title": "" }, { "docid": "84f1a302b5a145ead0c030fb3eb30df5", "score": "0.4933505", "text": "function getRenderedHostOrTextFromComponent(component){for(var rendered;rendered=component._renderedComponent;)component=rendered;return component}", "title": "" }, { "docid": "ce5901fdd5cad0db2368e27514aea7c5", "score": "0.49150425", "text": "render(){\n try{\n if(this.props.vanish){\n return null\n }\n const text=this.text\n const defaultStyle=this.defaultStyle\n const measure=this.measure\n\n if(this.props.wrap===false){\n this.appendComposed({\n ...defaultStyle,\n width:measure.stringWidth(text),\n \"data-endat\":text.length,\n children:text,\n mergeOpportunity:false,\n })\n return null\n }\n\n const whitespaceWidth=measure.stringWidth(\" \")\n let start=0\n breakOpportunities(text).forEach((a,j,_1,_2,jLast=_1.length-1==j)=>{\n a.split(/(\\s)/).filter(a=>!!a).forEach((b,i,$1,$2,iLast=$1.length-1==i)=>{\n const isWhitespace=b==\" \"\n const ending=b.endsWith(\",\") ? b.substring(0,b.length-1) : false\n this.appendComposed({\n ...defaultStyle,\n className:isWhitespace ? \"whitespace\" : undefined,\n width:isWhitespace ? whitespaceWidth : measure.stringWidth(b),\n minWidth:isWhitespace||b==LineBreak ? 0 : (ending ? measure.stringWidth(ending) : undefined),\n \"data-endat\":start+=b.length,\n children: b,\n mergeOpportunity:((i+j)==0||(jLast&&iLast))&&!isWhitespace&&b//first or last\n })\n })\n })\n return null\n }finally{\n this.onAllChildrenComposed()\n }\n }", "title": "" }, { "docid": "18031646eeabbe826d382a98302a4a9a", "score": "0.48977998", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n var outerDeco = !active.length ? nothing\n : child$1.isInline && !child$1.isLeaf ? active.filter(function (d) { return !d.inline; })\n : active.slice();\n onNode(child$1, outerDeco, deco.forChild(offset, child$1), index);\n offset = end;\n }\n }", "title": "" }, { "docid": "6daa73814e1d0991e14f5b227e8900c2", "score": "0.48945525", "text": "function ɵɵelementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsNotParent();\n }\n else {\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode, false);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n registerPostOrderHooks(tView, previousOrParentTNode);\n if (tView.firstTemplatePass && tView.queries !== null &&\n isContentQueryHost(previousOrParentTNode)) {\n tView.queries.elementEnd(previousOrParentTNode);\n }\n}", "title": "" }, { "docid": "73e5d459ef557a9d644544b76607369c", "score": "0.48818716", "text": "down() {\n let next = null;\n\n switch (this.$options.mode) {\n\n case DomNavigator.MODE.auto:\n if (!this.$selected) {\n next = this.elements()[0];\n break;\n }\n\n let left = this.$selected.offsetLeft;\n let top = this.$selected.offsetTop + this.$selected.offsetHeight;\n\n next = this.elementsAfter(0, top).reduce((prev, curr) => {\n let currDistance = Math.abs(curr.offsetLeft - left) + Math.abs(curr.offsetTop - top);\n if (currDistance < prev.distance) {\n return {\n distance: currDistance,\n element: curr\n };\n }\n return prev;\n }, {\n distance: Infinity\n });\n next = next.element;\n break;\n\n case DomNavigator.MODE.horizontal:\n break;\n\n case DomNavigator.MODE.vertical:\n if (!this.$selected) {\n next = this.elements()[0];\n break;\n }\n\n next = this.$selected.nextElementSibling;\n break;\n\n case DomNavigator.MODE.grid:\n if (!this.$selected) {\n next = this.elements()[0];\n break;\n }\n\n next = this.$selected;\n for (let i = 0; i < this.$options.cols; i++) {\n next = next && next.nextElementSibling;\n }\n\n break;\n }\n\n this.select(next, DomNavigator.DIRECTION.down);\n }", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "e314e288ea86b953abd7fe12be024e6a", "score": "0.4860676", "text": "function traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.48601168", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.48601168", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.48601168", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.48601168", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.48601168", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "f83bc73fe3a0fb4311167097befd29f9", "score": "0.48598287", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n var outerDeco = !active.length ? nothing\n : child$1.isInline && !child$1.isLeaf ? active.filter(function (d) { return !d.inline; })\n : active.slice();\n onNode(child$1, outerDeco, deco.forChild(offset, child$1), index);\n offset = end;\n }\n}", "title": "" }, { "docid": "f83bc73fe3a0fb4311167097befd29f9", "score": "0.48598287", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n var outerDeco = !active.length ? nothing\n : child$1.isInline && !child$1.isLeaf ? active.filter(function (d) { return !d.inline; })\n : active.slice();\n onNode(child$1, outerDeco, deco.forChild(offset, child$1), index);\n offset = end;\n }\n}", "title": "" }, { "docid": "f83bc73fe3a0fb4311167097befd29f9", "score": "0.48598287", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n var outerDeco = !active.length ? nothing\n : child$1.isInline && !child$1.isLeaf ? active.filter(function (d) { return !d.inline; })\n : active.slice();\n onNode(child$1, outerDeco, deco.forChild(offset, child$1), index);\n offset = end;\n }\n}", "title": "" }, { "docid": "f83bc73fe3a0fb4311167097befd29f9", "score": "0.48598287", "text": "function iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n var outerDeco = !active.length ? nothing\n : child$1.isInline && !child$1.isLeaf ? active.filter(function (d) { return !d.inline; })\n : active.slice();\n onNode(child$1, outerDeco, deco.forChild(offset, child$1), index);\n offset = end;\n }\n}", "title": "" }, { "docid": "f9a78a3cbc3325861dee6eed4c540ad3", "score": "0.48368534", "text": "function getRenderedHostOrTextFromComponent(component){var rendered;while(rendered=component._renderedComponent){component=rendered;}return component;}", "title": "" }, { "docid": "d925fbc94ef34b30f0f0e9af8e9e8140", "score": "0.4836454", "text": "runAllChildren(onLastChildComplete) {\n let firstChildIndex = 0;\n this.runChild(firstChildIndex, onLastChildComplete);\n }", "title": "" }, { "docid": "b15ebfe15cf6eba6511a643b374bf8d0", "score": "0.48064908", "text": "mount() {\n const { type, props } = this.currentElement;\n let children = props.children || [];\n\n // transform raw element to platform specific node with\n // props set as attributes and event handler attached\n const node = createDomElement(this.currentElement);\n this.node = node;\n children.forEach((childEle) => {\n // Recursively check the children\n // Each child could be either DOM host or composite host instance\n let childInstance = instantiateComponent(childEle);\n this.renderedChildren.push(childInstance);\n\n // if child is a DOM host instance, it recursively calls this mount \n // if child is composite host instance, it calls Composite.mount until it reaches another dom element\n // and get into DOMComponent.mount again \n let childNode = childInstance.mount();\n // DOM Ops: all children nodes mounted onto current level of element \n node.appendChild(childNode);\n });\n return node;\n }", "title": "" }, { "docid": "8df3f8dc844fbfe0e31271dd1c1091f0", "score": "0.48036516", "text": "function getChildNodes(props, from, to) {\n\t var nodeType = props.nodeType;\n\t var data = props.data;\n\t var collectionLimit = props.collectionLimit;\n\t var previousData = props.previousData;\n\t var circularCache = props.circularCache;\n\t var keyPath = props.keyPath;\n\t var postprocessValue = props.postprocessValue;\n\t var allExpanded = props.allExpanded;\n\n\t var childNodes = [];\n\n\t (0, _getCollectionEntries2.default)(nodeType, data, collectionLimit, from, to).forEach(function (entry) {\n\t if (entry.to) {\n\t childNodes.push(_react2.default.createElement(_ItemRange2.default, (0, _extends3.default)({}, props, {\n\t key: 'ItemRange' + entry.from + '-' + entry.to,\n\t from: entry.from,\n\t to: entry.to,\n\t getChildNodes: getChildNodes })));\n\t } else {\n\t var key = entry.key;\n\t var value = entry.value;\n\n\t var previousDataValue = undefined;\n\t if (typeof previousData !== 'undefined' && previousData !== null) {\n\t previousDataValue = previousData[key];\n\t }\n\t var isCircular = circularCache.indexOf(value) !== -1;\n\n\t var node = (0, _grabNode2.default)((0, _extends3.default)({}, props, {\n\t keyPath: [key].concat(keyPath),\n\t previousData: previousDataValue,\n\t value: postprocessValue(value),\n\t postprocessValue: postprocessValue,\n\t collectionLimit: collectionLimit,\n\t circularCache: [].concat(circularCache, [value]),\n\t initialExpanded: false,\n\t allExpanded: isCircular ? false : allExpanded,\n\t hideRoot: false\n\t }));\n\n\t if (node !== false) {\n\t childNodes.push(node);\n\t }\n\t }\n\t });\n\n\t return childNodes;\n\t}", "title": "" }, { "docid": "a91f1656636ea9c4a42e01463f76585f", "score": "0.48025706", "text": "renderGridBoxes() {\n const gridHeight = this.containerRef ? this.containerRef.clientHeight : 0;\n\n if (gridHeight > 0) {\n const gridDivs = [];\n const colsNr = this.state.cols[this.state.currentBreakpoint];\n const gridRows = Math.floor(gridHeight / this.state.rowHeight) * colsNr;\n\n let index = 0;\n while (index < gridRows) {\n gridDivs.push(<div\n key={index}\n className={this.state.dragHasStarted ? `gridItemActive gridItemActive--${colsNr}` : ''}\n />);\n index += 1;\n }\n\n return gridDivs;\n }\n return null;\n }", "title": "" }, { "docid": "325edbb414593a6e25d23a25d293f1d5", "score": "0.47973523", "text": "function precacheChildNodes(inst,node){if(inst._flags&Flags.hasCachedChildNodes){return;}var children=inst._renderedChildren;var childNode=node.firstChild;outer:for(var name in children){if(!children.hasOwnProperty(name)){continue;}var childInst=children[name];var childID=getRenderedHostOrTextFromComponent(childInst)._domID;if(childID===0){// We're currently unmounting this child in ReactMultiChild; skip it.\n\tcontinue;}// We assume the child nodes are in the same order as the child instances.\n\tfor(;childNode!==null;childNode=childNode.nextSibling){if(childNode.nodeType===1&&childNode.getAttribute(ATTR_NAME)===String(childID)||childNode.nodeType===8&&childNode.nodeValue===' react-text: '+childID+' '||childNode.nodeType===8&&childNode.nodeValue===' react-empty: '+childID+' '){precacheNode(childInst,childNode);continue outer;}}// We reached the end of the DOM children without finding an ID match.\n\ttrue?process.env.NODE_ENV!=='production'?invariant(false,'Unable to find element with ID %s.',childID):_prodInvariant('32',childID):void 0;}inst._flags|=Flags.hasCachedChildNodes;}", "title": "" }, { "docid": "913d764d264ccb547e328bc513cc2e10", "score": "0.4796249", "text": "composedPath() {\n const composedPath = [];\n\n const { currentTarget, _path: path } = this;\n\n if (path.length === 0) {\n return composedPath;\n }\n\n composedPath.push(currentTarget);\n\n let currentTargetIndex = 0;\n let currentTargetHiddenSubtreeLevel = 0;\n\n for (let index = path.length - 1; index >= 0; index--) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[index];\n\n if (rootOfClosedTree) {\n currentTargetHiddenSubtreeLevel++;\n }\n\n if (item === idlUtils.implForWrapper(currentTarget)) {\n currentTargetIndex = index;\n break;\n }\n\n if (slotInClosedTree) {\n currentTargetHiddenSubtreeLevel--;\n }\n }\n\n let currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n let maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n\n for (let i = currentTargetIndex - 1; i >= 0; i--) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[i];\n\n if (rootOfClosedTree) {\n currentHiddenLevel++;\n }\n\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.unshift(idlUtils.wrapperForImpl(item));\n }\n\n if (slotInClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n\n currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n\n for (let index = currentTargetIndex + 1; index < path.length; index++) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[index];\n\n if (slotInClosedTree) {\n currentHiddenLevel++;\n }\n\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.push(idlUtils.wrapperForImpl(item));\n }\n\n if (rootOfClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n\n return composedPath;\n }", "title": "" }, { "docid": "340a7ceac7243c94932fe7722f4964c1", "score": "0.47948664", "text": "renderScrollableElement() {\n\t\treturn React.Children.map(this.props.children, (child) => {\n\t\t\treturn React.addons.cloneWithProps(child, {\n\t\t\t\toffset: this.state.offset\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "b27d996f5b10827c143d7128667110f6", "score": "0.476564", "text": "function findAllInRenderedTreeInternal(inst, test) {\n\t if (!inst) {\n\t return [];\n\t }\n\t\n\t if (!inst.getPublicInstance) {\n\t var internal = (0, _Utils.internalInstance)(inst);\n\t return findAllInRenderedTreeInternal(internal, test);\n\t }\n\t var publicInst = inst.getPublicInstance() || inst._instance;\n\t var ret = test(publicInst) ? [publicInst] : [];\n\t var currentElement = inst._currentElement;\n\t if ((0, _reactCompat.isDOMComponent)(publicInst)) {\n\t var renderedChildren = renderedChildrenOfInst(inst);\n\t (0, _object2['default'])(renderedChildren || {}).filter(function (node) {\n\t if (_version.REACT013 && !node.getPublicInstance) {\n\t return false;\n\t }\n\t return true;\n\t }).forEach(function (node) {\n\t ret = ret.concat(findAllInRenderedTreeInternal(node, test));\n\t });\n\t } else if (!_version.REACT013 && (0, _reactCompat.isElement)(currentElement) && typeof currentElement.type === 'function') {\n\t ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));\n\t } else if (_version.REACT013 && (0, _reactCompat.isCompositeComponent)(publicInst)) {\n\t ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));\n\t }\n\t return ret;\n\t}", "title": "" }, { "docid": "1f487f368fffcc0b6721b61286372e53", "score": "0.47651884", "text": "function traverseNextElement(tNode) {\n if (tNode.child && tNode.child.parent === tNode) {\n // FIXME(misko): checking if `tNode.child.parent === tNode` should not be necessary\n // We have added it here because i18n creates TNode's which are not valid, so this is a work\n // around. The i18n code will be refactored in #39003 and once it lands this extra check can be\n // deleted.\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}", "title": "" }, { "docid": "f0503da39c32f73ff6b2ad01149b3fd1", "score": "0.47586018", "text": "function ɵɵelementContainerEnd() {\n let previousOrParentTNode = getPreviousOrParentTNode();\n const tView = getTView();\n if (getIsParent()) {\n setIsNotParent();\n }\n else {\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode, false);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, previousOrParentTNode);\n if (isContentQueryHost(previousOrParentTNode)) {\n tView.queries.elementEnd(previousOrParentTNode);\n }\n }\n}", "title": "" }, { "docid": "02c378f75c8b85183fa41ba8348fb395", "score": "0.47520897", "text": "function pack_children(d) {\n return d.results;\n}", "title": "" }, { "docid": "be801733e4cb9820dca75c09f015783d", "score": "0.47511345", "text": "getRenderedTileItems() {\r\n // query select rendered items if child items are created within this component\r\n // querySelectorAll returns a NodeList, we can convert it to array using spread operator but that doesn't work on IE\r\n // so using array slicing workaround\r\n let renderedTiles = this.getArrayFromNodeList(this.base.shadowRootQuerySelector(this.element, 'dxp-tile', true));\r\n // if child items are not found within this component then search for slotted items (childNodes)\r\n renderedTiles = renderedTiles.length > 0 ? renderedTiles : this.getArrayFromNodeList(this.element.childNodes).filter(child => {\r\n return child['tagName'] && child['tagName'].toLowerCase() === 'dxp-tile';\r\n });\r\n return renderedTiles;\r\n }", "title": "" }, { "docid": "3c125bbf60e74aadd6e5d4760dbb998a", "score": "0.4746737", "text": "function ɵɵelementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var tView = getTView();\n if (getIsParent()) {\n setIsNotParent();\n }\n else {\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode, false);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, previousOrParentTNode);\n if (isContentQueryHost(previousOrParentTNode)) {\n tView.queries.elementEnd(previousOrParentTNode);\n }\n }\n}", "title": "" }, { "docid": "9a84e82db3e43a8277cf0bb853e8194a", "score": "0.47211543", "text": "drillDown() {}", "title": "" }, { "docid": "0d4f6dd5f0373116a5599e9f9e5e61c8", "score": "0.47204682", "text": "render() {\r\n let collapsedItems = [];\r\n if (this.items.length > this.MAX_VISIBLE_ITEMS) {\r\n collapsedItems = this.items.slice(0, this.items.length - this.visibleItems);\r\n }\r\n let visibleItems;\r\n collapsedItems.length > 0 ? visibleItems = this.items.slice(this.items.length - this.visibleItems) : visibleItems = this.items;\r\n return (h(\"div\", { class: 'breadcrumb ' + (collapsedItems.length > 0 ? 'long' : '') },\r\n collapsedItems.length > 0 ?\r\n h(\"yoo-context-menu\", null,\r\n h(\"div\", { slot: \"trigger\", class: \"breadcrumb-item more\" },\r\n h(\"span\", { class: \"more-icons\" },\r\n h(\"yoo-icon\", { class: \"yo-more\" }),\r\n \" \",\r\n h(\"yoo-icon\", { class: \"yo-arrow-dropdown\" })),\r\n h(\"span\", { class: \"yo-right\" })),\r\n h(\"div\", { class: \"context-container\" }, collapsedItems.map(item => this.renderCollapsedBreadcrumbItem(item))))\r\n : '',\r\n visibleItems.map((item, index, arr) => this.renderDefaultBreadcrumbItem(item, index, arr))));\r\n }", "title": "" }, { "docid": "2ff70e72a43838bf74e9e0cf0b2bf259", "score": "0.47185007", "text": "_getChildTreeComponents() {\n return []\n }", "title": "" }, { "docid": "eba7ad0066e9bf844ee5dcb404b10148", "score": "0.47169027", "text": "hovered() {\n const itemChanges = this.directDescendantItems.changes;\n return itemChanges.pipe(startWith(this.directDescendantItems), switchMap((items) => merge(...items.map((item) => item.hovered))));\n }", "title": "" }, { "docid": "087b6a3a0d80055839c9092c428ed496", "score": "0.4712186", "text": "async _render() {\n this.partContainer = this.container.group();\n\n // Renders each part of the charset into the part container.\n await Promise.all(this.elements.map(\n part => part.render(this.partContainer.group()),\n ));\n\n // Space the parts of the charset vertically in the part container.\n util.spaceVertically(this.elements, {\n padding: 5,\n });\n\n // Label the part container.\n return this.renderLabeledBox(this.label, this.partContainer, {\n padding: 5,\n });\n }", "title": "" }, { "docid": "43540d986b73cd171683991aa899c9c8", "score": "0.4704577", "text": "bubbleDown(index = 0) {\n let curr = index;\n const left = (i) => 2 * i + 1;\n const right = (i) => 2 * i + 2;\n const getTopChild = (i) =>\n right(i) < this.size && this.comparator(left(i), right(i)) > 0\n ? right(i)\n : left(i);\n\n while (\n left(curr) < this.size &&\n this.comparator(curr, getTopChild(curr)) > 0\n ) {\n const next = getTopChild(curr);\n this.swap(curr, next);\n curr = next;\n }\n }", "title": "" }, { "docid": "43540d986b73cd171683991aa899c9c8", "score": "0.4704577", "text": "bubbleDown(index = 0) {\n let curr = index;\n const left = (i) => 2 * i + 1;\n const right = (i) => 2 * i + 2;\n const getTopChild = (i) =>\n right(i) < this.size && this.comparator(left(i), right(i)) > 0\n ? right(i)\n : left(i);\n\n while (\n left(curr) < this.size &&\n this.comparator(curr, getTopChild(curr)) > 0\n ) {\n const next = getTopChild(curr);\n this.swap(curr, next);\n curr = next;\n }\n }", "title": "" }, { "docid": "56183f5d54c81f062ffad2c30a0516fe", "score": "0.47034955", "text": "function getChildren(el) {\n const els = el.querySelector(':scope > .v-card, :scope > .v-sheet, :scope > .v-list')?.children;\n return els && [...els];\n}", "title": "" }, { "docid": "5c51582dce7a61173b6186c55546a569", "score": "0.47022903", "text": "displayComponent(position) {\n const components = this.state.displayedSubsection.components\n if (!components) {\n return\n }\n\n this.setState({ displayedComponent: components[position - 1] })\n }", "title": "" }, { "docid": "2f1701143d431e5a2fd13e8ac96fd10e", "score": "0.46998402", "text": "get distributedChildNodes() {\n return expandContentElements(this.childNodes, true);\n }", "title": "" }, { "docid": "a48a34fd628182c2345e50d17dbcbb32", "score": "0.4687738", "text": "findTileList() {\r\n const eleTileContainer = this.base.shadowRootQuerySelector(this.element, TILE_GRID_CONTAINER);\r\n const renderedTiles = this.getRenderedTileItems();\r\n const tileLength = this.renderColumns(renderedTiles.length);\r\n this.tileItemCount = renderedTiles.length;\r\n Array.from(renderedTiles).forEach((node, index) => {\r\n if (this.isSquare) {\r\n node.setAttribute('is-square', this.isSquare);\r\n }\r\n const tileEle = document.createElement('div');\r\n if (!this.isSquare) {\r\n tileEle.style.paddingLeft = '1px';\r\n tileEle.style.paddingRight = '1px';\r\n tileEle.style.flexShrink = '0';\r\n tileEle.style.overflow = 'hidden';\r\n }\r\n tileEle.style.flexShrink = '0';\r\n tileEle.className = tileLength;\r\n tileEle.appendChild(node);\r\n eleTileContainer.appendChild(tileEle);\r\n if (index === 0) {\r\n tileEle.style.paddingLeft = 0;\r\n }\r\n if (index === (this.tileItemCount - 1)) {\r\n tileEle.style.paddingRight = 0;\r\n }\r\n });\r\n const nextBtn = this.base.shadowRootQuerySelector(this.element, '.next');\r\n if ((this.isSquare && this.tileItemCount > 3) || (this.tileItemCount > 4)) {\r\n nextBtn.classList.add('active');\r\n }\r\n else {\r\n nextBtn.classList.add('disable');\r\n }\r\n const eleTileWrapper = this.base.shadowRootQuerySelector(this.element, TILE_GRID_CONTAINER);\r\n const containerWidth = eleTileWrapper.getBoundingClientRect().width;\r\n const singleWidth = this.getCalcWidth();\r\n // Calculate how many pages are necessary\r\n return Math.ceil(renderedTiles.length / (containerWidth / singleWidth));\r\n }", "title": "" }, { "docid": "ac0ecd379346e1ee4a8d9d76e7944c4d", "score": "0.46872386", "text": "render() {\n return Children.only(this.props.children);\n }", "title": "" }, { "docid": "c07430fce2d6d41e23c0fb5f696ad293", "score": "0.4681238", "text": "endPressed() {\n if (this.childItems.length < 1) {\n return\n }\n this.clickFirstViableChild(this.childItems.length - 1, false)\n }", "title": "" }, { "docid": "eb300ea0bd639706604987a78bbff7a5", "score": "0.46809402", "text": "_hasScrolledAncestor(el,deltaX,deltaY){if(\"vaadin-grid-cell-content\"===el.localName){return!1}else if(this._canScroll(el,deltaX,deltaY)&&-1!==[\"auto\",\"scroll\"].indexOf(getComputedStyle(el).overflow)){return!0}else if(el!==this&&el.parentElement){return this._hasScrolledAncestor(el.parentElement,deltaX,deltaY)}}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.4672293", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.4672293", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.4672293", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54013c26812c0e53b24c178b59ae6afc", "score": "0.4672293", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "236e7ba207ac4c55dd71f86bbc1c0987", "score": "0.46639958", "text": "function hydrate(elm,vnode,insertedVnodeQueue){if(isTrue(vnode.isComment)&&isDef(vnode.asyncFactory)){vnode.elm=elm;vnode.isAsyncPlaceholder=true;return true;}{if(!assertNodeMatch(elm,vnode)){return false;}}vnode.elm=elm;var tag=vnode.tag;var data=vnode.data;var children=vnode.children;if(isDef(data)){if(isDef(i=data.hook)&&isDef(i=i.init)){i(vnode,true/* hydrating */);}if(isDef(i=vnode.componentInstance)){// child component. it should have hydrated its own tree.\ninitComponent(vnode,insertedVnodeQueue);return true;}}if(isDef(tag)){if(isDef(children)){// empty element, allow client to pick up and populate children\nif(!elm.hasChildNodes()){createChildren(vnode,children,insertedVnodeQueue);}else{// v-html and domProps: innerHTML\nif(isDef(i=data)&&isDef(i=i.domProps)&&isDef(i=i.innerHTML)){if(i!==elm.innerHTML){/* istanbul ignore if */if(\"development\"!=='production'&&typeof console!=='undefined'&&!bailed){bailed=true;console.warn('Parent: ',elm);console.warn('server innerHTML: ',i);console.warn('client innerHTML: ',elm.innerHTML);}return false;}}else{// iterate and compare children lists\nvar childrenMatch=true;var childNode=elm.firstChild;for(var i$1=0;i$1<children.length;i$1++){if(!childNode||!hydrate(childNode,children[i$1],insertedVnodeQueue)){childrenMatch=false;break;}childNode=childNode.nextSibling;}// if childNode is not null, it means the actual childNodes list is\n// longer than the virtual children list.\nif(!childrenMatch||childNode){/* istanbul ignore if */if(\"development\"!=='production'&&typeof console!=='undefined'&&!bailed){bailed=true;console.warn('Parent: ',elm);console.warn('Mismatching childNodes vs. VNodes: ',elm.childNodes,children);}return false;}}}}if(isDef(data)){for(var key in data){if(!isRenderedModule(key)){invokeCreateHooks(vnode,insertedVnodeQueue);break;}}}}else if(elm.data!==vnode.text){elm.data=vnode.text;}return true;}", "title": "" }, { "docid": "261389ab62037ef907fe578adf80c2c1", "score": "0.46634477", "text": "getProjectBlocksRecursive(components, depth, maxDepth = Number.MAX_VALUE) {\n const items = [];\n if (depth < maxDepth) {\n (components || []).forEach((blockId) => {\n const block = this.props.blocks[blockId] || instanceMap.getBlock(blockId);\n if (block) {\n const hasSequence = block.sequence && block.sequence.length > 0;\n items.push({\n block,\n testid: block.id,\n stateKey: block.id,\n text: block.getName(),\n textWidgets: [\n hasSequence ? <BasePairCount count={block.sequence.length} style={{ color: 'gray' }} /> : null,\n ],\n onClick: this.onClickBlock.bind(this, block),\n items: this.getProjectBlocksRecursive(block.components, depth + 1, maxDepth),\n startDrag: (globalPosition) => {\n InventoryProjectTree.onBlockDrag(block, globalPosition);\n },\n // locked: block.isFrozen(), //hide locks in the inventory\n });\n }\n });\n }\n return items;\n }", "title": "" }, { "docid": "be11f889d984d825a84272879d76bc8b", "score": "0.46584776", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\t\twhile (col < endCol) {\n\t\t\t\t\tcell = _this.getCell(row, col);\n\t\t\t\t\tsegsBelow = _this.getCellSegs(cell, levelLimit);\n\t\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\t\tmoreLink = _this.renderMoreLink(cell, segsBelow);\n\t\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t\t}\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "7b0b6ee3d88387d894c682bb05586fe6", "score": "0.46563873", "text": "function childrenOfInstInternal(inst) {\n\t if (!inst) {\n\t return [];\n\t }\n\t if (!inst.getPublicInstance) {\n\t var internal = (0, _Utils.internalInstance)(inst);\n\t return childrenOfInstInternal(internal);\n\t }\n\t\n\t var publicInst = inst.getPublicInstance();\n\t var currentElement = inst._currentElement;\n\t if ((0, _reactCompat.isDOMComponent)(publicInst)) {\n\t var renderedChildren = renderedChildrenOfInst(inst);\n\t return (0, _object2['default'])(renderedChildren || {}).filter(function (node) {\n\t if (_version.REACT013 && !node.getPublicInstance) {\n\t return false;\n\t }\n\t if (typeof node._stringText !== 'undefined') {\n\t return false;\n\t }\n\t return true;\n\t }).map(function (node) {\n\t if (!_version.REACT013 && typeof node._currentElement.type === 'function') {\n\t return node._instance;\n\t }\n\t if (typeof node._stringText === 'string') {\n\t return node;\n\t }\n\t return node.getPublicInstance();\n\t });\n\t } else if (!_version.REACT013 && (0, _reactCompat.isElement)(currentElement) && typeof currentElement.type === 'function') {\n\t return childrenOfInstInternal(inst._renderedComponent);\n\t } else if (_version.REACT013 && (0, _reactCompat.isCompositeComponent)(publicInst)) {\n\t return childrenOfInstInternal(inst._renderedComponent);\n\t }\n\t return [];\n\t}", "title": "" }, { "docid": "cc9cae1691a4c8ea20401f3a9cadea97", "score": "0.46490255", "text": "render() {\n const properties = Memory.getObject(allProperties, this);\n if (properties.recycle) {\n properties.recycle = false;\n if (properties.component && properties.component.canRecycle(properties.state)) {\n properties.state = properties.component.state;\n const results = properties.component.render();\n const oldChildren = properties.children;\n const newChildren = results instanceof Array ? results : [results];\n properties.children = Engine.update(this, allProperties, newChildren, oldChildren);\n }\n else {\n for (const child of properties.children) {\n child.render();\n }\n }\n }\n }", "title": "" }, { "docid": "897a118b4f35abf29566e2be28358a68", "score": "0.46465003", "text": "renderParts_() {\n const buttons = this.shadowRoot.querySelectorAll('button[id]');\n const enabled = [];\n\n function setButton(i, text) {\n const previousSibling = buttons[i].previousElementSibling;\n if (previousSibling.hasAttribute('caret')) {\n previousSibling.hidden = !text;\n }\n\n buttons[i].removeAttribute('has-tooltip');\n buttons[i].textContent = window.unescape(text);\n buttons[i].hidden = !text;\n buttons[i].disabled = false;\n !!text && enabled.push(i);\n }\n\n const parts = this.parts_;\n setButton(0, parts.length > 0 ? parts[0] : null);\n setButton(1, parts.length == 4 ? parts[parts.length - 3] : null);\n buttons[1].hidden = parts.length != 4;\n setButton(2, parts.length > 2 ? parts[parts.length - 2] : null);\n setButton(3, parts.length > 1 ? parts[parts.length - 1] : null);\n\n if (enabled.length) { // Disable the \"last\" button.\n buttons[enabled.pop()].disabled = true;\n }\n\n this.closeMenu_();\n this.renderElidedParts_();\n\n this.setAttribute('path', this.path);\n this.signal_('path-rendered');\n }", "title": "" }, { "docid": "c5115c3ea589393a138d6fe55730781c", "score": "0.46450904", "text": "displayPrevComponent() {\n const sections = this.state.courseSidebar.sections\n const section = this.state.displayedSection\n const subsection = this.state.displayedSubsection\n const component = this.state.displayedComponent\n\n // If component is not the first in its subsection, display previous component in subsection\n if (!isFirst(component)) {\n this.displayComponent(component.position - 1)\n\n // If component is first in its subsection, but its subsection is not first,\n // display the last component in the previous subsection\n } else if (!isFirst(subsection)) {\n const displayedSubsection = section.subsections[subsection.position - 2]\n this.displaySubsection(displayedSubsection.id, -1)\n\n // If subsection is first in its section, but the section is not first,\n // display the last component of the last subsection of the previous section\n } else if (!isFirst(section)) {\n this.displaySection(section.position - 1, -1, -1)\n }\n }", "title": "" }, { "docid": "eb199220a67eb73f1fc5a94a4fca86f8", "score": "0.46424446", "text": "ensureRowIsVisible(aViewIndex, aBounced) {\n // Dealing with the tree view layout is a nightmare, let's just always make\n // sure we re-schedule ourselves. The most particular rationale here is\n // that the message pane may be toggling its state and it's much simpler\n // and reliable if we ensure that all of FolderDisplayWidget's state\n // change logic gets to run to completion before we run ourselves.\n if (!aBounced) {\n let dis = this;\n window.setTimeout(function() {\n dis.ensureRowIsVisible(aViewIndex, true);\n }, 0);\n }\n\n let tree = this.tree;\n if (!tree || !tree.view) {\n return;\n }\n\n // try and trigger a reflow...\n tree.height;\n\n let maxIndex = tree.view.rowCount - 1;\n\n let first = tree.getFirstVisibleRow();\n // Assume the bottom row is half-visible and should generally be ignored.\n // (We could actually do the legwork to see if there is a partial one...)\n const halfVisible = 1;\n let last = tree.getLastVisibleRow() - halfVisible;\n let span = tree.getPageLength() - halfVisible;\n let [topPadding, bottomPadding] = this.visibleRowPadding;\n\n let target;\n if (aViewIndex >= last - bottomPadding) {\n // The index is after the last visible guy (with padding),\n // move down so that the target index is padded in 1 from the bottom.\n target = Math.min(maxIndex, aViewIndex + bottomPadding) - span;\n } else if (aViewIndex <= first + topPadding) {\n // The index is before the first visible guy (with padding), move up.\n target = Math.max(0, aViewIndex - topPadding);\n } else {\n // It is already visible.\n return;\n }\n\n // this sets the first visible row\n tree.scrollToRow(target);\n }", "title": "" }, { "docid": "6cdf7e2951f94f831e234b62ace499e5", "score": "0.4639518", "text": "updateDirectDescendants() {\n this.items.changes\n .pipe(startWith(this.items))\n .subscribe((items) => {\n this.directDescendantItems.reset(items.filter((item) => item.parentDropdownPanel === this));\n this.directDescendantItems.notifyOnChanges();\n });\n }", "title": "" }, { "docid": "398541d1156b7e0eb3c1386ae059abbb", "score": "0.46393138", "text": "unmount() {\n for (let child of this.children) {\n child.unmount();\n }\n this.element.style.display = 'none';\n }", "title": "" }, { "docid": "dc5ce6a18434de1af1cf7ec466abcb71", "score": "0.46370846", "text": "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n\t\t\twhile (col < endCol) {\n\t\t\t\tsegsBelow = _this.getCellSegs(row, col, levelLimit);\n\t\t\t\tif (segsBelow.length) {\n\t\t\t\t\ttd = cellMatrix[levelLimit - 1][col];\n\t\t\t\t\tmoreLink = _this.renderMoreLink(row, col, segsBelow);\n\t\t\t\t\tmoreWrap = $('<div/>').append(moreLink);\n\t\t\t\t\ttd.append(moreWrap);\n\t\t\t\t\tmoreNodes.push(moreWrap[0]);\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\t\t}", "title": "" } ]
37f8dec815d39847443759b110ad56f0
Convert string of `baseIn` to an array of numbers of `baseOut`. Eg. convertBase('255', 10, 16) returns [15, 15]. Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
[ { "docid": "a6c4edc664be5d68889edf4b8b98dca4", "score": "0.75315374", "text": "function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" } ]
[ { "docid": "7e652e631ac7b465df58eb024be93ae1", "score": "0.7510832", "text": "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "7e652e631ac7b465df58eb024be93ae1", "score": "0.7510832", "text": "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "7e652e631ac7b465df58eb024be93ae1", "score": "0.7510832", "text": "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "7e652e631ac7b465df58eb024be93ae1", "score": "0.7510832", "text": "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "7e652e631ac7b465df58eb024be93ae1", "score": "0.7510832", "text": "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "df4df07cf57649bd8db131bd236bae56", "score": "0.7468918", "text": "function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n}", "title": "" }, { "docid": "09e2be5c28a710b4d48e164b9c71ca38", "score": "0.72270346", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for ( ; i < strL; ) {\r\n\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\r\n arr[ j = 0 ] += NUMERALS.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n\r\n if ( arr[j + 1] == null ) {\r\n arr[j + 1] = 0;\r\n }\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "72eab29b336fcc71625cfcde998adabf", "score": "0.7202647", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for ( ; i < strL; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += NUMERALS.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n\r\n if ( arr[j + 1] == null ) {\r\n arr[j + 1] = 0;\r\n }\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "e2dbd6a4d39afc68322f6f71f6f02e5a", "score": "0.7185348", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n\t var j,\r\n\t arr = [0],\r\n\t arrL,\r\n\t i = 0,\r\n\t len = str.length;\r\n\r\n\t for ( ; i < len; ) {\r\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n\t for ( ; j < arr.length; j++ ) {\r\n\r\n\t if ( arr[j] > baseOut - 1 ) {\r\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n\t arr[j + 1] += arr[j] / baseOut | 0;\r\n\t arr[j] %= baseOut;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t return arr.reverse();\r\n\t }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "64be6bcded6b73b66ba400f4bf3826fd", "score": "0.71429855", "text": "function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "af5939072e904326edb61c010be0e74e", "score": "0.71362716", "text": "function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "016cd60427beea166e1fcf24322987c6", "score": "0.71100104", "text": "function strToArr( str, bIn ) {\n var j,\n i = 0,\n strL = str.length,\n arrL,\n arr = [0];\n\n for ( bIn = bIn || baseIn; i < strL; i++ ) {\n\n for ( arrL = arr.length, j = 0; j < arrL; arr[j] *= bIn, j++ ) {\n }\n\n for ( arr[0] += DIGITS.indexOf( str.charAt(i) ), j = 0;\n j < arr.length;\n j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n\n if ( arr[j + 1] == null ) {\n arr[j + 1] = 0\n }\n arr[j + 1] += arr[j] / baseOut ^ 0;\n arr[j] %= baseOut\n }\n }\n }\n\n return arr.reverse()\n }", "title": "" }, { "docid": "74ab9c90265e02c6274d9a235415a2a1", "score": "0.7087033", "text": "function toBaseOut( str, baseIn, baseOut ) { // 522\n var j, // 523\n arr = [0], // 524\n arrL, // 525\n i = 0, // 526\n strL = str.length; // 527\n // 528\n for ( ; i < strL; ) { // 529\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn ); // 530\n arr[ j = 0 ] += DIGITS.indexOf( str.charAt( i++ ) ); // 531\n // 532\n for ( ; j < arr.length; j++ ) { // 533\n // 534\n if ( arr[j] > baseOut - 1 ) { // 535\n if ( arr[j + 1] == null ) arr[j + 1] = 0; // 536\n arr[j + 1] += arr[j] / baseOut | 0; // 537\n arr[j] %= baseOut; // 538\n } // 539\n } // 540\n } // 541\n // 542\n return arr.reverse(); // 543\n } // 544", "title": "" }, { "docid": "ddde1249b78448e892fec6b452f23cc9", "score": "0.6906107", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n } // Convert a numeric string of baseIn to a numeric string of baseOut.", "title": "" }, { "docid": "f753601df3f4da403f8dca7ffbd29c1d", "score": "0.6689483", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "f753601df3f4da403f8dca7ffbd29c1d", "score": "0.6689483", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "f753601df3f4da403f8dca7ffbd29c1d", "score": "0.6689483", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "f753601df3f4da403f8dca7ffbd29c1d", "score": "0.6689483", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "13aa66a0400a11b06a929ce8a209d74a", "score": "0.6677043", "text": "function toBaseOut( str, baseIn, baseOut, alphabet ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\r\n arr[0] += alphabet.indexOf( str.charAt( i++ ) );\r\n\r\n for ( j = 0; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "b71d53b13bb415b55071398cb6e548aa", "score": "0.66734385", "text": "function convert( nStr, baseOut, baseIn, sign ) {\n var e, dvs, dvd, nArr, fracArr, fracBN;\n\n // Convert string of base bIn to an array of numbers of baseOut.\n // Eg. strToArr('255', 10) where baseOut is 16, returns [15, 15].\n // Eg. strToArr('ff', 16) where baseOut is 10, returns [2, 5, 5].\n function strToArr( str, bIn ) {\n var j,\n i = 0,\n strL = str.length,\n arrL,\n arr = [0];\n\n for ( bIn = bIn || baseIn; i < strL; i++ ) {\n\n for ( arrL = arr.length, j = 0; j < arrL; arr[j] *= bIn, j++ ) {\n }\n\n for ( arr[0] += DIGITS.indexOf( str.charAt(i) ), j = 0;\n j < arr.length;\n j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n\n if ( arr[j + 1] == null ) {\n arr[j + 1] = 0\n }\n arr[j + 1] += arr[j] / baseOut ^ 0;\n arr[j] %= baseOut\n }\n }\n }\n\n return arr.reverse()\n }\n\n // Convert array to string.\n // E.g. arrToStr( [9, 10, 11] ) becomes '9ab' (in bases above 11).\n function arrToStr( arr ) {\n var i = 0,\n arrL = arr.length,\n str = '';\n\n for ( ; i < arrL; str += DIGITS.charAt( arr[i++] ) ) {\n }\n\n return str\n }\n\n nStr = nStr.toLowerCase();\n\n /*\n * If non-integer convert integer part and fraction part separately.\n * Convert the fraction part as if it is an integer than use division to\n * reduce it down again to a value less than one.\n */\n if ( ( e = nStr.indexOf( '.' ) ) > -1 ) {\n\n /*\n * Calculate the power to which to raise the base to get the number\n * to divide the fraction part by after it has been converted as an\n * integer to the required base.\n */\n e = nStr.length - e - 1;\n\n // Use toFixed to avoid possible exponential notation.\n dvs = strToArr( new BigNumber(baseIn)['pow'](e)['toF'](), 10 );\n\n nArr = nStr.split('.');\n\n // Convert the base of the fraction part (as integer).\n dvd = strToArr( nArr[1] );\n\n // Convert the base of the integer part.\n nArr = strToArr( nArr[0] );\n\n // Result will be a BigNumber with a value less than 1.\n fracBN = divide( dvd, dvs, dvd.length - dvs.length, sign, baseOut,\n // Is least significant digit of integer part an odd number?\n nArr[nArr.length - 1] & 1 );\n\n fracArr = fracBN['c'];\n\n // e can be <= 0 ( if e == 0, fracArr is [0] or [1] ).\n if ( e = fracBN['e'] ) {\n\n // Append zeros according to the exponent of the result.\n for ( ; ++e; fracArr.unshift(0) ) {\n }\n\n // Append the fraction part to the converted integer part.\n nStr = arrToStr(nArr) + '.' + arrToStr(fracArr)\n\n // fracArr is [1].\n // Fraction digits rounded up, so increment last digit of integer part.\n } else if ( fracArr[0] ) {\n\n if ( nArr[ e = nArr.length - 1 ] < baseOut - 1 ) {\n ++nArr[e];\n nStr = arrToStr(nArr)\n } else {\n nStr = new BigNumber( arrToStr(nArr),\n baseOut )['plus'](ONE)['toS'](baseOut)\n }\n\n // fracArr is [0]. No fraction digits.\n } else {\n nStr = arrToStr(nArr)\n }\n } else {\n\n // Simple integer. Convert base.\n nStr = arrToStr( strToArr(nStr) )\n }\n\n return nStr\n }", "title": "" }, { "docid": "704f53195bdc8e1c3e7b273c19aacc1f", "score": "0.66678125", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "704f53195bdc8e1c3e7b273c19aacc1f", "score": "0.66678125", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "704f53195bdc8e1c3e7b273c19aacc1f", "score": "0.66678125", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "704f53195bdc8e1c3e7b273c19aacc1f", "score": "0.66678125", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "eec6b022382b95f225863d52139612b9", "score": "0.66648436", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }", "title": "" }, { "docid": "34c43620ff960da8ae0016db1c0320e2", "score": "0.6660116", "text": "function toBaseOut( str, baseIn, baseOut, alphabet ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\n arr[0] += alphabet.indexOf( str.charAt( i++ ) );\n\n for ( j = 0; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "1d59f5df5d3aa6eee8f21efb03479321", "score": "0.6649093", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "baf24a6c09e1273f2c2aeb75583b6ea5", "score": "0.6644177", "text": "function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }", "title": "" }, { "docid": "6521c6bb1dbdab1597d9f42337590a05", "score": "0.6613303", "text": "function convert(n, base = 10) {\n\tvar output = [];\n\twhile(n > 0) {\n\t\toutput.unshift(n % base);\n\t\tn = Math.floor(n / base);\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "2d18fee79d31e61a51478a16ad218325", "score": "0.6408806", "text": "function splitToArray(input){\r\n\t\tvar digits = new Array();\r\n\t\tfor (var i = 0; i < input.length; i++){\r\n\t\t\tsubStart = input.length - (i + 1);\r\n\t\t\tsubEnd = input.length - i;\r\n\t\t\tdigits[i] = input.substring(subStart, subEnd);\r\n\t\t}\r\n\t\treturn digits;\r\n\t}", "title": "" }, { "docid": "00277debed268fc82c1a34425e31613c", "score": "0.6385269", "text": "function convertBase( str, baseOut, baseIn, sign ) { // 549\n var d, e, j, r, x, xc, y, // 550\n i = str.indexOf( '.' ), // 551\n rm = ROUNDING_MODE; // 552\n // 553\n if ( baseIn < 37 ) str = str.toLowerCase(); // 554\n // 555\n // Non-integer. // 556\n if ( i >= 0 ) { // 557\n str = str.replace( '.', '' ); // 558\n y = new BigNumber(baseIn); // 559\n x = y['pow']( str.length - i ); // 560\n // 561\n // Convert str as if an integer, then restore the fraction part by dividing the result // 562\n // by its base raised to a power. Use toFixed to avoid possible exponential notation. // 563\n y['c'] = toBaseOut( x.toFixed(), 10, baseOut ); // 564\n y['e'] = y['c'].length; // 565\n } // 566\n // 567\n // Convert the number as integer. // 568\n xc = toBaseOut( str, baseIn, baseOut ); // 569\n e = j = xc.length; // 570\n // 571\n // Remove trailing zeros. // 572\n for ( ; xc[--j] == 0; xc.pop() ); // 573\n if ( !xc[0] ) return '0'; // 574\n // 575\n if ( i < 0 ) { // 576\n --e; // 577\n } else { // 578\n x['c'] = xc; // 579\n x['e'] = e; // 580\n // sign is needed for correct rounding. // 581\n x['s'] = sign; // 582\n x = div( x, y, DECIMAL_PLACES, rm, baseOut ); // 583\n xc = x['c']; // 584\n r = x['r']; // 585\n e = x['e']; // 586\n } // 587\n d = e + DECIMAL_PLACES + 1; // 588\n // 589\n // The rounding digit, i.e. the digit after the digit that may be rounded up. // 590\n i = xc[d]; // 591\n j = baseOut / 2; // 592\n r = r || d < 0 || xc[d + 1] != null; // 593\n // 594\n r = rm < 4 // 595\n ? ( i != null || r ) && ( rm == 0 || rm == ( x['s'] < 0 ? 3 : 2 ) ) // 596\n : i > j || i == j && // 597\n ( rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == ( x['s'] < 0 ? 8 : 7 ) ); // 598\n // 599\n if ( d < 1 || !xc[0] ) { // 600\n xc.length = 1; // 601\n j = 0; // 602\n // 603\n if (r) { // 604\n // 605\n // 1, 0.1, 0.01, 0.001, 0.0001 etc. // 606\n xc[0] = 1; // 607\n e = -DECIMAL_PLACES; // 608\n } else { // 609\n // 610\n // Zero. // 611\n e = xc[0] = 0; // 612\n } // 613\n } else { // 614\n xc.length = d; // 615\n // 616\n if (r) { // 617\n // 618\n // Rounding up may mean the previous digit has to be rounded up and so on. // 619\n for ( --baseOut; ++xc[--d] > baseOut; ) { // 620\n xc[d] = 0; // 621\n // 622\n if ( !d ) { // 623\n ++e; // 624\n xc.unshift(1); // 625\n } // 626\n } // 627\n } // 628\n // 629\n // Determine trailing zeros. // 630\n for ( j = xc.length; !xc[--j]; ); // 631\n } // 632\n // 633\n // E.g. [4, 11, 15] becomes 4bf. // 634\n for ( i = 0, str = ''; i <= j; str += DIGITS.charAt( xc[i++] ) ); // 635\n // 636\n // Negative exponent? // 637\n if ( e < 0 ) { // 638\n // 639\n // Prepend zeros. // 640\n for ( ; ++e; str = '0' + str ); // 641\n str = '0.' + str; // 642\n // 643\n // Positive exponent? // 644\n } else { // 645\n i = str.length; // 646\n // 647\n // Append zeros. // 648\n if ( ++e > i ) { // 649\n for ( e -= i; e-- ; str += '0' ); // 650\n } else if ( e < i ) { // 651\n str = str.slice( 0, e ) + '.' + str.slice(e); // 652\n } // 653\n } // 654\n // 655\n // No negative numbers: the caller will add the sign. // 656\n return str; // 657\n } // 658", "title": "" }, { "docid": "8f671563215a3a652b0254afe1fabf44", "score": "0.62836784", "text": "function baseConvert(n, from, to) {\n\t// numberVar.toString(radix) // to convert a number to desired base and use \n\t// parseInt(\"string\", inputBase) // to convert a string of numbers from given base to decimal.\n return parseInt(n, from).toString(to);\n}", "title": "" }, { "docid": "2df9e097ba22a2593675252798003a44", "score": "0.6082804", "text": "function convertNumber(input, endBase) {\n // Var declaration\n var startBase = getBase(input);\n var convertedDecimal;\n\n // Convert all to decimal by checking original base\n if (startBase == 16)\n convertedDecimal = parseInt(input, 16); // Convert hex to dec\n else if (startBase == 2)\n convertedDecimal = parseInt(input, 2); // Convert binary to dec\n\n // Convert decimal number to final base\n if (endBase == 16)\n return convertedDecimal.toString(16); // Dec to hex\n else if (endBase == 2)\n return convertedDecimal.toString(2); // Dec to binary\n else\n return convertedDecimal.toString(); // Dec to string\n}", "title": "" }, { "docid": "a3098b67f3f0d24a13fd1f53eb549779", "score": "0.6016122", "text": "function str2bigInt(s,base,minSize) {\n var d, i, j, x, y, kk;\n var k=s.length;\n if (base==-1) { //comma-separated list of array elements in decimal\n x=new Array(0);\n for (;;) {\n y=new Array(x.length+1);\n for (i=0;i<x.length;i++)\n y[i+1]=x[i];\n y[0]=parseInt(s,10);\n x=y;\n d=s.indexOf(',',0);\n if (d<1) \n break;\n s=s.substring(d+1);\n if (s.length==0)\n break;\n }\n if (x.length<minSize) {\n y=new Array(minSize);\n copy_(y,x);\n return y;\n }\n return x;\n }\n\n x=int2bigInt(0,base*k,0);\n for (i=0;i<k;i++) {\n d=digitsStr.indexOf(s.substring(i,i+1),0);\n if (base<=36 && d>=36) //convert lowercase to uppercase if base<=36\n d-=26;\n if (d>=base || d<0) { //stop at first illegal character\n break;\n }\n multInt_(x,base);\n addInt_(x,d);\n }\n\n for (k=x.length;k>0 && !x[k-1];k--); //strip off leading zeros\n k=minSize>k+1 ? minSize : k+1;\n y=new Array(k);\n kk=k<x.length ? k : x.length;\n for (i=0;i<kk;i++)\n y[i]=x[i];\n for (;i<k;i++)\n y[i]=0;\n return y;\n }", "title": "" }, { "docid": "b5e937e6a67072ac7e537f1892ce4e4f", "score": "0.5996457", "text": "function binToNumMatrix(input){\n return input.map(function (x) {\n x = x.map(x => parseInt(x, 2));\n return x;\n });\n }", "title": "" }, { "docid": "78a9ac7e24dd6d34f26af55b66d57adb", "score": "0.5958038", "text": "function Bin2Arr(str) { var a = new Array(str.length); for (var i = 0; i < str.length; i++) { a[i] = (str.toString().substr(i, 1) == \"1\" ? 1 : 0); } return a; }", "title": "" }, { "docid": "80ec556e472d8c6e5a10bcb19a90b994", "score": "0.5936762", "text": "function convertBase( str, baseOut, baseIn, sign ) {\r\n\t var d, e, k, r, x, xc, y,\r\n\t i = str.indexOf( '.' ),\r\n\t dp = DECIMAL_PLACES,\r\n\t rm = ROUNDING_MODE;\r\n\r\n\t if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n\t // Non-integer.\r\n\t if ( i >= 0 ) {\r\n\t k = POW_PRECISION;\r\n\r\n\t // Unlimited precision.\r\n\t POW_PRECISION = 0;\r\n\t str = str.replace( '.', '' );\r\n\t y = new BigNumber(baseIn);\r\n\t x = y.pow( str.length - i );\r\n\t POW_PRECISION = k;\r\n\r\n\t // Convert str as if an integer, then restore the fraction part by dividing the\r\n\t // result by its base raised to a power.\r\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n\t y.e = y.c.length;\r\n\t }\r\n\r\n\t // Convert the number as integer.\r\n\t xc = toBaseOut( str, baseIn, baseOut );\r\n\t e = k = xc.length;\r\n\r\n\t // Remove trailing zeros.\r\n\t for ( ; xc[--k] == 0; xc.pop() );\r\n\t if ( !xc[0] ) return '0';\r\n\r\n\t if ( i < 0 ) {\r\n\t --e;\r\n\t } else {\r\n\t x.c = xc;\r\n\t x.e = e;\r\n\r\n\t // sign is needed for correct rounding.\r\n\t x.s = sign;\r\n\t x = div( x, y, dp, rm, baseOut );\r\n\t xc = x.c;\r\n\t r = x.r;\r\n\t e = x.e;\r\n\t }\r\n\r\n\t d = e + dp + 1;\r\n\r\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n\t i = xc[d];\r\n\t k = baseOut / 2;\r\n\t r = r || d < 0 || xc[d + 1] != null;\r\n\r\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n\t rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n\t if ( d < 1 || !xc[0] ) {\r\n\r\n\t // 1^-dp or 0.\r\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\r\n\t } else {\r\n\t xc.length = d;\r\n\r\n\t if (r) {\r\n\r\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\r\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n\t xc[d] = 0;\r\n\r\n\t if ( !d ) {\r\n\t ++e;\r\n\t xc.unshift(1);\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t // Determine trailing zeros.\r\n\t for ( k = xc.length; !xc[--k]; );\r\n\r\n\t // E.g. [4, 11, 15] becomes 4bf.\r\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n\t str = toFixedPoint( str, e );\r\n\t }\r\n\r\n\t // The caller will add the sign.\r\n\t return str;\r\n\t }", "title": "" }, { "docid": "5a9d002a1016eca67515b62f74b5ae2d", "score": "0.59277296", "text": "function str2bigInt(s, base, minSize) {\n var d, i, j, x, y, kk;\n var k = s.length;\n if (base == -1) {\n //comma-separated list of array elements in decimal\n x = new Array(0);\n for (;;) {\n y = new Array(x.length + 1);\n for (i = 0; i < x.length; i++) {\n y[i + 1] = x[i];\n }y[0] = parseInt(s, 10); //TODO PERF Should we replace that with ~~ (not not)? https://jsperf.com/number-vs-parseint-vs-plus/7\n x = y;\n d = s.indexOf(',', 0);\n if (d < 1) break;\n s = s.substring(d + 1);\n if (s.length == 0) break;\n }\n if (x.length < minSize) {\n y = new Array(minSize);\n copy_(y, x);\n return y;\n }\n return x;\n }\n\n x = int2bigInt(0, base * k, 0);\n for (i = 0; i < k; i++) {\n d = digitsStr.indexOf(s.substring(i, i + 1), 0);\n if (base <= 36 && d >= 36) //convert lowercase to uppercase if base<=36\n d -= 26;\n if (d >= base || d < 0) {\n //stop at first illegal character\n break;\n }\n multInt_(x, base);\n addInt_(x, d);\n }\n\n for (k = x.length; k > 0 && !x[k - 1]; k--) {} //strip off leading zeros\n k = minSize > k + 1 ? minSize : k + 1;\n y = new Array(k);\n kk = k < x.length ? k : x.length;\n for (i = 0; i < kk; i++) {\n y[i] = x[i];\n }for (; i < k; i++) {\n y[i] = 0;\n }return y;\n}", "title": "" }, { "docid": "32b2e35610e1711c70d5f19e1f06ccee", "score": "0.58458954", "text": "function digitsToArray(numb1) {\n var str1 = '' + numb1;\n var arr = [];\n for (var i = 0; i < str1.length; i++) {\n arr[arr.length] = str1[i];\n }\n return arr;\n}", "title": "" }, { "docid": "75a661e95e77b58969de286498b879de", "score": "0.57692826", "text": "function hex_str_to_byte_array(in_str) {\n var i\n var out = []\n var str = in_str.replace(/\\s|0x/g, \"\")\n for (i = 0; i < str.length; i += 2) {\n if (i + 1 > str.length) {\n out.push(get_dec_from_hexchar(str.charAt(i)) * 16)\n } else {\n out.push(\n get_dec_from_hexchar(str.charAt(i)) * 16 +\n get_dec_from_hexchar(str.charAt(i + 1))\n )\n }\n }\n return out\n }", "title": "" }, { "docid": "65c452e1895bf2887b40946151d1934a", "score": "0.57461125", "text": "function convert(number, base) {\n if (base === 2) {\n console.log(number.toString(2));\n } else if (base === 10) {\n console.log(number.toString(10));\n } else {\n console.log('Numero o base incorrecto');\n }\n}", "title": "" }, { "docid": "b4303755adf76696da3ae48327661268", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "b4303755adf76696da3ae48327661268", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "b4303755adf76696da3ae48327661268", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" }, { "docid": "4bcbddbc8345ba650763ca9d00bb8d02", "score": "0.5728703", "text": "function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }", "title": "" } ]
f50f435935eddefc1a61bc162e342630
This is cheating. Really only suited to demos and other situations where we're guaranteed to be using the local fs
[ { "docid": "f1d90044153cd0866d4325cef0796bc0", "score": "0.0", "text": "async function hardlinkAttachments() {\n const fs = require('fs');\n const root = to.attachments.uploadfs.options.uploadsPath;\n const original = `${root}/${piece.copyOfId}`;\n const copy = `${root}/${piece._id}`;\n if (!fs.existsSync(original)) {\n // Master has no media yet\n return;\n }\n fs.mkdirSync(copy);\n recursiveHardlink(original, copy);\n function recursiveHardlink(original, copy) {\n const contents = fs.readdirSync(original);\n for (const entry of contents) {\n const oldPath = `${original}/${entry}`;\n const newPath = `${copy}/${entry}`;\n if (fs.lstatSync(oldPath).isDirectory()) {\n fs.mkdirSync(newPath);\n recursiveHardlink(oldPath, newPath);\n } else {\n fs.linkSync(oldPath, newPath);\n }\n }\n }\n }", "title": "" } ]
[ { "docid": "fa6f0ad57b6aedf6d379dc88afc71d41", "score": "0.6855153", "text": "function NodeFileSystem() {\n\n}", "title": "" }, { "docid": "834a3387d03739b140085ddc6fe93329", "score": "0.6777337", "text": "function initFS() {\n window.requestFileSystem(window.TEMPORARY, 1024*1024, function(filesystem) {\n fs = filesystem;\n }, errorHandler);\n}", "title": "" }, { "docid": "cc1c11511bc545fb68882fe6b7c2da96", "score": "0.64238805", "text": "function gotFS(fileSystem) {\n\t\t\t\t\t\t\tfileSystem.root.getFile(dirPath, {create: true, exclusive: false}, gotFileEntry, fail);\n\t\t\t\t\t\t}", "title": "" }, { "docid": "cc1c11511bc545fb68882fe6b7c2da96", "score": "0.64238805", "text": "function gotFS(fileSystem) {\n\t\t\t\t\t\t\tfileSystem.root.getFile(dirPath, {create: true, exclusive: false}, gotFileEntry, fail);\n\t\t\t\t\t\t}", "title": "" }, { "docid": "56a1c2baff0ff3afc5e35808f3128d9f", "score": "0.64029783", "text": "async openMemoryFilePath () {\n\t\tlet path;\n\n\t\tif (! OsUtil.isLinux) {\n\t\t\tthis.memoryFilePath = \"\";\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t// User-specific tmpfs directory, available on Raspios and other Linux systems\n\t\t\tpath = Path.join (Path.sep, \"run\", \"user\", `${process.getuid ()}`);\n\t\t\tconst stats = await FsUtil.statFile (path);\n\t\t\tif (! stats.isDirectory ()) {\n\t\t\t\tthrow Error (`${path} is not a directory`);\n\t\t\t}\n\t\t\tpath = Path.join (path, \"membrane-server\");\n\t\t\tawait FsUtil.createDirectory (path);\n\t\t\tthis.memoryFilePath = path;\n\t\t\tLog.debug (`Memory file system open; path=${path}`);\n\t\t}\n\t\tcatch (err) {\n\t\t\tLog.debug (`Memory file system not available; err=${err}`);\n\t\t\tthis.memoryFilePath = \"\";\n\t\t}\n\t}", "title": "" }, { "docid": "c5e38690df7f03e7256ed90a55723f69", "score": "0.63415086", "text": "mount(dir, fs) { return not_implemented(); }", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.63256013", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.63256013", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.63256013", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.63256013", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.63256013", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "c28b3ae26782d3e4832cf1a2f63fda62", "score": "0.61126083", "text": "async init () {\n\t\treturn fs.ensureDir(this.root);\n\t}", "title": "" }, { "docid": "258a32dc4e3cd746c45e6a69ead30474", "score": "0.60786355", "text": "function read() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "a791515d0af164991bc78be34e13d839", "score": "0.6065768", "text": "function access() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "eb5d2b641a22291812cbcea56c1aa356", "score": "0.6028539", "text": "openFile() {\n this.statFile(this.path);\n this.checkStartOffset();\n this.getMaxOffset();\n this.fd = fs.openSync(this.path, 'r');\n this.buffer = Buffer.alloc(BUFFER_LENGTH);\n this.readChunk(this.currentOffset);\n }", "title": "" }, { "docid": "7e1d4570ea5ad026dc55d1347e25beb3", "score": "0.6003702", "text": "static isFile(context, fs, path){\n\t\treturn (async_ctx_0) => {\n\t\t\tvar async_jump_0 = async_ctx_0.current();\n\t\t\tif (async_jump_0 == \"0\"){\n\t\t\t\tif (!this.fileExists(path)){\n\t\t\t\t\treturn async_ctx_0.resolve(false);\n\t\t\t\t}\n\t\t\t\treturn async_ctx_0.resolve(!this.isDir(path));\n\t\t\t}\n\t\t\telse if (async_jump_0 == \"-1\"){\n\t\t\t\treturn async_ctx_0.error( async_ctx_0.getError() )\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn async_ctx_0.next();\n\t\t\t}\n\t\t\treturn async_ctx_0.end();\n\t\t}\n\t}", "title": "" }, { "docid": "1578c9734e5e0b9fbc8ae2eb2df6cd87", "score": "0.596352", "text": "static tempfile() {\n // #Dependency to #Lively4Server \n return lively.files.directory(lively4url) + \"_tmp/\" + generateUuid() \n }", "title": "" }, { "docid": "f1ccd67301a4818947540bf880e38eb3", "score": "0.59534895", "text": "read(){\n // fs.readStream()\n }", "title": "" }, { "docid": "daf9a95298d2f4ae79bbb3c0f4e2c494", "score": "0.5940311", "text": "function fileSystemCallback(fs){\n \n \n //display the console\n console.log('file system open :' +fs.name);\n //display in front end\n //var toFrontEnd = 'file system open: ' + fs.name;\n //document.getElementById('file').innerHTML = toFrontEnd;\n // name of the file we want to create\n var fileToCreate = \"MyFirstFile.txt\";\n // opening / creating the file\n fs.root.getFile(fileToCreate, fileSystemOptionals,\n getFileCallback, onError);\n \n}", "title": "" }, { "docid": "2f7d2c26f1bbc6f85c060f296650c1fb", "score": "0.5865099", "text": "function open() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "c54254ab50495db85df5803847b09941", "score": "0.5858924", "text": "function getNodeIO() {\n var _fs = require('fs');\n var _path = require('path');\n var _module = require('module');\n\n return {\n appendFile: function (path, content) {\n _fs.appendFileSync(path, content);\n },\n readFile: function (file, codepage) {\n return TypeScript.Environment.readFile(file, codepage);\n },\n writeFile: function (path, contents, writeByteOrderMark) {\n TypeScript.Environment.writeFile(path, contents, writeByteOrderMark);\n },\n deleteFile: function (path) {\n try {\n _fs.unlinkSync(path);\n } catch (e) {\n IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_delete_file_0, [path]), e);\n }\n },\n fileExists: function (path) {\n return _fs.existsSync(path);\n },\n dir: function dir(path, spec, options) {\n options = options || {};\n\n function filesInFolder(folder) {\n var paths = [];\n\n try {\n var files = _fs.readdirSync(folder);\n for (var i = 0; i < files.length; i++) {\n var stat = _fs.statSync(folder + \"/\" + files[i]);\n if (options.recursive && stat.isDirectory()) {\n paths = paths.concat(filesInFolder(folder + \"/\" + files[i]));\n } else if (stat.isFile() && (!spec || files[i].match(spec))) {\n paths.push(folder + \"/\" + files[i]);\n }\n }\n } catch (err) {\n /*\n * Skip folders that are inaccessible\n */\n }\n\n return paths;\n }\n\n return filesInFolder(path);\n },\n createDirectory: function (path) {\n try {\n if (!this.directoryExists(path)) {\n _fs.mkdirSync(path);\n }\n } catch (e) {\n IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_create_directory_0, [path]), e);\n }\n },\n directoryExists: function (path) {\n return _fs.existsSync(path) && _fs.statSync(path).isDirectory();\n },\n resolvePath: function (path) {\n return _path.resolve(path);\n },\n dirName: function (path) {\n var dirPath = _path.dirname(path);\n\n // Node will just continue to repeat the root path, rather than return null\n if (dirPath === path) {\n dirPath = null;\n }\n\n return dirPath;\n },\n findFile: function (rootPath, partialFilePath) {\n var path = rootPath + \"/\" + partialFilePath;\n\n while (true) {\n if (_fs.existsSync(path)) {\n return { fileInformation: this.readFile(path), path: path };\n } else {\n var parentPath = _path.resolve(rootPath, \"..\");\n\n // Node will just continue to repeat the root path, rather than return null\n if (rootPath === parentPath) {\n return null;\n } else {\n rootPath = parentPath;\n path = _path.resolve(rootPath, partialFilePath);\n }\n }\n }\n },\n print: function (str) {\n process.stdout.write(str);\n },\n printLine: function (str) {\n process.stdout.write(str + '\\n');\n },\n arguments: process.argv.slice(2),\n stderr: {\n Write: function (str) {\n process.stderr.write(str);\n },\n WriteLine: function (str) {\n process.stderr.write(str + '\\n');\n },\n Close: function () {\n }\n },\n stdout: {\n Write: function (str) {\n process.stdout.write(str);\n },\n WriteLine: function (str) {\n process.stdout.write(str + '\\n');\n },\n Close: function () {\n }\n },\n watchFile: function (fileName, callback) {\n var firstRun = true;\n var processingChange = false;\n\n var fileChanged = function (curr, prev) {\n if (!firstRun) {\n if (curr.mtime < prev.mtime) {\n return;\n }\n\n _fs.unwatchFile(fileName, fileChanged);\n if (!processingChange) {\n processingChange = true;\n callback(fileName);\n setTimeout(function () {\n processingChange = false;\n }, 100);\n }\n }\n firstRun = false;\n _fs.watchFile(fileName, { persistent: true, interval: 500 }, fileChanged);\n };\n\n fileChanged();\n return {\n fileName: fileName,\n close: function () {\n _fs.unwatchFile(fileName, fileChanged);\n }\n };\n },\n run: function (source, fileName) {\n require.main.fileName = fileName;\n require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(fileName)));\n require.main._compile(source, fileName);\n },\n getExecutingFilePath: function () {\n return process['mainModule'].filename;\n },\n quit: function (code) {\n var stderrFlushed = process.stderr.write('');\n var stdoutFlushed = process.stdout.write('');\n process.stderr.on('drain', function () {\n stderrFlushed = true;\n if (stdoutFlushed) {\n process.exit(code);\n }\n });\n process.stdout.on('drain', function () {\n stdoutFlushed = true;\n if (stderrFlushed) {\n process.exit(code);\n }\n });\n setTimeout(function () {\n process.exit(code);\n }, 5);\n }\n };\n }", "title": "" }, { "docid": "45d510848fd0bea86defc814672266c8", "score": "0.5817029", "text": "constructor(_dir) {\n // dir = _dir\n // this.fs = new FS(\"fs\")\n // this.pfs = this.fs.promises\n // this.dir = '/semsm'\n // console.log(this.dir, 'dir');\n\n }", "title": "" }, { "docid": "34ea19be909c6dfe01a206db3f62f77f", "score": "0.581619", "text": "static storageRoot() { return './files' }", "title": "" }, { "docid": "45b4da45c0e5eee105e47fad35367de0", "score": "0.5802462", "text": "readFileSync (path, encoding) {\n\t\tthrow new TypeError(\"FSI is merely an interface, override this method\");\n }", "title": "" }, { "docid": "0ca9bd0ed2b225ffa42f65a21f62710f", "score": "0.57758206", "text": "function write() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "dd0dd755c027265eec79e57847562dbd", "score": "0.57571644", "text": "function ensure_root_directory() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "f50297f2eee664196478e57d4964a617", "score": "0.57421356", "text": "function openfs(){\n window.webkitRequestFileSystem(window.PERSISTENT, 50*1024*1024 /*50MB*/, _success, _errorHandler);\n }", "title": "" }, { "docid": "109d2bb9a091138fc302efe963ebaf72", "score": "0.57382166", "text": "open() {}", "title": "" }, { "docid": "0d34f7848b698feea6efd27b671b3fa3", "score": "0.57271403", "text": "function gotFS(fileSystem) {\n path = TEMPLATE_DIRECTORY;\n createDir(fileSystem.root, path.split('/')); \n}", "title": "" }, { "docid": "842b7ea2aab074565c74ca2f2d7f201c", "score": "0.571817", "text": "function FileAdaptor() {\n}", "title": "" }, { "docid": "c7c379188e4fe2f008c849fa6c558a66", "score": "0.56860596", "text": "async use (name) {\n\t\tthis.path = path.join(this.root, name);\n\t\treturn fs.ensureDir(this.path);\n\t}", "title": "" }, { "docid": "1f8ed374ec1e79a3667a9b40e7fc8aea", "score": "0.5684539", "text": "extend(config) {\n config.node = {\n fs: 'empty'\n }\n }", "title": "" }, { "docid": "9dd00fb2416fcd99dbdc3e705993f0d1", "score": "0.5678205", "text": "function gotFS(fileSystem) {\n\tfileSystem.root.getFile(\"save.txt\", {\n\t\tcreate : true,\n\t\texclusive : false\n\t}, gotFileEntry, fail);\n}", "title": "" }, { "docid": "d9b4aa983abf5626e50037953f84434f", "score": "0.5673592", "text": "function gotFS(fileSystem){\n\t\t$scope.fileSystem = fileSystem.root.toURL();\n\t}", "title": "" }, { "docid": "e062a4071fe27bb81178b95c1490d1fd", "score": "0.56691784", "text": "extend(config, ctx) {\n config.node = {\n fs: 'empty'\n }\n }", "title": "" }, { "docid": "bea5525c953fe2d239ac48d2c3898413", "score": "0.5641983", "text": "function fsRead(path,back){\r\n\t\tvar fs=api.require('fs');\r\n\t\tfs.open({\r\n\t\t path:path,\r\n\t\t flags:'read_write'\r\n\t },function(ret,err){\r\n\t \tif(ret.status)\r\n\t \t{\r\n\t \t\tvar fid=ret.fd;\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tfs.read({\r\n\t fd:fid\r\n\t },function(ret,err){\r\n\t \tif(ret.status)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tvar content=ret.data;\r\n\t \t\tfs.close({\r\n\t\t fd:fid\r\n\t },function(ret,err){\r\n\t \tif(ret)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tconsole.log(content);\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":true}');\r\n\t\t\t \t\t\t\tvar back_content=content;\r\n\t\t\t \t\t\t\tback(back_ret,back_content); \r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t \t\t\t\tvar back_content=content;\r\n\t\t\t \t\t\t\tback(back_ret,back_content); \r\n\t \t}\r\n\t }); \t\t\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tfs.close({\r\n\t\t fd:fid\r\n\t },function(ret,err){\r\n\t \tif(ret)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t \t\t\t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t\t\t \t\t\t\tback(back_ret,back_err); \r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t\t\t \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t\t\t\t\t \t\tback(back_ret,back_err); \r\n\t \t}\r\n\t }); \t\t\r\n\t \t}\r\n\t });\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t \t\tback(back_ret,back_err); \t\r\n\t \t}\r\n\t });\r\n\t}", "title": "" }, { "docid": "7e25f7dfb938fe39bd1d6c7e770ad1b2", "score": "0.562729", "text": "static readFile(context, fs, filepath, charset){\n\t\treturn (async_ctx_0) => {\n\t\t\tvar async_jump_0 = async_ctx_0.current();\n\t\t\tif (async_jump_0 == \"0\"){\n\t\t\t\tif (filepath == undefined) filepath=\"\";\n\t\t\t\tif (charset == undefined) charset=\"utf8\";\n\t\t\t\t\n\t\t\t\treturn fsModule.readFileSync(filepath, {encoding : charset}).toString();\n\t\t\t\treturn async_ctx_0.resolve(\"\");\n\t\t\t}\n\t\t\telse if (async_jump_0 == \"-1\"){\n\t\t\t\treturn async_ctx_0.error( async_ctx_0.getError() )\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn async_ctx_0.next();\n\t\t\t}\n\t\t\treturn async_ctx_0.end();\n\t\t}\n\t}", "title": "" }, { "docid": "98c40e2ae64bceaf181b69c484686e08", "score": "0.56227493", "text": "_saveToLocalFs() {\n\t return this._params.tests.reduce((res, test) => {\n\t const content = wrapCode(test.code);\n\t const localPath = utils.join(this._params.localBaseDir, test.path);\n\t return res\n\t .then(() => fs.writeFile(localPath, content))\n\t .then(entry => this._localUrls.push(entry.toURL()))\n\t }, Promise.resolve())\n\t }", "title": "" }, { "docid": "356cd025da64800a5e94fdfc5f7f90eb", "score": "0.56174266", "text": "constructor() {\n // Stores the opened data files.\n this.opened = {};\n /*\n * Structure of objects in opened:\n * data {object} - The payload JSON data object.\n * dirty {boolean} - True if we have not initiate the write operation for\n * what is currently in the data object, and the data object differs from\n * the on disk data.\n * writeInProgress {boolean} - True if we are currently writing.\n * pending {boolean} - True if we wanted to flush dirty data when write is\n * in progress.\n * flushActive {boolean} - True if _flushDirtyData() is running.\n * onFlushDone {function} - Called when _flushDirtyData() finishes.\n */\n\n // Where to store the data files?\n this.dataDir = 'small_data';\n\n // If set to true, we'll always automatically flush dirty cache.\n // This can only be set in the constructor.\n this.autoFlush = true;\n\n if (!this.autoFlush) {\n // If no auto flush, then we'll need to flush periodically.\n this._routineFlusher();\n }\n try {\n fs.mkdirSync(this.dataDir);\n } catch (e) {\n // Doesn't matter, the directory might already exist.\n }\n\n // Check that the directory exists.\n let stat = fs.statSync(this.dataDir);\n assert.equal(stat.isDirectory(), true);\n }", "title": "" }, { "docid": "bd9eef6db1f7478bf2cd9d9a8700fea7", "score": "0.5609533", "text": "function FileAPI() {\n return typeof File === 'undefined' ? NodeFile : File\n}", "title": "" }, { "docid": "9bdebc456bd91ec707dbf4ffa25cd867", "score": "0.5608718", "text": "function FileSystemSuccessCallback(){\r\n}", "title": "" }, { "docid": "18fc4fd2b83faf298728ef2e7a4f82ef", "score": "0.56069213", "text": "function fs(e,t,n,r){os.call(this,e,t,n,r)}", "title": "" }, { "docid": "b01009df009f8c5ae258cb05df1c282c", "score": "0.55994475", "text": "function ResourceFS(manager, prefix, opts) {\n this.manager = manager;\n this.prefix = prefix;\n this.opts = opts;\n this.writeFileOpts = {\n create: true,\n };\n this.readFileOpts = {\n };\n}", "title": "" }, { "docid": "939806f617fc3a7ba351fcd009b462d2", "score": "0.55786395", "text": "function lseek() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "1c9e8f39ef0f2d967fd401d8ab11a1d4", "score": "0.5541173", "text": "function onFileSystemSuccess(fileSystem) {\n\tfs = fileSystem;\n\tvar entry = fs.root;\n entry.getDirectory(\"underground-streams-test\", {create: true, exclusive: true}, onGetDirectorySuccess, onGetDirectoryFail);\n}", "title": "" }, { "docid": "89f882147ca8aba98a462a3c7a051a0b", "score": "0.5540675", "text": "function whateverItSays() {\n \n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }\n });\n}", "title": "" }, { "docid": "ea4a2a64ecc89e2b9ff070fc82b44f1c", "score": "0.5538461", "text": "function create_fs() {\n mkdirp(__dirname + '/data/', function (err) {\n if (err) {\n stage.error(err)\n } else { \n stage.process('success create folder: ./data/')\n }\n })\n}", "title": "" }, { "docid": "e07cbe106ef6391aeecbf146f98e20d3", "score": "0.55337834", "text": "async function init() {\n try {\n await fs.writeFile('teste.txt', 'bla bla bla');\n await fs.appendFile('teste.txt', '\\nwith append file');\n const data = await fs.readFile('teste.txt', 'utf-8');\n console.log(data);\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "045e24e6cc753017a488ba165b7fded5", "score": "0.55295384", "text": "readMyFile () {\n try {\n this.data = fs.readFileSync(this.textFile, 'utf8')\n } catch (err) {\n console.error(err)\n } \n }", "title": "" }, { "docid": "30dc9922cbf2cd938744dea4ef14106e", "score": "0.5528764", "text": "function initRootFs() {\n var ds = [ \"/bin\"\n , \"/etc\"\n , \"/etc/zoneinfo\"\n , \"/dev\"\n , \"/dev/shm\"\n , \"/tmp\"\n ];\n ds.forEach(d => bfs.mkdirSync(d, 511 /*=0777*/));\n}", "title": "" }, { "docid": "eb906b8b86e0895a7e9c5301e2386c66", "score": "0.55249697", "text": "static initialize() {\n\n const indexPath = RESTFile.storageRoot() + '/index.json'\n\n if (fs.existsSync(indexPath)) {\n RESTFile.indexJSON = JSON.parse(fs.readFileSync(indexPath, 'utf8'))\n } else {\n RESTFile.indexJSON = {}\n }\n\n if (!fs.existsSync(RESTFile.storageRoot())) fs.mkdirSync(RESTFile.storageRoot())\n\n }", "title": "" }, { "docid": "5a55da56b9759b55aa1bc3ad4eef67f7", "score": "0.5520521", "text": "function openFS() {\n try {\n filer.init({persistent: true, size: 20 * 1024 * 1024}, function (fs) {\n console.log(fs.root.toURL());\n console.log('Opened: ' + fs.name +'.');\n\n setCwd('/'); // Display current path as root.\n refreshFolder();\n// openFsButton.innerHTML = '<div></div>';\n// openFsButton.classList.add('fakebutton');\n\n }, function (e) {\n if (e.name == 'SECURITY_ERR') {\n// errors.textContent = 'SECURITY_ERR: Are you running in incognito mode?';\n// openFsButton.innerHTML = '<div></div>';\n// openFsButton.classList.add('fakebutton');\n return;\n }\n onError(e);\n });\n } catch (e) {\n if (e.code == FileError.BROWSER_NOT_SUPPORTED) {\n fileList.innerHTML = 'BROWSER_NOT_SUPPORTED';\n }\n }\n}", "title": "" }, { "docid": "8f0ba6c08302533239086cace272c2f9", "score": "0.55173165", "text": "function appendFile() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "573a4a8e428df6f8c9577044b8e574fd", "score": "0.55168265", "text": "function link() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "14c766cac2c884ebe1b7cf3e1206ab8a", "score": "0.55134016", "text": "static get web() { return \"https://file.io/\"; }", "title": "" }, { "docid": "d5c6cd5cf3a2b08338c1325d7de78dbe", "score": "0.55080277", "text": "function DeviceDriverFileSystem() // Add or override specific attributes and method pointers.\n{\n this.driverEntry = krnFileSystemDriverEntry;\n\n function krnFileSystemDriverEntry() {\n // Initialization routine for this, the kernel-mode file system Device Driver.\n this.status = \"loaded\";\n }\n\n this.formatFileSystem = function() {\n try {\n for (var track = 0; track < 4; track++) {\n for (var sector = 0; sector < 8; sector++) {\n for (var block = 0; block < 8; block++) {\n if (track + \"\" + sector + \"\" + block === \"000\") {\n localStorage[track + \"\" + sector + \"\" + block] = \"SPECIAL\";\n } else {\n localStorage[track + \"\" + sector + \"\" + block] = \"0000~\";\n var tsb = new TSB(track + \"\" + sector + \"\" + block);\n tsb.clear();\n }\n }\n }\n }\n return true;\n } catch (e) {\n return false;\n }\n }\n\n this.createFile = function(filename) {\n var directory = claimFreeDirectory();\n if (directory !== null) {\n var croppedName = filename.slice(0, Math.min(filename.length, 60));\n directory.write(croppedName);\n var data = claimFreeBlock();\n if (data !== null) {\n directory.linkTo(data);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n\n this.deleteFile = function(filename) {\n var tsb = this.findDirectory(filename);\n if (tsb !== null) {\n var nextTSB = tsb.getLinkedTSB();\n tsb.clear();\n var currentTSB = nextTSB;\n\n // delete all links\n do {\n nextTSB = currentTSB.getLinkedTSB();\n currentTSB.clear();\n currentTSB = nextTSB;\n } while (currentTSB !== null);\n\n return 1;\n } else {\n console.log(\"couldn't find\");\n //TODO throw error\n return -1;\n }\n }\n\n this.writeToFile = function(filename, contents) {\n this.clearFile(filename);\n var segmentCount = Math.ceil(contents.length / 60);\n var segments = [];\n for (var i = 0; i < segmentCount; i++) {\n segmentEnd = Math.min((i+1)*60, contents.length);\n segments.push(contents.slice(i*60, segmentEnd));\n }\n \n var tsb = this.findDirectory(filename);\n if (tsb !== null) {\n var currentTSB = tsb.getLinkedTSB();\n for (var i = 0; i < segments.length; i++) {\n // write data\n currentTSB.write(segments[i]); \n // if there is remaining data, make a new block and link it to current one\n if (segments.length - 1 > i) { \n linkedTSB = claimFreeBlock();\n currentTSB.linkTo(linkedTSB);\n currentTSB = linkedTSB;\n }\n }\n // return success\n return true;\n } else {\n //TODO throw error\n return false;\n }\n }\n\n this.readFromFile = function(filename) {\n var tsb = this.findDirectory(filename);\n if (tsb !== null) {\n var contents = \"\";\n var currentTSB = tsb.getLinkedTSB();\n\n // aggregate contents\n do {\n contents += currentTSB.getContents();\n currentTSB = currentTSB.getLinkedTSB();\n } while (currentTSB !== null);\n\n // return aggregated contents\n return contents;\n } else {\n console.log(\"couldn't find\");\n //TODO throw error\n return \"\";\n }\n }\n\n this.getAllFilenames = function() {\n var names = [];\n var track = 0;\n for (var sector = 0; sector < 8; sector++) {\n for (var block = 0; block < 8; block++) {\n var tsb = new TSB(track + \"\" + sector + \"\" + block);\n if (tsb.isClaimed()) {\n names.push(tsb.getContents());\n }\n }\n }\n return names;\n }\n\n this.findDirectory = function(name) {\n var track = 0;\n for (var sector = 0; sector < 8; sector++) {\n for (var block = 0; block < 8; block++) {\n var tsb = new TSB(track + \"\" + sector + \"\" + block);\n if (tsb.isClaimed() && tsb.getContents() === name) {\n return tsb;\n } else if (tsb.isClaimed()){\n } \n }\n }\n return null;\n }\n\n this.clearFile = function(filename) {\n var tsb = this.findDirectory(filename);\n if (tsb !== null) {\n var nextTSB = tsb.getLinkedTSB();\n var currentTSB = nextTSB;\n nextTSB = currentTSB.getLinkedTSB();\n currentTSB.clear();\n currentTSB.claim();\n currentTSB = nextTSB;\n\n // delete all links\n while (currentTSB !== null) {\n nextTSB = currentTSB.getLinkedTSB();\n currentTSB.clear();\n currentTSB = nextTSB;\n }\n\n return 1;\n } else {\n console.log(\"couldn't find\");\n //TODO throw error\n return -1;\n }\n }\n}", "title": "" }, { "docid": "6eb1bb3ee9e28564cf14e90ad1619715", "score": "0.54742444", "text": "function streamFile ()\n\t{\n\t}", "title": "" }, { "docid": "f6a4402c66feb826335d48a1bb3477ad", "score": "0.5468461", "text": "constructor(sffs, path, flags, accessType, callback, options) {\n this.sffs = sffs;\n this.path = path;\n this.flags = flags;\n this.accessType = accessType;\n this.options = options;\n this.cursor = 0;\n\n // Open a temp file, and download the remote file into it. As reads are\n // requested, we will satisfy them from that file. If the file is still\n // downloading, and too small to satisfy the read, we will retry via\n // setTimeout() a number of times before failing out.\n this.fd = null;\n this.tmpPath = null;\n this.error = null;\n this.downloaded = false;\n\n const openFd = () => {\n const fd = this.sffs.fds.length;\n this.sffs.fds[fd] = this;\n callback(null, fd);\n };\n\n // Open a temp file to back the remote file.\n tmp.file({ detachDescriptor: true }, (tmpError, tmpPath, tmpFd) => {\n if (tmpError) {\n callback(tmpError);\n return;\n }\n\n this.tmpFd = tmpFd;\n this.tmpPath = tmpPath;\n\n // When reading, we fetch the existing file from API.\n if (this.accessType !== ACCESS_WRITE) {\n // open the path as a stream for downloading.\n const ws = fs.createWriteStream(this.tmpPath, {\n fd: this.tmpFd,\n start: 0,\n autoClose: false,\n });\n\n // Try to download the file, this will allow reading and modification.\n this.sffs.rest.download(this.path, (e, res) => {\n res\n // Download complete, because of autoClose (default: true), the\n // stream is closed, we can reopen the path for reading.\n .on('error', (downloadError) => {\n callback(downloadError);\n })\n .pipe(ws)\n .on('finish', () => openFd());\n }, this.options);\n // When writing, we don't need to fetch.\n } else {\n openFd();\n }\n });\n }", "title": "" }, { "docid": "000241d8f544f52d354a5608a1a0dcf4", "score": "0.54675037", "text": "function createFileSystem() {\n\twindow.requestFileSystem(window.TEMPORARY, $('#fileSystemSize').val() * 1024*1024, \n\t\t\t\t\t\t\tfunction(filesystem) {\n\t \t\t\t\t\t\tfs = filesystem;\n\t \t\t\t\t\t\tshowNotification('Filesystem created !!');\n\t \t\t\t\t\t\t}, \n\t \t\t\t\t\t\tfileSystemErrorHandler);\n}", "title": "" }, { "docid": "47ce8493777339470e0cfdb4b703f6bc", "score": "0.54513204", "text": "function test_appendFile() {\n\tconsole.log(\"======= testing: fs.appendFile(...) ========\")\n\tvar info = \"ali: \" + (new Date());\n\tfs.appendFile(testFile, \"\\n\" + info, (err) => {\n\t\tif (err) throw err\n\t\tconsole.log(\"Appended!\");\n\t})\n}", "title": "" }, { "docid": "113e3cf782d5ab3da555beb7b6d8b0cb", "score": "0.54470295", "text": "function doThis() {\n fs.readFile(\"random.txt\", \"utf-8\", function (error, data) {\n if (error) {\n return console.log(error);\n }\n });\n\n}", "title": "" }, { "docid": "f199b5ff58e8851e52f7e9440838f7f8", "score": "0.54395425", "text": "async function mkfs(){\n\n // try to establish a connection to the module\n await getConnection();\n\n _mculogger.log('Formatting the file system...this will take around ~30s');\n\n try{\n const response = await _nodeMcuConnector.format();\n\n // just show complete message\n _mculogger.log('File System created | ' + response);\n }catch(e){\n _mculogger.error('Formatting failed');\n _logger.debug(e);\n }\n}", "title": "" }, { "docid": "7cea51d26af1937882f5f88588f21bec", "score": "0.54379845", "text": "function gotFS3(fileSystem) {\n\t\t\t\t\t\t\tfileSystem.root.getFile(dirPath, {create: false, exclusive: false}, gotFileEntry3, fail);\n\t\t\t\t\t\t}", "title": "" }, { "docid": "11f28d5dfaf7b82fd6ab46f6e1bb25cc", "score": "0.5430396", "text": "function fail(e) {\n console.log(\"FileSystem Error\");\n console.dir(e);\n }", "title": "" }, { "docid": "9030859a610c6e353558ec0b57cdb95f", "score": "0.54294467", "text": "function useFS() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n if (error) {\n return console.log(error);\n }\n\n var arrData = data.split(\",\")\n method = arrData[0]\n input = arrData[1]\n input = input.replace(/['\"]+/g, '')\n console.log(`${method} ${input}`)\n readMethod();\n });\n}", "title": "" }, { "docid": "92907f810e138ca8ae0c1c419b2b9a61", "score": "0.5418644", "text": "loadFromLocal(local_path) {\n let nodeFs = this.get('fs');\n let nodePath = this.get('path');\n let nodeJszip = this.get('jszip');\n\n if(nodeFs.lstatSync(local_path).isDirectory()) {\n\n } else {\n if(local_path.endsWith('inventory.json')) {\n let inventory = require(local_path);\n let books = inventory.comic_books.map(entry => LocalBook.create(entry));\n return new Promise((resolve) => resolve(books));\n }\n if(local_path.endsWith('.cbz')) {\n let episode_title = nodePath.basename(local_path);\n let series_title = 'unknown';\n let book = LocalBook.create({path: local_path, episode_title, series_title, nodeJszip, nodeFs});\n return new Promise((resolve) => resolve([book]));\n }\n }\n }", "title": "" }, { "docid": "68341104492d97669c908708862f2bca", "score": "0.5418047", "text": "function createNullFile() {\n return new File({\n cwd: \"/\",\n base: \"/test/\",\n path: \"/test/whatever\",\n contents: null\n });\n}", "title": "" }, { "docid": "6e206325c2a40a80e10055d073c28dae", "score": "0.54169226", "text": "function readFs() {\n\tvar dataArr = [];\n\t//file system to read and call back with content frome file.\n\tfs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\t\tif(error) {\n\t\t \tthrow error (\"error!!!!\");\n\t\t} \n\t\t//splice out the song name and pass to spotifyReq() method.\n\t\tdataArr = data.split(\",\");\n\t\tspotifyReq(dataArr[1].slice(1, 19));\n\t});\n}", "title": "" }, { "docid": "cf7faf15101e2182783c253e6a92da0a", "score": "0.54129535", "text": "function mkdtemp() {\n throw new Errors.ENOSYS('Filer native fs function not yet supported.');\n}", "title": "" }, { "docid": "a78480b7dc20361326ca297b6f200ecf", "score": "0.5393172", "text": "async start() {\n return await this.fs.start();\n }", "title": "" }, { "docid": "49ae724af12ff19a993c6bd84f1b6c82", "score": "0.53908676", "text": "function testFsExt(cb){\n \n // create recursive\n fsExt.existsOrCreate('./test_folder/subfolder/file.json', { data:'[]', replace:false }, function(err){\n if(err) throw err;\n \n fsExt.copydirRecursive('./test_folder/subfolder', './test_folder/subfolder_copy', function(err){\n if(err) throw err;\n \n // copy folder and file should exists\n assert.ok(fs.existsSync('./test_folder/subfolder_copy'));\n assert.ok(fs.existsSync('./test_folder/subfolder_copy/file.json'));\n \n fsExt.rmdirRecursive('./test_folder/subfolder_copy', function(err){\n if(err) throw err;\n \n // copy folder should'not exists any more\n assert.ok(!fs.existsSync('./test_folder/subfolder_copy'));\n \n // watch require json file\n fsExt.requireAsync('./test_folder/subfolder/file.json', { watch:true, isJson:true }, function(err, data){\n if(err) throw err;\n assert.deepEqual(data, []);\n \n // update json file\n fsExt.existsOrCreate('./test_folder/subfolder/file.json', { data:'[\"updated\"]', replace:true }, function(err){\n if(err) throw err;\n \n fsExt.writeFile('./test_folder/subfolder/file2.json', '{some data}', function(err){\n if(err) throw err;\n \n setTimeout(function(){\n fsExt.requireAsync('./test_folder/subfolder/file.json', { watch:true, isJson:true }, function(err, data){\n if(err) throw err;\n assert.deepEqual(data, ['updated']);\n \n // remove folder\n fsExt.rmdirRecursive('./test_folder/subfolder', function(err){\n if(err) throw err;\n \n setTimeout(function(){\n fsExt.requireAsync('./test_folder/subfolder/file.json', { watch:true, isJson:true }, function(err, data){\n assert.ok(err.code === 'ENOENT');\n \n // folder should'not exists any more\n assert.ok(!fs.existsSync('./test_folder/subfolder'));\n \n cb();\n });\n }, 500);\n });\n });\n }, 500);\n });\n });\n \n });\n });\n });\n });\n}", "title": "" }, { "docid": "cd498c2717c89f9228a5716b5f8bcdff", "score": "0.5390824", "text": "special(cb) {\n let _self = this;\n if (this.type === 'directory') {\n fs.readdir(this.path, (err, children) => {\n _self.content = {\n type: 'list',\n list: children\n };\n cb(err);\n });\n } else if (this.type === 'file') {\n _self.content = {\n type: 'localfile',\n address: _self.path\n };\n metadataProcessor(this, cb);\n } else {\n cb();\n }\n }", "title": "" }, { "docid": "061b9c4d1b0e1168e4aa15219df72c72", "score": "0.53838444", "text": "openOutstream() {\n let params = this.getConfig();\n\n // check file exists && if append mode\n if (!this.config.append && !this.config.overwrite) {\n let newFile = true;\n while (newFile) {\n try {\n fs.statSync(params.filePath);\n this.incrementKey();\n params = this.getConfig();\n } catch (err) {\n newFile = false;\n }\n }\n }\n\n // logging\n if (this.config.verbose) {\n this.logger.debug(\n 'ArrayStream: opening local fs stream',\n params.filePath,\n );\n }\n\n // create overwrite or append writestream if in local mode\n this.ensureFolder();\n // add file to files list\n this.files.push(params.filePath);\n try {\n if (this.config.overwrite) {\n // noinspection ExceptionCaughtLocallyJS\n throw new Error('Go to next catch statement');\n }\n const { size } = fs.statSync(params.filePath);\n if (this.config.debug)\n this.logger.debug('ArrayStream: Opening append outstream. Size:', size);\n let useSep = false;\n if (size >= 3) {\n if (this.config.debug) this.logger.debug('file size >=3 ');\n const buf = new Buffer.alloc(1);\n const fd = fs.openSync(params.filePath, 'r');\n const bytesRead = fs.readSync(fd, buf, 0, 1, size - 3);\n if (bytesRead === 1) {\n if (this.config.debug) this.logger.debug('read 1 byte');\n const str = buf.toString();\n useSep = !(str === '[' || str === ',');\n if (this.config.debug)\n this.logger.debug('got str', str, 'usesep', useSep);\n }\n fs.closeSync(fd);\n }\n this.outstream = fs.createWriteStream(params.filePath, {\n flags: 'a+',\n start: size - 2,\n });\n if (this.config.verbose)\n this.logger.debug(\n 'ArrayStream: opening local fs stream in a+ mode',\n params.filePath,\n );\n this.sep = useSep ? CONSTANTS.SEPARATOR : '';\n } catch (err) {\n if (this.config.debug) this.logger.error(err);\n if (this.config.debug)\n this.logger.debug('ArrayStream: Opening overwrite outstream');\n this.outstream = fs.createWriteStream(params.filePath);\n if (this.config.verbose)\n this.logger.debug(\n 'ArrayStream: opening local fs stream in w mode',\n params.filePath,\n );\n this.outstream.write('[');\n this.sep = '';\n }\n }", "title": "" }, { "docid": "644fe20481c47cd82faa255d7a4e4eb0", "score": "0.5369956", "text": "function tryingFile(){\n\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, fileSystemCallback, onError);\n \n}", "title": "" }, { "docid": "b0f83328503549cdcfdf6e2ce6823bd4", "score": "0.53665894", "text": "extend(config, ctx) {\n config.node = {\n fs: 'empty'\n }\n }", "title": "" }, { "docid": "b81ba75ff7554d0ac96498aacf40de07", "score": "0.5366143", "text": "async function init() {\n const mainFolderPath = getFolderPath()\n const solcCachePath = getSolcCachePath()\n\n if (!(await fs.exists(mainFolderPath)))\n await fs.mkdir(mainFolderPath)\n\n if (!(await fs.exists(solcCachePath)))\n await fs.mkdir(solcCachePath)\n}", "title": "" }, { "docid": "e5d5882cfe69e4cbd8737fd3750864d5", "score": "0.5355925", "text": "#injectGlobals() {\n const decoder = new TextDecoder(\"utf-8\");\n let outputBuffer = \"\";\n\n fs.writeSync = (fd, buf) => {\n outputBuffer += decoder.decode(buf);\n const nl = outputBuffer.lastIndexOf(\"\\n\");\n if (nl != -1) {\n\n const msg = outputBuffer.substr(0, nl);\n if (msg.startsWith(\"panic:\")) this.#panic = [];\n \n if (this.#panic !== false) {\n this.#panic.push(msg);\n } else {\n this.log(msg);\n }\n\n // Start the new buffer\n outputBuffer = outputBuffer.substr(nl + 1);\n }\n return buf.length;\n }\n }", "title": "" }, { "docid": "a65bd20552099cb76f90bef33c2b630b", "score": "0.5346796", "text": "function readLocalFile() {\n\n var frameStart = new Date().getTime(),\n file = __dirname + '/data/frame' + currentFrame + '.json',\n frames = [];\n\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n console.log('Error: ' + err);\n return;\n }\n frames.push(JSON.parse(data));\n render(data, frameStart); // need to stringify everything\n });\n }", "title": "" }, { "docid": "4f248bf9225016826089bf0a446667f5", "score": "0.5346584", "text": "function gotFS(fileSystem) {\n // on iphone current dir defaults to <myname>.app/documents\n // so we wanna look in our parent directory for <something>.app\n fileSystem.root.getDirectory('../', null, gotDirEntry, fail);\n }", "title": "" }, { "docid": "abda549d10aa6f04262bb006c0ae0b6a", "score": "0.53438556", "text": "function FileSystemListener(){\r\n}", "title": "" }, { "docid": "43f4f893881964d939227267f491fed2", "score": "0.534206", "text": "function saveFileFromMemoryFSToDisk(memoryFSname,localFSname) // This can be called by C++ code\r\n {\r\n var data=FS.readFile(memoryFSname);\r\n var blob;\r\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\r\n if(isSafari) {\r\n blob = new Blob([data.buffer], {type: \"application/octet-stream\"});\r\n } else {\r\n blob = new Blob([data.buffer], {type: \"application/octet-binary\"});\r\n }\r\n saveAs(blob, localFSname);\r\n }", "title": "" }, { "docid": "4220b7db98f8d006a2cf525c5a335bb2", "score": "0.53396696", "text": "static isDir(context, fs, path){\n\t\treturn (async_ctx_0) => {\n\t\t\tvar async_jump_0 = async_ctx_0.current();\n\t\t\tif (async_jump_0 == \"0\"){\n\t\t\t\t\n\t\t\t\treturn fsModule.lstatSync(path).isDirectory();\n\t\t\t}\n\t\t\telse if (async_jump_0 == \"-1\"){\n\t\t\t\treturn async_ctx_0.error( async_ctx_0.getError() )\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn async_ctx_0.next();\n\t\t\t}\n\t\t\treturn async_ctx_0.end();\n\t\t}\n\t}", "title": "" }, { "docid": "b5c939900e0762a57e6e99704aa4ad07", "score": "0.5327665", "text": "function testFileContext() { return this }", "title": "" }, { "docid": "7d8703eb69859e02067b857a8ede5f49", "score": "0.5319664", "text": "function fsWrite(path,content,back){\r\n\t\tvar fs=api.require('fs');\r\n\t\tfs.open({\r\n\t\t path:path,\r\n\t\t flags:'read_write'\r\n\t },function(ret,err){\r\n\t \tif(ret.status)\r\n\t \t{\r\n\t \t\tvar fid=ret.fd;\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tfs.write({\r\n\t\t fd:fid,\r\n\t\t data:content,\r\n\t\t offset:0,\r\n\t\t overwrite:true\r\n\t },function(ret,err){\r\n\t \tif(ret.status)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tfs.close({\r\n\t\t fd:fid\r\n\t },function(ret,err){\r\n\t \tif(ret)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":true}');\r\n\t\t\t \t\t\t\tvar back_err=JSON.parse('{\"status\":false,\"error\":4}');\r\n\t\t\t \t\t\t\tback(back_ret,back_err); \r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t\t\t \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t\t\t\t\t \t\tback(back_ret,back_err); \r\n\t \t}\r\n\t }); \t\t\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tfs.close({\r\n\t\t fd:fid\r\n\t },function(ret,err){\r\n\t \tif(ret)\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(ret));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t \t\t\t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t\t\t \t\t\t\tback(back_ret,back_err); \r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t\t\t\t\t \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t\t\t\t\t \t\tback(back_ret,back_err); \r\n\t \t}\r\n\t }); \t\t\r\n\t \t}\r\n\t });\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tconsole.log(JSON.stringify(err));\r\n\t \t\tvar back_ret=JSON.parse('{\"status\":false}');\r\n\t \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n\t \t\tback(back_ret,back_err); \t\r\n\t \t}\r\n\t });\r\n\t}", "title": "" }, { "docid": "33432d3191c636986acfdcc24461ef55", "score": "0.5313899", "text": "function gotFS(fileSystem) {\n\t\tstore = cordova.file.dataDirectory;\n\t\t//console.log('store location : '+ store + 'ApplicationDirectory : '+cordova.file.applicationDirectory);\n\t\twindow.appRootDirName = \"tailorrani\";\n\t\tonRequestFileSystemSuccess(fileSystem);\n\t // save the file system for later access\n\t //console.log(fileSystem.root.fullPath);\n\t window.fileSystem = fileSystem;\n\t window.rootFS = fileSystem.root;\n\t //console.log('window.rootFS : '+window.rootFS);\n\t fileSystem.root.getDirectory(window.appRootDirName, {\n create: true,\n exclusive: false\n }, dirReady, fail);\n\t}", "title": "" }, { "docid": "d88edcf33b97561b16a9aad0a11aa205", "score": "0.530762", "text": "function getFile(localPath, res, mimeType) {\n fs.readFile(localPath, function(err, contents) {\n if(!err) {\n res.setHeader(\"Content-Length\", contents.length);\n res.statusCode = 200;\n if(infoSent) {\n //console.log(contents);\n\n infoSent = false;\n }\n res.write(contents);\n res.end();\n } else {\n res.writeHead(500);\n res.end();\n }\n });\n}", "title": "" }, { "docid": "2d6a90e592432a149ad412d3085267ff", "score": "0.5304395", "text": "function testFile(file, annexed, dir, callback) {\n fs.access(file.path, function (accessErr) {\n if (!accessErr) {\n // accessible\n handleFsAccess(file, callback)\n } else {\n // inaccessible\n fs.lstat(file.path, function (lstatErr, lstats) {\n if (!lstatErr && lstats && lstats.isSymbolicLink()) {\n // symlink\n if (options.getOptions().remoteFiles)\n // only follow symlinks when --remoteFiles option is on\n handleRemoteAccess(file, annexed, dir, callback)\n else\n callback(\n new Issue({\n code: 114,\n file,\n }),\n file.stats,\n )\n } else {\n // inaccessible local file\n callback(new Issue({ code: 44, file: file }), file.stats)\n }\n })\n }\n })\n}", "title": "" }, { "docid": "41555fe07506858da2f7a47c9287edb1", "score": "0.53039014", "text": "function fileReadableTest(filePath){\r\n\ttry{\r\n\t\tvar testRead = fs.readFileSync(filePath);\r\n\t}\r\n\tcatch(err){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "a6c82837c7c716ff8fad26feba7d187b", "score": "0.5299101", "text": "function doWhatItSays () {\n\n\tvar fs = require('fs');\n\n\tfs.readFile('random.txt', 'utf8', function (error, data) {\n\n\t\tconsole.log(data);\n\t})\n\n}", "title": "" }, { "docid": "08961e9cbd3b1b7f96117d41b9b2627e", "score": "0.5286256", "text": "function doWhatItSays() {\nfs.readFile('random.txt', 'utf8', function(err, data){\n if (err) throw err;\n console.log(data);\n})\n\n}", "title": "" }, { "docid": "33d573466b131c6823d69e88e952709d", "score": "0.52839375", "text": "saveToFs() {\n var path = RNFS.DocumentDirectoryPath + '/test.txt';\n\n // write the file\n RNFS.writeFile(path, 'Lorem ipsum dolor sit amet', 'utf8')\n .then((success) => {\n console.log('FILE WRITTEN!');\n })\n .catch((err) => {\n console.log(err.message);\n });\n }", "title": "" }, { "docid": "315c545f447ed9b6ba72cee451d7f8a3", "score": "0.5265556", "text": "constructor () {\n this._currentPath = __dirname\n this._dataPath = './data'\n this._hardWordsPath = path.join(path.join(this._currentPath, this._dataPath), 'hardWords.txt')\n this._easyWordsPath = path.join(path.join(this._currentPath, this._dataPath), 'easyWords.txt')\n this._moderateWordsPath = path.join(path.join(this._currentPath, this._dataPath), 'moderateWords.txt')\n }", "title": "" }, { "docid": "a0055b8b3f105982033f9ce88048fb8a", "score": "0.5256766", "text": "function FileMgr() \n{\n\tthis.fileWriters = {}; // empty maps\n\tthis.fileReaders = {};\n\n\tthis.docsFolderPath = \"../../Documents\";\n\tthis.tempFolderPath = \"../../tmp\";\n\tthis.freeDiskSpace = -1;\n\tthis.getFileBasePaths();\n}", "title": "" }, { "docid": "13146ce4729019353b4afc04d78bd1e2", "score": "0.5256705", "text": "constructor(path: string) {\n super();\n this.path = path;\n this.buffer = fs.readFileSync(path);\n this.fileLength = this.buffer.length;\n }", "title": "" }, { "docid": "9e9951f1b898b0c2319a6e9083c3585a", "score": "0.52530205", "text": "cacheFile() {\n let file = nova.path.join(nova.extension.globalStoragePath, 'php', '.php_cs.cache');\n\n try {\n nova.fs.open(file, 'x');\n } catch (error) {\n log('Using existing cache file');\n }\n\n file = file.replace(/([ \"#&%'$`\\\\])/g, '\\\\$1');\n log(`Cache file path is ${file}`);\n\n return file;\n }", "title": "" }, { "docid": "019c805b12cc94a66b849f3a2ad6616a", "score": "0.524915", "text": "async function main() {\r\n const data = await fs.readFile(__filename);\r\n await fs.writeFile(__filename + '.copy', data);\r\n // More awaits here...\r\n}", "title": "" }, { "docid": "d74b9f9a32cb1169831c3428b11084be", "score": "0.5247525", "text": "openExternal () {\n\t\tlet tmpobj = tmp.dirSync();\n\t\tconsole.log('Dir: ', tmpobj.name);\n\n\t\tfs.writeFileSync(tmpobj.name + \"/index.html\", `\n\t\t\t<p>Hello world!</p>`, 'utf8');\n\n\t\tlet folder = new server.Server(tmpobj.name);\n\n\t\topn('http://127.0.0.1:8080');\n\t\trequire('http').createServer(function (request, response) {\n\t\t\tconsole.log(request, response);\n\n\t\t\trequest.addListener('end', function () {\n\t\t\t\tfolder.serve(request, response);\n\n\t\t\t}).resume();\n\t\t}).listen(8080);\n\n\t\t//tmpobj.removeCallback();\n\t}", "title": "" }, { "docid": "9b2da629480dd22b31be2fa64e2ff4b4", "score": "0.5239395", "text": "_validateFilePath() {\n // Ensure Log Directory Exists First\n let logDir = path.dirname(`./logs/temp.txt`);\n\n if (!fs.existsSync(logDir)) {\n console.log(`Unable to locate ${logDir}, creating now...`);\n fs.mkdirSync(logDir);\n this._validateFilePath();\n }\n\n let dirname = path.dirname(this.logFilePath);\n if (fs.existsSync(dirname)) {\n return true;\n } else {\n console.log(`Unable to locate ${dirname}, creating now...`);\n fs.mkdirSync(dirname);\n this._validateFilePath();\n }\n }", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.5238709", "text": "_read() {}", "title": "" }, { "docid": "59d707b6b690bb5a791b73963eede548", "score": "0.5236813", "text": "function init() {\n try {\n fs.unlinkSync(path)\n //file removed\n } catch (err) {\n console.error(err)\n }\n \n}", "title": "" }, { "docid": "99e306c390d9aa51141ea7db573efbd6", "score": "0.52359533", "text": "function storeFile(cb, _givenpath, fileStats, betterFileStats) {\n var givenpath\n , metapath\n ;\n\n function gotErDone(e, stat) {\n if (e) {\n console.error('[gotErDone Error]');\n console.error(e);\n return;\n }\n console.log('finished for', ' ' + givenpath);\n cb();\n }\n\n function saveMeta(e, fileStats) {\n if (e) {\n gotErDone(e, fileStats);\n }\n\n // At this point we know for sure that we have the correct md5sum\n if (betterFileStats.md5sum && betterFileStats.md5sum !== fileStats.md5sum) {\n console.log('very unexpected difference in md5sum');\n }\n betterFileStats.md5sum = fileStats.md5sum;\n\n metaStore(function (e, _metapath) {\n if (e) {\n gotErDone(e, fileStats);\n return;\n }\n\n metapath = _metapath;\n tagStore(function (e) {\n gotErDone(e, fileStats);\n }, fileStats.storepath, betterFileStats.name, betterFileStats.md5sum);\n }, givenpath, betterFileStats);\n }\n\n function getStats(e, fileStats) {\n if (e) {\n console.error('[getStat ERROR] cannot stat ' + givenpath, e.message);\n console.error(e.stack);\n return;\n }\n \n // is this right?\n //fileStats.pathname = givenpath;\n fileStats.filepath = givenpath;\n fileStats.path = givenpath.substr(0, givenpath.lastIndexOf('/'));\n fileStats.name = givenpath.substr(givenpath.lastIndexOf('/') + 1);\n //copyAndChecksum();\n\n fs.realpath(path.resolve(process.cwd(), givenpath), function (err, realpath) {\n fileStats.realpath = realpath.substr(0, realpath.lastIndexOf('/'));\n fileStats.realname = realpath.substr(realpath.lastIndexOf('/') + 1);\n copy(saveMeta, givenpath, fileStats, betterFileStats);\n });\n }\n\n givenpath = _givenpath;\n if (!fileStats) {\n fs.lstat(givenpath, getStats);\n }\n copy(saveMeta, givenpath, fileStats, betterFileStats);\n }", "title": "" } ]
bb828b83e4bc0c3b8e2a59089a36915e
The name of the object.
[ { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.0", "text": "set name(value) {}", "title": "" } ]
[ { "docid": "fe7e0ddba64df27a9bf6d05c287aca12", "score": "0.75015396", "text": "getName () {\n\t\t\treturn this.__name;\n\t\t}", "title": "" }, { "docid": "1a6d019043739b79f135e5a13b63b0b6", "score": "0.7432958", "text": "function getName() { return name; }", "title": "" }, { "docid": "8a930e945909000a89603fb719d3db49", "score": "0.74057037", "text": "@api get name() {\n return this._name;\n }", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7379227", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "ba16cf33266c2027cc09455d338fde68", "score": "0.7371796", "text": "get name() {\n return this.__name.get();\n }", "title": "" }, { "docid": "2ee4343a6dc7d5c6fa158831b0b7516f", "score": "0.72869885", "text": "getName() {\n return this._name\n }", "title": "" }, { "docid": "dbd413a992ca4623d9babad52a6f4c6a", "score": "0.72818685", "text": "name() {\n return this._name || '';\n }", "title": "" }, { "docid": "3f615e21483ae5ffb7f7c954beb385ed", "score": "0.7260695", "text": "get gameObjectName() {\n return this.name;\n }", "title": "" }, { "docid": "6e491b694d9ec2bc73effd17df6f20b7", "score": "0.7230864", "text": "function getName() {\n return name;\n }", "title": "" }, { "docid": "6e491b694d9ec2bc73effd17df6f20b7", "score": "0.7230864", "text": "function getName() {\n return name;\n }", "title": "" }, { "docid": "b37bb4d093ae55d850c166bd4a1ef908", "score": "0.71709365", "text": "getName() {\n\t\treturn this.name\n\t}", "title": "" }, { "docid": "ae20800ef85916e0d95dfda8bc2d1dd9", "score": "0.71680355", "text": "get name() {\n return this._name\n }", "title": "" }, { "docid": "575f25289c46baf68dc9989195d00715", "score": "0.71242195", "text": "get name () {\n\t\t\treturn this.getName();\n\t\t}", "title": "" }, { "docid": "370924d13f9f1198e80506ce168ae9c6", "score": "0.7114439", "text": "get name () {\r\n\t\treturn this._name;\r\n\t}", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.7106446", "text": "get name() { return this._name; }", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.7066627", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.7066627", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.7066627", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.7066627", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.7066627", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.70525736", "text": "get name() {}", "title": "" }, { "docid": "6ede2306f969efdc1c9d7940d3634e38", "score": "0.7036085", "text": "function getObjectName(object) {\n if (object === undefined) {\n return '';\n }\n\n if (object === null) {\n return 'Object';\n }\n\n if (_typeof(object) === 'object' && !object.constructor) {\n return 'Object';\n }\n\n var funcNameRegex = /function ([^(]*)/;\n var results = funcNameRegex.exec(object.constructor.toString());\n\n if (results && results.length > 1) {\n return results[1];\n } else {\n return '';\n }\n}", "title": "" }, { "docid": "dee8b9998d3083ace528ea4adb344316", "score": "0.6999813", "text": "get name() {return this._name;}", "title": "" }, { "docid": "6d7e1b30dc725dd6a466f9b8a03aced9", "score": "0.6989838", "text": "get name() { return this._name;}", "title": "" }, { "docid": "4dc384b25bb4310503b42a4e5bf41c4f", "score": "0.6975087", "text": "function getName (){\n\t\treturn killroy.name;\n\t}", "title": "" }, { "docid": "a15384f77562ec1dbff64087a498b1c4", "score": "0.695722", "text": "function getObjectName(object) {\n if (object === undefined) {\n return '';\n }\n if (object === null) {\n return 'Object';\n }\n if (typeof object === 'object' && !object.constructor) {\n return 'Object';\n }\n var funcNameRegex = /function ([^(]*)/;\n var results = funcNameRegex.exec(object.constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n }\n else {\n return '';\n }\n}", "title": "" }, { "docid": "5148a9663921cc5236bcbe77a7758ade", "score": "0.6946964", "text": "getName() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.6937328", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "748426e30ba16d20ac29345d2bac6024", "score": "0.6934611", "text": "get name() {\n return this._name || this.type + '_' + this.id;\n }", "title": "" }, { "docid": "32aa72eabd0aa815beb1ecb30631f8aa", "score": "0.6902335", "text": "get name()\n {\n return this.constructor.name;\n }", "title": "" }, { "docid": "b2a112cfd3f39de24a2e0c9568832414", "score": "0.68981296", "text": "getName() {\n return _name.get(this)\n }", "title": "" }, { "docid": "88a0d06ee16d6f2af5c08fffb77f6893", "score": "0.68973064", "text": "getName() {}", "title": "" }, { "docid": "88a0d06ee16d6f2af5c08fffb77f6893", "score": "0.68973064", "text": "getName() {}", "title": "" }, { "docid": "644c71221d9843f0366928b586d240ea", "score": "0.6882727", "text": "function objName(id) {\n var obj = getObject(id);\n return (obj) ? obj.common.name : null;\n}", "title": "" }, { "docid": "c51b125fae8557d371e65d3c4536aa76", "score": "0.6874983", "text": "function getName() {\n return this.name;\n}", "title": "" }, { "docid": "51529fa280f055b8b92f528c656f1833", "score": "0.6864753", "text": "function getObjectName(obj) {\n var looksLikeAFn = /function ([\\w\\d\\-_]+)\\s*\\(/;\n\n // I think this line is busted. Like really. WTF is RegExp.$1? First time\n // I've seen this in my life. Apparently this capture the regex matches in\n // a global fashion.\n // TODO: see if this is usable in a cross-browser fashion.\n return obj.name || (looksLikeAFn.test(obj.toString()) ? RegExp.$1 : \"{anonymous}\");\n }", "title": "" }, { "docid": "611f89978eefa7bc095d69e035319012", "score": "0.6862518", "text": "getName() {\n return this.name\n }", "title": "" }, { "docid": "c299e8a296a99996d74f6daeface31e6", "score": "0.68369025", "text": "getName(obj) {\n let primitive = obj.element;\n let name = null;\n if (this.names.containsKey(primitive)) {\n name = this.names.getValue(primitive);\n }\n // Object is new.\n if (name == null) {\n let sName = this.generateName();\n name = new PdfName(sName);\n this.names.setValue(primitive, name);\n if (obj instanceof PdfFont) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfTemplate) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfTransparency) {\n this.add(obj, name);\n }\n else if (obj instanceof PdfImage || obj instanceof PdfBitmap) {\n this.add(obj, name);\n }\n }\n return name;\n }", "title": "" }, { "docid": "b4b5b02c5ac83156002ad82798ffdc85", "score": "0.6805423", "text": "get name() {\n this._logger.debug(\"get name\");\n\n return this._name;\n }", "title": "" }, { "docid": "2924ef29df0ba67cff3403529724ef13", "score": "0.676968", "text": "static get _name() {\r\n return name;\r\n }", "title": "" }, { "docid": "2924ef29df0ba67cff3403529724ef13", "score": "0.676968", "text": "static get _name() {\r\n return name;\r\n }", "title": "" }, { "docid": "faddf8b8b90546b1e6cf54ccc1fb175e", "score": "0.6768872", "text": "get name() {\n return this._data.name;\n }", "title": "" }, { "docid": "a9254dc64790ba09480fa6a5e4784d84", "score": "0.6763625", "text": "getName () {\n\t\treturn this.definition.name;\n\t}", "title": "" }, { "docid": "35900dde0c8d71ca65dfdc78e104577c", "score": "0.6760783", "text": "get Name() { return this.name }", "title": "" }, { "docid": "3d744f2b79d28217da7bb2179c5cea51", "score": "0.6754763", "text": "get name() {\n let system = this.constructor;\n return system.name;\n }", "title": "" }, { "docid": "32fca8a0e0ec38873157fe45a53ac33f", "score": "0.6750161", "text": "function getPickedObjectName(obj) {\n // auto-generated from a multi-material object, use parent name instead\n if (obj.isMesh && obj.isMaterialGeneratedMesh && obj.parent) {\n return obj.parent.name;\n } else {\n return obj.name;\n }\n}", "title": "" }, { "docid": "32fca8a0e0ec38873157fe45a53ac33f", "score": "0.6750161", "text": "function getPickedObjectName(obj) {\n // auto-generated from a multi-material object, use parent name instead\n if (obj.isMesh && obj.isMaterialGeneratedMesh && obj.parent) {\n return obj.parent.name;\n } else {\n return obj.name;\n }\n}", "title": "" }, { "docid": "124cde9c222a3999cbe1e4cc19fa76a7", "score": "0.67292744", "text": "getName () {\r\n return this.name\r\n }", "title": "" }, { "docid": "249c24c640f315bac1e5a8fc44f4c731", "score": "0.6705799", "text": "toString () {\n\t\treturn this.name;\n\t}", "title": "" }, { "docid": "bc9fdb910ccd1f48463c902f40e2f9d8", "score": "0.67048347", "text": "get name() { return this.name_; }", "title": "" }, { "docid": "235002ec40c106f74cb56b1393d526ef", "score": "0.6684032", "text": "name() {\n return this._command.name;\n }", "title": "" }, { "docid": "2336485090ccf1a9d49077938df169a5", "score": "0.6673145", "text": "get Name() {\n return this._name;\n }", "title": "" }, { "docid": "9e9b609e96c4a24d0c656d466e5fdc94", "score": "0.66686946", "text": "function getName(o) {\n return _.findKey(this, v => v === o)\n}", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "809d2a2eaac0a54f33219f7d2c996093", "score": "0.6654299", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "cde1eade1c327a11d998369898ee922a", "score": "0.66498756", "text": "toString() {\n return this.name || \"\";\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.66462356", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.66462356", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.66462356", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.66462356", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "3cf65e98e2021471f50dbb3c7c750ad9", "score": "0.6639419", "text": "toString() {\n return this.name\n }", "title": "" }, { "docid": "12d225b650c978673d54be37ea91568d", "score": "0.6626308", "text": "toString() {\n return this.name;\n }", "title": "" }, { "docid": "12d225b650c978673d54be37ea91568d", "score": "0.6626308", "text": "toString() {\n return this.name;\n }", "title": "" }, { "docid": "12d225b650c978673d54be37ea91568d", "score": "0.6626308", "text": "toString() {\n return this.name;\n }", "title": "" }, { "docid": "bba7f62e42c4a3aa757456d18d1d0689", "score": "0.6612709", "text": "Name() {\n return this.getProperty(\"Name\");\n }", "title": "" }, { "docid": "ab9361359bf6c1c205c4c2f961c7f587", "score": "0.66117924", "text": "static get NAME() {\n return NAME;\n }", "title": "" }, { "docid": "9fe2899131c280336c71759c3e963e1f", "score": "0.65748656", "text": "toString() {\n return this.getName();\n }", "title": "" } ]
1578d99a0bc71a3a7a65b5bfa0dd092d
Provide roundingaccurate toFixed method. Borrowed:
[ { "docid": "77b6169bcfdb9f09748d584bb4349690", "score": "0.6486519", "text": "function toFixed ( value, exp ) {\n value = value.toString().split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\n value = value.toString().split('e');\n return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n }", "title": "" } ]
[ { "docid": "17f57c32b589acff70df70729c536d36", "score": "0.76098883", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n \n //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value * power) / power).toFixed(precision);\n \n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n \n return output;\n }", "title": "" }, { "docid": "d95793bcaa24cbc2d66f8ff6ce691014", "score": "0.76020384", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t \n\t //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value * power) / power).toFixed(precision);\n\t\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\t\n\t return output;\n\t }", "title": "" }, { "docid": "d95793bcaa24cbc2d66f8ff6ce691014", "score": "0.76020384", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t \n\t //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value * power) / power).toFixed(precision);\n\t\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\t\n\t return output;\n\t }", "title": "" }, { "docid": "d3750ce20fac86233cd1c6ab42da0c1b", "score": "0.758122", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t \n\t //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value * power) / power).toFixed(precision);\n\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\n\t return output;\n\t }", "title": "" }, { "docid": "d3750ce20fac86233cd1c6ab42da0c1b", "score": "0.758122", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\t \n\t //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value * power) / power).toFixed(precision);\n\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\n\t return output;\n\t }", "title": "" }, { "docid": "ef6ca74401be460c9c71246a68a1f680", "score": "0.7417724", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n \n //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value * power) / power).toFixed(precision);\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "ef6ca74401be460c9c71246a68a1f680", "score": "0.7417724", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n \n //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value * power) / power).toFixed(precision);\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "ef6ca74401be460c9c71246a68a1f680", "score": "0.7417724", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n \n //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value * power) / power).toFixed(precision);\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "ef6ca74401be460c9c71246a68a1f680", "score": "0.7417724", "text": "function toFixed (value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n \n //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value * power) / power).toFixed(precision);\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "93eb10ee3ead985cb14005f0cda63c6a", "score": "0.73309475", "text": "function toFixed (value, maxDecimals, roundingFunction, optionals) {\n\t var splitValue = value.toString().split('.'),\n\t minDecimals = maxDecimals - (optionals || 0),\n\t boundedPrecision,\n\t optionalsRegExp,\n\t power,\n\t output;\n\t\n\t // Use the smallest precision value possible to avoid errors from floating point representation\n\t if (splitValue.length === 2) {\n\t boundedPrecision = Math.min(Math.max(splitValue[1].length, minDecimals), maxDecimals);\n\t } else {\n\t boundedPrecision = minDecimals;\n\t }\n\t\n\t power = Math.pow(10, boundedPrecision);\n\t\n\t //roundingFunction = (roundingFunction !== undefined ? roundingFunction : Math.round);\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value * power) / power).toFixed(boundedPrecision);\n\t\n\t if (optionals > maxDecimals - boundedPrecision) {\n\t optionalsRegExp = new RegExp('\\\\.?0{1,' + (optionals - (maxDecimals - boundedPrecision)) + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\t\n\t return output;\n\t }", "title": "" }, { "docid": "9b62a98a8137323f2ced5b31a96f4a95", "score": "0.7106615", "text": "function toFixed(value, precision, roundingFunction, optionals) {\n\t var power = Math.pow(10, precision),\n\t optionalsRegExp,\n\t output;\n\n\t if (value.toString().indexOf('e') > -1) {\n\t // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n\t output = toFixedLargeSmall(value, precision);\n\t // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n\t if (output.charAt(0) === '-' && +output >= 0) {\n\t output = output.substr(1); // chop off the '-'\n\t }\n\t }\n\t else {\n\t // Multiply up by precision, round accurately, then divide and use native toFixed():\n\t output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n\t }\n\n\t if (optionals) {\n\t optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n\t output = output.replace(optionalsRegExp, '');\n\t }\n\n\t return output;\n\t }", "title": "" }, { "docid": "939a2154709bbe7b6b9a9aa353efeccd", "score": "0.6997876", "text": "function toFixed(value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n if (value.toString().indexOf('e') > -1) {\n // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n output = toFixedLargeSmall(value, precision);\n // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n if (output.charAt(0) === '-' && +output >= 0) {\n output = output.substr(1); // chop off the '-'\n }\n }\n else {\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n }\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "939a2154709bbe7b6b9a9aa353efeccd", "score": "0.6997876", "text": "function toFixed(value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n if (value.toString().indexOf('e') > -1) {\n // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n output = toFixedLargeSmall(value, precision);\n // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n if (output.charAt(0) === '-' && +output >= 0) {\n output = output.substr(1); // chop off the '-'\n }\n }\n else {\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n }\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "939a2154709bbe7b6b9a9aa353efeccd", "score": "0.6997876", "text": "function toFixed(value, precision, roundingFunction, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n if (value.toString().indexOf('e') > -1) {\n // toFixed returns scientific notation for numbers above 1e21 and below 1e-7\n output = toFixedLargeSmall(value, precision);\n // remove the leading negative sign if it exists and should not be present (e.g. -0.00)\n if (output.charAt(0) === '-' && +output >= 0) {\n output = output.substr(1); // chop off the '-'\n }\n }\n else {\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (roundingFunction(value + 'e+' + precision) / power).toFixed(precision);\n }\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "3c22732ccb8b391bed38a5ff595836ae", "score": "0.69958144", "text": "function toFixed(input) {\n return input.toFixed(6)\n}", "title": "" }, { "docid": "d520b6f207fc94c996246a7128bb0f60", "score": "0.6970269", "text": "roundFloat (float, digits) {\n return parseFloat(float.toFixed(digits))\n }", "title": "" }, { "docid": "cd8507a2a2645c9358789c179453e22b", "score": "0.6947065", "text": "function roundFloat(value){\n\t\n\treturn parseFloat(value).toFixed(2);\n}", "title": "" }, { "docid": "5db89002673e18fc205b1e8ea0f9b5bd", "score": "0.69286233", "text": "function toFixed (value, precision, optionals) {\n var power = Math.pow(10, precision),\n output;\n\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (Math.round(value * power) / power).toFixed(precision);\n\n if (optionals) {\n var optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "2f5773aebd20556b26737aa5c8124558", "score": "0.69215685", "text": "function toFixed(value, precision) {\n var power = Math.pow(10, precision || 0);\n return String(Math.round(value * power) / power);\n}", "title": "" }, { "docid": "144add6d1d9b3c81a031d883c955197c", "score": "0.6917552", "text": "function fixed_Method(){\n var y=5.64842574565847654;\n document.getElementById(\"fixed\").innerHTML=y.toFixed(3);\n}", "title": "" }, { "docid": "1b8b34342b6abb07ce26c1ff1a38cc0a", "score": "0.6906003", "text": "function toFixed (value, precision, optionals) {\n var power = Math.pow(10, precision),\n optionalsRegExp,\n output;\n\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n output = (Math.round(value * power) / power).toFixed(precision);\n\n if (optionals) {\n optionalsRegExp = new RegExp('0{1,' + optionals + '}$');\n output = output.replace(optionalsRegExp, '');\n }\n\n return output;\n }", "title": "" }, { "docid": "fe3734986b51d1d6f1f45a65909ba99b", "score": "0.68380916", "text": "function toFixed(num, fixed) {\n var re = new RegExp('^-?\\\\d+(?:\\.\\\\d{0,' + (fixed || -1) + '})?');\n\n return parseFloat(num.toString().match(re)[0]).toFixed(fixed);\n}", "title": "" }, { "docid": "00575efb03d8b9bc3a29211bf258e1e7", "score": "0.68304753", "text": "function toFixed (number, precision) {\n var multiplier = Math.pow( 10, precision + 1 ),\n wholeNumber = Math.floor( number * multiplier );\n return Math.round( wholeNumber / 10 ) * 10 / multiplier;\n}", "title": "" }, { "docid": "44a5f429ad1c58f235c0e8374082b276", "score": "0.68173754", "text": "function toFixed() {\n var num = 5.56789;\n var n = num.toFixed(2);\n document.getElementById(\"practice\").innerHTML = n;//should be 5.57\n}", "title": "" }, { "docid": "8503207846700ca33f3d98a7e662f30d", "score": "0.68111885", "text": "function toFixed ( value, exp ) {\nvalue = value.toString().split('e');\nvalue = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\nvalue = value.toString().split('e');\nreturn (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n}", "title": "" }, { "docid": "2cbe4eaf4f60e5315a6acc528638d94d", "score": "0.6770236", "text": "function roundFloat(value, precision) {\n if (!value || value == 'undefined') value = 0;\n return parseFloat(value).toFixed(precision);\n}", "title": "" }, { "docid": "39d497a058af48a2986ea8e0bfd46f8a", "score": "0.6763338", "text": "function toFixed( num ) {\n return +num.toFixed(5);\n }", "title": "" }, { "docid": "39d497a058af48a2986ea8e0bfd46f8a", "score": "0.6763338", "text": "function toFixed( num ) {\n return +num.toFixed(5);\n }", "title": "" }, { "docid": "b94b48afc5e571f469a4b72632e6942b", "score": "0.67443866", "text": "function toFixed (n, f) {\n var m = Math.pow(10, f)\n return ((n * m) | 0) / m\n}", "title": "" }, { "docid": "4bf7815966330865d04a4c0d181c8c0e", "score": "0.6695878", "text": "function toFixed ( value, decimals ) {\n\t\tvar scale = Math.pow(10, decimals);\n\t\treturn ( Math.round(value * scale) / scale).toFixed( decimals );\n\t}", "title": "" }, { "docid": "4bf7815966330865d04a4c0d181c8c0e", "score": "0.6695878", "text": "function toFixed ( value, decimals ) {\n\t\tvar scale = Math.pow(10, decimals);\n\t\treturn ( Math.round(value * scale) / scale).toFixed( decimals );\n\t}", "title": "" }, { "docid": "4bf7815966330865d04a4c0d181c8c0e", "score": "0.6695878", "text": "function toFixed ( value, decimals ) {\n\t\tvar scale = Math.pow(10, decimals);\n\t\treturn ( Math.round(value * scale) / scale).toFixed( decimals );\n\t}", "title": "" }, { "docid": "60a132489d09602c5155aed5ae7b18de", "score": "0.66187066", "text": "function roundDecimal(f) {\n return Math.round(f * 100) / 100\n }", "title": "" }, { "docid": "ec7a9b7ab706c7d67692ca85070c2e87", "score": "0.66133523", "text": "function newtoFixed(x,y) {\r\n\t\tif ( x || x==0 ) { return Number(x).toFixed(y) }\r\n\t\telse { return x };\r\n\t}", "title": "" }, { "docid": "268897ec5eeb9f1a32891e84d1f93bdf", "score": "0.6604192", "text": "function f_number_round_with_precision(pn_val, pi_prec) {\n let li_factor = Math.pow(10, pi_prec);\n return(Math.round(pn_val * li_factor) / li_factor);\n }", "title": "" }, { "docid": "03937f51c7b3e2adb42a7403431ce663", "score": "0.6581301", "text": "function toFixed(value, exp) {\r\n value = value.toString().split(\"e\");\r\n value = Math.round(+(value[0] + \"e\" + (value[1] ? +value[1] + exp : exp)));\r\n value = value.toString().split(\"e\");\r\n return (+(value[0] + \"e\" + (value[1] ? +value[1] - exp : -exp))).toFixed(exp);\r\n }", "title": "" }, { "docid": "41b80189e7a988732b85826a0e9c6951", "score": "0.65346366", "text": "function round(value) {\n return parseFloat(value.toFixed(2));\n }", "title": "" }, { "docid": "323582f8a121ae78d4b21897d4924bd5", "score": "0.6500016", "text": "function RoundedTo(roundedValue, number) {\n return number.toFixed(roundedValue);\n}", "title": "" }, { "docid": "41e599476f40dd44a28477e4c2d33c3d", "score": "0.6445657", "text": "function toFixed(num, fixed) {\n var re = new RegExp('^-?\\\\d+(?:.\\\\d{0,' + (fixed || -1) + '})?')\n return num.toString().match(re)[0]\n }", "title": "" }, { "docid": "fd1d757a2d4a46d259d78cfbebb52f53", "score": "0.64290255", "text": "function roundedResult(anyNumber) {\n return parseFloat(anyNumber.toFixed(2))\n}", "title": "" }, { "docid": "fe89f565f6252cc8efd263dc8aceca4f", "score": "0.6427899", "text": "function toFixed(value, exp) {\n\t\tvalue = value.toString().split('e');\n\t\tvalue = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + exp : exp)));\n\t\tvalue = value.toString().split('e');\n\t\treturn (+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp))).toFixed(exp);\n\t}", "title": "" }, { "docid": "fe89f565f6252cc8efd263dc8aceca4f", "score": "0.6427899", "text": "function toFixed(value, exp) {\n\t\tvalue = value.toString().split('e');\n\t\tvalue = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + exp : exp)));\n\t\tvalue = value.toString().split('e');\n\t\treturn (+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp))).toFixed(exp);\n\t}", "title": "" }, { "docid": "00b37e512dadf747db5511d86ecfe7cf", "score": "0.6419935", "text": "toFixed() {\n return this.toString();\n }", "title": "" }, { "docid": "285a34aa76e5457b65805c30fe6ac01c", "score": "0.6410601", "text": "function toFixedx(value, precision) {\n var power = Math.pow(10, precision || 0);\n return (Math.round(value * power) / power).toFixed(precision);\n}", "title": "" }, { "docid": "7c426ac52021ce7c776bae648f98d575", "score": "0.6402422", "text": "function toFixed ( value, exp ) {\n value = value.toString().split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\n value = value.toString().split('e');\n return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n }", "title": "" }, { "docid": "d6de37fda8440cd34225f7773c7cea1e", "score": "0.6359875", "text": "function toFixed ( value, exp ) {\n\t\tvalue = value.toString().split('e');\n\t\tvalue = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\n\t\tvalue = value.toString().split('e');\n\t\treturn (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n\t}", "title": "" }, { "docid": "da67cc5c20777427f663744633e3d99d", "score": "0.63529557", "text": "function toFixed(value, exp) {\n value = value.toString().split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\n value = value.toString().split('e');\n return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n }", "title": "" }, { "docid": "da67cc5c20777427f663744633e3d99d", "score": "0.63529557", "text": "function toFixed(value, exp) {\n value = value.toString().split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));\n value = value.toString().split('e');\n return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);\n }", "title": "" }, { "docid": "a4c60835d13e57b9567e4d0b5bc69be1", "score": "0.63310844", "text": "function convertToFloat(Savings){\n savings = 30000;\n return convertToFloat = savings;\n}", "title": "" }, { "docid": "106c4fe349bd23017ce48999d3df28d1", "score": "0.63201433", "text": "function precise(x) {\n let output = (Number.parseFloat(x).toFixed(7));\n output = Number.parseFloat(output).toPrecision(7).replace(/0+$/, \"\");\n console.log(output);\n if (output[output.length - 1] == '.') {\n output = output.slice(0, output.length - 1);\n }\n if (output.length > 8) {\n output = Number.parseFloat(output).toPrecision(5);\n } \n return output;\n }", "title": "" }, { "docid": "6cc7b8220fab282726360c87c199ed5b", "score": "0.6311837", "text": "function round(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.round(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.round(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "title": "" }, { "docid": "8b2dd0ba5b1435f2e60b59bf252a7398", "score": "0.62713605", "text": "function fRound(dValue) {\r\n return Math.round(dValue * Math.pow(10, 2)) / Math.pow(10, 2);\r\n}", "title": "" }, { "docid": "eb9557d396f3ed46c9b91645c76d82d5", "score": "0.6266886", "text": "function toFixed(num) {\n var decimals = Math.floor(map.getZoom() / 3);\n var multiplier = Math.pow(10, decimals);\n\n return Math.round(num * multiplier) / multiplier;\n }", "title": "" }, { "docid": "39bc9888362a26e0560e79fe6c0a3307", "score": "0.62657195", "text": "function roundNumber(num) {\n\treturn parseFloat(num.toFixed(floatingPointprecision));\n}", "title": "" }, { "docid": "358497e45ed8f09e2e7ba4384acf2c85", "score": "0.62388647", "text": "function fix(n, dec) {\r\n\treturn Number(n.toFixed(dec));\r\n}", "title": "" }, { "docid": "56742ea420ab08bd2407a7ec09f09a00", "score": "0.62309706", "text": "function round_to(x, precision) \n{\n var y = +x + (precision === undefined ? 0.5 : precision/2);\n return y - (y % (precision === undefined ? 1 : +precision));\n}", "title": "" }, { "docid": "c4e5022de59f72cdb7c82583ca66fba7", "score": "0.62190473", "text": "function roundDecimals(a){ \n\t\treturn Math.round(100*a) / 100; \n\t}", "title": "" }, { "docid": "ae4e22f0c841bec7acb5eb08640cd3ce", "score": "0.61956507", "text": "function convertToFloat (savingsGoal){\n return parseFloat(savingsGoal);\n}", "title": "" }, { "docid": "783b9ddbfca463b9b75342dc3e6dbe9c", "score": "0.61932766", "text": "function roundTo(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c;}", "title": "" }, { "docid": "6537f4d28d9e4865b1c850a8e9a26cae", "score": "0.6182247", "text": "function useToFixed() {\n var num = parseFloat(document.getElementById(\"toFixedTextBox\").value);\n\n document.getElementById(\"toFixedButton\").innerHTML = num.toFixed(2);\n}", "title": "" }, { "docid": "799fcdbfad5e44bd00328ff2e7b5a956", "score": "0.61772865", "text": "function roundTo(n, places) {\n n = Number(n)\n n = n.toFixed(places)\n return Number(n)\n}", "title": "" }, { "docid": "ad3726ba2a81b5898642cb8d0c643f66", "score": "0.6164894", "text": "function roundFix(number) {\n //Check to see if the number contains a decimal point. If not, we just return it (as it doesn't need fixing)\n if (number % 1 === 0) {\n console.log(\"No decimals here\");\n return number;\n }\n\n //Round the number to a (large) fixed number of decimal places\n number = number.toFixed(12);\n\n //Convert the number to a String\n var numString = String(number);\n\n //Parse the string from right to left, removing zeros until we hit a non-zero or the decimal point\n for (var i = numString.length; i > 0; i = i - 1) {\n if (numString.charAt(i - 1) === \"0\") {\n numString = numString.substring(0, i - 1);\n console.log(\"Found a zero. Removing...\");\n continue;\n }\n else if (numString.charAt(i - 1) === \".\") {\n numString = numString.substring(0, i - 1);\n console.log(\"Found a decimal point. Removing...\");\n break;\n }\n else {\n console.log(\"Non-zero, non-decimal point found. Returning...\");\n break;\n }\n }\n\n return Number(numString);\n }", "title": "" }, { "docid": "98c3680670a255b202f51363fe39f69a", "score": "0.6119168", "text": "function roundNumber(v) {\n\treturn parseFloat(parseFloat(v).toFixed(2));\n}", "title": "" }, { "docid": "113c5968f82fcbc55db58d7374c1a2f5", "score": "0.61163723", "text": "function round(x, digits) {\n return parseFloat(x.toFixed(digits))\n}", "title": "" }, { "docid": "3cb4bb1be87d6c4fe68ee40fca310cfe", "score": "0.6109592", "text": "function toNiceFixed(value, fractionDigits) {\n if (fractionDigits === void 0) { fractionDigits = 0; }\n var valueString = value.toFixed(fractionDigits), index;\n if (fractionDigits > 0) {\n for (index = valueString.length - 1; index > 0 && valueString[index] === \"0\"; index--)\n ;\n return valueString.substr(0, valueString[index] === \".\" ? index : index + 1);\n }\n return valueString;\n }", "title": "" }, { "docid": "e87f1422a0b6a6556ca0707d540e26f0", "score": "0.6107352", "text": "function preserveDecimal (n) {\r\n return parseFloat (n)\r\n}", "title": "" }, { "docid": "c734f6c7114c7481998d9c4cd4438584", "score": "0.61027735", "text": "function precise(x) {\n return Number.parseFloat(x).toPrecision(6);\n}", "title": "" }, { "docid": "7ac1c9fa5ab15921c85fb1112580b725", "score": "0.60915744", "text": "function toRound(num){\n var n = num.toFixed(4);\n return parseFloat(n);\n}", "title": "" }, { "docid": "b3558635d1d1a7f4f835193d4990272f", "score": "0.60777205", "text": "function bfgRound(val, dp)\n{\n if (dp<=0) {\n return Math.round(val);\n } else {\n var z = \"\"+val;\n var ix = z.indexOf(\".\");\n return z.substring(0, Math.min(ix+dp+1, z.length));\n }\n}", "title": "" }, { "docid": "65750824430d40a1999319f31afb3930", "score": "0.6061641", "text": "function roundup(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.ceil(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.ceil(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "title": "" }, { "docid": "f4b56e6aea2b958ab571abd69c78e134", "score": "0.6055172", "text": "function rounddown(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.floor(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.floor(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "title": "" }, { "docid": "2ccbdc7540d409003da54c75efe92326", "score": "0.60319483", "text": "toJSFixedPoint() {\n return shiftedIntegerToJSFixed(\n this.toJSInteger(),\n fix_decimal_bitlength,\n fix_whole_bitlength\n )\n }", "title": "" }, { "docid": "5de97bb85864cfaae3883bb11857cbad", "score": "0.60226846", "text": "function roundTotalPrice(totalNumber,precision){ \n return Math.ceil(totalNumber * precision) / precision;\n }", "title": "" }, { "docid": "d7e3bd7f10235838d06726545f3cc8a3", "score": "0.6009821", "text": "function preserveDecimal(n){\r\n return parseFloat(n);\r\n}", "title": "" }, { "docid": "efc6329757a37cee1488728dac305dee", "score": "0.6004617", "text": "function kToF(t) {\n // Do some math and round to two decimal places.\n return (t * 9/5 - 459.67).toFixed(2);\n}", "title": "" }, { "docid": "58f8119619852731d4e857f38b5b5bfd", "score": "0.6001014", "text": "function toFixed(value, fractionOrSignificantDigits) {\n if (fractionOrSignificantDigits === void 0) {\n fractionOrSignificantDigits = 2;\n }\n\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\n }\n\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\n}", "title": "" }, { "docid": "69ec0b9ea2e36c26649fd3cf7e1224a3", "score": "0.59957397", "text": "function opaqueAllTypesFround(argument) {\n return Math.fround(argument);\n}", "title": "" }, { "docid": "dfb886a09c5d9098606f794805bd472e", "score": "0.5991027", "text": "function roundsf(num, nsf)\n{\n if (Math.abs(num) < 1E-14) return 0;\n var shsz = nsf - 1 - Math.floor(log10(Math.abs(num)));\n return Math.pow(0.1, shsz) * Math.round(num * Math.pow(10, shsz));\n}", "title": "" }, { "docid": "c8b240cf6ce7554ddef4abd8e4a6cd3f", "score": "0.59747684", "text": "function opaqueFroundForDCE(argument) {\n Math.fround(argument);\n}", "title": "" }, { "docid": "e6b9217b723859fe4008a33a2bbfba5d", "score": "0.5974697", "text": "round(value: number, decimals: number) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n }", "title": "" }, { "docid": "b54d8f0f330907cf300d612a0606cca8", "score": "0.5969255", "text": "function roundedValue(price){\n\tprice = parseFloat(price);\n\treturn price + roundingValue(price);\n}", "title": "" }, { "docid": "2e8ee1ca84a31978f29824708dee6f53", "score": "0.5959236", "text": "function roundTwoDecimals(amount) {\n\treturn Math.round(amount*100)/100;\n}", "title": "" }, { "docid": "9c51eadfe025e3535520816b74a1822b", "score": "0.5950785", "text": "function preserveDecimal (n) {\n return parseFloat(n);\n}", "title": "" }, { "docid": "bcaaa5e1200df2f902ac842cb331af86", "score": "0.5946225", "text": "function round(val) {\n\t return Math[idx === 0 ? 'floor' : 'ceil'](val * 1e12) / 1e12;\n\t }", "title": "" }, { "docid": "eb33f674e1e1297ad394544623998448", "score": "0.5940816", "text": "function round(x) {\n return Math.round(x*100)/100;\n}", "title": "" }, { "docid": "07719b1fe7a6c6e352daf485c7f9962c", "score": "0.5937966", "text": "function roundTotalPrice(totalNumber,precision){ \n return Math.ceil(totalNumber * precision) / precision;\n }", "title": "" }, { "docid": "bded4b96855d13f0cf91368fbceee096", "score": "0.5931862", "text": "function round(n) { return Math.round(n * 100) / 100 }", "title": "" }, { "docid": "b90b553c462b160974b1f0dabdff43be", "score": "0.592778", "text": "function preserveDecimal(n) {\n return parseFloat(n);\n}", "title": "" }, { "docid": "a8ff544dda5ebf5f4f264914031e7688", "score": "0.5925674", "text": "function round(x) {\n return Math.round(x*100)/100;\n }", "title": "" }, { "docid": "fbf65cc7c8ff55334eda99a5d11214af", "score": "0.59169316", "text": "function formatNumber(value, fixedPosition) {\n\n return value.toFixed(fixedPosition);\n\n}", "title": "" }, { "docid": "df4cf1f150570e491a2ac90365e51b51", "score": "0.590966", "text": "function roundToDecimalPoint(num, decimal) {\n return parseFloat(num.toFixed(decimal));\n }", "title": "" }, { "docid": "0d5cef5cbebb29757c1d7ada6847fe53", "score": "0.59089524", "text": "roundToDecimalPlace(num, decimalPlaces, forceDecimal=false)\n {\n // Error handling: No number -> null\n if (!this.checkIfNumber(num)) return null;\n\n if (forceDecimal)\n return num.toFixed(decimalPlaces); // returns a tring, not a float!\n else\n return parseFloat(num.toFixed(decimalPlaces))\n // let roundingFactor = Math.pow(10, decimalPlaces)\n // return (Math.round(num*roundingFactor) / roundingFactor)\n }", "title": "" }, { "docid": "3f65731b2f6125cb8d604098f32b4502", "score": "0.5904333", "text": "function roundnum(x,p) {\n \tvar n=parseFloat(x);\n\t//var m=n.toPrecision(p+1);\n\tvar m=n.toFixed(p);\n\tvar y=String(m);\n\t//*\n\tvar i=y.length;\n\tvar j=y.indexOf('.');\n\tif(i>j && j!=-1) {\n\t\twhile(i>0) {\n\t\t\tif(y.charAt(--i)=='0')\n\t\t\t\ty = removeAt(y,i);\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\tif(y.charAt(i)=='.')\n\t\t\ty = removeAt(y,i);\n\t}//*/\n\treturn y;\n}", "title": "" }, { "docid": "07265528189201da3c2356143fa857b2", "score": "0.5895915", "text": "function round(value) {\n var d = Math.pow(10, decimals);\n return Math.round(value * d) / d;\n }", "title": "" }, { "docid": "a6ca6b29333bb0ce282e37ddfdd7db96", "score": "0.58949876", "text": "$round() {\n return this.clone().round();\n }", "title": "" }, { "docid": "c6e17e651d2cc10fd456552c6fccb9ab", "score": "0.58949405", "text": "function precise(number, precision) {\n return +(number * +(\"1e\" + precision)).toFixed(precision);\n}", "title": "" }, { "docid": "c5d3e223a4f0df7a843c45524ad2f8dd", "score": "0.5893602", "text": "function roundNumber(num) {\n return (num * 100).toFixed(3);\n }", "title": "" }, { "docid": "c9598755bef54260a16f68f3cfab7ba6", "score": "0.5887114", "text": "function floatVal(num) {\n return parseFloat(Math.round(num * 100) / 100).toFixed(2)\n}", "title": "" }, { "docid": "dc324acda703e2f8f053fe2335124873", "score": "0.58823705", "text": "function round(value, precision) {\n precision = precision || 0;\n\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n\n return value.toFixed(precision);\n}", "title": "" }, { "docid": "dc324acda703e2f8f053fe2335124873", "score": "0.58823705", "text": "function round(value, precision) {\n precision = precision || 0;\n\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n\n return value.toFixed(precision);\n}", "title": "" } ]
ed9b8f6d4f29bec263adb54d52a8286b
For HTML5 Geolocation API see: Start tracking position
[ { "docid": "f54b03e111ec9257da4a2e3a0c680d94", "score": "0.7206435", "text": "function startTracking(){\r\n\tif(navigator.geolocation){\r\n\t\tdocument.getElementById('startBtn').style.display = 'none';\r\n\t\tdocument.getElementById('stopBtn').style.display = 'inline';\r\n\t\t//Get Position\r\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\r\n\t\t//Watch Position - Returns the current position of the user and continues to return updated position as the user moves\r\n\t\twatchId = navigator.geolocation.watchPosition(showPositionUpdate,showError);\r\n\t} else {\r\n\t\talert('Geolocation is not supported by your browser');\r\n\t}\r\n}", "title": "" } ]
[ { "docid": "2e185511ac6e20e0410295507fc4dd3e", "score": "0.73871624", "text": "startLocationTracking() {\n\t\tPushwooshGeozonesModule.startLocationTracking();\n\t}", "title": "" }, { "docid": "3cf158dd89d360d84729eec9e8554217", "score": "0.7314427", "text": "function startGeolocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(findPosition, handleError);\n } else {\n updateStatus(\"HTML5 Geolocation is not supported in your browser.\");\n }\n}", "title": "" }, { "docid": "4fa891f8621799f33e8361ee822b6253", "score": "0.73083526", "text": "function getLocation() { \n navigator.geolocation.watchPosition(showPosition); \n}", "title": "" }, { "docid": "1794f3834a7bab5164a06cc3178fc9ec", "score": "0.72951597", "text": "function trackLocation()\r\n{\r\n\tif(navigator.geolocation)\r\n\t{\r\n\t\tnavigator.geolocation.watchPosition(showPosition);\r\n\t\tnavigator.geolocation.getCurrentPosition(getPosition);\r\n\t\t//alert(\"Loading Current Location\");\r\n\t}\r\n\telse \r\n\t{\r\n\t\tdocument.getElementById('showLocation').innerHTML = \"Geolocation is not supported by this browser.\";\r\n\t}\r\n}", "title": "" }, { "docid": "d75fcf7474bd5c9809eabdad2434184c", "score": "0.7288841", "text": "function getCoords(){\n navigator.geolocation.getCurrentPosition(successGeo, errorGeo);\n}", "title": "" }, { "docid": "9cfef237c42bf521c07bc30e02f0c819", "score": "0.7239203", "text": "function find_location(){\n\tif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(update_position);\n }\n}", "title": "" }, { "docid": "6367152bb17f9a4da35172b861a0af67", "score": "0.7210922", "text": "function startGeolocation() {\n //TODO: appel de la fonction de géolocalisation de l'utilisateur\n}", "title": "" }, { "docid": "77921ce9bd82890eb9b1dbaaddf60063", "score": "0.71687496", "text": "function getLocation() {\n //Make sure the broswer supports the HTML 5 geolocation method.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPosition);\n } else { \n //We may also have to set a default UserLatitute and UserLongtitude here to \n //make sure we don't error out if the the browser does not support geolocation.\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "b8699f517b713643080cdb5ba625a1be", "score": "0.7155185", "text": "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(this.setPosition);\n }\n }", "title": "" }, { "docid": "72219d023dfca4c020e3333bfc509b9e", "score": "0.7146136", "text": "function trackLocation(){\r\n\tif(navigator.geolocation) {\r\n\tnavigator.geolocation.watchPosition(showPosition);\r\n\t}else{\r\n\t//document.getElementById('mapid').innerHTML=\"Geolocation is not supported by this browser.\";\r\n\talert(\"Geolocation is not supported by this browser.\");\r\n\t}\r\n}", "title": "" }, { "docid": "eeeffd64e055592d8ca517205cc866bf", "score": "0.7110789", "text": "function askForCoords() {\n navigator.geolocation.getCurrentPosition(handleGeoSuccess, handleGeoError);\n}", "title": "" }, { "docid": "dcc1e33793a701f91dcb630d09409f34", "score": "0.70770335", "text": "function locate() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\t//alert(\"lat: \" + position.coords.latitude + \", long: \" + position.coords.longitude);\n\t\t\tvar p = {\n\t\t\t\tlat : position.coords.latitude,\n\t\t\t\tlng : position.coords.longitude\n\t\t\t};\n\t\t\tvar infoWindow = new google.maps.InfoWindow({\n\t\t\t\tmap : map\n\t\t\t});\n\t\t\tinfoWindow.setPosition(p);\n\t\t\tinfoWindow.setContent('Location found.');\n\t\t\tmarker1.setPosition(p);\n\t\t\tvar pos1 = document.getElementById(\"pos1\");\n\t\t//\tpos1.value = (Math.round(p.lat * 1000000) / 1000000) + \", \"\n\t\t//\t+ (Math.round(p.lng * 1000000) / 1000000);\n\t\t\tpos1.value = (p.lat + \", \"\n\t\t\t+ p.lng);\n\t\t\tmarker1.setMap(map);\n\t\t\tcount = 1;\n\t\t}, function() {\n\t\t\thandleLocationError(false, infoWindow, map.getCenter());\n\t\t}, {maximumAge:600000, timeout:5000, enableHighAccuracy: true});\n\t}\n}", "title": "" }, { "docid": "e113c83e1b6a923c8246cca961d99682", "score": "0.70762396", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n // showPosition is a reference to a JS function (below)\r\n navigator.geolocation.getCurrentPosition(showPosition);\r\n }\r\n}", "title": "" }, { "docid": "e091980064020876c44874c2901e9d8a", "score": "0.70590097", "text": "function getLocation() {\r\n\r\n }", "title": "" }, { "docid": "ab59af69569db73b2b62646117f1f7e4", "score": "0.70580333", "text": "function getLocation() { \n if( geo ) { \n geo.getCurrentPosition( displayLocation ); \n } \n\telse { alert( \"Oops, Geolocation API is not supported\"); \n } \n}", "title": "" }, { "docid": "f032b7c3117cc653a8530ea511ff57ec", "score": "0.7050916", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n };\n }", "title": "" }, { "docid": "3725d809903a6e025d037f46fac1d6ec", "score": "0.7049486", "text": "function trackLocation() {\r\nif (navigator.geolocation) {\r\nnavigator.geolocation.watchPosition(showPosition);\r\n} else {\r\ndocument.getElementById('showLocation').innerHTML =\r\n \"Geolocation is not supported by this browser.\";\r\n}\r\n}", "title": "" }, { "docid": "fcbf91b5eb301f0f4183748cf624000d", "score": "0.7048358", "text": "function locateUser() {\n navigator.geolocation.getCurrentPosition(success, error, options);\n}", "title": "" }, { "docid": "a8025efcbedfbc8c52b1073dadc61e4e", "score": "0.7036495", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "title": "" }, { "docid": "16abdaf3ed515e84413c32f540c2999b", "score": "0.7028579", "text": "function geoLocation() \n{\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(function(position) \n {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n if (typeof autocomplete != \"undefined\")\n {\n autocomplete.setBounds(new google.maps.LatLngBounds(geolocation,\n geolocation));\n }\n });\n }\n}", "title": "" }, { "docid": "26e20d66403de46ef104792defb28a1e", "score": "0.70282173", "text": "testLocation () {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(this.setLocation);\n } \n }", "title": "" }, { "docid": "3126121b3e217d0e7ff816c88fa5156f", "score": "0.702729", "text": "function geoLocate(){\n if(navigator.geolocation){\n browserSupportFlag = true;\n navigator.geolocation.getCurrentPosition(function(position){\n initialLocation = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n map.setCenter(initialLocation);\n }, function(){\n handleNoGeolocation(browserSupportFlag);\n });\n }\n else{\n browserSupportFlag = false;\n handleNoGeolocation(browserSupportFlag);\n }\n}", "title": "" }, { "docid": "942f4173b95a25070690e4173f499fa1", "score": "0.70204276", "text": "function geolocate() {\n console.log(\"Marcar la posicion actual\")\n \n if (navigator.geolocation) {\n \n navigator.geolocation.getCurrentPosition(function (position) {\n \n var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n \n marker.setPosition(pos)\n map.setCenter(pos);\n });\n }\n }", "title": "" }, { "docid": "9e80462e3e9e501fd4611b05b133b8ba", "score": "0.70096993", "text": "function getLocation () {\n\t\n\t\n\t\n}", "title": "" }, { "docid": "881d184afe2c4b83e24ee72f54a3e653", "score": "0.7008636", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(onSuccess, onError);\n}", "title": "" }, { "docid": "3be80d6737327d4bbb716ec9ba5f1735", "score": "0.70031714", "text": "function geoFindLocation() {\n navigator.geolocation.getCurrentPosition(success, error);\n}", "title": "" }, { "docid": "cc58b78de4eb1cf7546066dbd4ad209d", "score": "0.69966155", "text": "function GetGeoLocationFromDevice() {\r\n var startPos;\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n startPos = position;\r\n lat = startPos.coords.latitude;\r\n lng = startPos.coords.longitude;\r\n GeoCodeReverse(lat, lng);\r\n }, function (error) {\r\n alert('Sorry, there was an error trying to retrieve your location.')\r\n\r\n });\r\n}", "title": "" }, { "docid": "88a8ba7c23941d5d672794e22327230e", "score": "0.69756377", "text": "function myGeoloc(){\n\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(myGeolocSuccess, myGeolocError,{enableHighAccuracy:true});\n\t} else {\n\t\terror('Geolocation not supported');\n\t}\n\n}", "title": "" }, { "docid": "5f79f11209f38e7337acc5053bf5d197", "score": "0.6968242", "text": "function getLocation(success, error) {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, error);\n } else {\n alert(\"Location tracking not supported on device.\");\n }\n }", "title": "" }, { "docid": "a58aafcbc422e5c81eafe969d708a178", "score": "0.69674", "text": "function getLocation() {\n\tnavigator.geolocation.getCurrentPosition(function(pos) {\n\t\tgeocoder = new google.maps.Geocoder();\n\t\tvar latlng = new google.maps.LatLng(pos.coords.latitude,pos.coords.longitude);\n\t\tgeocoder.geocode({'latLng': latlng}, function(results, status) {\n\t\t\tif (status == google.maps.GeocoderStatus.OK) {\n \tdocument.getElementById(\"startingLocation\").value = results[0].formatted_address;\n \t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "7e491ce270efe82513ef3bd41cf69c7c", "score": "0.69558233", "text": "function gglocation(){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position){\n map.setView(position.coords, map.getZoom());\n mymarker.setLatLng(position.coords);\n lat = position.coords.latitude;\n lng = position.coords.longitude;\n });\n current = [lat, lng]\n } \n else {\n alert(\"Geolocation is not supported by this browser.\");\n current = [25.020418, 121.537630]\n }\n map.setView(current,16)\n}", "title": "" }, { "docid": "472bff770d77bdd9c0e25cf15455b51f", "score": "0.6952985", "text": "function geolocate() {\n if (navigator.geolocation) {\n //alert(333);\n\n navigator.geolocation.getCurrentPosition(function(position) {\n //alert(444);\n\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n console.log(\"geolocation\");\n //autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));\n });\n }\n }", "title": "" }, { "docid": "c75fdb36209a7720e72748f382267c79", "score": "0.6947678", "text": "function getLocation()\n{\n\n\tvar options={\n\t\tenableHighAcuuracy : true,\n\t\ttimeout : 50000 ,\n\t\tmaximumAge : 0\n\t};\n\n\n\tnavigator.geolocation.getCurrentPosition(\n displayLocation, handleError, options);\n\n}", "title": "" }, { "docid": "0bcb2ebd96e40e46feab153cb75a1af7", "score": "0.6947259", "text": "function getLocation(){if(navigator.geolocation)\n// If browser supports geolocation, get the location\n// and run the userPosition function.\nnavigator.geolocation.getCurrentPosition(userPosition);else{errorMessage(\"Den här webbläsaren stödjer inte geolocation!\")}}", "title": "" }, { "docid": "13825271ec4399520e0bc669196cf79e", "score": "0.6943349", "text": "function start() {\n\n navigator.geolocation.getCurrentPosition(success, error, {maximumAge: 1000});\n\n geoWatchId = $interval(function () {\n\n // TODO: need to check if already tracking, otherwise too many promises. But then we got some probs\n //if(!isTracking) {\n //isTracking = true;\n\n navigator.geolocation.getCurrentPosition(success, error, {maximumAge: 1000});\n\n //}\n\n // Check if there's an updated position\n // TODO: Te only way for now (with Cordova) to check if GPS is working\n if(localStorageService.get('position') != null) {\n var tempPosition = localStorageService.get('position');\n var date = new Date();\n var actualTimestamp = date.getTime();\n if ((actualTimestamp - tempPosition.timestamp) < positionMaxAge) {\n position = tempPosition;\n positionAvailable = true;\n } else {\n positionAvailable = false;\n }\n } else {\n positionAvailable = false;\n }\n\n }, geoWatchTime);\n }", "title": "" }, { "docid": "22023c3b839f99516aceee4577610592", "score": "0.6940847", "text": "function getPosition(){\n navWatch = navigator.geolocation.getCurrentPosition(success, error, geo_options);\n }", "title": "" }, { "docid": "123d9355d1791f53572b2a89a4ad1a87", "score": "0.69321465", "text": "function get_position() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function success(current_location) {\n let crd = current_location.coords;\n start_waypoint = L.Routing.waypoint(L.latLng(crd.latitude, crd.longitude), \"start\");\n create_map_points();\n },\n function error(err) {\n alert(\"load as HTTPS NOT HTTP\");\n console.warn(`ERROR(${err.code}): ${err.message}`);\n });\n }\n}", "title": "" }, { "docid": "8f29a4779608e6462374ea144ec6beb2", "score": "0.6930497", "text": "function myGeoLocation() {\n navigator.geolocation.getCurrentPosition(success, fail);\n function success(position) {\n longitude = position.coords.longitude;\n latitude = position.coords.latitude;\n console.log(position);\n getLocation();\n\n }\n function fail(err) {\n console.log(err.code + err.message);\n }\n }", "title": "" }, { "docid": "aa20bb451288bcddb65b33f2fddb7ba2", "score": "0.69267154", "text": "function getLocation()\n{\n if (navigator.geolocation)\n {\n\tnavigator.geolocation.getCurrentPosition(showPosition);\n }\n else{info.innerHTML=\"Geolocation is not supported by this browser.\";}\n}", "title": "" }, { "docid": "4a42aa2d44cb8943d8f21dd006955976", "score": "0.6925952", "text": "function getlocation(){\nnavigator.geolocation.getCurrentPosition(onSuccess, onError);\n}", "title": "" }, { "docid": "2a7f515f47135c443ae5b90da81c7936", "score": "0.6901252", "text": "function getLocation()\n{\n\tif (navigator.geolocation)\n\t{\n\t\tnavigator.geolocation.getCurrentPosition(getPosition,showError);\n\t}\n\telse{\n\t\talert(\"Geolocation impossible.\");\n\t}\n}", "title": "" }, { "docid": "611b6901a7911c8033ffc321dc6af8bc", "score": "0.68997085", "text": "function setGeolocatedPosition() {\n\tif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(displayAndWatch, locError, {\n\t\t\tenableHighAccuracy: false,\n\t\t\ttimeout: 60000,\n\t\t\tmaximumAge: 60000\n\t\t});\n } else {\n\t\twindow.alert(\"Il tuo browser non supporta la geolocalizzazione\");\n\t}\n}", "title": "" }, { "docid": "5f791017ace03bf20ce5a5befd922e1b", "score": "0.68993235", "text": "function setStartLocation() {\n\tvar info = '<div id=\"startLoc\">You are here!</div>';\n\n\tif( navigator.geolocation ) {\t\t\n\t\tvar geoOptions = {\n\t\t\ttimeout: 2 * 1000,\t\t\t// Timeout after 2 secs\n\t\t\tenableHighAccuracy: false,\t// How accurate results do we need? Approx. is okay.\n\t\t\tmaximumAge: 15 * 60 * 1000,\t// Re-use a previously geolocated location from within the last 15 minutes\n\t\t}\n\n\t\tvar geoSuccess = function(position) {\n\t\t\tstartLocation = {\n\t\t\t\tlat: position.coords.latitude,\n\t\t\t\tlng: position.coords.longitude,\n\t\t\t};\t\t\t\n\t\t\taddMarker(startLocation, info, goldStar, true);\n\t\t};\n\n\t\tvar geoError = function(error) {\n\t\t\tconsole.error('Error occured obtaining geolocation. Will use defaultLocation.');\n\t\t\taddMarker(startLocation, info, null, true);\n\t\t};\n\n\t\tnavigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions);\n\t};\n}", "title": "" }, { "docid": "9d3072469292978288d79f1aceb3ef58", "score": "0.6896433", "text": "function watchMapPosition() {\n console.log(\"Ecoute des coordonnées de géolocalisation\");\n\n return navigator.geolocation.watchPosition\n (onMapWatchSuccess, onMapError, { enableHighAccuracy: true });\n}", "title": "" }, { "docid": "2cc186930f202a4eac6bdf02b1618996", "score": "0.6887351", "text": "function getLocation(){\r\n if (navigator.geolocation) {\r\n navigator.geolocation.watchPosition(showPosition);\r\n } else { \r\n displayLocation.innerHTML = `Geolocation is not supported by this browser`;\r\n }\r\n}", "title": "" }, { "docid": "bab8d7a5f84187ca24ef88abc7840985", "score": "0.688355", "text": "function getLocation(){\r\n if(navigator.geolocation){\r\n navigator.geolocation.getCurrentPosition(storeLocation);\r\n }\r\n}", "title": "" }, { "docid": "2ff48518785efc3c63d341221bd42408", "score": "0.68825835", "text": "function getLocation (){\n\t\n\tif (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(getPosition,showError);\n }\n else{x.innerHTML=\"Geolocation is not supported by this browser.\";}\n }", "title": "" }, { "docid": "295173e418db8df51e54d955164c1677", "score": "0.6875365", "text": "function getCoords() {\n //user has location - run showPosition function\n //else run showError function\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n }\n }", "title": "" }, { "docid": "89cbf34ea24c6e0225060a1c7fa67b46", "score": "0.6873979", "text": "function Location() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(showPositionGeolocation, function(error) {\r\n showPositionIPLookup();\r\n });\r\n } else {\r\n x.innerHTML = \"Geolocation is not supported by this browser.\";\r\n }\r\n}", "title": "" }, { "docid": "870c26572e3159e475930badd0854e61", "score": "0.6871472", "text": "_getPosition(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(this._loadMap.bind(this), function(){\n alert('Could not get your position');\n });\n }\n }", "title": "" }, { "docid": "af29356617f0a86a8586c8efef7f208a", "score": "0.68701", "text": "function geoLocate() {\n\t// if browser supports geo-location, then run the rest\n\tif(navigator.geolocation) {\n\t\t// gets the current position\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\t// and stores it within pos\n\t\t\tpos = {\n\t\t\t\tlat: position.coords.latitude,\n\t\t\t\tlng: position.coords.longitude\n\t\t\t}\n\t\t\tconsole.log('lat and lng binded');\n\t\t\tconsole.log(pos);\n\t\t\t// changes the value of the latitude and longitude hidden value fields\n\t\t\t$('#latitude').val(position.coords.latitude);\n\t\t\t$('#longitude').val(position.coords.longitude);\n\t\t\tgenerateUserMarker(pos);\n\t\t}, function(){\n\t\t\talert('Error in geolocation');\n\t\t})\n\t} else {\n\t\talert('You must share your location');\n\t}\n}", "title": "" }, { "docid": "ea880b8499571fa044bf5e6ce9972e84", "score": "0.6864022", "text": "function getCoordinates() {\n navigator.geolocation.getCurrentPosition(setCoordinates, catchError)\n}", "title": "" }, { "docid": "9157fc41b7c690161235c8a0aca6f26d", "score": "0.6861324", "text": "function onGeolocationSuccess(){\n receivedEvent('onGPSConnection', true);\n requestStartingGame();\n}", "title": "" }, { "docid": "88a446ad74c2d15dff73d08f34d6c971", "score": "0.68559194", "text": "function geoLocation() {\n navigator.geolocation();\n}", "title": "" }, { "docid": "d02924a1aa1dff54dd28334ee388d519", "score": "0.68539876", "text": "function getLocation() {\n\t \tconsole.log('in getLocation!');\n\t \tif (navigator.geolocation) {\n\t \t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\n\t \t} else { \n\t \t\tuserLocationDiv.innerHTML = \"Geolocation is not supported by this browser.\";\n\t \t}\n\t }", "title": "" }, { "docid": "c0676abd5ddc48ad82974f956ae11c8b", "score": "0.6851481", "text": "function StartCurrentPositionWatcher() {\n\n //Check that browser supports geolocation\n //If it doesn't, display message and stop any more current position code from running\n if (!navigator.geolocation) {\n alert(\"GeoLocation info not available\");\n return;\n }\n\n //Get current position -- whenever position changes -- \n //and pass it to callback function\n navigator.geolocation.watchPosition(cb_UpdateCurrentPositionMarker,\n cb_UpdateCurrentPositionMarker_Error,\n {\n enableHighAccuracy: true,\n maximumAge: 1000 //Retrieve new info if older than 5 seconds \n }\n );\n}", "title": "" }, { "docid": "c57ecd7789b9874fca63a4944917d545", "score": "0.6844203", "text": "function geoUpdate()\n{\n navigator.geolocation.getCurrentPosition(\n function(position) \n {\n var pos = new google.maps.LatLng(\n position.coords.latitude,position.coords.longitude\n );\n \n // If there is a target, calculates the distance \n // between the target and the current position\n if(typeof(target) != \"undefined\")\n {\n dist = google.maps.geometry.spherical.computeDistanceBetween(target,pos)/1000;\n }\n\n if(typeof(current_marker) != \"undefined\")\n current_marker.setMap(null);\n\n current_marker = new google.maps.Marker({\n position: pos,\n map: map,\n title: 'Location found using HTML5.'\n });\n\n map.setCenter(pos);\n }, \n function() {\n handleNoGeolocation(true);\n }\n );\n}", "title": "" }, { "docid": "a0e33028b992d22e4b7fb5a7a8f460ad", "score": "0.6844072", "text": "function showlocation() {\r\n\t\tnavigator.geolocation.getCurrentPosition(showMap,errorCallback);\r\n\t}", "title": "" }, { "docid": "ffb6f24d65b516fb5b8ed4c9495889b0", "score": "0.6841708", "text": "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "f4c21ed880cbe5728e46b07b8e0487ec", "score": "0.6841354", "text": "function getLocation() {\n if(navigator.geolocation) {\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n }; \n navigator.geolocation.getCurrentPosition(showPosition, error, options);\n } else {\n alert(\"Geo Location not supported by browser\");\n }\n}", "title": "" }, { "docid": "d257642d14cc5d5f863943363090b01d", "score": "0.6840269", "text": "function userPos(){\nif(navigator.geolocation){\nnavigator.geolocation.getCurrentPosition(\nfunction(position){\nvar user_lat = parseFloat(position.coords.latitude);\nvar\tuser_lng = parseFloat(position.coords.longitude);\nconsole.log(user_lat);\nconsole.log(user_lng);\ninitialize(user_lat, user_lng);\n});\n} else {\nalert(\"Geolocation is not supported or turned off\");\n}\n}", "title": "" }, { "docid": "4381d3335b1e45a1736d6b85c645bd08", "score": "0.6839186", "text": "function getLocation() {\n if (\"geolocation\" in navigator) {\n navigator.geolocation.getCurrentPosition(saveLocation);\n }\n }", "title": "" }, { "docid": "d3a2669aa1a4cdcb56f3f23bb16f72cb", "score": "0.6831895", "text": "function getLocation() {\n // if geolocation is implemented by the browser, return the position\n\tif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(retrieveNearest, showError);\n // if not return an error\n\t} else {\n document.getElementById(\"errormessage\").innerHTML=\"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "e21f7b3d474af9f8cd75848d39c2dce1", "score": "0.68229663", "text": "function get_location() {\n if (Modernizr.geolocation) {\n navigator.geolocation.getCurrentPosition(initiate_geomap,initiate_map);\n } else {\n // No native support, falling back\n initiate_map();\n }\n}", "title": "" }, { "docid": "7b23b8b0d10bc4676957fb96802e2756", "score": "0.68228203", "text": "function auditCoords(){\n \n var forcedLocation = lcly.conversionModule.getMetaParam('jump_to');\n \n if (typeof forcedLocation != 'undefined' && forcedLocation && forcedLocation != ''){\n \n lcly.mapService.setCoordsFromGeocode(forcedLocation);\n }\n }", "title": "" }, { "docid": "87358c054bc7bedbad68f0b700910890", "score": "0.68193877", "text": "_getPosition(){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition( this._loadMap.bind(this), function() {\n alert('Could not get your position.')\n });\n }\n }", "title": "" }, { "docid": "9b6de18b956ade1d1f6b9ab8b8b82d51", "score": "0.6817846", "text": "function findMyLocation(evt) {\n \tif(navigator.geolocation){ \n\t navigator.geolocation.getCurrentPosition(zoomToLocation, locationError);\n\t}\n\telse{\n\t alert(\"Sorry, your browser doesn't support geolocation! Visit http://browsehappy.com and download a new browser!\");\n\t}\n}", "title": "" }, { "docid": "8af69e33f8af7cc192de28c80c979f39", "score": "0.6813588", "text": "function getCurrentPosition() {\n window.navigator.geolocation.getCurrentPosition(positionSuccess, alert);\n}", "title": "" }, { "docid": "a9137b9a69e0e25c6ffb7171230ee869", "score": "0.68056464", "text": "function getUsersLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var pos = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n mainmarker.setPosition(pos);\n console.log(pos)\n }, function () {\n mainmarker.setPosition(new google.maps.LatLng(14.597466, 121.0092));\n });\n } else {\n mainmarker.setPosition(new google.maps.LatLng(14.597466, 121.0092));\n }\n}", "title": "" }, { "docid": "0529875e8ded3f5d2f2b3eb5c56f9cea", "score": "0.6804916", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(reportPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "6bf8f39690cec7d6fafd58dbd125934b", "score": "0.6804776", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(showPosition);\r\n } else {\r\n x.innerHTML = \"Geolocation is not supported by this browser.\";\r\n }\r\n}", "title": "" }, { "docid": "453415c0bc5216f17f1a0e0f3ee4b4ad", "score": "0.67933047", "text": "function getLocation() {\n return jQuery.post(\"https://www.googleapis.com/geolocation/v1/geolocate?key=\" + geolocation_vars.geoApiKey + \"&v=3\");\n}", "title": "" }, { "docid": "81a739819ce6b787c0ed2522a9126932", "score": "0.6790935", "text": "function markerLocate(marker) // called from router.html\n{\n clearSearchResult(marker);\n\n function success(position)\n {\n formSetCoords(marker,position.coords.longitude,position.coords.latitude);\n markerAddMap(marker);\n }\n\n function failure(error)\n {\n alert(\"Error: \" + error.message);\n }\n\n if(navigator.geolocation)\n navigator.geolocation.getCurrentPosition(success,failure);\n else\n alert(\"Error: Geolocation unavailable\");\n}", "title": "" }, { "docid": "f3ffdba07f879ac41de8cf3037a9dfac", "score": "0.6788312", "text": "function geoloc(ctx, method, args){\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation){\n navigator.geolocation.getCurrentPosition(\n function(pos) {\n if (is_echo){\n return;\n }\n is_echo = true;\n args.latLng = new google.maps.LatLng(pos.coords.latitude,pos.coords.longitude);\n method.apply(ctx, [args]);\n }, \n function() {\n if (is_echo){\n return;\n }\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n }", "title": "" }, { "docid": "771674cd2f2612f81cd12baa0a7280c0", "score": "0.6782024", "text": "function initiateGeolocation() {\n\t\tnavigator.geolocation.getCurrentPosition(initGeolocation,handleErrors);\n\t\tnavigator.geolocation.watchPosition(handleGeolocation,handleErrors);\n\t\t$(\"#stopTracking\").click(toggleHandleGeolocation);\n\t}", "title": "" }, { "docid": "221012194572f376673cacd550ecc814", "score": "0.6781846", "text": "function geoloc(ctx, method, args) {\n\t\tvar is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n\t\tif (navigator && navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\tfunction (pos) {\n\t\t\t\t\tif (!is_echo) {\n\t\t\t\t\t\tis_echo = true;\n\t\t\t\t\t\targs.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n\t\t\t\t\t\tmethod.apply(ctx, [args]);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction () {\n\t\t\t\t\tif (!is_echo) {\n\t\t\t\t\t\tis_echo = true;\n\t\t\t\t\t\targs.latLng = false;\n\t\t\t\t\t\tmethod.apply(ctx, [args]);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\targs.opts.getCurrentPosition\n\t\t\t);\n\t\t} else {\n\t\t\targs.latLng = false;\n\t\t\tmethod.apply(ctx, [args]);\n\t\t}\n\t}", "title": "" }, { "docid": "116a51aa24f033daf533f62f2848108e", "score": "0.67803967", "text": "function set_current_location(){\r\n if(navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n current_location = new google.maps.LatLng(position.coords.latitude,\r\n position.coords.longitude);\r\n\t calcRoute();\r\n });\r\n } else {\r\n alert(\"Geolocation is not supported by this browser.\");\r\n calcRoute();\r\n }\r\n}", "title": "" }, { "docid": "a4f6cc936c90d94d1bd6c89e1ae9b9a3", "score": "0.6780373", "text": "function findPosition(){\r\n\tif (navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(function(position){ \r\n\t\t\t\tlatlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\r\n\t\t\t\tmap.setCenter(latlng);\r\n\t\t\t\t//create a selfmade needle position where the user is\r\n\t\t\t\tvar marker = new google.maps.Marker({\r\n\t\t\t\t\tposition: latlng, \r\n\t\t\t\t\ticon: 'images/needle.png', \r\n\t\t\t\t\tmap: map, \r\n\t\t\t\t\ttitle: 'Your position!'\r\n\t\t\t\t});\r\n\t\t\t\tlocationMarker.push(marker);\r\n\t\t}); \r\n\t} else{\r\n\t\t//when geolocation isn't working, tell the user to change his browser\r\n\t\talert(\"Can't find your position! Please use another browser!\");\r\n\t}\r\n}", "title": "" }, { "docid": "bff4fa12b0b628cf1f6a2e93767bc6da", "score": "0.67762256", "text": "function NewsLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(News);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "39de585e0e4e8efd00d494eb622f0d05", "score": "0.6768397", "text": "function onGPSLockSuccess(position) { SessionManager.setLocation(position.coords.latitude, position.coords.longitude); }", "title": "" }, { "docid": "2431212752ed9246c5e8a9ad31c9b5be", "score": "0.6766082", "text": "function getCurrentPosition() {\n navigator.geolocation.getCurrentPosition(showPosition);\n}", "title": "" }, { "docid": "265d9757cb881fedd32f7321853c6175", "score": "0.6762806", "text": "function geolocateUser() {\r\n if (navigator.geolocation) {\r\n // the geolocation succeeded so place a marker\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var pos = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n \r\n // set the start position for directions and ask the directions service to plan a route, default to driving\r\n startPos = pos;\r\n getDirections(directionsService, directionsDisplay, 'DRIVING');\r\n }, function() {\r\n handleLocationError(true);\r\n });\r\n } else {\r\n // Browser doesn't support geolocation\r\n handleLocationError(false);\r\n }\r\n}", "title": "" }, { "docid": "b02db1e0aa315f71dd2a96a77ede22e3", "score": "0.6761083", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n userLocation.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "d2dbc985ef40dde2a1cbe40f532b65a0", "score": "0.6759165", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n tileUrl\r\n navigator.geolocation.getCurrentPosition(placeMarker);\r\n }else {\r\n x.innerHTML = \"Geolocation is not supported by this browser.\";\r\n }\r\n }", "title": "" }, { "docid": "e212fae3f448e8d0fcfa96b4f153f3d2", "score": "0.67559713", "text": "function setupLoc() {\n navigator.geolocation.getCurrentPosition(success, error, geoOptions);\n function success(pos) {\n var geoPos = pos.coords;\n var geoLat = geoPos.latitude;\n var geoLng = geoPos.longitude;\n var newWPos = { lat: geoLat, lng: geoLng };\n new google.maps.Marker({\n position: newWPos,\n map: map,\n icon: \"../images/currentLoc.png\"\n });\n var currzoom = map.getZoom();\n window.newBounds = currzoom >= zoomThresh ? true : false;\n map.setCenter(newWPos);\n if (!window.newBounds) {\n map.setZoom(zoomThresh);\n }\n } // end of watchSuccess function\n function error(eobj) {\n var msg = 'Error retrieving position; Code: ' + eobj.code;\n window.alert(msg);\n }\n}", "title": "" }, { "docid": "59acf53ba5a835b43d428cae0cd67d2c", "score": "0.67558116", "text": "function geolocate() {\r\n\t\t if (navigator.geolocation) {\r\n\t\t navigator.geolocation.getCurrentPosition(function (position) {\r\n\t\t var geolocation = new google.maps.LatLng(\r\n\t\t position.coords.latitude, position.coords.longitude);\r\n\r\n\t\t var latitude = position.coords.latitude;\r\n\t\t var longitude = position.coords.longitude;\r\n\t\t \r\n\t\t document.getElementById(\"latitude\").value = latitude;\r\n\t\t document.getElementById(\"longitude\").value = longitude;\r\n\r\n\t\t autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));\r\n\t\t });\r\n\t\t }\r\n\r\n\t\t }", "title": "" }, { "docid": "f9e23de39c4fcadd12a50b5492803058", "score": "0.67519426", "text": "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n console.log(navigator.geolocation.getCurrentPosition(showPosition));\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "1069791f5f2a19bb64a420732b290691", "score": "0.6748847", "text": "function findAdressfromCoordinates(){\n\n\tnavigator.geolocation.getCurrentPosition(onGetCurrentPositionSuccess, onGetCurrentPositionError);\n\n\t\n\t}", "title": "" }, { "docid": "ebf53c8bfa07592e2076b9b72a2cb5a0", "score": "0.6744903", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n console.log(\"Geolocation is not supported by this browser.\")\n }\n}", "title": "" }, { "docid": "b139134bfe48c52a690bf60709df6bb2", "score": "0.67381096", "text": "function updatePosition() {\n \n /* Location */\n\t//instruct location service to get position with appropriate callbacks\n\t watchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "title": "" }, { "docid": "a81dc751c8b413e7d2dca23eb0d7294f", "score": "0.6736644", "text": "function findlocation(){\r\n var options = {\r\n enableHighAccuracy: true,\r\n timeout: 5000,\r\n maximumAge: 0\r\n };\r\n\r\n function error(err) {\r\n console.warn(`ERROR(${err.code}): ${err.message}`);\r\n };\r\n\r\n function success(pos) {\r\n var crd = pos.coords;\r\n lat = crd.latitude;\r\n long = crd.longitude;\r\n current_location = {lat, long};\r\n initMap();\r\n findEntriesNearMe();\r\n };\r\n navigator.geolocation.watchPosition(success, error, options);\r\n }", "title": "" }, { "docid": "3df1a7862e9ffd77a124f0468fe331d7", "score": "0.6735364", "text": "function geoLocation\n(\n) \n{\n if (navigator.geolocation) \n {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n autocomplete.setBounds(new google.maps.LatLngBounds(geolocation,\n geolocation));\n });\n }\n}", "title": "" }, { "docid": "6ce9a0ba93de20a4a1ad36e8fcda209a", "score": "0.67331696", "text": "requestBrowserLocation() {\n navigator.geolocation.getCurrentPosition((pos) => {\n this.map.panTo([pos.coords.latitude, pos.coords.longitude])\n })\n }", "title": "" }, { "docid": "a83dd1d4028464a3450272d6d2478dde", "score": "0.6732514", "text": "function getLocation() {\n\t if (navigator.geolocation) {\n\t \t$(\".detecting-location\").show();\n\t \t$(\"#start-chat\").hide();\n\t navigator.geolocation.getCurrentPosition(showPosition);\n\t } \n\t}", "title": "" }, { "docid": "49972cde114dff5957fad3cff4da54a0", "score": "0.672658", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "23828ebfe79ff5a86060d825d3941cde", "score": "0.6725558", "text": "function getLocation(){\n // Once the position has been retrieved, an JSON object\n // will be passed into the callback function (in this case geoCallback)\n // If something goes wrong, the onError function is the \n // one that will be run\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "23828ebfe79ff5a86060d825d3941cde", "score": "0.6725558", "text": "function getLocation(){\n // Once the position has been retrieved, an JSON object\n // will be passed into the callback function (in this case geoCallback)\n // If something goes wrong, the onError function is the \n // one that will be run\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "3126f55ed7a1cfe27aaa87c98b39e3a9", "score": "0.6723893", "text": "function locateOnMap()\r\n{\r\n if(navigator.geolocation)\r\n {\r\n // Options for GPS watching.\r\n // Note: Don't use default \"timeout\" value of \"Infinity\" as this causes both Safari and some versions of \r\n // Chrome on iOS and Android to return error code 3: Location access timed out.\r\n positionOptions = {\r\n enableHighAccuracy: true,\r\n timeout: 60000,\r\n maximumAge: 0\r\n };\r\n\r\n // Watch the user's GPS location. showCurrentLocation function will be called every time the user's \r\n // location changes (if it can be successfully determined).\r\n // If the location can't be determined, then the errorHandler function will be called. \r\n navigator.geolocation.watchPosition(showPosition, handleLocationError, positionOptions);\r\n }\r\n else \r\n {\r\n alert(\"Geolocation is not supported by this browser!\");\r\n }\r\n}", "title": "" }, { "docid": "9e9a535e027203e382d9df48b365c0b2", "score": "0.6717317", "text": "function geoloc(ctx, method, args) {\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (pos) {\n if (!is_echo) {\n is_echo = true;\n args.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n method.apply(ctx, [args]);\n }\n },\n function () {\n if (!is_echo) {\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n}", "title": "" }, { "docid": "9e9a535e027203e382d9df48b365c0b2", "score": "0.6717317", "text": "function geoloc(ctx, method, args) {\n var is_echo = false; // sometime, a kind of echo appear, this trick will notice once the first call is run to ignore the next one\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (pos) {\n if (!is_echo) {\n is_echo = true;\n args.latLng = new gm.LatLng(pos.coords.latitude, pos.coords.longitude);\n method.apply(ctx, [args]);\n }\n },\n function () {\n if (!is_echo) {\n is_echo = true;\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n },\n args.opts.getCurrentPosition\n );\n } else {\n args.latLng = false;\n method.apply(ctx, [args]);\n }\n}", "title": "" } ]
f2646157e4e034d20bebbda3e947afa2
End Global Variables Start Helper Functions End Helper Functions Begin Main Functions build the nav
[ { "docid": "4a5a5b8bbcc97d001db76fb2aa38e5fa", "score": "0.0", "text": "function createListItems (){\n for (const section of sections) {\n //getting section name\n sectionName = section.getAttribute('data-nav');\n //getting section id\n sectionId = section.getAttribute('id');\n //creating list item\n listItem = document.createElement('li');\n //Adding name and id\n listItem.innerHTML = `<a class='menu__link' href='#${sectionId}'>${sectionName}</a>`;\n //append menu item to the navMenu\n navMenu.append(listItem);\n }\n}", "title": "" } ]
[ { "docid": "8b7841e09d07463b3d73be2542311e2f", "score": "0.75089335", "text": "function build_nav() {\n\n if (settings.show_first)\n navigation_container.append($('<span class=\"page_link first\"><a href=\"#\">' + settings.first_label + '</a></span>').data('page', 1));\n\n if (settings.show_prev)\n navigation_container.append($('<span class=\"page_link prev\"><a href=\"#\">' + settings.prev_label + '</a></span>'));\n \n if (settings.show_ellipse)\n navigation_container.append($('<span class=\"ellipse less\">' + settings.ellipse_label + '</span>'));\n\n for (i = 1; i <= total_pages; i++) {\n navigation_container.append($('<span class=\"page_link\" data-page=\"' + i + '\"><a href=\"#\">' + i + '</a></span>').data('page', i));\n }\n \n if (settings.show_ellipse)\n navigation_container.append($('<span class=\"ellipse more\">' + settings.ellipse_label + '</span>'));\n\n if (settings.show_prev)\n navigation_container.append($('<span class=\"page_link next\"><a href=\"#\">' + settings.next_label + '</a></span>'));\n\n if (settings.show_last)\n navigation_container.append($('<span class=\"page_link last\"><a href=\"#\">' + settings.last_label + '</a></span>').data('page', total_pages));\n\n $('.page_link:not(.next, .prev)', navigation_container).click(function() {\n var page = $(this).data('page');\n goto_page(page);\n return false;\n });\n\n $('.page_link.next', navigation_container).click(function() {\n var current_page = $('.page_link.active', navigation_container).data('page');\n if (current_page < total_pages)\n goto_page(current_page + 1);\n return false;\n });\n\n $('.page_link.prev', navigation_container).click(function() {\n var current_page = $('.page_link.active', navigation_container).data('page');\n if (current_page > 1)\n goto_page(current_page - 1);\n return false;\n });\n }", "title": "" }, { "docid": "7b445f92dc0116d04b6f5438b07c1d47", "score": "0.6972714", "text": "function navInit() {\n\t\n\tvar subnavs = $( '.web-help-subnav' );\n\t\n\tfor (i=subnavs.length-1;i>=0;i--) {\n\t\tel = subnavs[i];\n\t\tchild = $(el).children()[0];\n\t\t$(child).css(\"margin-top\",-($(el).height()+15));\n\t\t$(el).css('display','none');\n\t\t$(el).addClass(\"collapsed\");\n\t}\n\t\n\tvar folderbuttons = $( '.folderButton' )\n\t\n\tfor (j=0;j<folderbuttons.length;j++) {\n\t\tel = folderbuttons[j];\n\t\tel.innerHTML = \"\";\n\t\t$(el).addClass(\"collapsed\");\n\t}\n\t\n\tdefaultNav = $('.web-help-nav')[0].outerHTML;\n}", "title": "" }, { "docid": "af43046eaeeab7cac2a08d685799eede", "score": "0.6793167", "text": "function primaryNavBarMenuItems(root){// The primary (middle) navbar menu displays the general code navigation hierarchy, similar to the navtree.\n// The secondary (right) navbar menu displays the child items of whichever primary item is selected.\n// Some less interesting items without their own child navigation items (e.g. a local variable declaration) only show up in the secondary menu.\nvar primaryNavBarMenuItems=[];function recur(item){if(shouldAppearInPrimaryNavBarMenu(item)){primaryNavBarMenuItems.push(item);if(item.children){for(var _i=0,_a=item.children;_i<_a.length;_i++){var child=_a[_i];recur(child);}}}}recur(root);return primaryNavBarMenuItems;/** Determines if a node should appear in the primary navbar menu. */function shouldAppearInPrimaryNavBarMenu(item){// Items with children should always appear in the primary navbar menu.\nif(item.children){return true;}// Some nodes are otherwise important enough to always include in the primary navigation menu.\nswitch(navigationBarNodeKind(item)){case 245/* ClassDeclaration */:case 214/* ClassExpression */:case 248/* EnumDeclaration */:case 246/* InterfaceDeclaration */:case 249/* ModuleDeclaration */:case 290/* SourceFile */:case 247/* TypeAliasDeclaration */:case 322/* JSDocTypedefTag */:case 315/* JSDocCallbackTag */:return true;case 202/* ArrowFunction */:case 244/* FunctionDeclaration */:case 201/* FunctionExpression */:return isTopLevelFunctionDeclaration(item);default:return false;}function isTopLevelFunctionDeclaration(item){if(!item.node.body){return false;}switch(navigationBarNodeKind(item.parent)){case 250/* ModuleBlock */:case 290/* SourceFile */:case 161/* MethodDeclaration */:case 162/* Constructor */:return true;default:return false;}}}}", "title": "" }, { "docid": "b0a3959d519b560c2c1f87bf8295d686", "score": "0.6790139", "text": "function fncBuildLocalNav()\r\n{\r\n\tif (gobjLayout.localnav == 1 || gobjLayout.localnav == 2 || gobjLayout.localnav == 3)\r\n\t{\r\n\tif ((gobjLayout.localnav != 2) || (gobjLayout.localnavwidth + gobjLayout.localnavgutter > 130))\r\n\t{\r\n\t\tgobjLayout.localnavwidth = Math.max(116,gobjLayout.localnavwidth);\r\n\t\tgobjLayout.localnavgutter = Math.max(0,130 - gobjLayout.localnavwidth);\r\n\t}\r\n\t// get count of local nav objects from image names\r\n\tvar intCount = 0;\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\tintCount++;\r\n\t\t}\r\n\t}\r\n\tintCount = Math.min(intCount,gobjLayout.localnavmax);\r\n\tintSpaces = gobjLayout.localnavmax - intCount;\r\n\tvar strTemp = '';\r\n\t// Start building HTML string\r\n\tstrTemp = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" bgcolor=\"' + gobjLayout.localnavbgcolor +'\">';\r\n\tstrTemp += '<tr>';\r\n\tstrTemp += '<td width=\"107\" bgcolor=\"#ffffff\"><img src=\"' + gobjClear.on.src +'\" width=\"107\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '<td width=\"1\" valign=\"top\" align=\"left\" bgcolor=\"#5A5A5A\"><img src=\"' + gobjClear.on.src +'\" width=\"1\" height=\"24\" border=\"0\"></td>';\r\n\tstrTemp += '<td>';\r\n\tstrTemp += '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"555\">';\r\n\t// Loop from last main nav element to max allowed number of local nav elements to create cells & gutters\r\n\tstrTemp += '<tr><td rowspan=\"3\" width=\"10\"><img src=\"' + gobjClear.on.src +'\" width=\"10\" height=\"24\" border=\"0\"></td>';\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavwidth + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavwidth + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// Build space holders if local nav count less than maximum allowed\r\n\tif (intSpaces > 0)\r\n\t{\r\n\t\tfor (i = 1; i <= intSpaces; i++)\r\n\t\t{\t\r\n\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavwidth + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavwidth + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tstrTemp += '</tr>';\r\n\t// Loop from last main nav element to max allowed number of local nav elements\r\n\tstrTemp += '<tr align=\"left\" valign=\"bottom\">';\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\t//If no sub navs present, make roll-over work for Local Nav\r\n\t\t\tif (gobjLayout.localnav == 2 || gobjLayout.localnav == 3)\r\n\t\t\t{\r\n\t\t\t\t//If current local nav is the selected on, use selected state\r\n\t\t\t\tif (gobjLayout.selectedparentnav == i)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tstrTemp += '<td><a class=\"lnavon\">' + gobjNavArray[i].label + '</a></td>';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstrTemp += '<td><a href=\"' + gobjNavArray[i].href + '\" class=\"lnavoff\">' + gobjNavArray[i].label + '</a></td>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td><a class=\"lnavoff\">' + gobjNavArray[i].label + '</a></td>';\r\n\t\t\t}\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td>&nbsp;</td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// Build space holders if local nav count less than maximum allowed\r\n\tif (intSpaces > 0)\r\n\t{\r\n\t\tfor (i = 1; i <= intSpaces; i++)\r\n\t\t{\t\r\n\t\t\tstrTemp += '<td>&nbsp;</td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td>&nbsp;</td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tstrTemp += '</tr>';\r\n\t// End row, start next row for local nav rollover images\r\n\tstrTemp += '<tr>';\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavwidth + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavwidth + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tstrTemp += '</tr>';\r\n\tstrTemp += '</table></td><td width=\"100%\"><img src=\"' + gobjClear.on.src +'\" width=\"1\" height=\"24\" border=\"0\"></td></tr></table>';\r\n\tstrTemp += '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">';\r\n\tstrTemp += '<tr bgcolor=\"#5A5A5A\">';\r\n\tstrTemp += '<td width=\"107\" bgcolor=\"#ffffff\"><img src=\"' + gobjClear.on.src +'\" width=\"107\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '<td width=\"1\" rowspan=\"3\"><img src=\"' + gobjClear.on.src +'\" width=\"1\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '<td width=\"545\"><img src=\"' + gobjClear.on.src +'\" width=\"545\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '<td width=\"100%\"><img src=\"' + gobjClear.on.src +'\" width=\"1\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '</tr>';\r\n\tstrTemp += '</table>';\r\n\t// Build local nav elements\r\n\tdocument.write (strTemp);\r\n\t}\r\n}", "title": "" }, { "docid": "2ebc39171e00dd262f920fc0ea11086d", "score": "0.6715007", "text": "function navigation() {\n }", "title": "" }, { "docid": "4e59362bd2d79e08c4c17b7c8ea8c2cd", "score": "0.6689608", "text": "function main() {\n\t\tvar projDropdownID = '#projects-dropdown';\n\t\tvar navCollapseID = '#nav-collapse';\n\t\tvar navCollapseButtonID = '#nav-coll-button';\n\t\tvar noJsMessageID = '#no-js-message';\n\t\t// Hide the no-js-message\n\t\t$(noJsMessageID).hide();\n\t\t// Get rid of margin on header\n\t\t$('header').attr('style', 'margin-top: 0px; ');\n\t\t// Collapse the navbar (from no-js state)\n\t\tcollapseNavbar({ \n\t\t\tnavCollapseID: navCollapseID, \n\t\t\tbutton: navCollapseButtonID \n\t\t});\n\t\t// Highlight the active link\n\t\taddActiveLink();\n\t}", "title": "" }, { "docid": "da55bcb3d6257bb8318809232ffd0199", "score": "0.6660489", "text": "function main() {\n\t\tvar subNavID = \"project-subnav\";\n\t\tvar subnavDelay = 300;\n\t\tvar subnavDuration = 700;\n\t\tvar activeIconFadeDuration = 800;\n\t\t// Hide project subnav so it is in jQuery queue for slide down\n\t\t$(\"#\" + subNavID).hide();\n\t\t// Lighten and flash infinitely the $ cursor\n\t\tsubNavActiveLink(activeIconFadeDuration);\n\t\t// Slide subnav down\n\t\tslideSubNavDown(subNavID, subnavDelay, subnavDuration);\n\t}", "title": "" }, { "docid": "7997868df2dcc1a87f33fd0670515dc0", "score": "0.66382194", "text": "function navClicks() {\n}", "title": "" }, { "docid": "5a244e9b1c628541825280d36f711172", "score": "0.6635197", "text": "function setup_navigation(){function c(){a.scrollTop()>50?b.addClass(\"nav-fixed\"):b.removeClass(\"nav-fixed\")}function i(a){var b=78;if(a.target.localName!=\"body\"&&a.target.localName!=\"html\")return!0;if(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey)return!0;if(d)return n(a),!1;if(a.which==b)return j(),!1}function j(){l(),d=\"top\"}function k(){m(),$(\"#nav li.open\").removeClass(\"open\"),d=e=!1}function l(){$(\"#nav\").addClass(\"key-active\")}function m(){$(\"#nav\").removeClass(\"key-active\")}function n(a){var b=73,c=80,d=83,f=87,g=68,h=67,i=78,j=85,l=27,m=37,n=39,r=13,s=38,v=40,w=74,x=75;switch(a.which){case b:q(0);break;case j:q(1);break;case g:q(2);break;case h:q(3);break;case i:a.ctrlKey&&choose_current_top_nav();break;case m:o();break;case n:p();break;case r:t();break;case v:e?u(a):choose_current_top_nav();break;case s:u(a);break;case w:u(a);break;case x:u(a);break;case l:k()}}function o(){f==0?f=g-1:f-=1,r()}function p(){f==g-1?f=0:f+=1,r()}function q(a){f=a,r()}function r(){$(\"#nav .container > ul > li\").removeClass(\"active\");var a=$(\"#nav .container > ul > li:eq(\"+f+\")\");a.addClass(\"active\"),$(\"#nav li.with-subnav\").removeClass(\"open\"),e=!1,a.hasClass(\"with-subnav\")&&s(a),l()}function s(a){a.addClass(\"open\"),e=!0,h=0;var b=a.find(\".subnav\");b.find(\"a\").removeClass(\"hover\"),b.children(\"li:eq(\"+h+\")\").find(\"a\").addClass(\"hover\"),m()}function t(){var a=$(\"#nav .container > ul > li:eq(\"+f+\") > a\");e&&(a=a.parent().find(\".subnav li:eq(\"+h+\")\").find(\"a\")),window.location=a.attr(\"href\")}function u(a){var b=$(\"#nav li.with-subnav.open .subnav\"),c=38,d=40,e=74,f=75;if(a.which==c||a.which==f){h<=0&&(h=b.children().length),h-=1,b.find(\"a\").removeClass(\"hover\");var g=b.children(\"li:eq(\"+h+\")\");g.hasClass(\"header\")&&(h-=1,g=b.children(\"li:eq(\"+h+\")\")),g.find(\"a\").addClass(\"hover\"),a.preventDefault()}else if(a.which==d||a.which==e){h>=b.children().length-1&&(h=-1),h+=1,b.find(\"a\").removeClass(\"hover\");var i=b.children(\"li:eq(\"+h+\")\");i.hasClass(\"header\")&&(h+=1,i=b.children(\"li:eq(\"+h+\")\")),i.find(\"a\").addClass(\"hover\"),a.preventDefault()}}$(window).click(function(){$(\"#nav li.with-subnav.open\").removeClass(\"open\")}),$(\"#nav .subnav\").click(function(a){a.stopPropagation()}),$(\"#nav li.with-subnav > a\").click(function(){return $(this).parent().toggleClass(\"open\").siblings().removeClass(\"open\"),!1}),$(\"#nav li.with-subnav li a\").click(function(){var a=$(this).parents(\"li.with-subnav\");a.addClass(\"active\").siblings().removeClass(\"active\"),a.find(\"a\").removeClass(\"active\"),$(this).hasClass(\"external\")||$(this).addClass(\"active\")}),$(\"#mobile-nav-toggle\").click(function(){return $(\"body\").toggleClass(\"nav-open\"),!1}),$(\"#mobile-auth-toggle\").click(function(){return $(\"body\").toggleClass(\"auth-open\"),!1});var a=$(window),b=$(\"html\");c(),a.scroll(c),$(document).keydown(i),f=$(\"#nav li.active\").index(),g=$(\"#nav .container > ul > li\").length;var d=!1,e=!1,f=0,g=6,h=-1}", "title": "" }, { "docid": "229fd69a61f3c67247c1d329ec220da1", "score": "0.6602597", "text": "function navInit() {\n\n /* Running function to add new sections to page */\n addSections();\n const mySections = document.getElementsByTagName(\"section\");\n const myNav = document.querySelector(\"nav\");\n /* initaliazing a new unordered list */\n const navUl = document.createElement(\"ul\");\n /* adding an existing css class from layout.css */\n navUl.classList.add(\"nav\");\n /* looping through all sections in page */\n for (let section of mySections) {\n /* retrieving section number from the dataset attribute */\n const navItem = section.dataset.nav;\n /* creating a list element */\n const node = document.createElement(\"li\");\n /* adding section name */\n node.textContent = navItem;\n /* adding an existing css class from layout.css */\n node.classList.add(\"nav__item\");\n /* adding an event listener to nav items to scroll into view when\n clicked */\n node.addEventListener(\"click\", () =>\n /* for large device screens scroll to center of section,\n otherwise for smaller screens scroll to top of section */\n { if (window.innerWidth > 400) {\n section.scrollIntoView({block: \"center\", behavior: \"smooth\"})}\n else {\n section.scrollIntoView({block: \"start\", behavior: \"smooth\"})}\n });\n /* appending list item to unordered list */\n navUl.appendChild(node);\n }\n /* appending unordered list to nav element in HTML file */\n myNav.appendChild(navUl);\n\n /* function which calls activeClass() which in turn adjusts border box of\n current section in viewport. */\n activeClass();\n }", "title": "" }, { "docid": "fafb3686e026bceac72df6317dcba3f0", "score": "0.6570196", "text": "function navSettings() { // Public function for invoking our\n _desktopNavSettings // private device speciffic functions.\n _mobileNavSettings()\n }", "title": "" }, { "docid": "50ed89a011cc507c35e5a8cd477eb009", "score": "0.65659976", "text": "function fncBuildLocalSubNav()\r\n{\r\n\tvar strTemp = '';\r\n\tif (gobjLayout.localnav == 1)\r\n\t{\r\n\t// Start building HTML string\r\n\tstrTemp = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';\r\n\tstrTemp += '<tr>';\r\n\tstrTemp += '<td width=\"108\" bgcolor=\"#ffffff\"><img src=\"' + gobjClear.on.src +'\" width=\"108\" height=\"1\" border=\"0\"></td>';\r\n\tstrTemp += '<td>';\r\n\tstrTemp += '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"555\">';\r\n\t// Loop from last main nav element to max allowed number of local nav elements to create cells & gutters\r\n\tstrTemp += '<tr><td rowspan=\"3\" width=\"10\"><img src=\"' + gobjClear.on.src +'\" width=\"10\" height=\"1\" border=\"0\"></td>';\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavwidth + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavwidth + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// Build space holders if local nav count less than maximum allowed\r\n\tif (intSpaces > 0)\r\n\t{\r\n\t\tfor (i = 1; i <= intSpaces; i++)\r\n\t\t{\t\r\n\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavwidth + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavwidth + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tstrTemp += '</tr>';\r\n\t// Loop from last main nav element to max allowed number of local nav elements\r\n\tstrTemp += '<tr align=\"left\" valign=\"top\">';\r\n\tfor (i = 0; i < gobjNavArray.length; i++)\r\n\t{\t\r\n\t\tif (gobjNavArray[i].type == 3)\r\n\t\t{\r\n\t\t\tintLocalSubNavCount = gobjNavArray[i].child.length;\r\n\t\t\tstrTemp += '<td><table width=\"108\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\r\n\t\t\tintRows = 2 * intLocalSubNavCount;\r\n\t\t\tintLocalSubNavWidth = gobjLayout.localnavwidth - 10;\r\n\t\t\tfor (j=0; j<intLocalSubNavCount; j++)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<tr>';\r\n\t\t\t\tif (j > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrTemp += '<td valign=\"top\"><img src=\"' + gobjNavArray[i].child[j].rollover.off.src + '\" name=\"' + gobjNavArray[i].child[j].rollovername + '\" width=\"7\" height=\"16\" border=\"0\"></td>';\r\n\t\t\t\t\tif ((gobjLayout.selectedparentnav == i) && (gobjLayout.selectedchildnav == j))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstrTemp += '<td><a class=\"lnavon\" onmouseover=\"fncSwitch(' + i + ',' + j + ',1);\" onmouseout=\"fncSwitch(' + i + ',' + j + ',0);\">' + gobjNavArray[i].child[j].label + '</a></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstrTemp += '<td><a href=\"' + gobjNavArray[i].child[j].href + '\" class=\"lnavoff\" onmouseover=\"fncSwitch(' + i + ',' + j + ',1);\" onmouseout=\"fncSwitch(' + i + ',' + j + ',0);\">' + gobjNavArray[i].child[j].label + '</a></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstrTemp += '<td rowspan=\"' + intRows +'\" width=\"1\" bgcolor=\"#5A5A5A\"><img src=\"' + gobjClear.on.src +'\" width=\"1\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t\t\tstrTemp += '<td width=\"7\" valign=\"top\"><img src=\"' + gobjNavArray[i].child[j].rollover.off.src + '\" name=\"' + gobjNavArray[i].child[j].rollovername + '\" width=\"7\" height=\"16\" border=\"0\"></td>';\r\n\t\t\t\t\tstrTemp += '<td rowspan=\"' + intRows +'\" width=\"2\"><img src=\"' + gobjClear.on.src +'\" width=\"2\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t\t\tif ((gobjLayout.selectedparentnav == i) && (gobjLayout.selectedchildnav == j))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstrTemp += '<td width=\"' + intLocalSubNavWidth + '\"><a class=\"lnavon\" onmouseover=\"fncSwitch(' + i + ',' + j + ',1);\" onmouseout=\"fncSwitch(' + i + ',' + j + ',0);\">' + gobjNavArray[i].child[j].label + '</a></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstrTemp += '<td width=\"' + intLocalSubNavWidth + '\"><a href=\"' + gobjNavArray[i].child[j].href + '\" class=\"lnavoff\" onmouseover=\"fncSwitch(' + i + ',' + j + ',1);\" onmouseout=\"fncSwitch(' + i + ',' + j + ',0);\">' + gobjNavArray[i].child[j].label + '</a></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tstrTemp += '</tr>';\r\n\t\t\t\tstrTemp += '<tr><td><img src=\"' + gobjClear.on.src +'\" height=\"7\" border=\"0\"></td></tr>';\r\n\t\t\t}\r\n\t\t\tstrTemp += '</table></td>';\r\n\t\t\tif (gobjLayout.localnavgutter > 0)\r\n\t\t\t{\r\n\t\t\t\tstrTemp += '<td width=\"' + gobjLayout.localnavgutter + '\"><img src=\"' + gobjClear.on.src +'\" width=\"' + gobjLayout.localnavgutter + '\" height=\"1\" border=\"0\"></td>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tstrTemp += '</tr>';\r\n\t// End row, start next row for local nav rollover images\r\n\tstrTemp += '</table></td></tr></table>';\r\n\t// Build local nav elements\r\n\tdocument.write (strTemp);\r\n\t}\r\n}", "title": "" }, { "docid": "1b033f1e865dabe1b847e7b1185a3969", "score": "0.6551847", "text": "function buildNavigation(){\n \n $(_.carousel).append('<div class=\"nav\"> <div class=\"left openNav\"> </div><div class=\"right openNav\"> </div> </div>');\n \n /* Navigation Hide and Display */\n \n var navigation = \"display\";\n \n if(navigation === \"display\"){\n $(_.carousel + \" .nav\").hide();\n $(_.carousel).hover(function (){\n $(_.carousel + \" .nav\").fadeIn();\n }, function(){\n $(_.carousel + \" .nav\").fadeOut();\n } \n );\n }\n \n /* \n * Build navigation Interaction \n *\n * */\n $(_.carousel + \" .nav .left\").click(function(){\n \n console.log(\"stat: pause Left click ARROW\" ); \n \n if($(this).hasClass(\"openNav\")){\n \n _clickArrow = true; \n clearInterval(cycle);\n \n doCycle(\"desending\");\n \n $(this).removeClass(\"openNav\").addClass(\"closeNav\");\n\n setTimeout(function() {\n $(_.carousel + \" .nav .left\").removeClass(\"closeNav\").addClass(\"openNav\"); \n }, _.delayOnNextClick);\n }\n });\n \n \n $(_.carousel + \" .nav .right\").click(function(){\n \n console.log(\"stat: pause Right click ARROW\" ); \n \n if($(this).hasClass(\"openNav\")){\n \n _clickArrow = true; \n clearInterval(cycle);\n doCycle(\"assending\");\n $(this).removeClass(\"openNav\").addClass(\"closeNav\");\n setTimeout(function() {\n $(_.carousel + \" .nav .right\").removeClass(\"closeNav\").addClass(\"openNav\"); \n }, _.delayOnNextClick);\n \n }\n });\n }", "title": "" }, { "docid": "4014902c4309fdf0a15c0800f05e002f", "score": "0.65412605", "text": "function setMenu() {\n\n\t\tvar w = parseInt($(\"nav\").css(\"width\"), 10);\n\n\t\tif (w < 750) {\n\n\t\t\tif ($(\"#navigator2\").is(':empty')) {\n\t\t\t\t$(\"#navigator2\").append($(\"#booksNav\"), $(\"#gamesNav\"), $(\"#moviesNav\"), $(\"#contactNav\"),\n\t\t\t\t\t$(\"#logNav\"), $(\"#accountNav\"));\n\t\t\t\t$(\"#booksNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#gamesNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#moviesNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#miniNavigator\").show();\n\t\t\t\t$(\"#miniNavigator\").effect(\"highlight\", { color: 'red' }, 500);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$(\"#navigator\").append($(\"#booksNav\"), $(\"#gamesNav\"), $(\"#moviesNav\"), $(\"#contactNav\"),\n\t\t\t\t$(\"#logNav\"), $(\"#accountNav\"));\n\t\t\t$(\"#booksNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#gamesNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#moviesNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#miniNavigator\").hide();\n\n\t\t}\n\t}", "title": "" }, { "docid": "dc3b83dc9ad438c9ecad407602d7d77c", "score": "0.65211934", "text": "function all_ready() {\n\t// Update nav for the first page\n\tnav.append_element();\n\n\t// Handle nav for hover. When hover in, add label and change colour. Whne hover out, return original state\n\t$(\".nav-link\").hover(function()\t{\n\t\tif(!this.classList.contains(\"active\")){\n\t\t\tnav.append_element(this, this.dataset.navigation, false);\n\t\t};\n\t}, function(){\n\t\tif(!this.classList.contains(\"active\")){\n\t\t\tnav.remove_element(this, this.dataset.navigation);\n\t\t}\n\t});\n\n\t// Handle when nav is clicked. Update next page value in current obj and call scroll animation start\n\t$(\".nav-link\").click(function() {\n\t\tif(view.wheel){\n\t\t\tcurrent.set_next_page(parseInt(this.dataset.navigation));\n\t\t\tif(current.difference() == 0){\n\t\t\t\tcurrent.set_next_page(null);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tview.scroll();\n\t\t\t}\n\t\t}\n\t})\n\n\t// Hanfle mobile nav icon being clicked. Bring down the nav container from top when click and bring it back to top when clicked again\n\t$(\".mobile-nav-indicator\").click(function() {\n\t\tlet navbar = document.getElementById(\"navbar\");\n\t\tif(this.classList.contains(\"toggled\") == false) {\n\t\t\tthis.className += \" toggled\";\n\t\t\tview.disable_wheel();\n\t\t\tnavbar.style.transform = \"translate3d(0, 0, 0)\";\n\t\t\tsetTimeout(nav.mobile_nav_in, 400);\n\t\t}\n\t\telse {\n\t\t\tthis.classList.remove(\"toggled\");\n\t\t\tview.enable_wheel();\n\t\t\tnavbar.style.transform = \"\";\n\t\t\tnav.mobile_nav_out();\n\t\t}\n\t})\n\n\t// Handle mobile nav link when being clicked. Move the navbar back to top, update next page value in current obj and start page changing animation\n\t$(\".mobile-nav-link\").click(function() {\n\t\tlet navbar = document.getElementById(\"navbar\");\n\t\tlet linkData = this.dataset.navigation;\n\n\t\t$(\".mobile-nav-indicator\").click();\n\n\t\tnavbar.addEventListener(\"transitionend\", function n() {\n\t\t\tif(view.wheel){\n\t\t\t\tcurrent.set_next_page(parseInt(linkData));\n\t\t\t\tif(current.difference() == 0){\n\t\t\t\t\tcurrent.set_next_page(null);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tview.scroll();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n\n\t// Handle first section load when page first ready\n\tif(!visited){\n\t\tlet sec_in_function = window[current.get_in_function()];\n\t\tsec_in_function();\n\t\tvisited = true;\n\t}\n\n\t// Add Wheel Event Listener to <body> of the page\n\tlet body = document.querySelector(\"body\");\n\tbody.addEventListener(\"wheel\", function(){});\n\tbody.onwheel = function(event) {\n\t\t// Check direction (1: scroll down, 2: scroll up)\n\t\tlet wheel_direction = event.deltaY > 0 ? 1 : -1;\n\n\t\tif(view.wheel && !(current.page == 1 && wheel_direction == -1) && !(current.page == 4 && wheel_direction == 1)) {\n\t\t\tif(wheel_direction === 1) {\n\t\t\t\tcurrent.set_next_page(current.page + 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrent.set_next_page(current.page - 1);\n\t\t\t}\n\t\t\tview.scroll();\n\t\t}\n\t\telse {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\n\t// Add Touchmove Event Listener to <body> of the page\n\t// Touchscreen Device\n\tlet touchStartY;\n\tlet touchEndY;\n\tbody.addEventListener(\"touchstart\", function(e){\n\t\ttouchStartY = e.changedTouches[0].clientY;\n\t});\n\n\tbody.addEventListener(\"touchend\", function(e){\n\t\ttouchEndY = e.changedTouches[0].clientY;\n\t\tmove();\n\t});\n\n\tfunction d() {\n\t\tif(Math.abs(touchStartY - touchEndY) < 100) {\n\t\t\treturn 0;\n\t\t}\n\t\tif(touchStartY > touchEndY) {\n\t\t\treturn 1;\n\t\t}\n\t\tif(touchStartY < touchEndY) {\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\tfunction move() {\n\t\tlet direction = d();\n\t\tif(view.wheel && !(current.page == 1 && direction == -1) && !(current.page == 4 && direction == 1) && !(direction == 0) ) {\n\t\t\tif(direction == 1) {\n\t\t\t\tcurrent.set_next_page(current.page + 1);\n\t\t\t}\n\t\t\tif(direction == -1) {\n\t\t\t\tcurrent.set_next_page(current.page - 1);\n\t\t\t}\n\t\t\tview.scroll();\n\t\t}\n\t}\n\t\n\n}", "title": "" }, { "docid": "827f967e1541768e85da219555b57d41", "score": "0.6497459", "text": "function initNavigation() \n{\n\t//Place the generated page into the website\n\tdocument.getElementById( \"navPanel\" ).innerHTML = placeNavigation();\n}", "title": "" }, { "docid": "d67f71cdf9334ada4b5ee6a9a865536b", "score": "0.64801025", "text": "function overrideNav() {\n}", "title": "" }, { "docid": "73756babed4c3003493b68fdbb350dff", "score": "0.64585406", "text": "function buildNav() {\n // looping through all sections to build Navbar based on sections information\n sections.forEach(section => {\n // create list item for each section\n let listItem = document.createElement(\"li\");\n\n // add title to each list item\n listItem.innerHTML = `<a class=\"nav_link\" data-nav=\"${section.id}\" href=\"#${section.id}\" id=\"link-${section.id}\">${section.dataset.nav}</a>`;\n\n // add list items to the unordered list with ID navbar__list\n navbarList.appendChild(listItem);\n });\n}", "title": "" }, { "docid": "486ed2292026619f00194459a01a23c9", "score": "0.6443919", "text": "navigation(sprint) {\n\n this.enableSourceBar();\n\n const nav = document.querySelectorAll('nav ul li a');\n nav.forEach( (button) => {\n button.addEventListener('click', (event) => {\n const element = event.target;\n const id = element.getAttribute('href').replace('#','');\n if (id === 'current') {\n this.displayCurrent(sprint);\n } else if (id === 'me') {\n this.displayMe();\n } else if (id === 'all') {\n this.displayAll();\n } else {\n this.tabs(id);\n }\n this.setMenuStatus(element, nav);\n });\n });\n\n }", "title": "" }, { "docid": "ede70cfcff309092ced55ceae467579f", "score": "0.64352536", "text": "function createNav(navItems) {\n\n}", "title": "" }, { "docid": "9343ecbdc7b03a7dffcdedba9e2f1ba7", "score": "0.6435079", "text": "function createNav() {\n const nav = $('.navigation ul');\n nav.html('');\n\n if (settings.isAuth) {\n nav.append(\n '<li class=\"nav-link translate\" data-target=\"#translate\">Add</li>' +\n '<li class=\"nav-link words-list\" data-target=\"#results\">My Words</li>' +\n '<li class=\"logout\">Logout</li>'\n );\n $('.nav-link.active').removeClass('active');\n $('.active-tab').removeClass('active-tab');\n $('.translate').addClass('active');\n $('#translate').addClass('active-tab');\n } else {\n nav.append('<li class=\"nav-link auth\" data-target=\"#auth-form\">Authentication</li>');\n $('.nav-link.active').removeClass('active');\n $('.active-tab').removeClass('active-tab');\n $('.auth').addClass('active');\n $('#auth-form').addClass('active-tab');\n }\n }", "title": "" }, { "docid": "438f8a06518b478d1bdb27a86116c5d6", "score": "0.6401149", "text": "function globalnav() {\n\tvar c = {\n\t\tcrClass: \"cr\",\n\t\tcrPostfix: \"_cr\",\n\t\thoverClass: \"on\",\n\t\thoverPostfix: \"_on\",\n\t\trootDir: \"\"\n\t};\n\t\n\tvar gnav = document.getElementById(\"global-nav\");\n\tif(!gnav) return;\n\tvar nav = gnav.getElementsByTagName(\"a\");\n\tfor (var i = 0, l = nav.length; i < l; i ++) setup(nav[i]);\n\t\n\tfunction setup(a) {\n\t\t\n\t\t/* debug code ------------------------------*\n\t\t\tdocument.getElementById(\"alpha\").appendChild(document.createTextNode(a.href));\n\t\t\tdocument.getElementById(\"alpha\").appendChild(document.createElement(\"br\"));\n\t\t*------------------------------ debug code */\n\t\t\n\t\tvar img = a.getElementsByTagName(\"img\")[0];\n\t\tif(img) {\n\t\t\timg.extPos = img.src.lastIndexOf(\".\");\n\t\t\timg.srcPath = img.src.substring(0, img.extPos);\n\t\t\timg.ext = img.src.substring(img.extPos, img.src.length);\n\t\t\t(new Image()).src = img.srcPath + c.crPostfix + img.ext;\n\t\t\t(new Image()).src = img.srcPath + c.hoverPostfix + img.ext;\n\t\t}\n\t\t\n\t\t\ta.fNamePos = a.href.lastIndexOf(\"/\") + 1;\n\t\t\ta.dirPath= a.href.substring(0, a.fNamePos);\n\t\t\t\n\t\t// 第1個連結目標為首頁\n\t\tc.rootDir = nav[0].dirPath;\n\t\t\n\t\tvar loc = location.href; // 非物件型別而是字串型別\n\t\tvar locDirPos = loc.lastIndexOf(\"/\") + 1;\n\t\tvar locDirPath = loc.substring(0, locDirPos);\n\t\t\n\t\tif(a.dirPath == c.rootDir) { // 前往首頁之連結的情況\n\t\t\tif(a.dirPath == locDirPath) {\n\t\t\t\tif(img) { img.src = img.srcPath + c.crPostfix + img.ext; }\n\t\t\t\ta.className += \" \" + c.crClass;\n\t\t\t}\n\t\t} else { // 首頁以外連結的情況\n\t\t\tif (loc.indexOf(a.href) != -1) {\n\t\t\t\tif(img) { img.src = img.srcPath + c.crPostfix + img.ext; }\n\t\t\t\ta.className += \" \" + c.crClass;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 製作滑鼠滑入反應的準備\n\t\tif(img)\t { img.orgSrc = img.src; }\n\t\ta.orgClassName = a.className;\n\t\t// 設定滑鼠滑入時的處理\n\t\ta.onmouseover = function() {\n\t\t\tif(img) { img.src = img.srcPath + c.hoverPostfix + img.ext; }\n\t\t\ta.className += \" \" + c.hoverClass;\n\t\t};\n\t\ta.onmouseout = function() {\n\t\t\tif(img) { img.src = img.orgSrc; }\n\t\t\ta.className = a.orgClassName;\n\t\t};\n\t}\n}", "title": "" }, { "docid": "078c2b0b56919b21cf79620b30d70642", "score": "0.6396803", "text": "function init() {\n createNavBar()\n scrolling()\n}", "title": "" }, { "docid": "36249293719e50ace4096f4f940f38f4", "score": "0.639129", "text": "function mkNavigator(self){\n var $nav = $(\"<ul class='nav nav-pills nav-stacked gray'></ul>\");\n self.navigator = $nav;\n \n $.each(self.app.modules, function(i, module){\n var title = module_title(module);\n \n var nav_entry = $(\"<li></li>\"); \n $nav.append(nav_entry);\n nav_entry[0]._index = i;\n \n var link = $(\"<a><span class='multied-entry-text'>\"+title+\"</span></a>\");\n nav_entry.append(link);\n \n link[0].onclick = function(){\n activate(self, i);\n };\n \n });\n \n self.tag.find(\"[data-name='navigator']\").html($nav);\n \n activate(self, self.app.current_module);\n return $nav;\n }", "title": "" }, { "docid": "8da15d46e08665fbee87a91446906062", "score": "0.63852364", "text": "function navBuilder() {\n const nav = document.getElementById('navbar__list');\n\n for (let i = 0; i < all_sections.length; i++) {\n let li = NewNavList(i);\n if (i == 0) {\n SelectNavLink(li);\n }\n nav.appendChild(li);\n }\n}", "title": "" }, { "docid": "17816bd822b7b26bdb672d820ab0fa65", "score": "0.63821936", "text": "function mk_main_nav_scroll() {\n\n var lastId, topMenu = $(\".main-navigation-ul, .mk-responsive-nav\"),\n menuItems = topMenu.find(\".menu-item a\"),\n headerHeight = ken.modules.header.calcHeight(),\n href;\n\n menuItems.each(function() {\n var href_attr = $(this).attr('href');\n if (typeof href_attr !== 'undefined' && href_attr !== false) {\n href = href_attr.split('#')[0];\n if(typeof href_attr.split('#')[1] !== 'undefined' && href_attr.split('#')[1].length) {\n $(this).addClass(\"one-page-nav-item\");\n }\n } else {\n href = \"\";\n }\n\n if (href === window.location.href.split('#')[0] && (typeof $(this).attr(\"href\").split('#')[1] !== 'undefined') && href !== \"\") {\n\n $(this).attr(\"href\", \"#\" + $(this).attr(\"href\").split('#')[1]);\n $(this).parent().removeClass(\"current-menu-item\");\n }\n });\n\n var onePageMenuItems = $('.one-page-nav-item');\n\n var scrollItems = onePageMenuItems.map(function() {\n var item = $(this).attr(\"href\");\n\n if (/^#\\w/.test(item) && $(item).length) {\n return $(item);\n }\n });\n\n\n topMenu.on('click', '.one-page-nav-item', function(e) {\n var href = $(this).attr(\"href\");\n if (typeof $(href).offset() !== 'undefined') {\n var href_top = $(href).offset().top;\n } else {\n var href_top = 0;\n }\n\n if($(window).width() < mk_nav_res_width) {\n headerHeight = 0;\n }\n\n var offsetTop = href === \"#\" ? 0 : href_top - (headerHeight + 2);\n\n /*\n * We need to trigger click as it will close menu and pass another event 'mk-closed-nav' which will unlock scrolling\n * blocked by edge one pager\n */\n if($.exists('.responsive-nav-link.active-burger')) {\n $('.responsive-nav-link.active-burger').trigger('click');\n }\n\n console.log(offsetTop)\n\n $('html, body').stop().animate({\n scrollTop: offsetTop\n }, {\n duration: 1200,\n easing: \"easeInOutExpo\"\n });\n\n e.preventDefault();\n });\n\n\n var fromTop;\n var animationSet = function() {\n\n if (!scrollItems.length) {\n return false;\n }\n\n fromTop = scrollY + (headerHeight + 10);\n\n var cur = scrollItems.map(function() {\n if ($(this).offset().top < fromTop) { \n return this;\n }\n });\n //console.log(cur);\n cur = cur[cur.length - 1];\n var id = cur && cur.length ? cur[0].id : \"\";\n\n if (lastId !== id) {\n lastId = id;\n\n console.log(fromTop);\n\n onePageMenuItems.parent().removeClass(\"current-menu-item\");\n //console.log(id);\n if (id.length) {\n onePageMenuItems.filter(\"[href=#\" + id + \"]\").parent().addClass(\"current-menu-item\");\n //console.log(id);\n }\n }\n };\n $(window).scroll(animationSet)\n // debouncedScrollAnimations.add(animationSet);\n }", "title": "" }, { "docid": "2885f34f3fcfda10501f454892ff757d", "score": "0.63818103", "text": "function createNav() {\n let navString = \"\";\n let filterArticles = articles.filter((article => article.title !== \"Undefined\"));\n let sortedArticlesByCat = sortArticlesByCategory(filterArticles);\n let categoryIndex = 0;\n navString += \"<li class=\\\"lsg_nav__item\\\"><a class=\\\"lsg_link__head\\\" href=\\\"#Intro\\\">Intro</a></li>\";\n sortedArticlesByCat.forEach((arr) => {\n navString += createNavSubList(arr, categories[categoryIndex]) + \"\\n\";\n categoryIndex++;\n })\n\n return navString;\n}", "title": "" }, { "docid": "f9f24cfbf372db45537735f4b26d96f1", "score": "0.637719", "text": "function OnNav() {\n var elNav = document.querySelector('.nav-bar');\n elNav.addEventListener('click', NavigateToPage);\n //relevant for future develop \n // const elGallery = document.querySelector('.gallery');\n // const elMemes = document.querySelector('.memes');\n // const elAbout = document.querySelector('.about-modal');\n const elEditor = document.querySelector('.meme-editor');\n elEditor.classList.add('hide');\n //relevant for future develop\n // elMemes.hidden = true;\n // elAbout.hidden = true;\n // elGallery.hidden = false;\n}", "title": "" }, { "docid": "8bdb5154161c51ffc39d325bf2e32dda", "score": "0.6367466", "text": "function drawNavBar(){\n var navbar = '';\n navbar += '<nav class=\"navbar navbar-expand-lg navbar-light\">';\n navbar += '<a class=\"navbar-brand\" href=\"index.html\"><img src=\"images/Logo_header.png\" alt=\"Housepal Logo\"></a>';\n navbar += '<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">';\n navbar += '<span class=\"navbar-toggler-icon\"></span>';\n navbar += '</button>';\n navbar += '<div class=\"collapse navbar-collapse\" id=\"navbarNav\">';\n navbar += '<ul class=\"navbar-nav left-nav\">';\n navbar += '<li class=\"nav-item\">';\n navbar += '<a class=\"nav-link\" href=\"index.html\">Home</a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"listings.html\">Listings</a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"aboutUs.html\">About Us</a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"testimonials.html\">Testimonials</a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"contact.html\">Contact</a>';\n navbar += '</li>';\n navbar += '</ul>';\n navbar += '<ul class=\"navbar-nav media-nav\">';\n navbar += '<li class=\"nav-item dropdown\">';\n navbar += '<a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"favouriteShortcuts\" aria-label=\"View your favourite properties\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">';\n navbar += '<i class=\"fa fa-heart fa-2x\" aria-hidden=\"true\">';\n navbar += '<span class=\"fa fa-circle\"></span>';\n navbar += '<span class=\"num\">0</span>';\n navbar += '</i></a>';\n navbar += '<div class=\"dropdown-menu\" aria-labelledby=\"favouriteShortcuts\">';\n navbar += '<a class=\"dropdown-item\" id=\"no-favourites\" style=\"display: none;\" href=\"#\">No favourites have been added.</a>';\n navbar += '</div>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"https://en-gb.facebook.com/\" aria-label=\"Facebook link\" target=\"_blank\"><i class=\"fa fa-facebook-square fa-2x\" aria-hidden=\"true\"></i></a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"https://www.instagram.com/\" aria-label=\"Instagram link\" target=\"_blank\"><i class=\"fa fa-instagram fa-2x\" aria-hidden=\"true\"></i></a>';\n navbar += '</li>';\n navbar += '<li class=\"nav-item ml-4\">';\n navbar += '<a class=\"nav-link\" href=\"https://twitter.com/login?lang=en-gb\" aria-label=\"Twitter link\" target=\"_blank\"><i class=\"fa fa-twitter fa-2x\" aria-hidden=\"true\"></i></a>';\n navbar += '</li>';\n navbar += '</ul>';\n navbar += '</div>';\n navbar += '</nav>';\n\n $(\"#navbar-frame\").html(navbar);\n\n var id = location.pathname.split('/').slice(-1)[0];\n $('a[href=\\'' + id + '\\']').addClass(\"active\"); //find the link for the active page and set active css class\n\n var favProperties = localStorage.getItem('favProperties'); \n\n // Check if any favourite properties have been stored in browser\n if (favProperties == null || favProperties.length < 1) {\n return;\n }else{\n // if we get here, favourite properties exists so populate the dropdown\n $(JSON.parse(favProperties)).each(function () {\n $('#no-favourites').after('<a class=\"dropdown-item fav-property\" data-fave-id=\"' + this.Id + '\" href=\"singleListing.html?id=' + this.Id + '\">' + this.Address +'</a>');\n });\n }\n\n // finally display no favourites if needed and populate number with favourites count\n $('.fav-property').length > 0 ? $('#no-favourites').hide() : $('#no-favourites').show();\n $('.num').text($('.fav-property').length);\n}", "title": "" }, { "docid": "e324b91eba64ecf0f02d8ad2043daafb", "score": "0.634654", "text": "function buildNavigation () {\n const parentEl = navEl.parentElement;\n const tocLinks = navEl.querySelectorAll('a.toc_link');\n const scrollTopTrigger = navEl.querySelector(baseSelector + '__scroll-top ' + triggerSelector);\n const tocTrigger = navEl.querySelector(baseSelector + '__toc ' + triggerSelector);\n const socialTrigger = navEl.querySelector(baseSelector + '__social-icons ' + triggerSelector);\n const defaultVariant = window.AnchorNavigation.settings.breakpoints[0].display;\n const defaultSetting = window.AnchorNavigation.settings.displaySettings[defaultVariant];\n const inlineAnchorNavEl = document.querySelector('.anchor-navigation--block')\n\n window.AnchorNavigation.overlayElement = document.createElement('div');\n\n // Build a wrapper element around the navigation\n const wrapperElement = document.createElement('div');\n wrapperElement.classList.add(componentName + '__wrapper')\n // Insert the wrapper in the parent element\n parentEl.appendChild(wrapperElement);\n // Move the navigation to the wrapper\n wrapperElement.appendChild(navEl);\n\n window.addEventListener('resize', (event) => {\n displayVariant(window.innerWidth);\n });\n\n displayVariant(window.innerWidth);\n\n parentEl.classList.add('anchor-navigation-tether');\n navEl.style.color = window.AnchorNavigation.settings.highlightColor;\n\n window.AnchorNavigation.overlayElement.classList.add('anchor-navigation-overlay');\n window.AnchorNavigation.overlayElement.addEventListener('click', () => {\n closeChildMenu(tocTrigger);\n closeChildMenu(socialTrigger);\n });\n\n Array.from(tocLinks).forEach(link => {\n link.addEventListener('click', (event) => {\n event.preventDefault();\n const destinationElId = event.target.href.split('#')[1];\n const target = document.querySelector('#' + destinationElId);\n\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n top: target.getBoundingClientRect().top + window.pageYOffset,\n behavior: 'smooth',\n });\n }\n else {\n window.scrollTo(0, target.getBoundingClientRect().top + window.pageYOffset);\n }\n\n closeChildMenu(tocTrigger);\n });\n });\n\n if (tocTrigger) {\n tocTrigger.addEventListener('click', (event) => {\n event.preventDefault();\n\n if (menuIsOpen(tocTrigger)) {\n closeChildMenu(tocTrigger);\n }\n else {\n closeChildMenu(socialTrigger);\n openChildMenu(tocTrigger);\n }\n });\n }\n\n if (socialTrigger) {\n socialTrigger.addEventListener('click', (event) => {\n event.preventDefault();\n\n if (menuIsOpen(socialTrigger)) {\n closeChildMenu(socialTrigger);\n }\n else {\n closeChildMenu(tocTrigger);\n openChildMenu(socialTrigger);\n }\n });\n }\n\n if (scrollTopTrigger) {\n scrollTopTrigger.addEventListener('click', (event) => {\n event.preventDefault();\n const parentBoundings = parentEl.getBoundingClientRect();\n const destination = (parentBoundings.y + window.pageYOffset) - (window.innerHeight / 7);\n\n closeChildMenu(socialTrigger);\n closeChildMenu(tocTrigger);\n\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n top: destination,\n behavior: 'smooth',\n });\n }\n else {\n window.scrollTo(0, destination);\n }\n })\n }\n\n if (tocTrigger && inlineAnchorNavEl && window.IntersectionObserver) {\n const observer = new IntersectionObserver (\n (els) => {\n if (els[0].intersectionRatio > 0) {\n tocTrigger.dataset.originalWidth = tocTrigger.dataset.originalWidth || tocTrigger.offsetWidth\n tocTrigger.style.maxWidth = 0\n tocTrigger.classList.add('collapsed')\n } else {\n tocTrigger.style.maxWidth = `${tocTrigger.dataset.originalWidth}px`;\n tocTrigger.classList.remove('collapsed')\n }\n },\n {\n rootMargin: '50px 0px',\n threshold: 0.01,\n }\n )\n observer.observe(inlineAnchorNavEl)\n }\n}", "title": "" }, { "docid": "4fc7903bf87a0318614f21984be9e68f", "score": "0.6334632", "text": "function navClicks () {\n checkoutProjectsClick()\n navItemClicks()\n burgerClick()\n menuClick()\n}", "title": "" }, { "docid": "7e16992365f90977052ae9ce41720dbe", "score": "0.63325745", "text": "function navBuilder () {\n // a for...of loop to loop over all the sections and create <li> for each\n for (const section of sections) { \n \n const listItem = document.createElement('li');\n\n //get the attribute of data-nav to define each section name\n const sectionName = section.getAttribute('data-nav');\n \n // adding the content of lit item element\n listItem.innerHTML= `<a href= \"#${section.id}\" class= \"menu__link\" id = \"${section.id}\">${sectionName}</a>`;\n \n // adding a (click) event listener to listItem to apply the smooth scroll\n listItem.addEventListener(\"click\", function(event) { \n event.preventDefault();\n section.scrollIntoView({behavior: \"smooth\", block: \"center\"});\n });\n \n //appending the listItem to docFragment to enhance the performance\n docFragment.appendChild(listItem);\n };\n //append the fragment to the menu variable to add its content to the page\n menu.appendChild(docFragment);\n}", "title": "" }, { "docid": "71f3489890148bf487d94374519f1c25", "score": "0.63001853", "text": "function navClicks() {\n checkoutProjectsClick();\n navItemClicks();\n burgerClick();\n menuClick();\n}", "title": "" }, { "docid": "ff431632e1a1bbd8fa4659c90028eef9", "score": "0.62901783", "text": "function Navigator() {}", "title": "" }, { "docid": "ff431632e1a1bbd8fa4659c90028eef9", "score": "0.62901783", "text": "function Navigator() {}", "title": "" }, { "docid": "af3637c7bfd1f40e9fcf8f44e186773f", "score": "0.6287934", "text": "function updateNavigation() {\n /* First we check for the existence of the mobileNav component.\n * We check for either the bare mobileNav name, or the the\n * CDE-style render_mobileNav name.\n * If it doesn't exist, we just hide the navigation pull-down.\n */\n var navComponent = window.mobileNav || window.render_mobileNav;\n if (!navComponent) {\n _navSelector.hide();\n return;\n }\n /* \n */\n var dashboardList = navComponent.navList();\n\n }", "title": "" }, { "docid": "87f6116ee805adbdac75113da2966255", "score": "0.6280701", "text": "function buildNav() {\n\t/** Using regular for loop instead of foreach()\n\t * to loop over each section in the document\n\t * because Not all browsers support the .forEach() method\n\t */\n\t// for (let i = 0; i < sec_list.length; i++) {\n\t// console.log(sec_list[i].id)\n\t// console.log(sec_list[i].dataset.nav);\n\t//let li_txt = document.createTextNode(sec_list[i].dataset.nav);\n\t//li_item.appendChild(li_txt);\n\t//li_item.textContent = sec_list[i].dataset.nav;\n\t// \tlet new_li = '<li><a class=\\'menu__link\\' href=\\'#' + sec_list[i].id + '\\'>' + sec_list[i].dataset.nav + '</a></li>';\n\t// \tnavbar.insertAdjacentHTML('beforeend', new_li);\n\n\t// }\n\tsec_list.forEach(sec => {\n\t\tconst new_li = '<li><a class=\\'menu__link\\' href=\\'#' + sec.id + '\\'>' + sec.dataset.nav + '</a></li>';\n\t\tnavbar.insertAdjacentHTML('beforeend', new_li);\n\n\t});\n}", "title": "" }, { "docid": "d164f1027b00318abdc67a64ddd85bc6", "score": "0.62772167", "text": "setupNav(){\n let self = this;\n \n this.btnTrivia.onclick = function(e) {\n self.menuScreen.style.display = 'none';\n self.triviaScreen.style.display = 'inline';\n self.birthdayScreen.style.display = 'none'; \n }\n \n this.btnBirthday.onclick = function(e) {\n self.menuScreen.style.display = 'none';\n self.triviaScreen.style.display = 'none';\n self.birthdayScreen.style.display = 'inline'; \n }\n \n document.onkeypress = function(evt) {\n if(evt.key === 'back' && self.menuScreen.style.display === 'none' ){\n self.menuScreen.style.display = 'inline';\n self.triviaScreen.style.display = 'none';\n self.birthdayScreen.style.display = 'none'; \n evt.preventDefault();\n }\n } \n }", "title": "" }, { "docid": "af69e66e3cd46ea3ce4220a6ee76f2a9", "score": "0.6271342", "text": "function navFn(){\n var navBar =[\n { displayName:\"Home\",\n routeName:'home',\n templateUrl:\"app/templates/home.html\"},\n { displayName:\"Contact\",\n routeName:'contact',\n templateUrl:\"app/templates/contact.html\"},\n {displayName:\"Register\",\n routeName:'register',\n templateUrl:\"app/templates/register.html\"},\n {displayName:\"About us\",\n routeName:\"about\",\n templateUrl:\"app/templates/about.html\"},\n {displayName:\"Login\",\n routeName:\"login\",\n templateUrl:\"app/templates/login.html\"},\n {displayName:\"Order\",\n routeName:\"order\",\n templateUrl:\"app/templates/order.html\"}\n ];\n return{\n getNavigationItems:function(){\n return navBar;\n }\n }\n}", "title": "" }, { "docid": "9403fc11e36ffcb27253819f971731ee", "score": "0.6255103", "text": "function mainNavigationAction(){\n\t\t\t\tvar $activeLinks = $links.filter('.active');\n\t\t\t\tif ( $activeLinks.length > 0 ){\n\t\t\t\t\t$activeLinks.each(function(){\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tvar page = $this.data().page;\n\t\t\t\t\t\tvar $contentWrapper = $this.closest('.the1panel-tabcontent').find('.options-pages');\n\t\t\t\t\t\t$contentWrapper.find('.page').hide().filter('.'+page).show();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "ac0c978671d551b063efee25f58deabc", "score": "0.62539274", "text": "function navInit() {\n\n\t//store fixed value for menu top position\n\t$j(\"#nav\").data(\"top\", $j(\"#nav\").offset().top);\n\t\n\t//bind class hovermenu to hover status\n\t$j( \".menu-primary\" ).hover(\n \t\tfunction() {\n \t\t$j( this ).addClass( \"hovermenu\" );\n \t\t}, function() {\n \t\t$j( this ).removeClass( \"hovermenu\" );\n \t\t}\n \t);\n \t\n \t//remove class hovermenu on window scroll\n \t$j( window ).scroll(function() {\n\t\t$j( \".menu-primary\" ).removeClass( \"hovermenu\" );\n\t});\n\t\n\t//toggle class hovermenu on click\n\t$j( \".menu-primary\" ).click(function() {\n \t\t$j( this ).toggleClass( \"hovermenu\" );\n \t});\n \t\n \t//bind fixDiv() to window scroll; enables fixed topnav\n \t$j(window).scroll(fixDiv);\n \t\n \t//add active class to items pointing to current subdomain (not counting www)\n// \tactivateSubdomainNavItems();\n\t\n} //end navInit()", "title": "" }, { "docid": "b0b12185dff0107e6d7c0c01e5732db0", "score": "0.6250852", "text": "function mainPage() {\n //Need to clear dataStr again in case we already collected data since the last full refresh\n dataStr = '';\n \n //We want a different table element depending on if this is a partial refresh or not\n var partialLoad = false;\n if (document.getElementById('navareatransition')) {partialLoad = true;} \n var navTable;\n if (partialLoad) {\n navTable = document.getElementById('navareatransition');\n } else {\n navTable = document.getElementById('navarea');\n }\n\n //Find the sector, coords, and tile id. If necessary trim away links (such as if QI Augmenter executes first and makes the coordinates a link to a map).\n var sector = document.getElementById(\"sector\").innerHTML;\n if (sector.indexOf(\"<\") > -1) {\n sector = document.getElementById(\"sector\").firstChild.innerHTML;\n }\n var coords = document.getElementById(\"coords\").innerHTML;\n if (coords.indexOf(\"<\") > -1) {\n coords = document.getElementById(\"coords\").firstChild.innerHTML;\n }\n var userLoc = unsafeWindow.userloc;\n \n if (document.body.innerHTML.indexOf('Exit inner starbase') > -1) {\n \n //We're inside a SB, so record the different SB buildings we can see and their locations.\n\n addIdAndSectorAndCoordsToDataStr();\n\n //Since we're in a SB, the \"sector\" name is really the SB name.\n var baseName = sector;\n addToDataStr(nameEntry, baseName); \n \n //Define abbreviations for the lengthy SB building names\n var abbreviations = {\n 'Armor Factory' : 'Armor',\n 'Shield Factory' : 'Shield',\n 'Engines Factory' : 'Drive',\n 'Weapons Factory' : 'Weapon',\n 'Special Equipment Factory' : 'Special',\n 'Shipyard (small)' : 'Sml Ship',\n 'Shipyard (medium)' : 'Med Ship',\n 'Shipyard (huge)' : 'Huge Ship',\n 'Light Defense Artillery' : 'LDA',\n 'Standard Defense Artillery' : 'SDA',\n 'Heavy Defense Artillery' : 'HDA',\n 'Repair Facility' : 'Repair',\n 'Warehouse' : 'Warehouse',\n 'Short Range Scanner' : 'SRS'\n };\n \n var coordsArray = coords.replace(/\\[|\\]/g,'').split(',');\n var xShip = parseInt(coordsArray[0]);\n var yShip = parseInt(coordsArray[1]);\n var topLeftID = userLoc - 13*xShip - yShip; //Inner SB is a 13x13 grid.\n \n //First record all buildings in view. \n var buildings = navTable.getElementsByClassName('navBuilding');\n var tileID, xBuild, yBuild, buildingCoords, buildingName;\n for (var i=0; i<buildings.length; i++) {\n //Figure out building coords by comparing its tile id to the top left id to figure out its relative position.\n tileID = parseInt(buildings[i].firstChild.getAttribute(\"onclick\").match(/\\d+/)[0]);\n xBuild = Math.floor( (tileID - topLeftID)/13 );\n yBuild = (tileID - 13*xBuild) - topLeftID;\n buildingCoords = xBuild + ',' + yBuild;\n //If it's one of the player-made SB buildings (i.e. not a hab ring or CC), record the building type.\n if (sbBuildingsEntry[buildingCoords]) {\n buildingName = buildings[i].firstChild.firstChild.getAttribute('title');\n buildingName = abbreviations[buildingName];\n addToDataStr(sbBuildingsEntry[buildingCoords],buildingName);\n }\n }\n \n //Next, record any empty building slots in view.\n var notBuildings = navTable.getElementsByClassName('navClear');\n var tileID, xCoord, yCoord, tileCoords, tileType, image;\n for (var i=0; i<notBuildings.length; i++) {\n //Check if the background image matches an empty slot.\n image = notBuildings[i].firstChild.firstChild.src;\n if (image.indexOf('ground_hor') > -1 || image.indexOf('ground_ver') > -1) {\n //Figure out tile coords by comparing its tile id to the top left id to figure out its relative position.\n tileID = parseInt(notBuildings[i].firstChild.getAttribute(\"onclick\").match(/\\d+/)[0]);\n xCoord = Math.floor( (tileID - topLeftID)/13 );\n yCoord = (tileID - 13*xCoord) - topLeftID;\n tileCoords = xCoord + ',' + yCoord;\n addToDataStr(sbBuildingsEntry[tileCoords],'Empty');\n }\n }\n //We have to check if our ship is on an empty building slot seperately.\n if (navTable.getElementsByClassName('navShip')[0]) {\n var ourTile = navTable.getElementsByClassName('navShip')[0];\n //Check if the background image matches an empty slot.\n image = ourTile.getAttribute('style');\n if (image.indexOf('ground_hor') > -1 || image.indexOf('ground_ver') > -1) {\n tileCoords = xShip + ',' + yShip;\n addToDataStr(sbBuildingsEntry[tileCoords],'Empty');\n }\n }\n \n //Finally, if we can see the end of any pylon, then we know how many rings there are and thus the outer rings have no slots available.\n var tileID, xCoord, yCoord, tileCoords, tileType, image;\n var foundEnd = false; //Have we found the end of a pylon yet? (Only need to find one.)\n for (var i=0; i<notBuildings.length; i++) {\n //Check if the background image matches the end of a pylon.\n image = notBuildings[i].firstChild.firstChild.src;\n if (image.indexOf('groundend') > -1) {\n //Figure out tile coords by comparing its tile id to the top left id to figure out its relative position.\n tileID = parseInt(notBuildings[i].firstChild.getAttribute(\"onclick\").match(/\\d+/)[0]);\n xCoord = Math.floor( (tileID - topLeftID)/13 );\n yCoord = (tileID - 13*xCoord) - topLeftID;\n foundEnd = true;\n break; //Every end of pylon gives us the same info, so no need to look for more.\n }\n }\n if (!foundEnd) {\n \n //We have not found the end of a pylon yet. Last place to check is under the ship!\n var ourTile = navTable.getElementsByClassName('navShip')[0];\n //Check if the background image matches the end of a pylon.\n image = ourTile.getAttribute('style');\n if (image.indexOf('groundend') > -1) {\n xCoord = xShip;\n yCoord = yShip;\n foundEnd = true;\n }\n } \n \n //Based on the coordinates of the pylon ending we found, we know certain rings do no exist.\n if (foundEnd) {\n if (xCoord + yCoord >= 9 && xCoord + yCoord <= 15) {\n //No second ring.\n addToDataStr(sbBuildingsEntry['6,3'],'-');\n addToDataStr(sbBuildingsEntry['9,6'],'-');\n addToDataStr(sbBuildingsEntry['6,9'],'-');\n addToDataStr(sbBuildingsEntry['3,6'],'-');\n }\n if (xCoord + yCoord >= 8 && xCoord + yCoord <= 16) {\n //No third ring.\n addToDataStr(sbBuildingsEntry['6,2'],'-');\n addToDataStr(sbBuildingsEntry['10,6'],'-');\n addToDataStr(sbBuildingsEntry['6,10'],'-');\n addToDataStr(sbBuildingsEntry['2,6'],'-');\n }\n if (xCoord + yCoord >= 7 && xCoord + yCoord <= 17) {\n //No fourth ring.\n addToDataStr(sbBuildingsEntry['6,1'],'-');\n addToDataStr(sbBuildingsEntry['11,6'],'-');\n addToDataStr(sbBuildingsEntry['6,11'],'-');\n addToDataStr(sbBuildingsEntry['1,6'],'-');\n }\n }\n \n sendData();\n \n } else {\n //We're not in a SB, so just record the sector, coords, and tile id in a local variable.\n GM_setValue(\"currentSector\",sector);\n GM_setValue(\"currentCoords\",coords);\n GM_setValue(\"currentuserLoc\",userLoc);\n }\n }", "title": "" }, { "docid": "df7bce40d53d58f7a066f596de0779c9", "score": "0.6250687", "text": "function _renderNav(){\n \n var _this = this;\n var ul = $('<ul class=\"navbar-nav\"></ul>');\n $('#navBarMain').append(ul);\n $.each(this.navArray, function( index, value ) {\n //console.log( index + \": \" + value.label );\n\n var nav_link_class = 'nav-link';\n if (DisplayGlobals_SRV.getArguments().platform == 'buzzradar') {\n nav_link_class += ' br';\n }\n\n ul.append('<li class=\"nav-item perso-insights-navitem\"><a class=\"'+nav_link_class+'\" href=\"#\" data-slug=\"'+value.slug+'\" data-targetdomid=\"'+value.targetDomId+'\" data-url=\"'+value.url+'\">'+value.label+'</a></li>');\n });\n\n\n $('.perso-insights-navitem > a').click(function(e){\n $('#navBarMain').collapse('hide');\n e.preventDefault();\n var slug = $(this).data('slug');\n var targetdomid = $(this).data('targetdomid');\n var url = $(this).data('url');\n if (targetdomid){\n\n if (slug === 'bookmeeting'){\n\n Calendly.showPopupWidget('https://calendly.com/buzzradar/introduction-meeting');\n return false;\n\n }else{\n \n if ( $('#result').hasClass('show') ) {\n $('#result').collapse(\"hide\")\n setTimeout(function(){\n _openPopup.call(_this); \n },750);\n }else{\n console.log(this)\n _openPopup.call(_this);\n }\n\n }\n\n }else{\n console.log(\"loading external URL ->\", url);\n window.open(url);\n }\n\n // trackGAEvent('event','Navigation','clicked', slug);\n\n });\n\n}", "title": "" }, { "docid": "f8a0cfed2536286610557eff7cdf031f", "score": "0.62380606", "text": "function createNavigation() {\n\n// The buttons themselves\n var leftArrow = $('<div class=\"leftBtn slideBtn hide1\">');\n var rightArrow = $('<div class=\"rightBtn slideBtn hide1\">');\n// Arrows for the buttons\n var nextPointer = $('<span class=\"pointer next\"></span>');\n var prevPointer = $('<span class=\"pointer previous\"></span>');\n\n prevPointer.appendTo(leftArrow);\n nextPointer.appendTo(rightArrow);\n\n leftArrow.appendTo(helpdiv);\n rightArrow.appendTo(helpdiv);\n }", "title": "" }, { "docid": "74d1dddd8925ccaff4f835e13444b2a2", "score": "0.6236121", "text": "_navigationMenu() {\n let header_menu_div = document.getElementById('header_menu_div');\n this._clearChilds(header_menu_div);\n let nav_menu = document.createElement('ul');\n nav_menu.classList.add('states-menu-ul');\n let summary_li = document.createElement('li');\n summary_li.id = 'summary_li';\n summary_li.textContent = 'RESUMEN';\n summary_li.classList.add('states-menu-li','states-menu-li-sel');\n summary_li.addEventListener('click', event => {\n summary_li.classList.add('states-menu-li-sel');\n states_li.classList.remove('states-menu-li-sel');\n progress_li.classList.remove('states-menu-li-sel');\n summary_div.style.display = 'inherit';\n progress_div.style.display = 'none';\n states_div.style.display = 'none';\n });\n let progress_li = document.createElement('li');\n progress_li.id = 'progress_li';\n progress_li.textContent = 'PROGRESO';\n progress_li.classList.add('states-menu-li');\n progress_li.addEventListener('click', event => {\n progress_li.classList.add('states-menu-li-sel');\n summary_li.classList.remove('states-menu-li-sel');\n states_li.classList.remove('states-menu-li-sel');\n progress_div.style.display = 'inherit';\n states_div.style.display = 'none';\n summary_div.style.display = 'none';\n });\n let states_li = document.createElement('li');\n states_li.id = 'states_li';\n states_li.textContent = 'ESTADOS';\n states_li.classList.add('states-menu-li');\n states_li.addEventListener('click', event => {\n states_li.classList.add('states-menu-li-sel');\n summary_li.classList.remove('states-menu-li-sel');\n progress_li.classList.remove('states-menu-li-sel');\n states_div.style.display = 'inherit';\n progress_div.style.display = 'none';\n summary_div.style.display = 'none';\n }); \n this._append(nav_menu, [summary_li, progress_li, states_li]);\n header_menu_div.appendChild(nav_menu);\n }", "title": "" }, { "docid": "e9c7eab2605eb415d90042772d0ec5f3", "score": "0.62341136", "text": "setupNav() {\n this.router.on({}, () => {\n try {this.editor.remove();} catch(e) {console.log(e);}\n $('.content>div').attr('hidden', '');\n $('.content>iframe').css('display', 'block');\n });\n this.router.on({'page': 'week1'}, () => {\n this.changePage('http://mikewhitfield.org/javascript-week-1/');\n });\n this.router.on({'page': 'week2'}, () => {\n this.changePage('http://mikewhitfield.org/javascript-week-2/');\n });\n this.router.on({'page': 'week3-4'}, () => {\n this.changePage('http://mikewhitfield.org/javascript-week-3-4');\n });\n this.router.on({'page': 'week5-6'}, () => {\n this.changePage('http://mikewhitfield.org/javascript-week-5-6');\n });\n }", "title": "" }, { "docid": "c8854a6d2a296fbd577a542444a98451", "score": "0.6233165", "text": "function toogleNavBar() {\n if (navBarIsOpened()) {\n closeNavBar();\n } else {\n openNavBar();\n }\n }", "title": "" }, { "docid": "4d2dd8797e88796ea260d3cc8f7bc2fd", "score": "0.62266576", "text": "function setup(){\n loadNavBar();\n}", "title": "" }, { "docid": "3f49fb0c8487e53c8e3e1f74ff1eca23", "score": "0.6226605", "text": "function navAnimation(){\n\t\t\t\t//If window scroll top is bigger than 800 we animate the navigation to be always on top\n\t\t\t\tif($(window).scrollTop() > 800 ){\n\t\t\t\t\tif( $init == 1 ){\n\n\t\t\t\t\t\t$navi.css({'position': 'fixed','margin-top': -160 +'px'});\n\t\t\t\t\t\t$navi.stop().animate({'margin-top': 0 +'px' }, 500);\n\t\t\t\t\t\t$init = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif( $initt == 1 ){\n\t\t\t\t\t\t\t//Adds the white background\n\t\t\t\t\t\t\t$navi.addClass('navbg');\n\n\n\n\t\t\t\t\t\t\t//Adds dark logo\n\t\t\t\t\t\t\t$logoWhite.addClass('dark').removeClass('white');\n\n\t\t\t\t\t\t\t//If navigation is darkchealkk make logo white\n\t\t\t\t\t\t\tif( $navi.hasClass('darkchealk') ){\n\t\t\t\t\t\t\t\t$logoDark.addClass('white').removeClass('dark');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$initt = 0;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If window scroll top is NOT bigger than 800\n\t\t\t\telse {\n\t\t\t\t\t//This hides the small fixed nav and executes only once\n\t\t\t\t\tif( $init == 0 ){\n\n\t\t\t\t\t\t$navi.stop().animate({'margin-top': -160 +'px'}, 500);\n\n\t\t\t\t\t\t$init = 1;\n\t\t\t\t\t\t$initt = 1;\n\t\t\t\t\t\t$exonce = 1;\n\n\t\t\t\t\t\t//Adds white logo\n\t\t\t\t\t\t$logoDark.addClass('white').removeClass('dark');\n\n\t\t\t\t\t\t//Remove the background\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t$navi.removeClass('navbg');\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t\t// $(window).trigger('resize');\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif( $(window).scrollTop() < 160 ){\n\t\t\t\t\tif( $exonce == 1 ){\n\t\t\t\t\t\t$navi.stop();\n\t\t\t\t\t\t//Here we check the nav margintop depending on the screen\n\t\t\t\t\t\tif( $iw < 970 ){\n\t\t\t\t\t\t\t$navi.css({'position': 'absolute','margin-top': 0 +'px'});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( $iw > 970 ){\n\t\t\t\t\t\t\t$navi.css({'position': 'absolute','margin-top': 60 +'px'});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$exonce = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "f73b335c3f79e8aca05f5f557a4a7dfa", "score": "0.6225531", "text": "function Start()\n {\n let projects = document.getElementById(\"Products\");\n projects.firstChild.lastChild.textContent = \" Projects\";\n\n //putting the human resorces on the nav bar \n let humanResources = projects.cloneNode(true);\n let contact = document.getElementById(\"Contact Us\");\n //inserts the node into nav bar\n contact.parentNode.insertBefore(humanResources, contact);\n //sets the text to Human resources\n humanResources.firstChild.lastChild.textContent = \" Human Resources\";\n //changes the icon\n humanResources.firstChild.firstChild.setAttribute(\"class\",\"fas fa-user-alt\")\n //changes id so it is not the same as the one that was clonned\n humanResources.setAttribute(\"id\", \"Human Resources\");\n\n //sets variables s=to hold all new tags \n let nav = document.createElement(\"nav\");\n let anchor = document.createElement(\"a\");\n let main = document.getElementById(\"Main Nav\");\n let body = document.getElementById(\"body\")\n\n //sets all the needed attrivutes\n nav.setAttribute(\"class\",\"navbar fixed-bottom navbar-dark bg-dark\");\n anchor.setAttribute(\"class\",\"navbar-brand\");\n anchor.textContent = \"\\u00A9 Copyright 2020\";\n\n //appends the anchor to the nav\n nav.appendChild(anchor);\n\n //inserts the nav \n body.insertBefore(nav, main);\n\n }", "title": "" }, { "docid": "16c7f0bd309e516bb338036df1d52f1c", "score": "0.62108475", "text": "function Navigation () {\n // information about each level of the navigation\n this.navigationLevels = {\n Women: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n },\n Footwear: {\n One: \"#one\",\n Two: \"#two\"\n },\n Brands: {\n One: \"#one\",\n Two: \"#two\"\n },\n Collections: {\n One: \"#one\",\n Two: \"#two\"\n },\n Offers: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n Men: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n },\n Footwear: {\n One: \"#one\",\n Two: \"#two\"\n },\n Brands: {\n One: \"#one\",\n Two: \"#two\"\n },\n Collections: {\n One: \"#one\",\n Two: \"#two\"\n },\n Offers: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n Boys: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n },\n School: {\n One: \"#one\",\n Two: \"#two\"\n },\n Collections: {\n One: \"#one\",\n Two: \"#two\"\n },\n Offers: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n Girls: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n },\n School: {\n One: \"#one\",\n Two: \"#two\"\n },\n Collections: {\n One: \"#one\",\n Two: \"#two\"\n },\n Offers: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n Baby: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n School: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n }\n },\n Shoes: {\n Products: {\n One: \"#one\",\n Two: \"#two\"\n }\n }\n };\n this.mainNavigation = document.getElementById(\"main-navigation\");\n this.navigationBreadcrumb = [];\n this.buildNavigation();\n}", "title": "" }, { "docid": "335d034f4f8197a8a78dc38b1c470120", "score": "0.6210261", "text": "function setupElements()\n{\n\tgetLinkAndTextCount();\n\tdisplayText();\n \tchangePageNumber(); \t\n \thightlightMenu();\n \t\n\t$(\".btnNext\").on(\"click\",function()\t\t\n\t{\n\t\tnextButtonclick();\t\t\t\t//function for handling the btnNext click\t\t\n \tchangePageNumber();\n });\n \n $(\".btnPrev\").on(\"click\",function()\t\t\n\t{\n\t\tprevButtonclick();\t\t\t\t//function for handling the btnNext click\t\t\n \tchangePageNumber();\n });\n \n $(\".navbar-nav li\").on(\"click\",function(){ //Random click on the any linkNode will start traversing from that node\n\t\tcurrentLink=$(this).index();\n\t\tconsole.log(currentLink);\n\t \tcurrentLinkText=0;\n\t \tdisplayText();\n\t \tchangePageNumber(); \t\n\t \thightlightMenu();\n\t});\n\n}", "title": "" }, { "docid": "63cd8be920d4435c6155a54dc7c87ac1", "score": "0.6209998", "text": "function settingsReady() {\n // set the page title (change as desired)\n $(document).attr(\"title\", vars['classNum'] + \" | \" + vars['className'] + \" | \" + vars['section'] + \" | \" + vars['semester']);\n\n // sets the navbar title (shortening for smaller screens)\n $('#brand-big').text(vars['classNum'] + \" | \" + vars['className']);\n $('#brand-small').text(_shorten(vars['classNum'] + \" | \" + vars['className']));\n\n // generally replaces any usage of variable classes on the page\n for (k in vars) {\n $('.var-' + k).text(vars[k]);\n };\n\n // determine file name\n var url = window.location.pathname;\n var filename = url.substring(url.lastIndexOf('/')+1);\n\n // produce navbar dynamically from settings\n if (tabs.length > 0) {\n tabs.unshift([\"index.html\", \"Home\"]);\n\n active = \"index.html\";\n tabs.forEach(function(item) {\n if (item[0] == filename) {\n active = item[0];\n }\n });\n\n var navbarList = $('#myNavbar ul:first');\n tabs.forEach(function(item) {\n navbarList.append($('<li>', {\n class: ((item[0] == active)?(\"active\"):(\"\")),\n html: $('<a>', {\n href: item[0],\n text: item[1]\n })\n }));\n });\n } else {\n $('#burger').hide();\n }\n}", "title": "" }, { "docid": "d3fc97801df083b167573768d4ee7eaf", "score": "0.62068975", "text": "function makeNavigationData() {\n navItems.forEach((item) => {\n const { pid } = item;\n\n if (navMap[pid]) {\n item.childNodes = helper.sort(navMap[pid]);\n }\n });\n\n navItems = helper.sort(navItems);\n\n if (navMap.global) {\n navItems.push({\n pid: 'global',\n parentPid: 'global',\n name: 'global',\n opened: false,\n type: 'api'\n });\n }\n}", "title": "" }, { "docid": "a08886e1d805150ff4040cd00a8b46fe", "score": "0.6206535", "text": "static Init() {\n\t\tnavbar_items.forEach(e => App.AddItemToNavbar(e));\n\t\tApp.TriggerClickableNavBar();\n\t\tApp.LoadTab(App.URLGetParameterByName(\"roll\") || images[images.length - 1].split(\"/\")[0] || \"001\"/*\"000\"*/);\n\t}", "title": "" }, { "docid": "bc39003101658c6cf4313bb17c3ff051", "score": "0.62042063", "text": "function buildTheNav(){\n\n let navbarHTML = ''\n sections.forEach( section=>{\n navbarHTML += `<li><a class=\"menu__link\" href=\"#${section.id}\">${section.dataset.nav}</a></li>`\n });\n\n navbar.insertAdjacentHTML(\"afterbegin\", navbarHTML);\n}", "title": "" }, { "docid": "52c4353f2583f46bc72781677bdb3c3f", "score": "0.6203738", "text": "function NavBar(AppTools){\n var navElmt = document.getElementsByTagName(\"nav\")[0];\n var usernameElmt = document.getElementById(\"username\");\n var logoutButton = document.getElementById(\"logout\");\n var logoutButtonBehavior = AppTools.logoutUser;\n function configNavBar(email){\n var username = email || getCookieValue(\"email\");\n navElmt.classList.toggle(\"hide\");\n usernameElmt.innerHTML = username;\n $(logoutButton).on(\"click\", logoutButtonBehavior);\n }\n return {\n config: configNavBar,\n };\n}", "title": "" }, { "docid": "3411415594ea393d86f7eca6ffa3a66c", "score": "0.61972684", "text": "function init () {\n this.createNavItem();\n this.intiNavBar (\"navbar__menu\");\n this.activeSection();\n }", "title": "" }, { "docid": "9292ba9b5f99aceeb31094ab1e4173b4", "score": "0.61958987", "text": "function navigation()\n{\n\t// Unbind the default window scroll function\n\t$(window).unbind(\"scroll\");\n\n\t// Set the navigation bar to be unlocked\n\t$(\"#navbar\").addClass(\"navbar-unlocked\");\n\n\t// Set the position of the title text\n\t$(\"#ptitle\").css(\"top\", $(window).height() / 2 - $(window).height() * 0.1);\n\n\n\t// Set the new scroll functionality\n\t$(window).scroll(function()\n\t{\n\t\t// Determine how far down the page we are\n\t\tvar percent = ($(window).scrollTop() / $(window).height());\n\n\t\t// Scroll the title information up faster than the window\n\t\t$(\"#ptitle\").css(\"top\", (1 - percent) * ($(window).height() / 2 - $(window).height() * 0.1));\n\n\t\t// Offset the background scrolling\n\t\tvar scrollOffset = $(document).scrollTop();\n\t\tvar offset = ($(\"#content\").offset().top - scrollOffset) * 0.2;\n\t\t$(\"#content\").css(\"background-position\", \"center \" + offset + \"px\");\n\t});\n}", "title": "" }, { "docid": "dd1a91abfe4677f920bead8e14b15edb", "score": "0.6182733", "text": "function Build_Nav() {\n for (let i = 0; i < Content_Sections.length; i++) {\n let navitems = document.createElement('li');\n navitems.classList = 'menu__link';\n navitems.setAttribute('data-section-id', Content_Sections[i].id);\n navitems.innerText = `${Content_Sections[i].id}`;\n Navbar_menu.appendChild(navitems);\n };\n}", "title": "" }, { "docid": "9d6df8e47de6af98237ab3690a4daf35", "score": "0.61794734", "text": "function navtogglingfunction(){\n\n console.log(\"click\");\n // what we want to do is dissacosiate the closing of the nave with the normal body sate\n // so probably have a nav on and nav off class; each hs didderent animatin\n // then our normal body no longer assiging hte \"nav-off\" stagte\n if ( (!$('body').not('nav-off')) || (!$('body').not('nav-on')) ) {// chekc if we have \"started the nav yet; i.e assiging a nav off\"\n // \"start the nav toggle\" - for first time\n \n // unforceheadroompin(); // ensure headroom now turned off + freeze that position\n // freezeheadroom();\n\n destroyheadroom();\n\n $('body').addClass('nav-on');\n console.log(\"not either\");\n return;\n\n } else if ($('body').hasClass('nav-on')) {\n\n // turn nav off:\n console.log(\"turn nav off\")\n initheadroom();\n\n\n $('body').addClass('nav-off');\n $('body').removeClass('nav-on');\n return;\n\n } else { // if body hasClass nav-off - + others?\n\n // turn nav on:\n console.log(\"turn nav on\")\n // unforceheadroompin(); // ensure headroom now turned off + freeze that position\n // freezeheadroom();\n // r- initheadroom \n destroyheadroom();\n\n $('body').addClass('nav-on');\n $('body').removeClass('nav-off');\n\n //if click statment to add here; if they click a menu item that tkes them away from current page\n \n //nav now on, but this function will run muiltiple times: apparently; so move it out of here?\n\n var $mainmenuitmes = $('li.menu-item a');\n\n $mainmenuitmes.click(function(){\n \n console.log(\"$mainmenuitmes.click(function()\")\n\n // close nave\n $('body').addClass('nav-off');\n $('body').removeClass('nav-on');\n //re init headroom\n\n initheadroom()\n return;\n\n }); // click\n return;\n \n \n \n\n }// ifnav on\n return;\n\n }//navtogglingfunction()", "title": "" }, { "docid": "fe8bcf60e6c52b9e5564f5d15632077b", "score": "0.6178064", "text": "function upd_airbr(){\n openNav();\n}", "title": "" }, { "docid": "3c5f703b6fcb4434659003d99d640256", "score": "0.61750394", "text": "function initOnepagenav(){\n \n $('.navigation-overlay .navbar-collapse ul li a, .nav-type-4 .navbar-collapse ul li a').on('click',function() {\n $('.navbar-toggle:visible').click();\n });\n\n // Smooth Scroll Navigation\n $('.local-scroll').localScroll({offset: {top: -60},duration: 1500,easing:'easeInOutExpo'});\n $('.local-scroll-no-offset').localScroll({offset: {top: 0},duration: 1500,easing:'easeInOutExpo'});\n }", "title": "" }, { "docid": "82007d095b3687a8eab04ab7db690edc", "score": "0.6156291", "text": "function buildTheNavBar() {\n sectionList.forEach((section) => {\n const listItem = document.createElement('li');\n const listItemLink = document.createElement('a');\n listItem.appendChild(document.createTextNode(listItemLink));\n listItemLink.appendChild(document.createTextNode(section.dataset.nav));\n listItemLink.dataset.sectionId = section.id;\n navBarList.appendChild(listItem).appendChild(listItemLink);\n });\n}", "title": "" }, { "docid": "68572d6f510ad19afef47f61c67660c5", "score": "0.61388606", "text": "function buildTheNav() {\n for (const section of sections) {\n const section_Id = section.getAttribute(\"id\");\n const section_Name = section.getAttribute(\"data-nav\");\n newItem = document.createElement('li');\n newItem.innerHTML = navMenuItem(section_Id, section_Name);\n fragment.appendChild(newItem);\n }\n unorderedList.appendChild(fragment);\n}", "title": "" }, { "docid": "d6eca782915b01534217a44fcdeb46ad", "score": "0.6125515", "text": "function side_nav(){\n const sectionEls = document.querySelectorAll(\"section\");\n const dark_filter = document.querySelector(\"div.dark_filter\");\n const nav_bar = document.querySelector(\"div.nav_bar\");\n const nav_bar_list = document.querySelector(\"div.side_nav_list_wrap\");\n const nav_list_title = document.querySelectorAll(\"ul.side_nav_list > li > a\");\n const side_nav_one = document.querySelectorAll(\"div.side_nav_one\");\n const side_nav_one_title = document.querySelectorAll(\"div.side_nav_one > h3 > a\");\n const side_nav_one_btn = document.querySelectorAll(\"div.side_nav_one > ul > li > a\");\n const side_nav_two = document.querySelectorAll(\"div.side_nav_two\");\n const side_nav_two_title = document.querySelectorAll(\"div.side_nav_two > h4 > a\");\n \n\n for(let i = 0 ; i < sectionEls.length ; i++){\n sectionEls[i].addEventListener(\"click\", ()=> {\n nav_bar.classList.remove(\"active_nav\");\n nav_bar_list.classList.remove(\"active_side_nav\");\n dark_filter.classList.remove(\"active_filter\");\n })\n }\n nav_bar.addEventListener(\"click\", click_nav);\n function click_nav(){\n nav_bar.classList.toggle(\"active_nav\");\n nav_bar_list.classList.toggle(\"active_side_nav\");\n dark_filter.classList.toggle(\"active_filter\");\n }\n for(let i = 0 ; i < nav_list_title.length ; i++){\n nav_list_title[i].addEventListener(\"click\", (e)=>{\n e.preventDefault();\n side_nav_one[i].classList.toggle(\"active_side_nav\");\n })\n }\n for(let i = 0 ; i < side_nav_one_title.length ; i++){\n side_nav_one_title[i].addEventListener(\"click\", (e)=>{\n e.preventDefault();\n side_nav_one[i].classList.toggle(\"active_side_nav\");\n })\n }\n for(let i = 0 ; i < side_nav_two_title.length ; i++){\n side_nav_two_title[i].addEventListener(\"click\", (e)=>{\n e.preventDefault();\n side_nav_two[i].classList.toggle(\"active_side_nav\");\n })\n }\n for(let i = 0 ; i < side_nav_one_btn.length ; i++){\n side_nav_one_btn[i].addEventListener(\"click\", (e)=>{\n e.preventDefault();\n side_nav_two[i].classList.toggle(\"active_side_nav\");\n })\n }\n\n\n}", "title": "" }, { "docid": "01dbb55fdedbf4b9259cf00fbf84b1d2", "score": "0.61200064", "text": "function handleNavigation() {\n\t\t// On first run show the introduction sidebar\n\t\tif (!(ss.storage.first_run === false)) {\n\t\t\tintro_sidebar.show();\n\t\t} else if (typeof ss.storage.api_key === \"undefined\" || ss.storage.api_key === \"\") {\n\t\t\tsignup_sidebar.show();\n\t\t} else {\n\t\t\tsidebar.show();\n\t\t}\n}", "title": "" }, { "docid": "2b9bc54fde524ce59c6f4b9ba0b16db1", "score": "0.6118565", "text": "function startatLoad(){\n\tloadNavbar(function(){\n\t//\tsetSelectDigiOutput(function(){\n\t\t//\tsetSelectDigiInput(function(){\n\t\t\t\tgetExtensions(function(){\n\t\t\t\t\tgetXMLDataCloud(function(){\n\t\t\t\t\t\tsethardwarehtmlinterface();\n\t\t\t\t\t});\n\t\t\t\t});\n\t//\t\t});\n\t\n\t//\t});\n\t});\n}", "title": "" }, { "docid": "e771d02670aac6c7d05126a548c5e5f8", "score": "0.61009353", "text": "function setCurrentPageHighlighting(sNavID, sNavTitle) {\n var sDashBoardMsg = \"Hello, \" + appUser.UserName + \"!\"; //UserNiceName\n\n // Navigation items -- elementID and associated page\n var arNavItems = new Array();\n arNavItems[\"home.aspx\"] = { navid: \"Home\", msg: sDashBoardMsg };\n arNavItems[\"admin/masterdata.aspx\"] = { navid: \"MasterData\", msg: \"Master Data\" };\n arNavItems[\"admin/usercreation.aspx\"] = { navid: \"UserCreation\", msg: \"User Updation\" };\n arNavItems[\"admin/chartimport.aspx\"] = { navid: \"ChartImport\", msg: \"Chart Import\" };\n arNavItems[\"admin/chartreallocation.aspx\"] = { navid: \"ChartReallocation\", msg: \"Chart Reallocation\" };\n arNavItems[\"admin/chartbulkreallocation.aspx\"] = { navid: \"ChartBulkReallocation\", msg: \"Chart Bulk Reallocation\" };\n arNavItems[\"taskallocation/level1.aspx\"] = { navid: \"Level1\", msg: \"Level 1\" };\n arNavItems[\"taskallocation/level2.aspx\"] = { navid: \"Level2\", msg: \"Level 2\" };\n arNavItems[\"taskallocation/level3.aspx\"] = { navid: \"Level3\", msg: \"Level 3\" };\n arNavItems[\"reports/dailyproductionsummary.aspx\"] = { navid: \"DailyProductionSummary\", msg: \"Daily Production Summary\" };\n \n arNavItems[\"reports/productionstatus.aspx\"] = { navid: \"ProductionStatus\", msg: \"Current Production Status\" };\n \n arNavItems[\"reports/chartstatus.aspx\"] = { navid: \"ChartStatusReport\", msg: \"Chart Status\" };\n arNavItems[\"reports/agingreport.aspx\"] = { navid: \"AgingReport\", msg: \"Aging Report\" };\n arNavItems[\"reports/performancesummary.aspx\"] = { navid: \"PerformanceSummary\", msg: \"Performance Summary\" };\n arNavItems[\"reports/invoice.aspx\"] = { navid: \"InvoiceReport\", msg: \"Invoice Summary\" };\n arNavItems[\"admin/clientchartdeallocation.aspx\"] = { navid: \"ClientChartDeallocation\", msg: \"Chart Deallocation\" };\n arNavItems[\"admin/clientconfiguration.aspx\"] = { navid: \"ClientConfiguration\", msg: \"Client Configuration\" };\n arNavItems[\"admin/directupload.aspx\"] = { navid: \"DirectUpload\", msg: \"Direct Upload to Client\" };\n arNavItems[\"admin/clientbulkdeallocate.aspx\"] = { navid: \"ClientChartBulkDeallocate\", msg: \"Client Chart Bulk Deallocation\" };\n\n arNavItems[\"admin/usermapping.aspx\"] = { navid: \"UserMapping\", msg: \"User Mapping\" };\n //arNavItems[\"reports/PerformanceSummary.aspx\"] = { navid: \"PerformanceSummary\", msg: \"PerformanceSummary.aspx\" };\n\n var oPageNavItem = null;\n\n if (sNavID) {\n oPageNavItem = { navid: sNavID, msg: sNavTitle };\n }\n else {\n var docName = SiteMasterVar.g_sPage;\n var urlElems = docName.split('?');\n\n if (urlElems.length > 1) {\n var sMenuID = urlElems[1].split('=')[1];\n\n if (sMenuID != undefined) {\n docName = sMenuID;\n oPageNavItem = { navid: sMenuID, msg: $('#' + sMenuID).find('a').text() };\n }\n }\n else {\n // Set menu higlighting based on which page is currently displayed\n // Default: need to handle potential for docName to be blank, etc).. \n oPageNavItem = arNavItems[docName.toLowerCase()];\n }\n }\n\n //if nav item is undefined/null/false then set nav item as home\n if (!oPageNavItem)\n oPageNavItem = arNavItems[\"home.aspx\"];\n\n // Clear old highlights, if necessary\n $(\"#sidebar\").find(\".menuItemCurrent\").removeClass(\"menuItemCurrent\");\n\n if (oPageNavItem.navid == \"UserCreation\" || oPageNavItem.navid == \"ChartImport\" || oPageNavItem.navid == \"ChartReallocation\" || oPageNavItem.navid == \"ChartBulkReallocation\" || oPageNavItem.navid == \"MasterData\"\n || oPageNavItem.navid == \"Level1\" || oPageNavItem.navid == \"DailyProductionSummary\" || oPageNavItem.navid == \"ProductionStatus\" || oPageNavItem.navid == \"ChartStatusReport\"\n || oPageNavItem.navid == \"ClientChartDeallocation\" || oPageNavItem.navid == \"Level3\" || oPageNavItem.navid == \"AgingReport\" || oPageNavItem.navid == \"PerformanceSummary\"\n || oPageNavItem.navid == \"InvoiceReport\" || oPageNavItem.navid == \"ClientConfiguration\" || oPageNavItem.navid == \"DirectUpload\" || oPageNavItem.navid == \"ClientChartBulkDeallocate\" || oPageNavItem.navid == \"UserMapping\") {\n\n var oPage = \"#\" + oPageNavItem.navid;\n // highlights 'Results' navigation item\n $(oPage).addClass(\"menuItemCurrent\");\n }\n\n // highlight appropriate navigation item\n // and update content header title\n $(\"#\" + oPageNavItem.navid).addClass(\"menuItemCurrent\");\n\n // if message is null - get it from inside the nav node\n var sMsg = oPageNavItem.msg;\n if (!sMsg)\n sMsg = $(\"#\" + oPageNavItem.navid).find(\"a\").text();\n\n updateContentTitle(sMsg);\n}", "title": "" }, { "docid": "eaa3acae0b3472e39b8879a8d9b1bab4", "score": "0.6098858", "text": "function buildMenu() {\n\n // for each of the section names add a list item including an\n // eventListener referring that section to the navigation menu\n // in the header\n\n for (let section of sections) {\n const li = document.createElement('li');\n let id = section.id;\n let nav = section.dataset.nav;\n let link = document.createTextNode(nav);\n li.appendChild(link);\n li.setAttribute(\"name\", id);\n navbar.appendChild(li);\n }\n}", "title": "" }, { "docid": "c59d90574a088272b86a823b9fdae4cb", "score": "0.60968685", "text": "function buildNavbarMenu(e,page) {\n\tvar menu = document.getElementById(\"menuNavBar\");\n\t// Except for the 'main', all of the relative paths start the same way \n\tvar firstPart = (page == 'main') ? '<a class=\"button\" href=\"./views/': '<a class=\"button\" href=\"../';\n\t// For all but the 'main' page, the 'main' page needs to be the first button.\n\tvar temp = (page == 'main') ? '' : getMainButton();\n\t// go over the directories\n\tfor (let directory of directories) {\n\t\t// No sense in have a link to the current page, on the current page\n\t\tif (page != directory) {\n\t\t\t// Build each button <a> element\n\t\t\ttemp += firstPart + directory + '/index.htm\">' + directory.replace('_', ' ') + '</a>';\n\t\t}\n\t}\n\t// Add the last element \n\ttemp += getLastButton();\n\t// Adds the innHTML to the navbar\n\tmenu.innerHTML = temp;\n} // end buildNavbarMenu", "title": "" }, { "docid": "be560becea3a25ae46c2e9585898dcd1", "score": "0.60955834", "text": "function initNavigation() {\n const mainNavLinks = gsap.utils.toArray('.main-nav a')\n const mainNavLinksRev = gsap.utils.toArray('.main-nav a').reverse()\n\n mainNavLinks.forEach(link => {\n link.addEventListener('mouseleave', e => {\n link.classList.add('animate-out')\n setTimeout(() => {\n link.classList.remove('animate-out')\n }, 300)\n })\n })\n\n function navAnimation(direction) {\n const scrollingdown = direction === 1\n const links = scrollingdown ? mainNavLinks : mainNavLinksRev\n return gsap.to(links, {\n duration: 1,\n autoAlpha: () => scrollingdown ? 0 : 1,\n y: () => scrollingdown ? 20 : 0,\n ease: \"Power4.out\"\n })\n }\n\n ScrollTrigger.create({\n start: 100,\n end: \"bottom bottom-=200\",\n toggleClass: {\n targets: 'body',\n className: 'has-scrolled'\n },\n onEnter: ({\n direction\n }) => navAnimation(direction),\n onLeaveBack: ({\n direction\n }) => navAnimation(direction)\n })\n\n}", "title": "" }, { "docid": "54262858fa80adaf0eaafb5ad3988f18", "score": "0.608877", "text": "function updateNav() {\n // Remove each .is-active class from all sections.\n btnNav.forEach(btn => btn.classList.remove('is-active'))\n\n // Add the .is-active class to a particular button based on the current slide.\n if (index >= 1 && index < 4) {\n btnNav[0].classList.add('is-active')\n } else if (index === 4) {\n btnNav[1].classList.add('is-active')\n } else if (index === 5) {\n btnNav[2].classList.add('is-active')\n } else if (index === 6) {\n btnNav[3].classList.add('is-active')\n } else if (index >= 7 && index < 10) {\n btnNav[4].classList.add('is-active')\n } else if (index >= 10 && index < 12) {\n btnNav[5].classList.add('is-active')\n } else if (index >= 12 && index < 17) {\n btnNav[6].classList.add('is-active')\n } else if (index >= 17 && index < 22) {\n btnNav[7].classList.add('is-active')\n } else if (index >= 22 && index < 24) {\n btnNav[8].classList.add('is-active')\n } else if (index >= 24 && index < 26) {\n btnNav[9].classList.add('is-active')\n } else if (index >= 26) {\n btnNav[10].classList.add('is-active')\n }\n }", "title": "" }, { "docid": "c5f0aedd90344bf4ea2f007225ec154b", "score": "0.608756", "text": "function createMainNav() {\n const header = document.querySelector('#header')\n const mainNav = document.createElement('nav')\n mainNav.setAttribute('id', 'main-nav')\n header.appendChild(mainNav)\n const pages = document.createElement('ul')\n pages.setAttribute('id', 'main-pages')\n mainNav.appendChild(pages)\n for (i=0; i<sections.length; i++) {\n const pageList = document.createElement('li')\n pageList.classList.add('main-nav-pages')\n pages.appendChild(pageList)\n const pageLink = document.createElement('a')\n const pageName = sections[i].name.toLowerCase()\n pageLink.textContent = sections[i].name\n if (pageLink.textContent == 'Information') {\n pageLink.setAttribute('href', '../information/information-about.html')\n } else {\n pageLink.setAttribute('href', `../${pageName}/${pageName}-${pageName}.html`)\n }\n pageList.appendChild(pageLink)\n if (pageName === currentSection) {\n pageLink.style.borderBottom = `solid 3px hsl(${sections[i].hue}, ${sections[i].saturation}%, ${sections[i].lightness}%)`\n }\n }\n}", "title": "" }, { "docid": "5f40f70399ca42205da758328b1b4fe6", "score": "0.60810375", "text": "function buildNavBar(navItems) {\n // Create starting html for nav list\n let navigationList = '<li><a href=\"https://night2013.github.io/acme-project/index.html\" title=\"Go to the home page\">Home</a></li>';\n\n // Input the rest of the items into the nav along with the proper HTML\n for (let i = 0; navItems.length > i; i++) {\n navigationList += '<li><a href=\"https://night2013.github.io/acme-project/' + \n navItems[i].toLowerCase() + '.html\" title =\"Go to the ' + navItems[i] + ' page\">' + navItems[i] + '</li>';\n }\n\n console.log(\"Nav Bar inner HTML = \" + navigationList);\n \n return navigationList;\n }", "title": "" }, { "docid": "1ae900b532535a9a9078b46576c5d0b6", "score": "0.6074512", "text": "function page() {\n let hns= document.getElementById(\"home-link\").style; //hns = home nav stling\n let ans= document.getElementById(\"about-link\").style; //ans = about nav stling\n let pns= document.getElementById(\"projects-link\").style; //pns = projects nav stling\n // console.log(window.location);\n if(pathName.includes('index.php') || pathName.includes('about.php') != true && pathName.includes('projects.php') != true ) {\n hns.display = 'none';\n document.getElementById(\"nav-tgl\").style.display = 'none';\n\n }else if (pathName.includes('about.php') ) {\n ans.display = 'none';\n }else if (pathName.includes('projects.php') ) {\n pns.display = 'none';\n }\n}", "title": "" }, { "docid": "c95429d938ddba27e3b5f4246a0c120a", "score": "0.6071328", "text": "function doNav(i) {\n setSlides()\n pnClasses()\n highlightDot(i)\n }", "title": "" }, { "docid": "ba3dbdd496f5dbeb8bd131a5206f370d", "score": "0.60637194", "text": "function createNavigation2(items) {\n var menu = \"\";\n var i = 0;\n var navMainUl = document.createElement('ul');\n navMainUl.setAttribute('class', \"nav\");\n if (items === undefined || items.length === 0) return menu;\n while (i < items.length) {\n var item = items[i];\n var childItems = item && item.items && item.items.length;\n var navLi = document.createElement('li');\n navLi.setAttribute('class', \"nav-item\");\n\n var navLink = document.createElement('a');\n var spanText = document.createElement('span');\n spanText.innerHTML = item.label;\n spanText.setAttribute('class', \"nav-item-text\");\n\n navLink.appendChild(spanText);\n navLi.appendChild(navLink);\n if (childItems) {\n var subNavUl = document.createElement('ul');\n subNavUl.setAttribute('class', \"nav\");\n var spanIcon = document.createElement('span');\n spanIcon.setAttribute('class', \"nav-item-icon\");\n for (var j = 0; j < childItems; j++) {\n var subnavLi = document.createElement('li');\n subnavLi.setAttribute('class', \"nav-item\");\n var sub_item = item.items[j];\n\n var subnavLink = document.createElement('a');\n subnavLink.setAttribute('href', sub_item.url);\n subnavLink.addEventListener('click', toogleSubItem);\n\n spanText = document.createElement('span');\n spanText.innerHTML = sub_item.label;\n spanText.setAttribute('class', \"nav-item-text\");\n\n subnavLink.appendChild(spanText);\n subnavLink.appendChild(spanIcon);\n subnavLi.appendChild(subnavLink);\n subNavUl.appendChild(subnavLi);\n }\n navLi.appendChild(subNavUl);\n }\n navMainUl.appendChild(navLi);\n i++;\n }\n return '<ul class=\"nav\">' + getOuterHtml(navMainUl) + '</ul>';\n }", "title": "" }, { "docid": "c8c44af0085e353ad3a9947ac962e21a", "score": "0.6061018", "text": "function setVariables() {\n\n $subNav = $('#subnav.large');\n $leftRail = $('.owner-benefits-side-bar');\n $leftRailContent = $('.owner-benefits-inner');\n leftRailContentHeight = $leftRailContent.outerHeight();\n headerHeight = $('.header-wrapper').outerHeight();\n subNavHeight = $subNav.outerHeight();\n $viewportHeight = $(window).height();\n topOffset = $subNav.offset().top + subNavHeight;\n footerOffsetTop = $('footer').offset().top;\n footerHeight = $('footer').outerHeight() + $('.footer-disclaimer-container').outerHeight();\n\n // Set the height of the left rail\n $leftRail.css('height', $('#content').height() - (topOffset + footerHeight / 2));\n }", "title": "" }, { "docid": "caaa58fceddb48037535ef353b7edc66", "score": "0.6057013", "text": "function initiateAG() {\n \n // Assigner le HTML de la page à une variable\n let body = $('body').html();\n \n // Effacer le corps de la page et y mettre mon HTML\n $('body').removeClass().html(myHtm);\n \n // Initier le script\n makeHeaderAG(body);\n makePostListAG(body); // MAKE ASSEMBLEE-HEADER\n getResources($('.nav',body));\n}", "title": "" }, { "docid": "957fd907220f22fbe3250c9f4f4a46f6", "score": "0.6053893", "text": "function addNavigate(){\nfor(section of sections){\n\n//sections.forEach(addNavigate);\n//through a function i will add link in the nav bar to each section \n//function addNavigate(){\n /*adding the navigation menu as unordered list\n *selecting ul tag to add to it the li \n linking each li tag to each section tag*/\n let parentul = document.getElementById(\"navbar__list\") ;\n let childli = document.createElement(\"li\");\n parentul.appendChild(childli);\n // anchor to the specific section using its specific attribute\n //name linking each individual nav menu to its specific section using specific attribute too\n let link = document.createElement(\"a\");\n let anchor = section.getAttribute(\"id\");\n //console.log(anchor);\n let naming = section.getAttribute(\"data-nav\");\n \n link.textContent = naming ; \n link.href = `#${anchor}` ;\n// adding menu_link class to the li to determine its place and style\n link.classList.add(\"menu__link\");\n childli.appendChild(link);\n // acheiving smooth navigation also i can do this step through css file\n link.addEventListener(\"click\", e => {\n e.preventDefault();\n document\n .querySelector(\n \"#\" + e.target.innerText.toLowerCase().replace(/\\s/g, \"\")\n )\n .scrollIntoView({ behavior: \"smooth\" });\n })\n \n }\n \n}", "title": "" }, { "docid": "b05ee40e20e9ce0abacf789965161620", "score": "0.6050509", "text": "function buildNav() {\n for (const section of sections) {\n const newElement = document.createElement('li');\n newElement.setAttribute('id', `l${section.id}`);\n newElement.innerHTML = `<a class=\"menu__link\" href=\"#${section.id}\" > ${section.dataset.nav}</a>`;\n fragment.appendChild(newElement);\n }\n navbarLinks.appendChild(fragment);\n}", "title": "" }, { "docid": "a037de81f41f0f25762eb8ee6aa96206", "score": "0.6050005", "text": "function nav() {\n\t\tvar separator = window.location.toString().split(\"?cat=\");\n\t\twindow.scrollTo(0, $('#' + separator[1]).offset().top - 65);\n\t}", "title": "" }, { "docid": "6ce1487ba6345562deebd6a827e387c2", "score": "0.6046326", "text": "static TriggerClickableNavBar() {\n\t\t// Code to allow navigation through navbar\n\t\tdocument.querySelectorAll(\"ul#parent > li.par\").forEach(function(e) {\n\t\t\te.addEventListener(\"click\", function() {\n\t\t\t\tlet el = document.querySelector(\"ul#parent > li.sub-\" + this.innerHTML);\n\t\t\t\tif (el.style.display == \"list-item\")\n\t\t\t\t\tdocument.querySelectorAll(\"ul#parent > li.sub\").forEach(function(f) {\n\t\t\t\t\t\tf.style.display = \"none\";\n\t\t\t\t\t\te.classList.remove(\"selec\");\n\t\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tdocument.querySelectorAll(\"ul#parent > li.sub\").forEach(function(f) {\n\t\t\t\t\t\tf.style.display = \"none\";\n\t\t\t\t\t\te.classList.remove(\"selec\");\n\t\t\t\t\t});\n\t\t\t\t\tel.style.display = \"list-item\";\n\t\t\t\t\tdocument.querySelectorAll(\"ul#parent > li.par\").forEach(function(f) {\n\t\t\t\t\t\tf.classList.remove(\"selec\");\n\t\t\t\t\t});\n\t\t\t\t\te.classList.add(\"selec\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t\n\t\t// Code to allow navbar extension on mobile\n\t\tdocument.querySelector(\"div.nav > a\").addEventListener(\"click\", function() {\n\t\t\tdocument.querySelector(\"div.nav > nav\").style.display = \"inline-grid\";\n\t\t\tthis.style.display = \"none\";\n\t\t});\n\t\t\n\t\t// Code to allow navbar retraction on mobile\n\t\tdocument.querySelector(\"div.nav > nav > a\").addEventListener(\"click\", function() {\n\t\t\tdocument.querySelector(\"div.nav > nav\").style.display = \"\";\n\t\t\tdocument.querySelector(\"div.nav > a\").style.display = \"\";\n\t\t});\n\t\t\n\t\t// Code to allow navigation between tabs throught navbar\n\t\tdocument.querySelectorAll(\"ul#parent > li.sub > ul > li\").forEach(function(e) {\n\t\t\te.addEventListener(\"click\", function() {\n\t\t\t\tApp.LoadTab(this.innerHTML);\n\t\t\t});\n\t\t});\n\t\t\n\t\t// Code to allow special tabs to work properly\n\t\tdocument.querySelectorAll(\"ul#parent > li.spe\").forEach(function(e) {\n\t\t\te.addEventListener(\"click\", function() {\n\t\t\t\tApp.LoadSpecialTab(this.getAttribute(\"data-target\"), this.innerHTML);\n\t\t\t\tApp.UpdateNavbar(this);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1c98e170fb4406124adc915b62a63c8f", "score": "0.60455656", "text": "function aboutNav() {\n const sideNavFind = document.querySelector('.sidenav.about');\n let findul = document.createElement('ul');\n let findlist = document.createElement('li');\n const sideNavAboutLinks = links.sidebarAbout.map(function (link) {\n return `<li><a href=\"${link.url}\">${link.name}</a></li>`;\n });\n findlist.innerHTML = sideNavAboutLinks;\n findul.innerHTML = findlist;\n sideNavFind.appendChild(findul);\n findul.appendChild(findlist);\n findlist.innerHTML = sideNavAboutLinks.join('');\n findul.innerHTML = sideNavAboutLinks.join('');\n const sidebarFindButtons = document.createElement('div');\n sidebarFindButtons.innerHTML = `<button class=\"quotation\">Get A Free Quote</button> <br>\n <button class=\"demonstration\">Get A Free Demo</button>`;\n sideNavFind.appendChild(sidebarFindButtons);\n sidebarFindButtons.classList.add('btns');\n }", "title": "" }, { "docid": "50efc400280a3159d005b1427224fbe4", "score": "0.60343295", "text": "function navigate(event) {\n event.preventDefault();\n\n nav_snd.play()\n\n switch ($(this).attr('id')) {\n case 'navBack':\n\n if (navIndex >= 1) {\n navIndex--\n\n }\n\n break;\n\n case 'navNext':\n if (navIndex < (totalSections - 1)) {\n\n navIndex++\n\n }\n break;\n\n default:\n navIndex = 0;\n navIndex = event.data.navType;\n }\n\n switch (transition[0]) {\n case 'vertical':\n\n moveLeft = 0;\n moveTop = -navIndex * ($(sections).outerHeight()) + 'px';\n\n break;\n case 'horizontal':\n moveTop = 0;\n\n $('#sectionsContainer').css('width', ($(sections).outerWidth() * totalSections) + 'px');\n moveLeft = -navIndex * $(sections).width() + 'px';\n\n break;\n case 'grid':\n\n $('#sectionsContainer').css('width', ($(sections).outerWidth() * transition[3]) + 'px');\n cols = transition[3];\n y = 0;\n x = 0;\n for (i = 1; i <= totalSections; i++) {\n x++\n if (x > cols) {\n y++;\n x = 1;\n }\n if (i == (navIndex + 1)) {\n\n moveLeft = (-x + 1) * ($(sections).outerWidth() - 1) + 'px';\n moveTop = -y * ($(sections).outerHeight() - 1) + 'px';\n\n }\n }\n break;\n\n default:\n\n alert('El valor asignado a \"Transition\" es incorrecto. (config.js).')\n }\n\n setFlatShadow($('[class*=\" icon-\"], .textButton'), navAnchorColor, false);\n $('.button, .textButton').css('background-color', navAnchorColor);\n\n //PINTAR DE OTRO COLOR BOTONES DEL LADO IZQUIERDO\n setFlatShadow($('#buttons [class*=\" icon-\"]'), color[1], false);\n $('#buttons .button').css('background-color', color[1]);\n\n if (!$('#sectionsContainer').hasClass('animated')) {\n $('#sectionsContainer').dequeue().stop().velocity({\n 'left': moveLeft,\n 'top': moveTop,\n }, transition[2], transition[1], function() {\n\n $('#sectionsContainer').addClass('animated')\n $('#sectionsContainer').removeClass('animated').dequeue();\n\n doSection(navIndex)\n\n\n }\n\n )\n }\n\n\n if (navigation == 'numeric') {\n\n if ($('#navButtons li').eq(navIndex).children().hasClass('highlighted')) {\n\n $('#navIndicator').removeIndicator()\n }\n\n\n $('#navButtons li').eq(navIndex).children().effect('bounce').dequeue().stop().animate({\n 'color': color[2]\n }, 500)\n\n $('#navButtons li').not(':eq(' + navIndex + ')').children().dequeue().stop().animate({\n 'color': 'white'\n }, 500);\n\n\n }\n\n\n showButtons(navIndex)\n\n } //end navigate", "title": "" }, { "docid": "307881773581f0567258a12c2808ffd5", "score": "0.6033185", "text": "function setNav() {\n\t\tvar $anchorLinks = $('#nav-anchors').find('a');\n\t\t$anchorLinks.click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar $this = $(this),\n\t\t\t\tthisHref = $this.attr('href');\n\t\t\t$('.reveal').hide();\n\t\t\tif($this.hasClass('active')) {\n\t\t\t\t$this.removeClass('active');\n\t\t\t\t$(thisHref).hide();\n\t\t\t} else {\n\t\t\t\t$anchorLinks.removeClass('active');\n\t\t\t\t$this.addClass('active');\n\t\t\t\t$(thisHref).show();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f6119b127cbe8f0cc3592119176fed65", "score": "0.6031035", "text": "function navMenu() {\n let navListItem = \"\";\n\n for (const section of sections) {\n const id = section.id;\n const dataNav = section.dataset.nav;\n navListItem += `<li><a class=\"menu__link ${id}\" href=\"#${id}\">${dataNav}</a></li>`;\n }\n\n navList.innerHTML = navListItem;\n}", "title": "" }, { "docid": "bd98a25f93453ec68b14775cc249ba44", "score": "0.60307777", "text": "function ToolsMenuItems() {\n\t$('section header nav ul li:nth-last-child(2) ul li:first-child').after('<li><a href=\"/index.php?title='+ encodeURIComponent(wgPageName) +'&action=history\">History</a></li><li><a href=\"/wiki/Special:WhatLinksHere/'+ encodeURIComponent(wgPageName) +'\">What Links here</a></li>');\n\t$('section header nav ul li:nth-last-child(2) ul li:nth-last-child(1)').after('<li><a href=\"/index.php?title='+ encodeURIComponent(wgPageName) +'&useskin=monobook\" title=\"Change to Monobook\">Monobook skin</a></li><li><a href=\"/index.php?title='+ encodeURIComponent(wgPageName) +'&useskin=vector\" title=\"Change to Vector\">Vector skin</a></li>');\n}", "title": "" }, { "docid": "91633c2ee40fb625c08061310a0fecb5", "score": "0.60305053", "text": "function populateNav(){\n\tconst sections = document.querySelectorAll('section');\n\tconst navBarList = document.querySelector('#navbar__list');\n\t//loop through sections to add its title to the nave\n\tsections.forEach(section=>{\n\t\tconst navElement = document.createElement('li');\n\t\tnavElement.innerHTML = `<a href='#' id='${section.id}' class='menu__link'> ${section.dataset.nav} </a>`\n\t\tnavBarList.appendChild(navElement) ;\n\t})\n}", "title": "" }, { "docid": "805582454c09506b82ca9e852d4643f2", "score": "0.6027927", "text": "function addNavHandler() {\n\tlast = 'das';\n\t$('.nav, nav li a:not(.noNav)').live('click', function() {\n\t\tnavigate($(this).attr('href').substr(1));\n\t});\n\tvar hash = window.location.hash.substr(1);\n\tif (hash === 'update') {\n\t\t$('#n_abo, #p_abo').addClass('current');\n\t\tlast = 'abo';\n\t} else if (hash === 's_syn') {\n\t\t$('#n_syn, #p_syn').addClass('current');\n\t\t$('#m_welcome').removeClass('current');\n\t\t$('#m_import').removeClass('current');\n\t\tlast = 'syn';\n\t} else if (hash == null || hash === '' || hash === 'opt' || hash === 'edi' || hash.indexOf('new') != -1) {\n\t\t$('#n_das, #p_das').addClass('current');\n\t} else {\n\t\t$('#n_' + hash + ', #p_' + hash).addClass('current');\t\t\t\n\t\tlast = hash;\n\t}\n\n\tif (hash.indexOf('new') != -1) {\n\t\tvar host = null;\n\t\t\ttitle = null;\n\t\tif (hash.indexOf('new=') != -1) {\n\t\t\thost = hash.substr(hash.indexOf('new=') + 4, hash.indexOf('&title=') - hash.indexOf('new=') - 4);\n\t\t}\n\t\tif (hash.indexOf('&title') != -1) {\n\t\t\ttitle = hash.substr(hash.indexOf('&title=') + 7, 30);\n\t\t}\n\t\twindow.location.hash = '';\n\t\tmakeNewModule(host, title);\n\t\t\n\t}\n}", "title": "" }, { "docid": "a41cd5d5e32871d51a79fbc6f0235533", "score": "0.60270846", "text": "function buildNavMenu() {\n //get the navigation bar unordered list element already exists on the page but empty \n const navBar = document.getElementById('navbar__list');\n \n //create a document fragment to inhance the performance by adding\n //all the list items to it and then add it to the ul at one time\n const docFragment = document.createDocumentFragment();\n \n //index to count the section and help us label them\n let index = 1;\n\n //walk through the sections and add them to the unordered list defined in the navigation bar\n for(let section of sectionsArr) {\n //create a list element\n const listItem = document.createElement('li');\n\n //create a link element to help us link the list item with the section on the page\n const linkSection = document.createElement('a');\n \n //set the href attribute of the link with the address of the section by giving it it's unique id\n linkSection.setAttribute('href','#'+section.getAttribute('id'));\n\n //set the class attribute of the link to style it by the class already defined in the css file\n linkSection.setAttribute('class','menu__link');\n\n //add the text that will appear in the navigation bar from the value of the \n //attribute 'data-nav' if found so that we don't use to add fixed content\n let secDataNavAtt = section.getAttribute('data-nav');\n if(secDataNavAtt !== undefined) {\n //data nav attribute \n linkSection.textContent = secDataNavAtt;\n } else {\n linkSection.textContent = 'Section'+ index; \n }\n\n //append this link to the list item we have created for this section\n listItem.appendChild(linkSection);\n \n //append this list item to the document fragment\n docFragment.appendChild(listItem);\n\n //increment the index to deine the next section\n index++;\n }\n //at the end append the constructed document fragment to the navigation bar\n navBar.appendChild(docFragment);\n}", "title": "" }, { "docid": "d61819bd5b3d5097193ff258f321c0a1", "score": "0.60224426", "text": "function _buildNav(data){\n const uiNavContainer = document.querySelector('#nav__menu'), // uiNavContainer: DOM element container for generated nav.\n uiNavDocFrag = document.createDocumentFragment(), // uiNavDocFrag: Appending dynamically created elems to a\n // Document Fragment first, rather than the\n // DOM directly, boosts performance.\n uiNavMainUl = document.createElement('UL'); // uiNavMainUl: Creates Primary nav UL.\n\n uiNavMainUl.className = 'nav__main--ul'; // Sets class for primary nav UL.\n\n // ** If we used the for loop to build our nav, we'd end up having to write a couple\n // nested loops with unscoped indice variables left floating about.\n // Using .map() offers a few advantages that make it a more suitable alternative.\n // It's visually simpler to read, returns a new array that doesn't\n // mutate our original data, and can invoke callbacks on each indice in parallel\n // which gives us chaining super powers. Running a .forEach() within a .map()\n // won't break our loop.\n // It's not necessary to build the navigation UI, but I'll demonstrate below.\n //---------------------------------------------------------------------------------------//\n data.map(function(data,index,arr) {\n let uiMainNavLi = document.createElement('LI'), // uiMainNavLi: Creates primary nav LI.\n uiMainNavA = document.createElement('A'); // uiMainNavLi: Creates primary nav A tags.\n let uiMainNav = arr[index], // uiMainNav: Builds primary nav items from array returned via remote API.\n uiSubNav = uiMainNav.items; // uiSubNav: Builds sub nav items from primary nav using dot notation.\n\n uiMainNavLi.className = 'nav__main--li'; // Sets class for primary nav LI.\n uiMainNavA.textContent = uiMainNav.label; // Sets visable link name via textContent rather than\n // the more expensive alternative, innerHTML for\n // performance boost.\n uiMainNavA.href = uiMainNav.url; // Sets url for primary nav link.\n uiMainNavA.className = 'nav__primaryLink'; // Sets class for primary nav A tags.\n\n uiMainNavLi.appendChild(uiMainNavA); // Appends primary nav A tags as children to primary nav LI\n\n // ** Condition that checks for any sub\n // nav items and builds them if they exist.\n //-----------------------------------------------//\n if(uiSubNav.length !== 0){\n let uiSubNavUl = document.createElement('UL'); // uiSubNavUl: Creates sub nav UL.\n\n uiSubNavUl.className = 'nav__sub--ul'; // Sets class for sub nav UL.\n\n // ** We could use .map() entirely, but for demonstrating\n // versatility we'll use a forEach() loop to build the\n // sub navigation. Like .map(), .forEach() is visually\n // cleaner to read and has the advantage of providing\n // its own scope which makes using it in tandem with\n // .map() much less prone to dumb bug issues.\n //------------------------------------------------------------//\n uiSubNav.forEach(function(uiSubNav){\n let uiSubNavLi = document.createElement('LI'), // uiSubNavLi: Creates sub nav LI.\n uiSubNavA = document.createElement('A'); // uiSubNavA: Creates sub nav A tags.\n\n uiSubNavLi.className = 'nav__sub--li'; // Sets class for sub nav LI.\n uiSubNavA.textContent = uiSubNav.label; // Sets visable link name via textContent rather than\n // the more expensive alternative, innerHTML for\n // performance boost.\n uiSubNavA.href = uiSubNav.url; // Sets url for sub nav links.\n uiSubNavA.className = 'nav__secondaryLink'; // Sets class for sub nav A tags.\n\n uiSubNavLi.appendChild(uiSubNavA); // Appends sub nav A tags as children to sub nav LI\n\n uiSubNavUl.appendChild(uiSubNavLi); // Appends sub nav LI tags as children to sub nav UL\n })\n\n uiMainNavLi.className += ' nav--hasChildren'; // Adds additional class to primary nav LI's that have sub nav items.\n\n uiMainNavLi.appendChild(uiSubNavUl); // Appends sub nav UL's as children to primary nav LI's.\n }\n\n uiNavMainUl.appendChild(uiMainNavLi); // Appends primary nav LI as child to primary nav UL.\n })\n\n uiNavDocFrag.appendChild(uiNavMainUl); // Appends current dynamically generated element tree to Document Fragment.\n _uiDefaultNavBehavior(uiNavMainUl) // Private function that adds conditionally based behavior to application.\n uiNavContainer.insertBefore(uiNavDocFrag, uiNavContainer.firstChild); // Renders the Document Fragment of nav items to\n // the DOM at the navigation container via insertBefore\n // method for performance boost.\n }", "title": "" }, { "docid": "fc5e556565e01268ca203528e6d27973", "score": "0.6009647", "text": "function main() {\n initialize();\n View.set('Menu');\n Loop.requestFrame();\n }", "title": "" }, { "docid": "b1ea0288b8aa625b943cfde9f014ae92", "score": "0.6007496", "text": "function addToNav() {\n\t//Creating new nav items and changing existing nav color to green.\n\thome.href = 'index.html';\n\thome.textContent = 'Home';\n\thome.style.color = 'green';\n\tnav.prepend(home); //Add store to end of nav.\n\n\tstore.href = '#';\n\tstore.textContent = 'Store';\n\tstore.style.color = 'green';\n\tnav.appendChild(store); // Add home to beginning of nav.\n\n\tfor (let i = 0; i < navArray.length; i++) {\n\t\t//Change existing nav color to green.\n\t\tnavArray[i].textContent = siteContent['nav'][`nav-item-${i + 1}`];\n\t\tnavArray[i].style.color = 'green';\n\t}\n\tlogo.setAttribute('src', siteContent['nav']['img-src']);\n}", "title": "" }, { "docid": "459e4524a6aea3de0fc5a2a028be2f11", "score": "0.6003493", "text": "function initSinglePageNav(){\n\t\n\tlastId = \"\";\n\ttopMenu = $j('.top-header #site-header .main-nav');\n\theaderHeight = $j('.top-header #site-header').height();\n\tadminBarHeight = $j('body').hasClass('admin-bar') ? 32 : 0;\n\tscrollOffest = adminBarHeight + headerHeight - 10;\n\t\n\t// All list items\n\tmenuItems = topMenu.find(\"a\");\n\t// Anchors corresponding to menu items\n\tscrollItems = menuItems.map(function(){\n\t var target = this.hash.replace(/^.*#/, '');\n\t var item = $j('div[data-row-id=\"'+target+'\"]');\n\t if (item.length) { return item; }\n\t});\n\t\n\t$j('.main-nav a[href^=\"#\"], #slide-mobile-menu a[href^=\"#\"]').click(function(e) {\n\t\t// Shut the slide panel if it is open\n\t\tslideMenu.css('transform', 'translateX(' + slideMenuWidth + 'px)');\n\t e.preventDefault();\n\t\tvar target = this.hash.replace(/^.*#/, '');\n\t\tvar targetElement = $j('div[data-row-id=\"'+target+'\"]');\n\t $j(window).scrollTo(targetElement, {duration:500, interrupt:false, offset: -(scrollOffest-15) });\n\t });\t\n}", "title": "" }, { "docid": "91cc77ca275e489f44333b16b49c4684", "score": "0.6002825", "text": "function loadNavBar () {\n\tvar userStatus = localStorage.getItem('user_status')\n\tvar loggedUser = localStorage.getObj('logged_user')\n\tif (userStatus == 0) { // não logado\n\t\t// se não tiver logado e apertar meu carirnho, vai pra pagina de login\n\n\t\tli = `<li class=\"nav-item\">\n\t <a class=\"nav-link\" href=\"../login/login.html\">Meu Carrinho</a>\n\t\t\t\t\t</li>`\n\n\t\tbutton = `<button class=\"btn btn-outline-success btn-custom\" type=\"button\" onclick=\"location.href='../login/login.html';\">Entre ou Cadastre-se</button>`\n\n\n\t} else if (userStatus == 1) { // logado\n\t\tli = `<li class=\"nav-item\">\n\t <a class=\"nav-link\" href=\"../carrinho/carrinho.html\">Meu Carrinho</a>\n\t\t\t\t\t</li>`\n\t\tbutton = `<button class=\"btn btn-outline-success btn-custom\" type=\"button\" onclick=\"location.href='../user-page/user-page.html';\">Bem-vindo, ${loggedUser.name}</button>`\n\n\n\t} else { // admin\n\t\tli = `<li class=\"nav-item\">\n\t <a class=\"nav-link\" href=\"../admin/admin.html\">Administração</a>\n\t\t\t\t\t</li>`\n\t\tbutton = `<button class=\"btn btn-outline-success btn-custom\" type=\"button\" onclick=\"location.href='../user-page/user-page.html';\">Bem-vindo, ${loggedUser.name}</button>`\n\n\t}\n\n\tvar navbar = `\n\t\t<nav class=\"navbar navbar-expand-lg navbar-custom\">\n\n\t <a class=\"navbar-brand logo\" href=\"../main/main.html\"><img src=\"../img/logo.png\" class=\"img-responsive\"alt=\"logo\"></a>\n\n\t <button class=\"navbar-toggler custom-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarResponsive\" aria-controls=\"navbarResponsive\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n\t <span class=\"navbar-toggler-icon\"></span>\n\t </button>\n\n\t <div class=\"collapse navbar-collapse\" id=\"navbarResponsive\">\n\t <ul class=\"navbar-nav mr-auto\">\n\t <li class=\"nav-item active\">\n\t <a class=\"nav-link\" href=\"../produtos/produtos.html\"> Produtos <span class=\"sr-only\">(current)</span></a>\n\t </li>\n\t ${li}\n\t </ul>\n\n\n\t <form class=\"form-inline\">\n\t \t${button}\n\t </form>\n\n\t </div>\n\t </nav>\n\t `;\n\n\n\n\n\tvar header = document.getElementById('nav-bar-header')\n\theader.innerHTML = navbar\n}", "title": "" }, { "docid": "ecb7d9def9f8ca9d19beb71e2f5f995f", "score": "0.60027826", "text": "function initSlideMenu() {\n /**\n * add toggle functionality to slide right (visible) and slide left (invisible)\n * change icon burger into arrow and reverse\n * put class status while navigation show up or hide\n */\n $(\".toggle-nav\").click(function (e) {\n e.preventDefault();\n $(\".navigation\").toggleClass(\"open\");\n $(this).toggleClass(\"fa-arrow-left\");\n $(this).toggleClass(\"fa-navicon\");\n });\n\n /**\n * close slide navigation when user click overlay\n * reverse back navigation icon and adjust the status (remove 'open' class)\n */\n $(\"nav.navigation .overlay\").click(function () {\n $(\".toggle-nav\").toggleClass(\"fa-arrow-left\");\n $(\".toggle-nav\").toggleClass(\"fa-navicon\");\n $(\".navigation\").removeClass(\"open\");\n })\n\n /**\n * build a simple accordion to make nice slide effect on sub menu\n * check if one of li has open the close and open the another\n */\n $(\"#navigation > li > a\").click(function () {\n if (isExtraSmall) {\n if ($(this).parent().hasClass('active')) {\n $(\"#navigation > li\").removeClass('active');\n $(\"#navigation > li .sf-mega\").stop(true).slideUp().removeClass(\"open\");\n }\n else {\n $(\"#navigation > li\").removeClass('active');\n $(\"#navigation > li .sf-mega\").stop(true).slideUp().removeClass(\"open\");\n\n $(this).parent().addClass('active');\n $(this).next('.sf-mega').stop(true).slideDown().addClass(\"open\");\n }\n }\n });\n\n /**\n * make sure the navigation is visible\n * but still offset the browser viewport\n */\n $(\"#navigation\").show();\n\n /**\n * some additional feature on mobile\n * add toggle search box\n */\n $(\".mobile-search\").click(function () {\n $(this).toggleClass(\"active\");\n $(\".header-section > .search-wrapper\").stop(true).fadeToggle(100);\n\n $(\".user-dropdown\").removeClass(\"active\");\n $(\".list-menu\").stop(true).slideUp(100);\n });\n\n $(\".user-dropdown\").click(function () {\n $(this).toggleClass('active');\n $(this).next(\".list-menu\").stop(true).slideToggle(100);\n\n if (isExtraSmall) {\n $(\".mobile-search\").removeClass(\"active\");\n $(\".header-section > .search-wrapper\").stop(true).fadeOut(100);\n }\n });\n\n /**\n * close search box when click the outside of the search box itself\n * remove class open on button search toggle\n */\n $('html').click(function () {\n /**\n * hide search on mobile only, because on mobile search act like a drop down\n * remove active class too\n */\n if (isExtraSmall) {\n $(\".mobile-search\").removeClass(\"active\");\n $(\".header-section > .search-wrapper\").stop(true).fadeOut(100);\n }\n\n $(\".user-dropdown\").removeClass(\"active\");\n $(\".list-menu\").stop(true).slideUp(100);\n });\n\n /**\n * stop all events when click reach the header-section\n * it prevent to close the search box when user click the wrapper of search box\n * itself until click event reach the html tag and close it as function that we have defined before\n */\n $('.user-menu, .header-section > .search-wrapper').click(function (event) {\n event.stopPropagation();\n });\n }", "title": "" }, { "docid": "eb4b4af5311cf8ef36b38a0acc1f4156", "score": "0.60027015", "text": "function navbar() {\ndocument.write(`\n<ul>\n <li style=\"float:left\"><a href=\"./index.html\">Noah's Mac Shack Home</a></li><br>\n <li><a href=\"./products_display.html${location.search}\">Shopping Cart</a></li>\n <li><div class=\"dropdown\">\n <li><a href=\"./products_display.html${location.search}\">Products</a></li>\n <div class=\"dropdown-content\">\n <a href=\"laptop.html\">Laptops</a><br>\n <a href=\"desktop.html\">Desktops</a><br>\n <a href=\"airpods.html\">AirPods</a><br>\n <a href=\"external.html\">External</a><br>\n <li><a href=\"./login.html${location.search}\">Login</a></li>\n <li><a href=\"./register.html${location.search}\">Registration</a></li>\n <li><a href=\"./index.html${location.search}\">Logout</a></li>\n</ul>\n`);\n}", "title": "" }, { "docid": "c021115238577932e3d6d5731ebf7542", "score": "0.5992457", "text": "function mainMenu(){\n overviewMenu();\n}", "title": "" }, { "docid": "1c14359aead3baa2e8dcb286a66493e1", "score": "0.599244", "text": "function hamburger(){var n=document.querySelector(\".menu-icon\"),e=document.querySelectorAll(\".nav-link:not(.nav-link--overview)\"),t=document.querySelectorAll(\".mobile-nav__link:not(.has-drop)\"),o=document.querySelector(\".mobile-nav\"),a=document.querySelector(\".header\"),i=document.querySelector(\".slide-menu\"),r=document.querySelector(\".nav-link--large > .arrow-forward\"),c=document.querySelector(\".header__logo-link\"),l=document.querySelectorAll(\".nav-link--slide\"),s=document.querySelector(\".nav-link--overview\"),u=function e(t){\n// slideMenuLinks.forEach(link => {\n// if (link.classList.contains('current-menu-item')) {\n// overview.classList.add('whoa');\n// console.log(link);\n// }\n// });\nt.classList.contains(\"nav-link--slide\")?s.classList.add(\"maybe\"):s.classList.remove(\"maybe\")};n.addEventListener(\"click\",function(){window.innerWidth<=990?n.classList.contains(\"open\")?(n.classList.remove(\"open\"),o.style.transform=\"translateX(-100%)\"):(n.classList.add(\"open\"),o.style.transform=\"none\"):a.classList.contains(\"slim\")?a.classList.remove(\"slim\"):a.classList.add(\"slim\")}),e.forEach(function(t){t.addEventListener(\"click\",function(){var e;990<=window.innerWidth&&(document.querySelector(\".nav-link.current-menu-item\").classList.remove(\"current-menu-item\"),t.classList.add(\"current-menu-item\"),a.classList.add(\"slim\"),i.classList.contains(\"open\")&&(i.classList.remove(\"open\"),TweenMax.to(i,.4,{xPercent:-100,autoAlpha:0}),TweenMax.to(r,.4,{rotation:360})),setTimeout(function(){ga(\"send\",\"pageview\",location.pathname),u(t)},1e3))})}),t.forEach(function(t){t.addEventListener(\"click\",function(){var e;window.innerWidth<=990&&(document.querySelector(\".nav-link.current-menu-item\").classList.remove(\"current-menu-item\"),t.classList.add(\"current-menu-item\"),n.classList.remove(\"open\"),o.style.transform=\"translateX(-100%)\",setTimeout(function(){ga(\"send\",\"pageview\",location.pathname)},1e3))})}),c.addEventListener(\"click\",function(){var e=document.querySelector(\".nav-link.current-menu-item\"),t=document.querySelector(\".menu-item-home\");e.classList.remove(\"current-menu-item\"),t.classList.add(\"current-menu-item\")})}", "title": "" } ]
a06b656c7bec0106bf01cd727278fbe5
Number of vertices in the billboard mesh.
[ { "docid": "af94d8127cb166732ebef38f605142ba", "score": "0.72908217", "text": "get vertexCount() {}", "title": "" } ]
[ { "docid": "7b31916c4c90854c94ad20ea1bcd0b25", "score": "0.7356949", "text": "countVertices() {\n return this.vert.count;\n }", "title": "" }, { "docid": "d0994b622ed7cfe8cfa3e24be4277fed", "score": "0.7355524", "text": "verticesCount() {\n return this.vertices().length;\n }", "title": "" }, { "docid": "021305dffdecbc8eae6254d6cfe9dbaa", "score": "0.72174025", "text": "vertexNumber() {\n return this.vertex.length;\n }", "title": "" }, { "docid": "73aab961403523fc9ebced5221f1f973", "score": "0.7192028", "text": "getNumVertices() {\n return this.numVertices;\n }", "title": "" }, { "docid": "849d6bde8ac308c28a52fe535bd117fd", "score": "0.7047054", "text": "function numVertices(){\n\n numV = [];\n var m = objects[objActive].matrix[0].length / 3 ; //number of points per row\n\n numV.push(0);numV.push(1);numV.push(2);numV.push(3);\n var cont = 3;\n //numbers of the vertices for the first row of faces\n for(i=0; i< m-2; i++){\n numV.push(cont);numV.push(cont-1);numV.push(cont+1);numV.push(cont+2);\n cont+=2;\n }\n // number of the vertices for the second row of faces\n numV.push(1);numV.push(2*m);numV.push(2*m+1);numV.push(2);\n cont = 2;\n\n for(i=0; i< m-2; i++){\n numV.push(cont);numV.push(2*m+i+1);numV.push(2*m+i+2);numV.push(cont+2);\n cont+=2;\n }\n // number of the vertices for the rest of the rows\n for (r=2; r< objects[objActive].matrix.length-1; r++){\n for (c=0; c< m-1; c++){\n if (r== objects[objActive].matrix.length-2){\n if (c==0){\n numV.push(r*m+c);numV.push(0);numV.push(3);numV.push(r*m+c+1);\n }\n else{\n numV.push(r*m+c);numV.push(3+2*(c-1));numV.push(3+(2*c));numV.push(r*m+c+1);\n }\n \n }else{\n numV.push(r*m+c);numV.push((r+1)*m+c);numV.push((r+1)*m+c+1);numV.push(r*m+c+1);\n\n }\n\n }\n }\n}", "title": "" }, { "docid": "9cc4ff9eb0537c78fc4b7871d5e64cd7", "score": "0.6908438", "text": "getVertexCount() {\n return 0;\n }", "title": "" }, { "docid": "5bded2b72e439a9cc0835e8532deec6b", "score": "0.68852836", "text": "getVertexCount()\n {\n return this.m_VertexList.length;\n }", "title": "" }, { "docid": "16fe5f28d16dec9ef07002a57e06fc8b", "score": "0.681867", "text": "get totalVertices() {\n return this.vertices.length;\n }", "title": "" }, { "docid": "ea0b569a731adc262745254509f87ffd", "score": "0.6657752", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for (var i = 0, il = cells.length; i < il; ++i) {\n var c = cells[i]\n for (var j = 0, jl = c.length; j < jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc + 1\n }", "title": "" }, { "docid": "7bd85c15588ec3db4505fc1ab4b3bad5", "score": "0.65860575", "text": "set vertexCount(value) {}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.65623397", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "f6e0a63fe45c0be9e797c9e8e12274f1", "score": "0.6535252", "text": "function countVertices(cells) {\n\t var vc = -1\n\t , max = Math.max\n\t for(var i=0, il=cells.length; i<il; ++i) {\n\t var c = cells[i]\n\t for(var j=0, jl=c.length; j<jl; ++j) {\n\t vc = max(vc, c[j])\n\t }\n\t }\n\t return vc+1\n\t}", "title": "" }, { "docid": "f6e0a63fe45c0be9e797c9e8e12274f1", "score": "0.6535252", "text": "function countVertices(cells) {\n\t var vc = -1\n\t , max = Math.max\n\t for(var i=0, il=cells.length; i<il; ++i) {\n\t var c = cells[i]\n\t for(var j=0, jl=c.length; j<jl; ++j) {\n\t vc = max(vc, c[j])\n\t }\n\t }\n\t return vc+1\n\t}", "title": "" }, { "docid": "f6e0a63fe45c0be9e797c9e8e12274f1", "score": "0.6535252", "text": "function countVertices(cells) {\n\t var vc = -1\n\t , max = Math.max\n\t for(var i=0, il=cells.length; i<il; ++i) {\n\t var c = cells[i]\n\t for(var j=0, jl=c.length; j<jl; ++j) {\n\t vc = max(vc, c[j])\n\t }\n\t }\n\t return vc+1\n\t}", "title": "" }, { "docid": "f8b5639afe4e348a435da08e50065c96", "score": "0.645169", "text": "function countVertices(cells) {\n var vc = -1, max = Math.max;\n for(var i = 0, il = cells.length; i < il; ++i){\n var c = cells[i];\n for(var j = 0, jl = c.length; j < jl; ++j)vc = max(vc, c[j]);\n }\n return vc + 1;\n}", "title": "" }, { "docid": "a6fdcf552cdc59cb68a3f1596c038955", "score": "0.64221525", "text": "edgeCount() {\n return this.vertices()\n .reduce((sum, v) => this.adjacencyList[v].size + sum, 0) / 2;\n }", "title": "" }, { "docid": "421aad7901ead55902c8b8f5b3d68134", "score": "0.63639104", "text": "function numVerts(numDims) {\n const d = numDims || state.numDims;\n return Math.pow(2,d);\n}", "title": "" }, { "docid": "380395835e116cb05ee662824d9e215c", "score": "0.63040954", "text": "function getNumBlocks(){\n\t\tvar i = 0;\n\t\tfor(var x = 0; x < gridSize; x++){\n\t\t\tfor(var y = 0; y < gridSize; y++){\n\t\t\t\tif(grid[x][y]) i++;\n\t\t\t}\n\t\t}\n\t\treturn i;\n\t}", "title": "" }, { "docid": "620d0cdab46d1790fc0613438e3e26a1", "score": "0.6299297", "text": "function countRows() {\n return GRID.length;\n }", "title": "" }, { "docid": "de24509b2c82a1a6037d3bfe2786df16", "score": "0.62874764", "text": "function totalCells(){\n return GRID.length * GRID[0].length;\n}", "title": "" }, { "docid": "f23f2ce83cc9e2a020e3a49fc5e4b5bb", "score": "0.6238781", "text": "get totalCells () {\n return this._gridWidth * this._gridHeight\n }", "title": "" }, { "docid": "b7835e1e6e6f0f7e37fa61714ebf4274", "score": "0.62164456", "text": "function getBombNum (mesh) {\n\tvar bombNum = 0;\n\tvar x_min = mesh.position_x - 1 >= 0 ? mesh.position_x - 1 : 0;\n\tvar y_min = mesh.position_y - 1 >= 0 ? mesh.position_y - 1 : 0;\n\tvar z_min = mesh.position_z - 1 >= 0 ? mesh.position_z - 1 : 0;\n\tvar x_max = mesh.position_x + 1 < numberOfSphersPerSide ? mesh.position_x + 1 : numberOfSphersPerSide - 1;\n\tvar y_max = mesh.position_y + 1 < numberOfSphersPerSide ? mesh.position_y + 1 : numberOfSphersPerSide - 1;\n\tvar z_max = mesh.position_z + 1 < numberOfSphersPerSide ? mesh.position_z + 1 : numberOfSphersPerSide - 1;\n\n\tfor (var i = x_min; i <= x_max; i++) {\n\t\tfor (var j = y_min; j <= y_max; j++) {\n\t\t\tfor (var k = z_min; k <= z_max; k++) {\n\t\t\t\tif (position_objects[i][j][k].isBomb) {\n\t\t\t\t\tbombNum++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn bombNum;\n}", "title": "" }, { "docid": "43c5f6feffe40debc335ec5eb452d4de", "score": "0.61766464", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "b402ee058beead4bf913681a665e07c1", "score": "0.6132176", "text": "_countNeighboringMines() {\n\t\tlet mineCount = 0;\n\t\tthis.surroundingCells((cell, coord) => {\n\t\t\tif(cell.mine) mineCount++;\n\t\t});\n\t\treturn mineCount;\n\t}", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6109212", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6109212", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.6109212", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "eb268607cdf5e1e3ab1f1c03883efd48", "score": "0.6077063", "text": "size() {\n return this._board.size();\n }", "title": "" }, { "docid": "35b54d2c6a32179de3554f4b1c6e5215", "score": "0.6070863", "text": "function countEdges() {\n var numOfEdges = this.count() - 1;\n return numOfEdges;\n }", "title": "" }, { "docid": "24af06f04fe05533c899aad77221ff7c", "score": "0.6003402", "text": "function FSS_GetNumberOfCoord()\n{\n\treturn this.coordX.length;\n}", "title": "" }, { "docid": "db7011c1282eddb8f0c14ec31a2a75f8", "score": "0.59940183", "text": "get veiled() {\n /* Get global variables. */\n var veil = this.veil;\n var width = this.width;\n var height = this.height;\n \n var count = 0;\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < width; y++) {\n if (veil[x][y]) count++;\n }\n }\n \n return count;\n }", "title": "" }, { "docid": "94e5b575b2539fb2def7e4678749c764", "score": "0.59709775", "text": "countEdges () { return this.edges.length }", "title": "" }, { "docid": "e1eb678b2cb436330fc7b35f16dcf4d2", "score": "0.5949628", "text": "function countColumns() {\n return GRID[0].length;\n }", "title": "" }, { "docid": "e1eb678b2cb436330fc7b35f16dcf4d2", "score": "0.5949628", "text": "function countColumns() {\n return GRID[0].length;\n }", "title": "" }, { "docid": "2687115f875cbebcf45ed31b3af96047", "score": "0.5947469", "text": "function countRows(){\n return GRID.length;\n}", "title": "" }, { "docid": "1db9bc5ce64d595df113f2e1eccd6174", "score": "0.5943402", "text": "function totalCells() {\n return (countRows()*countColumns());\n }", "title": "" }, { "docid": "6a302f6953b43130046639436542f56f", "score": "0.59419036", "text": "numberOfElements() {\n let running_size = 0;\n for (let sd in this.info) {\n running_size += sd.size;\n }\n return running_size;\n }", "title": "" }, { "docid": "2653ef3fd81869d682fb768235cdb0c8", "score": "0.5921488", "text": "xShape(grid)\n {\n \tif (grid.length < 1) return 0\n \tlet count = 0\n \tfor (let row = 0; row < grid.length; row++) {\n \t for (let col = 0; col < grid[row].length; col++) {\n \t if (this.isValid(row, col, grid)) {\n \t count += 1\n \t this.solve(grid, row, col)\n \t }\n \t }\n \t}\n \treturn count\n }", "title": "" }, { "docid": "a34b9954e73758ebcd72af545c4345bc", "score": "0.59118813", "text": "function gridSize() {\n return(countColumns() + ' x ' + countRows());\n }", "title": "" }, { "docid": "b01cf9877162b8475491ecfc239d10cd", "score": "0.58842874", "text": "dimensions() {\n\t\treturn this.coordinates.length;\n\t}", "title": "" }, { "docid": "1bacb55dd486e645573fef317622ab52", "score": "0.5867816", "text": "function countColumns() {\n return GRID[0].length;\n}", "title": "" }, { "docid": "1bacb55dd486e645573fef317622ab52", "score": "0.5867816", "text": "function countColumns() {\n return GRID[0].length;\n}", "title": "" }, { "docid": "e7df0dcd70c4bdddf24b45de6531424b", "score": "0.58624446", "text": "getSize(){\n\t\tvar ende = this.endindex;\n\t\tif (this.endindex < this.startindex){\n\t\t\tende += this.getPlanet().terrainSize;\n\t\t}\n\t\treturn 1 + (ende - this.startindex);\n\t}", "title": "" }, { "docid": "f2e293558d553887f126f8fd17ec85c4", "score": "0.5833787", "text": "familySize (){\n let count = 1;\n for(let i = 0;i<this.children.length;i++){\n count ++\n }\n return count;\n }", "title": "" }, { "docid": "af0ed75c01cdc407151c9e9b14ad0243", "score": "0.5809315", "text": "countTempRows() {\n\t\tlet rowCount = 0;\n\t\tthis.layout.qHyperCube.qDataPages.forEach(qDataPage => {\n\t\t\trowCount += qDataPage.qMatrix.length;\n\t\t});\n\t\treturn rowCount;\n\t}", "title": "" }, { "docid": "3209f126ef7bee5fb95cd3217ff50764", "score": "0.5797749", "text": "function nrow(matrix){\n\treturn matrix.length;\n}", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.579683", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.579683", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.579683", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "067a8411660cd992f8b729ac70ca3498", "score": "0.5782802", "text": "getWidth() {\n return this._cells.length;\n }", "title": "" }, { "docid": "a9cbd0a3bdb21552c576e83ddc19f6df", "score": "0.5770842", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "34e3e2e80c7794538bdb3fecdeacb44d", "score": "0.5758657", "text": "getNumberOfNeighborBombs(rowIndex, columnIndex) {\n const neighborOffsets = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]; //other variables need append this._?\n const numberOfRows = this._bombBoard.length;\n const numberOfColumns = this._bombBoard[0].length;\n this._numberOfBombs = 0;\n neighborOffsets.forEach(offset => {\n const neighborRowIndex = rowIndex + offset[0];\n const neighborColumnIndex = columnIndex + offset[1];\n if (neighborRowIndex >= 0 && neighborRowIndex < numberOfRows && neighborColumnIndex >= 0 && neighborColumnIndex < numberOfColumns) {\n if (this._bombBoard[neighborRowIndex][neighborColumnIndex] === 'B') {\n return this._numberOfBombs++;\n }\n }\n });\n return this._numberOfBombs;\n }", "title": "" }, { "docid": "18a1e02bda5570cbf41e48280bc5cbc4", "score": "0.5758324", "text": "function setMinesNegsCount(board) {\r\n for (var i = 0; i < gLevel.SIZE; i++) {\r\n for (var j = 0; j < gLevel.SIZE; j++) {\r\n var currPos = { i, j };\r\n var currMines = countNegs(currPos);\r\n board[i][j].minesAroundCount = currMines.length;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cf498c26bfcc63a42fd9a416b4530412", "score": "0.5755524", "text": "function countGridRows(){\n\t\t\treturn dataView.getItems().length;\n\t\t}", "title": "" }, { "docid": "169541c336a8a0cc7ee913104ebabcac", "score": "0.57399464", "text": "get width() {\n let tracker = new Array(this.tile.width);\n tracker.fill(0);\n this.tile.matrix.forEach((row) => {\n row.forEach((cell, i) => {\n if (!!cell) {\n tracker[i] = 1;\n }\n });\n });\n return tracker.filter(el => !!el).length;\n }", "title": "" }, { "docid": "5241b5d59c1f9f4262d17f44b8657ac1", "score": "0.5737806", "text": "numLevels() {\n let maxDimension = Math.max(this.width, this.height);\n let boundary = this.type === 'dzi' ? 1 : this.tileSize;\n let numLevels = 0;\n while (maxDimension >= boundary) {\n maxDimension /= 2;\n numLevels++;\n }\n return numLevels\n }", "title": "" }, { "docid": "ba54d14f51dae3447a8da8a41b013d35", "score": "0.57264996", "text": "function getNumberOfInitialPieces() {\n return (BOARD_NUM_COL / 2 - floor(BOARD_NUM_COL / 15) - 1) * BOARD_NUM_COL;\n}", "title": "" }, { "docid": "316ca8ce7eafcfb7e5cc9e5609255ee9", "score": "0.57263345", "text": "getTriangleCount()\n {\n return this.m_TriangleList.length;\n }", "title": "" }, { "docid": "9cf5c02fd515ea195ada47165d39e2cb", "score": "0.5719872", "text": "getNumColumns() {\n return this.getSize().getData()[1];\n }", "title": "" }, { "docid": "2b4f42047cdf1aa91faadec3cd852dc8", "score": "0.57174367", "text": "getNumberOfNeighborBombs (rowIndex, columnIndex) {\n // Constant that identifies all possible offset (adjacent) squares\n // to selected square\n const neighborOffsets = [[1, 1],\n [1, 0],\n [1, -1],\n [0, 1],\n [0, -1],\n [-1, 1],\n [-1, 0],\n [-1, -1]];\n // Constants that get the board dimensions\n const numberOfRows = this._bombBoard.length;\n const numberOfColumns = this._bombBoard[0].length;\n // Variable that determines the number of adjacent bombs\n let numberOfBombs = 0;\n // Check each offset to determine the number of bombs next to it\n neighborOffsets.forEach(offset => {\n const neighborRowIndex = rowIndex + offset[0];\n const neighborColumnIndex = columnIndex + offset[1];\n // Check to make sure that the array position is valid\n if (neighborRowIndex >= 0 && neighborRowIndex < numberOfRows &&\n neighborColumnIndex >= 0 && neighborColumnIndex < numberOfColumns) {\n // If board position is valid, check for a bomb and increment if found\n if (this._bombBoard[neighborRowIndex][neighborColumnIndex] === 'B') {\n numberOfBombs++;\n }\n }\n });\n // Return the number of bombs next to this node\n return numberOfBombs;\n }", "title": "" }, { "docid": "59c1f950af1147b40c0fb3349e596096", "score": "0.57090616", "text": "getNumberOfNeighborBombs(rowIndex, columnIndex) {\n const neighborOffsets = [\n [-1, -1],\n [-1, 0],\n [-1, 1],\n [0, -1],\n [0, 1],\n [1, -1],\n [1, 0],\n [1, 1]\n ];\n const numberOfRows = this._bombBoard.length;\n const numberOfColumns = this._bombBoard[0].length;\n let numberOfBombs = 0;\n\n neighborOffsets.forEach(offset => {\n const neighborRowIndex = rowIndex + offset[0];\n const neighborColumnIndex = columnIndex + offset[1];\n\n if (neighborRowIndex >= 0 && neighborRowIndex < numberOfRows && neighborColumnIndex >= 0 && neighborColumnIndex < numberOfColumns) {\n if (this._bombBoard[neighborRowIndex][neighborColumnIndex] === 'B') {\n numberOfBombs++;\n }\n }\n });\n\n return numberOfBombs;\n }", "title": "" }, { "docid": "ff979ed7aa828ad89f468d45c0554ba4", "score": "0.5698461", "text": "getRowCount() {}", "title": "" }, { "docid": "4b14fc058d075b13cc366ed9da9f2984", "score": "0.5682549", "text": "countActiveNeighbours() {\n // returns number of active neighbours\n this.activecount=0;\n for (let i = 0; i < 3; i++) {\n if (this.neighbours[i] && this.neighbours[i].active) {\n this.activecount++;\n }\n }\n return this.activecount;\n }", "title": "" }, { "docid": "d625d61aa1d3193c10bacc4083c0f964", "score": "0.5673875", "text": "function getDimensions () {\n for (var i = 0; i < vertices.length; i += 1) {\n var v = vertices[i];\n\n if (typeof self.minX === 'undefined' || v.x < self.minX) {\n self.minX = v.x;\n }\n\n if (typeof self.minY === 'undefined' || v.y < self.minY) {\n self.minY = v.y;\n }\n\n if (typeof self.minZ === 'undefined' || v.z < self.minZ) {\n self.minZ = v.z;\n }\n\n if (typeof self.maxX === 'undefined' || v.x > self.maxX) {\n self.maxX = v.x;\n }\n\n if (typeof self.maxY === 'undefined' || v.y > self.maxY) {\n self.maxY = v.y;\n }\n\n if (typeof self.maxZ === 'undefined' || v.z > self.maxZ) {\n self.maxZ = v.z;\n }\n }\n\n self.lengthX = Math.abs(self.maxX - self.minX);\n self.lengthY = Math.abs(self.maxY - self.minY);\n self.lengthZ = Math.abs(self.maxZ - self.minZ);\n }", "title": "" }, { "docid": "f338ef8602ee5689d43a9d30ea402af6", "score": "0.56715333", "text": "function countCells(board) {\n\tvar cells = 0;\n\tfor (var y = 0; y < HEIGHT; y++) {\n\t\tfor (var x = 0; x < WIDTH; x++) {\n\t\t\tif (board[y][x]) {\n\t\t\t\tcells++;\n\t\t\t}\n\t\t}\n\t}\n\treturn cells;\n}", "title": "" }, { "docid": "de13c361a42835a8f091d7b262a738f9", "score": "0.56619084", "text": "size() {\n return this._n;\n }", "title": "" }, { "docid": "97b4cd2f15ccf33dc1d3921d7bfa5ecc", "score": "0.56596094", "text": "getSize() {\n // returns the number of edges\n var cnt = 0;\n var get_keys = this.getKeys();\n\n // iterate over all the keys\n for (var i of get_keys) {\n var get_values = this.AdjList.get(i);\n // iterate over all the values\n /*for (var j of get_values) {\n cnt += 1;\n }*/\n cnt += get_values.length;\n }\n return cnt;\n }", "title": "" }, { "docid": "155e3f757f775c3907dc9f23b1a451fe", "score": "0.5644581", "text": "get count() {\n\t\tconst data = engine.getParsedBuffer(this['path']);\n\t\tconst length = Object.keys(data[this['table']]).length;\n\t\treturn length;\n\t}", "title": "" }, { "docid": "aefdbdd2d4c9b0fb980f3827f81eff58", "score": "0.5636315", "text": "countKegs() {\n this.numberKegs = 0;\n for (let x = 0; x < this.board.length; x++) {\n for (let y = 0; y < this.board[x].length; y++) {\n if (this.board[x][y] === \"K\" || this.board[x][y] === \"KB\") {\n this.numberKegs++;\n }\n }\n }\n return this.numberKegs\n }", "title": "" }, { "docid": "24024fc2bac21a5fd50434d634dbd7ca", "score": "0.5617655", "text": "getRows() {\n return this.matrix.length;\n }", "title": "" }, { "docid": "7e7b19764aa3612cf88cf45a0176f121", "score": "0.56071126", "text": "getNumberOfSides() {\n return this.points.length\n }", "title": "" }, { "docid": "91a522ee601b21546552b531d47a1fad", "score": "0.5593693", "text": "getNumberOfNeighborBombs(rowIndex, columnIndex){\n //start by creating nested array to define the offsets of each tile based on the center tile. Works only with a 3x3 board.\n const neighborOffsets = [\n [-1,-1],\n [-1,0],\n [-1,1],\n [0,-1],\n [0,1],\n [1,-1],\n [1,0],\n [1,1]\n ];\n \n const numberOfRows = this._bombBoard.length;\n const numberOfColumns = this._bombBoard[0].length;\n \n let numberOfBombs = 0; //this will increase based on the tile flipped later down and the number of bombs around that tile\n \n //check each of the offset arrays above\n neighborOffsets.forEach(offset =>{\n let neighborRowIndex = rowIndex + offset[0];\n let neighborColumnIndex = columnIndex + offset[1];\n //make sure that the tile checked isnt outside the board by making sure the row/column selected is within the number of rows/columns of the generated board\n if(neighborRowIndex >= 0 && neighborRowIndex < numberOfRows && neighborColumnIndex >= 0 && neighborColumnIndex < numberOfColumns){\n //if there is a bomb on that row/column, then add it to the number of bomb to inform the user\n if(this._bombBoard[neighborRowIndex][neighborColumnIndex] === 'B'){\n numberOfBombs++;\n }\n }\n });\n return numberOfBombs;\n }", "title": "" }, { "docid": "b90276736c7db189f2bc54b6d93ca03f", "score": "0.55790395", "text": "size(){\n return this.#count - this.#lowestCount;\n }", "title": "" }, { "docid": "8c2b9569f043a28e042a8c913de0ffa2", "score": "0.55758184", "text": "size() {\n return this.count - this.lowestcount;\n }", "title": "" }, { "docid": "197cc6b5d1a9912d6d686efb4ca21da4", "score": "0.556848", "text": "getNumberOfNeighborBombs(rowIndex, columnIndex) {\n\n // All possible adjacent options to a flipped tile\n const neighborOffsets = [\n [-1, -1], \n [-1, 0],\n [-1, 1],\n [0, -1],\n [0, 1],\n [1, -1],\n [1, 0],\n [1, 1]\n ];\n\n // Finds the number of rows on the bomboard\n const numberOfRows = this._bombBoard.length;\n\n // Finds the number of columns in a row\n const numberOfColumns = this._bombBoard[0].length;\n\n // Stores the number of bombs adjacent to a flipped tile\n let numberOfBombs = 0;\n\n // Use the row and column offsets to check the neighbors around a flipped tile\n neighborOffsets.forEach( offset => {\n\n\n const neighborRowIndex = rowIndex + offset[0];\n const neighborColumnIndex = columnIndex + offset[1];\n\n // Conditions that must be passed before incrementing the number of bombs\n if ( neighborRowIndex >= 0 && neighborRowIndex < numberOfRows && \n neighborColumnIndex >= 0 && neighborColumnIndex < numberOfColumns ) {\n if ( this._bombBoard[neighborRowIndex][neighborColumnIndex] === 'B' ) {\n numberOfBombs++;\n }\n } \n\n });\n // log the no. of bombs so we can see 'em!\n // console.log(`I found ${this._numberOfBombs} bombs`); \n return numberOfBombs;\n\n }", "title": "" }, { "docid": "7e99d76cd91b3291147bf742a94d7319", "score": "0.5558113", "text": "size(){\n console.log(`${this.count}elements in the stack`);\n return this.count\n }", "title": "" }, { "docid": "5d9a0be9cb1eb34627134488587f40e1", "score": "0.55536395", "text": "function size() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}", "title": "" }, { "docid": "85237918bdc6c082d2d97250d7a7e490", "score": "0.555129", "text": "get vertices() {\n return this.m_geometry.vertices;\n }", "title": "" }, { "docid": "a7c437acc170a75f9058583ed4b751db", "score": "0.5544813", "text": "function dimension(cells) {\n var d = 0\n , max = Math.max\n for (var i = 0, il = cells.length; i < il; ++i) {\n d = max(d, cells[i].length)\n }\n return d - 1\n }", "title": "" }, { "docid": "3bc5e317364523429af5752299ffcd43", "score": "0.5541533", "text": "function getRowCount() {\n return data.length;\n }", "title": "" }, { "docid": "2f2f4906bfbe3607eac280d684394d9a", "score": "0.5535776", "text": "getNumRows() {\n return this.getSize().getData()[0];\n }", "title": "" }, { "docid": "24785269bdc813a8fcd974fe8c5dee9c", "score": "0.5534757", "text": "getNumberOfSides() {\n return this.points.length\n }", "title": "" }, { "docid": "77375ddd1c8eacaeff315719808cb522", "score": "0.55317354", "text": "get_length(voronoi_viz) {\n return this.all.length; //>breaks if you do voronoi_viz.site_db.all.length\n }", "title": "" }, { "docid": "69e812ad17c4980a774284f73d6bb2cf", "score": "0.55309695", "text": "getSize() {\r\n return 6 * this.sides + 6 * this.sides * this.bands;\r\n }", "title": "" }, { "docid": "69e812ad17c4980a774284f73d6bb2cf", "score": "0.55309695", "text": "getSize() {\r\n return 6 * this.sides + 6 * this.sides * this.bands;\r\n }", "title": "" }, { "docid": "00db4998f5aa8fcc7b4f4a240678803a", "score": "0.5520383", "text": "function countNumbers(x,y) {\n if (inBounds(x-1,y-1)) {grid[x-1][y-1].number++;}\n if (inBounds(x ,y-1)) {grid[x ][y-1].number++;}\n if (inBounds(x+1,y-1)) {grid[x+1][y-1].number++;}\n if (inBounds(x-1,y )) {grid[x-1][y ].number++;}\n if (inBounds(x+1,y )) {grid[x+1][y ].number++;}\n if (inBounds(x-1,y+1)) {grid[x-1][y+1].number++;}\n if (inBounds(x ,y+1)) {grid[x ][y+1].number++;}\n if (inBounds(x+1,y+1)) {grid[x+1][y+1].number++;}\n}", "title": "" }, { "docid": "d961f97855a94789b2d1bac095290b57", "score": "0.55181354", "text": "countBomb(){\n\tif (this.bomb){\n\t\treturn -1;\n\t}\n\tlet bombCount = 0;\n\t//checking around the cell's proximity\n\tfor(let i =-1; i<=1;i++ ){\n\t\tfor (let j = -1; j<=1; j++){\n\t\t\tlet k = this.i + i;\n\t\t\tlet l = this.j + j; \n\t\t\t//Have to check for neighbors ponly on grid\n\t\t\tif (k > -1&& k <column&& l >-1&& l < rows){\n\t\t\t\tlet neighbor = board[k][l];\t\n\t\t\t\tif (neighbor.bomb){\n\t\t\t\t\tbombCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tthis.bombNumb = bombCount;\n}", "title": "" }, { "docid": "65fee0d409625f1529dbfa807fa02c8a", "score": "0.5513657", "text": "getNumEdges() {\n return this.numEdges;\n }", "title": "" }, { "docid": "8df2695aa5e5cf8edf6e81ccbaeef5a8", "score": "0.55089957", "text": "size () {\n let total = 1;\n\n if (this.isLeaf()) {\n return total;\n }\n\n util.each(this.getChildren(), (child) => {\n total += child.size();\n });\n\n return total;\n }", "title": "" }, { "docid": "b35d66f222c8575167673d492bd355b4", "score": "0.55086374", "text": "blossomSize(B) {\n\t\tlet k = 0;\n\t\tfor (let u = this.firstIn(B); u; u = this.nextIn(B,u))\n\t\t\tk++;\n\t\treturn k;\n\t}", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.55080885", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.55080885", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "a4beceb11e26f2bdf03ed33a17c1a459", "score": "0.5503149", "text": "countNeighbors(index) {\n var aliveNeighborCount = 0;\n var neighborList = [\n {x:-1, y:-1}, {x:-1, y:0},{x:-1, y:1},\n {x:0, y:-1}, null , {x:0, y:1},\n {x:1, y:-1}, {x:1, y:0},{x:1, y:1} \n ];\n\n neighborList.forEach((cellCoord) => {\n if(!cellCoord) { return;}\n var neighborX = index.x + cellCoord.x;\n var neighborY = index.y + cellCoord.y;\n //will return if the item is out of bounds\n if( neighborX < 0 || neighborY < 0 || neighborX > (this.sqroot -1 ) || neighborY > (this.sqroot - 1)) {\n return;\n }\n\n var square = this.board[neighborX][neighborY];\n if(square.alive) {\n aliveNeighborCount++;\n }\n\n });\n\n return aliveNeighborCount;\n }", "title": "" }, { "docid": "3850989bf011ed29bef93ca68ed787fa", "score": "0.5502359", "text": "function getNumPieces(col){\n let npieces = 0;\n for (let i = 0; i < maxRow; i++){\n if (boards[i][col] !== 0){\n npieces++;\n }\n }\n return npieces;\n}", "title": "" }, { "docid": "135985a350f2e781975115f719f69740", "score": "0.54893893", "text": "_boxesPerRow() {\n return Math.floor(this._width / (this._boxSize + this._boxSpacing));\n }", "title": "" } ]
833323901d6ab57539a8c4b241d74faa
/// FUNCTION CALL FOR NORMALIZATION /////
[ { "docid": "f8b059b14c72d959690345c61f35adb1", "score": "0.0", "text": "function normalizeTables() {\n $.when(setJSON()).then(\n $.ajax({\n type: 'post',\n url: \"http://localhost:5000/api/normalize/\",\n contentType: \"application/json\",\n async: false,\n data: s,\n success: function(data) {\n var div = document.getElementById('sqlstatement');\n div.innerHTML = '';\n\n div.innerHTML += data;\n \n $(\"#sql\").overlay().load();\n }\n })\n )\n}", "title": "" } ]
[ { "docid": "0eb53ca5aabf60d4285fdbad327de367", "score": "0.7206527", "text": "normalize()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "ff84a21e0bc366a34999d33cb1d00119", "score": "0.6768713", "text": "function Normalizer() {\n}", "title": "" }, { "docid": "ca220ce18fe7b0b9b108ec2f9cbaa379", "score": "0.62309444", "text": "static OrthoNormalize() {}", "title": "" }, { "docid": "43e47669386dec7800ec263114605d92", "score": "0.60574573", "text": "function Transform() {}", "title": "" }, { "docid": "43e47669386dec7800ec263114605d92", "score": "0.60574573", "text": "function Transform() {}", "title": "" }, { "docid": "43e47669386dec7800ec263114605d92", "score": "0.60574573", "text": "function Transform() {}", "title": "" }, { "docid": "43e47669386dec7800ec263114605d92", "score": "0.60574573", "text": "function Transform() {}", "title": "" }, { "docid": "43e47669386dec7800ec263114605d92", "score": "0.60574573", "text": "function Transform() {}", "title": "" }, { "docid": "aa7f8b73ed5a8ad4548258cad458aa05", "score": "0.6054251", "text": "function transform() {}", "title": "" }, { "docid": "f4d49c24e7f8627d9a74d3b8e137ff03", "score": "0.58966315", "text": "function o$9(o,d){0===d.normalType&&(o.attributes.add(\"normal\",\"vec3\"),o.vertex.code.add(t$l`\n vec3 normalModel() {\n return normal;\n }\n `)),1===d.normalType&&(o.include(o$a),o.attributes.add(\"normalCompressed\",\"vec2\"),o.vertex.code.add(t$l`\n vec3 normalModel() {\n return decodeNormal(normalCompressed);\n }\n `)),3===d.normalType&&(o.extensions.add(\"GL_OES_standard_derivatives\"),o.fragment.code.add(t$l`\n vec3 screenDerivativeNormal(vec3 positionView) {\n return normalize(cross(dFdx(positionView), dFdy(positionView)));\n }\n `));}", "title": "" }, { "docid": "58f3180bc0cd097ffc2f67e004b60948", "score": "0.57956886", "text": "calculateTransformation() {\r\n\t\t// Override me!\r\n\t}", "title": "" }, { "docid": "3e8a066853884c849672910d378217fb", "score": "0.57546693", "text": "get normalized() {}", "title": "" }, { "docid": "f96142d165f47a03e1c0d5ffa3392619", "score": "0.57497203", "text": "_transformDataObject(dataObject) { }", "title": "" }, { "docid": "4772fa492c78c63cd1cbc34007274033", "score": "0.5744934", "text": "function normalize(vector) {\n}", "title": "" }, { "docid": "c77c926a160aad9fcc6216ddb92328da", "score": "0.572919", "text": "normalise() {\n\t\tlet m = this.mag();\n\n\t\tif (m != 0) {\n\t\t\treturn scaleDown(m);\n\t\t}\n\t}", "title": "" }, { "docid": "356e1fdf50a3bf7879efaf184e8fab4a", "score": "0.5666377", "text": "setNormals(){\n //TODO SUBCLASS\n }", "title": "" }, { "docid": "2a4b993d6b254b46df806ce7b2ed0cd9", "score": "0.56434923", "text": "function testNormalizeScale(){\n/*\n\tvar selectedAlgorithm = algorithmFactory.createSequence(\"Phi\");\n\tmusicAlgorithms.setAlgorithm(selectedAlgorithm);\n\n\tvar normalizeChoice = normalizeFactory.createNormalizer(\"Modulo\");\n\tmusicNormalize.setAlgorithm(normalizeChoice);\n\t\n\tvar currData = musicAlgorithms.getValues(4);\n\talert(\"Hello \"+musicNormalize.normalize(currData,1,88));\n*/\t\n\n//\tmusicAlgorithms.getValues(23);\n\n/*\n\tvar compressedObject = document.getElementById(\"compressType\");\n\talert(\"ha:\"+compressedObject.options[compressedObject.selectedIndex].text);\n\n*/\t\n//alert(\"ha:\"+factory(compressedObject.options[algorithm.selectedIndex].text));\n\n}", "title": "" }, { "docid": "646b44e2b0a6560d41d66e625b40889a", "score": "0.5624737", "text": "normalize()\n {\n const mag = this.magnitude();\n if (mag === 0){console.log(\"Tried normalizing vector with 0 magnitude.\"); return V2.zero;}\n return new V2(this.x / mag, this.y / mag);\n }", "title": "" }, { "docid": "3c548c76e743fbdb59b622fe959bb381", "score": "0.5623", "text": "function l$4(l,e){0===e.normalType||1===e.normalType?(l.include(o$9,e),l.varyings.add(\"vNormalWorld\",\"vec3\"),l.varyings.add(\"vNormalView\",\"vec3\"),l.vertex.uniforms.add(\"uTransformNormal_GlobalFromModel\",\"mat3\"),l.vertex.uniforms.add(\"uTransformNormal_ViewFromGlobal\",\"mat3\"),l.vertex.code.add(t$l`\n void forwardNormal() {\n vNormalWorld = uTransformNormal_GlobalFromModel * normalModel();\n vNormalView = uTransformNormal_ViewFromGlobal * vNormalWorld;\n }\n `)):2===e.normalType?(l.include(t$8,e),l.varyings.add(\"vNormalWorld\",\"vec3\"),l.vertex.code.add(t$l`\n void forwardNormal() {\n vNormalWorld = ${1===e.viewingMode?t$l`normalize(vPositionWorldCameraRelative);`:t$l`vec3(0.0, 0.0, 1.0);`}\n }\n `)):l.vertex.code.add(t$l`\n void forwardNormal() {}\n `);}", "title": "" }, { "docid": "d934355cc91f0a7161b4116f7bed3b66", "score": "0.55806553", "text": "static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t result.w = w;\r\n\t }", "title": "" }, { "docid": "d934355cc91f0a7161b4116f7bed3b66", "score": "0.55806553", "text": "static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t result.w = w;\r\n\t }", "title": "" }, { "docid": "b5f89fff2e74fe84c43e03998ae1ddd4", "score": "0.55268455", "text": "apply(){ //abstract function\n //If current state is vec3\n //scene.translate\n //screen.rotate x3\n //screen.scale\n //else current state is matrix\n //scene.multMatrix\n\n\n\n\n }", "title": "" }, { "docid": "50e588f91f0e321a0658ead50517cb9e", "score": "0.54813635", "text": "normalize() {\n this.div(this.magnitude);\n }", "title": "" }, { "docid": "a5492f68e7e9f31f01439bf4b550712c", "score": "0.54532176", "text": "set normalized(value) {}", "title": "" }, { "docid": "f785b31a6cf0e1d6d6a07ba1acb6cb52", "score": "0.54520124", "text": "function transform(data){\n}", "title": "" }, { "docid": "5f67c320613b911f8ce4849b1cede129", "score": "0.5449917", "text": "function o$a(o){const d=t$l`\n vec3 decodeNormal(vec2 f) {\n float z = 1.0 - abs(f.x) - abs(f.y);\n return vec3(f + sign(f) * min(z, 0.0), z);\n }\n `;o.fragment.code.add(d),o.vertex.code.add(d);}", "title": "" }, { "docid": "2ffa51749f3b5e93a7681f24536ccd3b", "score": "0.54089224", "text": "function normalise(v, s) {\n if (typeof s === \"undefined\") s = 1;\n if (v.magnitude() === 0) return v.map(e => e);\n return v.multiplyScalar(s / v.magnitude());\n }", "title": "" }, { "docid": "224dd64c57a12ab791f35a05283d262c", "score": "0.5404356", "text": "function normalize() {\n console.log(this.coords.map(n => n / this.length));\n } // Both normalize and its inside funtions can access object props", "title": "" }, { "docid": "82fa8d973efa41ead6a2da037355a5bc", "score": "0.53741616", "text": "static normalize(vector){\n \tlet magnitude = Vector.magnitude(vector)\n return Vector.divide(vector, magnitude)\n }", "title": "" }, { "docid": "27308cb13efa88a14ed4d6001adc7d5f", "score": "0.53472275", "text": "static NormalizeToRef(vector, result) {\r\n\t result.copyFrom(vector);\r\n\t result.normalize();\r\n\t }", "title": "" }, { "docid": "27308cb13efa88a14ed4d6001adc7d5f", "score": "0.53472275", "text": "static NormalizeToRef(vector, result) {\r\n\t result.copyFrom(vector);\r\n\t result.normalize();\r\n\t }", "title": "" }, { "docid": "1d40db57d42633ff3ddad2748e40bcfe", "score": "0.53407294", "text": "function normalizer(array) {\n if (averageVotes(array, \"D\") !== 0) {\n statistics.democrats.averageVotes = (averageVotes(array, \"D\") / statistics.democrats.numberOfMembers).toFixed(2);\n\n } else {\n statistics.democrats.averageVotes = 0;\n }\n if (averageVotes(array, \"R\") !== 0) {\n statistics.republicans.averageVotes = (averageVotes(array, \"R\") / statistics.republicans.numberOfMembers).toFixed(2);\n\n } else {\n statistics.republicans.averageVotes = 0;\n }\n if (averageVotes(array, \"I\") !== 0) {\n statistics.independents.averageVotes = (averageVotes(array, \"I\") / statistics.independents.numberOfMembers).toFixed(2);\n } else {\n statistics.independents.averageVotes = 0;\n }\n}", "title": "" }, { "docid": "afed265c56b3ea5de8982900dc5c21e4", "score": "0.53379256", "text": "normalize(prop) {\n return this.decl(prop).normalize(prop)\n }", "title": "" }, { "docid": "afed265c56b3ea5de8982900dc5c21e4", "score": "0.53379256", "text": "normalize(prop) {\n return this.decl(prop).normalize(prop)\n }", "title": "" }, { "docid": "649ca2b7fe812d606a52894559b8bd1d", "score": "0.53356665", "text": "function entityStaticTransform(ent,mtx){\n\tfor(var i=0;i<ent.quads.length;++i){\n\t\t/*Matrix.Transform(ent.quads[i].p0,mtx,ent.quads[i].p0);\n\t\tMatrix.Transform(ent.quads[i].p1,mtx,ent.quads[i].p1);\n\t\tMatrix.Transform(ent.quads[i].p2,mtx,ent.quads[i].p2);\n\t\tMatrix.Transform(ent.quads[i].p3,mtx,ent.quads[i].p3);\n\t\tMatrix.Transform(ent.quads[i].normal,mtx,ent.quads[i].normal);\n\t\tVec.Normalize(ent.quads[i].normal,ent.quads[i].normal);*/\n\t\tQuad.Transform(ent.quads[i],mtx,ent.quads[i]);\n\t}\n}", "title": "" }, { "docid": "6ad4d2818c962fea0d39a4fb6e1fc017", "score": "0.53183854", "text": "normalize() {\n const dist = this.magnitude;\n this[0] /= dist;\n this[1] /= dist;\n }", "title": "" }, { "docid": "21115d19a01e540141ecf8a365ced946", "score": "0.5304719", "text": "static TransformNormalFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "21115d19a01e540141ecf8a365ced946", "score": "0.5304719", "text": "static TransformNormalFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "479f6b689cccfd353ed9acf08034f2ed", "score": "0.53020024", "text": "function normalize() {\n // normalize\n // bepaal de omzettingsformule. Bereken eerst de maximale en minimale x en y waarden.\n let maxx = -Infinity;\n let minx = Infinity;\n let maxy = -Infinity;\n let miny = Infinity;\n for (let i = 0; i < knopen.length; i++) {\n let k = knopen[i];\n if (k.ve == null) {\n print(\"null:\", k.id + \"/\" + k.name, k.span_edges[0].source.id, k.span_edges[0].dest.id);\n } else { // er wordt extra ruimte gelaten van 0.25 eenheden.\n maxx = Math.max(maxx, k.ve.x + 0.25);\n minx = Math.min(minx, k.ve.x - 0.25);\n maxy = Math.max(maxy, k.ve.y + 0.25);\n miny = Math.min(miny, k.ve.y - 0.25);\n }\n }\n let xoffset = 0;\n let yoffset = 0;\n let mxy = Math.max((maxx - minx), (maxy - miny));\n let sxy = Math.min(width, height);\n fxy = sxy / mxy; // de scale factor.\n // de onzettingsfunctie voor x\n cx = function (xin) {\n return (xin - minx) * fxy - xoffset;\n }\n // de onzettingsfunctie voor y\n cy = function (yin) {\n return height - (yin - miny) * fxy - yoffset;\n }\n xoffset = ((cx(maxx) - cx(minx)) - width) / 2;\n yoffset = (cy(maxy) - cy(miny) + height) / 2;\n\n // update de x/y coordinaten en de lengtes/diameters.\n for (let i = 0; i < knopen.length; i++) {\n let k = knopen[i];\n if (k.ve != null) {\n k.x = cx(k.ve.x);\n k.y = cy(k.ve.y);\n k.ra = k.ra * fxy;\n k.len = k.len * fxy;\n } else {\n print(\"fout:\", k.id)\n }\n }\n\n // update de x/y coordinaten van de triangles\n for (let i = 0; i < triangles.length; i++) {\n let t = triangles[i];\n t.lx = cx(t.posL.x);\n t.ly = cy(t.posL.y);\n t.rx = cx(t.posR.x);\n t.ry = cy(t.posR.y);\n t.px = cx(t.posP.x);\n t.py = cy(t.posP.y);\n }\n\n // bereken de min en max van de afstanden. (t.b.v. de legenda)\n let mind = Infinity;\n let maxd = -Infinity;\n for (let i = 0; i < span_edges.length; i++) {\n let e = span_edges[i];\n e.ra = e.ra * fxy;\n mind = Math.min(mind, e.cost);\n maxd = Math.max(maxd, e.cost);\n }\n // Welke verschillende afstanden zijn er. Er wordt gebruik gemaakt van een Set die de dubbelen verwijderd. \n let afstandlijst = Array.from(new Set(span_edges.map(e => parseInt(e.cost)))).sort((a, b) => a - b);\n distance = { mind, maxd, afstandlijst };\n\n // bepaal de minimale afstand vanuit elke node afzonderlijk\n // en kenmerk de edge (lds en ldd) wanneer deze voor de betreffende knoop de minimum afstand heeft.\n nodemin = []; // de minimale afstand tot een andere node\n knopen.filter(k => !k.nep).forEach(k => {\n let m = k.edges.reduce((a, el) => Math.min(a, el.cost), Infinity);\n nodemin.push({ k, m });\n k.edges.filter(e => !e.nep && e.cost == m).forEach(ed => {\n if (k.id == ed.source.id) ed.lds = true;\n if (k.id == ed.dest.id) ed.ldd = true;\n })\n })\n // neem het kenmerk over naar de eventuele nepedge.\n edges.filter(k => k.nep).forEach(e => {\n e.lds = e.orig_edge.lds;\n e.ldd = e.orig_edge.ldd;\n })\n nodemin.sort((a, b) => a.k.name > b.k.name); // sorteer op naam (alfabetisch!!)\n}", "title": "" }, { "docid": "991e8e669bed758f0cd1235ea0af69da", "score": "0.5293752", "text": "normLines(vm) {\n\t\t\tlet nv = [] ;\n\t\t\tlet v = this.obj_v\n\t\t\tlet n = this.obj_n ;\n\t\t\tif(vm==undefined) vm = 0.1\n\t\t\tfor(let i=0,l=v.length;i<l;i++) {\n\t\t\t\tnv.push(v[i][0]) ;\n\t\t\t\tnv.push(v[i][1]) ;\n\t\t\t\tnv.push(v[i][2]) ;\n\t\t\t\tnv.push(v[i][0]+n[i][0]*vm) ;\n\t\t\t\tnv.push(v[i][1]+n[i][1]*vm) ;\n\t\t\t\tnv.push(v[i][2]+n[i][2]*vm) ;\n\t\t\t}\n\t\t\treturn {mode:\"lines\",vtx_at:[\"position\"],vtx:nv} ;\n\t\t}", "title": "" }, { "docid": "9ca9175ccfa9f00754b300d80d5a4d9f", "score": "0.5263068", "text": "function Preprocess (data, origW, origH, normTo) {\n // alert (\"Preprocess\");\n var debug = [];\n\n /**********************************************\n * transform to (0, 0) -> (lenX, lenY)\n **********************************************/\n this.transform = function() {\n // alert (\"normalize\");\n var xMin = data[0].x;\n var yMin = data[0].y;\n for (var i=1; i<data.length; ++i) {\n xMin = (data[i].x < xMin) ? data[i].x : xMin;\n yMin = (data[i].y < yMin) ? data[i].y : yMin;\n }\n // debug.push (\"xMin: \" + xMin);\n // debug.push (\"yMin: \" + yMin);\n\n var dataTrans = [];\n for (var i=0; i<data.length; ++i) {\n dataTrans.push (new Point ( (data[i].x-xMin), (data[i].y-yMin)));\n // debug.push (data[i].toStr () + \" -> \" + dataTrans[i].toStr ());\n }\n\n return dataTrans;\n }\n\n /**********************************************\n * check if there is a gap between two points\n **********************************************/\n this.isGap = function (pnt1, pnt2) {\n if ((Math.abs(pnt2.x - pnt1.x) > 1) || (Math.abs (pnt2.y-pnt1.y) > 1)) {\n return true;\n }\n return false;\n }\n\n /**********************************************\n * get orientation of a line between two points\n **********************************************/\n this.getOrientation = function (pnt1, pnt2) {\n // alert (\"getOrientation\");\n if ((pnt1.x == pnt2.x) && (pnt1.y == pnt2.y)) {\n return \"point\";\n }\n else if (pnt1.x == pnt2.x) {\n return \"vertical\";\n }\n else if (pnt1.y == pnt2.y) {\n return \"horizontal\";\n }\n else if ((pnt1.x < pnt2.x) && (pnt1.y > pnt2.y)) {\n return \"rising\";\n }\n else if ((pnt1.x < pnt2.x) && (pnt1.y < pnt2.y)) {\n return \"falling\";\n }\n else if ((pnt1.x > pnt2.x) && (pnt1.y > pnt2.y)) {\n return \"falling\";\n }\n else if ((pnt1.x > pnt2.x) && (pnt1.y < pnt2.y)) {\n return \"rising\";\n }\n else {\n return \"invalid\";\n }\n }\n\n /**********************************************\n * Equation for a line between two points (x1, y1) and (x2, y2):\n * y = mx + b; x = (y-b)/m\n * m = (y1 - y2) / (x1 - x2)\n * b = y - mx\n **********************************************/\n this.fillGap = function (pnt1, pnt2) {\n // alert (\"fillGap\");\n var xMin = (pnt1.x < pnt2.x) ? pnt1.x : pnt2.x;\n var yMin = (pnt1.y < pnt2.y) ? pnt1.y : pnt2.y;\n var xMax = (pnt1.x > pnt2.x) ? pnt1.x : pnt2.x;\n var yMax = (pnt1.y > pnt2.y) ? pnt1.y : pnt2.y;\n\n var pntsGap = [];\n var orientation = this.getOrientation (pnt1, pnt2);\n // debug.push (\"orientation: \" + orientation);\n if (orientation.localeCompare (\"vertical\") == 0) {\n if (pnt1.y < pnt2.y) {\n for (var y=pnt1.y+1; y<pnt2.y; ++y) {\n pntsGap.push (new Point (xMin, y));\n }\n }\n else {\n for (var y=pnt1.y-1; y>pnt2.y; --y) {\n pntsGap.push (new Point (xMin, y));\n }\n }\n }\n else if (orientation.localeCompare (\"horizontal\") == 0) {\n if (pnt1.x < pnt2.x) {\n for (var x=pnt1.x+1; x<pnt2.x; ++x) {\n pntsGap.push (new Point (x, yMin));\n }\n }\n else {\n for (var x=pnt1.x-1; x>pnt2.x; --x) {\n pntsGap.push (new Point (x, yMin));\n }\n }\n }\n else if (orientation.localeCompare (\"rising\") == 0 ||\n orientation.localeCompare (\"falling\") == 0) {\n var m = (pnt1.y - pnt2.y) / (pnt1.x - pnt2.x);\n var b = pnt1.y - m*pnt1.x;\n if ( ((pnt1.x < pnt2.x) && (pnt1.y > pnt2.y)) ||\n ((pnt1.x < pnt2.x) && (pnt1.y < pnt2.y)) ) {\n for (var x=pnt1.x+1; x<pnt2.x; ++x) {\n pntsGap.push (new Point (x, Math.round (m*x + b)));\n }\n }\n else {\n for (var x=pnt1.x-1; x>pnt2.x; --x) {\n pntsGap.push (new Point (x, Math.round (m*x + b)));\n }\n }\n }\n else {\n alert (\"BAD\");\n }\n\n return pntsGap;\n }\n\n var dataNorm = this.transform ();\n // debug.push (\"dataNorm length: \" + dataNorm.length);\n var dataFlld = [];\n var pnt1 = dataNorm[0];\n dataFlld.push (new Point (pnt1.x, pnt1.y));\n for (var i=1; i<dataNorm.length; ++i) {\n // debug.push (\"i: \" + i);\n var pnt2 = dataNorm[i];\n if (this.isGap (pnt1, pnt2)) {\n // debug.push (\"Gap: \" + pnt1.toStr () + \" -> \" + pnt2.toStr ());\n var pntsOnGap = this.fillGap (pnt1, pnt2);\n for (var j=0; j<pntsOnGap.length; ++j) {\n dataFlld.push (new Point (pntsOnGap[j].x, pntsOnGap[j].y));\n }\n }\n dataFlld.push (new Point (pnt2.x, pnt2.y));\n pnt1 = pnt2;\n }\n for (var i=0; i<dataFlld.length; ++i) {\n // debug.push (\"filled: \" + dataFlld[i].toStr ());\n }\n\n // outputArr (\"debug\", debug);\n return dataFlld;\n}", "title": "" }, { "docid": "6ea2e02dfb18dcbe958d65894c61dca9", "score": "0.5240658", "text": "static TransformNormalToRef(vector, transformation, result) {\r\n\t var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]);\r\n\t var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]);\r\n\t var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]);\r\n\t result.x = x;\r\n\t result.y = y;\r\n\t result.z = z;\r\n\t result.w = vector.w;\r\n\t }", "title": "" }, { "docid": "6ea2e02dfb18dcbe958d65894c61dca9", "score": "0.5240658", "text": "static TransformNormalToRef(vector, transformation, result) {\r\n\t var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]);\r\n\t var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]);\r\n\t var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]);\r\n\t result.x = x;\r\n\t result.y = y;\r\n\t result.z = z;\r\n\t result.w = vector.w;\r\n\t }", "title": "" }, { "docid": "f6266fe6497148ebc2c27ecaca631f9b", "score": "0.52397037", "text": "function setNorms(faceArray, vertexArray, normalArray)\n{\n\n/* console.log(faceArray);\n console.log(vertexArray); */\n for(var i=0; i<faceArray.length;i+=3)\n {\n //find the face normal\n var x_comp = vec3.fromValues(vertexArray[faceArray[i]*3],vertexArray[faceArray[i]*3+1],vertexArray[faceArray[i]*3+2]);\n \n var y_comp = vec3.fromValues(vertexArray[faceArray[i+1]*3],vertexArray[faceArray[i+1]*3+1],vertexArray[faceArray[i+1]*3+2]);\n \n var z_comp = vec3.fromValues(vertexArray[faceArray[i+2]*3],vertexArray[faceArray[i+2]*3+1],vertexArray[faceArray[i+2]*3+2]);\n \n var vect31=vec3.create(), vect21=vec3.create();\n vec3.sub(vect21,y_comp,x_comp);\n vec3.sub(vect31,z_comp,x_comp)\n\n var v=vec3.create();\n vec3.cross(v,vect21,vect31);\n \n //add the face normal to all the faces vertices\n normalArray[faceArray[i]*3 ]+=v[0];\n normalArray[faceArray[i]*3+1]+=v[1];\n normalArray[faceArray[i]*3+2]+=v[2];\n\n normalArray[faceArray[i+1]*3]+=v[0];\n normalArray[faceArray[i+1]*3+1]+=v[1];\n normalArray[faceArray[i+1]*3+2]+=v[2];\n\n normalArray[faceArray[i+2]*3]+=v[0];\n normalArray[faceArray[i+2]*3+1]+=v[1];\n normalArray[faceArray[i+2]*3+2]+=v[2];\n\n }\n \n //normalize each vertex normal\n for(var i=0; i<normalArray.length;i+=3)\n {\n var v = vec3.fromValues(normalArray[i],normalArray[i+1],normalArray[i+2]); \n vec3.normalize(v,v);\n if(i + 2 > normalArray.length)\n break; \n normalArray[i ]=v[0];\n normalArray[i+1]=v[1];\n normalArray[i+2]=v[2];\n }\n \n //return the vertex normal\n return normalArray;\n}", "title": "" }, { "docid": "4992e3cffe23ca843a04f95d5b039db8", "score": "0.52147764", "text": "normals() {\n const normalsArray = [];\n for (let face of this.faces) {\n normalsArray.push(normal(face.map(vidx => this.vertices[vidx])));\n }\n return normalsArray;\n }", "title": "" }, { "docid": "135c9fe4d0c0fbf61fe25fd5f9119f1b", "score": "0.5205887", "text": "getNormal() {\n return this.getNormals()[0];\n }", "title": "" }, { "docid": "99f14f1f12f90af1e734fa44ee27d852", "score": "0.5200945", "text": "static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {\n const m = transformation.m;\n result.x = (x * m[0]) + (y * m[4]) + (z * m[8]);\n result.y = (x * m[1]) + (y * m[5]) + (z * m[9]);\n result.z = (x * m[2]) + (y * m[6]) + (z * m[10]);\n result.w = w;\n }", "title": "" }, { "docid": "19bde19b6011657a91651068b709cfd4", "score": "0.5194589", "text": "static Denormalize(normalized, min, max) {\n return (normalized * (max - min) + min);\n }", "title": "" }, { "docid": "cd46ff9d93d769493155a3e89486c9e2", "score": "0.5187835", "text": "static Z_Normalization2D (dataRef) {\n let data = {};\n for (let i in dataRef) {\n let count = 0;\n for (let v in dataRef[i]) {\n if (count === 0) {\n data[v] = {};\n data[v].data = [];\n data[v].mean = 0;\n data[v].sd = 0;\n }\n dataRef[i][v].forEach(e=>{\n if (typeof (e) === 'number') data[v].data.push(e);\n });\n }\n count += 1;\n }\n for (let v in data) {\n let mean = 0;\n let sd = 0;\n data[v].data.forEach(e=>mean=mean+e);\n mean /= data[v].data.length;\n data[v].data.forEach(e=>sd=sd+Math.pow(e-mean,2));\n sd /= data[v].data.length;\n sd = Math.sqrt(sd);\n data[v].mean = mean;\n data[v].sd = sd;\n }\n for (let i in dataRef) {\n for (let v in dataRef[i]) {\n dataRef[i][v].forEach((e,index)=>{\n if (typeof (e) === 'number') dataRef[i][v][index] = (e-data[v].mean)/data[v].sd;\n })\n }\n }\n }", "title": "" }, { "docid": "183773bbb4a0a71b576da351527c9334", "score": "0.5177265", "text": "processAttributes(setId) {\n for (let a = 0; a < this.dataAttributes.length; a++) {\n if (this.dataAttributes[a].dataset !== setId) continue;\n\n let aDim = this.dataAttributes[a].dim;\n let name = this.dataAttributes[a].name;\n let shared = this.dataAttributes[a].shared;\n let dataset = this.dataAttributes[a].dataset;\n let type = \"\";\n if (aDim == 1) {\n type = \"float\";\n }\n if (aDim == 2) {\n type = \"vec2\";\n }\n if (aDim == 3) {\n type = \"vec3\";\n }\n\n // For the shader source code\n this.addCustomAttribute(\n dataset,\n type,\n name,\n \"state\",\n this.dataAttributes.length,\n true,\n false,\n shared\n );\n this.addCustomUniform(\n dataset,\n type,\n name + \"From\",\n 1,\n this.dataAttributes[a].min\n );\n this.addCustomUniform(\n dataset,\n type,\n name + \"To\",\n 1,\n this.dataAttributes[a].max\n );\n this.addCustomUniform(\n dataset,\n type,\n name + \"Min\",\n 1,\n this.dataAttributes[a].min\n );\n this.addCustomUniform(\n dataset,\n type,\n name + \"Max\",\n 1,\n this.dataAttributes[a].max\n );\n\n // For the interface between graphics card and browser\n this.uniforms[this.dataAttributes[a].dataset][\n this.cleanVarName(this.dataAttributes[a].name + \"From\")\n ] = new Uniform(this.dataAttributes[a].min);\n this.uniforms[this.dataAttributes[a].dataset][\n this.cleanVarName(this.dataAttributes[a].name + \"To\")\n ] = new Uniform(this.dataAttributes[a].max);\n this.uniforms[this.dataAttributes[a].dataset][\n this.cleanVarName(this.dataAttributes[a].name + \"Min\")\n ] = new Uniform(this.dataAttributes[a].min);\n this.uniforms[this.dataAttributes[a].dataset][\n this.cleanVarName(this.dataAttributes[a].name + \"Max\")\n ] = new Uniform(this.dataAttributes[a].max);\n }\n }", "title": "" }, { "docid": "b41902c35d5f10908270b4e4c3532b93", "score": "0.51736367", "text": "get Normal() {}", "title": "" }, { "docid": "56d45206fafcbfba75ba0122b2d654ba", "score": "0.51528233", "text": "static TransformNormalFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n result.x = x * m[0] + y * m[4] + z * m[8];\n result.y = x * m[1] + y * m[5] + z * m[9];\n result.z = x * m[2] + y * m[6] + z * m[10];\n }", "title": "" }, { "docid": "41e1e1eee2b833d076e09e24a1062051", "score": "0.51505184", "text": "ScaleTransform(float, float, bool) {\n\n }", "title": "" }, { "docid": "3e075a2741775453fd4bf1ba657a037d", "score": "0.5135564", "text": "function normal (data, inMin, inMax, outMin, outMax)\n{\n\treturn ( ((data - inMin) / (inMax - inMin)) * (outMax - outMin)) + outMin\n}", "title": "" }, { "docid": "5394530aa99fa1f100a38c1c91c9d266", "score": "0.51319486", "text": "function v(t){return t?{origin:Object(_chunks_vec3f64_js__WEBPACK_IMPORTED_MODULE_3__[\"a\"])(t.origin),vector:Object(_chunks_vec3f64_js__WEBPACK_IMPORTED_MODULE_3__[\"a\"])(t.vector)}:{origin:Object(_chunks_vec3f64_js__WEBPACK_IMPORTED_MODULE_3__[\"c\"])(),vector:Object(_chunks_vec3f64_js__WEBPACK_IMPORTED_MODULE_3__[\"c\"])()}}", "title": "" }, { "docid": "3825211cadbad6e6eba0a100ed1ac1c6", "score": "0.5130991", "text": "normalize(prop) {\n return this.decl(prop).normalize(prop)\n }", "title": "" }, { "docid": "249bef983ab4e8fd3753818733f9f4a7", "score": "0.51229465", "text": "normalize(prop) {\n return prop\n }", "title": "" }, { "docid": "4c0801f93c31fb77f6a3361433428e09", "score": "0.512257", "text": "function MultiFlattener() {}", "title": "" }, { "docid": "800a5b31e7bf76fc8fbe41101b540bf9", "score": "0.5121918", "text": "static TransformNormal(vector, transformation, out) {\r\n\t var result = out || new Vector3();\r\n\t var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]);\r\n\t var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]);\r\n\t var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]);\r\n\t result.x = x;\r\n\t result.y = y;\r\n\t result.z = z;\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "800a5b31e7bf76fc8fbe41101b540bf9", "score": "0.5121918", "text": "static TransformNormal(vector, transformation, out) {\r\n\t var result = out || new Vector3();\r\n\t var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]);\r\n\t var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]);\r\n\t var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]);\r\n\t result.x = x;\r\n\t result.y = y;\r\n\t result.z = z;\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "44c87afff4f3ea15e80c6270ec5b3807", "score": "0.5112179", "text": "function flipNormals(intersections){\n for(let i of intersections){\n i.surface.normal = scale(-1, i.surface.normal);;\n }\n }", "title": "" }, { "docid": "bbf7fef9e7b36ba8129ac9eb15239a1b", "score": "0.5110755", "text": "normalize(config, bundle, texture_nodes = {}) {\n this.normalizeDataSources(config, bundle);\n this.normalizeFonts(config, bundle);\n this.normalizeTextures(config, bundle);\n this.collectTextures(config, bundle, texture_nodes);\n return { config, bundle, texture_nodes };\n }", "title": "" }, { "docid": "f3b95c80618923c01169602981b28542", "score": "0.5101256", "text": "function n$6(n,a){const o=n.fragment;o.uniforms.add(\"normalTexture\",\"sampler2D\"),o.uniforms.add(\"normalTextureSize\",\"vec2\"),a.vertexTangets?(n.attributes.add(\"tangent\",\"vec4\"),n.varyings.add(\"vTangent\",\"vec4\"),2===a.doubleSidedMode?o.code.add(t$l`\n mat3 computeTangentSpace(vec3 normal) {\n float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\n vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\n vec3 bitangent = cross(normal, tangent) * tangentHeadedness;\n return mat3(tangent, bitangent, normal);\n }\n `):o.code.add(t$l`\n mat3 computeTangentSpace(vec3 normal) {\n float tangentHeadedness = vTangent.w;\n vec3 tangent = normalize(vTangent.xyz);\n vec3 bitangent = cross(normal, tangent) * tangentHeadedness;\n return mat3(tangent, bitangent, normal);\n }\n `)):(n.extensions.add(\"GL_OES_standard_derivatives\"),o.code.add(t$l`\n mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\n\n vec3 Q1 = dFdx(pos);\n vec3 Q2 = dFdy(pos);\n\n vec2 stx = dFdx(st);\n vec2 sty = dFdy(st);\n\n float det = stx.t * sty.s - sty.t * stx.s;\n\n vec3 T = stx.t * Q2 - sty.t * Q1; // compute tangent\n T = T - normal * dot(normal, T); // orthogonalize tangent\n T *= inversesqrt(max(dot(T,T), 1.e-10)); // \"soft\" normalize - goes to 0 when T goes to 0\n vec3 B = sign(det) * cross(normal, T); // assume normal is normalized, B has the same lenght as B\n return mat3(T, B, normal); // T and B go to 0 when the tangent space is not well defined by the uv coordinates\n }\n `)),0!==a.attributeTextureCoordinates&&(n.include(u$5,a),o.code.add(t$l`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${a.supportsTextureAtlas?\"vtc.size = normalTextureSize;\":\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `));}", "title": "" }, { "docid": "2b49ea9af3be03f019958d6ef1c5f0f5", "score": "0.50929314", "text": "function ObjVertexDefProcessorObjectBoundsNormalizer() {\n\tthis.minValueX = null;\n\tthis.maxValueX = null;\n\tthis.minValueY = null;\n\tthis.maxValueY = null;\n\tthis.minValueZ = null;\n\tthis.maxValueZ = null;\n\t\n\t// Scaling factor, based on a set of source coordinates\n\t// which have maximum extents of 1 model world coordinate\n\t// system unit.\n\tthis.unitScalingFactor = 1.0;\n\t\n\t// Per-axis offsets, applied after final model\n\t// scaling.\n\tthis.unitOffsetX = 0.0;\n\tthis.unitOffsetY = 0.0;\n\tthis.unitOffsetZ = 0.0;\n}", "title": "" }, { "docid": "b4c95f13fdeba454183e9ce79b3e25ea", "score": "0.5090841", "text": "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n mat3.transpose(nMatrix,nMatrix);\r\n mat3.invert(nMatrix,nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\r\n}", "title": "" }, { "docid": "b4c95f13fdeba454183e9ce79b3e25ea", "score": "0.5090841", "text": "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n mat3.transpose(nMatrix,nMatrix);\r\n mat3.invert(nMatrix,nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\r\n}", "title": "" }, { "docid": "44625ff332489ff78b0c45a876f83d30", "score": "0.50798845", "text": "function normalize(){\n console.log(this.coords.map (n => n/this.length))\n}", "title": "" }, { "docid": "aee40856dd01118321852a9d1e1f1b76", "score": "0.50764436", "text": "function n$9(e,r){r.instanced&&r.instancedDoublePrecision&&(e.attributes.add(\"modelOriginHi\",\"vec3\"),e.attributes.add(\"modelOriginLo\",\"vec3\"),e.attributes.add(\"model\",\"mat3\"),e.attributes.add(\"modelNormal\",\"mat3\")),r.instancedDoublePrecision&&(e.vertex.include(o$c,r),e.vertex.uniforms.add(\"viewOriginHi\",\"vec3\"),e.vertex.uniforms.add(\"viewOriginLo\",\"vec3\"));const n=[t$l`\n vec3 calculateVPos() {\n ${r.instancedDoublePrecision?\"return model * localPosition().xyz;\":\"return localPosition().xyz;\"}\n }\n `,t$l`\n vec3 subtractOrigin(vec3 _pos) {\n ${r.instancedDoublePrecision?t$l`\n vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);\n return _pos - originDelta;`:\"return vpos;\"}\n }\n `,t$l`\n vec3 dpNormal(vec4 _normal) {\n ${r.instancedDoublePrecision?\"return normalize(modelNormal * _normal.xyz);\":\"return normalize(_normal.xyz);\"}\n }\n `,t$l`\n vec3 dpNormalView(vec4 _normal) {\n ${r.instancedDoublePrecision?\"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);\":\"return normalize((viewNormal * _normal).xyz);\"}\n }\n `,r.vertexTangets?t$l`\n vec4 dpTransformVertexTangent(vec4 _tangent) {\n ${r.instancedDoublePrecision?\"return vec4(modelNormal * _tangent.xyz, _tangent.w);\":\"return _tangent;\"}\n\n }\n `:t$l``];e.vertex.code.add(n[0]),e.vertex.code.add(n[1]),e.vertex.code.add(n[2]),2===r.output&&e.vertex.code.add(n[3]),e.vertex.code.add(n[4]);}", "title": "" }, { "docid": "692a5a413333ffd748bd77ad156376b6", "score": "0.5061325", "text": "function b2Mat22() {\n}", "title": "" }, { "docid": "4ba81c09efe7a018534c21b084086a5e", "score": "0.5056977", "text": "static plane_normal(v1,v2,v3){\n var v12 = this.unitvector(v1,v2);\n var v23 = this.unitvector(v2,v3);\n return this.normalise(math.cross(v12,v23));\n }", "title": "" }, { "docid": "3741eca3ad7b4dd27268d4bec2627d58", "score": "0.50430965", "text": "static NormalizeToRef(vector, result) {\n vector.normalizeToRef(result);\n }", "title": "" }, { "docid": "064a8ada312ae68c67c4882f8658f95b", "score": "0.5039642", "text": "function getNormalizationFunction(toLowerCase) {\n var repl = [];\n var args = Array.prototype.slice.call(arguments, 1);\n for (var i = 0; i < args.length; i++) {\n var mapping = args[i];\n for ( var key in mapping) {\n repl.push({\n regexp : new RegExp(key, 'gim'),\n value : mapping[key]\n });\n }\n }\n return function(str) {\n if (!str || str == '')\n return '';\n str = str + '';\n for (var i = 0; i < repl.length; i++) {\n var slot = repl[i];\n str = str.replace(slot.regexp, slot.value);\n }\n if (toLowerCase)\n \treturn str.toLowerCase();\n return str;\n }\n}", "title": "" }, { "docid": "2cf5fd6e9b9fbd4cea69ddb132b61015", "score": "0.5038587", "text": "static NormalizeToRef(vector, result) {\n result.copyFrom(vector);\n result.normalize();\n }", "title": "" }, { "docid": "48537f6a725a3792d1e5121be90d02d8", "score": "0.5036333", "text": "function unflatten(flatObject) {\n // Write your code here\n \n}", "title": "" }, { "docid": "0b6882ceca20cd072ea9c9fc92e71a9e", "score": "0.5034798", "text": "function JsonTransformer() {\n}", "title": "" }, { "docid": "dba55755c4416e81e773a6e074b89556", "score": "0.50224864", "text": "static TransformNormal(vector, transformation) {\r\n\t var result = Vector4.Zero();\r\n\t Vector4.TransformNormalToRef(vector, transformation, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "dba55755c4416e81e773a6e074b89556", "score": "0.50224864", "text": "static TransformNormal(vector, transformation) {\r\n\t var result = Vector4.Zero();\r\n\t Vector4.TransformNormalToRef(vector, transformation, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "932dc81394a2a143fb6c73ee58e985d3", "score": "0.50218207", "text": "function UnNormalise(lms, height, width, alphabet_coord){\r\n//FIRST HAND ONLY\r\nvar unnormalised_landmarks = new Array(21);\r\n\r\nvar basex = lms[0][0].x;\r\nvar basey = lms[0][0].y;\r\nvar basez = lms[0][0].z;\r\nvar thumbx = lms[0][5].x;\r\nvar thumby = lms[0][5].y;\r\nvar thumbz = lms[0][5].z;\r\n\r\n//const normalised_lms = Normalise2(lms, height, width) //ONLY TO CALC ROTATION MATRIX\r\nconst scale_factor = ( ((thumbx-basex)**2) + ((thumby-basey)**2) + ((thumbz-basez)**2))**0.5;\r\n\r\n//NORMAL VECTOR CALCULATION\r\nconst base_vector05 = [alphabet_coord[15+1],alphabet_coord[15+2],alphabet_coord[15+3] ] //+1 cos the first item in alpha coord is the letter\r\nconst base_vector017 = [alphabet_coord[51+1],alphabet_coord[51+2],alphabet_coord[51+3] ]\r\nconst base_normalvector = math.cross(base_vector05, base_vector017)\r\n\r\nconst dest_vector05 = [(thumbx-basex), (thumby-basey), (thumbz-basez)] // *2 as responsiveness increases with a larger z value\r\nconst dest_vector017 = [(lms[0][17].x-basex), (lms[0][17].y-basey), (lms[0][17].z-basez)]\r\nconst dest_normalvector = math.cross(dest_vector05,dest_vector017)\r\n\r\nconst RM = rotationmatrix(base_normalvector,dest_normalvector)\r\n\r\n//USING OG LMS TO SCALE TO CORRECT WIDTH\r\nfor (let index = 0; index < lms[0].length; index++) {\r\n\r\n const x = alphabet_coord[index*3 + 1];\r\n const y = alphabet_coord[index*3 + 2];\r\n const z = alphabet_coord[index*3 + 3];\r\n\r\n var vector = math.matrix([[x],[y],[z]])\r\n var finalvector = math.multiply(RM, vector)\r\n\r\n var tempJson = {\r\n \"x\": finalvector.subset(math.index(0,0)) * scale_factor + lms[0][0].x,\r\n \"y\": finalvector.subset(math.index(1,0)) * scale_factor + lms[0][0].y,\r\n \"z\": (finalvector.subset(math.index(2,0)) * scale_factor + lms[0][0].z),\r\n };\r\n unnormalised_landmarks[index] = tempJson;\r\n}\r\n\r\nreturn unnormalised_landmarks;\r\n}", "title": "" }, { "docid": "58ad8e02104a790dc236ab0ac87a3018", "score": "0.5017697", "text": "Normalize() {\n var num = 1 / Math.sqrt(this.X * this.X + this.Y * this.Y + this.Z * this.Z + this.W * this.W);\n this.X *= num;\n this.Y *= num;\n this.Z *= num;\n this.W *= num;\n }", "title": "" }, { "docid": "5b37c255a3fe29a5b9b2ac1da919a66c", "score": "0.50121933", "text": "setScaleNorm( scaleNorm ){\n if (scaleNorm instanceof Array)\n this.scaleNorm = scaleNorm;\n else\n if( typeof(scaleNorm) == 'number' )\n this.scaleNorm = [scaleNorm, scaleNorm, scaleNorm ];\n else\n throw \"scaleNorm is not array or number: \" + typeof(scaleNorm)\n //assign the string. should update gui automatically\n this.scaleNormStr = g_arrayToFloatList( this. scaleNorm );\n }", "title": "" }, { "docid": "db9274d7db8ac4f5b0245b4ea3e95d3f", "score": "0.50117975", "text": "function Int_primitives(ns, exports) {\n\nvar m_assert = Object(__WEBPACK_IMPORTED_MODULE_1__util_assert_js__[\"a\" /* default */])(ns);\nvar m_cfg = Object(__WEBPACK_IMPORTED_MODULE_2__config_js__[\"a\" /* default */])(ns);\nvar m_geom = Object(__WEBPACK_IMPORTED_MODULE_3__geometry_js__[\"a\" /* default */])(ns);\n\nvar cfg_def = m_cfg.defaults;\n\nexports.generate_line = function() {\n var submesh = m_geom.init_submesh(\"LINE\");\n\n var va_frame = m_geom.create_empty_va_frame();\n va_frame[\"a_position\"] = new Float32Array(3);\n va_frame[\"a_direction\"] = new Float32Array(3);\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array(1);\n submesh.base_length = 1;\n\n return submesh;\n}\n\nexports.generate_plane = function(x_size, y_size) {\n var grid_submesh = generate_grid(2, 2, x_size, y_size);\n grid_submesh.name = \"PLANE\";\n\n return grid_submesh;\n}\n\nexports.generate_grid = generate_grid;\n/**\n * Subdivisions and size are from the blender\n * @methodOf primitives\n */\nfunction generate_grid(x_subdiv, y_subdiv, x_size, y_size) {\n\n var indices = [];\n var positions = [];\n var texcoords = [];\n var tbn_count = x_subdiv * y_subdiv;\n\n var delta_x = (2 * x_size) / (x_subdiv - 1);\n var delta_y = (2 * y_size) / (y_subdiv - 1);\n\n for (var i = 0; i < x_subdiv; i++) {\n\n var x = -x_size + i * delta_x;\n\n for (var j = 0; j < y_subdiv; j++) {\n\n var y = -y_size + j * delta_y;\n\n positions.push(x, y, 0);\n\n texcoords.push(i / (x_subdiv - 1), j / (y_subdiv -1));\n\n if (i && j) {\n var idx0 = i * y_subdiv + j;\n var idx1 = idx0 - 1;\n var idx2 = (i - 1) * y_subdiv + j;\n var idx3 = idx2 - 1;\n indices.push(idx0, idx1, idx2);\n indices.push(idx1, idx3, idx2);\n }\n }\n }\n\n // construct submesh\n\n var va_frame = m_geom.create_empty_va_frame();\n\n va_frame[\"a_position\"] = new Float32Array(positions);\n va_frame[\"a_tbn\"] = __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"c\" /* create */](tbn_count);\n\n var submesh = m_geom.init_submesh(\"GRID_PLANE\");\n\n submesh.va_frames[0] = va_frame;\n submesh.va_common[\"a_texcoord\"] = new Float32Array(texcoords);\n submesh.indices = new Uint32Array(indices);\n submesh.base_length = positions.length/3;\n\n return submesh;\n}\n\n/**\n * Extract water submesh\n */\nexports.generate_cascaded_grid = function(num_cascads, subdivs, detailed_dist) {\n\n var min_casc_size = detailed_dist / Math.pow(2, num_cascads - 1);\n var x_size = min_casc_size;\n var y_size = min_casc_size;\n\n var x_subdiv = subdivs + 1;\n var y_subdiv = subdivs + 1;\n\n var indices = [];\n var positions = [];\n var tbn_count = 0;\n\n var prev_x = 0;\n var prev_y = 0;\n\n var last_added_ind = -1;\n\n function is_merged_vertex(i, j) {\n if ( (i % 2 == 1 && (j == 0 || j == y_subdiv - 1)) ||\n (j % 2 == 1 && (i == 0 || i == x_subdiv - 1)) )\n return true;\n else\n return false;\n }\n\n var prev_utmost_verts = []; // prev cascad utmost verts (x, y, ind)\n\n for (var c = 0; c < num_cascads; c++) {\n\n var delta_x = (2 * x_size) / (x_subdiv - 1);\n var delta_y = (2 * y_size) / (y_subdiv - 1);\n\n var cur_utmost_verts = []; // current cascad utmost verts (x, y, ind)\n var casc_indices = []; // current cascad indices\n var all_skipped = 0;\n\n for (var i = 0; i < x_subdiv; i++) {\n\n var x = -x_size + i * delta_x;\n\n var indices_in_row = [];\n\n for (var j = 0; j < y_subdiv; j++) {\n\n var y = -y_size + j * delta_y;\n\n // process vertices only otside previous cascad\n if (!(x > -prev_x && x < prev_x &&\n y > -prev_y && y < prev_y)) {\n\n var coinciding_ind = null;\n\n // check if there exist a vertex with the same coords\n for (var k = 0; k < prev_utmost_verts.length; k+=3) {\n if (x == prev_utmost_verts[k] && y == prev_utmost_verts[k+1]) {\n coinciding_ind = prev_utmost_verts[k+2];\n break;\n }\n }\n\n if (coinciding_ind !== null) {\n var idx0 = coinciding_ind;\n } else\n var idx0 = last_added_ind + 1;\n\n // push to positions array if needed\n if ( !is_merged_vertex(i, j) ) {\n if (coinciding_ind == null) {\n if ((j == 0 || j == y_subdiv - 1 ||\n i == 0 || i == x_subdiv - 1)) {\n\n if (c == num_cascads - 1)\n var cascad_step = delta_x;\n else\n var cascad_step = 2 * delta_x;\n\n cur_utmost_verts.push(x, y, idx0);\n } else\n var cascad_step = delta_x;\n positions.push(x, y, cascad_step);\n tbn_count++;\n last_added_ind++; \n }\n indices_in_row.push(idx0);\n } else {\n indices_in_row.push(-2); // is odd utmost\n all_skipped++;\n }\n\n if (i && j) {\n // for not utmost vertices\n if ( i == 1 ) {\n // 2-nd column \n if (is_merged_vertex(i-1, j)) {\n if ( j > 1) {\n var idx1 = idx0 - 1;\n var idx2 = casc_indices[i-1][j+1];\n var idx3 = idx2 - 1;\n indices.push(idx3, idx1, idx0);\n indices.push(idx2, idx3, idx0);\n } else {\n var idx2 = casc_indices[i-1][j+1];\n var idx3 = idx2 - 1;\n indices.push(idx2, idx3, idx0);\n }\n } else if (!is_merged_vertex(i, j)) {\n var idx1 = idx0 - 1;\n var idx2 = casc_indices[i-1][j];\n indices.push(idx2, idx1, idx0);\n }\n } else if ( i == x_subdiv - 1 ) {\n // last column\n if (!is_merged_vertex(i, j)) {\n if (j == y_subdiv - 1) {\n // build lower-right corner\n var idx1 = idx0 - 1;\n var idx2 = casc_indices[i-1][j-1];\n var idx3 = casc_indices[i-2][j];\n indices.push(idx2, idx1, idx0);\n indices.push(idx3, idx2, idx0);\n } else {\n var idx1 = idx0 - 1;\n var idx2 = casc_indices[i-1][j];\n var idx3 = idx2 - 1;\n var idx4 = idx2 + 1;\n indices.push(idx3, idx1, idx0);\n indices.push(idx2, idx3, idx0);\n indices.push(idx4, idx2, idx0);\n if (j == 2) {\n // build upper-right corner\n idx4 = casc_indices[i-2][j-2];\n indices.push(idx3, idx4, idx1);\n }\n }\n }\n } else if ( j == 1 ) {\n // 2-nd row\n if (!is_merged_vertex(i, j-1)) {\n var idx1 = indices_in_row[j-1];\n var idx2 = casc_indices[i-1][j];\n var idx3 = casc_indices[i-2][j-1];\n indices.push(idx2, idx1, idx0);\n indices.push(idx2, idx3, idx1);\n } else {\n var idx1 = casc_indices[i-1][j];\n var idx2 = casc_indices[i-1][j-1];\n indices.push(idx1, idx2, idx0);\n }\n } else if ( j == y_subdiv - 1 ) {\n // last row\n if (!is_merged_vertex(i, j)) {\n var idx1 = indices_in_row[j-1];\n var idx2 = casc_indices[i-1][j-1];\n var idx3 = casc_indices[i-2][j];\n indices.push(idx2, idx1, idx0);\n indices.push(idx3, idx2, idx0);\n }\n } else if (casc_indices[i-1][j] != -1\n && casc_indices[i-1][j-1] != -1\n && indices_in_row[j-1] != -1) {\n\n var idx1 = indices_in_row[j-1];\n var idx2 = casc_indices[i-1][j];\n var idx3 = casc_indices[i-1][j-1];\n indices.push(idx2, idx1, idx0);\n indices.push(idx2, idx3, idx1);\n if (j == y_subdiv - 2 && is_merged_vertex(i, j+1)) {\n var idx4 = casc_indices[i-1][j+1]\n indices.push(idx4, idx2, idx0);\n }\n } else if (j == y_subdiv - 2 && is_merged_vertex(i, j+1)) {\n var idx2 = casc_indices[i-1][j];\n var idx4 = casc_indices[i-1][j+1]\n indices.push(idx4, idx2, idx0);\n }\n }\n } else {\n indices_in_row.push(-1);\n all_skipped++;\n }\n }\n casc_indices.push(indices_in_row);\n\n }\n prev_utmost_verts = cur_utmost_verts;\n\n prev_x = x_size;\n prev_y = y_size;\n\n x_size *= 2;\n y_size *= 2;\n }\n\n // generate outer cascad from 8 vertices [Optional]\n var required_mesh_size = 20000;\n if (prev_x < required_mesh_size) {\n\n var casc_step = -(2 * prev_x) / (x_subdiv - 1);\n\n positions.push(-required_mesh_size, -required_mesh_size, casc_step);\n positions.push(-required_mesh_size, required_mesh_size, casc_step);\n positions.push(-prev_x, -prev_y, casc_step);\n positions.push(-prev_x, prev_y, casc_step);\n positions.push( required_mesh_size, -required_mesh_size, casc_step);\n positions.push( required_mesh_size, required_mesh_size, casc_step);\n positions.push( prev_x, -prev_y, casc_step);\n positions.push( prev_x, prev_y, casc_step);\n\n var idx0 = last_added_ind + 1;\n indices.push(idx0 + 1, idx0 + 2, idx0 + 3,\n idx0 + 1, idx0 + 0, idx0 + 2,\n idx0 + 2, idx0 + 4, idx0 + 6,\n idx0 + 2, idx0 + 0, idx0 + 4,\n idx0 + 1, idx0 + 7, idx0 + 5,\n idx0 + 1, idx0 + 3, idx0 + 7,\n idx0 + 7, idx0 + 4, idx0 + 5,\n idx0 + 6, idx0 + 4, idx0 + 7);\n\n tbn_count += 8;\n }\n\n // construct submesh\n var va_frame = m_geom.create_empty_va_frame();\n\n va_frame[\"a_position\"] = new Float32Array(positions);\n va_frame[\"a_tbn\"] = __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"c\" /* create */](tbn_count);\n\n // CHECK: why should we do next line?\n __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"j\" /* multiply_quat */](va_frame[\"a_tbn\"], [0.707, 0, 0, 0.707], va_frame[\"a_tbn\"]);\n\n var submesh = m_geom.init_submesh(\"MULTIGRID_PLANE\");\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array(indices);\n submesh.base_length = positions.length/3;\n\n // debug wireframe mode\n if (cfg_def.water_wireframe_debug) {\n m_geom.submesh_drop_indices(submesh, 1, true);\n va_frame[\"a_polyindex\"] = m_geom.extract_polyindices(submesh);\n }\n\n return submesh;\n}\n\n/**\n * Generate submesh for shadeless rendering (w/o normals)\n * verts must be CCW if you look at the front face of triangle\n */\nexports.generate_from_triangles = function(verts) {\n var len = verts.length;\n if (len % 3)\n m_assert.panic(\"Wrong array\");\n\n var indices = [];\n var positions = [];\n\n for (var i = 0; i < len; i+=3) {\n var v1 = verts[i];\n var v2 = verts[i+1];\n var v3 = verts[i+2];\n\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v2, positions);\n add_vec3_to_array(v3, positions);\n\n indices.push(i, i+1, i+2);\n }\n\n // construct submesh\n\n var va_frame = m_geom.create_empty_va_frame();\n\n va_frame[\"a_position\"] = new Float32Array(positions);\n\n var submesh = m_geom.init_submesh(\"FROM_TRIANGLES\");\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array(indices);\n submesh.base_length = positions.length/3;\n\n return submesh;\n}\n\nexports.generate_from_quads = generate_from_quads; \n/**\n * Generate submesh for shadeless rendering (w/o normals).\n * verts must be CCW if you look at the front face of quad\n * @methodOf primitives\n */\nfunction generate_from_quads(verts) {\n\n\n var len = verts.length;\n if (len % 4)\n m_assert.panic(\"Wrong array\");\n\n var indices = [];\n var positions = [];\n\n for (var i = 0; i < len; i+=4) {\n var v1 = verts[i];\n var v2 = verts[i+1];\n var v3 = verts[i+2];\n var v4 = verts[i+3];\n\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v2, positions);\n add_vec3_to_array(v3, positions);\n add_vec3_to_array(v4, positions);\n\n indices.push(i, i+1, i+2);\n indices.push(i, i+2, i+3);\n }\n\n // construct submesh\n\n var va_frame = m_geom.create_empty_va_frame();\n\n va_frame[\"a_position\"] = new Float32Array(positions);\n // CHECK: probably there should be non-init tbn\n va_frame[\"a_tbn\"] = __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"c\" /* create */](len / 4);\n\n var submesh = m_geom.init_submesh(\"FROM_QUADS\");\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array(indices);\n submesh.base_length = positions.length/3;\n\n return submesh;\n}\n\n/**\n * Generate frustum submesh from submesh corners.\n * <p>NOTE1: corners must be near and far planes\n * <p>NOTE2: near plane - CCW, far plane - CW (from viewer point)\n * <p>NOTE3: left buttom vertex of near and far plane are joined\n */\nexports.generate_frustum = function(corners) {\n\n corners = __WEBPACK_IMPORTED_MODULE_5__util_js__[\"_69\" /* vectorize */](corners, []); \n\n // TODO: implement simple method to generate frustum geometry\n var quads = [];\n\n // near quad\n quads.push(corners[0], corners[1], corners[2], corners[3]);\n\n // left quad\n quads.push(corners[0], corners[3], corners[5], corners[4]);\n // top quad\n quads.push(corners[3], corners[2], corners[6], corners[5]);\n // right quad\n quads.push(corners[1], corners[7], corners[6], corners[2]);\n // buttom quad\n quads.push(corners[0], corners[4], corners[7], corners[1]);\n\n // far quad\n quads.push(corners[4], corners[5], corners[6], corners[7]);\n\n var submesh = generate_from_quads(quads);\n submesh.name = \"FRUSTUM\";\n\n return submesh;\n}\n\nexports.generate_fullscreen_tri = function() {\n\n var submesh = m_geom.init_submesh(\"FULLSCREEN_TRI\");\n\n var va_frame = m_geom.create_empty_va_frame();\n va_frame[\"a_position\"] = new Float32Array([0, 0, 1, 0, 0, 1]);\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array([0, 1, 2]);\n submesh.base_length = 3;\n\n return submesh;\n}\n\nexports.generate_fullscreen_quad = function() {\n\n var submesh = m_geom.init_submesh(\"FULLSCREEN_QUAD\");\n\n var va_frame = m_geom.create_empty_va_frame();\n va_frame[\"a_position\"] = new Float32Array([-1, 1, 1, 1, -1, -1, 1, -1]);\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array([0, 2, 1, 1, 2, 3]);\n submesh.base_length = 4;\n\n return submesh;\n}\n\nexports.generate_billboard = function() {\n\n var submesh = m_geom.init_submesh(\"BILLBOARD\");\n\n var va_frame = m_geom.create_empty_va_frame();\n va_frame[\"a_bb_vertex\"] = m_geom.gen_bb_vertices(1);\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array([0, 2, 1, 0, 3, 2]);\n submesh.base_length = 4;\n\n return submesh;\n}\n\n/**\n * Return uv sphere submesh\n *\n * size - sphere radius\n */\nexports.generate_uv_sphere = function(segments, rings, size, center, \n use_smooth, use_wireframe) {\n var submesh = m_geom.init_submesh(\"UV_SPHERE\");\n\n var x, y;\n \n var positions = [];\n var grid_positions = [];\n var indices = [];\n\n for (y = 0; y <= rings; y++) {\n for (x = 0; x <= segments; x++) {\n\n var u = x / segments;\n var v = y / rings;\n\n var xpos = -size * Math.cos(u * 2*Math.PI) * Math.sin(v * Math.PI);\n var ypos = size * Math.cos(v * Math.PI);\n var zpos = size * Math.sin(u * 2*Math.PI) * Math.sin(v * Math.PI);\n\n // clamp near-zero values to improve TBN smoothing quality\n if (use_smooth) {\n var edge = 0.00001;\n xpos = (Math.abs(xpos) < edge) ? 0 : xpos;\n ypos = (Math.abs(ypos) < edge) ? 0 : ypos;\n zpos = (Math.abs(zpos) < edge) ? 0 : zpos;\n }\n\n grid_positions.push(xpos + center[0], ypos + center[1], \n zpos + center[2]);\n }\n }\n\n var v_index = 0;\n for (y = 0; y < rings; y++) {\n for (x = 0; x < segments; x++) {\n\n var v1 = extract_vec3(grid_positions, (segments+1)*y + x + 1);\n var v2 = extract_vec3(grid_positions, (segments+1)*y + x);\n var v3 = extract_vec3(grid_positions, (segments+1)*(y + 1) + x);\n var v4 = extract_vec3(grid_positions, (segments+1)*(y + 1) + x + 1);\n \n // upper pole\n if (Math.abs(v1[1]) == (size + center[1])) {\n\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v3, positions);\n add_vec3_to_array(v4, positions);\n\n if (use_wireframe)\n indices.push(v_index, v_index+1, v_index+1, v_index+2, \n v_index+2, v_index);\n else\n indices.push(v_index, v_index+1, v_index+2);\n v_index += 3;\n\n // lower pole\n } else if (Math.abs(v3[1]) == (size + center[1])) {\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v2, positions);\n add_vec3_to_array(v3, positions);\n\n if (use_wireframe)\n indices.push(v_index, v_index+1, v_index+1, v_index+2, \n v_index+2, v_index);\n else\n indices.push(v_index, v_index+1, v_index+2);\n v_index += 3;\n\n } else {\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v2, positions);\n add_vec3_to_array(v3, positions);\n add_vec3_to_array(v4, positions);\n\n if (use_wireframe) {\n indices.push(v_index, v_index+1);\n indices.push(v_index+1, v_index+2);\n indices.push(v_index+2, v_index+3);\n indices.push(v_index+3, v_index);\n } else {\n indices.push(v_index, v_index+1, v_index+2);\n indices.push(v_index, v_index+2, v_index+3);\n }\n\n v_index += 4;\n }\n }\n }\n\n // construct submesh\n\n var va_frame = {};\n\n va_frame[\"a_position\"] = positions;\n\n if (use_wireframe) {\n va_frame[\"a_tbn\"] = __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"c\" /* create */]();\n } else {\n\n var shared_indices = m_geom.calc_shared_indices(indices, \n grid_positions, positions);\n\n var normals = m_geom.calc_normals(indices, positions, \n shared_indices);\n va_frame[\"a_tbn\"] = __WEBPACK_IMPORTED_MODULE_4__tbn_js__[\"d\" /* from_norm_tan */](normals);\n }\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = indices;\n submesh.base_length = positions.length/3;\n\n return submesh;\n}\n\n/**\n * Position in vectors, not values\n */\nfunction extract_vec3(array, position) {\n var offset = position*3;\n var x = array[offset];\n var y = array[offset+1];\n var z = array[offset+2];\n\n return [x,y,z];\n}\n\nfunction add_vec3_to_array(vec, array) {\n array.push(vec[0], vec[1], vec[2]);\n}\n\nexports.generate_index = function(num) {\n\n var submesh = m_geom.init_submesh(\"INDEX\");\n\n var va_frame = m_geom.create_empty_va_frame();\n va_frame[\"a_index\"] = new Float32Array(num * 3);\n var indices = new Uint16Array(num * 3);\n for (var i = 0; i < num * 3; i++) {\n va_frame[\"a_index\"][i] = i;\n indices[i] = i;\n }\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = indices;\n submesh.base_length = num * 3;\n\n return submesh;\n}\n\n\n}", "title": "" }, { "docid": "d59def1bc72f5b97d810b63f60a92223", "score": "0.4993929", "text": "preRender(){ this.transform.updateMatrix(); }", "title": "" }, { "docid": "2058bf683ec041688b481c935bce5045", "score": "0.4993296", "text": "updateTransform(){}", "title": "" }, { "docid": "17a993f61957246bef3734967ac0d879", "score": "0.49838877", "text": "get_transform() {\r\n if (this.manual_scale == null) // Normal case\r\n return this.matrix_transform.times(Mat4.scale([this.width, this.height, this.length])); // Must scale at the end.\r\n else { // Special case: scaling obj file shape but not the bounding box itself.\r\n let x_scale = this.manual_scale[0];\r\n let y_scale = this.manual_scale[1];\r\n let z_scale = this.manual_scale[2];\r\n return this.matrix_transform.times(Mat4.scale([x_scale, y_scale, z_scale])); // Must scale at the end.\r\n }\r\n }", "title": "" }, { "docid": "11b6f359a2b5e77791aaf149b5cbe0ab", "score": "0.49807748", "text": "function getNormalizationType(children){var res=0;for(var i=0;i < children.length;i++) {var el=children[i];if(el.type !== 1){continue;}if(needsNormalization(el) || el.ifConditions && el.ifConditions.some(function(c){return needsNormalization(c.block);})){res = 2;break;}if(maybeComponent(el) || el.ifConditions && el.ifConditions.some(function(c){return maybeComponent(c.block);})){res = 1;}}return res;}", "title": "" }, { "docid": "83d2f202b8797d382b2e0a0e15e651fa", "score": "0.4971283", "text": "function getNormalizationType(children){var res=0;for(var i=0;i<children.length;i++){var el=children[i];if(el.type!==1){continue;}if(needsNormalization(el)||el.ifConditions&&el.ifConditions.some(function(c){return needsNormalization(c.block);})){res=2;break;}if(maybeComponent(el)||el.ifConditions&&el.ifConditions.some(function(c){return maybeComponent(c.block);})){res=1;}}return res;}", "title": "" }, { "docid": "82a1cc3192d646421f2fae18aed37eb3", "score": "0.4970886", "text": "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "title": "" }, { "docid": "82a1cc3192d646421f2fae18aed37eb3", "score": "0.4970886", "text": "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "title": "" }, { "docid": "82a1cc3192d646421f2fae18aed37eb3", "score": "0.4970886", "text": "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "title": "" }, { "docid": "82a1cc3192d646421f2fae18aed37eb3", "score": "0.4970886", "text": "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "title": "" }, { "docid": "d768c395f24f9cae21debbd1fd60e329", "score": "0.4970371", "text": "function normalize() {\n console.log(this.coords.map(n => n / this.length));\n}", "title": "" }, { "docid": "692cc75aac729a1d97df8c0bad54d8d8", "score": "0.49686667", "text": "calculateNormals() {\n // Calculate normals on all faces\n let fnormals = [];\n let v1 = glMatrix.vec3.create();\n let v2 = glMatrix.vec3.create();\n let v3 = glMatrix.vec3.create();\n for(let i = 0; i < this.numFaces; i++){\n let f = i*3;\n this.getVertex(v1, this.faceData[f]);\n this.getVertex(v2, this.faceData[f+1]);\n this.getVertex(v3, this.faceData[f+2]);\n\n glMatrix.vec3.sub(v2, v2, v1);\n glMatrix.vec3.sub(v3, v3, v1);\n\n let n = glMatrix.vec3.create();\n glMatrix.vec3.cross(n, v2, v3);\n\n // TODO: I don't quite understand the difference between\n // triangle and parallelogram area weighting since this\n // 1/2 factor should end up canceling when I normalize later...\n glMatrix.vec3.scale(n, n, 0.5);\n \n fnormals.push(n);\n }\n\n // Interpolate normals for each vertex\n for(let y = 0; y <= this.div; y++){\n for(let x = 0; x <= this.div; x++){\n let faces = this.getNeighboringFaces(x, y);\n\n let n = glMatrix.vec3.create();\n faces.forEach((f) => glMatrix.vec3.add(n, n, fnormals[f]));\n glMatrix.vec3.normalize(n, n);\n\n this.normalData.push(...n)\n }\n }\n }", "title": "" }, { "docid": "5b8249c9cab4c5699ac070f1995c9d18", "score": "0.4967646", "text": "function R(a,b){a.opacity.value=b.opacity,Sa.gammaInput?a.diffuse.value.copyGammaToLinear(b.color):a.diffuse.value=b.color,a.map.value=b.map,a.lightMap.value=b.lightMap,a.specularMap.value=b.specularMap,a.alphaMap.value=b.alphaMap,b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale),b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale));\n// uv repeat and offset setting priorities\n// 1. color map\n// 2. specular map\n// 3. normal map\n// 4. bump map\n// 5. alpha map\nvar c;if(b.map?c=b.map:b.specularMap?c=b.specularMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.alphaMap&&(c=b.alphaMap),void 0!==c){var d=c.offset,e=c.repeat;a.offsetRepeat.value.set(d.x,d.y,e.x,e.y)}a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,Sa.gammaInput?\n//uniforms.reflectivity.value = material.reflectivity * material.reflectivity;\na.reflectivity.value=b.reflectivity:a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.combine.value=b.combine,a.useRefract.value=b.envMap&&b.envMap.mapping instanceof THREE.CubeRefractionMapping}", "title": "" }, { "docid": "5d7e33855c85827eda4edf7c7bded536", "score": "0.4964905", "text": "static NormalizationNetScatterPlot (dataRef) {\n // measure time\n timeMeasure[0] = performance.now();\n\n if (controlVariable.selectedData === 'covid') { // for covid data in teaser\n for (let i in dataRef) {\n for (let v in dataRef[i]) {\n // let m = (dataRef[i][v][netSP.timeInfo.length-2] - dataRef[i][v][0])/(netSP.timeInfo.length-1);\n let m = 1;\n let maxV = -Infinity, minV = Infinity;\n for (let t = 0; t < netSP.timeInfo.length-1; t++) {\n if (typeof (dataRef[i][v][t+1]) === 'number') {\n dataRef[i][v][t] = (dataRef[i][v][t+1] - dataRef[i][v][t])/m;\n maxV = (maxV < dataRef[i][v][t]) ? dataRef[i][v][t] : maxV;\n minV = (minV > dataRef[i][v][t]) ? dataRef[i][v][t] : minV;\n } else dataRef[i][v][t] = 'no value';\n }\n for (let t = 0; t < netSP.timeInfo.length; t++) {\n if (typeof (dataRef[i][v][t]) === 'number') dataRef[i][v][t] = (dataRef[i][v][t]-minV)/(maxV-minV);\n }\n }\n }\n }\n else if (controlVariable.normalization==='similarUnit') { // for my proposed normalization\n // Get mean of labor force\n for (let i in dataRef) {\n let meanLF = 0;\n for (let t = 0; t < netSP.timeInfo.length; t++) {\n let LF = 0;\n for (let v in dataRef[i]) {\n if (typeof (dataRef[i][v][t]) === 'number')\n LF += dataRef[i][v][t];\n }\n meanLF += LF/netSP.timeInfo.length;\n }\n for (let v in dataRef[i]) {\n for (let t = 0; t < netSP.timeInfo.length; t++) {\n if (typeof (dataRef[i][v][t]) === 'number') {\n dataRef[i][v][t] /= meanLF;\n }\n }\n }\n }\n } else if (controlVariable.normalization==='individual') { // for each time series\n for (let i in dataRef) {\n for (let v in dataRef[i]) {\n let tS = dataRef[i][v].filter(e=>typeof (e)==='number');\n let maxV = Math.max(...tS);\n let minV = Math.min(...tS);\n for (let t = 0; t < dataRef[i][v].length; t++) {\n if (typeof(dataRef[i][v][t])==='number') dataRef[i][v][t] = (maxV > minV) ? (dataRef[i][v][t]-minV)/(maxV-minV) : 0.5;\n }\n }\n }\n }\n\n // measure time\n timeMeasure[1] = performance.now();\n }", "title": "" }, { "docid": "76f03cb9ced03c65c9c90cb92a91d5de", "score": "0.49581367", "text": "static Normalize(vector) {\r\n\t var result = Vector4.Zero();\r\n\t Vector4.NormalizeToRef(vector, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "76f03cb9ced03c65c9c90cb92a91d5de", "score": "0.49581367", "text": "static Normalize(vector) {\r\n\t var result = Vector4.Zero();\r\n\t Vector4.NormalizeToRef(vector, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "2de7d72445c2da3fa1a8135af3935458", "score": "0.49511537", "text": "function makeNormalize(relName) {\n return function (name) {\n return normalize(name, relName);\n };\n }", "title": "" }, { "docid": "870bbf184fe3e330e6eadb6e38e3a3ad", "score": "0.49466214", "text": "normalize() {\n let length = this.getMagnitude();\n\n if (length > 0) {\n this.x = this.x / length;\n this.y = this.y / length;\n }\n }", "title": "" }, { "docid": "52ba9a8e0960828f490967578e22fcf3", "score": "0.49446845", "text": "reshape(...format) {\n throw \"Most difficult function to implement.\";\n }", "title": "" }, { "docid": "3721d5398eb88b61f9012fb4024a8fec", "score": "0.4935436", "text": "normalize() {\r\n if (this.isZeroVector() === false) {\r\n let mag = this.magnitude;\r\n this.x /= mag;\r\n this.y /= mag;\r\n this.z /= mag;\r\n this.magnitude = 1;\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "b9b88b151604c7bf348751744dc88c30", "score": "0.49297348", "text": "diffuse() {\r\n\r\n }", "title": "" } ]
c867ccd400e175b7dadd47b2d12ca209
send data collected to database
[ { "docid": "bae89dc457c6a33809de97c4091ec8de", "score": "0.0", "text": "function createPost(newData) {\n $.ajax({\n url: 'http://localhost:3000/posts',\n method: 'POST',\n data: newData,\n success: function(newPost) {\n $('#table-body').append($(`<tr data-id='${newPost.id}'>`)\n .append($('<td>').append(newPost.id))\n .append($('<td>').append(newPost.title))\n .append($('<td>').append(newPost.author))\n .append($('<td>').append(newPost.description))\n .append($(\"<td>\").append(`\n <button class='deletePost' data-id='${newPost.id}'> Delete</button>\n <a href=\"update.html\" onclick=\"goToEdit('${post.id}')\" class='editPost btn-primary' data-id='${post.id}'> Edit</a>\n `))\n )\n }\n });\n }", "title": "" } ]
[ { "docid": "1a84e2aeb1d04ee0ca2c351d372d3350", "score": "0.6420019", "text": "function recordData() {\n\n\n //Skip the rest of the request if there aren't any matches that need to be updated.\n if (matchesData.length == 0) {\n completeData();\n return;\n }\n\n console.log(\"Recording Data!\");\n\n var matchesBuffer = [];\n\n for (match in matchesData) {\n\n\n var matchData = buildMatchData.build({statusCode: \"200\", body: JSON.stringify(matchesData[match])});\n\n matchesBuffer.push(matchData);\n\n }\n\n console.log(\"Matches Buffer:\");\n\n console.log(matchesBuffer);\n\n var bufferOutput = readBuffer.read(matchesBuffer);\n\n console.log(bufferOutput);\n\n\t\t\tvar con = mysql.createConnection({\n\t\t\t\thost: \"localhost\",\n\t\t\t\tuser: \"frickmh\",\n\t\t\t\tpassword: \"rbbsbfh11\",\n\t\t\t\tdatabase: \"carryfactor_\" + region\n\t\t\t}); \n\n completeData();\n\n basicQuery.query(con, bufferOutput.sql);\n\n }", "title": "" }, { "docid": "cc3c818475ade2670ab6ca9e41ea4ccc", "score": "0.6242155", "text": "function writeToServer() {\n\n var sendthis = user.toString();\n var andthis = experiment.toString();\n var andalsothis = stats.toString();\n var resumptions = resumptionspots.toString();\n var ttimes = trialtimes.toString();\n var dumpd = dumpdata;\n\n var request = $.ajax({\n url: \"storedata.php\",\n type: \"POST\",\n data: ({sendthis: sendthis, andthis: andthis, andalsothis: andalsothis, resumptions: resumptions, ttimes: ttimes, dumpd: dumpd}),\n success: function(msg) {\n //$(\"#dataoutput\").html(msg);\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) {\n //$(\"#dataoutput\").html(\"API Error\");\n }\n });\n }", "title": "" }, { "docid": "73714543cb9a78fd301e996f516e3198", "score": "0.6156301", "text": "function sendprocedures()\n{\n\t\n\t showUpModal();\n\t\tIsSyncMessages=true;\n\t \t$(\"#progressheader\").html(\"Collecting data...\");\n\t\t$(\"#progressMessage\").html(\"Preparing data to send\");\n\t\tpbar.setValue(0);\n\t sendproceduresarray=\"\";\n\t var db = window.openDatabase(\"Fieldtracker\", \"1.0\", \"Fieldtracker\", 50000000);\n db.transaction(Querytosendprocedures, errorCB);\n\t\n}", "title": "" }, { "docid": "f90974ce705c24303841e5c4528cbc47", "score": "0.6094518", "text": "function saveAll() {\n data = {}\n data['pool'] = pool.export();\n data['project'] = project.export();\n\n console.log('saving', data)\n\n socket.emit('save', JSON.stringify(data, null, \"\\t\"))\n\n // TODO: fallback to AJAX -> /data/save.php (type project) if socketio not available)\n\n }", "title": "" }, { "docid": "1b80e586b6b7c46f85190895c566c310", "score": "0.6077909", "text": "function sendDataUpdate(event) {\n listDB.find({}, {}, function(err, lists) {\n\t\t\t// TODO Handle errors.\n\t\t\tvar data = {'lists': lists, 'event': event};\n\t\t\tio.emit('update-data', JSON.stringify(data));\n });\n}", "title": "" }, { "docid": "ab38890e507b05372d3a2ccd1d40a4e7", "score": "0.60141534", "text": "function process() {\n\t\t\t//preparo l' array con i dati da inviare al server\n\t\t\tinputPrepare();\n\n\t\t\t//invio la richiesta al server\n\t\t\tsend();\n\n\t\t}// close function process()", "title": "" }, { "docid": "1a041a59107211cf59aac21e8ffbf1d7", "score": "0.6005287", "text": "function sendData(res, columns, sql, params)\n{\n\tvar splitColumns = columns.split(\",\");\n\tvar nColumns = splitColumns.length;\n\tvar storedData = new Array(nColumns);\n\t\n\t//creates two dimensional array.\n\tfor(i = 0; i<nColumns; i++)\n\t{\n\t\tstoredData[i] = new Array();\n\t}\n\t\n\t//makes column title the first element in each column.\n\tfor(i in splitColumns)\n\t{\n\t\tstoredData[i][0] = splitColumns[i];\n\t}\n\t\n\t//Fills array with data from sqlite database.\n\tdb.serialize(function()\n\t{\n\t var location = 1; //Second iterator for second dimension of array.\n\t \n\t /*sqlite3 command with two callback functions:\n\t First one performs its operation on each row.\n\t Second one executes once after all row are done being processed.*/\n\t db.each(sql,params,\n\t function(err,row)\n\t {\n\t for(i in splitColumns)\n \t {\n\t\t if(row[splitColumns[i]])\n\t\t storedData[i][location] = row[splitColumns[i]];\n\t }\n\t location++;\n\t },\n\t function(err,rows)\n\t {\n\t sendTable(rows, nColumns, storedData, res);\n\t });\n });\n}", "title": "" }, { "docid": "05a91cafb440790495c841eef5f2a5eb", "score": "0.59956115", "text": "async function sendMultipleData() {\n let cursor = '0';\n // keys with a \"to_send-\" prefix are objects that were saved but not sent\n redis.scan(cursor, 'MATCH', 'to_send-*', (err, rep) => {\n if(err) throw err;\n cursor = rep[0];\n if(cursor === '0') return;\n // for each key in redis DB, fetch value, send parsed value and delete pair from DB\n rep[1].forEach(async id => await sendSingleData(await parseRedisData(id)));\n });\n}", "title": "" }, { "docid": "6b3b08026e92b3b3d106bfbf5bdf1581", "score": "0.59745866", "text": "static writeToDB () {\n var db = new JsonDB(config.jsondb, true, false);\n\n db.push('/', Restreamer.dataForJsonDb());\n }", "title": "" }, { "docid": "886c6c743d539a79556b898b779ef45a", "score": "0.5939192", "text": "send ( wuid ) {\n\t\t // prepare data to be send to server\n\t }", "title": "" }, { "docid": "68a1db94a6463e6fd71c47c673d27c9c", "score": "0.5938429", "text": "function saveM4qData(data) // Function save MQ4 data in to mysql.\n{\n var sql = \"INSERT INTO co (co,created_at, updated_at) VALUES ?\";\n var values = [\n [data, moment(new Date()).format(\"YYYY-MM-DD HH:mm:ss\"), moment(new Date()).format(\"YYYY-MM-DD HH:mm:ss\")]\n ];\n mysql_conntection.query(sql, [values], function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "59100d7677ac40d0c80da6bf646309ab", "score": "0.5932092", "text": "static saveData(data){\n return DBHelper.newIDB().then(db => {\n if(!db) return;\n const tx = db.transaction('restaurants', 'readwrite');\n const store = tx.objectStore('restaurants');\n // saving each element in database restaurant\n data.forEach((restaurant) => {\n store.put(restaurant);\n });\n return tx.complete;\n }).then(() => {\n console.log('Data Saved to IDB');\n });\n }", "title": "" }, { "docid": "46b7a0de9d10abfba1eb3b9711a4cd42", "score": "0.59125376", "text": "function send(qst) {\n let qstdata = [];\n let curDate = currDate();\n for (let i = 0; i < qst.length; ++i) {\n qstdata[i] = {\n body: qst[i].body,\n options: JSON.stringify(qst[i].asrs),\n idx: qst[i].idx,\n tag: qst[i].tag\n };\n }\n if (isFirebase) {\n //console.log('firebase go')\n db.collection('qsts').doc('uid').set({\n [curDate]: qstdata // use current date as key, the original questions will be overwritten\n })\n .then(docRef =>{\n // console.log('doc from firestore===>', docRef)\n }).catch(e=>{\n console.error('fireStore err===>', e);\n })\n } else {\n // MySql version \n const url = '/qs/save';\n let data = { // convert to obj and send to db\n qst: qstdata\n };\n //send to server\n $.post(url, data, function (data, status) {\n console.log(\"from server \", data);\n });\n\n }\n\n }", "title": "" }, { "docid": "ccc9cd62a2076ac66fd927c802a2d77a", "score": "0.59073216", "text": "async function saveData(data) {\n // Get a connection from pool\n let conn = await pool.getConnection();\n // Catch any errors\n try {\n // Try to insert values to database\n await conn.query(\n `INSERT INTO graph VALUES (?${\",?\".repeat(13)})`,\n [ Date.now(), ...Object.values(data.graph) ]\n );\n await conn.query(\n `UPDATE stat SET\n time = ?,\n cpuClock = ?,\n cpuCores = ?,\n uptime = ?,\n ramTotal = ?,\n swapTotal = ?,\n diskSize = ?,\n diskReadTotal = ?,\n diskWriteTotal = ?,\n diskUsed = ?,\n diskUsedPercentage = ?,\n downloadTotal = ?,\n uploadTotal = ?`,\n [ Date.now(), ...Object.values(data.stat) ]\n );\n console.log(`Saved data at ${new Date().toISOString()}`);\n } catch(e) {\n // Log and ignore\n console.error(e);\n } finally {\n // Release the connection\n conn.release();\n }\n}", "title": "" }, { "docid": "7d60f5bd44856a33135c7d90ed9cfdb1", "score": "0.588738", "text": "function saveData(data) {\n // open a new transaction with the database with read and write permissions \n const transaction = db.transaction(['budget_data'], 'readwrite');\n\n //access the object store\n const transactionObjectStore = transaction.objectStore('budget_data');\n\n //add record to the table\n transactionObjectStore.add(data)\n}", "title": "" }, { "docid": "f3cf704f222522ea24128c5fce03f1d7", "score": "0.5882465", "text": "function saveToDB(data)\n\t{\n\t\ttransaction = db.transaction('tweets', 'readwrite');\n\t\tobjectStore = transaction.objectStore('tweets');\n\n\t\trequest = objectStore.add(data);\n\n\t\ttransaction.oncomplete = function(event)\n\t\t{\n\t\t\tconsole.log(':::: ADDED TO DATABASE :::: ', event);\n\n\t\t\tgetTweets();\n\n\t\t};\n\t}", "title": "" }, { "docid": "a05c26998a84fb9c19687430bb2af1f4", "score": "0.58754325", "text": "static async save(data) {\n try {\n\n let result = await DatabaseService.bulkUpsert(collectionName, data);\n return result;\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "889d43bf968fa22ff4eab58952bba974", "score": "0.5874443", "text": "function sendData() {\n if (results.length === 3) {\n metadata = { total_count: results.length };\n console.log(`${metadata.total_count} results, sending data!`);\n res.json({ _metadata: metadata, records: results });\n } else {\n setTimeout(() => {\n sendData();\n }, 1000);\n }\n }", "title": "" }, { "docid": "b9b4c7e903bc9b303df75def102a8f13", "score": "0.58638895", "text": "function insert(data) {\n // get index\n let i = data.i\n // get start time\n let startTime = data.startTime\n // sql query\n const sql = `INSERT INTO workerdata (data) VALUES ('data-${i}')`;\n connection.query(sql, function(err, result) {\n if (err) throw err;\n //print execution time\n console.log(`Proses ke ${i} ${performance.now() - startTime} milliseconds`)\n });\n}", "title": "" }, { "docid": "b9b4c7e903bc9b303df75def102a8f13", "score": "0.58638895", "text": "function insert(data) {\n // get index\n let i = data.i\n // get start time\n let startTime = data.startTime\n // sql query\n const sql = `INSERT INTO workerdata (data) VALUES ('data-${i}')`;\n connection.query(sql, function(err, result) {\n if (err) throw err;\n //print execution time\n console.log(`Proses ke ${i} ${performance.now() - startTime} milliseconds`)\n });\n}", "title": "" }, { "docid": "4774479568d3c83d772ab786b4e8b39f", "score": "0.5859726", "text": "function senddatabacktostoreofdrug2distributor(next){\n knex('drug2distributor').select().then(function(result){\n next(null,result);\n })\n}", "title": "" }, { "docid": "cd29f037a7f0d131112f56e4487ff2bd", "score": "0.5854048", "text": "*saveData() {\n\t\tconst data = this.state.data;\n\n\t\t// Send the data to the server.\n\t\tconst options = {\n\t\t\tmethod: 'POST',\n\t\t\turi: this.state.saveURL,\n\t\t\tbody: data,\n\t\t\tjson: true\n\t\t};\n\t\tyield requestPromise(options);\n\t}", "title": "" }, { "docid": "016d35141d0b33db066c1f069cac30ff", "score": "0.584566", "text": "function addToDatabase() {\n\n var xmlhttp = new XMLHttpRequest();\n //var sendData = $(\"input\");\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var result = xmlhttp.responseText;\n result += collectData();\n $(\"#confirm\").text(result);\n\n }\n }\n xmlhttp.open(\"POST\", \"/stock/adminAddStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "title": "" }, { "docid": "59f69b541810f623ae086b5b3bd92057", "score": "0.58386225", "text": "function viewProductSale(){\n\nvar query = connection.query(\"SELECT * FROM products\",function(err,res){\nfor(var i=0; i< res.length; i++){\nconsole.log(\"--------------------------------------------------------------\");\nconsole.log(\"ids:\"+res[i].item_id+\" product name:\" + res[i].product_name + \" department name:\"+ res[i].department_name + \" price: $\"+ res[i].price + \" stock quantity: \"+ res[i].stock_quantity)\n\n}\nsendData(res);\n\n\n\n});\nstart();\n}", "title": "" }, { "docid": "2d982f9492a783f1f79572c1e6fa6c09", "score": "0.5832432", "text": "function saveData (data) {\n data.save('target_count', target_count)\n data.save('target_entity', target_entity)\n data.save('killed', killed)\n}", "title": "" }, { "docid": "ee447812a97c49fd845e5fa19a783df6", "score": "0.58084863", "text": "function PublishToDataStore(req,resp){\n var myString = req.params.body;\n\tvar dataList = myString.split(',');\n\tvar cpuUsage = dataList[0];\n\tvar localTimeStamp = dataList[1];\n\t//Separating the value of cpu usage percentage using regex\n var myCpuRegexp = /{\\\"usageinpercentage\\\":\\s+\\\"(.*)\\\"/g;\n var final_cpu = myCpuRegexp.exec(cpuUsage);\n var fcpu = final_cpu[1];\n\t//Separating the value of timestamp usage percentage using regex\n var myTsRegexp = /\\\"timestamp\\\":\\s+\\\"(.*)\\\"}/g;\n var final_ts = myTsRegexp.exec(localTimeStamp);\n var fTs = final_ts[1];\n\tClearBlade.init({request:req});\n\n \tvar insertintoCollection = function() {\n\t\tvar collection = ClearBlade.Collection({collectionName:\"CpuUsage\"});\n\t\tvar newRow = {\n\t\t\tusageinpercentage: fcpu,\n\t\t\ttimestamp:fTs\n\t\t};\n\t\tvar callback = function(err, data) {\n\t\t\tif (err) {\n\t\t\t\tresp.error(data);\n\t\t\t} else {\n\t\t\t\tresp.success(\"Data stored successfully\");\n\t\t\t}\n\t\t};\n\t\tcollection.create(newRow, callback);\n\t};\n\n\tinsertintoCollection();\n}", "title": "" }, { "docid": "efd44c246e075ced4ebb15db6c8abdbc", "score": "0.5808054", "text": "function sendData() {\n\t// Create a reference to the colors section\n\tvar colors = database.ref('colors');\n\t// Data object to be stored in the database\n\tvar data = {\n\t\tred: r,\n\t\tgreen: g,\n\t\tblue: b,\n\t\tcolor: this.html()\n\t}\n\t\n\t// Push data to colors\n\tvar color = colors.push(data);\n\t// Update the color of the page\n\tsetColor();\n\tbackground(r, g, b);\n\n\tcolors.once('value', function(snapshot) { console.log('Count: ' + snapshot.numChildren()); });\n}", "title": "" }, { "docid": "5d331915da91d9121c93971459a21bcd", "score": "0.58057415", "text": "function returnData() {\n const transaction = db.transaction(['process'], 'readwrite');\n const dataStore = transaction.objectStore('process');\n const getAll = dataStore.getAll();\n getAll.onSuccess = function() {\n // If data in indexedDb's store, send it to api server\n if (getAll.result.length > 0) {\n fetch('/api/transaction/bulk', {\n method: 'POST' ,\n body: JSON.stringify(getAll.result),\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n }\n })\n .then(response => response.json())\n .then(serverResponse => {\n if (serverResponse.message) {\n throw new Error(serverResponse);\n }\n const transaction = db.transaction(['process'], 'readwrite');\n const dataStore = transaction.objectStore('process');\n dataStore.clear();\n })\n }\n }\n}", "title": "" }, { "docid": "87f35cd9e6470d2ce80ec1b04a1b59ac", "score": "0.5798858", "text": "function recordDB(data) {\r\n MongoClient.connect(url, function (err, db) {\r\n assert.equal(null, err);\r\n console.log(\"Connected successfully to server database\");\r\n\r\n insertDocuments(db, function () {\r\n db.close();\r\n }, data);\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "93cacd39fd7d595e43d05cbba100248f", "score": "0.5794756", "text": "function insertDataToDatabase(collectionName, data) {\n var ItemModel = require('./models/item')(String(collectionName));\n for (var i = 0; i < data.length; i++) {\n var newItem = new ItemModel({\n sex: data[i].sex,\n season: data[i].season,\n type: data[i].type,\n cover: data[i].cover,\n hover: data[i].hover,\n name: data[i].name,\n category: data[i].category,\n price: data[i].price,\n currency: data[i].currency,\n url: data[i].url,\n sizes: data[i].sizes\n });\n newItem.save(function (err, newItem) {\n if (err) console.log(err);\n });\n }\n}", "title": "" }, { "docid": "b95fb8adc955596a8b559e7b20021cf4", "score": "0.5792883", "text": "function sendAll(db, res) {\n var results = store.get(db);\n\n try {\n res.jsonp(results);\n } catch (e) {\n errorHandler(res, e);\n }\n }", "title": "" }, { "docid": "3e95eca0140a3290f2bf7036a7e76d7c", "score": "0.5768723", "text": "function writeUserData(trainName,destination,firstTrain,frequency){\n database.push({\n trainName : trainName,\n destination: destination,\n firstTrain : firstTrain,\n frequency: frequency,\n })\n}", "title": "" }, { "docid": "a059f8d1954113f5d0a0c64002eb94d6", "score": "0.5758113", "text": "function saveToDB(obj) {\r\n //saves to adaptor.....\r\n}", "title": "" }, { "docid": "fc2fd01b754d54130c1a32572014eaa3", "score": "0.57493925", "text": "function processRequest() {\n\t\t\t\t\t\t\t\tlet itemsProcessed = 0;\n\t\t\t\t\t\t\t\tif (typeof (result.sent) != 'undefined') {\n\t\t\t\t\t\t\t\t\tresult.sent.forEach(tx => {\n\t\t\t\t\t\t\t\t\t\tmng.db(dbNAME).collection(\"transactions\").findOne({\n\t\t\t\t\t\t\t\t\t\t\t_id: Number(tx)\n\t\t\t\t\t\t\t\t\t\t}, function (err, result2) {\n\t\t\t\t\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\t\t\t\t\tbalance -= result2.value;\n\t\t\t\t\t\t\t\t\t\t\ttxs.push(result2);\n\t\t\t\t\t\t\t\t\t\t\titemsProcessed++;\n\t\t\t\t\t\t\t\t\t\t\tif (itemsProcessed == result.sent.length) {\n\t\t\t\t\t\t\t\t\t\t\t\tprepareData();\n\t\t\t\t\t\t\t\t\t\t\t}\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} else {\n\t\t\t\t\t\t\t\t\tprepareData();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "87c7c8d18d87a12dd5a9dd2ab958416d", "score": "0.57336277", "text": "function dataEntry(values) {\n var sql = \"INSERT INTO products (title, price, store, pricePerWeight, imageUrl, category, availability) VALUES ?\";\n db.query(sql, [values], function (err, result) {\n if (err)\n throw err;\n\n console.count(\"Number of records inserted: \" + result.affectedRows);\n });\n}", "title": "" }, { "docid": "1af4e7729f4f72242ab552de6d794c5e", "score": "0.5719939", "text": "sendAttributesToDB(postItId) {\n const roomId = new URLSearchParams(window.location.search).get(\"room\");\n this.postitOnChange(roomId, postArray);\n const postItdb = postArray.find((post) => post.id === postItId);\n socket.emit(\"changedPostit\", { postItdb, roomId });\n }", "title": "" }, { "docid": "178eef0338da106cca4aed11c2782bbe", "score": "0.57193035", "text": "function insert_data(data) {\n if (db) {\n const insert_transaction = db.transaction(\"user\", \"readwrite\");\n const objectStore = insert_transaction.objectStore(\"user\");\n\n return new Promise((resolve, reject) => {\n insert_transaction.onerror = function (event) {\n console.log(event);\n resolve(false);\n };\n\n insert_transaction.onsuccess = function (event) {\n console.log(event);\n resolve(true);\n };\n\n data.forEach((email) => {\n let request = objectStore.add(email);\n\n request.onerror = function (event) {\n console.log(\"Failed to add data\");\n };\n\n request.onsuccess = function (event) {\n console.log(\"Successfully added data\");\n };\n });\n });\n }\n}", "title": "" }, { "docid": "33983e3ab5580f024b8f4422a799a17b", "score": "0.5703322", "text": "function saveSphereData(data) {\n socket.emit('saveData', { data:data, room:room });\n}", "title": "" }, { "docid": "7ebdb036ee5db700f5efdad1c2ba6e09", "score": "0.57019925", "text": "function sendData(){\r\n\t\r\n\tio.sockets.emit('updateObstacles',listOfObstacles);\r\n\tio.sockets.emit('updateCloudObstacles',listOfCloudObstacles);\r\n\tfor(let player in listOfPlayers) {\r\n\t\tio.emit('updatepos',{'username' : player , 'x' : listOfPlayers[player].x, 'y' : listOfPlayers[player].y });\r\n\t\tio.emit('updatePoints',{'username' : player , 'points' : listOfPlayers[player].points});\r\n\t\tio.emit('updateLevelCounter', level);\r\n\t\t/*var pos = { 'x':listOfPlayers[newPos.user].x , 'y':listOfPlayers[newPos.user].y };\r\n\t\tsocket.emit(\"lastPos\", pos);*/\r\n\t}\t\t\r\n}", "title": "" }, { "docid": "64d2244ded4bce5896f99dbe1daecda3", "score": "0.56929487", "text": "function dbSubmit() {\n var _loop = function _loop(item) {\n if (donationSummary[item] > 0) {\n var itemDoc = firestore.collection('donationSummary').doc(item);\n var getItemDoc = itemDoc.get().then(function (doc) {\n if (!doc.exists) {\n console.log('No such document!');\n } else {\n var currentAmount = doc.data();\n var newAmount = currentAmount['quantity'] + donationSummary[item];\n var donationItems = firestore.collection(\"donationSummary\").doc(item).update({ 'quantity': newAmount });\n }\n }).catch(function (err) {\n console.log('Error getting document', err);\n });\n }\n };\n\n for (var item in donationSummary) {\n _loop(item);\n }\n}", "title": "" }, { "docid": "f4549461061e51d0dc569bb91d80d529", "score": "0.56879556", "text": "async myTask(data, msg, conn, ch, db) {\n\n\t\tvar rows = await db.collection('test_usage').aggregate([{ \n\t\t\t$group:{\n\t\t\t\t_id:{\n\t\t\t\t\t'id_submission':'$id_submission',\n\t\t\t\t\t'source_etl':'$source_etl',\n\t\t\t\t\t'team':'$team',\n\t\t\t\t\t'app':'$app',\n\t\t\t\t\t'player_id':'$player_id'\n\t\t\t\t},\n\t\t\t\tnumber_of_responses:{$sum:1}\n\t\t\t} \n\t\t}]).toArray();\n\n\t\tconsole.log(` [x] Wrote ${JSON.stringify(rows)} to ${this.DbName + '.' + c}`);\n\n\t\tch.ack(msg);\n\n\t\treturn rows.map(x => Object.assign({number_of_responses: x.number_of_responses}, x._id));\n\t}", "title": "" }, { "docid": "bf140e574f6afceb0b1880be23a22d3a", "score": "0.56744397", "text": "insertData(complete) {\n\t\tthis.mysql.pool.query(this.sql, this.inserts, function (error, result, fields) {\n\t\t\tcomplete(result.insertId);\n\t\t});\n\t}", "title": "" }, { "docid": "3164463468decce8aa477face89323ae", "score": "0.5674163", "text": "function syncWithDb(data){\r\n // Now we are sending data from client to server then from this server to db\r\n // we are using fetch to send data\r\n //headers- they are used to define which type of data are sending\r\n const headers={\r\n \"Content-Type\":\"application/json\"\r\n }\r\n fetch(\"/comments/:postId\",{method:\"POST\",body: JSON.stringify(data),headers}) //in this fetch we have second argument where we are sending data in the form of JSON\r\n .then(response => response.json()) //here we are recieving response in string format so we converted it into json\r\n .then(result =>{\r\n console.log(result)\r\n })\r\n}", "title": "" }, { "docid": "96dd6c674f6eac5b3c08743cb3d793c7", "score": "0.5649497", "text": "function storeData(){\n\tstoreDifferenceData.storeDifferences(differences, \"Berkeley's\", communicationType, synchronisationRate, largeOffset);\n\tconsole.log(\"\\n\\n SAVED DATA \\n\\n\");\n}", "title": "" }, { "docid": "b443a8dafe55c633950b597868b3acc3", "score": "0.5642012", "text": "function saveToDB(obj) {\n //saves to adaptor.....\n}", "title": "" }, { "docid": "ca0be2a2c13396eb0643482bd866572a", "score": "0.5639397", "text": "sendServerData(){\n // Pack into JSON form to be read from server code.\n var dataToSend = [];\n dataToSend.push(this.lines);\n this.emitSendData(dataToSend);\n }", "title": "" }, { "docid": "15573bcf4ed35a3e69633aac12584aab", "score": "0.5638877", "text": "function addDB( data ){\t\t\t\t\t\t\t\n\n \n\n\t\t\tdb.transaction( function(tx){\n\n\t\t\t\t\t\t\t\t\t\t \n\n\t\t\t\t//var tablas = [\"productos\", \"clientes\"];\n\n\t\t\t\tvar tablas = Object.keys( data );\n\n\t\t\t\tfor(var k = 0; k < tablas.length; k++ ) { \n\n\t\t\t\t\n\n\t\t\t\t\tvar tabla = tablas[k];\n\n\n\n\t\t\t\t\tvar n = data[ tabla ].length ;\n\n\n\n\t\t\t\t\tvar listaColmunas; \n\n\t\t\t\t\tif(n>0){ \n\n\n\n\t\t\t\t\t\tvar stringCol=\"\";\n\n\t\t\t\t\t\tvar stringVal=\"\";\n\n\n\n\t\t\t\t\t\tlistaColmunas = Object.keys( data[ tabla ][0] ) ;\n\n\t\t\t\t\t\tvar colmLength = listaColmunas.length; \n\n\t\t\t\t\t\tfor(var i = 0; i < colmLength; i++ ) {\n\n\t\t\t\t\t\t stringCol+= listaColmunas[i]+\",\";\n\n\t\t\t\t\t\t stringVal+= \"?,\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstringCol = stringCol.substring(0, stringCol.length-1);\n\n\t\t\t\t\t\tstringVal = stringVal.substring(0, stringVal.length-1);\n\n\n\n\n\n\t\t\t\t\t\tvar sql = 'INSERT INTO '+tabla+' ('+stringCol+') VALUES ('+stringVal+') ';\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tfor( var i = 0; i < n; i++){\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tvar obj = data[ tabla ][i];\n\n\t\t\t\t\t\t\tvar objData = [];\n\n\t\t\t\t\t\t\tfor(var j = 0; j < colmLength; j++ ) {\n\n\t\t\t\t\t\t\t\tobjData.push( data[ tabla ][i][listaColmunas[j]] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\ttx.executeSql( sql, objData,\n\n\t\t\t\t\t\t\t\t// On Success\n\n\t\t\t\t\t\t\t\tfunction (itx, results) {},\n\n\t\t\t\t\t\t\t\t// On Error\n\n\t\t\t\t\t\t\t\tfunction (etx, err) {\n\n\t\t\t\t\t\t\t\t\t// Reject with the error and the transaction.\n\n\t\t\t\t\t\t\t\t\tconsole.log(\" >>> ERROR: \"+err.message);\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t\t} \n\n\t\t\t\t\t} \n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t},\n\n\t\t\t\n\n\t\t\tfunction(tx,res){\n\n\t\t\t\talert(\"Error al insertar en DB Local \"+res);\n\n\t\t\t},\n\n\t\t\t\n\n\t\t\tfunction(){\n\n\t\t\t\t\n\n\t\t\t\t//Finalizamos Correctamente\n\n\t\t\t\tsetTimeout(function(){\t\t\t\t\n\n\t\t\t\t\t\t$('#btnGuardarSinc').css(\"visibility\",\"visible\");\n\n\t\t\t\t\t\t$('#txtGuardandoSinc').html(\"¡Aplicación Offline Almacenada!\");\n\n\t\t\t\t\t\t$('#modalSinc #cargando').hide();\t\t\t\t\n\n\t\t\t\t},1000); \n\n\t\t\t\t\n\n\t\t\t}); \n\n\t\t\t\n\n\t\t\t\n\n\t\t}", "title": "" }, { "docid": "ba4bd751d7b6375ae8b5d8c2493b8312", "score": "0.56318456", "text": "function data(Rubric_Id, newRubricId){\n \n connection.query(\"Select * from `data` where `Rubric_Id` = ?\",Rubric_Id,function(err, results, fields){\n if(err) throw err;\n\n if(results.length>0){\n var total = [];\n for(var l = 0;l<results.length;l++){\n value= [newRubricId, results[l].Row_Id,results[l].Data, results[l].index]\n total.push(value)\n \n }\n connection.query(\"INSERT INTO `data`(`Rubric_Id`, `Row_Id`, `Data`, `index`) VALUES ?\",\n [total], function(err, result, fields){\n if(err) throw err;\n })\n\n }\n\n \n })\n\n }", "title": "" }, { "docid": "df69c12f497dfe1acdf8ce956b43e338", "score": "0.5620951", "text": "function savednumbers(data) {\n let { number, type, text } = data;\n let SQL = 'INSERT INTO numbertable (number, type, text) VALUES ($1, $2, $3) RETURNING *';\n let values = [number, type, text];\n // console.log('vallllllllllllllllll', values);\n return client.query(SQL, values)\n .then(results => results.rows[0])\n .catch(err => handleError(err, response));\n\n\n}", "title": "" }, { "docid": "7f22d4aa21c8242fc5ba2631d63398f7", "score": "0.5620551", "text": "async setInput(data) {\r\n //TODO: consider refactoring this function to check if database input is empty\r\n if (!data && data.length === 0) {\r\n throw new Error(\"Source is empty!\")\r\n }\r\n try {\r\n //Do batch insertion\r\n let batch = this.db.batch();\r\n data.forEach(async (doc) => {\r\n const ref = this.input.doc();\r\n batch.set(ref, doc);\r\n });\r\n await batch.commit();\r\n }\r\n catch (ex) {\r\n throw new Error(`Error appending to input collection! \\n${ex}`);\r\n }\r\n }", "title": "" }, { "docid": "2ce73553ab66ab72d4b5856d61a01a0e", "score": "0.56199896", "text": "function setData(data){\n db.idSource = data.idSource;\n db.assemblies = data.assemblies;\n buildIdToName();\n }", "title": "" }, { "docid": "d0c17a335cf08913161b19a5e7ac1807", "score": "0.56195337", "text": "function sendResponse() {\n\t\t\t\tTi.API.log('doing save callback');\n\t\t\t\t// create an alert saying that the data has been sent for moderation\n\t\t\t\talert('The venue data has been successfully sent to the team for moderation.');\n\t\t\t}", "title": "" }, { "docid": "d7bae02b0b538e22136a5667e1d8ccd5", "score": "0.5614192", "text": "function saveData(request) {\n // Make an object with a name and number\n // from the query string\n var data = {\n name: request.params.name,\n num: request.params.num\n };\n \n // Add to database\n names.add(data);\n\n // A reply\n request.respond('Thanks your data was saved:' + data.name + ',' + data.num);\n}", "title": "" }, { "docid": "cfae389a48b38628e73a02b32b3369c1", "score": "0.5610345", "text": "function save_data(pagelists){\n\tfor(var i in pagelists){\n\t\tif(pagelists[i] != 'undefined'){\n\t\t\t//var data = {'site':'vrzy.com','url':pagelists[i],'status':0}\n\t\t\tconsole.log(pagelists[i])\n\t\t\t/*MongoClient.connect(url , function(err,db){\n\t\t\t\tvar col = db.collection('tasks');\n\n\t\t\t\tcol.insert(data,function(err,result){\n\t\t\t\t\t//test.equal(null, err);\n\t\t\t\t\tconsole.log(result);\n\t\t\t\t});\n\n\t\t\t});*/\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "4b2bdd1fdc5b74397be1c88a00f7ce99", "score": "0.5589476", "text": "processPage(event){\n event.preventDefault();\n alert(this.state.poemName);\n alert(this.convertArrayToString(this.state.tags));\n alert(this.convertArrayToString(this.filterLines(this.state.newTags)));\n alert(this.state.blockNumber);\n alert(this.convertArrayToString(this.filterLines(this.state.lines)));\n alert(this.convertGameBoardToString(this.state.gameBoard));\n //SEND DATA TO DATABASE HERE\n window.location.reload(false);\n }", "title": "" }, { "docid": "68f18c2a6c028315de97128b8c209ce8", "score": "0.55868983", "text": "submitTableData(){\n // emit a Make Table bus signal; or place a passenger on the bus carrying the \n // parameters to make a table. This package will get off at\n // the bus.$on (bus stop) and get routed to where it should be delivered.\n // console.log(\"Adding seating\");\n bus.$emit('sigMakeTable',startX,startY,this.tableType, this.seats, this.xSeats, this.ySeats, this.sectionName, this.seatType, this.price);\n\n // set toggle the table forms visibility since the table has been created.\n this.showAddTableForm = false;\n }", "title": "" }, { "docid": "123c974d143b21b3381d44f113c05e4a", "score": "0.55852276", "text": "function sendDatabase(dbName, payload1) {\r\nvar timeNow = getTime();\r\nif(db.ref(dbName).push(payload1)){ //unique key and difference value\r\n//db.ref(dbName).child({difference:payload1});\r\n winston.log('info', 'Sending to firebase successfull');\r\n} else {\r\n \r\n winston.log('error', 'Sending not successfull');\r\n}\r\nstopSpin();\r\n}", "title": "" }, { "docid": "7f88223bf60ef47fef7a604b21d95b45", "score": "0.5582888", "text": "function SendData(hourly_readings, callback) {\n var base_record = hourly_readings[0];\n\n var total_cost = 0;\n var total_power = 0;\n var max_power = 0;\n var min_power = 0;\n\n var recordedDate = new Date(\n parseInt(base_record.Year) + 2000,\n parseInt(base_record.Month) - 1,\n parseInt(base_record.Day),\n parseInt(base_record.Hour), //save for this current hour (not the next)\n 0, 0, 0 //minutes, seconds, milliseconds\n );\n\n\n _.each(_.pluck(base_record.Mtus, \"Mtu\"), function(indivMtuID) {\n\n _.each(hourly_readings, function(indivRecord) {\n\n var mtu_record = _.where(indivRecord.Mtus, {\"Mtu\": indivMtuID})[0];\n\n total_cost += mtu_record.Cost;\n total_power += mtu_record.Power;\n\n max_power = _.max([max_power, mtu_record.Power]);\n min_power = _.min([max_power, mtu_record.Power]);\n });\n\n\n var data = {\n 'list': [{\n 'Name': 'HourlyCost',\n 'Value': total_cost,\n }, {\n 'Name': 'RecoDateandTime',\n 'Value': recordedDate,\n }, {\n 'Name': 'Power',\n 'Value': total_power,\n }, {\n 'Name': 'SensorID',\n 'Value': indivMtuID,\n //}, {\n //'Name': 'LimitExceeded',\n //'Value': limitExceeded,//''\n }, {\n 'Name': 'MMeasurementkWh',\n 'Value': max_power,\n }, {\n 'Name': 'MinMeasuremtkWh',\n 'Value': min_power,\n }]\n };\n\n //Post Monitor Record!!!;\n IlxServer.postrecord(data, function(response_data) {\n console.log('POST Response: ', JSON.stringify(response_data));\n });\n });\n\n callback();\n}", "title": "" }, { "docid": "81c93dfa2c17a7e88c3818c6cf011744", "score": "0.55803144", "text": "function sendToDatabase(req, res) \n{\n var contactByMail =false;\n var contactByPhone =false;\n var contactOnline =false;\n\n if (req.body.allOK != undefined) \n {\n contactByMail = true;\n contactByPhone = true;\n contactOnline = true;\n }\n else \n {\n if (req.body.phoneOK != undefined) \n {\n contactByPhone = true;\n }\n if (req.body.mailOK != undefined) \n {\n contactByMail = true;\n } \n if (req.body.emailOK != undefined) \n {\n contactOnline = true;\n }\n }\n /* Add parsed info to data set to be stored in database */\n workingDataSet =\n {\n suffix: req.body.suffix,\n first: req.body.first,\n last: req.body.last,\n street: req.body.street,\n city: req.body.city,\n state: req.body.state,\n zip: req.body.zip,\n email: req.body.email,\n phone: req.body.phone,\n contactByMail: contactByMail,\n contactByPhone: contactByPhone,\n contactByEmail: contactOnline\n };\n\n /* Geocoding is done server-side */\n /* Calculate latitude and longitude then add to database for specifif user */\n var latitude;\n var longitude;\n var location=req.body.street + ', '+req.body.city + ', '+req.body.state + ', '+ req.body.zip;\n \n geocoder.geocode(location, function (err, data) \n {\n if (data[0] != null) \n {\n workingDataSet.latitude = data[0].latitude;\n workingDataSet.longitude = data[0].longitude;\n if (requestedSources != 'update') \n {\n database.contacts().insert(workingDataSet, function (err, data) \n {\n if (data.result.ok) \n {\n if (requestedSources == 'mailer') \n {\n res.render('mailerTY',{contact: workingDataSet});\n }\n else \n {\n res.end(JSON.stringify(data.ops[0]));\n }\n }\n else \n {\n res.end(err);\n }\n });\n }\n else \n {\n database.contacts().updateMany({_id: ObjectID(req.body.id)}, {'$set': workingDataSet}, function (err, doc) \n {\n if (err) \n {\n res.end(err);\n }\n else \n {\n res.end(JSON.stringify(workingDataSet));\n }\n });\n }\n }\n else \n {\n console.log(\"Failed to geocode given location!\");\n }\n });\n}", "title": "" }, { "docid": "04142cc31e382e1497d3c7bdc21c25d2", "score": "0.557916", "text": "saveData() {\n this.oData = {\n name: this.oInputName.value,\n email: this.oInputEmail.value,\n phone: this.oInputPhone.value,\n movie: this.processSelect(this.oSelectMovie),\n source: this.processSelect(this.oSelectSource),\n message: this.oInputMessage.value\n }\n console.table(this.oData)\n }", "title": "" }, { "docid": "e0375ce63cfbbddb80f5a8304b29a442", "score": "0.55761236", "text": "function GNPSdata() {\n\t\t\t\t\t\t\treturn new Promise(res=>{\n\t\t\t\t\t\t\t\tlet dataFromDB = \"{}\"; // Data from DB\n\t\t\t\t\t\t\t\tres(dataFromDB);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}", "title": "" }, { "docid": "4c43fd3358db20c0993df32043f813c6", "score": "0.55609244", "text": "function POST_db(sql, data, req, res, next) {\n db.query(sql, data, (err, results) => {\n if (err) {\n console.error(err)\n res.statusCode = 500\n return res.json({ message: 'Game over, man! Game OVER! Couldn\\'t add resource.', errors: err })\n }\n\n req.results = results.rows\n next()\n })\n}", "title": "" }, { "docid": "f99773fcda4e839eb5caae96a8b40650", "score": "0.5554949", "text": "pushDatatoDb(){\n const user = new User(this.users[0]);\n \n this.rentals.forEach(rental =>{\n //creating a new instance of the Rental class and passing pushing the data into it\n const newRental = new Rental(rental);\n newRental.user = user;\n //now we need to push the user to the newRentals \n user.rentals.push(newRental);\n\n //this wi;; save the data ato database\n \n newRental.save();\n });\n console.log(user.username);\n user.save();\n\n }", "title": "" }, { "docid": "9929e010f8efe7e6c015c47941cbfbd6", "score": "0.55520725", "text": "function updateValues() {\n var data = document.querySelectorAll('.userData')\n for (i=0; i < data.length; i++) {\n var name = data[i].querySelector('.nameOfskill').innerHTML;\n var usage = data[i].querySelector('.form-control').value;\n var interest = data[i].querySelector('.custom-select').value;\n\n var transaction = db.transaction('studentData', 'readwrite');\n var studentdta = transaction.objectStore('studentData');\n var item = {\n name: name,\n usage: usage,\n interest: interest\n }\n studentdta.put(item);\n\n request.onerror = function(e) {\n console.log(\"Error\", e.target.error.name);\n }\n\n request.onsuccess = function(e) {\n console.log(\"It's in!\");\n }\n }\n document.getElementById('updateDB').innerHTML = 'SUCCESS! Keep Reflecting'\n }", "title": "" }, { "docid": "4fa90a55cf7e1814d16102254a2ac1e1", "score": "0.55495876", "text": "function bufferData(){\r\n console.log(\"inside bufferData() !!!!\");\r\n \r\n var db = window.openDatabase(\"Database\", \"1.0\", \"Pin Point\", 200000);\r\n db.transaction(tempPopulate, tempError, tempSuccess);\r\n}", "title": "" }, { "docid": "a0e926b0633bf0060ecdbdfe1faf091e", "score": "0.554605", "text": "async function pushDataFromBackendToIndexedDb() {\n const objectStore = indexedDbInstance.transaction(\"temperatures\", \"readwrite\").objectStore(\"temperatures\");\n objectStore.clear().onsuccess = () => {\n alert(\"Brak internetu - możesz korzystać ze strony w trybie offline.\");\n };\n}", "title": "" }, { "docid": "0dcba0f51a22c1d107c0333289a24c8e", "score": "0.5541805", "text": "function writeData () {\n data = input.value();\n var html = report.html();\n html = \"<li><strong>TX:-->&nbsp;</strong>\" + data + html;\n report.html(html);\n socket.emit('message', data);\n \n}", "title": "" }, { "docid": "6b174ef24e869aaddf449d36e95b0297", "score": "0.5541205", "text": "writeDB() {\n fs.writeFileSync(this.dir, JSON.stringify(this.data))\n }", "title": "" }, { "docid": "dcd4efb9cc904681a5d96d0de43f845e", "score": "0.5534841", "text": "function handleSaveToDB(agent) {\r\n const text=agent.parameters.text;\r\n const name=agent.parameters.name;\r\n agent.add('The Value added sucessfully: '+text);\r\n agent.add('The updated name: '+name);\r\n return admin.database().ref('data').set({\r\n text:text\r\n });\r\n }", "title": "" }, { "docid": "0a8047cf8ba3edebfd1ac3137ce71a8b", "score": "0.55345815", "text": "function writeToDB(req, res, next){\r\n\tlet newNum = Math.floor(Math.random()*100);\r\n\t\r\n\tdb.collection(\"data\").insertOne({num: newNum}, function(err, result){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"Error saving to database.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tres.status(200).send(\"Added new number: \" + newNum);\r\n\t});\r\n}", "title": "" }, { "docid": "900e9f6b5b3c748ca797e6e5307683c0", "score": "0.5526668", "text": "function syncAllData(){\n appdata = []\n var dataset = db.get('data').value() // Find all users in the collection\n if(dataset !== undefined){\n console.log(\"sync...\")\n dataset.forEach(function(data) {\n appdata.push(({\"word\":data.word,\"lang\":data.lang,\"translation\":data.translation,\"action\":data.action,\"id\":data.id,\"user\":data.user})); // adds their info to the dbUsers value\n });\n return appdata\n }\n else{\n console.log(\"no data\")\n return appdata\n }\n}", "title": "" }, { "docid": "80dce0ec66fa2b8a72a05a9eed565a70", "score": "0.55261827", "text": "sync_to_server(data) {}", "title": "" }, { "docid": "082d2662d7ad36a6924b0fcea51422ec", "score": "0.5525349", "text": "function _upload_data() {\n\t\t\ttry {\n\t\t\t\tif ((Ti.Network.online) && (!Ti.App.Properties.getBool('lock_table_flag'))) {\n\t\t\t\t\t// send gps and download last updated\n\t\t\t\t\t// info\n\t\t\t\t\tif (Ti.App.Properties.getString('current_login_user_id') > 0) {\n\t\t\t\t\t\tself.download_latest_log();\n\t\t\t\t\t\tself.refresh_last_updated_time_label();\n\t\t\t\t\t\tself.refresh_badge_info();\n\t\t\t\t\t\t//self.local_notification_if_upload_media_file_failed();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tself.run_in_background_for_sync_upload();\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _upload_data');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9d25fecd90dbc0f700b3e9a16fc6e4f7", "score": "0.552099", "text": "function addDataToLevelDB(value) {\n let i = 0;\n db.createReadStream().on('data', function(data) {\n i++;\n }).on('error', function(err) {\n return console.log('Unable to read data stream!', err)\n }).on('close', function() {\n console.log('Block #' + i);\n addLevelDBData(i, value);\n });\n}", "title": "" }, { "docid": "b191f9105198c220e875bfe47a431b43", "score": "0.5509659", "text": "function addNewsToDb() {\n\n getAgencyFeed().then(function(agencyFeed){\n\n agencyFeed.forEach(item => {\n\n rssFeedsObjects(item.feed_url).then(function(feed){\n\n var rssFeedNews = feed.items;\n\n rssFeedNews.forEach(element => {\n var pubDate = moment(rssFeedNews.pubDate).tz('Asia/Kolkata').format(\"YYYY-MM-DD HH:mm:ss\");\n \n let pic_src = \"\";\n if(item.feed_url==\"https://www.indiatoday.in/rss/1206584\" || item.feed_url==\"https://www.indiatoday.in/rss/1206614\"){\n let src = element.content.split('src');\n let imgPath = src[1].split(\"=\");\n let position = imgPath[1].indexOf(\">\");\n pic_src = imgPath[1].substring(1,position-1);\n \n console.log(element);\n }\n \n var postData = {\n \"title\": element.title,\n \"description\": element.description,\n \"guid\": element.guid,\n \"link\": element.link,\n \"news_published_date\": pubDate,\n \"agency_feed_id\": item.agency_feed_id,\n \"agency_id\": item.agency_id,\n \"category_id\": item.category_id,\n \"pic_src\": pic_src\n }\n \n con.query('INSERT INTO rss_news.agency_news SET ?', postData, function (error, results, fields) {\n if (error) {\n //throw error;\n logger.error(\"---------- Printing the failed query ---------------\");\n logger.error('this.sql', this.sql + '\\n'+ '\\n');\n }\n });\n }); \n });\n });\n })\n .catch(error => logger.error(error));\n}", "title": "" }, { "docid": "f595beff0d060fb2b50a214c9ef0596e", "score": "0.550898", "text": "addDataToLevelDB(value) {\n let i = 0;\n db.createReadStream().on('data', function (data) {\n i++;\n }).on('error', function (err) {\n return console.log('Unable to read data stream!', err)\n }).on('close', function () {\n console.log('Block #' + i);\n new Blockchain().addLevelDBData(i, JSON.stringify(value));\n });\n }", "title": "" }, { "docid": "2889d19fdaee0fe7511f5cee1c24379b", "score": "0.55083174", "text": "function writeToDatabase(dataObject) {\n database.ref().push(dataObject);\n}", "title": "" }, { "docid": "badc446c55343b2feb45bbcded91e093", "score": "0.55061394", "text": "function everythingInStore() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw err;\n //======================no error go to the next step ===\n // console.log(res)\n res.forEach(function(res) {\n // console.log(res);\n console.log(\"Item Id :\" + res.item_id + \" , name : \" + res.product_name + \" , Dept : \" + res.department_name + \", Price\" + res.price + \"\\n\");\n console.log(\"-----------------------------------------------------------------------------------\");\n });\n selectProductId();\n\n });\n}", "title": "" }, { "docid": "34db8ceccac1de3bc3fdcbc32792827c", "score": "0.5497071", "text": "function updateDB(){\n var name = $(\"#name\").val();\n var message = $(\"#message\").val();\n console.log(name + \" : \" + message);\n\n //Update database here\n var data = {\n \t\"NAME\" : name,\n \t\"MESSAGE\" : message\n }\n database.push(data);\n\n}", "title": "" }, { "docid": "6caed175f4ed0447338e21380d957ca1", "score": "0.54923767", "text": "function addDetailsToDatabase(){\n \n}", "title": "" }, { "docid": "18a7c688f9ad7e6b2e01d678e6ae39e6", "score": "0.5482682", "text": "function pushFBEntireDBValue() {\n database.ref(\"/messages\").once(\"value\", function (snapShot) {\n if (snapShot.val()) {\n var dbSnapShot = Object.entries(snapShot.val())\n dbSnapShot.forEach((snapShotEntry) => {\n var entry = {\n userMessage: snapShotEntry[1].message,\n userPhotoURL: snapShotEntry[1].userPhotoLink,\n userName: snapShotEntry[1].userName,\n timeCreated: snapShotEntry[1].time,\n email: snapShotEntry[1].email,\n key: snapShotEntry[0]\n\n }\n dbDataDomFormatting(entry)\n })\n }\n })\n}", "title": "" }, { "docid": "281a8764003167fb84880d3ac0e0df26", "score": "0.54814154", "text": "function addData(e) {\n // prevent browser to refresh\n e.preventDefault();\n\n let newItem = { note: note.value };\n\n // create a transaction to write to db\n let transaction = db.transaction([\"notes\"], \"readwrite\");\n let objectStore = transaction.objectStore(\"notes\");\n let request = objectStore.add(newItem);\n\n request.onsuccess = () => {\n note.value = \"\";\n };\n\n transaction.oncomplete = () => {\n console.log(\"Transaction completed on the database\");\n displayData();\n };\n\n transaction.onerror = () => {\n console.log(\"Transaction not completed, error!!!\");\n };\n }", "title": "" }, { "docid": "d920a3422837df2af28aca3bccccac42", "score": "0.54794574", "text": "store({ table,post },respond) {\n\t\tlet handler = new ORM({ table })\n\n\t\tasync function run() {\n\t\t\tlet packet = {\n\t\t\t\ttable,\n\t\t\t\tpost\n\t\t\t}\n\n\t\t\tlet res = {}\n\n\t\t\tres[table] = await handler.store(packet).catch(err => { throw new Error(err) })\n\n\t\t\treturn res\n\t\t}\n\n\t\trun().then(res => respond(null,res)).catch(err => respond(err))\n\t}", "title": "" }, { "docid": "f514130301a7fd6248df983f83891355", "score": "0.5479146", "text": "function addData(data) {\n console.log(\"Adding data\");\n PADI_PGI.insert(data);\n}", "title": "" }, { "docid": "3d7aa86d7fceb1509a904595db0c6345", "score": "0.54771066", "text": "async function fetchAndStoreMBTAData()\n{\n // Get MBTA Data as an array of objects using function getMBTAData()\n var buses = await getMBTAData();\n \n // Add each bus to db.json using function writeBus()\n buses.forEach(writeBus);\n\n // Log time on console\n console.log(new Date());\n}", "title": "" }, { "docid": "982425d9e25b3c2d93a42dd851629417", "score": "0.54743177", "text": "function sendTicketInfoToDB() {\n emptyStates(); \n }", "title": "" }, { "docid": "0c5bdff2be08177021b79bb523fd11cf", "score": "0.5466136", "text": "async function saveToDb(parsedData) {\n for (let i = 0; i <= parsedData.length - 1; i++) {\n for (let j = 0; j <= parsedData[i].length - 1; j++) {\n try {\n let currentDate = new Date();\n let date = parsedData[i][j].date\n ? parsedData[i][j].date\n : currentDate.toISOString();\n let utcDate = dateStandardiser.utcDate(date, parsedData[i][j].siteID);\n\n const articleData = new Archive({\n link: parsedData[i][j].link,\n headline: parsedData[i][j].headline,\n summary: parsedData[i][j].summary,\n imgURL: parsedData[i][j].imgURL,\n date: date,\n siteID: parsedData[i][j].siteID,\n utcDate: utcDate,\n });\n \n const savedArticleData = await articleData.save();\n newlyAddedArticles.push(savedArticleData);\n } catch (error) {\n if (error && error.code !== 11000) {\n console.log(chalk.bold.magenta(error));\n }\n }\n }\n }\n emailNewArticles(newlyAddedArticles);\n}", "title": "" }, { "docid": "f65179c2037653cdd27a940b267772b1", "score": "0.54648817", "text": "save(data) {\n this.db.save(data);\n }", "title": "" }, { "docid": "e4c8883411e9f787e255e50b9cceae6c", "score": "0.5463586", "text": "function saveToDB(id, type, number) {\n backend.method = \"POST\";\n backend.path = \"/update_db?id=\"+id+\"&type=\"+type;\n backend.headers = {'Content-Type': 'application/json'};\n\n http.request(backend, function(res) {\n }).end();\n}", "title": "" }, { "docid": "1748d01bc7ac8d61775b7600843b76c4", "score": "0.546169", "text": "insertStoredContent() {\n this.fetch();\n }", "title": "" }, { "docid": "46e6f03f40b18ef3f0201c523b068489", "score": "0.54593235", "text": "function registerDB(data) {\n console.log('the data to go into the database is: ' + data);\n}", "title": "" }, { "docid": "c299cfde5efb26b1ab184bc60aa06d2b", "score": "0.5456865", "text": "addLevelDBData(key, value) {\n db.put(key, value, function (err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n })\n }", "title": "" }, { "docid": "d65c031d69ba6d21ef4617e1dad1d0a7", "score": "0.54547316", "text": "function storedata(){\n console.log(data);\n questions[i].ans = data;\n i++;\n setTimeout(sendresponse,2000);\n }", "title": "" }, { "docid": "21488f828ea03400fc3813cf9adc9ae2", "score": "0.54523814", "text": "function uploadPizza() {\n // open a transaction on your db to read data\n const transaction = db.transaction([\"new_pizza\"], \"readwrite\");\n\n // access your object store\n const pizzaObjectStore = transaction.objectStore(\"new_pizza\");\n\n // get all records from store and set to a variable\n const getAll = pizzaObjectStore.getAll();\n\n getAll.onsuccess = function() {\n // if there was data in teh idb's store, send it to the api server\n if (getAll.result.length > 0) {\n fetch(\"/api/pizzas\", {\n method: \"POST\",\n body: JSON.stringify(getAll.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\"\n }\n })\n .then(response => response.json())\n .then(serverResponse => {\n if (serverResponse.message) {\n throw new Error(serverResponse);\n }\n // open one more transaction\n const transaction = db.transaction([\"new_pizza\"], \"readwrite\");\n // access the new_pizza object store\n const pizzaObjectStore = transaction.objectStore(\"new_pizza\");\n //clear all items in your store\n pizzaObjectStore.clear();\n\n alert(\"All saved pizza has been submitted!\");\n }) \n .catch(err => {\n console.log(err)\n });\n }\n };\n}", "title": "" }, { "docid": "c667645e7abb491ed4dd88da3e52f948", "score": "0.54428875", "text": "function sendExerciseDataToDB(exerciseData)\n{\n message = new Paho.MQTT.Message(exerciseData);\n message.destinationName = \"cs3237/store\"\n mqtt.send(message)\n}", "title": "" }, { "docid": "a077ff06ad74c3420e071efc042a224b", "score": "0.5440277", "text": "static storeAllInIDB(data) {\n return DBHelper.openIDB().then(function(db) {\n if(!db) return;\n\n var tx = db.transaction(dbOBJECTSTORE, 'readwrite');\n var store = tx.objectStore(dbOBJECTSTORE);\n data.forEach(function(restaurant) {\n store.put(restaurant);\n });\n return tx.complete;\n });\n }", "title": "" }, { "docid": "ea52468338f78f643c33a0485f832883", "score": "0.5437208", "text": "function store(Temperatur) {\n // Her tjekker vi om temperaturen kommer igennem\n console.log('store ' + Temperatur);\n // Her sender vi vores temperatur ind på vores hjemmeside\n io.emit('data', \"Temperature \" + Temperatur + \" C\");\n //Her definere vi vores sql insert - for og sende data til db\n const sql = \"INSERT INTO measurements (Temperatur) VALUES (?)\";\n // Her sender vi vores temperatur ind i vores db table\n dbCon.query(sql, Temperatur, function (err, result) {\n // Hvis den ikke kan sende temperaturen ind i db så kaster den en fejl\n if (err) throw err;\n // Her fortæller terminalen os at temperaturen blev sendt ind i Db\n console.log(\"Temperature inserted \" + Temperatur);\n // dbCon.query(\"SELECT * FROM measurements\", function (err, result, fields) {\n // if (err) throw err;\n // console.log(result);\n // });\n });\n}", "title": "" }, { "docid": "cb7eecaece1ed39e787e0f350624590f", "score": "0.5432443", "text": "MergeDB(peer_db={}) {\n // - Loop for received data\n for (let _msg in peer_db) {\n this.AddMessage(peer_db[_msg]);\n }\n\n this._save()\n }", "title": "" }, { "docid": "b16b6234035360b47a24a68c329f3176", "score": "0.54317194", "text": "async save () {\n const tableName = this.getResourceName()\n console.log(this.getPrimaryKeyName())\n const { [this.getPrimaryKeyName()]: _, ...data } = this.data\n const columns = Object.keys(data)\n const values = Object.values(data)\n let statement = prepareInsertStmt(tableName, columns, values)\n return db._execute(statement, values)\n }", "title": "" }, { "docid": "66ebaa387e5f503db9661899385821c0", "score": "0.54309505", "text": "onDb1Save(e) {\n e.preventDefault();\n const sendingData = this.state.data;\n axios\n .post('/database1', sendingData)\n .then(res => {\n this.setState({ open: true, message: 'Saved to Database 1' });\n })\n .catch(err =>\n this.setState({ open: true, message: 'There was an error' })\n );\n }", "title": "" }, { "docid": "fccd9e79cda317fad24d8a99936a212f", "score": "0.54283905", "text": "manipulateDatabase() {\n console.log(new Date() + ' Manipulating database.');\n\n for (let i = 0; i < this.data.records.length; i++) {\n const item = this.data.records[i];\n\n this.client.query('SELECT pointer FROM manuscripts WHERE pointer = $1::character(5)', [item.pointer.toString()], (error, result) => {\n if (error) {\n this.logger(item.pointer, 'Incoming error.');\n\n throw error;\n }\n\n if (result.rows.length) {\n this.updateRow(item);\n } else {\n this.insertRow(item);\n }\n\n if (i + 1 === this.data.records.length) {\n // Initialize a two second timeout to assure any future queries\n // are completed. There might be a better way to do this.\n setTimeout(() => {\n this.closeDatabaseConnection();\n }, 2000);\n }\n });\n }\n }", "title": "" } ]
511c82a614804c2092954270c721ea53
answer = prompt('Are you sure you want to sell your wooden sword?', 'Yes, No').toUpperCase()
[ { "docid": "58c247ca15bf77966905b02abe4c9647", "score": "0.0", "text": "function determineAnswer2() {\n switch (answer) {\n case 'Yes':\n totalGold += .9 * wsCost\n woodenSword = 0\n kixleyNCo[1].attackPow /= (1 + (0.05 * (3 - diffSetting)))\n alert('Wooden sword sold!')\n InShop()\n break;\n case 'No':\n Sell()\n break;\n }\n }", "title": "" } ]
[ { "docid": "ba067557df4732dfde15117c57d1db1c", "score": "0.8200297", "text": "function food(){\n var tacos = prompt('Do you know what is great on Tuesdays?');\n if(tacos.toLowerCase() === 'yes'){\n alert('Oh yes, Tacos!');\n } else if(tacos.toLowerCase() === 'no'){\n alert('That is unacceptable');\n }\n}", "title": "" }, { "docid": "254330a90805a271e5fed3b1d16c0c58", "score": "0.8052618", "text": "function tequila(){\n var drinkedTequila = prompt('Have you ever try: Tequila?');\n if(drinkedTequila.toLowerCase() === 'yes'){\n alert('I hope it was just a taste hehe.');\n } else if(drinkedTequila.toLowerCase() === 'no'){\n alert('You should give it a try.');\n }\n}", "title": "" }, { "docid": "ff0ccff3641396479824bb5075a0b120", "score": "0.7905398", "text": "function questionTwo() {\n\n var questionTwo = prompt(\"Is it my goal in life to be successful?\");\n\n var answerTwo = questionTwo.toLowerCase().trim();\n\n console.log(answerTwo);\n\n if(answerTwo === \"yes\" || answerTwo === \"y\")\n {\n alert(\"You failed. While it would be nice to be successful in life, my only goal in life is to make a positive impact on people with everything I do.\");\n } else if(answerTwo === \"no\" || answerTwo === 'n')\n {\n alert(\"Winner! I know success will come, but I also know that I'd gain more from having a positive impact on people around me with the things I do. That's my goal in life.\")\n } else {\n alert(\"Yes or No answers please.\");\n }\n}", "title": "" }, { "docid": "1ea7e6abdcb210daddbf558d249ace45", "score": "0.78665125", "text": "function myLoveForTequila(){\r\n var x = prompt('Do i love tequila?').toUpperCase();\r\n if(x === 'Y'|| x === 'YES'){\r\n alert('Of course who doesn\\'t love tequila');\r\n correctAnswerCount++;\r\n }\r\n else if(x === 'N'|| x === 'NO'){\r\n alert('Sorry to tell you but I do.');\r\n }\r\n else{ alert('Sorry but you didnt follow my instructions please only answer with\\\r\n Y and N.');\r\n }\r\n console.log('myLoveForTequila:', x);\r\n}", "title": "" }, { "docid": "e9de2be74890cacdf7e20b59a83f6324", "score": "0.78515595", "text": "function ansPotatoes() {\n const favFoodPotatoes = prompt(username + ' would you believe me if I told you potatoes were my favorite food?');\n console.log('Question: Are potatoes my favorite food? User answered: ' + favFoodPotatoes);\n if (favFoodPotatoes.toLowerCase() === 'yes' || favFoodPotatoes.toLowerCase() === 'y'){\n alert('Correct! Potatoes are so versatile.');\n score++;\n } else {\n alert('Wrong. Potatoes are the best food ever!');\n }\n}", "title": "" }, { "docid": "8b36b44121be4d751d6c850e2d68adac", "score": "0.7833386", "text": "function Boat(){\r\n var funky = prompt(\"Funky town\")\r\n var funky2 = prompt(\"what is your name\")\r\n if(funky2 === funky2.toUpperCase()){\r\n alert(\"you are on the all caps epress\")\r\n }\r\n\r\n else if(funky2 === funky2.toLocaleLowerCase()){\r\n alert(\"all lowercase, the maddness\")\r\n }\r\n\r\n else{\r\n alert(\"This is how you do it\" + funky2.toLocaleUpperCase())\r\n document.write(\"test\");\r\n };\r\n}", "title": "" }, { "docid": "2a025409bf21993671320214a3a2f219", "score": "0.7822023", "text": "function askUpperFunk(){\n var askUpper = prompt(\"Would you like to include uppercase letters in the password? Please enter Yes or No.\")\n askUpper2 = askUpper.toLocaleLowerCase()\n if(askUpper2 != \"yes\" && askUpper2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askUpperFunk()\n }\n }", "title": "" }, { "docid": "a761edd9092698628d248e4b46a150c1", "score": "0.7820344", "text": "function askUpperCase(){\n let input = confirm(\"Would you like to include upper case letters?\");\n hasUpperCase = input;\n return input;\n}", "title": "" }, { "docid": "42687e2b6c5c07d4afa6ebd38138e279", "score": "0.77794296", "text": "function askUpper() {\n var haveUpper = prompt(\"Do you want to include uppercase characters? Enter yes or no.\");\n if (haveUpper === \"yes\") {\n options.push(\"upper\");\n alert(\"Ok, your password will include uppercase characters.\");\n }else if (haveUpper === \"no\") {\n alert(\"Ok, your password will not include uppercase characters.\");\n } else {\n alert(\"Please type \\\"yes\\\" or \\\"no\\\"\");\n askUpper();\n }\n }", "title": "" }, { "docid": "cb722f9234f18bf0012ed86486877efe", "score": "0.7779178", "text": "function myLoveForTequila() {\r\n var usersAnswers = prompt('Do i love tequila?').toUpperCase();\r\n if (usersAnswers === 'Y' || usersAnswers === 'YES') {\r\n alert(\"Of course who doesn't love tequila\");\r\n correctAnswers++;\r\n }\r\n else if (usersAnswers === 'N' || usersAnswers === 'NO') {\r\n alert('Sorry to tell you but I do.');\r\n }\r\n else {\r\n alert('Sorry but you didnt follow my instructions please only answer with\\\r\n Y and N.');\r\n }\r\n console.log('myLoveForTequila:', usersAnswers);\r\n}", "title": "" }, { "docid": "a48063fedd4a27823796a8eb8d63f278", "score": "0.77073956", "text": "function yesNo1() {\n var responseOne = prompt('Was I born in Seattle?').toLowerCase();\n if (responseOne === 'y' || responseOne === 'yes') {\n alert('Yes, that is correct!');\n correctAnswers++;\n } else {\n (responseOne === 'n' || responseOne === 'no');\n alert('Sorry, that is incorrect. I was born in North Seattle');\n console.log('responseOne', responseOne);\n }\n}", "title": "" }, { "docid": "4f34851809757d0cfd1368010c66bb33", "score": "0.76885957", "text": "function myEducation() {\r\n var x = prompt('Did i go to college?').toUpperCase();\r\n if(x === 'Y' || x === 'YES'){\r\n alert('Correct but i dropped out.');\r\n correctAnswerCount++;\r\n }\r\n else if(x === 'N' || x === 'NO'){\r\n alert('Incorrect I did but i dropped out.');\r\n }\r\n else alert('Sorry but you didnt follow my instructions please only answer with\\\r\n Y and N.');\r\n console.log('Did i go to college?', x);\r\n\r\n}", "title": "" }, { "docid": "ba7fbc11de77603d41810c4cae73d8a6", "score": "0.7676872", "text": "function yesNo3() {\n var responseThree = prompt('Did I study abroad in Paris?').toLowerCase();\n if (responseThree === 'n' || responseThree === 'no') {\n alert('Congrats, ' + userName + '! You know me very well.');\n correctAnswers++;\n } else {\n (responseThree === 'y' || responseThree === 'yes');\n alert('Sorry, wrong answer. My first study abroad trip was to Buenos Aires, Argentina.');\n }\n console.log('responseThree', responseThree);\n\n}", "title": "" }, { "docid": "c7bcefb7d3aa2c3dfe5c866b7b0d35d2", "score": "0.76637954", "text": "function questionThree() {\n var answerThree = prompt('Is Bronwyn a huge fan of Firefly/Serenity?');\n var responseThree = document.getElementById('responseThree');\n\n if (answerThree.toLowerCase() === 'yes' || answerThree.toLowerCase() === 'y') {\n responseThree.textContent = 'So you noticed the t-shirts! Yes, she is a Browncoat!';\n score++;\n } else {\n responseThree.textContent = 'Sorry, you got that one wrong. She\\'s a huge fan of Firefly and Serenity.';\n };\n}", "title": "" }, { "docid": "6769f4200b847bd9ceffe057de49dde2", "score": "0.76514655", "text": "function yesNoQ(greetingQuestion, answerCorrect, answerWrong, answerA, answerB) {\n var ans = prompt(greetingQuestion);\n if (ans.toLowerCase() === answerA || ans.toLowerCase() === answerB) {\n console.log(answerCorrect);\n var ansA = alert(answerCorrect);\n score += 1;\n } else {\n console.log(answerWrong);\n var ansA = alert(answerWrong);\n }\n}", "title": "" }, { "docid": "25db8f33752850d25d001b63cfef6a7b", "score": "0.7651399", "text": "function yesNo2() {\n var responseTwo = prompt('Did I study Communication at the University of Washington?').toLowerCase();\n if (responseTwo === 'y' || responseTwo === 'yes') {\n alert('Congrats, you are right.');\n correctAnswers++;\n } else {\n (responseTwo === 'n' || responseTwo === 'no');\n alert('Sorry, wrong answer. I studied Communication and Diversity at the University of Washington.');\n }\n console.log('responseTwo', responseTwo);\n}", "title": "" }, { "docid": "f33fc71e63a73c79a6f5612c6138d480", "score": "0.7651232", "text": "function ansPizza() {\n const likesPizza = prompt(username + ' do I like pizza?'); // Likes pizza?\n console.log('Question: likes pizza? User answered: ' + likesPizza);\n if(likesPizza.toLowerCase() === 'yes' || likesPizza.toLowerCase() === 'y'){\n alert('Correct! I do like pizza.');\n score++;\n } else{\n alert('Wrong... who doesn\\'t like pizza..?');\n }\n}", "title": "" }, { "docid": "4939226bc83f30439cde02dcdd7b40db", "score": "0.76209545", "text": "function guac(){\n var avocados = prompt('Do you like Avocados?');\n if(avocados.toLowerCase()=== 'yes'){\n alert('Good, where I am from produces most of it.');\n } else if(avocados.toLowerCase() === 'no'){\n alert('No guacamole for you my friend.');\n }\n}", "title": "" }, { "docid": "6a6cb987634f468b2ee8e57bab4115a3", "score": "0.7606319", "text": "function questionOne () {\r\n var answerOne = prompt('Have I ever been scuba diving?').toLowerCase();\r\n console.log(userName + '\\'s answer to the first question:', answerOne);\r\n if (answerOne === 'n' || answerOne === 'no') {\r\n alert('By jove you\\'ve got it!');\r\n correctAnswers++;\r\n } else {\r\n alert('Wrong...');\r\n }\r\n}", "title": "" }, { "docid": "37625dec40c9d79ff97ffdab9bbca133", "score": "0.75993884", "text": "function tq1() {\nlet Q1 = prompt(\"Do you smoke?\");\nif (Q1.toLowerCase() == 'yes' || Q1.toLowerCase() == 'y') {\n alert(\"wish you would stop smoking\");\n console.log(\"Q1,yes ans\");\n count++;\n\n} else if (Q1.toLowerCase() == 'no' || Q1.toLowerCase() == 'n') {\n alert(\"GOOD for you\");\n console.log(\"Q1,no ans\");\n\n}\n}", "title": "" }, { "docid": "0b868319e66c2c61e355edfc8d7d4a63", "score": "0.7598094", "text": "function questionTwo() {\n var answerTwo = prompt('Does Bronwyn have a daughter?');\n var responseTwo = document.getElementById('responseTwo');\n\n if (answerTwo.toLowerCase() === 'yes' || answerTwo.toLowerCase() === 'y') {\n responseTwo.textContent = 'You are correct! She does have a daughter.';\n score++;\n } else {\n responseTwo.textContent = 'You haven\\'t been paying attention! She does have a daughter.';\n };\n}", "title": "" }, { "docid": "378d5edd8a04a1e978fa8a42e96d7b13", "score": "0.75768745", "text": "function userChoice() {\n confirmLowerCase = confirm(\"Do you want Lower case letters?\");\n confirmUpperCase = confirm(\"Do you want Upper case letters?\");\n confirmNumeric = confirm(\"Do you want numbers?\");\n confirmSpecial = confirm(\"Do you want special characters?\");\n}", "title": "" }, { "docid": "fdc8a7d0eec866810038b97cabfd6150", "score": "0.7563469", "text": "function uppercaseprompt() {\n var prompt3 = prompt(\"Would you like to include uppercase characters in your password?\", \"\");\n var upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n if (prompt3 == null) { // If they click cancel\n alert(\"Cancelled\");\n }\n else if (prompt3 == \"yes\" || prompt3 == \"Yes\") {\n traits.uc = 1; // true\n passwordpool += upper; // includes the uppercase characters in those that will generate the password\n numericprompt();\n }\n else if (prompt3 == \"no\" || prompt3 == \"No\") {\n traits.uc = 0; // false\n numericprompt();\n }\n else {\n alert(\"Please enter yes or no\");\n uppercaseprompt();\n }\n}", "title": "" }, { "docid": "ed2fe91797dff84f8e0392a8d2c928e2", "score": "0.7547801", "text": "function questionOne() {\n var answerOne = prompt('Does Bronwyn ride a motorcycle?');\n var responseOne = document.getElementById('responseOne');\n\n if (answerOne.toLowerCase() === 'yes' || answerOne.toLowerCase() === 'y') {\n responseOne.textContent = 'That\\'s right! Bronwyn does ride a motorcycle!';\n score++;\n } else {\n responseOne.textContent = 'You must not have noticed the boots she\\'s wearing today! She does ride a motorcycle!';\n };\n}", "title": "" }, { "docid": "cb771ae1f68a047cd0c227d3e7cef0f6", "score": "0.754044", "text": "function forthQ(){\n\n var answer4 = prompt('is red my favorit color?').toLowerCase();\n if (answer4 === 'y' || answer4 === 'yes') {\n //console.log('your answer is wrong');\n alert('your answer is wrong');\n }\n else if (answer4 === 'no' || answer4 === 'n') {\n //console.log('your answer is true');\n alert('your answer is true');\n }\n else {\n //console.log('you should answer yes/y or no/n,please.');\n alert('your should answer yes/y or no /n, please.');\n }\n}", "title": "" }, { "docid": "125f9b0a9bf094bf58e7ceec040d0b53", "score": "0.7521133", "text": "function myEducation() {\r\n var UserAnswers = prompt('Did i go to college?').toUpperCase();\r\n if (UserAnswers === 'Y' || UserAnswers === 'YES') {\r\n alert('Correct but i dropped out.');\r\n correctAnswers++;\r\n }\r\n else if (UserAnswers === 'N' || UserAnswers === 'NO') {\r\n alert('Incorrect I did but i dropped out.');\r\n }\r\n else {\r\n alert('Sorry but you didnt follow my instructions please only answer with\\\r\n Y and N.');\r\n }\r\n console.log('myEducation:', UserAnswers)\r\n}", "title": "" }, { "docid": "1829611ca06afc9e48d76ed6b6037ded", "score": "0.74960935", "text": "function firstQuestion() {\r\n var question1 = prompt('Did I learn to be a pro musician in New Orleans, yes or no?');\r\n question1 = question1.toLowerCase();\r\n if (question1 === 'yes' || question1 === 'y') {\r\n //console.log('Correct, ' + userName);\r\n alert('Correct, ' + userName);\r\n correctAnswers++;\r\n } else {\r\n //console.log(userName + ', that is incorrect.')\r\n alert(userName + ', that is incorrect.' + correctAnswers);\r\n }\r\n\r\n}", "title": "" }, { "docid": "d3803d97e088e4dd246c5218d782e476", "score": "0.74933887", "text": "function from(){\n var canYouGuess = prompt('Hola ' + userName + ' do you wanna guess where I am from?');\n if(canYouGuess.toLowerCase() === 'yes'){\n alert('great, I will help you with easie questions.');\n } else if(canYouGuess.toLowerCase() === 'no'){\n alert('Too bad, you have to do it');}\n prompt('Please answer with a yes or a no');\n}", "title": "" }, { "docid": "a5187715559a2f152e66f3412002f493", "score": "0.7477812", "text": "function ansGuardians() {\n const likesGuardians = prompt(username + ' did I enjoy watching Guardians of the Galaxy?'); // Likes Guardians of the Galaxy?\n console.log('Question: Liked Guardians of the Galaxy? User answered: ' + likesGuardians);\n if(likesGuardians.toLowerCase() === 'yes' || likesGuardians.toLowerCase() === 'y'){\n alert('Correct! That movie was awesome.');\n score++;\n }else{\n alert('Wrong. How could you NOT like that movie?');\n }\n}", "title": "" }, { "docid": "7d9f14c544c88a1b3e06643ee9d69ddd", "score": "0.74712324", "text": "function secondQ(){\n\n var answer2 = prompt('is pharmacist was my first job?').toLowerCase();\n if (answer2 === 'y' || answer2 === 'yes') {\n //console.log('your answer is wrong');\n alert('your answer is wrong');\n }\n else if (answer2 === 'no' || answer2 === 'n') {\n //console.log('your answer is true');\n alert('your answer is true');\n }\n \n else {\n //console.log('you should answer yes/y or no/n, please.');\n alert('you sholud answer yes/y or no/n, please.');\n }\n}", "title": "" }, { "docid": "c739d5dba716721adb97f8dbb38e4e44", "score": "0.7448737", "text": "function yesNo5() {\n var responseFive = prompt('Do I aspire to be a full-stack developer?').toLowerCase();\n if (responseFive === 'y' || responseFive === 'yes') {\n alert('Yes, that is correct.');\n correctAnswers++;\n } else {\n (responseFive === 'n' || responseFive === 'no');\n alert('Sorry, that is incorrect. I would love to become a full-stack developer');\n }\n\n}", "title": "" }, { "docid": "04bfb16d5b65501a017a1f3656232f22", "score": "0.7441529", "text": "function questionFour() {\n var answerFour = prompt('Does Bronwyn own the best coffeehouse in Seattle?');\n var responseFour = document.getElementById('responseFour');\n\n if (answerFour.toLowerCase() === 'yes' || answerFour.toLowerCase() === 'y') {\n responseFour.textContent = 'Ah! So you\\'ve been there! Glad you liked it!';\n score++;\n } else {\n responseFour.textContent = 'Clearly you haven\\'t had a chance to visit yet.';\n };\n}", "title": "" }, { "docid": "5d3ee9c32b65483a473a83e7c6a5a377", "score": "0.7436493", "text": "function ques5() {\n var myAnswer5 = 'NO';\n var answer5 = prompt('Do you think Im NOT a good cooker ?');\n //check if the answer matching \n if (answer5.toUpperCase() === 'NO' || answer1.toUpperCase() === 'N') {\n alert('Correct.. ' + 'I do love cooking !');\n console.log('Correct answer');\n score++;\n } else {\n alert('Wrong answer ..');\n }\n}", "title": "" }, { "docid": "d6b91f2251a7fcf28fe557e399ceecb9", "score": "0.74261916", "text": "function upperCasePrompt() {\n return window.confirm(\"Do you want your password to include upper case letters?\");\n}", "title": "" }, { "docid": "c5280fac860dcef2799b413b5b4edf41", "score": "0.7413393", "text": "function question3() {\n var response3 = prompt('Do you know if Rose Anne likes to sing?').toUpperCase();\n\n if (response3 === 'YES' || response3 === 'Y') {\n alert('Yes, Rose Anne does like to sing!');\n rightAnswer += 1;\n console.log('Does Rose Anne like to sing?');\n console.log(response3);\n }\n else if (response3 === 'NO' || response3 === 'N') {\n alert('Yes, Rose Anne doesn\\'t like to sing!');\n console.log('Does Rose Anne like to sing?');\n console.log(response3);\n }\n else {\n alert('Please enter a YES/Y or NO/N');\n console.log('The user didn\\'t answer YES or NO.');\n }\n}", "title": "" }, { "docid": "6245cc5043b5037f1783869529f8bdb7", "score": "0.73952687", "text": "function fifthQ(){\n\n var answer5 = prompt('do i love sports').toLowerCase();\n if (answer5 === 'y' || answer5 === 'yes') {\n //console.log('your answer is true');\n alert('your answer is true');\n }\n else if (answer5 === 'no' || answer5 === 'n') {\n //console.log('your answe is wrong');\n alert('your answe is wrong');\n }\n else {\n //console.log('you should answer yes/y or /no/n, please.');\n alert('you should answer yes/y or no/n, please.');\n }\n}", "title": "" }, { "docid": "727ee1d8e3a0790e86c74dc1d2d201de", "score": "0.73945487", "text": "function question5() {\n var response5 = prompt('Does Rose Anne yodel?').toLowerCase();\n\n if (response5 === 'yes' || response5 === 'y') {\n alert('Yes, Rose Anne yodels!');\n rightAnswer += 1;\n console.log('Does Rose Anne yodel?');\n console.log(response5);\n }\n else if (response5 === 'no' || response5 === 'n') {\n alert('Yes, Rose Anne doesn\\'t yodel!');\n console.log('Does Rose Anne yodel?');\n console.log(response5);\n }\n else {\n alert('Please enter a yes/y or no/n');\n console.log('The user didn\\'t answer yes or no.');\n console.log(response5);\n }\n}", "title": "" }, { "docid": "a0e41a7212413d95aed5b4513502ee8e", "score": "0.73940665", "text": "function question1() {\n var ikeCollege = prompt('Did I graduated college?');\n//saves the user's response to the question about college. #1 question.\n\n if (ikeCollege.toLowerCase() === 'no' || ikeCollege.toLowerCase() === 'n'){\n alert('That\\'s right! I did go to college, but unfortunately I dropped out.');\n correctAnswers++;\n } else {\n alert('That\\'s wrong. I went to college right after High School, but I dropped out after a year and a half.');\n }\n console.log('When asked if user thought I graduated from college, user responded ' + ikeCollege);\n}", "title": "" }, { "docid": "0810571409f729f4e2d0dc72b662d115", "score": "0.73895866", "text": "function questionFive() {\n var answerFive = prompt('Is Bronwyn learning to code?');\n var responseFive = document.getElementById('responseFive');\n\n if (answerFive.toLowerCase() === 'yes' || answerFive.toLowerCase() === 'y') {\n responseFive.textContent = 'Why yes she is! That\\'s why she\\'s at CodeFellows!';\n score++;\n } else {\n responseFive.textContent = 'Got that wrong, mate. She\\'s at CodeFellows to learn to code and launch a new career!';\n };\n}", "title": "" }, { "docid": "72f7cf5808331463da4cce130c37903c", "score": "0.7330662", "text": "function askPlayOutside(){\n var answer = prompt(user + ', Do you think I like to \\'Play Outside\\' as WDFW says? Enter Yes or No (Y or N is OK too):').toUpperCase();\n if (answer === 'YES' || answer === 'Y') {\n console.log('The user answered that I like to play outside.');\n alert(user + ', that is right! Hmmm, identifying WDFW probably gave that one away.');\n answersRight++;\n } else {\n alert(user + ', that is not correct!');\n answersWrong++;\n console.log('The user answered that I do NOT like to play outside. Total Wrong: ' + answersWrong);\n }\n}", "title": "" }, { "docid": "f83875c19f9077dbd3954db3246a7074", "score": "0.72999203", "text": "function whatKind() {\r\n let quoteType = prompt('Would you like a \\'silly\\' quote or a \\'serious\\' quote?', 'silly or serious');\r\n if (quoteType === 'silly' || quoteType === 'serious') {\r\n return quoteType;\r\n } else {\r\n alert('You must enter silly or serious');\r\n return whatKind();\r\n }\r\n}", "title": "" }, { "docid": "18cc5154e8846b51de6488e5045df6d6", "score": "0.72960144", "text": "function question4() {\n var response4 = prompt('Does Rose Anne Dance?').toLowerCase();\n\n if (response4 === 'yes' || response4 === 'y') {\n alert('Yes, Rose Anne dances!');\n rightAnswer += 1;\n console.log('Does Rose Anne dance?');\n console.log(response4);\n }\n else if (response4 === 'no' || response4 === 'n') {\n alert('Yes, Rose Anne doesn\\'t dance!');\n console.log('Does Rose Anne dance?');\n console.log(response4);\n }\n else {\n alert('Please enter a yes/y or no/n');\n console.log('The user didn\\'t answer yes or no.');\n console.log(response4);\n }\n}", "title": "" }, { "docid": "b1607b0a63241c79d65c19e75f08b975", "score": "0.72796226", "text": "function yesNo4() {\n var responseFour = prompt('Am I a certified ESL teacher?').toLowerCase();\n if (responseFour === 'y' || responseFour === 'yes') {\n alert('Yes, that is correct.');\n correctAnswers++;\n } else {\n (responseFour === 'n' || responseFour === 'no');\n alert('Sorry, that is incorrect. I received my TEFL certification in 2013.');\n }\n console.log('responseFour', responseFour);\n}", "title": "" }, { "docid": "1e221130f194314062b67d084ad887b7", "score": "0.7270342", "text": "function madlab() {\n var noun = prompt(\"Enter a noun?\");\n var verb = prompt(\"Enter a verb\");\n var adjective = prompt(\"Enter an adjective\");\n var adverb = prompt(\"Enter an adverb\");\n alert ( \"Do you\" + ' ' + verb + ' ' + ' '+ \"your\" + ' ' + adjective + ' ' + noun + adverb + \"?\" + \"That is hilarious!\");\n}", "title": "" }, { "docid": "a3cce414c23d00a7bf963f181b088dca", "score": "0.726631", "text": "function ansGuardiansTwo() {\n const likesGuardiansSequel = prompt(username + ' what about the sequel Guardians 2? Did I like that movie?');\n console.log('Question: Did I like the sequel of Guardians of the Galaxy? User answered: ' + likesGuardiansSequel);\n if (likesGuardiansSequel.toLowerCase() === 'yes' || likesGuardiansSequel.toLowerCase() === 'y'){\n alert('Correct! Best sequel in years!');\n score++;\n } else {\n alert('Wrong. Of course I liked the sequel! Best sequel in years imho...');\n }\n}", "title": "" }, { "docid": "26281954216653f5295e52588490a9c4", "score": "0.7264609", "text": "function playerChoice(){\n const the_player_choice = prompt(\"Choose: Paper, Rock or Scissors\")\n return the_player_choice.toLowerCase();\n}", "title": "" }, { "docid": "298ab2f54c76dfec19ec00fc806023d8", "score": "0.725737", "text": "function thirdQ(){\n\n var answer3 = prompt('did i study at JUST?').toLowerCase();\n if (answer3 === 'y' || answer3 === 'yes') {\n console.log('your answer is wrong');\n alert('your answer is wrong');\n \n }\n else if (answer3 === 'no' || answer3 === 'n') {\n //console.log('your answer is true');\n alert('your answer is true');\n }\n else {\n //console.log('you should answe yes/y or no/n, please.');\n alert('you should answer yes/y or no/n, please.');\n \n }\n}", "title": "" }, { "docid": "08eaedc1da5091ec95579486e2b4e2af", "score": "0.72521454", "text": "function question4(){\n gutBiota = prompt('Does Drew have a troubled gut biota?');\n while (!gutBiota) {\n gutBiota = prompt('Oops. You forgot to answer, that one, ' + userName + '. Try again. Does Drew have tummy issues?');\n }\n console.log('Troubled gut?: ' + gutBiota);\n\n gutBiota = gutBiota.toUpperCase();\n\n if (gutBiota === 'YES' || gutBiota === 'Y') {\n alert('Wrong. He eats yogurt everyday and drinks kombucha on the reg. You have ' + userTally + ' point(s).');\n } else if (gutBiota === 'NO' || gutBiota === 'N') {\n userTally++;\n alert('Very good. But how did you know that? I\\'m getting a creepy vibe from you. You now have ' + userTally + ' point(s), but I\\'d kinda like to take away a point.');\n } else {\n alert('You said \"' + gutBiota + '.\" Not an answer. I have a question for you, though. Are you a gut bacterium with eyes and extremely long fingers... ' + userName + '?');\n }\n}", "title": "" }, { "docid": "673874745db70d332ab9d5d67b64c209", "score": "0.7246605", "text": "function askQ(question, variable, ans) {\n let response = prompt(question).toLowerCase();\n // Check for invalid responses with a while loop first\n while(!response.startsWith('y') && !response.startsWith('n')) {\n response = prompt('I\\'m sorry I didn\\'t understand that, please enter yes or no').toLowerCase();\n }\n // Compare first letter of response with correct answer, add score if correct.\n if (response.startsWith(ans)) {\n alert(variable + ': Correct!');\n scoreCount++;\n } else {\n alert(variable + ': Incorrect.');\n }\n}", "title": "" }, { "docid": "00e2be7429a9be5caca24b39270670d5", "score": "0.7244739", "text": "function persQues( question, message, flip){\n var userInput = prompt(question).toLowerCase(); \n console.log (newUser + ' guessed', userInput );\n if (userInput.startsWith('n')||userInput.startsWith('y') ) {\n if (userInput.startsWith(flip)) {\n confirm( 'That\\'s Correct! ' +message + ' Let\\'s keep going!');\n rightCount = rightCount+1;\n scoreAlert();\n \n } else {\n confirm ('That\\'s not quite right, but keep going! ' +' '+message);\n scoreAlert(); \n }\n }else{\n alert ('Hmmm, Try a Yes or No ');\n }\n}", "title": "" }, { "docid": "997347baab13352163e6e49859f9a6b4", "score": "0.724366", "text": "function ansGrewUp() {\n const grewUp = prompt(username + ' did I grow up in Oregon?');\n console.log('Question: Did I grow in in Oregon? User answered: ' + grewUp);\n if (grewUp.toLowerCase() === 'no' || grewUp.toLowerCase() === 'n'){\n alert('Correct! I actually grew up in Alaska!');\n score++;\n } else {\n alert('Wrong. How could you have known that tho? I actually grew up in Alaska!');\n }\n}", "title": "" }, { "docid": "e7f0d9c9ae8890fdd0e4d2745272aa47", "score": "0.7229859", "text": "function questionOne() {\n var answer1 = prompt(userName + \", please answer the following with 'Y' or 'N'. Am I from Manitoba?\");\n console.log('The user answered question 1: ' + answer1);\n if(answer1.toUpperCase() === \"N\" || answer1.toUpperCase() === \"NO\") {\n //alert(\"You are correct, \" + userName +\". I not from Canada; I am actually from Minneapolis, Minnesota\");\n result1.textContent = \"You are correct, \" + userName +\". I not from Canada; I am actually from Minneapolis, Minnesota\";\n counter +=1\n correctCounter();\n } else {\n //alert(\"Sorry, \" + userName + \", I am actually from Minneapolis, Minnesota.\");\n result1.textContent = \"Sorry, \" + userName + \", I am actually from Minneapolis, Minnesota.\";\n }\n}", "title": "" }, { "docid": "22ed3a684efe00c1f6b644662b8e7d1d", "score": "0.7209764", "text": "function askLowerFunk(){\n var askLower = prompt(\"Would you like to include lowercase letters in the password? Please enter Yes or No.\")\n askLower2 = askLower.toLocaleLowerCase()\n if(askLower2 != \"yes\" && askLower2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askLowerFunk()\n }\n }", "title": "" }, { "docid": "dc4f39a67d4597731e171c04c1a6bc63", "score": "0.72089136", "text": "function question ( questionNumber, country, city ) {\n var answer = prompt( \"Question \" + questionNumber + \": What is the capital city of \" + country + \"?\");\n if (answer.toUpperCase() === city) {\n alert(\"You are correct!\");\n return 1;\n } else {\n alert(\"Sorry, the capital of \" + country + \" is \" + city);\n return 0;\n }\n}", "title": "" }, { "docid": "4b48da8b826d3054bab94dadffc00b80", "score": "0.72003394", "text": "function questionOne() {\nlet colorAsk = prompt('Is my favorite color blue??').toLowerCase();\n\n// if code to verify correct answer\n\nif (colorAsk === 'yes' || colorAsk === 'y') {\n // console.log('user answer for color is: ' + colorAsk);\n alert('Congrats, too easy. Time for a harder one.');\n correctAnswer = correctAnswer +1;\n} else if (colorAsk === 'no' || colorAsk === 'n') {\n // console.log('user answer for color is: ' + colorAsk);\n alert('Maybe try the other option??');\n} else {\n // console.log('user answer for color is: ' + colorAsk);\n alert('Please answer yes or no. Thank you for your cooperation.')\n}\n}", "title": "" }, { "docid": "4f318bd1c386b59ffc2a3201b76902f8", "score": "0.7150025", "text": "function question2() {\n var response2 = prompt('Do you know if Rose Anne likes to travel?').toUpperCase();\n\n if (response2 === 'YES' || response2 === 'Y') {\n alert('Yes, Rose Anne does like to travel!');\n rightAnswer += 1;\n console.log('Does Rose Anne like to travel?');\n console.log(response2);\n }\n else if (response2 === 'NO' || response2 === 'N') {\n alert('Yes, Rose Anne doesn\\'t like to travel!');\n console.log('Does Rose Anne like to travel?');\n console.log(response2);\n }\n else {\n alert('Please enter a YES/Y or NO/N');\n console.log('The user didn\\'t answer yes or no.');\n console.log(response2);\n }\n}", "title": "" }, { "docid": "c637481370f3302f4e9d4fd713aa470e", "score": "0.7137193", "text": "function aboutMe(question, alertYes, alertNo) {\n question = prompt(question).toLowerCase();\n if (question === 'yes') {\n alert(alertYes);\n totalCorrectAnswers++;\n // console.log(alertYes);\n } else {\n alert(alertNo);\n // console.log(alertNo);\n }\n}", "title": "" }, { "docid": "c5a510f0ebf513625e5d27d2e8e0976c", "score": "0.7118269", "text": "function question3(){\n homePlanet = prompt('Is Drew\\'s home planet still Earth?');\n while (!homePlanet) {\n homePlanet = prompt('Oops. You forgot to answer, that one, ' + userName + '. Try again. Does Drew still live on Earth?');\n }\n console.log('Still on Earth?: ' + homePlanet);\n homePlanet = homePlanet.toUpperCase();\n\n if (homePlanet === 'YES' || homePlanet === 'Y') {\n userTally++;\n alert('\"' + homePlanet + '.\" Cool. You should give him a call sometime. One more point for you, ' + userName + ', for a total of: ' + userTally);\n } else if (homePlanet === 'NO' || homePlanet === 'N') {\n alert('Wrong. He here. In fact, he\\'s standing right behind you. You have ' + userTally + ' point(s).');\n } else {\n alert('No comprende, chica.');\n }\n}", "title": "" }, { "docid": "c8198212280598de11549aebbe3b4b7f", "score": "0.71044374", "text": "function lowercaseprompt() {\n var prompt2 = prompt(\"Would you like to include lowercase characters in your password?\", \"\");\n var lower = \"abcdefghijklmnopqrstuvwxyz\";\n\n if (prompt2 == null) { // If they click cancel\n alert(\"Cancelled\");\n }\n else if (prompt2 == \"yes\" || prompt2 == \"Yes\") {\n traits.lc = 1; // true\n passwordpool += lower; // includes the lowercase characters in those that will generate the password\n uppercaseprompt();\n }\n else if (prompt2 == \"no\" || prompt2 == \"No\") {\n traits.lc = 0; // false. though this is the default, having it set to 0 here allows for the process to be repeated without refreshing\n uppercaseprompt();\n }\n else {\n alert(\"Please enter yes or no\");\n lowercaseprompt();\n }\n}", "title": "" }, { "docid": "682fd78aeb5ca82d6ba0c97ebdb374d1", "score": "0.7065154", "text": "function initialPrompt() {\n let answer = input.question(\"Let's play some scrabble! Enter a word:\")\n return answer;\n}", "title": "" }, { "docid": "ab9f746dcd60ebed951b8e99eaf52b8f", "score": "0.7064395", "text": "function monthPythonGame(question){\n var answer = prompt(question).toLowerCase();\n\nif (answer == \"holy grail\" || answer == \"to seek the holy grail\") {\n insertText(\"You sure do know your Monty Python references. You get the bonus point!\");\n correctGuess +=2;\n } else {\n correctGuess +=1;\n insertText(\" \");\n }\n answerArr.unshift(answer);\n}", "title": "" }, { "docid": "916acfaae549bc3d7b3c1872aa25f763", "score": "0.704242", "text": "function initialPrompt() {\n inputWord = input.question(\"Enter a word to score:\");\n}", "title": "" }, { "docid": "7466cc71a66ddc84196ce9669af224dd", "score": "0.70334834", "text": "function askPuget(){\n var answer = prompt(user + ', Do you think I live in Puget Sound? Enter Yes or No (Y or N is OK too):').toUpperCase();\n if (answer === 'YES' || answer === 'Y') {\n console.log('The user answered that I live in Puget Sound.');\n alert(user + ', that is right! (Yeah, that was not difficult was it?)');\n answersRight++;\n } else {\n alert(user + ', that is not correct!');\n answersWrong++;\n console.log('The user answered that I do NOT live in Puget Sound. Total Wrong: ' + answersWrong);\n }\n}", "title": "" }, { "docid": "edfec0543d84f9f81233dc765c58083c", "score": "0.70250213", "text": "function myAge() {\r\n var usersAnswer = prompt('Is my age 22').toUpperCase();\r\n if (usersAnswer === 'Y' || usersAnswer === 'YES') {\r\n alert('Good job you guessed right!');\r\n correctAnswers++;\r\n }\r\n else if (usersAnswer === 'N' || usersAnswer === \"NO\") {\r\n alert('Wrong Answer Sorry');\r\n }\r\n else {\r\n alert('Sorry but you didnt follow my instructions please only answer with\\\r\n Y and N.');\r\n }\r\n console.log('myAge:', usersAnswer);\r\n}", "title": "" }, { "docid": "c2d8b9779d5a10afe9854836eee5b7bd", "score": "0.70202833", "text": "function ask(question, yes, no){\n if (confirm(question)) yes()\n else no();\n}", "title": "" }, { "docid": "a150890b238bd0286f8938674b14c753", "score": "0.70116335", "text": "function thirdQuestion() {\n var myTravels = prompt('Have I been to Australia?').toLowerCase();\n if(myTravels === 'no') {\n alert('You are correct! Ever since the Lord of the Rings movies, I have wanted to go to Oceania! My favorite trip was probably to Copenhagen, but Australia and New Zealand are high on the list!' );\n numCorrect.push('Correct');\n } else{\n alert ('Unfortunately, I have not! Ever since the Lord of the Rings movies, I have wanted to go to Oceania! My favorite trip was probably to Copenhagen, but Australia and New Zealand are high on the list!');\n numIncorrect.push('Incorrect');\n }\n console.log('Question 3: you have ' + numCorrect.length + ' correct and ' + numIncorrect.length + ' wrong.');\n}", "title": "" }, { "docid": "f8ae6fbc0c6f409fd8bb5e3a52150e01", "score": "0.69896644", "text": "function initialPrompt() {\n //console.log(\"Let's play some scrabble! Enter a word:\");\n let response=input.question(\"Let's play some scrabble! Enter a word: \")\n response=response.toUpperCase();\n // userWords.push(response);\n // console.log(oldScrabbleScorer(response))\n //oldScrabbleScorer(response);\n //console.log(vowelBonusScore(response));\n return response;\n}", "title": "" }, { "docid": "1acabae3d90dcdeb4c91e724461c3cb1", "score": "0.6983055", "text": "function welcomeToGame() {\n var userName = prompt('What is your name?');\n alert('Welcome to my guessing game ' + userName);\n}", "title": "" }, { "docid": "c276dede97257ab32b70ff77fec6ac09", "score": "0.69742703", "text": "function askSpecialFunk(){\n var askSpecial = prompt(\"Would you like to include special characters in the password? Please enter Yes or No.\")\n askSpecial2 = askSpecial.toLocaleLowerCase()\n if(askSpecial2 != \"yes\" && askSpecial2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askSpecialFunk()\n }\n }", "title": "" }, { "docid": "66cfe3816c67f281935cbea66de214fb", "score": "0.6973301", "text": "function temple()\n{\n var wChoice = prompt(\"Which god do you worship? (Storm)on, (Sun)shin, or leave?\")\n if (wChoice === \"Storm\")\n {\n alert (\"You pray to Stormon the god of storms and battle and read from his holy book, 'The Book of Stormon'.\")\n stormon_worship += 1;\n }\n else if (wChoice === \"Sun\")\n {\n alert (\"You pray Sto Sunshine the god of light.\")\n sunshin_worship += 1;\n }\n else\n {\n alert (\"You decide not to pray like the edgy little athiest you are.\")\n }\n alert(\"You leave the temple.\")\n}", "title": "" }, { "docid": "fce992b9119b896f01c439f05c7a9f2b", "score": "0.69649756", "text": "function greetAliceOrBob() {\n var name = prompt(\"what is your name\");\n if(name==\"alice\" || name==\"bob\"){\n alert(`good morning ${name}`);\n }else{\n alert(\"good morning\");\n }\n }", "title": "" }, { "docid": "198a2206f7ac0c20c59c7361244eb70b", "score": "0.694756", "text": "function ex2(){\n\tvar userInput = prompt(\"Enter how you feel?\");\n\talert(userInput);\n}", "title": "" }, { "docid": "837b9a030689eef3c53bd4568d91eb8a", "score": "0.6946018", "text": "function checkUppercase() {\n var confirmUpperCase = confirm(`${promptMessageOne}uppercase${promptMessageTwo}`);\n return confirmUpperCase\n }", "title": "" }, { "docid": "34b52041b39fd2e9da12d1c8859e217f", "score": "0.6941632", "text": "function askConversion(){\r\n var answer= window.prompt('Which conversion you want to do? (euros/celsius/liters');\r\n return answer;\r\n}", "title": "" }, { "docid": "a95415851fa883e072c9f8368fb47769", "score": "0.69414544", "text": "function ask(question, yes, no) {\n if (confirm(question)) yes()\n else no();\n}", "title": "" }, { "docid": "29df23bd792fc6d77be4d4067f0da3fa", "score": "0.69409686", "text": "function askContinue(){\r\n var answer= window.prompt(\"Do you want to convert a value? (yes/no)\");\r\n if( answer == 'yes'){\r\n return true;\r\n } else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "969045cf6ed43c82173927e157d79d8a", "score": "0.69407755", "text": "function respond(answer){\r\n return (answer? \"Yes\" : \"No\")\r\n}", "title": "" }, { "docid": "e35985e57dc876ccf64f11f6b3e9bc9e", "score": "0.6938193", "text": "function qprompt(){\n let question = prompt(\"Press the [letter] associated with the one you'd like to change\\n\"+\n \"***NOTE*** If you change [a]Destination then restaurant and entertainment also must change based on location.\\n\"+\n \"\\n [a] \"+selectedDestination+ \n \"\\n \" +\"[b] \"+selectedRestaurant+ \n \"\\n \"+\"[c] \"+selectedModeOfTransportation +\n \"\\n \"+\"[d] \"+selectedEntertainment +\n \"\\n [e] If you are satisfied with this randomly generated day trip!\\n\");\n return question;\n}", "title": "" }, { "docid": "35a73dee3ea7b2cf9365c5b2f74fce05", "score": "0.69319564", "text": "function includeUppercaseFunction() {\n includeUppercase = prompt(\"Do you want your password to include uppercase letters? (Y or N)\");\n includeUppercase = includeUppercase.toUpperCase();\n\n if (!includeUppercase) {\n return;\n };\n\n if(includeUppercase !== \"Y\" && includeUppercase !== \"N\") {\n alert(\"Please enter Y or N.\");\n includeUppercaseFunction();\n };\n\n console.log(\"Did they choose uppercase letters?\");\n console.log(includeUppercase);\n}", "title": "" }, { "docid": "7d576f963ae869f64c3069ada7eb60dd", "score": "0.69309175", "text": "function askLowerCase(){\n let input = confirm(\"Would you like to include lower case letters?\");\n hasLowerCase = input;\n return input;\n}", "title": "" }, { "docid": "1a44e8125c280b0c008a89748a8dcb57", "score": "0.6929683", "text": "function initialPrompt() {\n let userInput = input.question(\"Let's play some scrabble! Enter a word:\");\n\n return userInput\n}", "title": "" }, { "docid": "242f52c873def7ecae7d002c373ccc16", "score": "0.6928016", "text": "function initialPrompt() {\n wordsPlayed = input.question(`Let's play some scrabble!\n\nEnter a word to score: `);\n \n}", "title": "" }, { "docid": "2a00260b4c2f17c39d00e50bc2443cae", "score": "0.6923721", "text": "function ask(question, yes, no) {\r\n if (confirm(question)) yes()\r\n else no();\r\n}", "title": "" }, { "docid": "b35d7870c43d66f4cd4f8c8876762004", "score": "0.69193435", "text": "function ask(question, yes, no) {\n if (confirm(question)) yes()\n else no();\n }", "title": "" }, { "docid": "4178c920e184a27f7d64ea9f85f46954", "score": "0.69110316", "text": "function initialPrompt() {\n console.clear();\n let word = input.question(\"Let's play some scrabble! Enter a word to score: \");\n\n return word;\n\n}", "title": "" }, { "docid": "68bada6c7302182767b3b6eaeddce943", "score": "0.6901508", "text": "function prompts() {\n upper = confirm(\"Would you like to include uppercase letters?\");\n lower = confirm(\"Would you like to include lowercase letters?\");\n numer = confirm(\"Would you like to include numeric values?\");\n spec = confirm(\"Would you like to include special characters?\");\n }", "title": "" }, { "docid": "332742e7087d5b740e6b5f18ba548811", "score": "0.68980294", "text": "function lowerCasePrompt() {\n return window.confirm(\"Do you want your password to include lower case letters?\");\n}", "title": "" }, { "docid": "127ac7775314703c8c6f6fea22189a3b", "score": "0.68968743", "text": "function ask() {\n return prompt(\"Введите обязательную статью расходов в этом месяце?\", \"\");\n}", "title": "" }, { "docid": "e0641c58a8405911538f7ee8db47f18b", "score": "0.68922776", "text": "function initialPrompt() {\n console.log(\"Let's play some scrabble! Enter a word:\");\n word= input.question(\"Enter a word to score: \");\n \n return word;\n}", "title": "" }, { "docid": "442457369aa71c41efcd5d89c4a0620d", "score": "0.68905073", "text": "function InShop() {\n alert('The marketplace master greets you.')\n temp = [\"Buy\", \"Sell\", \"Leave\"];\n if(woodenSword === 0 && speedBoots === 0) {\n temp.splice(temp.indexOf(\"Sell\"), 1);\n }\n requestInput(temp, determineAnswer);\n //answer = prompt('The marketplace master asks you if you would like to buy, or sell.', 'Buy, Sell, Leave').toUpperCase()\n function determineAnswer() {\n switch (answer) {\n case 'Buy':\n Buy()\n break;\n case 'Sell':\n Sell()\n break;\n case 'Leave':\n InTown()\n break;\n }\n }\n}", "title": "" }, { "docid": "a56c81f73cdd5d839c26b82dd806c89f", "score": "0.68898034", "text": "function askChoice() {\n userChoice = prompt('Choose your weapon: Rock, Paper or Scissors?', '');\n }", "title": "" }, { "docid": "f74f194949633ff7982db15805f49d37", "score": "0.68822676", "text": "function promptName() {\n var sName = prompt(\"Enter your name.\\nThis prompt should show up when the \" + \n \"button is clicked.\",\"Your Name\");\n alert(\"Hi there \" + sName + \". Alert boxes are a quick way to check the state \" +\n \"\\nof your variables when you are developing code.\");\n rewriteParagraph(sName);\n}", "title": "" }, { "docid": "3680e75ee50b1505a5824143d693777b", "score": "0.687977", "text": "function askLower() {\n var haveLower = prompt(\"Do you want to include lowercase characters? Enter yes or no.\");\n if (haveLower === \"yes\") {\n options.push(\"lower\");\n alert(\"Ok, your password will include lowercase characters.\");\n } else if (haveLower === \"no\") {\n alert(\"Ok, your password will not include lowercase characters.\");\n } else {\n alert(\"Please type \\\"yes\\\" or \\\"no\\\"\");\n askLower();\n }\n }", "title": "" }, { "docid": "1e521e5d5c92cd3726eac20dc6ffce80", "score": "0.687773", "text": "function playerChoice(){\n let choice = prompt(\"Do you attack or retreat?\", \"Please type attack or retreat\");\n if(choice.toLowerCase()==='retreat'){\n return 'break';\n } else if(choice.toLowerCase()==='attack'){\n return 'continue';\n }\n else {\n alert('You did not choose attack or retreat');\n console.log('%c You did not choose attack or retreat', 'font-style: italic; background: azure; border: 1px solid grey;');\n playerChoice();\n }\n}", "title": "" }, { "docid": "4e3eee60bb1cc8630ca48598e952cf7c", "score": "0.685445", "text": "function ask(question, yes, no) {\n if (confirm(question)) yes()\n else no();\n}", "title": "" }, { "docid": "4e3eee60bb1cc8630ca48598e952cf7c", "score": "0.685445", "text": "function ask(question, yes, no) {\n if (confirm(question)) yes()\n else no();\n}", "title": "" }, { "docid": "0afb922422570fb4cf5d3a73893d40f6", "score": "0.68441135", "text": "function wannaPlayAgain() {\n var playAgain = prompt(\"Do you want to play again? [y/n]\");\n if (playAgain == 'y') {\n dealCards();\n }\n else {\n alert(\"Good Game!\");\n }\n}", "title": "" }, { "docid": "d8a21c3ad41394c890fc97a4da7659c2", "score": "0.68408793", "text": "function checkUpperCase(){\n upperCase = window.prompt(\"Do you want to include 'Upper case character' in the password? \\n Choose: \\n 'Y' for Yes \\n 'N' for No\");\n \n // check for invalid inputs\n var flag = invalid(upperCase);\n\n // if invalid input re-prompt\n if (flag === 1){\n checkUpperCase();\n }\n\n upperCase = upperCase.toLowerCase();\n if (upperCase === 'y'){\n passwordChar += upperChar;\n }\n }", "title": "" }, { "docid": "7de320cf0b4c84ac9c0ebce9a638fa79", "score": "0.68403524", "text": "function greetings(){\r\n let yourName = prompt ('Please enter your name', 'Sadik');\r\n if (yourName != null){\r\n alert(\"Hello! \" + yourName + \" Welcome\");\r\n }\r\n}", "title": "" }, { "docid": "39c358bf55757c5541a24b04665b579e", "score": "0.68394834", "text": "function correctYesNo(input)\n{\n\tif(input == \"yes\" || input == \"YES\")\n\t\treturn true;\n\telse if(input == \"no\" || input == \"NO\")\n\t\treturn false;\n\t\t\n}", "title": "" }, { "docid": "24e5405a095a9620fc0e3b1c84fcd476", "score": "0.68197036", "text": "function ask2(question, yes, no) {\n return confirm(question) ? yes() : no() \n}", "title": "" } ]
99ce2491d5b67e1ebdae1333754cc708
change date from UI to number only such as Oct 18 2018 to 18102018
[ { "docid": "68dd5f582b718c218b4549154d37fb6b", "score": "0.60425645", "text": "setDate(newDate) {\n var str = newDate.toString().substr(4, 4);\n var intDate;\n\n if (str.match(\"Jan\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"01\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Feb\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"02\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Mar\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"03\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Apr\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"04\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"May\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"05\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Jun\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"06\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Jul\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"07\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Aug\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"08\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Sep\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"09\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Oct\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"10\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Nov\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"11\" +\n newDate.toString().substring(11, 15);\n } else if (str.match(\"Dec\")) {\n intDate =\n newDate.toString().substring(7, 10) +\n \"12\" +\n newDate.toString().substring(11, 15);\n }\n this.setState({ chosenDate: intDate });\n }", "title": "" } ]
[ { "docid": "11bb9da3daba37a5da9da3c97362c3db", "score": "0.6801067", "text": "function dateToDateNum( date ) {\n date = date.trim();\n var arr = date.split(\" \");\n \n var yearNum = 0;\n var monthNum = 0;\n var dayNum = 0;\n \n if( arr[1] === \"Jan\" ) { monthNum = 1; }\n else if( arr[1] === \"Feb\" ) { monthNum = 2; }\n else if( arr[1] === \"Mar\" ) { monthNum = 3; }\n else if( arr[1] === \"Apr\" ) { monthNum = 4; }\n else if( arr[1] === \"May\" ) { monthNum = 5; }\n else if( arr[1] === \"Jun\" ) { monthNum = 6; }\n else if( arr[1] === \"Jul\" ) { monthNum = 7; }\n else if( arr[1] === \"Aug\" ) { monthNum = 8; }\n else if( arr[1] === \"Sep\" ) { monthNum = 9; }\n else if( arr[1] === \"Oct\" ) { monthNum = 10; }\n else if( arr[1] === \"Nov\" ) { monthNum = 11; }\n else if( arr[1] === \"Dec\" ) { monthNum = 12; }\n \n yearNum = (2000 + parseInt(arr[2])) * 10000;\n monthNum = monthNum * 100;\n dayNum = parseInt(arr[0]);\n \n return yearNum + monthNum + dayNum;\n}", "title": "" }, { "docid": "3dc77e00fb9b3ccef974272bfc346bfd", "score": "0.6772722", "text": "function dateConversion(date){\r\n if(date.toString().length==1){\r\n return '0'+date;\r\n } else{\r\n \treturn date;\r\n }}", "title": "" }, { "docid": "59713920f2941eff4eb959202ee0a982", "score": "0.6657146", "text": "getFormattedDate(date) {\n let month = date.getMonth() + 1;\n let day = date.getDate();\n\n if (month < 10) month = '0' + month;\n if (day < 10) day = '0' + day;\n\n return `${month}/${day}/${date.getFullYear()}`;\n }", "title": "" }, { "docid": "0be063b0bfc6bf9b26c546e2a49ac472", "score": "0.66465485", "text": "function fixDate(date){\n var day=date.getDate(), month=date.getMonth()+1, year=date.getFullYear();\n if(month<10) month = '0'+month;\n if(day<10) day = '0'+day;\n return year+\"-\"+month+\"-\"+day\n }", "title": "" }, { "docid": "ca21ed29c4a11de14c1f77dc884eb34b", "score": "0.66185933", "text": "function reFormatDate(date){\n var d = new Date(Date.parse(date));\n var mm = d.getMonth() + 1;\n var yyyy = d.getFullYear();\n var dd = d.getDate();\n\n if(dd < 10){\n dd = '0' + dd;\n }\n if(mm < 10){\n mm = '0' + mm;\n }\n return yyyy + '-' + mm +'-' + dd;\n }", "title": "" }, { "docid": "80edc75586cdaedcee76749bf09e5978", "score": "0.6566344", "text": "function dateSN(d){ return d.getFullYear() * 10000 + d.getMonth() * 100 + d.getDate();}", "title": "" }, { "docid": "03635ec6c3a03c14081a259dbec5b329", "score": "0.65638745", "text": "function convertDate(date) {\n let dateResult = new Date(date);\n let year = dateResult.getFullYear();\n let month = (dateResult.getMonth() +1).toLocaleString('en-US', {\n minimumIntegerDigits: 2,\n useGrouping: false\n });\n let day = dateResult.getDay().toLocaleString('en-US', {\n minimumIntegerDigits: 2,\n useGrouping: false\n });\n return `${year}-${month}-${day}`;\n}", "title": "" }, { "docid": "cc7df804a3c871f7cc2b0ad01a625d88", "score": "0.65261626", "text": "function dateConverter(date) {\n let newDate = date.replace(/(\\d+)\\-(\\d+)\\-(\\d{4})/g, '$1/$2/$3')\n return newDate\n}", "title": "" }, { "docid": "6e6a8c8a96c27c575bb060003015df2d", "score": "0.65182865", "text": "digitizeDate (date) {\n if (!date) {\n return ''\n }\n\n let s = split(date, ' ')\n let s0 = replace(s[0], new RegExp('-', 'g'), '')\n let s1 = replace(s[1], new RegExp(':', 'g'), '')\n\n return `${s0}${s1}`\n }", "title": "" }, { "docid": "de5b6256b48ebbb5451677c9a2e0746d", "score": "0.647051", "text": "function reformatDate(date) {\n // dd/mm/yyyy -> yyyy-mm-dd\n let arr = convertUNIXToDate(date).split(\"/\");\n if (arr[1] < 10) {\n arr[1] = \"0\" + arr[1];\n }\n let newDate = arr.reverse().join(\"-\");\n return newDate;\n }", "title": "" }, { "docid": "1df85575d8a8ba7cf15df03f07c2e66c", "score": "0.645254", "text": "function editDate(dateToChange) {\n var options = {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n };\n var replacedDate = new Date(\n dateToChange.replace(/(\\d+).(\\d+).(\\d+)/, \"$3,$2,$1\"),\n );\n var resultDate = new Date(replacedDate).toLocaleString(\"en-US\", options);\n return resultDate;\n}", "title": "" }, { "docid": "8250240a3a37353230db390428728984", "score": "0.64455837", "text": "convertSiteDate() {\n const today = new Date();\n let dd = today.getDate();\n let mm = today.getMonth() + 1;\n const yy = today\n .getFullYear()\n .toString()\n .substr(-2);\n\n if (dd < 10) {\n dd = \"0\" + dd;\n }\n\n if (mm < 10) {\n mm = \"0\" + mm;\n }\n\n return yy + mm + dd;\n }", "title": "" }, { "docid": "07d285729e0ec4cb8a01d531d8b4c992", "score": "0.64025205", "text": "function currentDateConvertor() {\r\n\t\tlet currentDayConvert;\r\n\t\tif (new Date().getDate() < 10) {\r\n\t\t\tcurrentDayConvert = (\"0\" + new Date().getDate());\r\n\t\t} else { \r\n\t\t\tcurrentDayConvert = new Date().getDate();\r\n\t\t}\r\n\t\treturn currentDayConvert\r\n\t}", "title": "" }, { "docid": "05f68b0f9083d8cdd84858c727b04130", "score": "0.63902503", "text": "function getFormattedDate(date) {\n return moment(date).format('ll');\n }", "title": "" }, { "docid": "c7bf560208fea19c1dacabcc6ed1693e", "score": "0.6364196", "text": "convertDate() {\n let newDate = new Date(this.ordenSelected.fecha);\n let anio = newDate.getFullYear();\n let mes;\n if (newDate.getMonth() + 1 < 10) {\n mes = \"0\" + (newDate.getMonth() + 1);\n } else {\n mes = newDate.getMonth() + 1;\n }\n let dia;\n if (newDate.getDate() < 10) {\n dia = \"0\" + newDate.getDate();\n } else {\n dia = newDate.getDate();\n }\n let formattedDate = anio + \"-\" + mes + \"-\" + dia;\n return formattedDate;\n }", "title": "" }, { "docid": "395117a528399e05adbf87722a512390", "score": "0.63448673", "text": "formatYYYYMMDD(value) {\n const date = new Date(value)\n if (value && !isNaN(date)) {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n const day = date.getDate()\n return year + '-' +\n ((month < 10 ? '0' : '') + month) + '-' +\n ((day < 10 ? '0' : '') + day)\n }\n return ''\n }", "title": "" }, { "docid": "2197dc954a18225d80498ca0d358a17e", "score": "0.6339835", "text": "function fixDate(date) {\n var date = new Date(parseInt(date.substr(6)));\n var month = date.getMonth() + 1;\n var day = date.getDate();\n if (month.toString().length < 2) { month = '0' + month; }\n if (day.toString().length < 2) { day = '0' + day; }\n return date.getFullYear() + \"-\" + month + \"-\" + day;\n\n}", "title": "" }, { "docid": "d38fbe97b5050b34dba8f8fddcfe8122", "score": "0.63367456", "text": "function formatDateNumber(num){\n if (num < 10){\n return `0${num}`\n } else {\n return num.toString()\n }\n}", "title": "" }, { "docid": "72753f8d4b4bf9a6f9b2a337b3ff3470", "score": "0.6316306", "text": "function getDate(num) {\n if (num < 10) {\n return \"0\" + num;\n }\n return num;\n}", "title": "" }, { "docid": "5d9c376e7a4a3a30e627993ceef1acd3", "score": "0.6311676", "text": "function formatMMDDYYYY(date) {\n return (date.getMonth() + 1) +\n \"/\" + date.getDate() +\n \"/\" + date.getFullYear();\n }", "title": "" }, { "docid": "f6d73883ab8f32a90eeedd377028ca0d", "score": "0.6289099", "text": "function convertDate(inputDate) {\n\t// adjust format here to adjust all dates displayed:\n\treturn moment(inputDate).format(\"llll\")\n}", "title": "" }, { "docid": "a847a9e9968e81fa6f44a344f91a550c", "score": "0.62689304", "text": "dateToYMD () {\n const d = this.getDate();\n const m = this.getMonth() + 1;\n const y = this.getFullYear();\n return '' + y + (m <= 9 ? '0' + m : m) + (d <= 9 ? '0' + d : d);\n }", "title": "" }, { "docid": "fd71a363800a284bdc6c75047a63eabf", "score": "0.62643486", "text": "dateConvertion(date) {\n return new Intl.DateTimeFormat(\"en-GB\", {\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n }).format(new Date(date));\n }", "title": "" }, { "docid": "4482ca589abcdf6db4de16b9baa20c90", "score": "0.6262202", "text": "function transformDateForAPIRequest(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n if (month < 10) {\n month = `0${month}`;\n }\n if (day < 10) {\n day = `0${day}`;\n }\n return `${year}-${month}-${day}`; // format 2021-08-22\n}", "title": "" }, { "docid": "d2c4be1772a4227d3ab8759cd137acf7", "score": "0.6251021", "text": "function checkDate(date) {\n if (date < 10) {\n date = \"0\" + date;\n\n\n }\n return date;\n\n}", "title": "" }, { "docid": "aefd4cdfc44774469d899ca2fe78047c", "score": "0.6244119", "text": "function getDate(date) {\n var day = date.getDate();\n if (day < 10) {\n return \"0\" + day;\n }\n return day;\n}", "title": "" }, { "docid": "7c49f17e6e925d48aae0bc7edb48173d", "score": "0.6242588", "text": "function ReformatDate(old_date) {\n\n if (old_date.length == 10) {\n if(old_date[2] == '/') {\n return `${old_date.substr(6, 4)}-${old_date.substr(0, 2)}-${old_date.substr(3, 2)}`;\n }\n else if(old_date[4] == '-') {\n return old_date;\n }\n else {\n return \"Unknown Date\";\n }\n } \n else {\n return \"Unknown Date\";\n }\n}", "title": "" }, { "docid": "9f841f58024e05f65c20edd2f32b229e", "score": "0.62354904", "text": "function fixDateInput(date){\n if(date[3] == \"0\"){\n date = date.slice(0, 3) + date.slice(4)\n }\n if(date[0] == \"0\"){\n date = date.slice(1)\n }\n return date;\n}", "title": "" }, { "docid": "522cbc53a6a3a2d7830554847e6f82e3", "score": "0.62006193", "text": "function convDateRev(date) {\r\n return date.split(\"-\").reverse().join(\"-\");\r\n}", "title": "" }, { "docid": "fcb46c439dafaa79dda96a75d79f3401", "score": "0.61794364", "text": "static converterData(tempData) {\n\n return `${tempData.getDate()}/${tempData.getMonth() + 1}/${tempData.getFullYear()}`;\n \n }", "title": "" }, { "docid": "661264e4a8d47431a220b397f423b839", "score": "0.6178613", "text": "function convertDate(date) {\n\n var dateFrom = date.getUTCFullYear() + \"-\";\n var month = date.getUTCMonth() + 1;\n dateFrom += (month < 10) ? \"0\" + month + \"-\" : month + \"-\";\n var date = date.getUTCDate();\n dateFrom += (date < 10) ? \"0\" + date : date;\n return dateFrom;\n}", "title": "" }, { "docid": "e86db68f4ec85697bfea34fa1fe25dbc", "score": "0.61639714", "text": "function dateConverter(currentDate){\r\n return (currentDate.date.getDate() +\"/\"+ (currentDate.date.getMonth() + 1)+\"/\"+ currentDate.date .getFullYear())\r\n}", "title": "" }, { "docid": "b3b08cb36d0cd13b8e143d67f511ff75", "score": "0.6149127", "text": "function convertDate(date) {\n var date = new Date(date);\n if (!isNaN(date.getTime())) {\n // Months use 0 index.\n return date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear();\n }\n}", "title": "" }, { "docid": "cbea6a5968fb56c5ed19cb8b49bbf350", "score": "0.6147297", "text": "formatYYYYMM(value) {\n const date = new Date(value)\n if (value && !isNaN(date)) {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n return year + '-' +\n ((month < 10 ? '0' : '') + month)\n }\n return ''\n }", "title": "" }, { "docid": "424f42ab3517ec9268320102e6eeb209", "score": "0.613578", "text": "function dateProcessor(date){\n month = '' + (date.getMonth() + 1);\n day = '' + date.getDate();\n year = date.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n\n}", "title": "" }, { "docid": "781cc58723a96e0c9b748b0e0878e111", "score": "0.6120006", "text": "function convertDate(date) {\r\n\r\n var month = date.getMonth();\r\n var year = date.getFullYear();\r\n\r\n newDate = (month + \" \" + year);\r\n\r\n return newDate;\r\n}", "title": "" }, { "docid": "14b6f98f25fe617007cb3e3b4e355394", "score": "0.6119187", "text": "function formatDate(date){\n var yyyy = date.getFullYear();\n var mm = date.getMonth() + 1;\n var dd = date.getDate();\n if(dd<10){\n dd='0'+ dd;\n }\n if(mm<10){\n mm='0'+mm;\n } \n return (yyyy + '-' + mm + '-' + dd);\n \n }", "title": "" }, { "docid": "a1b0378fa86f9e401c0ea80430503955", "score": "0.6110252", "text": "function m4fechahoy(){\t\n\td = new Date();\n\tvar d,s = \"\";\n\tif (d.getDate() < 10)\n\t\t{ s += 0;}\n\ts += d.getDate()+ \"-\";\n\tif (d.getMonth()+1 < 10)\n\t\t { s += 0;}\n\ts +=(d.getMonth()+1)+ \"-\";\n\ts += d.getYear();\n\treturn(s);\t\n}", "title": "" }, { "docid": "32b6068a191170c7f6c25cf3960a297c", "score": "0.6105743", "text": "function toYYYYMMDD (n) {\n return new Date(n).toISOString().split('T')[0]\n }", "title": "" }, { "docid": "0ce376874d8e43dd599badde5f7e1268", "score": "0.61010796", "text": "function transformDataToFriendlyDate(item){\n if(!item){\n return '----';\n }\n return new Date(item).format('MM/dd/yyyy');\n }", "title": "" }, { "docid": "507e2ffcd34dd8fa487152279be4f6f8", "score": "0.6097458", "text": "function formatDate(date) {\r\n return date.substr(0,11);\r\n}", "title": "" }, { "docid": "b94b8e1ee6dfb018b0e8045d0fccc1f1", "score": "0.60923684", "text": "function formatInputDate(date) {\r\n return date.getFullYear().toString().padStart(2, \"0\") + \"-\" + (date.getMonth() + 1).toString().padStart(2, \"0\") + \"-\" + date.getDate().toString().padStart(2, \"0\")\r\n }", "title": "" }, { "docid": "846d0b780cb6e9c87220607d2e6c2bac", "score": "0.6090852", "text": "function formatDate(date) {\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n \n return year + \"/\" + month + \"/\" + day;\n }", "title": "" }, { "docid": "c1904393507409adaadabf18ec8e4d56", "score": "0.6088414", "text": "reformatDate(date) {\n var split = date.split('-');\n var months = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\n var day = split[2].slice(0, 2);\n if (day[0] === '0') {\n day = day[1];\n }\n var month = months[split[1] - 1];\n var year = split[0];\n return `${month} ${day}, ${year}`;\n }", "title": "" }, { "docid": "e4adaeafc6af7b8811923f2e31d981f3", "score": "0.60708755", "text": "datePrint(date) {\r\n let dateString = date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear();\r\n return dateString;\r\n }", "title": "" }, { "docid": "f21a2f8d4fecbe0e8ca77d3d26337118", "score": "0.6068706", "text": "function processDate(date){\n\tdate = date.toString();\n\ty = date.substring(0,4);\n\tm = monthsText[date.substring(4,6)-1];\n\td = date.substring(6,8);\n\tif (d.charAt(0) == \"0\"){d = d.substring(1,2);}\n\tdate = m+\" \"+d+\", \"+y;\n\treturn(date);\n}", "title": "" }, { "docid": "3764dc26f6fbe589e5487d445fcc4d0d", "score": "0.6063177", "text": "function convertDate(date){\n\tvar dia = 0;\n\tvar mes = 0;\n\tvar anio = 0;\n\tvar diaString = \"\";\n\tvar mesString = \"\";\n\tvar anioString = \"\";\n\tdia = date.getDate();\n\tmes = date.getMonth() + 1;\n\tanio = date.getFullYear();\n\t\n\tif (dia < 10) diaString = \"0\" + dia;\n\telse diaString = dia;\n\tif (mes < 10) mesString = \"0\" + mes;\n\telse mesString = mes;\n\tanioString = anio;\t\n\t\n\treturn diaString + \"/\" + mesString + \"/\" + anioString;\n}", "title": "" }, { "docid": "7264aff08d5d61a9e940644c555ff9d9", "score": "0.60607636", "text": "function convertDate(thisDate) {\r\n if (thisDate != \"\") {\r\n let newDate = new Date(thisDate);\r\n let d = newDate.getDate() + 1;\r\n let m = newDate.getMonth() + 1;\r\n let y = newDate.getYear() + 1900;\r\n newDate = m + \"/\" + d + \"/\" + y;\r\n\r\n return newDate\r\n } else {\r\n return \"No Input.\";\r\n }\r\n\r\n}", "title": "" }, { "docid": "97784b95d47dc760938af5f45d4be0c7", "score": "0.60493517", "text": "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "title": "" }, { "docid": "253e5e468abf3361d83a547a2871fbfd", "score": "0.6047034", "text": "static formatDateDDMMYYYY(date) {\n if(Common.isNullOrUndifined(date)) return \"\";\n try {\n return moment(date).format(\"DD/MM/yyyy\");\n } catch (error) {\n console.log(\"formatDateDDMMYYYY\\n\" + error);\n }\n }", "title": "" }, { "docid": "48e9aa05aa4042cbc22104e84c7af3b6", "score": "0.6044665", "text": "function convertToNatural(date){\n var natDate\n\n\nday=date.getDate();\n year=date.getFullYear();\n\n month=date.getMonth()\n switch(month){\n case 0:\n month=\"january\"\n break;\n case 1:\n month=\"february\"\n break;\n \n case 2:\n month=\"march\"\n break;\n \n case 3:\n month=\"april\"\n break;\n \n case 4:\n month=\"may\"\n break;\n \n case 5:\n month=\"june\"\n break;\n \n case 6:\n month=\"july\"\n break;\n \n case 7:\n month=\"august\"\n break;\n \n case 8:\n month=\"september\"\n break;\n \n case 9:\n month=\"october\"\n break;\n \n case 10:\n month=\"november\"\n break;\n \n case 11:\n month=\"december\"\n break;\n }\n natDate=month + ' '+ day + ',' + year\n \n return natDate}", "title": "" }, { "docid": "f4da33afa2c9b72ca82e26c54694ad52", "score": "0.6034015", "text": "function translate( int ) {\n\t var year = Math.floor( int / 12 ) + 2000;\n\t var month = int % 12 + 1;\n\t if ( month < 10 ) {\n\t month = '0' + month;\n\t }\n\n\t return year + '-' + month + '-01';\n\t}", "title": "" }, { "docid": "01de70292d35ce348904e5b6c1c6508f", "score": "0.6033684", "text": "function ChangeDateFormat(jsondate) {\n if (jsondate == null) {\n jsondate = \"\";\n return jsondate;\n }\n jsondate = jsondate.replace(\"/Date(\", \"\").replace(\")/\", \"\");\n if (jsondate.indexOf(\"+\") > 0) {\n jsondate = jsondate.substring(0, jsondate.indexOf(\"+\"));\n }\n else if (jsondate.indexOf(\"-\") > 0) {\n jsondate = jsondate.substring(0, jsondate.indexOf(\"-\"));\n }\n\n var date = new Date(parseInt(jsondate, 10));\n var month = date.getMonth() + 1 < 10 ? \"0\" + (date.getMonth() + 1) : date.getMonth() + 1;\n var currentDate = date.getDate() < 10 ? \"0\" + date.getDate() : date.getDate();\n return month + \"/\" + currentDate + \"/\" + date.getFullYear();\n }", "title": "" }, { "docid": "accdc49d3200419cf9d8a8165e012825", "score": "0.60336655", "text": "function displayDate(dateInJson){\n let date = new Date(dateInJson);\n return date.getDate() + \"/\" + (date.getMonth() + 1);\n }", "title": "" }, { "docid": "ec026098d14e76e67d4aa3397f64c76a", "score": "0.6030791", "text": "function addZero(typeOfDate, date) {\n if (date < 10) {\n if (typeOfDate === 'day') {\n return '0' + date;\n } else if (typeOfDate === 'month') {\n return '0' + (date + 1);\n }\n }\n return date;\n }", "title": "" }, { "docid": "0e530642be499f99efb0753fee49254a", "score": "0.60277563", "text": "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "title": "" }, { "docid": "45978a1e5419d797b83b0515d981bc7b", "score": "0.60231996", "text": "function changeFormat(date){\n return (date.substr(6,4)+'-'+date.substr(3,2)+'-'+date.substr(0,2));\n}", "title": "" }, { "docid": "4d1f734da8a12c95803dcb1672c70cdf", "score": "0.6022065", "text": "displayDate(date) {\n if(!date) {\n date = new Date();\n }\n let\n dd = String(date.getDate()),\n mm = String(date.getMonth() + 1),\n yyyy = date.getFullYear()\n ;\n return `${mm}/${dd}/${yyyy}`;\n }", "title": "" }, { "docid": "491adf65b57cf808b72b1c6c3ce93ac1", "score": "0.6013806", "text": "formatDate(date) {\n return date.toString().substring(4, 15); // return just the month day and year\n }", "title": "" }, { "docid": "8e84a6458a0d26a47ecf1d7469f60b0b", "score": "0.60034585", "text": "function fromMMDDYYtoStandard(str)\n{\n\tif (typeof(authUser) != \"undefined\" && typeof(authUser.date_separator) != \"undefined\" && authUser.date_separator != \"\")\n\t\tdefaultDateSep = authUser.date_separator;\n\tstr = str.split(defaultDateSep);\n\tvar cc = \"\";\n\tif (parseInt(str[0],10) >= 0 && parseInt(str[0],10) <= 9)\n\t\tstr[0] = \"0\" + parseInt(str[0],10);\n\tif (parseInt(str[1],10) >= 0 && parseInt(str[1],10) <= 9)\n\t\tstr[1] = \"0\" + parseInt(str[1],10);\t\n\tif (str[2].length <= 2)\n\t\tcc = (parseInt(str[2],10) > centuryTurnOver)?\"19\":\"20\";\n\treturn (cc + str[2] + defaultDateSep + str[0] + defaultDateSep + str[1]);\n}", "title": "" }, { "docid": "419b8d3039f6369f1edbc53f286c5e26", "score": "0.6003435", "text": "function formatDate (d) {\n // getMonth starts from 0\n return parseInt([d.getFullYear(), d.getMonth() + 1, d.getDate()].map(function(n) {\n return n.toString().rjust(2, '0');\n }).join(''), 10);\n }", "title": "" }, { "docid": "5ac338bc30c8db4bc346acf2d14c00c4", "score": "0.6001947", "text": "function formatDateToInput(date = new Date()) {\n let month = String(date.getMonth() + 1);\n let day = String(date.getDate());\n const year = String(date.getFullYear());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return `${year}-${month}-${day}`;\n}", "title": "" }, { "docid": "badeee7d56f3bbf4ca6bbb05045e110c", "score": "0.5994334", "text": "renderDate(date){\n const beerDate = new Date(date);\n const month = beerDate.getMonth();\n const day = beerDate.getDay();\n const year = beerDate.getFullYear()\n\n return `${month}/${day}/${year}`\n }", "title": "" }, { "docid": "471b1338b9727dec123a729939d283dd", "score": "0.59910667", "text": "function obter_data_atual()\r\n\t{\r\n\t\thoje = new Date();\r\n\t\tdia = hoje.getDate();\r\n\t\tmes = hoje.getMonth();\r\n\t\tano = hoje.getFullYear();\r\n\t\t\r\n\t\tif (dia < 10)\r\n\t\t dia = \"0\" + dia\r\n\t\t\r\n\t\tif (ano < 2000)\r\n\t\t ano = \"19\" + ano\r\n\r\n\t\t//O mes começa em Zero, então soma-se 1\r\n\t\treturn (dia+\"/\"+(mes+1)+\"/\"+ano);\r\n\t}", "title": "" }, { "docid": "f100613d1a4285e6ab3299cbdf201ad0", "score": "0.59892225", "text": "function changeFormatDate(d){\n annee=d.getFullYear();\n mois=d.getMonth()+1;\n jour=d.getDate()\n return (annee+'-'+mois+'-'+jour);\n \n}", "title": "" }, { "docid": "557638b7307ce68c114afcecd8825526", "score": "0.5961995", "text": "function changeDateFormat(jsondate) {\n jsondate = jsondate.replace(\"/Date(\", \"\").replace(\")/\", \"\");\n if (jsondate.indexOf(\"+\") > 0) {\n jsondate = jsondate.substring(0, jsondate.indexOf(\"+\"));\n }\n else if (jsondate.indexOf(\"-\") > 0) {\n jsondate = jsondate.substring(0, jsondate.indexOf(\"-\"));\n }\n\n var date = new Date(parseInt(jsondate, 10));\n var month = date.getMonth() + 1 < 10 ? \"0\" + (date.getMonth() + 1) : date.getMonth() + 1;\n var currentDate = date.getDate() < 10 ? \"0\" + date.getDate() : date.getDate();\n\n return currentDate + \"/\" + month + \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "e11ee62cdc3baf6aeeda49cc12327758", "score": "0.5961847", "text": "l2fDate() {\n return `${this.billDate.getFullYear()}-${this.billDate.getMonth()+1}-${this.billDate.getDate()}`;\n }", "title": "" }, { "docid": "f7a6353cf74523834090914adb44c531", "score": "0.5960754", "text": "function dataAtual() {\r\n\r\n let hoje = new Date()\r\n var dd = hoje.getDate()\r\n var mm = hoje.getMonth() + 1 //January is 0!\r\n var yyyy = hoje.getFullYear()\r\n\r\n if (dd < 10) {\r\n dd = '0' + dd\r\n }\r\n\r\n if (mm < 10) {\r\n mm = '0' + mm\r\n }\r\n\r\n hoje = dd + '/' + mm + '/' + yyyy\r\n\r\n return (hoje)\r\n\r\n }", "title": "" }, { "docid": "876cbc6356273d94fe784fdbcf9e9d14", "score": "0.59565693", "text": "function yyyymmdd(dateIn) {\r\n var yyyy = dateIn.getFullYear();\r\n var mm = dateIn.getMonth()+1; // getMonth() is zero-based\r\n var dd = dateIn.getDate();\r\n return String(10000*yyyy + 100*mm + dd); // Leading zeros for mm and dd\r\n}", "title": "" }, { "docid": "a97f82565e70965fdfb3610f232b9592", "score": "0.59541625", "text": "formatDate(date){\n\n var dd = date.getDate();\n var mm = date.getMonth()+1;\n var yyyy = date.getFullYear();\n if(dd<10) {dd='0'+dd}\n if(mm<10) {mm='0'+mm}\n date = yyyy+'-'+mm+'-'+dd;\n return date\n }", "title": "" }, { "docid": "89253a026226cf8be86d4a1488c4d447", "score": "0.5942805", "text": "function convertDate (d: Date): number {\n const year = d.getFullYear()\n\n if (year < 1980) {\n return (1 << 21) | (1 << 16)\n }\n return ((year - 1980) << 25) | ((d.getMonth() + 1) << 21) | (d.getDate() << 16) |\n (d.getHours() << 11) | (d.getMinutes() << 5) | (d.getSeconds() >> 1)\n}", "title": "" }, { "docid": "464247a456a7e9c264426d202cc28812", "score": "0.59366596", "text": "function convertirFecha(fecha){\n \n if( !fecha )\n return \"\";\n \n var dia = fecha.getDate();\n var mes = fecha.getMonth();\n var año = fecha.getFullYear();\n \n if(!dia || !año)\n return \"\";\n \n return dia+\"/\"+(mes+1)+\"/\"+año;\n}", "title": "" }, { "docid": "1a7e947d5c985ec88f08c5c3536da0b0", "score": "0.59297794", "text": "function dateConvertToMMDD(A){if(A!=\"\"){var C=A.substring(0,2);\nvar D=A.substring(3,5);\nvar B=A.substring(6,10);\nA=D+\"/\"+C+\"/\"+B;\n}return A;\n}", "title": "" }, { "docid": "0c4ab971991afff8df5755293e9e2d39", "score": "0.5928322", "text": "static customFormatter (date) {\n // between 2000 and 3000\n if (date > 20000000 && date < 30000000) {\n const dateString = `${date}`;\n const yearString = dateString.substr(0, 4);\n const monthString = dateString.substr(4, 2);\n const dayString = dateString.substr(6, 2);\n\n const customDate = new Date();\n customDate.setMonth(parseInt(monthString)-1);\n\n const month = customDate.toLocaleString('de-de', { month: 'long' });\n return `${parseInt(dayString)}. ${month} ${yearString}`;\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "57136219a3810b37f528fab4744c9353", "score": "0.5903803", "text": "function getYYYYMMDD (date) {\n let yyyy = date.getFullYear().toString();\n let mm = (date.getMonth()+1).toString();\n let dd = date.getDate().toString();\n return yyyy + '-' + padWithZeroes(mm) + '-' + padWithZeroes(dd);\n }", "title": "" }, { "docid": "419642698bc8786d126afc0571df7e95", "score": "0.59002995", "text": "function getFormattedDate (date) {\n return date.getFullYear()\n + \"-\"\n + (\"0\" + (date.getMonth() + 1)).slice(-2)\n + \"-\"\n + (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "060fb2a55ee094b9188c3a23fcb43629", "score": "0.58938", "text": "function beautifyDate(date) {\n let newDate = new Date(date);\n return newDate.getDate() + '/' + (newDate.getMonth() + 1) + '/' + newDate.getFullYear();\n}", "title": "" }, { "docid": "c8118406f3cd7b1bd831634d3ee56466", "score": "0.5882756", "text": "function formatDate(){\n var date = \"20th Oct, 2015\";\n console.log(new Date(date.replace(/(\\d+)(st|nd|rd|th)/, \"$1\")).toISOString().slice(0, 10));\n}", "title": "" }, { "docid": "1ae9611646dc2044e41c43cbac1747bd", "score": "0.588206", "text": "function get_format_date(orig_val){\n return (new Date(Date.parse(orig_val))).toLocaleDateString()\n }", "title": "" }, { "docid": "7959476c367f55d23fcd30276dbbf48b", "score": "0.5878998", "text": "function formatDate(date) {\n const padAndConvert = i => {\n return (i < 10 ? '0' : '') + i.toString();\n };\n\n const year = date.getFullYear().toString();\n // Months are 0-based, but days aren't.\n const month = padAndConvert(date.getMonth() + 1);\n const day = padAndConvert(date.getDate());\n\n return `${year}-${month}-${day}`;\n}", "title": "" }, { "docid": "1f85c90c50f6e3219a20b5bd721b12d3", "score": "0.5878533", "text": "function formatDate(date){\n return <span className=\"date\">{date.slice(0,10)} at {date.slice(11,19)}</span>\n }", "title": "" }, { "docid": "68f3a994112259a779a478365a0b978a", "score": "0.5877665", "text": "YY(date, _, forcedYear) {\n // workaround for < 1900 with new Date()\n const y = this.YYYY(date, _, forcedYear) % 100;\n return y > 0 ? Object(format[\"d\" /* pad */])(y) : '-' + Object(format[\"d\" /* pad */])(Math.abs(y));\n }", "title": "" }, { "docid": "85ffd8261616c357be046be0c876fb9d", "score": "0.5875265", "text": "formatDate(date) {\n date = new Date(date);\n date = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n return date;\n }", "title": "" }, { "docid": "618a15b5b19abf8d825c86ecba5eaa27", "score": "0.5873337", "text": "dateConvert(d) {\n\t\tlet newDate = new Date(d);\n\t\t\n\t\tnewDate = new Date(newDate.setTime(newDate.getTime() + 1 * 86400000));\n\n\t\tconst date = newDate.toDateString();\n\n\t\treturn date;\n\t}", "title": "" }, { "docid": "973278a01ff6d03721f9e024103a7db8", "score": "0.58715135", "text": "function cal_generate_date (dt_date) {\r\n\treturn (\r\n\t\tnew String (\r\n\t\t\t(dt_date.getDate() < 10 ? '0' : '') + dt_date.getDate() + \"/\"\r\n\t\t\t+ (dt_date.getMonth() < 9 ? '0' : '') + (dt_date.getMonth() + 1) + \"/\"\r\n\t\t\t+ dt_date.getFullYear()\r\n\t\t)\r\n\t);\r\n}", "title": "" }, { "docid": "dca64e7062427c5c1a2563e73af79d35", "score": "0.5870552", "text": "function convertDate(dayOfEl){\n var date = new Date(dayOfEl*1000);\n forecastDay = date.getMonth()+'/'+ date.getDate() +'/'+ date.getFullYear();\n return forecastDay;\n }", "title": "" }, { "docid": "ae0f9e60fa21c8113af9f7f90b6b132c", "score": "0.586752", "text": "function sfDateFormat(dateString){\n var myDate = new Date(dateString);\n var YYYY = myDate.getUTCFullYear();\n var MM = myDate.getUTCMonth()+1;\n var DD = myDate.getUTCDate();\n \n if(MM>=10){\n MM = MM;\n } else{\n MM = \"0\"+MM;\n }\n if(DD>=10){\n DD = DD;\n } else{\n DD = \"0\"+DD;\n }\n //console.log(MM);\n var formatedDate = MM+\"/\"+DD+\"/\"+YYYY;\n return formatedDate;\n }", "title": "" }, { "docid": "f64ba5922f7cf2dc99b04b64fe085c38", "score": "0.58621067", "text": "function formatDate (d) {\n // getMonth starts from 0\n return parseInt([d.getFullYear(), d.getMonth() + 1, d.getDate()].map(function(n){\n return rjustString(n.toString(), 2, '0');\n }).join(''));\n }", "title": "" }, { "docid": "4d88ef648787bbbec1836a98337dd102", "score": "0.5855215", "text": "function formatDate(dateValue){\n let day = dateValue.getDate();\n let month = dateValue.getMonth() + 1;\n let year = dateValue.getFullYear();\n if(day < 10){\n day = `0${day}`;\n } \n if(month < 10){\n month = `0${month}`;\n }\n return `'${year}-${month}-${day}'`\n}", "title": "" }, { "docid": "084d04e613d223bb92b757137f1a4bcf", "score": "0.58548", "text": "function makeYYMMDD() {\n var YYMMDD = new Date().toISOString().substring(2, 10).replace(/-/g, '');\n return YYMMDD;\n}", "title": "" }, { "docid": "0f03f137c088cbceed880e28703f6fce", "score": "0.585107", "text": "function date_apple_cleanse(input) {\n return input.replace(/ /g, 'T');\n}", "title": "" }, { "docid": "0f03f137c088cbceed880e28703f6fce", "score": "0.585107", "text": "function date_apple_cleanse(input) {\n return input.replace(/ /g, 'T');\n}", "title": "" }, { "docid": "8783c2e90c6101754c8070443b1654c0", "score": "0.5846963", "text": "function unwrapDate(date) {\n return typeof date === 'number' ? date : date.valueOf();\n }", "title": "" }, { "docid": "3915e27be0d113545ccd84e828b7cd62", "score": "0.5846841", "text": "static formatDate (date) {\n let tokens = date.toString().split(' ')\n return `${ tokens[2] }-${ tokens[1] }-${ tokens[3] % 100 }`\n }", "title": "" }, { "docid": "7ae1fcc357b87efe97b1c6d7a4bde5b7", "score": "0.5846364", "text": "function formatDate(date) {\n var reviewDate = new Date(new Date(date).getTime());\n var day = reviewDate.toString().substring(8, 10);\n if(day.charAt(0) === '0'){\n day = day.charAt(1);\n }\n var month = reviewDate.toString().substring(4, 7);\n var time = reviewDate.toString().substring(16, 21);\n $scope.review.date = day + ' ' + month + ' ' + time;\n }", "title": "" }, { "docid": "b355c0af99a90014a94bbcc85aa6ec66", "score": "0.58461523", "text": "function fromDDMMYYtoStandard(str)\n{\n\tif (typeof(authUser) != \"undefined\" && typeof(authUser.date_separator) != \"undefined\" && authUser.date_separator != \"\")\n\t\tdefaultDateSep = authUser.date_separator;\n\tif (str)\n\t{\n\t\tstr = str.split(defaultDateSep);\n\t\tvar cc = \"\";\n\t\tif (parseInt(str[0],10) >= 0 && parseInt(str[0],10) <= 9)\n\t\t\tstr[0] = \"0\" + parseInt(str[0],10);\n\t\tif (parseInt(str[1],10) >= 0 && parseInt(str[1],10) <= 9)\n\t\t\tstr[1] = \"0\" + parseInt(str[1],10);\t\t\n\t\tif (str[2].length <= 2)\n\t\t\tcc = (parseInt(str[2],10) > centuryTurnOver)?\"19\":\"20\";\n\t\treturn (cc + str[2] + defaultDateSep + str[1] + defaultDateSep + str[0]);\n\t}\n\telse\n\t\treturn \"\";\n}", "title": "" }, { "docid": "fe29f8593177035f633cb9b64ae4c404", "score": "0.5845552", "text": "function getFormatDate(date) {\n\t\t\treturn date.getFullYear() + '-' + (parseInt(date.getMonth()) + 1) + '-' + date.getDate();\n\t\t}", "title": "" }, { "docid": "163aaaf493a3b54d941a9e7f103b94c5", "score": "0.5834147", "text": "function formateDate(dateToBeFormated) {\n var date = new Date(dateToBeFormated);\n var year = date.getFullYear();\n var month = (date.getMonth() + 1).toString().padStart(2, \"0\"); //padStart()is the new method of ES6, which is set the length of the string, the insufficient part will be supplemented with the second parameter\n var day = date.getDate().toString().padStart(2, \"0\");\n \n return `${year}-${month}-${day}`; \n}", "title": "" }, { "docid": "a8d24bbc4675ec82eda90ab41afa8362", "score": "0.5822939", "text": "function convertDateToString() {\n const day = props.foundJob.date.toDateString().split(\" \").slice(0, 3).join(\" \");\n let time = props.foundJob.date.toLocaleString().split(\"\").slice(10).join(\"\").split('');\n time.splice(3, 3);\n return time.join('') + \" \" + day;\n }", "title": "" }, { "docid": "777c8aac57b41d096df0cf939d1a3e60", "score": "0.5811004", "text": "function decompressDate(text) {\n\treturn +('1' + decompressNumber(text) + '00000');\n}", "title": "" } ]
4ba252a612deb87fea14e2048bf97db3
Description: Adds a message to the msg bar Parameters: message the message to be displayed
[ { "docid": "472ffaa9692f472a38c2e6af41b38d1b", "score": "0.68171984", "text": "function addMsg(message) {\n msg.empty();\n msg.append(message);\n}", "title": "" } ]
[ { "docid": "88efbd404a414b61aaf152aada3ef944", "score": "0.7586631", "text": "function set_message( msg ) {\n set_text( '.lbl_message', msg );\n}", "title": "" }, { "docid": "fde99203bc0ec89ee9e61683824b667a", "score": "0.74126244", "text": "function addMessage(msg) {\n appendMessage(msg);\n scrollDown();\n}", "title": "" }, { "docid": "fde99203bc0ec89ee9e61683824b667a", "score": "0.74126244", "text": "function addMessage(msg) {\n appendMessage(msg);\n scrollDown();\n}", "title": "" }, { "docid": "988024b8ae7c3303b77cc0439a0cecf7", "score": "0.73611146", "text": "function message(msg) {\n $message.text(msg);\n }", "title": "" }, { "docid": "4a852e19e3bd341f45103629219c822b", "score": "0.72489804", "text": "function showMsg(msg) {\n}", "title": "" }, { "docid": "f070384248978c009e3c75fd44ecfee6", "score": "0.7136541", "text": "function message (msg, callback) { ui.message (msg, callback); }", "title": "" }, { "docid": "d53befe0a49441c608f47ca6cb01e3cf", "score": "0.7106837", "text": "function showStatusMessage(message) {\r\n const { msTimeValue } = generateTimestamp();\r\n extension_1.output.appendLine(`[${msTimeValue}] - ${message}`);\r\n}", "title": "" }, { "docid": "c84f44bdffce05c9066121a095a48a89", "score": "0.70925653", "text": "printToChat(message) {\r\n // print this message to the chat\r\n chatBox.value += message + '\\n';\r\n }", "title": "" }, { "docid": "64adbf2724ac8420aff473caac9fb2cf", "score": "0.7037876", "text": "function showMessageDialog(message) {\n\t\tvar content = showDialog();\n\t\tcontent.html(message + \"<br/>\");\n\t}", "title": "" }, { "docid": "aa044b82f93129cfe406c6318061eaf4", "score": "0.7034282", "text": "function UIfeedback(msg){\n\t\tdocument.getElementById(\"message\").innerHTML = msg\n\t\t}", "title": "" }, { "docid": "16d55c7f9e252ef1510b4380461c0a32", "score": "0.7019559", "text": "function message(msg){\n\tconsole.log(msg)\n\tboard.messages.add(msg)\n}", "title": "" }, { "docid": "abfa899ebe8d277fa4bb49a007967a0c", "score": "0.7018089", "text": "displayMessage(message) {}", "title": "" }, { "docid": "516c7c6165ce87e2c27cbe7fde12490b", "score": "0.6992287", "text": "function setMessage(msg) {\n message.innerHTML = msg;\n} // end function", "title": "" }, { "docid": "5ab9073a7437e3213eb0bded924a6abd", "score": "0.6984774", "text": "function showMessage(msg) {\n\t\t$message.html(msg).show();\n\t}", "title": "" }, { "docid": "1d0ec4bbe0a27f918a40c16117c1e5d3", "score": "0.6983103", "text": "log(message){\n\t\t\tlet p = document.createElement('p');\n\t\t\tp.innerHTML = message;\n\t\t\tactionBox.prepend(p);\n\t\t}", "title": "" }, { "docid": "e4dbbfdba94a56bba1c644060886c7b7", "score": "0.69818646", "text": "showStaticToolbarMessage(text){\n this.showMessage({\n static: true,\n text: text\n });\n }", "title": "" }, { "docid": "573381ef335c91a01dca1327f858ccd2", "score": "0.69204354", "text": "function displayMessage(message) {\n alert(`Na ten ${name} ${message} wyslany kod`);\n}", "title": "" }, { "docid": "d71ca89562b364c808f148eca86bceae", "score": "0.6915562", "text": "function addDialogMessage(message) {\n\t\t$('#magiccontent').append(message + \"<br/>\");\n\t}", "title": "" }, { "docid": "e8cd47b14337075ea214418028e7d122", "score": "0.6869017", "text": "function msg(id,message){\n $(id).text(message).show;\n }", "title": "" }, { "docid": "a3ac31627b3e0ee0514030045071c68a", "score": "0.6834518", "text": "function displayMessage(message) {\n $('#message').text(message).show();\n }", "title": "" }, { "docid": "a1c3265393a7b140abf248a89cd543c2", "score": "0.68279177", "text": "function setMessage( message )\r\n{\r\n\tif ( message )\r\n\t{\r\n\t\t$( '#message' ).html( message ).show();\r\n\t}\r\n}", "title": "" }, { "docid": "807c8a7baa20fbe67ee025c84237a045", "score": "0.68278027", "text": "infoMsg(message) {\n alert(`\n Testo messaggio: ${message.text}\n Data messaggio: ${message.date}`);\n message.menuShow = false;\n }", "title": "" }, { "docid": "8497820486c31f38c63d5f81762debc9", "score": "0.6826007", "text": "function displayMessage(text){\n}", "title": "" }, { "docid": "e8baf0dff0b4ef5d90113a9a08db5ba0", "score": "0.6810564", "text": "function Message(value : String) {\n\tif (value == \"MainMenu\") {\n\t\tApplication.LoadLevel(\"MainMenu\");\n\t} else if (value == \"HUDPause\") {\n\t\tApplication.LoadLevel(\"HUD_Pause\");\n\t} else {\n\t\tprint(\"ERROR: The message: \" + value + \" is not recognized. See the Message function in OtherElements.js\");\n\t}\n}", "title": "" }, { "docid": "d682e4d99eeb87a5609049ee700b4405", "score": "0.68017787", "text": "function showMsg (title, msg) {\n\t$.messager.show({\n\t\ttitle: title,\n\t\ttimeout:5000,\n\t\tmsg: msg\n\t});\n}", "title": "" }, { "docid": "d682e4d99eeb87a5609049ee700b4405", "score": "0.68017787", "text": "function showMsg (title, msg) {\n\t$.messager.show({\n\t\ttitle: title,\n\t\ttimeout:5000,\n\t\tmsg: msg\n\t});\n}", "title": "" }, { "docid": "abd9df5a40195f82d51920b8c24fe895", "score": "0.6790204", "text": "function addMessage ( item,key,message ) {\n if (item.visible) {\n if (msg.length>0)\n msg += '<br>';\n var id = key;\n if ('reportas' in item) id = item.reportas;\n else if ('label' in item) id = item.label;\n else if ('keyword' in item) id = item.keyword;\n msg += '<b>' + id + ':</b> ' + message;\n }\n }", "title": "" }, { "docid": "dcc1a0817da62daad961631683c13309", "score": "0.6784939", "text": "function displayMessage(msg) {\r\n\tdisplayMessageOrErr(msg, false);\r\n}", "title": "" }, { "docid": "034f5373e8ae9ab3c7d75d94f9d5ceea", "score": "0.6780566", "text": "function showMassage(message) {\n document.getElementById(\"message\").textContent = message;\n}", "title": "" }, { "docid": "3b22f3f5bd1965db1877d45aa8c29788", "score": "0.67691815", "text": "function displayMessage(text) {\n // set text\n messageElement.innerHTML += text\n}", "title": "" }, { "docid": "ffe6f40d1309e2b5bcb292be37cc677f", "score": "0.6763576", "text": "function displayMessage(msg) {\n $('#msg').css(\"display\", \"block\");\n $('#msg').html('<div class=\"alert alert-warning alert-dismissible fade show\" role=\"alert\">' + msg + ' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></div>');\n}", "title": "" }, { "docid": "57b4550adf5eda99badd7cca739ad3e7", "score": "0.6763343", "text": "function ShowMessage(mesTitle, mesContent, type) {\n $.msgBox({\n title: mesTitle,\n content: mesContent,\n type: type,\n autoClose: false\n });\n}", "title": "" }, { "docid": "8dd4436616d27dbc3870f698a4193d3d", "score": "0.67581785", "text": "displayMessage(text) {\n this.message.text = text;\n this.message.visible = true;\n }", "title": "" }, { "docid": "e638e8c4a86b4f28ac23d3e54472b36f", "score": "0.6732622", "text": "function gameMessage(parameterMsg)\n {\n $(\"#boardmessage\").text(parameterMsg)\n }", "title": "" }, { "docid": "451626f82bc08d28be458fed347226f5", "score": "0.6725976", "text": "showDynamicToolbarMessage(listMessages = []){\n this.showMessage({\n static: false,\n text: listMessages\n });\n }", "title": "" }, { "docid": "b7835852ee87d1486c944b96eac8eeb6", "score": "0.6713905", "text": "function write(message) {\n document.getElementById('message').innerText += message;\n }", "title": "" }, { "docid": "b7835852ee87d1486c944b96eac8eeb6", "score": "0.6713905", "text": "function write(message) {\n document.getElementById('message').innerText += message;\n }", "title": "" }, { "docid": "85e3384bedba3bc2ed500b7b4632c4ed", "score": "0.6708667", "text": "function addMessage( message ) {\n if ( self.element ) test_elem.appendChild( $.html( self.html.message, message ) );\n results.details[ package_path + '.' + test.name ] = message;\n }", "title": "" }, { "docid": "b9951e5ccc3f946128c1bd65be068e24", "score": "0.6708041", "text": "function showMsg(msg)\r\n{\r\n\tshowMsg2(msg, true);\r\n}", "title": "" }, { "docid": "42948fcf3aed3cf43ea913bbc819c927", "score": "0.67065245", "text": "function displayMessage(msg) {\n $('#msg').html('<div class=\"alert alert-warning\">' + msg + '</div>');\n}", "title": "" }, { "docid": "a5b19beed903371b8aab931652b6c386", "score": "0.67061013", "text": "function addToMsg(msg) {\n msgElement.innerHTML = msg;\n}", "title": "" }, { "docid": "1e8dcb74dc761d3e24cabc3d5c28a207", "score": "0.67033726", "text": "function displayMessage(message){\r\n\t\t$('<div>'+message+'</div>').dialog({modal:true, dialogClass:'pexeto-dialog', buttons: {\r\n\t\t\t\"Close\": function() {\r\n\t\t\t\t$( this ).dialog( \"close\" ).remove();\r\n\t\t\t}\r\n\t\t}});\r\n\t}", "title": "" }, { "docid": "5e6947740106e1a07ef1571d5007ee5d", "score": "0.67017573", "text": "function displayMessage(selectionMessage){\n message.innerHTML = selectionMessage;\n }", "title": "" }, { "docid": "923d5c153b9ac6f738b0969881c51570", "score": "0.6696349", "text": "function displayMessage(message){\n\t\talert(message);\n\t}", "title": "" }, { "docid": "1811dd6b9c554b9b02c4f746cd413759", "score": "0.668996", "text": "function showMessage(message){\n console.log(message);\n}", "title": "" }, { "docid": "df2a6970bc1e547797288c88c7f20ce7", "score": "0.6686191", "text": "function displayMessage(msg) {\r\n $('#msg').html('<div class=\"alert alert-warning\">' + msg + '</div>');\r\n}", "title": "" }, { "docid": "df2a6970bc1e547797288c88c7f20ce7", "score": "0.6686191", "text": "function displayMessage(msg) {\r\n $('#msg').html('<div class=\"alert alert-warning\">' + msg + '</div>');\r\n}", "title": "" }, { "docid": "1266b99624a785e3951cd26c98481266", "score": "0.66857076", "text": "function addMessage( message ) {\n if ( self.element ) test_elem.appendChild( self.ccm.helper.html( my.html.message, message ) );\n results.details[ package_path + '.' + tests[ i ].name ] = message;\n }", "title": "" }, { "docid": "54b8154ca9f9a25c8e2e85a69790f312", "score": "0.668058", "text": "function showUIMsg(msg)\n{\n\t$.blockUI({\n\t\tmessage: msg,\n\t\tcss: {\n\t\t\t\tborder: 'none',\n\t\t\t\tpadding: '15px',\n\t\t\t\tfontSize: '12px',\n\t\t\t\tbackgroundColor: '#000000',\n\t\t\t\t'-webkit-border-radius': '10px',\n\t\t\t\t'-moz-border-radius': '10px',\n\t\t\t\topacity: '1',\n\t\t\t\tcolor: '#ffffff'\n\t\t},\n\t\toverlayCSS: { backgroundColor: '#000000' }\n\t});\n\n\tsetTimeout($.unblockUI, 2000);\n}", "title": "" }, { "docid": "bf282b78f6965cf0a5c9fceb6eb99671", "score": "0.667727", "text": "function setMessage(message) {\n $('#message').text(message);\n}", "title": "" }, { "docid": "a94aaa6cdbb60617a721ba5258a5a84e", "score": "0.6675551", "text": "function status_msg(msg)\n{\n\t\tdocument.getElementById(\"status-msg\").innerHTML = msg;\n}", "title": "" }, { "docid": "4fac0010ee60aa0009a77f4a96f60d3d", "score": "0.6671873", "text": "displayMessage(message) {\n $('.communicate').text(message);\n }", "title": "" }, { "docid": "201154e251b1a5123b0d7c4a414a6166", "score": "0.66666985", "text": "function displayMessage(message){\r\n\t\treturn $(\"#message\").text(message);\r\n\t}", "title": "" }, { "docid": "ed5f13c741ad69791d640130a61312f5", "score": "0.6660185", "text": "function displayMessage(message) {\n const div = document.createElement(\"div\");\n div.innerText = message;\n document.body.appendChild(div);\n}", "title": "" }, { "docid": "51e01f24dd5c06b4946627d8791bdf6f", "score": "0.6658762", "text": "function showMessage(message){\n\tdocument.getElementById('message').innerHTML = message;\n}", "title": "" }, { "docid": "1f0d07800b7872247e7c710f89d0a077", "score": "0.665758", "text": "function showMessage (msg){\r\n\tdocument.getElementById(\"messagepar\").innerHTML = msg;\r\n}", "title": "" }, { "docid": "f695a2b45c12921266f5f10ae8b38a3f", "score": "0.6657098", "text": "function setMessage(msg) {\n document.getElementById(\"message\").innerHTML = msg;\n}", "title": "" }, { "docid": "7334c6b3fdbd3b1ab11886f21e40586d", "score": "0.6656839", "text": "function reportMsg (element, msg) {\n element.update (\"<br>\" + msg);\n element.setStyle ({display: 'block' });\n}", "title": "" }, { "docid": "87f0e533166b935cb15c714d574c7133", "score": "0.66537935", "text": "function writeMessage(message) {\n\t\ttext.setText(message);\n\t\tlayer.draw();\n\t}//end writeMessage", "title": "" }, { "docid": "47408dbfdec9f9d35ea1dd297530e7c8", "score": "0.66490644", "text": "function displayMessage(message) {\n $(\"#msg\").toggle();\n $(\"#msg\").html(message);\n }", "title": "" }, { "docid": "29ac23fe61d6c325bc66c7f240312e17", "score": "0.66350824", "text": "function msg(message){\n\tBrowser.msgBox(typeof message === 'object' ? message.join(', ') : message );\n}", "title": "" }, { "docid": "93d91769f5f09658380de7fef6a60e39", "score": "0.6612732", "text": "function showMsg(title, msg) {\n if($(\"#message\").length == 0 )\n $('body').append('<div id=\"message\"></div>');\n\n $('#message').attr('title', title);\n $('#message').html(msg);\n $('#message').dialog({resizable: false, modal: true, \n buttons: {\n \"Ok\": function() {\n $(this).dialog(\"close\");\n }\n }\n });\n}", "title": "" }, { "docid": "a4cad892e56d8d88f086141e7f3ba9c8", "score": "0.66087824", "text": "function displayMessage(message) {\n $('#message').text(message).show();\n}", "title": "" }, { "docid": "a4cad892e56d8d88f086141e7f3ba9c8", "score": "0.66087824", "text": "function displayMessage(message) {\n $('#message').text(message).show();\n}", "title": "" }, { "docid": "d4561d86bbe3f5701f8fbd7b5acf44fc", "score": "0.6602694", "text": "function displayMessage(type, message) {\n msgDiv.textContent = message;\n msgDiv.setAttribute(\"class\", type);\n }", "title": "" }, { "docid": "f639827c9923ed9c486fc78d4d50d409", "score": "0.6600606", "text": "function displayMessage(message) {\n document.getElementById('ui').innerHTML = message;\n}", "title": "" }, { "docid": "c88c31136d69a64ad163382b0c3865b1", "score": "0.6597419", "text": "function messagesMain() {\n var msgHandler = new Framework7();\n var $$ = Dom7;\n\n var messages = msgHandler.messages('.messages');\n var msgBar = msgHandler.messagebar('.messagebar');\n var currentMsg = \"\";\n\n $$('.messagebar').on('click', function () {\n currentMsg = msgBar.value().trim();\n msgBar.clear();\n messages.add\n\n messages.addMessage({\n text: currentMsg,\n name: \"Mateo\"\n\n }, \"append\", true);\n\n })\n\n}", "title": "" }, { "docid": "19edddfd731f932afb8400bfb32ad7f5", "score": "0.65933156", "text": "function show(msg) {\r\n const p = document.createElement(\"p\");\r\n p.appendChild(document.createTextNode(msg));\r\n document.body.appendChild(p);\r\n}", "title": "" }, { "docid": "85ae9b811d738a780a84c8aa1de3f528", "score": "0.6584815", "text": "function msg(message) {\r\n messages= document.getElementById(\"msg\");\r\n messages.innerHTML=\"It is \"+ player_name[message]+\" 's turn, please place a disk at any column !\";\r\n\r\n}", "title": "" }, { "docid": "c1ac276a432860ba9f39446183ac511e", "score": "0.658008", "text": "function displayMessage(type, message) {\n msgDiv.textContent = message;\n msgDiv.setAttribute(\"class\", type);\n}", "title": "" }, { "docid": "c1ac276a432860ba9f39446183ac511e", "score": "0.658008", "text": "function displayMessage(type, message) {\n msgDiv.textContent = message;\n msgDiv.setAttribute(\"class\", type);\n}", "title": "" }, { "docid": "8f66638141b1cdff5f05776a857978fb", "score": "0.6571883", "text": "function setMessage(msg, color) {\n displayMessage.textContent = msg; \n displayMessage.style.color = color;\n}", "title": "" }, { "docid": "48c00d5cdb9822e0e5f6cc2168722b29", "score": "0.6553236", "text": "function updateMessage(newMessage) {\n messageInd.textContent = String(newMessage); \n}", "title": "" }, { "docid": "12e99fdc4928697b3e3d9d3099e0dcb4", "score": "0.6552622", "text": "function ShowHelpMessage(message) {\n mp.game.ui.setTextComponentFormat('STRING');\n mp.game.ui.addTextComponentSubstringPlayerName(message);\n mp.game.ui.displayHelpTextFromStringLabel(0, false, true, -1);\n}", "title": "" }, { "docid": "7c86aa7eb02d3d36f562f244f7e1cc93", "score": "0.6547725", "text": "function muestraMsg2(msg, msgIco, msgClass_name){\n //muestra mensaje\n $.gritter.add({\n title: 'Examen Ingenia',\n text: msg,\n close_icon: 'l-arrows-remove s16',\n icon: msgIco,\n class_name: msgClass_name\n });\n}", "title": "" }, { "docid": "a0fc97d9e10069b73c1347dd56dcd925", "score": "0.65449935", "text": "function displayMainMessage (msg) {\n document.getElementById(\"MainMessageText\").innerHTML=msg;\n}", "title": "" }, { "docid": "af31163fa2afde20bb4a87fe36aa3ff9", "score": "0.65400445", "text": "function addMessage(msg, pseudo) {\n\t$(\"#chatEntries\").append('<label class=\"psuedo\">' + pseudo + \" : \" + '</label><p class=\"msg\">' + msg + '</p>');\n}", "title": "" }, { "docid": "8ba09f1f0f89cb13f02563fa78413750", "score": "0.653695", "text": "function showMessage(msg){\n $('#system_messages .content_message').text(msg);\n $('#system_messages')\n .animate({marginBottom: '20px'}, 100, \"linear\", function() {\n $('#system_messages').delay(2000).animate({marginBottom: '-200px'}, 100, \"linear\");\n });\n}", "title": "" }, { "docid": "f0eea274c2f7a8b7156483bdefa33cd4", "score": "0.6536929", "text": "function setMessage(msg){\r\n document.getElementById(\"message\").innerText = msg;\r\n}", "title": "" }, { "docid": "34502055710d160bbf5dd4ef955341d0", "score": "0.6536104", "text": "function writeMessage(message) {\n ///<summary>\n /// Displays a message or appends an element to the results area.\n ///</summary>\n var li = document.createElement(\"li\");\n if (typeof (message) == \"string\") {\n\n setText(li, message);\n\n }\n else {\n li.appendChild(message);\n }\n\n output.appendChild(li);\n}", "title": "" }, { "docid": "9856757f5118cf6e8fb65be08cc3d3d9", "score": "0.6532649", "text": "showControlMessage() {\n this.showMessage(this.controlMessage);\n }", "title": "" }, { "docid": "32d42ad2c4fe6c4c9495553a6d101fee", "score": "0.65303546", "text": "function displayMessage(msg) {\n document.getElementById(\"message\").innerHTML = msg;\n}", "title": "" }, { "docid": "31f5dda87e8356c3ea5a1d70e2fedda8", "score": "0.652792", "text": "function notify(msg) {\n const $err = document.getElementById('err');\n $err.innerHTML = msg;\n $err.style.display = 'block'\n }", "title": "" }, { "docid": "062d08a9f506c75d818e3315710ca76c", "score": "0.65269595", "text": "function showMessage(message) {\n humane.log(message, {\n timeoutAfterMove: 3000,\n waitForMove: true\n });\n}", "title": "" }, { "docid": "a025a0b814369775bfec8ddb82bb9217", "score": "0.6521624", "text": "function addMessage(text) {\n var newNode = document.createElement('p');\n newNode.innerHTML = text;\n _this.elText.appendChild(newNode);\n }", "title": "" }, { "docid": "54de6c4f15bf93b367834f8f9ff4b0b4", "score": "0.6519514", "text": "function application_notify_message(msg) {\n // Delete the old text\n var space_div = getById('log_space');\n var logtext = getById('log_space').childNodes[0];\n // logtext can be undefined when the app has just started for\n // example\n if(logtext != undefined)\n space_div.removeChild(logtext);\n // Create and append the new text\n space_div.appendChild(document.createTextNode(msg));\n}", "title": "" }, { "docid": "4ad4dd2b5c551d3a0a40790734ff55a0", "score": "0.6515956", "text": "function successMsg(msg) {\n setSuccessText(msg);\n showInfoText();\n}", "title": "" }, { "docid": "0d39b406a6ce9140e24875af6102951e", "score": "0.6498394", "text": "function print(msg)\n{\n $('#chat-messages').append('<div class=\"chat-update\"><span class=\"chat-text\" style=\"color:#ffd900;font-weight:bold\">' + msg + '</span></div>');\n}", "title": "" }, { "docid": "22c223aa48d002a6cbba62b72e15ab35", "score": "0.6495264", "text": "showMessage(button, message) {\r\n var messageId = this.__generateId(\"message\");\r\n this.message.setAttribute(\"id\", messageId);\r\n $(button).click( function() {\r\n $('#' + messageId).text(message);\r\n })\r\n }", "title": "" }, { "docid": "7a304027ffcb77324b878746bb348118", "score": "0.6491605", "text": "function updateMessage( msg ) {\r\n\t\t$('.visor').removeClass('pulse');\r\n\t\t$('.visor').removeClass('alert');\r\n\t\t$('.visor label').html( msg.toUpperCase() );\r\n\t}", "title": "" }, { "docid": "d2ed01433d5908073cef5721935cb3e8", "score": "0.6490508", "text": "showInfo(msg) {\n msg == null || msg == '' ? msg = 'Please provide a message' : msg ;\n this.get('notifications').info(msg, this.options);\n }", "title": "" }, { "docid": "b6ca49df15a7e9cbd280e338d3d5423c", "score": "0.64728177", "text": "function createMessageBar() { // Changed position and styling of message bar as well as added entry effects\n\t$('#idmain').append($('<div id=\"clxmessagebar\" class=\"bg-primary col-xs-12\" style=\"display:none;\">Autobuy Status</div>'));\n\t$('#clxmessagebar').slideDown('slow');\n}", "title": "" }, { "docid": "df13019dab99a6b962d4249e3bf37550", "score": "0.6465234", "text": "function addMessage(message) {\n document.getElementById('main').innerHTML += `<p>${message.text}</p>`;\n}", "title": "" }, { "docid": "3082432392fc40192f6737d9edc8f6a8", "score": "0.64549106", "text": "function _showErrorMessage(message) {\n showProgressBar();\n var $popup = editor.popups.get('filesManager.insert');\n var $layer = $popup.find('.fr-files-progress-bar-layer');\n $layer.addClass('fr-error');\n var $message_header = $layer.find('h3');\n $message_header.text(message);\n editor.events.disableBlur();\n $message_header.focus();\n }", "title": "" }, { "docid": "c6fc33906b4545a8e62212062083fdd2", "score": "0.64537984", "text": "function showMsg(data){\n\t$.messager.show({\n\t\ttitle:' ',\n\t msg: data,\n\t timeout:2000\n\t});\n}", "title": "" }, { "docid": "44c0555dcdc433bdf80347e8ee1721a2", "score": "0.644865", "text": "function callMessageDialog(title, messageContent){\n\t\t$(\"#messageDialog\").find(\"#messageContent\").text(messageContent);\n\t\t$(\"#messageDialog\").dialog({\n\t\t\tmodal: true,\n\t\t\tshow:{\n\t\t\t\teffect:\"blind\",\n\t\t\t\tduration: 500\n\t\t\t},\n\t\t\ttitle: title,\n\t\t\theight: 200,\n\t\t\twidth: 350,\n\t\t\thide: {\n\t\t\t\teffect: \"explode\",\n\t\t\t\tduration: 500\n\t\t\t},\n\t\t\tbuttons:{\n\t\t\t\t\"OK\": function(){\n\t\t\t\t\t$(\"#messageDialog\").dialog(\"close\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "44c0555dcdc433bdf80347e8ee1721a2", "score": "0.644865", "text": "function callMessageDialog(title, messageContent){\n\t\t$(\"#messageDialog\").find(\"#messageContent\").text(messageContent);\n\t\t$(\"#messageDialog\").dialog({\n\t\t\tmodal: true,\n\t\t\tshow:{\n\t\t\t\teffect:\"blind\",\n\t\t\t\tduration: 500\n\t\t\t},\n\t\t\ttitle: title,\n\t\t\theight: 200,\n\t\t\twidth: 350,\n\t\t\thide: {\n\t\t\t\teffect: \"explode\",\n\t\t\t\tduration: 500\n\t\t\t},\n\t\t\tbuttons:{\n\t\t\t\t\"OK\": function(){\n\t\t\t\t\t$(\"#messageDialog\").dialog(\"close\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "165e6d4d2f829bcc58ff15deea2129ca", "score": "0.64290994", "text": "function displayMessage(theme, icon, message) {\n const banner = `\n <div id=\"messenger\" class=\"slds-notify slds-notify_alert slds-theme_{theme}\" role=\"alert\" style=\"height:0px; line-height:0px; font-size:15px;\">\n <span class=\"slds-assistive-text\">{theme}</span>\n <span class=\"slds-icon_container slds-icon-utility-error slds-m-right_x-small\" title=\"Description of icon when needed\">\n <svg class=\"slds-icon slds-icon_x-small\" aria-hidden=\"true\">\n <use xlink:href=\"/assets/icons/utility-sprite/svg/symbols.svg#{icon}\"></use>\n </svg>\n </span>\n <h2>{message}</h2>\n </div>\n `\n $('#messenger').remove();\n $('#page-header').append(banner.replace('{theme}', theme).replace('{icon}', icon).replace('{message}', message));\n $('#messenger').animate({height:'54px', 'line-height':'18px'});\n setTimeout(function(){\n $('#messenger').animate({left:'100%'}, 'slow', function(){\n $('#messenger').remove();\n });\n }, 5000);\n}", "title": "" }, { "docid": "da6e4258aadb9f02c8008d8007aea816", "score": "0.64272064", "text": "function displayMessage(actionMessage) {\n\n $(\"#confirm-action\").modal();\n $(\"#custom-Action-Message\").text(actionMessage);\n\n}", "title": "" }, { "docid": "b9594c7912a01ebdf77635d5a2a31f84", "score": "0.64264464", "text": "function showMsg(msg) {\n msg = toStr(msg)\n msg = addNDNT(msg)\n console.log(msg)\n}", "title": "" } ]
8eed56f642199ebb9f36738c2387fe43
[UNDOCUMENTED]: mutation is an array (to deprecate)
[ { "docid": "31b053cf31041251e4ce7148a9507095", "score": "0.58560616", "text": "function generateMutatorFromArray(mutagen,mutationArray) {\n var rawAction = mutationArray[0];\n if ( (!rawAction) || (!rawAction.apply) )\n return error ('Invalid mutation: the first element in an async mutation shall be a function');\n var fnArgs = []; // other elements are state changes\n for (var i = 1; i < mutationArray.length; ++i) {\n fnArgs.push(generateMutator(mutagen,mutationArray[i]));\n }\n return function () { // (...arguments)\n var res = rawAction.apply(this, arguments);\n if (res && res.apply) {\n res.apply(this, fnArgs);\n }\n };\n}", "title": "" } ]
[ { "docid": "127dc06296c402e187fa4194a372eff9", "score": "0.8023303", "text": "function mutation(arr) {\n return arr;\n}", "title": "" }, { "docid": "2fab8374d5726b0b60e924e33eb133da", "score": "0.69181484", "text": "function arrMutationValueTypes(arr) {\n arr[0] = 100;\n}", "title": "" }, { "docid": "5d5e43b7862f0ec3fae1f31b4a8061d1", "score": "0.68301845", "text": "function arrMutationReferenceTypes(arr) {\n arr[0].name = \"Charlie\"\n}", "title": "" }, { "docid": "41179cec5f015a5fa27dbd288feedfed", "score": "0.58508885", "text": "handleMutation() { }", "title": "" }, { "docid": "0c16f75ff4f08c2c4af9e5d6ef0921c0", "score": "0.56609166", "text": "function ArrayExpression() {\n}", "title": "" }, { "docid": "498f4eef4e0a2466a7da84f7041f49e6", "score": "0.5644724", "text": "_mutationHandler() {\n // Ignore the mutation if using autobuild\n if (this.autobuild) return;\n\n this.update = true;\n this.rebuild();\n }", "title": "" }, { "docid": "2ba6d450bab35e3dbe06022288de584c", "score": "0.5605734", "text": "function _ArrayExpressionEmitter() {\n}", "title": "" }, { "docid": "e34f9de873b60a4e2bd73dad1306d426", "score": "0.5528975", "text": "function mapArrayToMutation(arr){\n var genesNames = getGenesNames();\n return arr.reduce(function(previousValue, currentValue, index) {\n previousValue[genesNames[index]] = currentValue;\n return previousValue;\n }, {});\n }", "title": "" }, { "docid": "bd450f8dde0d839e58eeb266c61dfa2a", "score": "0.5498428", "text": "function _ArrayLiteralExpressionEmitter() {\n}", "title": "" }, { "docid": "ea10d97e96034ec3a76dc2050bac5668", "score": "0.54405975", "text": "moddedBy(other) {\n return [null, this.illegalOperation(other)];\n }", "title": "" }, { "docid": "a5475b526c54cc37cefd3a2d8323031d", "score": "0.5428868", "text": "function isEvolvingArrayOperationTarget(node) {\n var root = getReferenceRoot(node);\n var parent = root.parent;\n var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === \"length\" || parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name));\n var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && parent.expression === root && parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */);\n return isLengthPushOrUnshift || isElementAssignment;\n }", "title": "" }, { "docid": "7d8c0ecf5fbab9d29f6be5c43da18e51", "score": "0.5387621", "text": "function spreadNotMutateArrRef(...students) {\n students[0].name = \"Charlie\"\n}", "title": "" }, { "docid": "41ee47d52d094bb62c5ba75f923bdf01", "score": "0.5365565", "text": "function applyFieldMutation(field, mutation, onlyFirst = false) {\n if (!Array.isArray(field)) {\n mutation(field);\n return;\n }\n if (onlyFirst) {\n mutation(field[0]);\n return;\n }\n field.forEach(mutation);\n}", "title": "" }, { "docid": "62637f934fd8f04402e4e2fc1fadf1ee", "score": "0.53643155", "text": "function isEvolvingArrayOperationTarget(node) {\n var root = getReferenceRoot(node);\n var parent = root.parent;\n var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === \"length\" ||\n parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name));\n var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ &&\n parent.expression === root &&\n parent.parent.kind === 195 /* BinaryExpression */ &&\n parent.parent.operatorToken.kind === 58 /* EqualsToken */ &&\n parent.parent.left === parent &&\n !ts.isAssignmentTarget(parent.parent) &&\n isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */);\n return isLengthPushOrUnshift || isElementAssignment;\n }", "title": "" }, { "docid": "29de7b7e6fe0823d8d1fb4b079604afe", "score": "0.53387576", "text": "createMutations() {\n this.mutations = {};\n\n return this.mutations;\n }", "title": "" }, { "docid": "6046790821e8e80984413c99ff09df9e", "score": "0.5335827", "text": "function arrayify() {\n // TODO don't type in here until you have a unit test first!\n}", "title": "" }, { "docid": "deeea7f23eb74870522f83893a962354", "score": "0.53336936", "text": "function isEvolvingArrayOperationTarget(node) {\n var root = getReferenceRoot(node);\n var parent = root.parent;\n var isLengthPushOrUnshift = parent.kind === 178 /* PropertyAccessExpression */ && (parent.name.text === \"length\" || parent.parent.kind === 180 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name));\n var isElementAssignment = parent.kind === 179 /* ElementAccessExpression */ && parent.expression === root && parent.parent.kind === 193 /* BinaryExpression */ && parent.parent.operatorToken.kind === 57 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 340 /* NumberLike */ | 2048 /* Undefined */);\n return isLengthPushOrUnshift || isElementAssignment;\n }", "title": "" }, { "docid": "88cd0b1e44c525a3dfbd99383d121e88", "score": "0.5322842", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b5f: // SAMPLER_3D\n\t\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\t\treturn setValueT3DArray;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\t\treturn setValueT2DArrayArray;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "10022a62de17f6c7797f560945b1213c", "score": "0.53224766", "text": "visitArrayArgument(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c6d0ab25c8bffb26677121370f486a8c", "score": "0.52949953", "text": "function visitArrayLiteralExpression(node) {\n if (node.transformFlags & 64 /* ES2015 */) {\n // We are here because we contain a SpreadElementExpression.\n return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "645b6b1552871dd1ace121094f8c8bf5", "score": "0.5287363", "text": "function visitArrayLiteralExpression(node) {\n if (node.transformFlags & 64 /* ES2015 */) {\n // We are here because we contain a SpreadElementExpression.\n return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/true, node.multiLine, /*hasTrailingComma*/node.elements.hasTrailingComma);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "645b6b1552871dd1ace121094f8c8bf5", "score": "0.5287363", "text": "function visitArrayLiteralExpression(node) {\n if (node.transformFlags & 64 /* ES2015 */) {\n // We are here because we contain a SpreadElementExpression.\n return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/true, node.multiLine, /*hasTrailingComma*/node.elements.hasTrailingComma);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "dd4f640de42a513df7c99e383df44917", "score": "0.52066004", "text": "function SArray(values) {\n if (!Array.isArray(values))\n throw new Error(\"SArray must be initialized with an array\");\n var dirty = S.data(false), mutations = [], mutcount = 0, pops = 0, shifts = 0, data = S.root(function () { return S.on(dirty, update, values, true); });\n // add mutators\n var array = function array(newvalues) {\n if (arguments.length > 0) {\n mutation(function array() { values = newvalues; });\n return newvalues;\n }\n else {\n return data();\n }\n };\n array.push = push;\n array.pop = pop;\n array.unshift = unshift;\n array.shift = shift;\n array.splice = splice;\n // not ES5\n array.remove = remove;\n array.removeAll = removeAll;\n lift(array);\n return array;\n function mutation(m) {\n mutations[mutcount++] = m;\n dirty(true);\n }\n function update() {\n if (pops)\n values.splice(values.length - pops, pops);\n if (shifts)\n values.splice(0, shifts);\n pops = 0;\n shifts = 0;\n for (var i = 0; i < mutcount; i++) {\n mutations[i]();\n mutations[i] = null;\n }\n mutcount = 0;\n return values;\n }\n // mutators\n function push(item) {\n mutation(function push() { values.push(item); });\n return array;\n }\n function pop() {\n array();\n if ((pops + shifts) < values.length) {\n var value = values[values.length - ++pops];\n dirty(true);\n return value;\n }\n }\n function unshift(item) {\n mutation(function unshift() { values.unshift(item); });\n return array;\n }\n function shift() {\n array();\n if ((pops + shifts) < values.length) {\n var value = values[shifts++];\n dirty(true);\n return value;\n }\n }\n function splice( /* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n mutation(function splice() { Array.prototype.splice.apply(values, args); });\n return array;\n }\n function remove(item) {\n mutation(function remove() {\n for (var i = 0; i < values.length; i++) {\n if (values[i] === item) {\n values.splice(i, 1);\n break;\n }\n }\n });\n return array;\n }\n function removeAll(item) {\n mutation(function removeAll() {\n for (var i = 0; i < values.length;) {\n if (values[i] === item) {\n values.splice(i, 1);\n }\n else {\n i++;\n }\n }\n });\n return array;\n }\n }", "title": "" }, { "docid": "7bd7e47316600cf90757c0fa6f367951", "score": "0.5199733", "text": "[SOME_MUTATION] (state) {\n // mutate state\n }", "title": "" }, { "docid": "16d5dd1f883768baf5784326a4a49b3a", "score": "0.51821345", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "16d5dd1f883768baf5784326a4a49b3a", "score": "0.51821345", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "16d5dd1f883768baf5784326a4a49b3a", "score": "0.51821345", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "16d5dd1f883768baf5784326a4a49b3a", "score": "0.51821345", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "907fed06fa68edfce3617be40720380a", "score": "0.5176562", "text": "addedTo(other) {\n return [null, this.illegalOperation(other)];\n }", "title": "" }, { "docid": "f342ff00882d4dcc6553933df5a0a86c", "score": "0.5176075", "text": "function foo() {\n return [\n 42\n ];\n}", "title": "" }, { "docid": "b2dd87ff968eb1de1f186a0d040eb662", "score": "0.5168502", "text": "function operationToArray(data, op) {\n if (op instanceof insert_1.Insert) {\n let copy = data.slice(0);\n copy = ensureArrayLength(copy, op.at);\n copy.splice(op.at, 0, ...op.value.split(\"\"));\n return copy;\n }\n else if (op instanceof delete_1.Delete) {\n if (op.at < 0) {\n return data;\n }\n let copy = data.slice(0);\n copy = ensureArrayLength(copy, op.at);\n copy.splice(op.at, op.length);\n return copy;\n }\n return data;\n}", "title": "" }, { "docid": "473fee3a5050b6c9786a319408639109", "score": "0.51608205", "text": "function Arr(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "136250e418bcf27d85e8e7102f176075", "score": "0.5157331", "text": "function spreadNotMutateArr(...numbers) {\n numbers[0] = 100\n return numbers\n}", "title": "" }, { "docid": "2cac1515293b1b93ed316dd25b70f414", "score": "0.51436853", "text": "function doMutate()\n{\n let mutChrom = gen.mutation(hGArray[0].chrom);\n hGArray[0].reset(mutChrom);\n \n // Updates fitness and chromosome arrays in genetics class\n gen.newIndividual(0, hGArray[0].chrom, 0);\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.51374996", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.51374996", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.51374996", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.51374996", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "c1d76b64f5b459b1d74b2b2c36082ab1", "score": "0.51374996", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t}\n\n}", "title": "" }, { "docid": "f53ed0e0c564f3787b235375b97c7ee2", "score": "0.51205987", "text": "function ArrayExpression() {\n return t.genericTypeAnnotation(t.identifier(\"Array\"));\n}", "title": "" }, { "docid": "e963d7587428b16b3ac88f44ed4ab1eb", "score": "0.511912", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_SAMPLER_CUBE\n\t\t\t\treturn setValueT6Array;\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "3cdc70a0e0b3bcdc65668851892cd6bb", "score": "0.5110324", "text": "array() {\n const track = this.track();\n return track ? track.array() : null;\n }", "title": "" }, { "docid": "9728258bd03f802d3044d4950d548376", "score": "0.5108708", "text": "function getSpliceEquivalent( array, methodName, args ) {\n\t\t\tswitch ( methodName ) {\n\t\t\t\tcase 'splice':\n\t\t\t\t\tif ( args[ 0 ] !== undefined && args[ 0 ] < 0 ) {\n\t\t\t\t\t\targs[ 0 ] = array.length + Math.max( args[ 0 ], -array.length );\n\t\t\t\t\t}\n\t\t\t\t\twhile ( args.length < 2 ) {\n\t\t\t\t\t\targs.push( 0 );\n\t\t\t\t\t}\n\t\t\t\t\t// ensure we only remove elements that exist\n\t\t\t\t\targs[ 1 ] = Math.min( args[ 1 ], array.length - args[ 0 ] );\n\t\t\t\t\treturn args;\n\t\t\t\tcase 'sort':\n\t\t\t\tcase 'reverse':\n\t\t\t\t\treturn null;\n\t\t\t\tcase 'pop':\n\t\t\t\t\tif ( array.length ) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tarray.length - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\tcase 'push':\n\t\t\t\t\treturn [\n\t\t\t\t\t\tarray.length,\n\t\t\t\t\t\t0\n\t\t\t\t\t].concat( args );\n\t\t\t\tcase 'shift':\n\t\t\t\t\treturn [\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t1\n\t\t\t\t\t];\n\t\t\t\tcase 'unshift':\n\t\t\t\t\treturn [\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t0\n\t\t\t\t\t].concat( args );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "94b0c0e942839323a1807493c26d1302", "score": "0.5099321", "text": "function getSpliceEquivalent(array, methodName, args) {\n \tswitch (methodName) {\n \t\tcase \"splice\":\n \t\t\tif (args[0] !== undefined && args[0] < 0) {\n \t\t\t\targs[0] = array.length + Math.max(args[0], -array.length);\n \t\t\t}\n\n \t\t\twhile (args.length < 2) {\n \t\t\t\targs.push(0);\n \t\t\t}\n\n \t\t\t// ensure we only remove elements that exist\n \t\t\targs[1] = Math.min(args[1], array.length - args[0]);\n\n \t\t\treturn args;\n\n \t\tcase \"sort\":\n \t\tcase \"reverse\":\n \t\t\treturn null;\n\n \t\tcase \"pop\":\n \t\t\tif (array.length) {\n \t\t\t\treturn [array.length - 1, 1];\n \t\t\t}\n \t\t\treturn [0, 0];\n\n \t\tcase \"push\":\n \t\t\treturn [array.length, 0].concat(args);\n\n \t\tcase \"shift\":\n \t\t\treturn [0, array.length ? 1 : 0];\n\n \t\tcase \"unshift\":\n \t\t\treturn [0, 0].concat(args);\n \t}\n }", "title": "" }, { "docid": "94b0c0e942839323a1807493c26d1302", "score": "0.5099321", "text": "function getSpliceEquivalent(array, methodName, args) {\n \tswitch (methodName) {\n \t\tcase \"splice\":\n \t\t\tif (args[0] !== undefined && args[0] < 0) {\n \t\t\t\targs[0] = array.length + Math.max(args[0], -array.length);\n \t\t\t}\n\n \t\t\twhile (args.length < 2) {\n \t\t\t\targs.push(0);\n \t\t\t}\n\n \t\t\t// ensure we only remove elements that exist\n \t\t\targs[1] = Math.min(args[1], array.length - args[0]);\n\n \t\t\treturn args;\n\n \t\tcase \"sort\":\n \t\tcase \"reverse\":\n \t\t\treturn null;\n\n \t\tcase \"pop\":\n \t\t\tif (array.length) {\n \t\t\t\treturn [array.length - 1, 1];\n \t\t\t}\n \t\t\treturn [0, 0];\n\n \t\tcase \"push\":\n \t\t\treturn [array.length, 0].concat(args);\n\n \t\tcase \"shift\":\n \t\t\treturn [0, array.length ? 1 : 0];\n\n \t\tcase \"unshift\":\n \t\t\treturn [0, 0].concat(args);\n \t}\n }", "title": "" }, { "docid": "94b0c0e942839323a1807493c26d1302", "score": "0.5099321", "text": "function getSpliceEquivalent(array, methodName, args) {\n \tswitch (methodName) {\n \t\tcase \"splice\":\n \t\t\tif (args[0] !== undefined && args[0] < 0) {\n \t\t\t\targs[0] = array.length + Math.max(args[0], -array.length);\n \t\t\t}\n\n \t\t\twhile (args.length < 2) {\n \t\t\t\targs.push(0);\n \t\t\t}\n\n \t\t\t// ensure we only remove elements that exist\n \t\t\targs[1] = Math.min(args[1], array.length - args[0]);\n\n \t\t\treturn args;\n\n \t\tcase \"sort\":\n \t\tcase \"reverse\":\n \t\t\treturn null;\n\n \t\tcase \"pop\":\n \t\t\tif (array.length) {\n \t\t\t\treturn [array.length - 1, 1];\n \t\t\t}\n \t\t\treturn [0, 0];\n\n \t\tcase \"push\":\n \t\t\treturn [array.length, 0].concat(args);\n\n \t\tcase \"shift\":\n \t\t\treturn [0, array.length ? 1 : 0];\n\n \t\tcase \"unshift\":\n \t\t\treturn [0, 0].concat(args);\n \t}\n }", "title": "" }, { "docid": "f8ed1dd568905a2343a0c59b95c9d539", "score": "0.5098127", "text": "asArray() {\n this.validate();\n const val = this._captured[this.idx];\n if ((0, type_1.getType)(val) === 'array') {\n return val;\n }\n this.reportIncorrectType('array');\n }", "title": "" }, { "docid": "c7d900d5da4cc1f16a31744ffb4e3718", "score": "0.509757", "text": "function arr() {\n return Object.defineProperty([1, 2, 3], 0, {\n writable: false\n });\n}", "title": "" }, { "docid": "74c365a5f1b817b1a612685fca2d3d69", "score": "0.5083783", "text": "multedBy(other) {\n return [null, this.illegalOperation(other)];\n }", "title": "" }, { "docid": "1c050fac36c508ea952dc7130c703fd1", "score": "0.5038702", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "1c050fac36c508ea952dc7130c703fd1", "score": "0.5038702", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "9d9f336209d4935e4a9e89bd5ef54860", "score": "0.5020994", "text": "removeMutation() {\n this.setState({\n externalMutations: undefined\n });\n }", "title": "" }, { "docid": "5cdfbe6d65100bbe708de6a5e4d26c0b", "score": "0.5016556", "text": "function ArrayLiteralExpression() {\n}", "title": "" }, { "docid": "d7c9f6200c835ce22ad590302a8ffb98", "score": "0.5010549", "text": "function arrayFrom(){\n return [].slice.call(arguments)\n \n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.500461", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.500461", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "7dbf0449a10822c130f6bf65b9db64a1", "score": "0.49677312", "text": "function tuple(arr) {\n return arr;\n}", "title": "" }, { "docid": "f24ba87ba6993ac024849ae527219844", "score": "0.49385062", "text": "function single(a) {\n return [a];\n}", "title": "" }, { "docid": "7816d916e46d76a256d0a2a522a08c81", "score": "0.493639", "text": "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1Array; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6Array; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "8fa713d854285598de7c5ecade4cee26", "score": "0.49352452", "text": "function tsArrayOf(type) {\n return `${type}[]`;\n}", "title": "" }, { "docid": "2a03da1bad5415981693fb5f3ba3a4c7", "score": "0.49265328", "text": "function logArrayElements(array){\n let newArray = [...array]\n // let newObj = {...object}\n newArray[2] = \"Zach\"\n console.log(newArray[2])\n}", "title": "" }, { "docid": "a3494222b97ed7ca0ce840896ff70e2a", "score": "0.4920492", "text": "function asArray(something) {\n return [].slice.call(something);\n}", "title": "" }, { "docid": "3ac79c293eebe1cc573e675cbb7d5ebb", "score": "0.49124202", "text": "array() {\n return [...this.values()];\n }", "title": "" }, { "docid": "0663b2e304aa33448282ce75e468a2a8", "score": "0.4897837", "text": "function arrayFunction() {return [1,2,3,4]}", "title": "" }, { "docid": "56953878881cf47876db1d0a46f1f3af", "score": "0.48844308", "text": "function removeFromArray(name) {\n self.setState({\n changedValues: self.state.changedValues.filter(field => field !== name)\n });\n }", "title": "" }, { "docid": "a3c403e3465189631286b0a8ececa116", "score": "0.48832113", "text": "function spreadus() {\n var args = Array.prototype.slice.apply(arguments);\n args._spreadus_ = true;\n return args;\n }", "title": "" }, { "docid": "d4bc7811d606ccf92d0acd82b006f8cf", "score": "0.4878271", "text": "set array(val) {\n\t\tthis._array = val;\n\t\tthis._dirty = true;\n\t}", "title": "" }, { "docid": "d72945ad0f8f16820f0c814ccb7368b1", "score": "0.48721763", "text": "function isnArray() {\n argnr=isnArray.arguments.length;\n for (var i=0;i<argnr;i++) {\n this[i+1] = isnArray.arguments[i];\n }\n }", "title": "" }, { "docid": "d72945ad0f8f16820f0c814ccb7368b1", "score": "0.48721763", "text": "function isnArray() {\n argnr=isnArray.arguments.length;\n for (var i=0;i<argnr;i++) {\n this[i+1] = isnArray.arguments[i];\n }\n }", "title": "" }, { "docid": "e3bf5813423597ed0e062581387849c7", "score": "0.48685068", "text": "function doubleThemImmutable(list) {\n var newList = [];\n for (var i = 0; i < list.length; i++) {\n newList[i] = list[i] * 2;\n }\n\n return newList;\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "3aaec734f7a64986a8d22ccfd955d739", "score": "0.48682386", "text": "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "title": "" }, { "docid": "5c4059c7feaca564facb8d65a0887852", "score": "0.48552358", "text": "async fetchTodos({commit}){\n const response = await axios.get('https://jsonplaceholder.typicode.com/todos');\n \n commit('setTodos', response.data); //passing data to the mutation. \n //commit takes in the mutation and the data to be set \n }", "title": "" }, { "docid": "7f13a796f0d19123a46fc73f13f02a95", "score": "0.48536977", "text": "function c(e){return Array.isArray(e)}", "title": "" }, { "docid": "1f23ccd336086cf832da907adb9decf4", "score": "0.4851168", "text": "visitArrayLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6fc0558f5c6c23a0e13f3a9960837faf", "score": "0.48417485", "text": "function defineArrayProto () {\n var arrProto = Array.prototype;\n $.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function arrayProtoEach (method) {\n var protoMethod = arrProto[method];\n $defineProp(arrProto, '$' + method, {\n enumerable: false,\n configurable: true,\n value: function() {\n var result = protoMethod.apply(this, arguments);\n updateWatcher.call(this._vm_, this._ob_, this);\n return result;\n }\n });\n });\n\n $defineProp(arrProto, '$set', {\n enumerable: false,\n configurable: true,\n value: function(index, value) {\n var len = this.length;\n\n if (index > len) {\n this.length = +index + 1;\n }\n return this.$splice(index, 1, value)[0];\n }\n });\n\n $defineProp(arrProto, '$remove', {\n enumerable: false,\n configurable: true,\n value: function(index) {\n var len = this.length;\n\n if (!len) return;\n index = +index;\n\n if ($.isNaN(index)) return;\n\n if (index < len) {\n return this.$splice(index, 1);\n }\n }\n });\n }", "title": "" }, { "docid": "0d7e29da2794be2d1ccb1f98e19b109b", "score": "0.48342553", "text": "set(arrayLike, offset) {\n // validate arguments\n const arrayLikeIsIterable = Symbol.iterator in Object(arrayLike);\n if (!arrayLikeIsIterable) throw new TypeError('invalid_argument');\n offset = Math.floor(offset) || 0;\n if (offset < 0) throw new RangeError('offset is out of bounds');\n if (arrayLike.length + offset > this[internal].length) throw new RangeError('offset is out of bounds');\n\n for (let i=0; i<arrayLike.length; i++) {\n this[i+offset] = arrayLike[i];\n }\n }", "title": "" }, { "docid": "7d05c877292aba25fea47f7066ac8f44", "score": "0.483317", "text": "function changeArr(arr) {\n if (arr.length > 0) {\n arr[0] = 100\n }\n console.log({ arr })\n}", "title": "" }, { "docid": "9db5845a07a08e941d5c10ee187acd97", "score": "0.48323968", "text": "update(data) {\n this.graphQlServer.mutate(this.mutation)\n .on('error', this.handleError)\n .on('response', this.handleSuccess)\n }", "title": "" }, { "docid": "ac9e13de773f7f79b601256b0e52e7ac", "score": "0.48284435", "text": "mutate() {\n if (!this.unlocked) {\n return false;\n }\n const plots = this.getMutationPlots();\n if (!plots.length) {\n return false;\n }\n let mutated = false;\n plots.forEach((idx) => {\n const willMutate = Rand.chance(this.mutationChance(idx) * App.game.farming.getMutationMultiplier() * App.game.farming.plotList[idx].getMutationMultiplier());\n if (!willMutate) {\n return;\n }\n this.handleMutation(idx);\n App.game.oakItems.use(OakItemType.Squirtbottle);\n mutated = true;\n });\n return mutated;\n }", "title": "" }, { "docid": "01711215203d32c8188995330522d4e1", "score": "0.48240307", "text": "function nonMutatingPush(original, newItem) {\n //Add new item array to the end of original array\n return original.concat(newItem);\n}", "title": "" }, { "docid": "d4365bd04d641ca9a7850733d412f83d", "score": "0.48214403", "text": "isEquivalentTo(target) {\n return (\n target.constructor === ArrayType &&\n this.baseType.isEquivalentTo(target.baseType)\n );\n }", "title": "" }, { "docid": "e8d713ddc2dc4c6767c07bec8d06bdae", "score": "0.4821174", "text": "function myArreyFunction(arr){\r\nvar myItems = [...arr];\r\n//Only change code below this lin\r\nmyItems[2]=6;\r\n\r\nreturn myItems;\r\n \r\n//Only change code above this line \r\n\r\n}", "title": "" }, { "docid": "d68d542dd1d510616a7896c844269c0f", "score": "0.4817995", "text": "get array() { return this._array; }", "title": "" }, { "docid": "27692e07c022693f0284b73a73bdeebd", "score": "0.48106608", "text": "parsePrimitiveArray(inst) {\n if(!/^(\\s*\\[\\s*)/.test(inst))\n return false\n\n const array_list = syntax.parsePrimitiveArrayList(inst.substr(RegExp.$1.length))\n if(!array_list)\n return false\n\n if(!/^(\\s*\\]\\s*)/.test(array_list.remain))\n return false\n\n return {\n original: inst,\n remain: array_list.remain.substr(RegExp.$1.length),\n parsed: {\n type: 'array',\n args: array_list.parsed\n }\n }\n }", "title": "" }, { "docid": "4a3701f84b9b462fc22277c4a19cbed4", "score": "0.4810183", "text": "function getPureArraySetter( type ) {\n\t\n\t\t\tswitch ( type ) {\n\t\n\t\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\t\n\t\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\t\n\t\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\t\n\t\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\t\n\t\t\t}\n\t\n\t\t}", "title": "" }, { "docid": "d46910a11650f6383043006890e6d2c4", "score": "0.48067412", "text": "function checkSpreadAssign(node) {\n if (node.type !== \"Identifier\" && node.type !== \"ArrayPattern\")\n unexpected(node.start);\n }", "title": "" }, { "docid": "d46910a11650f6383043006890e6d2c4", "score": "0.48067412", "text": "function checkSpreadAssign(node) {\n if (node.type !== \"Identifier\" && node.type !== \"ArrayPattern\")\n unexpected(node.start);\n }", "title": "" }, { "docid": "d46910a11650f6383043006890e6d2c4", "score": "0.48067412", "text": "function checkSpreadAssign(node) {\n if (node.type !== \"Identifier\" && node.type !== \"ArrayPattern\")\n unexpected(node.start);\n }", "title": "" }, { "docid": "d46910a11650f6383043006890e6d2c4", "score": "0.48067412", "text": "function checkSpreadAssign(node) {\n if (node.type !== \"Identifier\" && node.type !== \"ArrayPattern\")\n unexpected(node.start);\n }", "title": "" }, { "docid": "85b325c5c9b90b0d0ce35971795a85b4", "score": "0.48044887", "text": "function getPureArraySetter( type ) {\n\t\t\n\t\t\t\tswitch ( type ) {\n\t\t\n\t\t\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\t\t\n\t\t\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\t\t\n\t\t\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\t\t\n\t\t\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\t\t\n\t\t\t\t}\n\t\t\n\t\t\t}", "title": "" }, { "docid": "417037922a321a77e9d3bed92e59d04b", "score": "0.4802587", "text": "function ensureArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n return [value];\n }", "title": "" }, { "docid": "87c8ab9da88eabeb5c338bf739daaf55", "score": "0.47994545", "text": "function asArray() {\n\t\t\tvar result = getterSetter.get();\n\t\t\treturn (result || []).slice(0);\t\t\t\n\t\t}", "title": "" }, { "docid": "f5714ac8b44d11f00858e221235421e6", "score": "0.47984537", "text": "function negativeArray(arr) {\n let clone = arr;\n\n Proxy.create({\n set: function (proxy, index, value) {\n clone[index] = value;\n },\n get function (proxy, index) {\n index = parseInt(index);\n return index < 0 ? clone[clone.length + index] : clone[index];\n }\n });\n}", "title": "" }, { "docid": "c34dd364c6bafcd0e29502b653dea987", "score": "0.47959387", "text": "asArray() {\n\n }", "title": "" } ]
ce0204f22253710ffbf6136be239db49
Sorted Array FizzBazz if number share without remainder to 15 , console (FizzBazz), if number share without remainder to 5 , console (Bazz), and if number share without remainder to 3 , console (Fizz).
[ { "docid": "64289114dc6f689cff2624729ab78cb9", "score": "0.67904294", "text": "function FizzBazz(num) {\n for (var i = 1; i <= num ;i++){\n if (i % 15 == 0){\n console.log('FizzBazz');\n }else if (i % 5 == 0){\n console.log('Bazz');\n }else if (i % 3 == 0){\n console.log('Fizz');\n }else{\n console.log(i);\n }\n }\n}", "title": "" } ]
[ { "docid": "a516ff1b8f76c187991cc1639b050dc7", "score": "0.7280992", "text": "function fizzBuzz(array) {\n let result = []; // Fizz, Buzz, FizzBuzz, Buzz, Fizz, 7\n\n for (let i = 0; i < array.length; i++) {\n let num = array[i];\n console.log(num); // 3, 5, 15....\n\n if (num % 3 === 0 && num % 5 === 0) {\n result.push(\"FizzBuzz\");\n } else if (num % 3 === 0) {\n result.push(\"Fizz\");\n } else if (num % 5 === 0) {\n result.push(\"Buzz\");\n } else {\n result.push(num);\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "be7ff5bc78a18cb9c3a1da02bc7e4f2e", "score": "0.7230824", "text": "function fizzBuzz(arr){\n let fiz = [];\n for (var i = 0; i < arr.length; i++){\n let num = arr[i];\n if ((num % 3 === 0) && (num % 5 !== 0)){\n fiz.push(num);\n } else if ((num % 3 !== 0) && (num % 5 === 0)){\n fiz.push(num);\n }\n };\n return fiz;\n}", "title": "" }, { "docid": "289da3cb6e0008db80fe4cf5ebedf095", "score": "0.7224013", "text": "function fizzBuzz(array) {\n let result = [];\n\n for (let i = 0; i <array.length; i++) {\n let num = array[i];\n if (num % 3 === 0 && num % 5 ===0) {\n result.push('FizzBuzz')\n }else if (num % 3 === 0) { \n result.push('Fizz')\n }else if (num % 5 === 0) {\n result.push('Buzz');\n }else {\n result.push(num);\n }\n }\n return result;\n}", "title": "" }, { "docid": "bb3a2b6cc9c8fc266d767a0db3a41d4a", "score": "0.7179728", "text": "function fizzBuzz(num_arr){\n var fizz_arr = [];\n for (var i = 0; i < num_arr.length; i ++) {\n\n if (num_arr[i] % 5 === 0 && num_arr[i] % 3 === 0){\n continue;\n } else if (num_arr[i] % 3 === 0) {\n fizz_arr.push(num_arr[i]);\n } else if (num_arr[i] % 5 === 0) {\n fizz_arr.push(num_arr[i]);\n }\n }\n console.log(fizz_arr);\n}", "title": "" }, { "docid": "704147206b1e0bae7a3a6398b522e3c6", "score": "0.71042144", "text": "function fizzBuzz(array) {\n let arr = [];\n\n for (let i = 0; i < array.length; i++) {\n let num = array[i];\n\n if (num % 3 === 0 && num % 5 !== 0) {\n arr.push(num);\n\n } else if (num % 3 !== 0 && num % 5 === 0) {\n arr.push(num);\n\n } else {\n continue;\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "64db4f014b1506009459fb2ecb685f18", "score": "0.7084636", "text": "function fizzBuzz(fizz, buzz){\n let fizzArray = [];\n for(let i=1; i<=100; i++){\n if((i % fizz == 0 )&& (i % buzz == 0 )){\n fizzArray.push(\"fizzbuzz\");\n }else if((i % fizz) == 0){\n fizzArray.push(\"fizz\");\n }else if((i % buzz) == 0){\n fizzArray.push(\"buzz\");\n }else{\n fizzArray.push(i);\n }\n \n }\n return fizzArray;\n}", "title": "" }, { "docid": "17052461579c50c420d058eb89c85cbc", "score": "0.70837164", "text": "function fizzBuzz(arr) {\n new_arr = []\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] % 15 != 0 && (arr[i] % 3 === 0 || arr[i] % 5 === 0)) {\n new_arr.push(arr[i]);\n }\n }\n return new_arr;\n}", "title": "" }, { "docid": "16c1eb13da8233ca6be3cc4b4dc68c5b", "score": "0.70453435", "text": "function fizzBuzz(arr) {\n let output = [];\n\n for(let i = 0; i < arr.length; i++) {\n if (arr[i] % 3 === 0|| arr[i] % 5 === 0) {\n output.push(arr[i]);\n }\n }\n\n return output;\n}", "title": "" }, { "docid": "8a0840bb0fdbe66ee033fbc75542dbd0", "score": "0.703162", "text": "function fizzBuzz(arr) {\n let results = [];\n for (let i = 0; i < arr.length; i += 1) {\n let num = arr[i]; \n if (num % 3 === 0 && num % 5 === 0) {\n continue; \n } else if (num % 3 === 0) {\n results.push(num);\n } else if (num % 5 === 0) {\n results.push(num); \n }\n }\n return results; \n}", "title": "" }, { "docid": "7269fdd0f019823c82ec15278f957e7c", "score": "0.700152", "text": "function fizzbuzz(num) {//done\n let result = [];\n for (let i = 1; i<=num; i++) {\n if (i%3===0 && i%5===0) {\n result.push('fizzbuzz')\n } else if (i%3===0) {\n result.push(\"fizz\")\n } else if (i%5===0) {\n result.push(\"buzz\")\n } else {\n result.push(i)\n }\n }\n return result;\n }", "title": "" }, { "docid": "12dddfa212c8abc11de85c4838172cb7", "score": "0.699308", "text": "function fizzBuzz(array){\n let result = [];\n\n for(let i = 0; i < array.length; i++){\n let num = array[i];\n console.log(num)\n\n if(num % 3 === 0 && num % 5 === 0){\n result.push(\"Fizzbuzz\");\n } else if(num % 3 === 0){\n result.push(\"fizz\");\n }else if(num % 5 === 0){\n result.push(\"buzz\");\n }else{\n result.push(num);\n }\n return result;\n\n \n }\n console.log(fizzBuzz([3,5,15,20,9,7]));\n }", "title": "" }, { "docid": "38221d2a48754765595c43e83c24876b", "score": "0.69867086", "text": "function fizzBuzz(num){\n var newArr = [];\n\n for(var i = 1; i <= num; i++){\n if(i % 3 === 0 || i % 5 === 0){\n if(i % 3 === 0 && i % 5 === 0){\n continue;\n }\n//use .push() method to push numbers into newArr variable.\n newArr.push(i);\n } \n }\n//loop thru newArr and then print out numbers:\n for(var i = 0; i < newArr.length; i++){\n console.log(newArr(i));\n } \n}", "title": "" }, { "docid": "dc08ec82ac07c9f1ce27e95cead086a7", "score": "0.6972585", "text": "function fizzBuzz(){\r\n if(number%3===0&&number%5===0){\r\n output.push(\"Fizzbuzz!\")\r\n }else if(number%3===0){\r\n output.push(\"Fizz!\");\r\n }else if(number%5===0){\r\n output.push(\"Buzz!\");\r\n }else{\r\n output.push(number);\r\n }\r\n number++;\r\n console.log(output);\r\n}", "title": "" }, { "docid": "645bc9c22b7d10a9673fc67eff730d46", "score": "0.6969154", "text": "function fizzBuzz(number) {\n const arr = [];\n for (let i = 1; i <= number; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n arr.push('FizzBuzz');\n } else if (i % 3 === 0) {\n arr.push('Fizz');\n } else if (i % 5 === 0) {\n arr.push('Buzz');\n } else {\n arr.push(i);\n }\n }\n return arr;\n}", "title": "" }, { "docid": "709453faf09c635abee5e3bace5c2ee4", "score": "0.69665647", "text": "function fizzBuzz(number) {\n var fbArr = []\n for(i=0; i < number; i++) {\n if (( i % 3) == 0 && (i % 5) == 0) {\n fbArr.push('FizzBuzz');\n }else if((i % 3) == 0) {\n fbArr.push('Fizz');\n }else if ((i % 5) == 0) {\n fbArr.push('Buzz');\n }else {\n fbArr.push(i);\n }\n }\n return fbArr;\n}", "title": "" }, { "docid": "33222e450faebdff7b5227c2591b6279", "score": "0.6934794", "text": "function fizzBuzz (array) {\n \n // Iterate through the array passed to it\n for (let i = 0; i < array.length; i ++) {\n\n // Assign a variable to each number being iterated trough in the array\n let num = array[i];\n\n // Give conditionals saying if the number is divisible by x, push this string into the empty array.\n if (num % 3 === 0 && num % 5 === 0) {\n fizzArr.push('FizzBuzz');\n } else if (num % 5 === 0) {\n fizzArr.push('Buzz')\n } else if (num % 3 === 0) {\n fizzArr.push('Fizz')\n } else {\n fizzArr.push(num);\n }\n } return fizzArr;\n }", "title": "" }, { "docid": "8fd767b011359628a19439e3f8cd3ee5", "score": "0.6926961", "text": "function superFizzBuzz(array){\n for (var i = 0 ; i < array.length; i++){\n if (array[i] % 15 === 0 ){\n array[i] = \"FizzBuzz\"; }\n else if (array[i] % 5 === 0 ){\n array[i] = \"Buzz\"; }\n else if(array[i] % 3 === 0 ){\n array[i] = \"Fizz\"; }\n else {\n array[i];\n };\n };\n return array\n}", "title": "" }, { "docid": "47f1bd7f15fb0a5117dec21eda0488a8", "score": "0.6922728", "text": "function fizzBuzz() {\n let numHolder = [];\n for (let i = 1; i < 101; i++) {\n if (i % 3 == 0 && i % 5 == 0) {\n numHolder.push(\"FizzBuzz\");\n } else if (i % 3 == 0) {\n numHolder.push(\"Fizz\");\n } else if (i % 5 == 0) {\n numHolder.push(\"Buzz\");\n } else {\n numHolder.push(i);\n }\n }\n return numHolder;\n}", "title": "" }, { "docid": "86654e04ebada1e0913ce7a4df26682a", "score": "0.69106114", "text": "function fizzBuzz(arr){\n let newArr = []\n\n arr.forEach(element => {\n if(element % 3 == 0 && element % 5 ==0) {\n return;\n } else if (element % 3 == 0) {\n newArr.push(element);\n } else if (element % 5 == 0) {\n newArr.push(element);\n }\n })\n\n return newArr\n}", "title": "" }, { "docid": "0e3bcfa86aac23cf79ed2b9e23ffdd93", "score": "0.6904896", "text": "function fizzBuzz() {\n var result = [];\n for (var i = 1; i <= 20; i++){\n if(i % 15 === 0){\n result.push(\"fizzbuzz\");\n } else if (i % 3 === 0) {\n result.push(\"fizz\");\n } else if (i % 5 === 0) {\n result.push(\"buzz\");\n } else {\n result.push(i);\n }\n }\n return result;\n}", "title": "" }, { "docid": "2c2841e5ac549cc678a4d8ab723add78", "score": "0.689849", "text": "function detecting( num ) {\n var arr = [];\n\n for (var i = 1; i <= num; i++) {\n arr.push(i);\n }\n\n for (var i = 0, l = arr.length; i < l; i++) {\n if (arr[i] % 3 == 0 && arr[i] % 5 == 0) {\n arr[i] = 'FizzBuzz';\n } else if (arr[i] % 3 == 0) {\n arr[i] = 'Fizz';\n } else if (arr[i] % 5 == 0) {\n arr[i] = 'Buzz';\n }\n }\n\n console.log(arr);\n}", "title": "" }, { "docid": "fdd5789e7c831486a0d031f3dea33ccc", "score": "0.6884979", "text": "function fizzBuzz(arr) {\n // seu código aqui\n\n let arrResult = [];\n\n for (let value of arr) {\n if (value % 3 === 0 && value % 5 === 0) {\n arrResult.push('fizzBuzz');\n } else if (value % 3 === 0) {\n arrResult.push('fizz');\n } else if (value % 5 === 0) {\n arrResult.push('buzz');\n } else {\n arrResult.push('bug!');\n }\n }\n return arrResult;\n}", "title": "" }, { "docid": "ce684022146b2854a6515a42d0b197ec", "score": "0.6874483", "text": "function fizzBuzz(n){\n let arr = [];\n\n for(let i = 1; i <= n; i++){\n if(i % 5 == 0 && i % 3 == 0){\n arr.push('FizzBuzz');\n } else if( i % 5 == 0){\n arr.push('Buzz');\n } else if( i % 3 == 0){\n arr.push('Fizz');\n } else {\n arr.push(i);\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "260903252e1c47dcc3db98d8ff57b360", "score": "0.6873852", "text": "function fizzbuzz(num) {\n\tvar resultArr=[];\n\t//loop num number of times\n\tfor(var i=1; i<num+1; i++){\n\n\n\t//if num is divisible by 3 and 5, type fizzbuzz\n\tif (i%3 ===0 && i%5 ===0) resultArr.push(\"fizzbuzz\");\n\t//if num is divisible by 3, type fizz\n\telse if (i%3 ===0) resultArr.push(\"fizz\");\n\t//if num is divisible by 5, type buzz\n\telse if (i%5 ===0) resultArr.push(\"buzz\");\n\t//when it isn't divisible by 3 or 5, push number\n\telse\tresultArr.push(i);\n\n\t}\n\n\treturn resultArr;\n\n}", "title": "" }, { "docid": "e89f50cede41aaadfcb118026667aaf0", "score": "0.68726027", "text": "function fizzBuzz(arrayNumber) {\n let newArray = [];\nfor (let index = 0; index < arrayNumber.length; index += 1) {\n if (arrayNumber[index] %3 === 0 && arrayNumber[index] %5 === 0) {\n newArray.push('fizzBuzz');\n }\n else if (arrayNumber[index] %3 === 0) {\n newArray.push('fizz');\n }\n else if (arrayNumber[index] %5 === 0) {\n newArray.push('buzz');\n }\n else {\n newArray.push('bug!');\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "b48059f81f9d5f9508f7dee94fb8405c", "score": "0.68671805", "text": "function fizzBuzz(number) {\n let array = [];\n for (let i = 1; i <= number; i++) {\n if (i % 3 == 0 && i % 5 == 0) {\n array[i] = \"FizzBuzz\";\n } else if (i % 5 == 0) {\n array[i] = \"Buzz\";\n } else if (i % 3 == 0) {\n array[i] = \"Fizz\";\n } else {\n array[i] = i;\n }\n }\n return array.slice(1, array.length + 1);\n}", "title": "" }, { "docid": "a8e5ebf5280444031905a8c4928aff07", "score": "0.6846399", "text": "function fizzbuzz(n) {\n const arr = []\n for (let i = 1; i <= n; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n arr.push('FizzBuzz');\n } else if (i % 3 === 0) {\n arr.push('Fizz');\n } else if (i % 5 === 0) {\n arr.push('Buzz');\n } else {\n arr.push(i);\n }\n }\n return arr;\n}", "title": "" }, { "docid": "8606f97237e2976c450ed4614e136a38", "score": "0.6846233", "text": "function fizzbuzz(arr) {\n out = [];\n arr.forEach((element) => {\n if (element % 3 === 0 || element % 5 === 0) {\n out.push(element)\n }\n });\n console.log(out);\n}", "title": "" }, { "docid": "5e57edfe119a231410c7aa1dd3d91705", "score": "0.6838007", "text": "function fizzBuzz (array1) {\n let result = [];\n for (let i = 0; i < array1.length; i++) {\n let num = array1[i];\n console.log(num);\n if (num % 5 === 0 && num % 3 === 0) {\n result.push('FizzBuzz');\n } else if (num % 3 === 0) {\n result.push('Fizz');\n } else if (num % 5 === 0) {\n result.push('Buzz');\n } else {\n result.push(num);\n }\n\n\n }\n return result;\n\n}", "title": "" }, { "docid": "af4904b5858291ddefdfd61f49ba3a74", "score": "0.6818505", "text": "function fizzBuzz(array) {\n let result = [];\n for (let i = 0; i < array.length; i++) {\n if ((array[i] % 3 === 0 || array[i] % 5 === 0) && !(array[i] % 3 === 0 && array[i] % 5 === 0)) {\n result.push(array[i]);\n }\n }\n console.log(result);\n}", "title": "" }, { "docid": "db17fa8865e39e65a3d75ffb939fab34", "score": "0.678223", "text": "function fizzbuzz(num) {\n //declare a counter var starting at 0;\n //declare an empty numbers array to store each digit;\n //create a while loop: while counter < num, counter++;\n //push counter to numbers array;\n //iterate through the array:\n \t//if num % 3 === 0 AND num % 5 === 0, change num to 'fizzbuzz';\n \t//if num % 3 === 0, change num to 'fizz';\n \t//if num % 5 === 0, change num to 'buzz';\n //return the numbers array;\n let counter = 0;\n const numbers = [];\n while (counter < num) {\n counter++\n numbers.push(counter);\n }\n \n for (let i = 0; i < numbers.length; i++) {\n if (numbers[i] % 3 === 0 && numbers[i] % 5 === 0) {\n numbers[i] = 'fizzbuzz';\n } else if (numbers[i] % 3 === 0) {\n numbers[i] = 'fizz';\n } else if (numbers[i] % 5 === 0) {\n numbers[i] = 'buzz';\n }\n }\n return numbers;\n}", "title": "" }, { "docid": "c41fc9f0114799614cc302575b649a99", "score": "0.6760555", "text": "function FizzBuzz(arr){\r\n let result = []\r\n arr.forEach(e => {\r\n if (e % 3 === 0 && e % 5 === 0){\r\n result.push('FizzBuzz')\r\n }\r\n else if (e % 3 === 0){\r\n result.push('Fizz')\r\n }\r\n else if (e % 5 === 0){\r\n result.push('Buzz')\r\n }\r\n else {\r\n result.push(e)\r\n }\r\n })\r\n return result\r\n}", "title": "" }, { "docid": "3f76ea6e742cfcae9931b820dc7426a2", "score": "0.67395407", "text": "function fizzBuzz(array) {\n var answer = [];\n\n for (var i = 0; i < array.length; i++) {\n if ( (array[i] % 3 === 0 && array[i] % 5 !== 0) || (array[i] % 3 !== 0 && array[i] % 5 === 0)) {\n\n answer.push(array[i]);\n }\n }\n\n console.log(answer);\n}", "title": "" }, { "docid": "b56f83671dbd8fdb084aa0e4b01218b0", "score": "0.67194265", "text": "function modFizzBuzz(number) {\n var a = 0;\n var b = 0;\n var c = 0;\n for (let i = 1; i < number; i++) {\n let r3 = i % 3;\n let r5 = i % 5;\n if (r3 === 0 && r5 === 0) {\n c++;\n continue;\n } else if (r3 === 0) {\n a++;\n continue;\n } else if (r5 === 0) {\n b++;\n continue;\n }\n }\n return [a, b, c];\n}", "title": "" }, { "docid": "318c2289970139408eac1684042ca5e3", "score": "0.67073166", "text": "function fizzBuzz(numbers) {\n let result = [];\n for (let i = 0; i < numbers.length; i++) {\n if (numbers[i] % 3 === 0 & numbers[i] % 5 === 0) {\n result.push(\"fizzBuzz\");\n } else if (numbers[i] % 3 === 0) {\n result.push(\"fizz\");\n } else if (numbers[i] % 5 === 0) {\n result.push(\"buzz\");\n } else\n result.push(\"bug!\");\n\n }\n return result\n\n}", "title": "" }, { "docid": "ab78f3c1e3e730184e77f004afb7bc2d", "score": "0.669962", "text": "function fizzBuzz (array) {\n const fizzBuzzArr = [];\n\n array.forEach(el => {\n if ((el % 3 === 0) ^ (el % 5 === 0)) {\n fizzBuzzArr.push(el);\n }\n });\n\n return fizzBuzzArr;\n}", "title": "" }, { "docid": "400b1c91bdb34593a50529c333f1cfd3", "score": "0.6686605", "text": "function fizzBuzz(num){\n for(var i = 1; i <= num; i++){\n if (i % 3 === 0 && i % 5 === 0 || i % 15 === 0) console.log('FizzBuzz');\n else if(i % 3 === 0) console.log('Fizz');\n else if (i % 5 === 0) console.log('Buzz');\n else console.log(i);\n }\n}", "title": "" }, { "docid": "3ed4b4a82a67ef135dc667e16810ff80", "score": "0.66814977", "text": "function fizzBuzz(fizzValue, buzzValue) {\n let values = [];\n\n for(let i = 1; i <= 100; i++){\n if((i % fizzValue == 0) && (i % buzzValue == 0)) {\n values.push(\"FizzBuzz\");\n } else if(i % fizzValue == 0) {\n values.push(\"Fizz\")\n } else if(i % buzzValue == 0) {\n values.push(\"Buzz\")\n } else {\n values.push(i);\n }\n }\n\n return values;\n}", "title": "" }, { "docid": "7ea12ce93fbc32477ceabb4dd8db4351", "score": "0.6671123", "text": "function fizzBuzz(n){\n let result = []\n for(let i = 1; i <= n; i++){\n if(i % 5 === 0 && i % 3 === 0) result.push('FizzBuzz')\n else if (i % 5 === 0) result.push('Buzz')\n else if (i % 3 === 0) result.push('Fizz')\n else result.push(i+'')\n }\n return result\n }", "title": "" }, { "docid": "9878fe3a8522c0ce13c671adfbb3a551", "score": "0.6669402", "text": "function alternativeFizzBuzz(number) {\n const result = [];\n\n for (let i = 1; i <= number; i++) {\n if (i % 15 === 0) {\n result.push('FizzBuzz');\n } else if (i % 5 === 0) {\n result.push('Buzz');\n } else if (i % 3 === 0) {\n result.push('Fizz');\n } else {\n result.push('' + i);\n }\n }\n return result;\n}", "title": "" }, { "docid": "10eb44c21084df78df815b483396130c", "score": "0.66479284", "text": "function fizzBuzz(num){\n\tfor (var i = 0, len = num - 1; i <= len; i++) {\n\t\tif((i + 1) % 3 === 0 && (i + 1) % 5 === 0) console.log('fizz buzz');\n\t\telse if ((i + 1) % 3 === 0) console.log('fizz');\n\t\telse if ((i + 1) % 5 === 0) console.log('buzz');\n\t\telse console.log(i + 1);\n\t\tnum--;\n\t};\n}", "title": "" }, { "docid": "dcf5bcd2c276f1f5ad53f6142912dd44", "score": "0.65900385", "text": "function fizzbuzz_3(arr) {\n\t\tfor (i = 0; i < arr.length; i++) {\n\t\t\tif ( (arr[i] % 3 === 0) && (arr[i] % 5 === 0)) {\n\t\t\t\toutput = \"FizzBuzz\";\n\t\t\t}\n\t\t\telse if (arr[i] % 3 === 0) {\n\t\t\t\toutput = \"Fizz\";\n\t\t\t}\n\t\t\telse if (arr[i] % 5 === 0) {\n\t\t\t\toutput = \"Buzz\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\toutput = arr[i];\n\t\t\t}\n\n\t\t\t$(\"#fizzbuzz3\").append(\"<li>\" + output + \"</li>\");\n\t\t}\n\t}", "title": "" }, { "docid": "6f5ffbd0c8f793ad52b69bd84468c5d9", "score": "0.6581782", "text": "function FizzBuzzer(arr){\n for(i = 0; i < arr.length; i++){ //Iterates through each element in array we pass\n if(arr[i] % 3 == 0 && arr[i] % 5 == 0){ //Checks if element is divisible by 3 and 5\n console.log(\"BuzzFizz\");\n }\n else if(arr[i] % 3 == 0){ //Checks if element is divisible by 3\n console.log(\"Buzz\");\n }\n else if(arr[i] % 5 == 0){ //Checks if element is divisible by 5\n console.log(\"Fizz\");\n }\n else{\n console.log(arr[i]); //prints element if none\n }\n }\n}", "title": "" }, { "docid": "abfceb926df49a8a62d1800de4024a11", "score": "0.65802693", "text": "function fizzBuzz(n1){\n//Console log all values from 1 to that number,\n // let n1 = 12\n for(let i=1; i <= n1; i++) {\n//but if the number is divisible by 3 log \"fizz\" instead of that number,\n if(i %3===0 && i % 5===0) {\n console.log('fizzzbuzzzz')\n//if the number is divisible by 5 log \"buzz\" instead of the number,\n } else if(i % 3===0) {\n console.log('fizzz')\n//and if the number is divisible by 3 and 5 log \"fizzbuzz\" instead of that number\n } else if (i % 5===0) {\n console.log(\"buzz\")\n } else {\n console.log(i)\n }\n }\n}", "title": "" }, { "docid": "1e5ffff0c08f1425f174faef2d11716c", "score": "0.6576662", "text": "function solution(number){\n let [fizz, buzz, fizzBuzz] = [0, 0, 0]\n while (number-- > 1) {\n if (number % 3 === 0 && number % 5 === 0) fizzBuzz++\n else if (number % 3 === 0) fizz++\n else if (number % 5 === 0) buzz++\n }\n return [fizz, buzz, fizzBuzz]\n}", "title": "" }, { "docid": "d72521bc7cd5316c6a23e1f47133d143", "score": "0.6570589", "text": "function FizzBuzzA(value1, value2) {\n let returnArray = [];\n for (let i = 1; i <= 92; i++) {\n if (i % value1 == 0 && i % value2 == 0) {\n returnArray.push('FizzBuzz');\n } else if (i % value1 == 0) {\n returnArray.push('Fizz');\n } else if (i % value2 == 0) {\n returnArray.push('Buzz');\n } else {\n returnArray.push(i);\n }\n }\n return returnArray;\n}", "title": "" }, { "docid": "dcae96deb9b3dbcf87a9b90074ca50b9", "score": "0.6566163", "text": "function fizzbuzz(num){\n if (typeof(num) != \"number\"){\n return false;\n }\n for(i = 1; i <= num; i++){\n if(i % 3 == 0 && i % 5 != 0){\n console.log(\"Fizz\" + i)\n }\n }\n for(i = 1; i<=num; i++){\n if(i % 3 != 0 && i % 5 == 0){\n console.log(\"Buzz\" + i)\n }\n }\n for(i = 1; i<=num; i++){\n if(i % 3 == 0 && i % 5 == 0){\n console.log(\"Fizz-Buzz\" + i)\n }\n }\n\n}", "title": "" }, { "docid": "5f6ce2da9c40bd2e709f10cfc7c2e9dd", "score": "0.65402347", "text": "function fizzbuzz_5(arr, obj) {\n\t\tfor (i = 0; i < arr.length; i++) {\n\t\t\tif ( (arr[i] % 3 === 0) && (arr[i] % 5 === 0)) {\n\t\t\t\toutput = obj.divisibleByThree + obj.divisibleByFive;\n\t\t\t}\n\t\t\telse if (arr[i] % 3 === 0) {\n\t\t\t\toutput = obj.divisibleByThree;\n\t\t\t}\n\t\t\telse if (arr[i] % 5 === 0) {\n\t\t\t\toutput = obj.divisibleByFive;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toutput = arr[i];\n\t\t\t}\n\n\t\t\t$(\"#fizzbuzz5\").append(\"<li>\" + output + \"</li>\");\n\t\t}\n\t}", "title": "" }, { "docid": "4a5a3e327e4c5fe49f098091ebfa863f", "score": "0.6529709", "text": "function FizzBuzzDisplay(){\n for (i=0;i<=100;i++){\n if (i%15==0) console.log(\"FizzBuzz\");\n else if (i%3==0) console.log(\"Fizz\");\n else if (i%5==0) console.log(\"Buzz\");\n else console.log(i);\n }\n\n}", "title": "" }, { "docid": "d273ec86e5a72514f65ebcbd30782fb0", "score": "0.65294814", "text": "function fizzBuzz(count){\n var i = 0;\n var ints = [];\n for(count;i<count; i++){\n if (count === 0){\n break\n }\n else if((i%3 === 0) && (i%5 === 0)){\n ints.push(\"FizzBuzz\")\n }\n\n else if ((i % 3) === 0){\n ints.push(\"Fizz\")\n }\n else if ((i%5) ===0){\n ints.push(\"Buzz\")\n }\n else {\n ints.push(i)\n }\n }\n\n return ints;\n //console.log(ints);\n}", "title": "" }, { "docid": "f35fe23112ccae55afb025714046a230", "score": "0.65226674", "text": "function fizzbuzz(n){\n\tvar list = [];\n\tif(n > 0){\n\t\tfor(i = 1; i < n; i++){\n\t\t\tif(i % 3 === 0 && i % 5 === 0){\n\t\t\t\tlist.push('Fizz Buzz')\n\t\t\t}\n\t\t\telse if(i % 3 === 0){\n\t\t\t\tlist.push(\"Fizz\")\n\t\t\t}\n\t\t\telse if(i % 5 === 0){\n\t\t\t\tlist.push(\"Buzz\")\n\t\t\t}\n\t\t\telse(list.push(i))\n\t\t}\n\t\treturn list\t\n\t}\n\telse(console.log('Parameter must be a positive number'))\n}", "title": "" }, { "docid": "265bd8303c4be01cd24b2a6f4502ea23", "score": "0.6520244", "text": "function fizzBuzz(val1, val2) {\r\n let fbItems = [];\r\n for (let i = 1; i <= 100; i++)\r\n\r\n if (i % val1 === 0 && i % val2 === 0) {\r\n fbItems.push('fizzbuzz');\r\n }\r\n else if (i % val1 === 0) {\r\n fbItems.push('fizz');\r\n }\r\n else if (i % val2 === 0) {\r\n fbItems.push('buzz');\r\n }\r\n else {\r\n fbItems.push(i);\r\n }\r\n \r\n return fbItems;\r\n}", "title": "" }, { "docid": "ab7e902d33ed9f7ef24c6acaedf5cae5", "score": "0.6510488", "text": "function fizzBuzz() {\n for (let i = 1; i < 101; i++) {\n if (i % 15 === 0) {\n console.log('FizzBuzz');\n } else if (i % 5 === 0) {\n console.log('Buzz')\n } else if (i % 3 === 0) {\n console.log('Fizz')\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "d0da568c7db129a150b871cb1b9d4b94", "score": "0.65091646", "text": "function fizzbuzz(n){\n\tfor(let i = 1; i<=n; i++){\n\t\tif(i % 15 === 0) console.log('fizzbuzz');\n\t\telse if(i % 3 === 0) console.log('fizz');\n\t\telse if(i % 5 === 0) console.log('buzz');\n\t\telse console.log(i);\n\t}\n}", "title": "" }, { "docid": "9b6f63950ed90f94ea4a42d4b80c62a6", "score": "0.6493432", "text": "function fizzBuzz() {\n for(let i = 1; i <= 100; i++) {\n if(i % 15 === 0) {\n console.log('FizzBuzz');\n } else if(i % 3 === 0) {\n console.log('Fizz');\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "69a28ba68499593f57ccaff57fba55a7", "score": "0.6476933", "text": "function fizzbuzz(students){\n // iterating thru number of students \n for (let i = 1; i <= students.length; i++) {\n // i = 15 \n if (i % 3 === 0 && i % 5 !== 0) {\n console.log(\"Fizz\") }\n if (i % 5 === 0 && i % 3 !== 0) {\n console.log(\"Buzz\") }\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"FizzBuzz\")\n }\n console.log(i)\n }\n }", "title": "" }, { "docid": "7b427522a03d89580cff4d14c5050a28", "score": "0.6475498", "text": "function fizzBuzz(array) {\n const newArray = [];\n\n // solution 1:\n // for (let i = 0; i < array.length; i++) {\n // if (array[i] % 3 === 0 && array[i] % 5 === 0) {\n // continue;\n // } else if (array[i] % 3 === 0) {\n // newArray.push(array[i]);\n // } else if (array[i] % 5 === 0) {\n // newArray.push(array[i]);\n // }\n // }\n\n // solution 2:\n array.forEach(ele=> {\n if ((ele % 3 === 0) ^ (ele % 5 === 0)) {\n newArray.push(ele)\n }\n })\n\n return newArray;\n}", "title": "" }, { "docid": "981d792798e8d1dc30d97696e28f27b2", "score": "0.64076805", "text": "function fizzBuzz() {\n\t//var numb = '';\n\tfor(var i = 1; i <= 100; i++) {\n\t\t//numb = numb + ' ' + i;\n\t\tif(i % 3 == 0 && i % 5 ==0) {\n\t\t\tconsole.log('FizzBuzz');\n\t\t} else if(i % 5 == 0) {\n\t\t\tconsole.log('Buzz');\n\t\t} else if(i % 3 == 0) {\n\t\t\tconsole.log('Fizz');\n\t\t} else {\n\t\t\tconsole.log(i);\n\t }\n\t}\n}", "title": "" }, { "docid": "c2643251e8c6bf53eb7d53c8fe3bb02a", "score": "0.64073217", "text": "function makeBubbles(fizzValue, buzzValue) {\n // create an empty array to store values\n let numbers = [];\n\n // checking for each condition and entering the value in to the array\n for (let i = 1; i <= 100; i++) {\n if ((i % fizzValue === 0) && (i % buzzValue === 0)) {\n numbers.push('FizzBuzz');\n } else if (i % fizzValue === 0) {\n numbers.push('Fizz');\n } else if (i % buzzValue === 0) {\n numbers.push('Buzz');\n } else {\n numbers.push(i);\n }\n }\n // return the values\n return numbers;\n}", "title": "" }, { "docid": "4713475edf46e2dbda0b669888013f6e", "score": "0.6383628", "text": "function fizzbuzz13() {\n for (i = 1; i < 101; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log('Fizzbuzz');\n }\n else if (i % 3 === 0) {\n console.log('Fizz');\n }\n else if (i % 5 === 0) {\n console.log('Buzz');\n }\n else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "ff8edda3ada2d6761c650d1c457842d1", "score": "0.6380134", "text": "function fizzBuzz (){\nfor (let i = 1; i <= 100; i++){\n if(i % 3 == 0){\n console.log(\"Fizz\");\n } else if (i % 5 == 0){\n console.log(\"Buzz\");\n }else if( i % 3 == 0 && i % 5 == 0){\n console.log(\"FizzBuzz\");\n }\n\n}\n}", "title": "" }, { "docid": "9510f9affa0a08eed6a33585f56d1dd7", "score": "0.63782954", "text": "function fizzBuzz(n) {\n for(n=1; n<=15; ++n) {// Write your code here\n if (n % 15 === 0) {\n console.log(\"FizzBuzz\")}\n else if (n % 3 === 0) {\n console.log(\"Fizz\")}\n else if (n % 5 === 0) {\n console.log(\"Buzz\")}\n else {\n console.log(n)}\n\n}\n}", "title": "" }, { "docid": "351a0a073ec78bd4e4f5a7b73572253f", "score": "0.6367081", "text": "function fizzbuss(num) {\n if (num % 15 === 0) {\n return \"FizzBuzz\";\n } else if (num % 3 === 0) {\n return \"Fizz\";\n } else if (num % 5 === 0) {\n return \"Buzz\";\n } else {\n return num;\n }\n}", "title": "" }, { "docid": "488e7f2fc9caff1e0b80a66c3ea0d314", "score": "0.6366694", "text": "function fizzBuzz(n) {\n for (let index = 1; index <= n; index++) {\n if (index % 3 === 0 && index % 5 === 0) {\n console.log(\"fizzbuzz\");\n } else if (index % 5 === 0) {\n console.log(\"buzz\");\n } else if (index % 3 === 0) {\n console.log(\"fizz\");\n } else console.log(index);\n }\n}", "title": "" }, { "docid": "f65ca5a90b8ef190eafa582201a9b399", "score": "0.6340695", "text": "function fizzBuzz(n) {\n for (let i = 1; i <= n; i++)\n if (i % 3 === 0 && i % 5 === 0){\n console.log(\"FizzBuzz\");\n } else if (i % 3 === 0){\n console.log('Fizz');\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }", "title": "" }, { "docid": "dbedf13dbf5513bb7f71dfda0fd40262", "score": "0.63338524", "text": "function fizzbuzz(num) {\n i = 1;\n while (i <= num) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"Fizz buzz\");\n } else if (i % 3 === 0) {\n console.log(\"Fizz\");\n } else if (i % 5 === 0) {\n console.log(\"Buzz\");\n } else {\n console.log(i);\n }\n i++;\n }\n}", "title": "" }, { "docid": "6b7924b96be15b889bd9c1439157297a", "score": "0.6326097", "text": "function fizzBuzz() {\n\tfor (let i = 0; i < 100; i++) {\n\t\tif (i % 3 === 0 && i % 5 === 0) {\n\t\t\tconsole.log(\"FizzBuzz\");\n\t\t} else if (i % 5 === 0) {\n\t\t\tconsole.log(\"Fizz\");\n\t\t} else if (i % 3 === 0) {\n\t\t\tconsole.log(\"Buzz\");\n\t\t} else {\n\t\t\tconsole.log(i);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ecebd16e607cf2e69995ea2b58b1b7d7", "score": "0.6325301", "text": "function fizzbuzz () {\n \n for (num = 1; num <100; num++){\n\n if (num % 3 === 0 && num % 5 === 0){\n\n console.log('fizzbuzz')\n }\n if (num % 3 === 0){\n\n console.log('fizz')\n }\n\n else if (num % 5 === 0){\n\n console.log('buzz')\n }else {\n\n console.log(num)\n }\n}\n\n\n}", "title": "" }, { "docid": "c920168d5569341b918b4cc117a30ab5", "score": "0.63226825", "text": "function FizzBuzzD(value1, value2) {\n let returnArray = [];\n for (let i = 1; i <= 100; i++) {\n returnArray[i] =\n (i % value1 == 0 ? \"Fizz\" : \"\") + (i % value2 == 0 ? \"Buzz\" : \"\") || i;\n }\n return returnArray;\n}", "title": "" }, { "docid": "5e43d2aeb0f6308486d87147aedce2e9", "score": "0.6319813", "text": "function fizzbuzz(arrayOfPairs) {\r\n for (i = 1; i < 100; i++) {\r\n let result = i + ' ';\r\n arrayOfPairs.forEach(pair => {\r\n const divisible = (i % Object.keys(pair)[0]) == 0;\r\n if (divisible) {\r\n result = result + Object.values(pair)[0];\r\n }\r\n });\r\n console.log(result);\r\n }\r\n }", "title": "" }, { "docid": "35295c011a76f3c0e2e6614d48a53385", "score": "0.63124216", "text": "function fizzBuzz(X,Y,N){\n\tvar result = [];\n\tfor(var i=1; i<=N; ++i){\n\t\tvar fb = '';\n\t\tif(i%X==0){\n\t\t\tfb+=\"F\";\n\t\t}\n\t\tif(i%Y==0){\n\t\t\tfb+=\"B\";\n\t\t}\n\t\tresult.push( (fb=='')?i:fb );\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "14c234f4ba06ccf377d37177af020585", "score": "0.63091487", "text": "function fizzBuzz() {\n for (let i=1; i<=100; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(`FizzBuzz (${i})`);\n } else if (i % 3 === 0 && i % 5 !== 0) {\n console.log(`Fizz (${i})`);\n } else if (i % 5 === 0 && i % 3 !== 0) {\n console.log(`Buzz (${i})`);\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "3ffe4ec16dc9dfa24a34e53fa634d090", "score": "0.6290053", "text": "function fizzBuzz(num) {\n\n if (num % 15 === 0) {\n return 'fizzbuzz'\n }\n\n if (num % 3 === 0) {\n return 'fizz'\n }\n\n if (num % 5 === 0) {\n return 'buzz'\n }\n\n return num\n}", "title": "" }, { "docid": "6e6f548e3bf327941e576936ea5eb041", "score": "0.6289949", "text": "function preFizz(n) {\n let arr = []\n for ( let i=1 ; i<=n; i++){\n arr.push(i)\n }\n return arr\n }", "title": "" }, { "docid": "7ce028564a5a4d3d5f26eb72231ba322", "score": "0.6281662", "text": "function fizzBuzzList(n) {\n let result = \"\";\n for (var i = 0; i < n; i++) {\n if (isDivBy3and5(i)) {\n result = result + i + \" \";\n }\n }\n return result;\n}", "title": "" }, { "docid": "633037a5e6de6684352e2c1b576e639b", "score": "0.6275028", "text": "function fizzBuzz(max){\n var fbSelection = [];\n//Feedback: Newline here\n for(var i=0; i<max; i++){//Feedback: Spacing\n if((i%3 === 0 && i%5!==0)||(i%3 !== 0 && i%5===0)){\n fbSelection.push(i);\n }\n }\n//Feedback: Newline here\n return fbSelection;\n}", "title": "" }, { "docid": "e4e5d2553c9b454155c96db774eefbf8", "score": "0.62610406", "text": "function fizzbuzz(n) {\n for (let i = 1; i <= n; i++){\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"fizzbuzz\");\n } else if (i % 3 === 0) {\n console.log(\"fizz\");\n } else if (i % 5 === 0) {\n console.log(\"buzz\")\n } else {\n console.log(i)\n }\n}\n}", "title": "" }, { "docid": "3f236b8d1c7abf466f13594eaa18df51", "score": "0.6257702", "text": "function fizzBuzz(num)\n{\n if (num %3 == 0 && num %5 == 0)\n {\n return \"FizzBuzz\"; \n }\n else if(num %3 ==0)\n {\n return \"Fizz\";\n\n }\n else if (num %5 ==0)\n {\n return \"Buzz\"\n }\n \n else {\n return num; \n }\n}", "title": "" }, { "docid": "7a9a938cee0a66b17bb01d49ab109983", "score": "0.6256143", "text": "function fizzbuzzer(num) {\n if (num % 3 === 0 && num % 5 === 0) {\n return 'FizzBuzz';\n }\n else if (num % 5 === 0) {\n return 'Buzz';\n }\n else if (num % 3 === 0) {\n return 'Fizz';\n }\n else {\n return 'McClane';\n }\n}", "title": "" }, { "docid": "214be4abeeb77d846901aa23cd3f7177", "score": "0.6234948", "text": "function fizzbuzz(num)\n{\n \n for (var x = 0; x <= num; x++)\n { \n if ((x%5 == 0) && (x%3 == 0)) \n { \n $('.fizzbuzz').append('<p>fizzbuzz</p>'); \n }\n else if ((x%5 == 0) && (x%3 != 0))\n { \n $('.fizzbuzz').append('<p>buzz</p>'); \n }\n else if ((x%5 != 0) && (x%3 == 0))\n { \n $('.fizzbuzz').append('<p>fizz</p>'); \n }\n else\n { \n $('.fizzbuzz').append('<p>' + x + '</p>'); \n }\n }\n}", "title": "" }, { "docid": "5f5edd09a8300ba933fddca0c0b968b0", "score": "0.62281835", "text": "function fizzBuzz(n) {\n for (var i = 1; i <= n; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"fizzbuzz\");\n } else if (i % 3 === 0) {\n console.log(\"fizz\");\n } else if (i % 5 === 0) {\n console.log(\"buzz\");\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "4bdb58a17c1e3b1e30af9928327393b5", "score": "0.62140316", "text": "function fizzBuzz(n) {\n for (i = 1; i <= n; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log('fizzbuzz');\n }\n else if (i % 3 === 0) {\n console.log('fizz');\n }\n else if (i % 5 === 0) {\n console.log('buzz')\n }\n else\n console.log(i)\n }\n}", "title": "" }, { "docid": "5ad8675f5a75079a873676f5a2ff24aa", "score": "0.6207624", "text": "function fizzBuzz() {\n for(let i = 1; i <= 100; i++) {\n if(i % 3 === 0 && i % 5 === 0) {\n console.log('FizzBuzz');\n } else if(i % 3 === 0) {\n console.log('Fizz');\n } else if(i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "33fe0bfb2a9b370e1b1cf4a4e48f6e1a", "score": "0.62038827", "text": "function fizzbuzz(){\n for(let i = 0; i < 100; i++){\n if(i % 3 === 0 && i % 5 === 0){\n console.log('fizzbuzz', i)\n } else if(i % 3 === 0){\n console.log('fizz', i)\n } else if(i % 5 === 0){\n console.log('buzz', i)\n }\n }\n}", "title": "" }, { "docid": "3d5259aa46d4dbad3f240758d443ef6a", "score": "0.61852455", "text": "function check3(num) {\n\tif (num % 5 == 0) {\n\t\tconsole.log(\"fizz\");\n\t}\n}", "title": "" }, { "docid": "e88b085eb07505ba73c65f22625175b5", "score": "0.6184534", "text": "function doFizzBuzz() {\n // FILL THIS IN\n for (var i = 1; i <= 100; i++) {\n console.log(i);\n if ( (i % 3) == 0) {\n console.log('Fizz')\n } else if ((i % 5) == 0 ) {\n console.log('Buzz')\n } else {\n console.log('FizzBuzz');\n }\n }\n return true;\n }", "title": "" }, { "docid": "fa62e203ea776775e435e57dfca0854d", "score": "0.61803055", "text": "function fizzBuzz () {\n for (let x=1; x<100; x++) {\n if ((x%3 === 0) && (x%5!==0))\n console.log (\"Fizz\")\n else if ((x%5 === 0) && (x%3 !==0))\n console.log (\"Buzz\")\n else if ((x%5 === 0) && (x%3 === 0))\n console.log (\"FizzBuzz\")\n else console.log (x)\n }\n}", "title": "" }, { "docid": "38d7f6b10a4e222dbbee330ed157aaed", "score": "0.61742115", "text": "function fizzbuzz() {\n for (let i = 1; i <= 100; i++) {\n \tif (i % 3 === 0 && i % 5 === 0) {\n console.log('FizzBuzz');\n\t} else if (i % 3 === 0) {\n console.log('Fizz');\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "23e70635c6ac6ffcd69b60fcb5b29bb2", "score": "0.6167044", "text": "function fizzBuzz(){\n for(let i = 1; i <= 100; i++){\n if(i % 3 === 0 && i % 5 === 0){\n console.log(\"FizzBuzz\");\n } else if (i % 3 === 0){\n console.log(\"Fizz\");\n } else if (i % 5 === 0){\n console.log(\"Buzz\");\n }\n console.log(i);\n }\n}", "title": "" }, { "docid": "db5777aba4c9460f9ad945bb888348f8", "score": "0.6163666", "text": "function fizzBuzz () {\n for (let i = 1; i <= 100; i++) {\n if (i % 3 === 0) {\n if (i % 5 === 0) {\n console.log('FizzBuzz');\n } else {\n console.log('Fizz');\n }\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "318ca37f1a802e210c2836998264cc68", "score": "0.616182", "text": "function fizzBuzz() {\n for (let i = 1; i <= 100; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log('FizzBuzz');\n } else if (i % 3 === 0) {\n console.log('Fizz');\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "44befc6318e7aa9a0a325d5aff414f65", "score": "0.61589843", "text": "function fizzBuzz(max) {\n if (typeof max !== 'number') {\n throw TypeError('needs to be a number');\n }\n if (max < 0) {\n throw new Error();\n }\n\n const array = [];\n for (let i = 0; i < max; i += 1) {\n if (i % 3 === 0 && i % 5 !== 0) {\n array.push(i);\n } else if (i % 5 === 0 && i % 3 !== 0) {\n array.push(i);\n }\n }\n return array;\n}", "title": "" }, { "docid": "fb7dccfcf84cbbede8799e547e34eb0f", "score": "0.61581206", "text": "function bai3(arrayofnum) {\n var EvenNumbers = [];\n for (var i = 0; i<arrayofnum.length; i++) {\n if((EvenNumbers[i]%2) == 0) {\n EvenNumbers.push(arrayofnum[i]);\n }\n }\n EvenNumbers.sort(function(a,b){return (a-b)});\n return EvenNumbers;\n }", "title": "" }, { "docid": "c21c52c40679ac6b41eda19b9a4dfead", "score": "0.61463565", "text": "function fizzBuzz(num) {\n for (let i = 1; i <= num; i++) {\n // this if statement needs to be read first so that a number\n // divisible by both 3 & 5 is not picked up by the other if statements\n if (i % 3 === 0 && i % 5 === 0) {\n console.log('FizzBuzz')\n } else if (i % 3 === 0) {\n console.log('Fizz')\n } else if (i % 5 === 0) {\n console.log('Buzz')\n } else { console.log(i)}\n }\n}", "title": "" }, { "docid": "fe5a8dbb6edc60b253e67b550bbb24f3", "score": "0.61436635", "text": "function fizzBuzz(){\n for (var i = 0; i <= 100; i++) {\n if(i % 3 == 0 && i % 5 == 0 ){\n console.log(i + ' FizzBuzz');\n }\n else if (i % 3 == 0) {\n console.log(i + \" Fizz\");\n }\n else if (i % 5 == 0) {\n console.log(i + \" Buzz\");\n }\n else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "a68df01b5e1cc8f5a87074cbf86c37e3", "score": "0.6122528", "text": "function preFizz(n) {\n const arr = [];\n for(let i = 1; i <= n; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "09590b2ac0fcb1e7a5ff348dadfbe9ac", "score": "0.6121683", "text": "function fizzBuzz(num) {\n if (((num % 3) == 0) && ((num % 5) == 0)) {\n return \"FizzBuzz\";\n } else if ((num % 3) == 0) {\n return \"Buzz\";\n } else if ((num % 5) == 0) {\n return \"Fizz\";\n }\n}", "title": "" }, { "docid": "4642395d6c97976b3ac8655ce96fa752", "score": "0.61046743", "text": "function fizzBuzz() {\n let num = 1;\n\n while (num < 100) {\n if (num % 3 === 0) {\n console.log('Fizz');\n } else if (num % 5 === 0) {\n console.log('Buzz');\n } else if (num % 5 === 0 && num & (3 === 0)) {\n console.log('FizzBuzz');\n } else {\n console.log(num);\n }\n num += 1;\n }\n}", "title": "" }, { "docid": "5fc25cab1d8d87078a0244a5ec1c58f0", "score": "0.6096759", "text": "function fizbuzz(num) {\n for (let i = 1; i <= num; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log('Fizzz Buzzzzz');\n } else if (i % 5 === 0) {\n console.log('fizzzzzz');\n } else if (i % 3 === 0) {\n console.log('buzzzzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "2a69592d589eb4a0659faeeb85b562c3", "score": "0.60948634", "text": "function fizzBuzz(num) {\n let fizz = 0;\n let buzz = 0;\n let fizzB = 0;\n let none = 0;\n\n if (isNaN(num)) {\n document.write(\n \"The given input (\" +\n num +\n \") cannot be accepted because it is not an integer. <br>\"\n );\n } else {\n //Logic accounts for fizzbuzz operation\n for (var i = 1; i <= num; i++) {\n if (i % 15 === 0) {\n fizzB = fizzB + 1;\n } else if (i % 3 === 0) {\n fizz = fizz + 1;\n } else if (i % 5 === 0) {\n buzz = buzz + 1;\n } else {\n none = none + 1;\n }\n }\n printData(fizz, buzz, fizzB, none, num);\n }\n}", "title": "" } ]
f155cfe81808b3bb0436383fbc2ee48a
Scrape a parsed HTML document for links.
[ { "docid": "0d9ed1e94986b4570bf22e1a78a1af4d", "score": "0.60419893", "text": "function scrapeTree(document)\n{\n\tvar base,link,links,rootNode;\n\t\n\tlinks = [];\n\trootNode = findRootNode(document);\n\t\n\tif (rootNode != null)\n\t{\n\t\tbase = findBase(rootNode);\n\t\t\n\t\tfindLinks(rootNode, function(node, attrMap, attrName, url)\n\t\t{\n\t\t\tlink = linkObj(url);\n\t\t\tlink.html.attrs = attrMap;\n\t\t\tlink.html.attrName = attrName;\n\t\t\tlink.html.base = base;\n\t\t\tlink.html.index = links.length;\n\t\t\tlink.html.selector = getSelector(node);\n\t\t\tlink.html.tag = stringifyNode(node);\n\t\t\tlink.html.tagName = node.nodeName;\n\t\t\tlink.html.text = getText(node);\n\t\t\t\n\t\t\tlinks.push(link);\n\t\t});\n\t}\n\t\n\treturn links;\n}", "title": "" } ]
[ { "docid": "ce81930b090c220a0e34ed6b35f7fdab", "score": "0.6585213", "text": "function parsePageSourceAndFetchLinks($) {\r\n var links = $('a');\r\n links.each(function() {\r\n var ref = $(this).attr('href');\r\n if(ref) {\r\n //Skipping relative URLS for now.\r\n if(ref.indexOf(\"//\") === 0) {\r\n urlArr.push(\"http:\" + ref);\r\n } else if(ref.indexOf(\"http\") === 0 || ref.indexOf(\"https\") === 0){\r\n urlArr.push(ref);\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "704eadb7faa0a1d50fdbec90ad17a922", "score": "0.65170556", "text": "function parseHTML(resolvedUrl, html, requestTime) {\n\n var startedDOMParse = new Date(),\n $ = cheerio.load(html);\n\n data.resolvedUrl = resolvedUrl;\n data.requestTime = requestTime;\n\n // get rel= me links from 'a' or 'link' tags\n $(\"a[rel~=me], link[rel~=me]\").each(function (i, elem) {\n\n // issue 41 - https://github.com/dharmafly/elsewhere/issues/41\n // discount paging link with rel=me and either rel=next or rel=prev\n var rel = $(elem).attr('rel').toLowerCase();\n if (rel.indexOf('next') === -1 && rel.indexOf('prev') === -1) {\n var href = $(elem).attr('href');\n\n // check its not empty\n if(href && fn.trim(href) !== ''){\n // take a page URL, and a relative href and resolve it\n if (href.substring(0,1) === '/') {\n href = urlParser.resolve(url, href);\n }\n data.links.push(href);\n logger.log('found link: ' + href + ' in page: ' + url);\n }\n }\n\n });\n\n logger.log('links found: ' + data.links.length + ' at: ' + url);\n\n // get the title, regex gets rid of new line characters etc.\n data.title = fn.trim($('title').text().replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\n\n // get the favicon\n data.favicon = resolveFavicon($, data.resolvedUrl || url);\n\n var endedDOMParse = new Date();\n var ms = endedDOMParse.getTime() - startedDOMParse.getTime();\n logger.log('time to parse DOM: ' + ms + 'ms - ' + url);\n\n callback(null, data);\n }", "title": "" }, { "docid": "c021e7af4986e6a96e56d37320fe426c", "score": "0.6515893", "text": "function scrapLinks() {\r\n var max = links_details.length;\r\n var start = 0;\r\n totalItems = links_details.length;\r\n scrapPage(links_details[start],links_details,scrapping_options.start,scrapping_options.end);\r\n}", "title": "" }, { "docid": "970a928f013c5a718b4929d87dd6577d", "score": "0.64137834", "text": "function parseLinks()\n{\n\t$(\"a\").each(function()\n\t{\n\t\tif ($(this).attr(\"href\").indexOf(\"://\") >= 0)\n\t\t{\n\t\t\t$(this).attr(\"target\", \"_blank\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a87737777a5be258d45d90741dbd2239", "score": "0.6380471", "text": "static getLinksFromHTML(content, pageURL){\r\n if(content != null){\r\n var position = content.indexOf('href')\r\n while(position !== -1){\r\n ShowFileUse.getFileNamesFromLinks(content, position, 6, pageURL)\r\n position = content.indexOf('href', position + 1)\r\n }\r\n \r\n position = content.indexOf('src')\r\n while(position !== -1){\r\n ShowFileUse.getFileNamesFromLinks(content, position,6, pageURL)\r\n position = content.indexOf('src', position+1)\r\n }\r\n }\r\n }", "title": "" }, { "docid": "164a87eeba2dde4fc7b2459cd4d89470", "score": "0.6327788", "text": "function processLinks()\n{\n var linksList = document.links; // get the document's links\n var contents = \"<ul>\";\n\n // concatenate each link to contents\n for ( var i = 0; i < linksList.length; ++i )\n {\n var currentLink = linksList[ i ];\n contents += \"<li><a href='\" + currentLink.href + \"'>\" + \n currentLink.innerHTML + \"</li>\";\n } // end for\n\n contents += \"</ul>\";\n document.getElementById( \"links\" ).innerHTML = contents;\n} // end function processLinks", "title": "" }, { "docid": "23a1c6c43e42e8dca290f1db3b118b9d", "score": "0.6239221", "text": "function parsePage(page, anchors = []) {\n\n /*\n * Make an XMLHttpRequest\n */\n function makeRequest (method = \"GET\", href) {\n\n let xhr = new XMLHttpRequest();\n\n xhr.open(method, href, true);\n xhr.responseType = \"document\";\n xhr.onload = function() {\n parsePage(this.responseXML, anchors);\n updateLinks(anchors);\n };\n xhr.onerror = function () {\n console.error(\"failed with\" , this.status , xhr.statusText);\n };\n xhr.send();\n }\n\n let re = /^https?:\\/\\/.*(?!(reader).)*(\\.cbr|\\.cbz|\\.rar|\\.zip)$/;\n\n Array.prototype.forEach.call(page.getElementsByTagName(\"a\"), (anchor) => {\n if (anchor.href.startsWith(window.location.href) && re.test(anchor.href)) {\n anchors.push(anchor);\n } else if (anchor.href.startsWith(page.URL) && anchor.innerText.endsWith(\"/\") && !(anchor.href === page.URL)) {\n makeRequest(\"GET\", anchor.href, anchors);\n }\n });\n return anchors;\n}", "title": "" }, { "docid": "46162ad3f782fcd910f70b354e4a2bc6", "score": "0.61522514", "text": "function getLinks(baseUrl, url, links) {\r\n\tlinks = links || [];\r\n\turl = url || baseUrl;\r\n\tconsole.log('get links '+url);\r\n\r\n\tfunction done(error, response, body) {\r\n\t\tfunction get(i) {\r\n\t\t\treturn function() {\r\n\t\t\t\tgetContents(links[i], i + 1);\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (error) {\r\n\t\t\tconsole.log(error);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar $ = cheerio.load(body);\r\n\r\n\t\t\t// scrape links from the page\r\n\t\t\tvar l = $(\"#main-content .view-content .teaser h2 a\");\r\n\r\n\t\t\tl.each(function(index) {\r\n\t\t\t\tlinks.push(absolute(baseUrl, this.attribs.href));\r\n\t\t\t});\r\n\r\n\t\t\t// scrape link to the next page\r\n\t\t\tvar next = $(\"#main-content .pager-next a\").first();\r\n\r\n\t\t\tif (next && next.length) {\r\n\t\t\t\tgetLinks(baseUrl, absolute(baseUrl, next.attr('href')), links);\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log('getting contents (' + links.length + ')');\r\n\t\t\t\tlinks = links.reverse();\r\n\t\t\t\tgetContents(links[0], 0, links);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trequest(url, done);\r\n}", "title": "" }, { "docid": "3cddd28e5232f44e01ccb65abab5ed3e", "score": "0.6138849", "text": "function extractLinks(html) {\n\n var importTags = [];\n\n // Add global tags to local registry\n for (var key in this.registry) {\n importTags.push({name: key, src: this.registry[key]});\n }\n\n importTags = importTags.concat(parseTags(html, 'e-link'));\n\n // Turn custom tags into generic tags\n importTags.forEach(function (tag) {\n html = html.replace(tag.html, '');\n if (tag.name && tag.src) {\n var tagName = (tag.src.indexOf('.html') !== -1) ? 'e-partial' : 'e-element';\n html = html.replace(new RegExp('<e-' + tag.name, 'g'), '<' + tagName + ' src=\"' + tag.src + '\" ');\n html = html.replace(new RegExp('</e-' + tag.name, 'g'), '</' + tagName);\n }\n });\n\n return {\n html: html.trim(),\n imports: importTags.filter(function (importTag) {\n return (importTag.src.indexOf('.html') === -1);\n })\n };\n }", "title": "" }, { "docid": "0b49b597d8c88170f4aa930f48af852e", "score": "0.6088375", "text": "function doGetLinks(document) {\n xhr_links.addEventListener('readystatechange', processGetLinks, false);\n xhr_links.open('GET', 'links.php?links=' + document, true);\n xhr_links.send(null);\n}", "title": "" }, { "docid": "ecbc95e1da726b805ab646d9dd1a8da5", "score": "0.60815144", "text": "function extractLinks() {\n console.log(\"Extracting links.\");\n findChildLinks(commonAncestor(node1, node2));\n }", "title": "" }, { "docid": "e2d117eca3ab7e11e5bd28c49622a5d1", "score": "0.60679257", "text": "collectLinks($) {\n const __self = this;\n const links = $(\"a\");\n links.each(function () {\n const link = $(this).attr('href');\n if (typeof link !== 'string' || link.startsWith('#') || link.startsWith('mailto:') || link.startsWith('javascript:')) {\n return;\n } else if (link.startsWith('/')) {\n __self.pagesToVisit.push(__self.baseUrl + link);\n } else if (link.startsWith(__self.baseUrl)) {\n __self.pagesToVisit.push(link);\n } else {\n __self.externalLinks.add(link);\n }\n });\n }", "title": "" }, { "docid": "fe2eedcf0bf2daf568bed94104919878", "score": "0.60143673", "text": "function dataExtracter(html){\n //search tool\n let searchTool = cheerio.load(html);\n let anchorrep = searchTool('a[data-hover=\"View All Results\"]');\n let link = anchorrep.attr(\"href\");\n let fullAllMatchPageLink = `https://www.espncricinfo.com${link}`;\n console.log(fullAllMatchPageLink);\n\n request(fullAllMatchPageLink, allMatchPageCb);\n}", "title": "" }, { "docid": "270417648fd9463378ca19c7e5d31700", "score": "0.60071874", "text": "function handleSuccess(response){\n // shorthand for the data coming from the response\n var doc = response.data;\n\n //regex was the second thing that came to mind for parsing the document to pull the <a> tags out. I attempted doc.getElementsByTagName('a') first but to no avail. I found this regex on stack overflow. So powerful, I would love to read more about regex.\n var regex = /<a[\\s]+([^>]+)>((?:.(?!\\<\\/a\\>))*.)<\\/a>/g;\n var aTags = doc.match(regex);\n var linkDiv = angular.element('.linkResult');\n for (i = 0; i < aTags.length; i++){\n linkDiv.append(aTags[i] + \"<br/>\");\n }\n console.log(\"the a tags\", aTags);\n }", "title": "" }, { "docid": "a9a523fe0bbad63ed8d7f582188e983a", "score": "0.59144264", "text": "function parsePage(data) {\n\n var links = {};\n //data = $(data);\n\n //Senaste nytt - top off page\n var el = $(data).find('.slide').find('.soft-unlocked').parent().parent();\n $.each(el, function (i, e) {\n var text = $(e).text().trim();\n var link = $(e).attr(\"href\");\n //console.log(link + \" \" + text);\n links[link] = text;\n });\n\n\n //Rest of page\n el = $(data).find('.teaser-content-wrapper .content .soft-unlocked.premium-label.m-icon-plus').closest('.content').find('a').not('.teaser-text');\n \n $.each(el, function (i, e) {\n var text = $(e).find('h2').text().trim();\n var link = $(e).attr(\"href\");\n //console.log(link + \" \" + text);\n links[link] = text;\n });\n\n readCacheAndNotifyParametersFromStorage(function(linksCache,notify){\n updateCacheAndNotify(linksCache,notify,links);\n });\n\n}", "title": "" }, { "docid": "a2761f79788d91f02a77b2b930fc8c2d", "score": "0.59004647", "text": "function crawl() {\n if (pagesToVisit.length <= 0) {\n console.log(\"Parsing JSON...\");\n movies = parseJson(movies);\n finished = true;\n return resolve(movies);\n }\n \n // Caso a pesquisa por links absolutos não tenha sido feita\n if (!linksFound) {\n nextPage = START_URL;\n } else {\n // Transformando o Set em Array para utilizar a função pop()\n pagesToVisit = Array.from(pagesToVisit);\n var nextPage = pagesToVisit.pop();\n }\n\n visitPage(nextPage, crawl);\n }", "title": "" }, { "docid": "51d02b98a53fe9e83f0e583a9748ffb2", "score": "0.5870124", "text": "function scrapeLinks(links){\n var linksSubset = links.slice(0,450) //change to all links.\n var downloadPageJobs = _.map(linksSubset, function(link){\n var job = function(callback) {\n console.log(\"Downloading \" + link.href)\n getPageText(\"http://www.dailymail.co.uk/\" + link.href, function(err, text){\n writeTextToFile(text)\n callback()\n });\n }\n return job\n })\n //4.Call frequency.analyse when download process is complete\n async.parallelLimit(downloadPageJobs, 5, function(err){\n console.log(\"Finished processing downloadPageJobs!\")\n frequency.analyse();\n })\n}", "title": "" }, { "docid": "7df597c78687f31477f26c54bbf6dbf8", "score": "0.5830809", "text": "function gatherAnchorTags(){\n if(debug) console.log(\"here\");\n $(\"a\").each(function(){\n links.push({\n text: this.text,\n url: this.href\n });\n });\n if(debug) console.log(\"links: \" + links[0].url);\n}", "title": "" }, { "docid": "3f5d49c37ba607c81f48333f25124221", "score": "0.57589704", "text": "function processGetLinks() {\n if (xhr_links.readyState === XMLHttpRequest.DONE && xhr_links.status === 200) {\n //Remove the registered event\n xhr_links.removeEventListener('readystatechange', processGetLinks, false);\n\n // Get response\n var myResponse = JSON.parse(this.responseText);\n\n // Delete current links on the page, if any\n if (document.getElementsByTagName('nav')[0])\n document.getElementsByTagName('nav')[0].parentNode.removeChild(document.getElementsByTagName('nav')[0]);\n\n // create new nav element\n var nav = document.createElement('nav');\n\n // if links array isn't empty, add the links to the page\n // myResponse may contain several arrays with links\n // for each array\n for (var linksArray in myResponse) {\n if (myResponse.hasOwnProperty(linksArray)) {\n\n // first create a links section\n var linksSection = document.createElement('ul');\n\n // next we add links to this section\n for (var link in myResponse[linksArray]) {\n if (myResponse[linksArray].hasOwnProperty(link)) {\n\n // create a new link element <a>\n var linkElement = document.createElement('a');\n linkElement.setAttribute('href', myResponse[linksArray][link]);\n linkElement.innerHTML = firstToUppercase(link);\n\n // create a new list element <li> and append link element\n var listElement = document.createElement('li');\n listElement.appendChild(linkElement);\n\n // append list element to list of links\n linksSection.appendChild(listElement);\n }\n }\n }\n // Add links to nav element\n nav.appendChild(linksSection);\n }\n // append links to menu\n var menu = document.getElementsByTagName('aside')[0];\n menu.appendChild(nav);\n }\n}", "title": "" }, { "docid": "ab90c4756897b6506e0c655897e85c80", "score": "0.5733445", "text": "function extractURLs (body) {\n var urls = []\n\n var parser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n if (attribs.href && isValidUrl(attribs.href)) {\n urls.push(attribs.href)\n }\n }\n })\n\n parser.write(body)\n parser.end()\n\n return urls\n}", "title": "" }, { "docid": "0200f464d35aad4b1bc85ec8dbcbbb03", "score": "0.5719214", "text": "function readLink(response, linkListStore) {\n let parentId = uuidv1();\n \n level++;\n \n response.$(eachElement).each(function() {\n let link = response.$(this).find(anchorElement).attr('href');\n \n if(link) {\n const linkToParser = baseUrl + link;\n let id = uuidv1();\n \n linkListStore.push({url: linkToParser, parentId: parentId, id: id});\n saveLink(parentId, linkToParser, id);\n }\n });\n \n}", "title": "" }, { "docid": "1858cee3df5bfa5ce7b51f7675509a43", "score": "0.5711944", "text": "async function parseWebpage(url, callback) {\n isSubstack(url, (result) => {\n if (result === true) {\n getSubstackPubName(url, (pubName) => {\n getSubstackLinks(pubName, callback);\n });\n } else {\n // Not substack\n const options = {\n url,\n headers: {\n \"User-Agent\": \"request\",\n },\n };\n request(options, (err, res, body) => {\n if (err) {\n console.log(err);\n callback([]);\n return;\n }\n const nodes = findRoot(domParser(body));\n let foundLinks = []; // dict of [link: weight]\n\n nodes.forEach((node) => {\n foundLinks = foundLinks.concat(traverser(node, 0, parentTypes.UNKNOWN, false, false));\n });\n\n const cleanedLinks = cleanLinks(foundLinks, url); // TODO converting dict to list needs to be moved out of this step\n const scoredLinks = scoreLinks(cleanedLinks, url);\n if (logStatus) { console.log(\"scored\", scoredLinks); }\n const chosenLinks = pickLinks(scoredLinks);\n const formattedLinks = formatLinks(chosenLinks, extractBaseUrl(url));\n const dedupedLinks = removeDuplicates(formattedLinks);\n\n if (logStatus) { console.log(\"Extracted Links:\", dedupedLinks); }\n\n callback(dedupedLinks);\n });\n }\n });\n}", "title": "" }, { "docid": "9d90b8f7bb21e6732bfd307430e3ff8b", "score": "0.5699792", "text": "function findRSSLinks(html){\n var doc = parseDOM(html);\n var links = doc ? doc.querySelectorAll(\"link[type='application/rss+xml'], link[type='application/atom+xml']\") : [];\n var result = [];\n\n var href;\n for(var i=0; i<links.length; ++i){\n if(href = links[i].getAttribute('href')){\n result.push(href);\n }\n }\n return result.length ? result : null;\n }", "title": "" }, { "docid": "8f32a5f3b74b81c3e9971f66f02a1ec7", "score": "0.56246537", "text": "function getLinks() {\n console.log('SyncanoNews::getLinks');\n $links.empty();\n connection.DataEndpoint.please().fetchData({name: 'get_news_items'})\n .then(function(links) {\n links.forEach(function(link) {\n var element = linkTemplate\n .replace('{id}', link.id)\n .replace('{url}', link.url)\n .replace('{title}', link.title)\n .replace('{upvotes}', link.upvotes);\n $links.prepend(element);\n });\n })\n .catch(function(error) {\n console.error(error);\n });\n }", "title": "" }, { "docid": "e0681258508b7f20a9e28626ce8a0720", "score": "0.5610954", "text": "function callback(error, response, html) {\n if (!error) {\n let manipulationTool = cheerio.load(html);\n let allAnchors = manipulationTool(\".no-underline.d-flex.flex-column\");\n\n for (let i = 0; i < allAnchors.length; i++) {\n topicProcessor(\n \"https://github.com/\" + manipulationTool(allAnchors[i]).attr(\"href\"),\n manipulationTool(manipulationTool(allAnchors[i]).find(\"p\")[0])\n .text()\n .trim()\n );\n }\n }\n}", "title": "" }, { "docid": "b6dd852e75dff587a75fedb00617951d", "score": "0.5600027", "text": "function parseOutboundLinks(doc) {\n\tvar pageUrl = doc.item.url,\n\t\t$ = cheerio.load(doc.body);\n\n\treturn $('a[href]')\n\t\t.get() // array of nodes\n\t\t.map(function(node) {\n\t\t\t// Extract the link URL\n\t\t\tvar href = $(node).attr('href');\n\n\t\t\t// Resolve relative URLs against the page URL\n\t\t\treturn url.resolve(pageUrl, href);\n\t\t})\n\t\t.filter(function(resolvedUrl) {\n\t\t\t// Only return outbound URLs\n\t\t\tif (resolvedUrl == pageUrl) return false;\n\n\t\t\t// Only return http[s] URLs\n\t\t\tif (!httpRegex.test(resolvedUrl)) return false;\n\n\t\t\treturn true;\n\t\t});\n}", "title": "" }, { "docid": "7fe0d9ed140324b820f19ccbcbb70f0f", "score": "0.5589324", "text": "function extractUrls (hmtlFileName){\r\n var data = fs.readFileSync(hmtlFileName);\r\n var $ = cheerio.load(data);\r\n var urls = [];\r\n $('A').each(function(i,element){\r\n urls.push($(element).attr());\r\n });\r\n return urls;\r\n }", "title": "" }, { "docid": "acf8cda5d46720bfd943627b74905c22", "score": "0.55785245", "text": "function searchLinks() {\n return cleanLinks(this.evaluate(function _fetchInternalLinks() {\n return [].map.call(__utils__.findAll('a[href]'), function(node) {\n return node.getAttribute('href');\n });\n }), this.getCurrentUrl());\n}", "title": "" }, { "docid": "562e6100889e670f84c3bb3ea4bb53af", "score": "0.557331", "text": "function processHtml(html) {\n const $ = cheerio.load(html, {\n decodeEntities: false\n });\n\n const assets = new Set();\n\n // Processing internal links\n $('a[data-internal=true]').each(function() {\n const $a = $(this);\n\n $a.removeAttr('data-internal');\n\n assets.add($a.attr('href'));\n });\n\n // Building custom output\n let output = '';\n\n $('body > *').each(function() {\n const $this = $(this);\n const tag = $this.prop('tagName');\n\n // Paragraphs\n if (tag === 'P') {\n output += `<p>${$this.html()}</p>`;\n }\n\n // Titles\n else if (TITLE.test(tag)) {\n const level = tag[tag.length - 1];\n\n // TODO: .html rather to handle links\n output += `<h${level}>${$this.text()}</h${level}>`;\n }\n\n // Lists\n else if (tag === 'UL') {\n output += `<ul>${$this.html()}</ul>`;\n }\n else if (tag === 'OL') {\n output += `<ol>${$this.html()}</ol>`;\n }\n\n // Raw blocks\n else if (tag === 'PRE') {\n output += entities.decode($this.text().replace(/^\\s+/g, ''));\n }\n\n // Atomics\n else if (tag === 'FIGURE') {\n\n // Images\n if ($this.has('img').length) {\n const $img = $this.find('img');\n\n const src = $img.attr('src'),\n width = $img.data('width'),\n height = $img.data('height');\n\n // TODO: What about squares?\n // TODO: keep with and height to help with browser rendering\n const className = width > height ? 'landscape' : 'portrait';\n\n assets.add(src);\n\n output += `<img class=\"${className}\" src=\"${src}\" />`;\n }\n\n // Iframes\n else {\n const $iframe = $this.find('iframe');\n const internal = !!$iframe.data('internal');\n\n const src = $iframe.attr('src');\n\n if (internal)\n assets.add(src);\n\n output += `<iframe src=\"${src}\"></iframe>`;\n }\n }\n });\n\n return {html: output, assets};\n}", "title": "" }, { "docid": "58f5285a4bd7c4a381ad9cd67b6919d3", "score": "0.55502033", "text": "function queryLinks(browser) {\n var urls = browser.document.getElementsByTagName(\"a\");\n var urlNodes = Array.from(urls);\n var links = urlNodes.map(function(node) {\n return node.href;\n });\n return links;\n}", "title": "" }, { "docid": "422296343e10de3aa6aabab547306204", "score": "0.5539743", "text": "parse() {\n\t\treturn this.parseWebsite(this.page.url);\n\t}", "title": "" }, { "docid": "10caa2d8e01b952ab1670c542d4c82d4", "score": "0.55369633", "text": "function visitAndParsePageSource(url, callbackCrawl) {\r\n if(!url) {\r\n callbackCrawl();\r\n return;\r\n }\r\n visitedUrlCount++;\r\n visitedUrls.push(url);\r\n request(url, function(error, response, body) {\r\n if(error) {\r\n printLog(\"Error: \" + error);\r\n callbackCrawl();\r\n return;\r\n }\r\n if(response.statusCode === 200) {\r\n var $ = cheerio.load(body);\r\n parsePageSourceAndFetchLinks($);\r\n }\r\n callbackCrawl();\r\n });\r\n}", "title": "" }, { "docid": "021f7c2f3eaa1f75ba98f07c202c4be7", "score": "0.55281746", "text": "function scrape (url, options, callback) {\n var logger = options.logger,\n cache = options.cache,\n data = {\n links:[],\n requestTime: 0\n }; \n\n logger.info('parsing: ' + url);\n\n try {\n // get cached html or get html from page\n if (options.cache && options.useCache && cache.has(url)) {\n // from cache\n logger.log('fetched html from cache: ' + url);\n var cachedPage = cache.get(url);\n parseHTML(cachedPage.resolvedUrl, cachedPage.body, 0);\n } else {\n if (url) {\n var startedRequest = new Date(),\n requestObj = {\n uri: url,\n headers: options.httpHeaders\n };\n\n // from page\n request(requestObj, function(requestErrors, response, body) {\n if (!requestErrors && response.statusCode === 200) {\n\n var resolvedUrl = url;\n\n if (response.request && \n response.request.uri.href && \n response.request.uri.href !== url) {\n resolvedUrl = response.request.uri.href;\n }\n\n // add html into the cache\n if (options.cache) {\n cache.set(url, {\n resolvedUrl: resolvedUrl,\n body: body\n });\n };\n\n var endedRequest = new Date();\n var ms = endedRequest.getTime() - startedRequest.getTime();\n logger.log('fetched html from page: ' + ms + 'ms - ' + url);\n\n // is the content html\n if (response.headers['content-type'].indexOf('text/html') > -1) {\n parseHTML(resolvedUrl, body, ms);\n } else {\n parseOtherFormat(body, url, ms);\n }\n\n } else {\n // add error information\n var err = requestErrors + ' - ' + url;\n if (response && response.statusCode) {\n err = 'http error: ' + response.statusCode \n + ' (' + httpCodes[response.statusCode] + ') - ' + url;\n }\n\n logger.warn(err)\n callback(err, data);\n } \n });\n } else {\n // add error information\n logger.warn('no url given');\n callback('no url given', data);\n }\n }\n } catch(err) {\n console.log(err.stack);\n logger.warn(err + ' - ' + url);\n callback(err + ' - ' + url, data);\n }\n\n\n // return a blank object for formats other than html\n function parseOtherFormat(content, url, requestTime) {\n var url = require('url').parse(url),\n icon = url.protocol + \"//\" + url.host + \"/favicon.ico\";\n\n data = {\n links:[],\n requestTime: requestTime,\n title: url.href,\n favicon: icon\n };\n\n callback(null, data);\n }\n\n\n // parse the html for rel=me links\n function parseHTML(resolvedUrl, html, requestTime) {\n\n var startedDOMParse = new Date(),\n $ = cheerio.load(html);\n\n data.resolvedUrl = resolvedUrl;\n data.requestTime = requestTime;\n\n // get rel= me links from 'a' or 'link' tags\n $(\"a[rel~=me], link[rel~=me]\").each(function (i, elem) {\n\n // issue 41 - https://github.com/dharmafly/elsewhere/issues/41\n // discount paging link with rel=me and either rel=next or rel=prev\n var rel = $(elem).attr('rel').toLowerCase();\n if (rel.indexOf('next') === -1 && rel.indexOf('prev') === -1) {\n var href = $(elem).attr('href');\n\n // check its not empty\n if(href && fn.trim(href) !== ''){\n // take a page URL, and a relative href and resolve it\n if (href.substring(0,1) === '/') {\n href = urlParser.resolve(url, href);\n }\n data.links.push(href);\n logger.log('found link: ' + href + ' in page: ' + url);\n }\n }\n\n });\n\n logger.log('links found: ' + data.links.length + ' at: ' + url);\n\n // get the title, regex gets rid of new line characters etc.\n data.title = fn.trim($('title').text().replace(/(\\r\\n|\\n|\\r)/gm,\"\"));\n\n // get the favicon\n data.favicon = resolveFavicon($, data.resolvedUrl || url);\n\n var endedDOMParse = new Date();\n var ms = endedDOMParse.getTime() - startedDOMParse.getTime();\n logger.log('time to parse DOM: ' + ms + 'ms - ' + url);\n\n callback(null, data);\n }\n}", "title": "" }, { "docid": "4e6fc2b25c3054d65b78e1e3a771a0e6", "score": "0.551895", "text": "function attachLinks () {\n var mainContent = findMainContentEl();\n if( !mainContent ) {\n console.error( \"No main content element found; exiting.\" );\n return;\n }\n\n var contentEls = mainContent.children;\n\n // Find the index of the first header in contentEls\n var headerIndex = 0;\n for( headerIndex = 0; headerIndex < contentEls.length; headerIndex++ ) {\n if( contentEls[ headerIndex ].matches( HEADER_SELECTOR ) ) break;\n }\n\n // If we didn't find any headers at all, that's a problem and we\n // should bail\n if( mainContent.querySelector( \"div.hover-edit-section\" ) ) {\n headerIndex = 0;\n } else if( headerIndex === contentEls.length ) {\n console.error( \"Didn't find any headers - hit end of loop!\" );\n return;\n }\n\n // We also should include the first header\n if( headerIndex > 0 ) {\n headerIndex--;\n }\n\n // Each element is a 2-element list of [level, node]\n var parseStack = iterableToList( contentEls ).slice( headerIndex );\n parseStack.reverse();\n parseStack = parseStack.map( function ( el ) { return [ \"\", el ]; } );\n\n // Main parse loop\n var node;\n var currIndentation; // A string of symbols, like \":*::\"\n var newIndentSymbol;\n var stackEl; // current element from the parse stack\n var idNum = 0; // used to make id's for the links\n var linkId = \"\"; // will be the element id for this link\n while( parseStack.length ) {\n stackEl = parseStack.pop();\n node = stackEl[1];\n currIndentation = stackEl[0];\n\n // Compatibility with \"Comments in Local Time\"\n var isLocalCommentsSpan = node.nodeType === 1 &&\n \"span\" === node.tagName.toLowerCase() &&\n node.className.includes( \"localcomments\" );\n\n var isSmall = node.nodeType === 1 && (\n node.tagName.toLowerCase() === \"small\" ||\n ( node.tagName.toLowerCase() === \"span\" &&\n node.style && node.style.getPropertyValue( \"font-size\" ) === \"85%\" ) );\n\n // Small nodes are okay, unless they're delsort notices\n var isOkSmallNode = isSmall &&\n !node.className.includes( \"delsort-notice\" );\n\n if( ( node.nodeType === 3 ) ||\n isOkSmallNode ||\n isLocalCommentsSpan ) {\n\n // If the current node has a timestamp, attach a link to it\n // Also, no links after timestamps, because it's just like\n // having normal text afterwards, which is rejected (because\n // that means someone put a timestamp in the middle of a\n // paragraph)\n var hasLinkAfterwardsNotInBlockEl = node.nextElementSibling &&\n ( node.nextElementSibling.tagName.toLowerCase() === \"a\" ||\n ( node.nextElementSibling.tagName.match( /^(span|small)$/i ) &&\n node.nextElementSibling.querySelector( \"a\" ) ) );\n if( TIMESTAMP_REGEX.test( node.textContent ) &&\n ( node.previousSibling || isSmall ) &&\n !hasLinkAfterwardsNotInBlockEl ) {\n linkId = \"reply-link-\" + idNum;\n attachLinkAfterNode( node, linkId, !!currIndentation );\n idNum++;\n\n // Update global metadata dictionary\n metadata[linkId] = currIndentation;\n }\n } else if( node.nodeType === 1 &&\n /^(div|p|dl|dd|ul|li|span|ol|table|tbody|tr|td)$/.test( node.tagName.toLowerCase() ) ) {\n switch( node.tagName.toLowerCase() ) {\n case \"dl\": newIndentSymbol = \":\"; break;\n case \"ul\": newIndentSymbol = \"*\"; break;\n case \"ol\": newIndentSymbol = \"#\"; break;\n case \"div\":\n if( node.className.includes( \"xfd_relist\" ) ) {\n continue;\n }\n break;\n default: newIndentSymbol = \"\"; break;\n }\n\n var childNodes = node.childNodes;\n for( let i = 0, numNodes = childNodes.length; i < numNodes; i++ ) {\n parseStack.push( [ currIndentation + newIndentSymbol,\n childNodes[i] ] );\n }\n }\n }\n\n // This loop adds two entries in the metadata dictionary:\n // the header data, and the sigIdx values\n var sigIdxEls = iterableToList( mainContent.querySelectorAll(\n HEADER_SELECTOR + \",span.reply-link-wrapper a\" ) );\n var currSigIdx = 0, j, numSigIdxEls, currHeaderEl, currHeaderData;\n var headerIdx = 0; // index of the current header\n var headerLvl = 0; // level of the current header\n for( j = 0, numSigIdxEls = sigIdxEls.length; j < numSigIdxEls; j++ ) {\n var headerTagNameMatch = /^h(\\d+)$/.exec(\n sigIdxEls[j].tagName.toLowerCase() );\n if( headerTagNameMatch ) {\n currHeaderEl = sigIdxEls[j];\n\n // Test to make sure we're not in the table of contents\n if( currHeaderEl.parentNode.className === \"toctitle\" ) {\n continue;\n }\n\n // Reset signature counter\n currSigIdx = 0;\n\n // Dig down one level for the header text because\n // MW buries the text in a span inside the header\n var headlineEl = null;\n if( currHeaderEl.childNodes[0].className &&\n currHeaderEl.childNodes[0].className.includes( \"mw-headline\" ) ) {\n headlineEl = currHeaderEl.childNodes[0];\n } else {\n for( var i = 0; i < currHeaderEl.childNodes.length; i++ ) {\n if( currHeaderEl.childNodes[i].className &&\n currHeaderEl.childNodes[i].className.includes( \"mw-headline\" ) ) {\n headlineEl = currHeaderEl.childNodes[i];\n break;\n }\n }\n }\n\n var headerName = null;\n if( headlineEl ) {\n headerName = headlineEl.textContent;\n }\n\n if( headerName === null ) {\n console.error( currHeaderEl );\n throw \"Couldn't parse a header element!\";\n }\n\n headerLvl = headerTagNameMatch[1];\n currHeaderData = [ headerLvl, headerName, headerIdx ];\n headerIdx++;\n } else {\n\n // Save all the metadata for this link\n currIndentation = metadata[ sigIdxEls[j].id ];\n metadata[ sigIdxEls[j].id ] = [ currIndentation,\n currHeaderData ? currHeaderData.slice(0) : null,\n currSigIdx ];\n currSigIdx++;\n }\n }\n //console.log(metadata);\n\n // Disable links inside hatnotes, archived discussions\n var badRegionsSelector = \"div.archived,div.resolved,table\";\n var badRegions = mainContent.querySelectorAll( badRegionsSelector );\n for( var i = 0; i < badRegions.length; i++ ) {\n var badRegion = badRegions[i];\n var insideArchived = badRegion.querySelectorAll( \".reply-link-wrapper\" );\n console.log(insideArchived);\n for( var j = 0; j < insideArchived.length; j++ ) {\n insideArchived[j].parentNode.removeChild( insideArchived[j] );\n }\n }\n }", "title": "" }, { "docid": "9aea6d5192113e8d98094a6ee5d671d8", "score": "0.5517748", "text": "function parseLinks(line){\n if(line.indexOf(\"[\") >= 0){\n var state = 0;\n var text = \"\";\n var link = \"\";\n var startIndex = -1;\n var result = \"\";\n for(var j=0; j<line.length; j++) {\n\n var switchedState = true;\n switch(line[j]){\n case \"[\" : state = 1; startIndex=j; break;\n case \"]\" : state = 2; break;\n case \"(\" : state = 3; break;\n case \")\" : state = 4; break;\n default : switchedState = false;\n }\n\n if(!switchedState){\n switch(state){\n case 0 : result += line[j]; break;\n case 1 : text += line[j]; break;\n case 3 : link += line[j]; break;\n }\n }\n else if(switchedState && state == 4){\n var newLink = {\n tag : \"a\",\n href : link,\n con : text\n };\n\n link = \"\";\n text = \"\";\n result += bwe.build(newLink);//newLink.get();\n state = 0;\n }\n }\n }\n //no links\n else{\n result = line;\n }\n return result;\n}", "title": "" }, { "docid": "638b7d1e7bf39eb01bd2dc308d5b7290", "score": "0.55163866", "text": "function loadLinks(){\n $('a').each(function(){//recorre cada uno de los elementos <a>\n $(this).text($(this).attr('href'))\n $(this).attr('target', '_blank') //Agregar atributo para que la página se cargue en una nueva pestaña\n })\n}", "title": "" }, { "docid": "f7a6e3712d553707fe9f95c56fc477a0", "score": "0.5516241", "text": "function parseAndRed()\n{\n\t// the regular expression should identify the \n\tdat = document.body.innerHTML;\n \tre = /<a id=[^ ]* href=\"([^\"]*)\">CMU/g;\n \tmyArray = re.exec(dat);\n\tmyNext = myArray[1];\n\n\tmyArray = myNext.split(\"amp;\");\n\t\n\ti=0;\n\tins=\"\";\n\twhile(myArray[i]){\n\t\tins += myArray[i];\n\t\ti++;\n\t}\n\n\tred = \"http://www.google.com\" + ins;\n\twindow.location = red;\n}", "title": "" }, { "docid": "04f5268d1cbb53fc7043a9f51cf5fb46", "score": "0.549808", "text": "function grabHTML(link) {\n // grabs the link\n return new Promise((resolve, reject) => {\n http.get(link, (response) => {\n let data;\n response.on('data', d => console.log(Buffer.from(JSON.parse(d))));\n response.on('close', () => resolve(data));\n });\n });\n}", "title": "" }, { "docid": "af65b2da37cfdaebaf1c44aeb71b38a0", "score": "0.5494979", "text": "function HTMLParser() {}", "title": "" }, { "docid": "bd75f75949c1395e34e4ec7faaabce9b", "score": "0.5471121", "text": "function getPage(href) {\n\t\tAjax\n\t\t\t.request({\n\t\t\t\turl: stem + href\n\t\t\t\t, method: 'get'\n\t\t\t})\n\t\t\t.done(function(res) {\n\t\t\t\tvar html = markdown.toHTML(res, 'Maruku')\n\t\t\t\t\t// handle peculiar HTML for python code blocks\n\t\t\t\t\t.replace(/<p><code>python\\n((?:.|\\n)+?)<\\/code><\\/p>/ig,\n\t\t\t\t\t\t'<pre><code>$1</code></pre>')\n\t\t\t\t;\n\n\t\t\t\tif (!noHistory)\n\t\t\t\t\thistory.pushState({ url: href }, '', '#/' + href);\n\n\t\t\t\tnoHistory = false;\n\t\t\t\tdocument.body.innerHTML = html;\n\t\t\t\tdocument.title = document.querySelector('h1').innerText;\n\n\t\t\t\t// add \"homepage\" link if not README\n\t\t\t\tif (href !== readme) {\n\t\t\t\t\tdocument.body.innerHTML =\n\t\t\t\t\t\t'<p><a href=\"' + readme + '\">Homepage</a></p>'\n\t\t\t\t\t\t+ document.body.innerHTML;\n\t\t\t\t}\n\n\t\t\t\t// handle link translation and click binding\n\t\t\t\tvar links = document.querySelectorAll('a');\n\n\t\t\t\tfor (var i = 0; i < links.length; i++) {\n\t\t\t\t\tvar ahref = links[i].getAttribute('href');\n\n\t\t\t\t\t// link has protocol; ignore\n\t\t\t\t\tif (/^https?:\\/\\//i.exec(ahref)) continue;\n\n\t\t\t\t\tif (/[^\\/].*\\.md$/.exec(ahref))\n\t\t\t\t\t{\n\t\t\t\t\t\tlinks[i].setAttribute('href', '#/' + ahref);\n\t\t\t\t\t\tlinks[i].addEventListener('click', linkClicked);\n\t\t\t\t\t}\n\n\t\t\t\t\t// only intercept hash links\n\t\t\t\t\tif (ahref.indexOf('#') === 0) {\n\t\t\t\t\t\tlinks[i].addEventListener('click', linkClicked);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// handle heading anchors\n\t\t\t\tvar heads = document.querySelectorAll('h1, h2, h3, h4, h5');\n\n\t\t\t\tfor (var i = 0; i < heads.length; i++) {\n\t\t\t\t\tvar name = heads[i].innerText\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.replace(/[^- _a-z0-9]+/g, '')\n\t\t\t\t\t\t.replace(/\\s+/g, '-')\n\t\t\t\t\t;\n\n\t\t\t\t\theads[i].setAttribute('name', name);\n\t\t\t\t}\n\t\t\t})\n\t\t;\n\t}", "title": "" }, { "docid": "3dd5cc0d73480dd7ca7556f5ace1b413", "score": "0.54497033", "text": "function adjustLinks(html) {\n \n // Fix the table of contents links\n html = html.replace(hashRegex, \"href=\\\"javascript: document.getElementById('$1').scrollIntoView();\");\n \n // Fix all Wikipedia internal links.\n html = html.replace(linkRegex, 'href=\"#/article/$1');\n \n return html;\n }", "title": "" }, { "docid": "5c7f478f1cc2b7d0f28e5dda4070344f", "score": "0.5446855", "text": "function gotonext(data) {\n let $ = cheerio.load(data);\n let linktag = $(\"li.widget-items.cta-link\").find(\"a\");\n\n let url = \"https://www.espncricinfo.com/\" + $(linktag).attr(\"href\");\n\n request(url, callback);\n\n function callback(error, response, html) {\n if (error) {\n console.log(error);\n console.log(\"Encountered some error in going next !! Try Again Later\");\n } else {\n resultpage(html);\n }\n }\n\n}", "title": "" }, { "docid": "3cc8eb8bdb8f15f2e83ed9df6ad225b4", "score": "0.54171884", "text": "function getLinksFromPage(parameters) {\n\n getData(parameters).done(function(data, textStatus, xhr) {\n var termObj = data;\n\n //If the search did not generate any results, show an error message\n if (JSON.stringify(termObj) === JSON.stringify(failedRequestObj1) || JSON.stringify(termObj) === JSON.stringify(failedRequestObj2)) {\n\n generateTermWithLinks();\n\n } else {\n if (wikiPageHasInfo(data.query.pages[0]) && data.query.pages[0].links) {\n var comboSearchTitle = generatedTitleCombo(data.query.pages[0].links);\n\n findAndMapSubterms(comboSearchTitle, termObj, 3, countNodesCallback);\n }\n }\n\n }).fail(function(error) {\n throw new Error(\"Error getting the data inside of the populateRandom function\");\n });\n }", "title": "" }, { "docid": "d1f9004fe8d5ccb3dc430a9f7aa846dd", "score": "0.5401107", "text": "function getSearchResultLinks(){\n var results = document.getElementsByClassName('r');\n var resultLinks = [];\n for(var i = 0; i < results.length; i++){\n var children = results[i].childNodes;\n for(var x = 0; x < children.length; x++){\n if(children[x].hasAttribute(\"href\")){\n resultLinks.push(children[x].href);\n break;\n }\n }\n }\n return resultLinks;\n}", "title": "" }, { "docid": "af7fff7da85d18d1bba11aefee1f5bdf", "score": "0.5401089", "text": "function consolidateLinks() {\n\tvar linksdiv = document.getElementById('links');\n\tvar allParagraphs = document.querySelectorAll('p');\n\tvar content = '';\n\t// join the text of all the paragraphs\n\t[].forEach.call(allParagraphs, function(para) {\n\t\tcontent += textUnder(para);\n\t});\n\n\tvar links = content.match(/<a>.*?<\\/a>/g) || [];\t// match with the pattern\n\t[].forEach.call(links, function(link) {\t\t// foreach pattern found\n\t\tlink = link.replace(/<a>/g, '');\t\t// remove '<a>'\n\t\tlink = link.replace(/<\\/a>/g, '');\t\t// remove '</a>'\n\n\t\tvar newdiv = document.createElement('div');\t// create div\n\t\tvar newlink = document.createElement('a');\t// create an anchor tag\n\t\tnewlink.appendChild(document.createTextNode(link));\t// append text in the anchor tag\n\t\tnewdiv.appendChild(newlink);\t// append anchor to new div\n\t\tlinksdiv.appendChild(newdiv);\t// append newdiv to linksdiv\n\t});\n}", "title": "" }, { "docid": "a21c42494aee15e6d99d9db69c52bd07", "score": "0.53901494", "text": "function resultpage(data) {\n let $ = cheerio.load(data);\n\n\n let containerarray = $(\".league-scores-container .match-score-block .match-cta-container\");\n\n for (let i = 0; i < containerarray.length; i++) {\n let a_tags = $(containerarray[i]).find(\"a\");\n let resulturl = \"https://www.espncricinfo.com/\" + $(a_tags[2]).attr(\"href\");\n\n request(resulturl, cb);\n\n function cb(error, response, html) {\n if (error) {\n console.log(\"Encountered some error ub result page !! Try Again Later\");\n } else {\n resultextracter(html);\n }\n }\n\n }\n\n\n\n}", "title": "" }, { "docid": "ecaebb666446289bd8fb4aa235bdd296", "score": "0.5387677", "text": "function retrieveLinks(linksToCrowl) {\n // Per request limit.\n let perRequestLimit = 10;\n // Urls to pull.\n let perRequestUrls = [];\n\n if (linksToCrowl.length > 0) {\n // Get patch of urls to request.\n $.each(linksToCrowl, function (index, value) {\n if (perRequestLimit == 0 && linksToCrowl.length > 10) {\n return false;\n }\n perRequestUrls.push(value);\n linksToCrowl.splice(index, 1);\n perRequestLimit--;\n });\n\n // Prepare variables for POST request.\n let urls = perRequestUrls.join(\",\");\n let elements = options['elements'].join(\",\");\n\n $.post(\"ajax/elements\", {urls: urls, elements: elements}, function (data) {\n data = JSON.parse(data);\n retrievedUrlsData = retrievedUrlsData.concat(data);\n updateLoadingText(linksToCrowl.length + \" URLs remaining\");\n retrieveLinks(linksToCrowl);\n });\n }\n else {\n if (retrievedUrlsData.length > 0) {\n // Replace code highlighter with retrieved JSON and disable loading.\n enableCodeBlock(JSON.stringify(retrievedUrlsData, null, \"\\t\"));\n }\n\n disableLoading();\n }\n }", "title": "" }, { "docid": "22001b544d18999453333039a5ff5612", "score": "0.5387295", "text": "function getEventsUrlListFromHtml(overviewPageHtml, baseUrl) {\n let eventsUrlList = []\n const $ = cheerio.load(overviewPageHtml, { decodeEntities: false })\n const ulList = $('ul','.eventlist_con_box2_inner_left2').children()\n ulList.each( function (i, element) {\n eventsUrlList.push(baseUrl + $(element).attr('href'))\n // console.log(eventsUrlList)\n })\n return eventsUrlList\n}", "title": "" }, { "docid": "c052a842687a8e8e3a02e3b01a2441db", "score": "0.5364371", "text": "function attachLinkListeners() {\n $(\"#html-loc a\").on(\"click\", function(e) {\n if (!e.target.href || e.target.href === '' || e.target.href.includes('#')) {\n return;\n }\n e.preventDefault();\n const nextURL = pageHistory.forwardHistory(e.target.href);\n if (execution && execution.exec) {\n execution.pause();\n setTimeout(() => { standardLoad(nextURL, () => { execution.play() }); }, 1000);\n } else {\n standardLoad(nextURL);\n }\n });\n}", "title": "" }, { "docid": "e21abc8006c0324816a4d406cb8b57cd", "score": "0.53474075", "text": "async readShowLinks() {\n const links = await this.page.$$eval(fieldSel, fields => {\n const links = {};\n for (let field of fields) {\n const labelEl = field.querySelector('label');\n if (!labelEl) continue;\n const link = field.querySelector('a');\n if (link) {\n const label = labelEl.textContent;\n const value = field.querySelector('label + *').textContent;\n const url = link.getAttribute('href');\n links[label] = { value, url };\n }\n }\n return links;\n });\n return links;\n }", "title": "" }, { "docid": "6094b6e658e5f4cde4129daa76c65d75", "score": "0.534576", "text": "function linkExpose(emailParsed) {\n\t\tlink.linkOutputs = [];\n\t\tlink.linkAnchors = [];\n\t\t\n\t\temailParsed.replace(/href=\"(.*?)\".*?>(.*?)<\\/a>/g, (match, href, anchor) => {\n\t\t\thref = href.replace(/\\s/g, '');\n\t\t\tlink.linkOutputs.push(href);\n\t\t\tlink.linkAnchors.push(anchor);\n\t\t\treturn match;\n\t\t});\n\t}", "title": "" }, { "docid": "07376a5dcf45c4084f7a7c737398b9cf", "score": "0.5340466", "text": "function scrape(answer){\n\trequest(answer, function(error,response,html){\n \t//load the HTML with the Cheerio module\n \tvar $ = cheerio.load(html);\n \tvar results = [];\n\t\tvar tagTarget = '';\n\n\t\trl.question(\"Which tag would you like to target?\", (tagTarget) => {\n\t\t\tconsole.log(\"\\x1b[32m\", tagTarget + ' tags will targeted!', \"\\x1b[0m\");\n\t\t\t$(tagTarget).each(function(){\n\t\t\t\tswitch(tagTarget){\n\t\t\t\t\tcase 'meta':\n\t\t\t\t\t\tvar tagContent = $(this).attr('content');\n\t\t\t\t\t\tresults.push(tagContent);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'img':\n\t\t\t\t\t\tvar tagContent = $(this).attr('src');\n\t\t\t\t\t\tresults.push(tagContent);\n\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tvar tagLink = $(this).attr('href');\n\t\t\t\t\t\tvar tagContent = $(this).text();\n\t\t\t\t\t\ttagContent = tagContent.replace(/(\\r\\n|\\n|\\r|\\t\\s+)/gm,\"\").trim();\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\tlink: tagLink,\n\t\t\t\t\t\t\tcontent: tagContent\n\t\t\t\t\t\t};\n\t\t\t\t\t\tresults.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'blockquote':\n\t\t\t\t\t\tvar tagCite = $(this).attr('cite');\n\t\t\t\t\t\tvar tagContent = $(this).text();\n\t\t\t\t\t\ttagContent = tagContent.replace(/(\\r\\n|\\n|\\r|\\t\\s+)/gm,\"\").trim();\n\t\t\t\t\t\tif (typeof tagCite == 'undefined'){\n\t\t\t\t\t\t\tresults.push(tagContent);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\tcitation: tagCite,\n\t\t\t\t\t\t\t\tcontent: tagContent\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tresults.push(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'embed':\n\t\t\t\t\t\tvar tagLink = $(this).attr('src');\n\t\t\t\t\t\tresults.push(tagLink);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'abbr':\n\t\t\t\t\t\tvar tagContent = $(this).text();\n\t\t\t\t\t\tvar tagTitle = $(this).attr('title');\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\ttitle: tagTitle,\n\t\t\t\t\t\t\taccronym: tagContent\n\t\t\t\t\t\t};\n\t\t\t\t\t\tresults.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvar tagContent = $(this).text();\n\t\t\t\t\t\tvar data = tagContent.replace(/(\\r\\n|\\n|\\r|\\t\\s+)/gm,\"\").trim();\n\t\t\t\t\t\tresults.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconsole.log( \"\\x1b[31m\", results);\n\t\t\trl.close();\n\t\t\tprocess.stdin.destroy();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "57a352824b2df3189796fc210845169a", "score": "0.53300107", "text": "function scrapeItems (URL){\n\n request(URL, function (err, response, body) {\n\n if(err) console.error(err);\n let $ = cheerio.load(body);\n let press_date = [];\n let press_title = [];\n let press_link = [];\n const results = [];\n const URLElements = $('li').find('p');\n const URLElementsA = $('#press').find('li').find('a');\n\n for (let counter = 0; counter < URLElements.length; counter++) {\n\n const dateInfo = $(URLElements[counter])\n const linklocation = $(URLElementsA)[counter]\n let linkInfo = $(URLElementsA[counter])\n\n //grabbing the data for the different dates, must match certain date in last if statement\n if (dateInfo) {\n const dateText = $(dateInfo).text()\n\n if(dateText == \"03.04.21\") {\n\n press_date.push(dateText);\n //grabbing information only for this date\n //grab title text\n function linkTitle(linkInfo){\n if (linkInfo) {\n let urlText = $(linkInfo).text()\n .replace(/\\n|\\t/g, \"\");\n return urlText;\n }\n }\n\n function linkInformation(linklocation){\n //grab link\n if (linklocation){\n let link = $(linklocation).attr('href')\n .replace(/\\n|\\t/g, \"\");\n return 'https://www.budget.senate.gov' + link;\n }\n }\n\n\n\n\n press_link.push(linkInformation(linklocation));\n press_title.push(linkTitle(linkInfo));\n\n }\n\n }\n\n\n }\n\n //building the JSON object based on how many for day grabbed\n for( let i =0; i < press_date.length; i++ ){\n\n results[i] = {\n date: press_date[i],\n link: press_link[i],\n title: press_title[i],\n day: day,\n month: month,\n year: year,\n org: 'United States Senate Committee on the Budget'\n }\n }\n\n\n\n\n console.log(results)\n console.log(results.length)\n //console.log(URLElements.length)\n\n\n //write the data to a file\n //might need to change namification to include date\n let data_JSON = JSON.stringify(results);\n fs.writeFileSync('senate-budget-committee-min.json', data_JSON);\n\n })\n}", "title": "" }, { "docid": "482b0f040212e0dde970cb4e7f6daeac", "score": "0.5326481", "text": "function crawl(link) {\n this.start().then(function() {\n this.echo(link, 'COMMENT');\n this.open(link);\n checked.push(link);\n });\n this.then(function() {\n if (this.currentHTTPStatus === 404) {\n this.warn(link + ' is missing (HTTP 404)');\n } else if (this.currentHTTPStatus === 500) {\n this.warn(link + ' is broken (HTTP 500)');\n } else {\n this.echo(link + f(' is okay (HTTP %s)', this.currentHTTPStatus));\n }\n });\n this.then(function() {\n var newLinks = searchLinks.call(this);\n links = links.concat(newLinks).filter(function(url) {\n return checked.indexOf(url) === -1;\n });\n this.echo(newLinks.length + \" new links found on \" + link);\n });\n // Added by [email protected]\n this.then(function() {\n var newLinks = searchAssets.call(this);\n links = links.concat(newLinks).filter(function(url) {\n return checked.indexOf(url) === -1;\n });\n this.echo(newLinks.length + \" new assets found on \" + link);\n });\n}", "title": "" }, { "docid": "eea7a6e12f7d93ddb892606a2d093aa9", "score": "0.53238297", "text": "function scrapeOne(doc) {\n\tvar url = doc.location.href;\n\n\tvar hostRe = new RegExp(\"^(http://[^/]+)/\");\n\t\tvar m = hostRe.exec(url);\n\t\tvar host = m[1];\n\n\t\tvar getPDF = doc.evaluate('//a[text() = \"PDF Version\" or text() = \"[Access article in PDF]\" or text() = \"Download PDF\"]', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\t\t\n\t\tvar DOI = doc.evaluate('//meta[@name=\"citation_doi\"]/@content', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\t\t\n\t\tvar abstract = doc.evaluate('//div[@class=\"abstract\"]', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\n\t\tvar authorNodes = ZU.xpath(doc, '//meta[@name=\"citation_author\"]/@content');\n\n\t\tif(url.indexOf('?') != -1) {\n\t\t\tvar m = url.match(/[?&]ur[li]=([^&]+)/i);\n\t\t\tif(m) url = host + decodeURIComponent(m[1]);\n\t\t}\n\n\t\tvar newUrl = url.replace(host, host+\"/metadata/zotero\").replace(\"/summary/\",\"/\");\n\t\tZotero.Utilities.HTTP.doGet(newUrl, function(text) {\n\t\t\tvar translator = Zotero.loadTranslator(\"import\");\n\t\t\t//set RIS translator\n\t\t\ttranslator.setTranslator(\"32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7\");\n\t\t\ttranslator.setString(text);\n\t\t\ttranslator.setHandler(\"itemDone\", function(obj, item) {\n\t\t\t\tif(item.notes && item.notes[0]) {\n\t\t\t\t\titem.extra = item.notes[0].note;\t\t\t\t\t\t\n\t\t\t\t\tdelete item.notes;\n\t\t\t\t\titem.notes = undefined;\n\t\t\t\t}\n\t\t\t\t//Muse has authors wrong in the RIS - we get the names from google/highwire metadata and use them\n\t\t\t\t// they're also inconsistent about comma use, so we're using the code from the Embedded Metadata translator to distinguish\n\t\t\t\tif(authorNodes.length){\n\t\t\t\t\titem.creators = [];\n\t\t\t\t\t\tfor(var i=0, n=authorNodes.length; i<n; i++) {\n\t\t\t\t\t\t\t//make sure there are no empty authors\n\t\t\t\t\t\t\tvar authors = authorNodes[i].nodeValue.replace(/(;[^A-Za-z0-9]*)$/, \"\").split(/\\s*;\\s/);\n\t\t\t\t\t\t\tif (authors.length == 1) {\n\t\t\t\t\t\t\t\t/* If we get nothing when splitting by semicolon, and at least two words on\n\t\t\t\t\t\t\t\t* either side of the comma when splitting by comma, we split by comma. */\n\t\t\t\t\t\t\t\tvar authorsByComma = authors[0].split(/\\s*,\\s*/);\n\t\t\t\t\t\t\t\tif (authorsByComma.length > 1\n\t\t\t\t\t\t\t\t\t&& authorsByComma[0].indexOf(\" \") !== -1\n\t\t\t\t\t\t\t\t\t&& authorsByComma[1].indexOf(\" \") !== -1)\n\t\t\t\t\t\t\t\t\tauthors = authorsByComma;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(var j=0, m=authors.length; j<m; j++) {\n\t\t\t\t\t\t\t\tvar author = authors[j];\n\t\t\t\t\t\t\t\titem.creators.push(ZU.cleanAuthor(author, \"author\", author.indexOf(\",\") !== -1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\titem.attachments.splice(0);\n\t\t\t\titem.attachments.push({document:doc, title:\"Project MUSE Snapshot\"});\n\t\t\t\tif(getPDF) {\n\t\t\t\t\titem.attachments.push({title:\"Project MUSE Full Text PDF\", mimeType:\"application/pdf\",\n\t\t\t\t\turl:getPDF.href});\n\t\t\t\t}\n\t\t\t\tif(DOI) {\n\t\t\t\t\titem.DOI = DOI.textContent.replace(/^DOI: /,\"\");\n\t\t\t\t}\n\t\t\t\tif(abstract) {\n\t\t\t\t\titem.abstract = abstract.textContent;\n\t\t\t\t}\n\t\t\t\titem.complete();\n\t\t\t});\n\t\t\ttranslator.translate();\n\t\t});\n}", "title": "" }, { "docid": "8b33dce5872fda2dd9dfd5e49bebe4ce", "score": "0.5323352", "text": "getLinks() {\r\n this.links = Array.from(document.querySelectorAll(this.conf.linksSelector)).filter((a, i, tab) => tab.indexOf(a) === i)\r\n return this\r\n }", "title": "" }, { "docid": "6bafc8cd88c996af7121e882a5da78be", "score": "0.53181636", "text": "function linkFinder () {\r\n\tvar linkList = [];\r\n\tvar link;\r\n\tvar article = '';\r\n\tvar articleElements = document.getElementsByTagName(\"article\");\r\n\tif (articleElements.length != 0) {\r\n\t\tarticle = articleElements[0];\r\n\t} else {\r\n\t\tarticleElements = document.getElementsByTagName(\"div\");\r\n\t\tfor (var i = 0; i < articleElements.length; i++) {\r\n\t\t\tif (articleElements[i].getAttribute('id') === 'content') {\r\n\t\t\t\tarticle = articleElements[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (article) {\r\n\t\tconst allLinks = article.getElementsByTagName('a');\r\n\t\tfor (var i = 0; i < allLinks.length; i++) {\r\n\t\t\tlink = allLinks[i].getAttribute('href');\r\n\t\t\tif (link && link.indexOf('http') === 0 &&\r\n\t\t\t\t!checkSelfReferralLink(link) &&\r\n\t\t\t\t!checkSocialPostLink(link)) {\r\n\t\t\t\tlinkList.push(link);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Filter down to unique list\r\n\tconst uniqueList = [];\r\n\tlinkList.forEach( v => {\r\n\t\tif ( -1 === uniqueList.indexOf( v ) ) {\r\n\t\t\tuniqueList.push( v );\r\n\t\t}\r\n\t});\r\n\r\n\treturn uniqueList;\r\n}", "title": "" }, { "docid": "8e175dd0fe9d05dfd1abb72b78838f20", "score": "0.5311877", "text": "function getLinks() {\n\n //MongoDB settings\n var host = \"localhost\";\n var port = \"27017\";\n var dbName = \"crawler\";\n\n MongoClient.connect(\"mongodb://\" + host + \":\" + port + \"/\" + dbName, function (err, db) {\n\n if (err) {\n console.log('MongoDB connection error: ' + err);\n } else {\n\n //get link from 'link_queue'\n db.collection('link_queue').find({}).toArray(function (err, docs) {\n\n if (err) {\n console.log('MongoDb find error: ' + err);\n } else {\n\n var link_arr2 = [];\n docs.forEach(function (doc) {\n var link_arr = doc.ads.link;\n link_arr2 = link_arr2.concat(link_arr);\n });\n\n // console.log(link_arr2);\n casperCrawl(link_arr2);\n\n db.close();\n }\n });\n\n }\n\n });\n\n}", "title": "" }, { "docid": "3d8abf7c041d8c82f7ce6a355c220f7a", "score": "0.53066766", "text": "function scrape() {\n console.log(\"Scraping \" + baseUrl + eventsUrl + \"...\");\n request(baseUrl + eventsUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n events = [];\n parse(body);\n } else {\n failedScrape(error, response, body);\n }\n\t});\n}", "title": "" }, { "docid": "5c6996a39badbf788c8c5e553e241e0a", "score": "0.53044105", "text": "function fetchLinks() {\n\t\tchrome.tabs.executeScript(null, {\n\t\t\t\tfile: \"jquery.min.js\"\n\t\t});\n\t\tchrome.tabs.executeScript(null, {\n\t\t\t\tfile: \"Content-Script.js\"\n\t\t});\n\t\tchrome.tabs.query({\n\t\t\t\tactive: true,\n\t\t\t\tcurrentWindow: true\n\t\t}, function (tabs) {\n\t\t\t\tchrome.tabs.sendMessage(tabs[0].id, {greeting: \"fetch\"}, function (response) {\n\t\t\t\t\t\tdoc = response.links;\n\t\t\t\t\t\tpopUpUI();\n\t\t\t\t});\n\t\t});\n}", "title": "" }, { "docid": "20bb081f1d2d54cd928a07f33c572e92", "score": "0.5302278", "text": "async function scanHtmlEntrypoints(htmlFiles) {\n return Promise.all(htmlFiles.map(async (htmlFile) => {\n const code = await fs_1.promises.readFile(htmlFile, 'utf8');\n const root = cheerio_1.default.load(code, { decodeEntities: false });\n const isHtmlFragment = root.html().startsWith('<html><head></head><body>');\n if (isHtmlFragment) {\n return null;\n }\n return {\n file: htmlFile,\n root,\n getScripts: () => root('script[type=\"module\"]'),\n getStyles: () => root('style'),\n getLinks: (rel) => root(`link[rel=\"${rel}\"]`),\n };\n }));\n}", "title": "" }, { "docid": "c6da678177c3c702413fbdef097dd2e2", "score": "0.5292775", "text": "function scrapPage(linkPage,links_details,current,max){\r\n var link_page_options = {\r\n uri: linkPage.link,\r\n transform: function (body) {\r\n return cheerio.load(body);\r\n },\r\n resolveWithFullResponse: true\r\n };\r\n var isValidLink = sanatizeUrl(linkPage.link);\r\n if(!isValidLink){\r\n if(current+2 !== max){\r\n wait(scrapping_options.scrapper_delay);\r\n scrapPage(links_details[current+2], links_details, current+2, max)\r\n } else {\r\n writeFiletoJSON(main_details, scrapping_options.details_outout_file+\"_till_\"+max);\r\n var new_start = max+1;\r\n var new_end = scrapping_options.counter + max;\r\n if(new_end < totalItems){\r\n scrapPage(links_details[new_start],links_details,new_start,new_end);\r\n }\r\n }\r\n } else {\r\n rp(link_page_options)\r\n .then(function ($) {\r\n console.log(new Date() +\" scarrping details page started\");\r\n console.log(linkPage.link)\r\n ScrapDetails($);\r\n console.log(new Date() +\" scarrping details page ended\");\r\n if(current+1 !== max){\r\n wait(scrapping_options.scrapper_delay);\r\n scrapPage(links_details[current+1], links_details, current+1, max)\r\n } else {\r\n writeFiletoJSON(main_details, scrapping_options.details_outout_file+\"_till_\"+max);\r\n var new_start = max+1;\r\n var new_end = scrapping_options.counter + max;\r\n if(new_end < totalItems){\r\n scrapPage(links_details[new_start],links_details,new_start,new_end);\r\n }\r\n }\r\n })\r\n .catch(function (err) {\r\n // Crawling failed or Cheerio choked... \r\n });\r\n }\r\n //console.log(linkPage);\r\n}", "title": "" }, { "docid": "616821b6e295003ef5e2d59b20a526bd", "score": "0.529064", "text": "function getAMurl(err,resp,html)\n{\n let STool=cheerio.load(html);\n let allmatchUrlElem=STool(\"a[data-hover='Scorecard']\");\n for(let i=0;i<allmatchUrlElem.length;i++)\n {\n let href=STool(allmatchUrlElem[i]).attr(\"href\");\n let fUrl=\"https://espncricinfo.com\"+href;\n findDataofAMatch(fUrl);\n console.log(\"##############################################################\")\n }\n}", "title": "" }, { "docid": "79a793e37db0c7a06532e7e9086e4e99", "score": "0.5289421", "text": "function updateLinks() {\n $.each($(\"a\"), function () {\n var a = this;\n if (!($._data(a, \"events\") && $._data(a, \"events\")['click'])) {\n $(a).click(function (event) {\n if (event.which == 2) {\n return true;\n }\n var url = $(a).attr(\"href\"); //get url\n goToPage(url);\n event.preventDefault(); //prevent following the link\n });\n }\n });\n}", "title": "" }, { "docid": "2222b0ee74039574431607d431fc5d3f", "score": "0.5288576", "text": "function scrapeUserLink(pageCounter){\n pageCounter++;\n request({\n method: 'GET',\n url: 'https://github-ranking.com/users?page=' + pageCounter\n },\n function(err, response, body) {\n if (err){\n return console.error(err);\n }\n\n $ = cheerio.load(body);\n $('a.list-group-item').each(function() {\n var userLink = $(this)[0].attribs.href;\n // userLink.replace('/', \"\");\n userArray.push(userLink)\n // console.log(userLink)\n });\n\n if(pageCounter != 10){\n console.log(\"retrieve User URLs from page \" + pageCounter + \" done!\")\n console.log(\"==========================================================\")\n scrapeUserLink(pageCounter)\n }else{\n console.log(\"starting to scrape \" + userArray.length + \" repo links :)\")\n console.log(\"==========================================================\")\n recursiveGetRepoLinks(\"stars/ckyue\")\n }\n });\n}", "title": "" }, { "docid": "add5ab347d4850dcbd039279d8acc490", "score": "0.5245598", "text": "findLinks($, orig, current_site, links_visited){\n let thisthat = this;\n return new Promise(function(resolve, reject){\n //Find every link on the webpage and add it to an array.\n let links = [];\n $(\"a\").each((i, elem)=>{ \n let href = $(elem).attr(\"href\");\n if(href!=null){\n //If the link is a partial link then append to it to the current site.\n let full_url = url.resolve(current_site, href);\n if(full_url.startsWith(orig)\n && !links_visited.includes(full_url)\n && !full_url.includes(\"#\")\n && !full_url.includes(\".pdf\")\n && !full_url.includes(\".png\")\n && !full_url.includes(\".jpg\")\n && !full_url.includes(\".xlsx\")\n && !full_url.includes(\".zip\")){\n links.push(full_url);\n }\n }\n })\n \n //Convert array to Set to remove duplicates and convert set back to array\n links = thisthat.removeDuplicatesInArrays(links);\n resolve(links);\n })\n }", "title": "" }, { "docid": "ee2f10b2a406756e5e1b97381e082112", "score": "0.5238024", "text": "function handleUrls(node, resolver, linkHandler) {\n // Set up an array to collect promises.\n let promises = [];\n // Handle HTML Elements with src attributes.\n let nodes = node.querySelectorAll('*[src]');\n for (let i = 0; i < nodes.length; i++) {\n promises.push(handleAttr(nodes[i], 'src', resolver));\n }\n // Handle anchor elements.\n let anchors = node.getElementsByTagName('a');\n for (let i = 0; i < anchors.length; i++) {\n promises.push(handleAnchor(anchors[i], resolver, linkHandler));\n }\n // Handle link elements.\n let links = node.getElementsByTagName('link');\n for (let i = 0; i < links.length; i++) {\n promises.push(handleAttr(links[i], 'href', resolver));\n }\n // Wait on all promises.\n return Promise.all(promises).then(() => undefined);\n }", "title": "" }, { "docid": "aaaa6f0725ed6598c958902e9de1ae8a", "score": "0.52261853", "text": "function processAllDrupalOrgIssueLinks() {\n // Get all anchors on the page linking to Drupal.org.\n var els = document.querySelectorAll(\"a[href^='https://www.drupal.org/']\");\n for (var i = 0, l = els.length; i < l; i++) {\n var el = els[i];\n processAnchorElement(el);\n }\n }", "title": "" }, { "docid": "31e53daf838fe54a3c38e8a350f3a558", "score": "0.52018136", "text": "function parse(url) {\n return new WinJS.Promise(function (complete) {\n $.ajax(url).then(function (response) {\n var parser = new Tautologistics.NodeHtmlParser.Parser(handler);\n parser.parseComplete(response);\n var dom = handler.dom;\n\n // See if this is a page with image information inside \n\n if (url.match(re) != null) {\n complete(parse_image_page(dom));\n }\n else {\n\n // We need to rewrite all <a> elements to point to a navigation event in the page\n\n var anchors = SoupSelect.select(dom, \"a\");\n for (var i = 0; i < anchors.length; i++) {\n var anchor = anchors[i];\n\n if (anchor.attribs.href) {\n var link = anchor.attribs.href.indexOf(\"/wiki/\", 0);\n var href = null;\n if (link >= 0) {\n if (link == 0) {\n // relative link to wikipedia\n href = \"http://en.wikipedia.org\" + anchor.attribs.href;\n } else {\n // absolute link to wikipedia\n href = \"http:\" + anchor.attribs.href;\n }\n anchor.attribs.href = href;\n }\n }\n }\n\n var body = SoupSelect.select(dom, \"div.mw-body\")[0];\n var html = inner_html(body);\n var safe_html = window.toStaticHTML(html);\n\n // Extract the title from the page\n\n var nodes = SoupSelect.select(dom, \"h1.firstHeading span\");\n var title = \"unknown title\";\n if (nodes.length > 0 && nodes[0].children.length > 0) {\n title = inner_text(nodes[0]);\n }\n\n // Invoke the completion handler with the JS object that contains the results\n\n complete({\n type: 'article',\n title: title,\n html: safe_html\n })\n }\n });\n });\n }", "title": "" }, { "docid": "e43564cb5d07d72a7276099c727055fb", "score": "0.5198472", "text": "function Scraper() {}", "title": "" }, { "docid": "498ae231b12bd28f0722557945142426", "score": "0.5173092", "text": "function parseSeries(html) {\n // parsing series page\n let d = cheerio.load(html);\n let cards = d(\".cscore.cscore--final.cricket.cscore--watchNotes\")\n // console.log(cards.length);\n // cards=> type => ODI/T20 \n for (let i = 0; i < cards.length; i++) {\n let matchType = d(cards[i]).find(\".cscore_info-overview\").html();\n // console.log(matchType);\n let test = matchType.includes(\"ODI\") || matchType.includes(\"T20\");\n if (test === true) {\n // console.log(matchType)\n // anchors => href => manually request \n // cscore_buttonGroup ul li a.html\n // html ,text ,attr,find \n let anchor = d(cards[i]).find(\".cscore_buttonGroup ul li a\").attr(\"href\");\n //https://www.espncricinfo.com/series/12234/scorecard/12345\n let matchLink = `https://www.espncricinfo.com${anchor}`;\n\n goToMatchPage(matchLink);\n // 8 => request\n }\n // console.log(\"``````````````````````````````````````````\");\n }\n}", "title": "" }, { "docid": "2d38fcd6763b55fcc66b612996202b59", "score": "0.517224", "text": "function eachLinkCallback(linkObj, parentUrl, array){\n\n\tvar url = linkObj.attr('href');\n\tif(typeof url !== 'undefined' &&\n\t url != '' &&\n\t url[0] != '.' &&\n\t url[0] != '#'){\n\n\t\t//remove www\n\t\turl = url.replace('www.', '');\n\n\t\t//make relative links absolute\n\t\tif(url.substring(0, 4) != 'http'){\n\t\t\tif(url[0] == '/') url = url.substring(1);\n\t\t\turl = parentUrl + '/' + url;\n\t\t}\n\n\t\tvar urlObj = urlModule.parse(url);\n\t\tvar formattedUrl = urlObj.hostname + urlObj.pathname; \n\n\t\t//remove trailing forward slash. This has to happen after formatting the url\n\t\tif(formattedUrl.charAt( formattedUrl.length - 1 ) == \"/\"){\n\t\t\tformattedUrl = formattedUrl.slice(0, -1);\n\t\t}\n\t\t\n\t\t//if the end is reached\n\t\tif(formattedUrl == stopUrl){\n\t\t\tarray[formattedUrl] = [];\n\t\t\tonStopUrlReached();\n\t\t}else if(searchedUrls.indexOf(formattedUrl) == -1){\n\n\t\t\tsearchedUrls.push(formattedUrl);\n\t\t\tarray[formattedUrl] = [];\n\n\t\t\t//if this url hasn't already been crawled..\n\t\t\tcrawl(\"http://\" + formattedUrl, array[formattedUrl]); //recurse the function\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d5465d1cb49d15859f07a2207049d6e1", "score": "0.5168876", "text": "function obtenerLinks(preguntas,anotFiltradas) {\n//A raiz de las anotaciones creamos una lista de objetos que contienen la uri del alumno, una pregunta y la nota obtenida. Pueden existir objetos repetidos ya que para varias preguntas existen varias anotaciones\n var preguntasAlumnosRep = _.map(anotFiltradas, (anotacion) => ({\n 'uri': anotacion.uri,\n 'pregunta': anotacion.tags[0].slice(18),\n 'nota': parseInt(anotacion.tags[1].slice(10))\n }));\n\n\n//Filtramos la lista previamente obtenida para eliminar los objetos repetidos\n var preguntasAlumnos = _.uniqBy(preguntasAlumnosRep, (alumno) => (alumno.uri.concat(alumno.pregunta)));\n\n//Creamos una lista y añadimos a cada alumno y si ha aprobado o no. Obtenemos la nota media, la pasamos sobre 10 y segun la nota sera aprobado o suspenso.\n resultadoFinalAlumnos = _(preguntasAlumnosRep).groupBy('uri')\n .map((preguntas, alumno) => ({\n 'uri': alumno,\n 'resultadoFinal': (normalizar(anotaciones,_.sumBy(preguntas, 'nota')) >= 5) ? \"Aprobado\" : \"Suspenso\" //Nos servira para saber de color pintar los links\n })).value();\n\n//Cogemos las preguntas de cada alumno de 'preguntasAlumnos' y le indicamos si al final aprobaron o no\n var preguntasAlumnosConResultado = _.map(preguntasAlumnos, function (obj) {\n return _.assign(obj, _.find(resultadoFinalAlumnos, {\n uri: obj.uri\n }));\n });\n\n//Agrupamos por preguntas. Cada pregunta tendra una lista de las nota de cada alumno en ese ejercicio\n var preguntasNotas = _.groupBy(preguntasAlumnos, 'pregunta');\n var links=[];\n //Recorremos cada pregunta del examen para saber las relaciones entre una pregunta y la siguiente\n for (var i = 0; i < preguntas.length - 1; i++) {\n var ejercicioOrigen = _.get(preguntasNotas, preguntas[i]); //Cogemos las notas de los alumnos de una pregunta\n var ejercicioDestino = _.get(preguntasNotas, preguntas[i + 1]); //Cogemos las notas de los alumnos de la siguiente pregunta\n var notas = _(ejercicioOrigen).map(\"nota\").uniq().value(); //Cogemos las distintas notas que ha habido en el primer ejercicio\n var nota;\n\n //Por cada nota distinta del primer ejercicio, comprobamos que nota se ha obtenido en el siguiente\n for (var j = 0; j < notas.length; j++) {\n nota = notas[j];\n //Cogemos los alumnos que han sacado esa nota en el primer ejercicio\n var alumnosNotaEjercicioOrigen = _(ejercicioOrigen).filter({'nota': nota}).map((anotacion) => ({'uri': anotacion.uri})).value();\n\n //Obtenemos los alumnos (y sus notas) del segundo ejercicio que han sacado esa nota en el primer ejercicio\n var alumnosNotaEjercicioDestino = _(ejercicioDestino).intersectionBy(alumnosNotaEjercicioOrigen, 'uri').value();\n\n //Filtramos y nos quedamos con los alumnos que han aprobado, contamos cuantos hay por cada nota y creamos un link siendo el origen la nota del\n // primer ejercicio (se guarda la pregunta concatenada con la nota), el objetivo la nota en el siguiente ejercicio, el valor cuantos alumnos\n // han sacado la nota del segundo ejercicio habiendo sacado la nota del primer ejercicio. Tambien se guarda que son los que han aprobado para saber de color pintar el link\n var linkAprobados = _(alumnosNotaEjercicioDestino).filter({'resultadoFinal': \"Aprobado\"}).countBy(\"nota\")\n .map((count, mark) => ({\n 'source': preguntas[i].concat(nota),\n 'target': preguntas[i + 1].concat(mark),\n 'value': count,\n 'resultadoFinal': \"Aprobado\"\n })).value();\n\n //Igual que el anterior pero quedandonos con los alumnos suspendidos\n var linkSuspendidos = _(alumnosNotaEjercicioDestino).filter({'resultadoFinal': \"Suspenso\"}).countBy(\"nota\")\n .map((count, mark) => ({\n 'source': preguntas[i].concat(nota),\n 'target': preguntas[i + 1].concat(mark),\n 'value': count,\n 'resultadoFinal': \"Suspenso\"\n })).value();\n\n //Los añadimos a la lista de links\n links = _.concat(links, linkAprobados);\n links = _.concat(links, linkSuspendidos);\n\n }\n }\n\n var ultimoEjercicio=_.last(preguntas);\n var anotUltimoEjercicio= _.get(preguntasNotas , ultimoEjercicio); //Cogemos las notas de los alumnos de la siguiente pregunta\n var notas= _(anotUltimoEjercicio).map(\"nota\").uniq().value();\n //Por cada nota en el ultimo ejercicio, si aprobaron o no el examen\n for (var i = 0; i < notas.length; i++) {\n var nota=notas[i];\n var r = _.filter(anotUltimoEjercicio, {'nota':nota});\n\n var aprobados = _(r).filter({ 'resultadoFinal': \"Aprobado\" }).countBy(\"nota\")\n .map((count, mark) => ({\n 'source': ultimoEjercicio.concat(nota),\n 'target': group.concat(\"Aprobado\"),\n 'value': count,\n 'resultadoFinal': \"Aprobado\"\n })).value();\n\n var suspensos = _(r).filter({ 'resultadoFinal': \"Suspenso\" }).countBy(\"nota\")\n .map((count, mark) => ({\n 'source': ultimoEjercicio.concat(nota),\n 'target': group.concat(\"Suspenso\"),\n 'value': count,\n 'resultadoFinal': \"Suspenso\"\n })).value();\n\n links= _.concat(links, aprobados);\n links= _.concat(links, suspensos);\n }\n return links;\n}", "title": "" }, { "docid": "c3619a1dc73cd43e796e6a8f401b37e5", "score": "0.5161506", "text": "function getLinks(text) {\n const regex = /\\[([^\\]]*)\\]\\((https?:\\/\\/[^*$#\\s].[^\\s]*)\\)/gm;\n const arrayResults = [];\n let temp;\n while ((temp = regex.exec(text)) !== null) {\n arrayResults.push({ [temp[1]]: [temp[2]] })\n }\n return arrayResults.length === 0 ? 'Não há links no arquivo' : arrayResults;\n}", "title": "" }, { "docid": "8f79eecf707a991568e4bd42099abcb5", "score": "0.5150657", "text": "function extractLinks(identifier) {\n const selector = document.querySelectorAll(`${identifier}`);\n let items = [];\n for (let element of selector) {\n items.push(element.href);\n }\n //console.log(items);\n return items;\n}", "title": "" }, { "docid": "393ed62b7f711bebe14c256c8c78bb78", "score": "0.5138262", "text": "function fullyQualifyLinksInLinkBibliographyEntries(containingDocument = document.firstElementChild) {\n\tGWLog(\"fullyQualifyLinksInLinkBibliographyEntries\", \"rewrite.js\", 1);\n\n\tcontainingDocument.querySelectorAll(\"#link-bibliography > ol > li > p a\").forEach(link => {\n\t\tlink.href = link.href;\n\t});\n}", "title": "" }, { "docid": "679c1ffea02187e934a4ea46f7df4dfa", "score": "0.5128731", "text": "async function getHomeworks() {\n const html = await http.get('domaci');\n const tree = parse(html);\n return tree.querySelectorAll('a').map(node => ({\n name: node.rawText.trim(),\n type: 'domaci'\n }));\n}", "title": "" }, { "docid": "7182756eb129b95b27069692bc32f078", "score": "0.51158077", "text": "function doCrawl() {\r\n if(visitedUrlCount >= maxCount) {\r\n printLog(\"Crawling completed successfully: Visited the max allowed pages.\");\r\n printLog(\"Writing visited links to file...\");\r\n printToFile(visitedUrls);\r\n printLog(\"Please find the crawled links listed in \"+ filePath);\r\n return;\r\n } else if (urlArr.length < 1) {\r\n printLog(\"Crawling completed successfully: No more pages left to visit.\");\r\n printLog(\"Writing visited links to file...\");\r\n printToFile(visitedUrls);\r\n printLog(\"Please find the crawled links listed in \"+ filePath);\r\n return;\r\n }\r\n var nextUrl = urlArr.pop();\r\n if(visitedUrls.indexOf(nextUrl) < 0) {\r\n visitAndParsePageSource(nextUrl, doCrawl);\r\n } else {\r\n doCrawl();\r\n }\r\n}", "title": "" }, { "docid": "003c64017ca8293306d9e485de330eb0", "score": "0.5112035", "text": "function prepPageLinks() {\n document.onclick = function(e) {\n var element = e.target;\n if (element.tagName === 'A') {\n handleLinkClick(element);\n return false; // disable redirect\n }\n }\n }", "title": "" }, { "docid": "98e1d6f771b0bcabb72487206b42db64", "score": "0.50878656", "text": "function getItemsOnFunnyOrDie(){\r\n console.log(\"Parsing FunnyOrDie videos\");\r\n var thumbnailXpath = \"//div[contains(@class, 'thumb')]\";\r\n var HREF_XPATH = \"a/@href[contains(.,'/videos')]\";\r\n var result = [];\r\n items = getElementsByXPath(thumbnailXpath, document);\r\n \r\n for(i = 0; i <= items.snapshotLength; i++){\r\n var node = items.snapshotItem(i);\r\n \r\n var href = getElementsByXPath(HREF_XPATH, node);\r\n console.log(href);\r\n if(href.snapshotLength == 1){\r\n var hrefText = href.snapshotItem(0);\r\n var res = [\"http://funnyordie.com\"+ hrefText.nodeValue,node.parentNode];\r\n result.push(res); \r\n }\r\n \r\n }\r\n return result;\r\n\r\n}", "title": "" }, { "docid": "128771e0acc353f29d46d14af302e489", "score": "0.5086632", "text": "function replaceDoisWithLinks(html) {\n return html.replace(/doi: (.*)\\.<\\/div>/g, \"doi: <a target='_blank' href='https://www.doi.org/$1'>$1</a>.</div>\");\n}", "title": "" }, { "docid": "9afdd6c6a0675e067095dc6a733a0ab3", "score": "0.50850654", "text": "function urls2links(element) {\n var re = /((http|https|ftp):\\/\\/[\\w?=&.\\/-;#@~%+-]+(?![\\w\\s?&.\\/;#~%\"=-]*>))/ig;\n element.html(element.html().replace(re,'<a href=\"$1\" rel=\"nofollow\">$1</a>'));\n var re = /((magnet):[\\w?=&.\\/-;#@~%+-]+)/ig;\n element.html(element.html().replace(re,'<a href=\"$1\">$1</a>'));\n}", "title": "" }, { "docid": "15236cb3d2a64ad15d6e8139942082e2", "score": "0.508021", "text": "function fetchWeb(url){\n fetch(url, {\n headers: {\n 'User-Agent': \"Mozilla/5.0\",\n 'Access-Control-Allow-Origin': '*'\n }\n }).then(function(fetchResponse){\n return fetchResponse.text();\n }).then(function(text) {\n response = text;\n resultHTML = parser.parseFromString(text, \"text/html\");\n\n var result_list = resultHTML.getElementsByClassName(\"g\");\n\n for(var i = 0; i < result_list.length; i++ ){\n if(result_list[i].className === \"g\"){\n const link = result_list[i].querySelector(\"[href]\");\n const title = result_list[i].getElementsByTagName(\"H3\");\n const description = result_list[i].getElementsByClassName(\"aCOpRe\");\n \n results_container.innerHTML += \"<Li>\" + title[0].innerText + \"</Li> <dd></dd>\" + \n '<a href=\"' + link.getAttribute(\"href\") + '\">' + link.getAttribute(\"href\") + \"</a> <dd></dd>\" +\n \"<Li>\" + description[0].innerText + \"</Li> <br></br>\";\n }\n }\n }).catch(function(error){\n console.log(error);\n }) \n}", "title": "" }, { "docid": "9530099f1c44a2e82f4ca3be0e0d3157", "score": "0.506789", "text": "function scrapeUrls(url,done){\n\t //var urls_restaurant=[];\n \t request(url, function(err,resp,body){ \n \t \t if (err) console.log(\"error at url : \" + url);\n \t \t else{\n \t \t \t var $=cheerio.load(body);\n \t\t $('.poi-card-link').each(function(){\n \t\t \t var url_temp = \"https://restaurant.michelin.fr\";\n \t\t\t url_temp+=$(this).attr('href');\n \t\t \t urls_restaurant.push(url_temp); //Every restaurant name is added to the array of restaurants\n \t\t });\n \t\t urls_Limit(urls_restaurant);\n \t\t\t done(null,urls_restaurant); //Once the process is done, we catch the restaurant urls\n \t \t }\n \t\t\n \t});\n}", "title": "" }, { "docid": "953fd34f23bdc3dd6f102f4db04f4e33", "score": "0.5067889", "text": "function fixLinks(htmlFragment)\n{\n\t// Collect all the links\n\tvar links = htmlFragment.getElementsByTagName(\"a\");\n\tfor (var i = 0; i < links.length; i++) {\n\t\tvar aNode = links[i];\n\t\t// Send them to our clickOnLink function\n\t\taNode.onclick = clickOnLink;\n\t}\n}", "title": "" }, { "docid": "1f185bc44cbc29cb35ca3542fdd52b68", "score": "0.5061476", "text": "function getAllScoreCardLink(html){\n let searchTool1 = cheerio.load(html);\n let scorecardArr = searchTool1(\"a[data-hover='Scorecard']\");\n for(let i=0; i<scorecardArr.length; i++){\n let linkScorecard = searchTool1(scorecardArr[i]).attr(\"href\");\n let fullScorecardPath = `https://www.espncricinfo.com${linkScorecard}`;\n console.log(fullScorecardPath);\n\n scorecardObj.getUrl(fullScorecardPath);\n }\n\n}", "title": "" }, { "docid": "513a9ac305400a101098a856cd789c09", "score": "0.50600004", "text": "async function fetchHTML(url) {\n const { data } = await axios.get(url)\n return cheerio.load(data)\n }", "title": "" }, { "docid": "bf12accff4d5a73571aa1d6612b220e0", "score": "0.50596595", "text": "function parseMovieLensLink(strResponseHTML) {\r\n \r\n // Regex to get the direct link from the HTML source that was recieved from MovieLens\r\n var regexDirectLink = new RegExp(\"src=\\\"/images/stars/([\\\\w\\\\.]+).gif\\\" width=\\\"84\\\" height=\\\"17\\\" .+<a href=\\\"/movieDetail\\\\?movieId=(\\\\d+)\\\" class=\\\"movieTitleL\\\">.+</a>.+<a href=\\\"http://akas\\\\.imdb\\\\.com/title/\" + globalStrImdbNum + \"\\\" TARGET=\\\"_imdb\\\">\", \"\");\r\n var arrResult = regexDirectLink.exec(strResponseHTML);\r\n \r\n if (arrResult && arrResult.length == 3) {\r\n changeMovieLensLink(STATE_SUCCESS, \"http://www.movielens.org/movieDetail?movieId=\" + arrResult[2], arrResult[1]);\r\n } else {\r\n GM_log(\"Could not find direct link to film in MovieLens. Linking to search page instead.\");\r\n changeMovieLensLink(STATE_FAILED, globalStrSearchURL, '');\r\n }\r\n \r\n}", "title": "" }, { "docid": "4fc58c0373825754a49186646a23e7dd", "score": "0.5058335", "text": "function getLinks() {\n\tws.get({limit: 5, sort: 'date:desc'}).on('success', function(data, response) {\n\t\tvar result = \"\";\n\t\tfor (var i in data) {\n\t\t\tif (data.hasOwnProperty(i)) {\n\t\t\t\tresult += \"<a href='\" + data[i].url + \"' alt='\" + data[i].name + \"'><img title ='\" + data[i].name + \"' alt='\" + data[i].name + \"' src='http://img.bitpixels.com/getthumbnail?code=\" + localStorage[\"bitPixelCode\"] + \"&url=\" + data[i].url + \"&size=200&format=PNG' /></a><br/>\";\n\t\t\t}\n\t\t}\n\t\t$(\"#displayLinks\").html(result);\n\t});\n}", "title": "" }, { "docid": "f4effa06d9d8247ce297bf9eb151b27b", "score": "0.50559896", "text": "function ContentExtractor(html, sourceID, url, siteinfos) {\n\treturn new Promise(function(resolve, reject) {\n\t\tif (!sourceID) return reject('no source feed specified');\n\t\tif (!html) return reject('no HTML provided');\n\n\t\tvar source = sources.findWhere({ id: sourceID });\n\n\t\t// If there is no body assume it's a binary file\n\t\tif (!re_body.test(html)) return resolve(getBinaryLink(url));\n\n\t\thtml = createHTML(html);\n\t\tif (!source) return reject('no source feed with matching ID');\n\t\tif (!html) return reject('failed to create DOM for current HTML');\n\n\t\tvar ft_pos_mode = source.get('fulltextEnable') || 0,\n\t\t\tft_pos = source.get('fulltextPosition') || ft_pos_default,\n\t\t\thtml_result = '',\n\t\t\tnodes = [];\n\n\t\tremoveNodes(html);\n\n\t\tmode:\n\t\tswitch (ft_pos_mode) {\n\t\t\tcase 1:\n\t\t\t\tnodes = getNodes(html, ft_pos);\n\t\t\t\tif (!nodes.length)\n\t\t\t\t\treturn reject('no nodes match the pattern');\n\t\t\t\thtml_result = nodesToText(nodes, true);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor (var i = 0, len = siteinfos.length; i < len; i++) {\n\t\t\t\t\tnodes = getNodes(html, siteinfos[i].pageElement);\n\t\t\t\t\thtml_result = nodesToText(nodes, true);\n\t\t\t\t\tif (html_result.length > min_length / 10) break mode;\n\t\t\t\t}\n\n\t\t\t\tnodes = [];\n\t\t\t\thtml_result = '';\n\n\t\t\t\tvar readable = new Readability({ pageURL: url, resolvePaths: true });\n\t\t\t\tfor (var i = 0, l = readable.getMaxSkipLevel(); i <= l; i++) {\n\t\t\t\t\treadable.setSkipLevel(i);\n\t\t\t\t\treadable.parseDOM(html.childNodes[html.childNodes.length-1]);\n\t\t\t\t\thtml_result = readable.getHTML().trim();\n\t\t\t\t\tif (readable.getLength() > min_length) break mode;\n\t\t\t\t\t//console.log('[ContentExtractor] Retry URL:'+url+';attempt='+i+';length='+readable.getLength())\n\t\t\t\t}\n\n\t\t\t\tif (readable.getLength() < min_length)\n\t\t\t\t\thtml_result = nodesToText(getNodes(html, ft_pos_default), true);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// this shouldn't happen\n\t\t\t\treturn reject('trying to get fulltext in no-fulltext mode');\n\t\t}\n\n\t\t // just to be sure clean it up again after processing\n\t\thtml = createHTML(html_result);\n\t\tif (!html) return reject('failed to clean resulting HTML');\n\t\tremoveNodes(html);\n\n\t\tresolve(html.body.innerHTML);\n\t});\n}", "title": "" }, { "docid": "f830fcb07c744199fa9e729d57f598a8", "score": "0.5053298", "text": "function getCurrentItemLinks(){\r\n // First, get a reference to the current entry\r\n var current_entry = document.getElementById(\"current-entry\");\r\n // Now, get all of the DIV elements under this node.\r\n var elements = current_entry.getElementsByTagName('DIV');\r\n // Setup a placeholder for the item body element\r\n var itembody;\r\n // Setup the regular expression to find the class name\r\n var classregex = new RegExp('\\\\bitem-body\\\\b');\r\n // Loop through the DIV elements and set the itembody\r\n // when it is found\r\n for(var i = 0; i< elements.length; i++){\r\n\tif(classregex.test(elements[i].className)) \r\n\t itembody = elements[i];\r\n }\r\n // Return the links found in the body\r\n return itembody.getElementsByTagName(\"A\");\r\n}", "title": "" }, { "docid": "393d2ae46b085d5fc90c670767f4f41f", "score": "0.50493133", "text": "function addGAToDownloadLinks() {\n\tif (document.getElementsByTagName) {\n\t\t// Initialize external link handlers\n\t\tvar hrefs = document.getElementsByTagName(\"a\");\n\t\tfor (var l = 0; l < hrefs.length; l++) {\n\t\t\t// try {} catch{} block added by erikvold VKI\n\t\t\ttry{\n\t\t\t\t//protocol, host, hostname, port, pathname, search, hash\n\t\t\t\tif (hrefs[l].protocol == \"mailto:\") {\n\t\t\t\t\tstartListening(hrefs[l],\"mousedown\",trackMailto);\n\t\t\t\t} else if (hrefs[l].protocol == \"tel:\") {\n\t\t\t\t\tstartListening(hrefs[l],\"mousedown\",trackTelto);\n\t\t\t\t} else if (hrefs[l].hostname == location.host) {\n\t\t\t\t\tvar path = hrefs[l].pathname + hrefs[l].search;\n\t\t\t\t\tvar isDoc = path.match(/\\.(?:doc|docx|eps|jpg|png|svg|xls|xlsx|ppt|pptx|pdf|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\\&|\\?)/);\n\t\t\t\t\tif (isDoc) {\n\t\t\t\t\t\tstartListening(hrefs[l],\"mousedown\",trackExternalLinks);\n\t\t\t\t\t}\n\t\t\t\t} else if (!hrefs[l].href.match(/^javascript:/)) {\n\t\t\t\t\tstartListening(hrefs[l],\"mousedown\",trackExternalLinks);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "431a65dbba015cb436812dc22f482a56", "score": "0.5043271", "text": "function parseHTML(searchTerm){\n let filename = 'result.html';\n let htmlContents = fs.readFileSync(filename, 'utf-8');\n\n let $ = cheerio.load( htmlContents );\n\n let titles = $('.result-card__title');\n let subtitles = $('.result-card__subtitle');\n let locations = $('.job-result-card__location');\n let snippets = $('.job-result-card__snippet');\n let links = $('.result-card__full-card-link');\n\n let size = titles.length;\n for(let el of [subtitles, locations, snippets, links]){\n if(el.length != size) throw Error('Mismatched array sizes while parsing');\n }\n\n let partialResults = [];\n\n titles.each((i,el) => {\n partialResults[i] = {\n search: searchTerm,\n title: $(el).text()\n };\n });\n subtitles.each((i,el) => { partialResults[i].subtitle = $(el).text(); });\n locations.each((i,el) => { partialResults[i].location = $(el).text(); });\n snippets.each((i,el) => { partialResults[i].snippet = $(el).text(); });\n links.each((i,el) => { partialResults[i].link = $(el).attr('href'); });\n\n return partialResults;\n}", "title": "" }, { "docid": "370f58b41d4453fb05810dff31fdeb67", "score": "0.5042742", "text": "deserialize(el, next) {\n if (el.tagName != 'a') return\n return {\n kind: 'inline',\n type: INLINES.LINK,\n nodes: next(el.children),\n data: {\n url: el.attribs.href\n }\n }\n }", "title": "" }, { "docid": "329207a4e89d08ddb57e27ba63bda6b5", "score": "0.50411206", "text": "function loadLinks() {\n\t\tlet link = (name, url) => {\n\t\t\tlet elem = createElement('div', {class: `${hsp}link`});\n\n\t\t\tlet shorten = (text, len) => {\n\t\t\t\tlet strlength = text.length;\n\t\t\t\tif(strlength > len)\n\t\t\t\t\ttext = text.substring(0, len / 2 - 3) + \"...\" + text.substring(strlength - len / 2, strlength);\n\t\t\t\treturn text;\n\t\t\t}\n\n\t\t\tlet fixedName = shorten(name, 64);\n\t\t\tlet fixedUrl = shorten(url, 40);\n\n\t\t\telem.appendChild(createElement('p').setTextContent(fixedName));\n\t\t\telem.appendChild(createElement('p').setTextContent(fixedUrl));\n\n\t\t\telem.addEventListener('click', event => {\n\t\t\t\tif(elem.classList.contains(`${hsp}active`)) {\n\t\t\t\t\tchrome.runtime.sendMessage({action: 'stepinto', handle: url});\n\t\t\t\t\tloadLinks();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tchrome.runtime.sendMessage({action: 'navigate', handle: url});\n\t\t\t\ttoggle();\n\t\t\t});\n\n\t\t\telem.addEventListener('contextmenu', event => {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\telem.classList.toggle(`${hsp}active`);\n\n\t\t\t\t// If this is off now, we've just right clicked on the active link again.\n\t\t\t\t// That means the user is opting out of action mode, and we need to disable it.\n\t\t\t\tif(!elem.classList.contains(`${hsp}active`)) {\n\t\t\t\t\tcomponents.browser.actionMode = false;\n\t\t\t\t\tcomponents.browser.selection = undefined;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif(components.browser.selection) { // If something was selected before this\n\t\t\t\t\t// Then we want to disable it to avoid duplicate selection\n\t\t\t\t\tcomponents.browser.selection.elem.classList.toggle(`${hsp}active`, false);\n\t\t\t\t}\n\n\t\t\t\tcomponents.browser.selection = {elem: elem, url: url};\n\t\t\t\tcomponents.browser.actionMode = true;\n\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\treturn elem;\n\t\t};\n\n\t\tchrome.runtime.sendMessage({action: 'fetchLinks'}, reply => {\n\t\t\tlet fragment = document.createDocumentFragment();\n\t\t\tcomponents.browser.links = [];\n\n\t\t\tif(reply.links) {\n\t\t\t\treply.links.forEach((elem, index) => {\n\t\t\t\t\tcomponents.browser.links.push(link(elem.name, elem.url));\n\t\t\t\t\tfragment.appendChild(components.browser.links[index]);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet backstep = components.chinbar.buttons[components.chinbar.buttonNames.indexOf('backstep')];\n\n\t\t\tbackstep.classList.toggle(`${hsp}disabled`, !reply.canRecede);\n\n\t\t\twhile(components.browser.firstChild) {\n\t\t\t\tcomponents.browser.removeChild(components.browser.firstChild);\n\t\t\t}\n\n\t\t\tcomponents.browser.appendChild(fragment);\n\t\t});\n\t}", "title": "" }, { "docid": "06af95f1c5c8c462c7bbc83bf90a9043", "score": "0.50403315", "text": "function parseKmlText(text) {\n var oParser = new DOMParser();\n var oDOM = oParser.parseFromString(text, 'text/xml');\n var links = oDOM.querySelectorAll('NetworkLink Link href');\n var files = Array.prototype.slice.call(links).map(function(el) {\n return el.textContent;\n });\n // console.log(files);\n return files;\n }", "title": "" }, { "docid": "ab034de889be4532670c117f5fb8fe0f", "score": "0.50383216", "text": "async function fetchPage(htmlUrl, cssUrl) {\n console.log('Requesting HTML');\n const response = await fetch(htmlUrl);\n console.log('Got response for HTML');\n\n const watchFor = '<link rel=\"stylesheet\"';\n let seenLink = false;\n let length = 0;\n let buffer = ''\n let start;\n\n const stream = response.body.pipeThrough(decodeText());\n\n for await (const chunk of iterateStream(stream)) {\n length += chunk.length;\n\n if (!start) {\n start = Date.now();\n console.log('Got first HTML chunk');\n }\n\n if (!seenLink) {\n buffer += chunk;\n if (buffer.includes(watchFor)) {\n buffer = '';\n seenLink = true;\n console.log('Seen stylesheet reference');\n fetchCss(cssUrl).then(() => {\n const now = Date.now();\n console.log('HTML bps so far:', length / ((now - start) / 1000));\n });\n }\n buffer = buffer.slice(-(watchFor.length - 1));\n }\n }\n\n const end = Date.now();\n console.log('Got all HTML. bps:', length / ((end - start) / 1000));\n}", "title": "" }, { "docid": "f38a459da08a7143ac654dfedee2d64f", "score": "0.5037555", "text": "function parseWikiHtml(html) {\n \n // convert html into a jQuery instance for easier parsing\n const $document = $(html);\n \n // This is just an example of something you might do with the html. Use jQuery to\n // parse the html into a form that suits the requirements for the app as I've done\n // on the following lines which log an array of strings containing the text for each\n // event found in the html from wikipedia\n const events = $document\n .find('#Events') // find the element for the Events\n .parent() // move up to the h2\n .next() // move to sibling after h2 -- ul\n .children() // get all the li contained in the ul\n .toArray() // convert to a regular Array.\n .map(el => $(el).text()); // get the text of each li\n console.log(events);\n return $document;\n}", "title": "" }, { "docid": "3c25ad1f84301446c2d23d1854a20c5c", "score": "0.50302714", "text": "function externalLinks() {\n if (!document.getElementsByTagName) {\n return;\n }\n var anchors = document.getElementsByTagName(\"a\");\n for (var i = 0; i < anchors.length; i++) {\n var anchor = anchors[i], target;\n if (anchor.getAttribute(\"href\") &&\n anchor.getAttribute(\"rel\") &&\n anchor.getAttribute(\"rel\").match(/^Target:/)) {\n target = anchor.getAttribute(\"rel\").match(/(^Target:)(\\w+$)/);\n anchor.target = target[2];\n }\n }\n }", "title": "" }, { "docid": "60ae92b8a9135b0a3a202740fbc7dab1", "score": "0.5029757", "text": "async function fetch(href) {\n try {\n const response = await axios(href);\n if (response.status !== 200) {\n return null;\n }\n const $ = cheerio.load(response.data);\n return $('a')\n .toArray()\n .map((element) => $(element).attr('href'))\n .map((relative) => absolute(relative, href))\n .filter((value) => value);\n } catch {\n return null;\n }\n}", "title": "" } ]
8e09441187e336e5ceeec65f0bce5c5b
Compile sass into CSS
[ { "docid": "b9fabc7a48713df86bbfac718bfb2d42", "score": "0.7740708", "text": "function compileSass() {\n return gulp.src(src.scss)\n .pipe(sourcemaps.init())\n .pipe(sass({\n includePaths: ['src/assets/stylesheets'],\n outputStyle: 'compressed'\n }))\n .pipe(autoprefixer())\n .pipe(sourcemaps.write())\n .pipe(gulp.dest(src.css))\n .pipe(browserSync.stream());\n}", "title": "" } ]
[ { "docid": "c71a05fea8c3394f8225b4d4f5d783d5", "score": "0.8100709", "text": "function sass(){\n return src('sass/**/*.scss')\n .pipe(CompSass())\n .pipe(dest('css/'))\n}", "title": "" }, { "docid": "dd6c0a4b759b2c23404c5f2b5ae42860", "score": "0.79992604", "text": "function sasscompile() {\n return gulp\n .src(\"./src/sass/**/*.scss\")\n .pipe(sourcemaps.init())\n .pipe(plumber())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(autoprefixer({browsers: ['last 2 versions']}))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest(\"./src/css/\"))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "02b3eb7c2e51c45d332b0110d62e2582", "score": "0.7953622", "text": "function compileSass() {\n return gulp\n .src([\"themes/endicott-counseling/scss/**/*.scss\"])\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(gulp.dest(\"themes/endicott-counseling/source/assets/css\"));\n}", "title": "" }, { "docid": "74f7fd4077bef016a6cb980f2faa9308", "score": "0.78976583", "text": "function compileSass() {\n return gulp\n .src('ui/modules/**/*.scss')\n .pipe(\n sass({\n fiber: Fiber,\n sourceComments: false,\n }).on('error', sass.logError)\n )\n .pipe(gulp.dest('./ui/modules'))\n}", "title": "" }, { "docid": "e0c9dd6cc3606a2b8f136b7601eb5f2e", "score": "0.78836805", "text": "function compileSass() {\n return getSass()\n .pipe(gulp.dest(`./dist/css`))\n .pipe(browserSync.stream());\n }", "title": "" }, { "docid": "657e635f01195d76fdf84abca0dbf3bc", "score": "0.7824432", "text": "function sassCompile() {\n return gulp.src('./app/scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./app/css'))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "4544a0c34213237139995f92659b76cd", "score": "0.78240836", "text": "function sassCompile() {\n return src('assets/scss/**/*.scss')\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))\n .pipe(sourcemaps.write('scss-maps/'))\n .pipe(dest('assets/'));\n}", "title": "" }, { "docid": "2384a0fe16fd40b83c404e22f5a7ad45", "score": "0.77917606", "text": "function sassToCssTask(){\n return src(paths.sass.src)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss([ autoprefixer() ]))\n .pipe(sourcemaps.write('.'))\n .pipe(dest(paths.sass.dest));\n}", "title": "" }, { "docid": "484dce1f11c69373631f844816929711", "score": "0.7733284", "text": "function sassCompile() {\n return gulp.src('app/scss/**/*.scss')\n .pipe(sass())\n .pipe(autoprefixer({\n cascade: false\n }))\n .pipe(gulp.dest('app/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "18f35ec3a0727fa878d5ff908af11963", "score": "0.76894933", "text": "function compileScss() {\n return src(['scss/*.scss'])\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('scss'))\n}", "title": "" }, { "docid": "978f2950856b0681ac6aa9bc91b001ea", "score": "0.7679749", "text": "function compileSass() {\n return gulp.src('src/sass/**/*.scss')\n .pipe(sass({ outputStyle: 'expanded' }).on('error', sass.logError))\n .pipe(autoprefixer())\n .pipe(rename('styles.css'))\n .pipe(gulp.dest('src/css'))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "a190921e0d2d9a4e5799d09edabb381c", "score": "0.7603274", "text": "function compileSass(){\n return gulp.src('src/scss/*.scss')\n .pipe(sass()).on('error', sass.logError)\n .pipe(sourcemaps.init())\n .pipe(concat('styles.css'))\n .pipe(rename({\n basename: 'styles',\n suffix: '.min',\n extname: \".css\"\n }))\n .pipe(postcss([prefix(), minify]))\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(PATHS.scss.dest))\n}", "title": "" }, { "docid": "250169282fd66ca61423dd55bfc5ae9a", "score": "0.7583661", "text": "function sass() {\n return gulp.src('src/assets/scss/zendroidthemes.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe(postcss([autoprefixer()]))\n\n .pipe($.if(PRODUCTION, $.cleanCss({ compatibility: 'ie9' })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe($.if(REVISIONING && PRODUCTION || REVISIONING && DEV, $.rev()))\n .pipe(gulp.dest(PATHS.dist + '/assets/css'))\n .pipe($.if(REVISIONING && PRODUCTION || REVISIONING && DEV, $.rev.manifest()))\n .pipe(gulp.dest(PATHS.dist + '/assets/css'))\n .pipe(browser.reload({ stream: true }));\n}", "title": "" }, { "docid": "ac1c63413b98654f1004149bb67f6c02", "score": "0.7581088", "text": "function compileToSCSS() {\n return src(paths.scssFiles)\n .pipe(sass().on('error', sass.logError))\n .pipe(csso())\n .pipe(concat('main.css'))\n .pipe(dest('pub/css'))\n .pipe(connect.reload());\n}", "title": "" }, { "docid": "72a141c2519e2339ea84415baa723cbb", "score": "0.75804496", "text": "function scssTask(){ \n return src(files.scssPath)\n .pipe(sass()) // compile SCSS to CSS\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(dest('app/css')\n ); // put final CSS in app folder\n}", "title": "" }, { "docid": "2921cd925e060561de1172d065247876", "score": "0.75777394", "text": "function compileSass() {\n return gulp\n .src(\"src/sass/**/*.scss\")\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(autoprefixer({ browsers: [\"last 2 versions\"], cascade: false }))\n .pipe(gulp.dest(\"dist/css\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "94163b3b424a16694465463724779716", "score": "0.75609124", "text": "function compile(){\n return gulp.src('./src/sass/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./src/css'))\n .pipe(browserSync.stream())\n \n}", "title": "" }, { "docid": "068ee5be818311a4ccaa2712f83e4d86", "score": "0.75526845", "text": "function sass() {\n const postCssPlugins = [\n // Autoprefixer\n autoprefixer(),\n ].filter(Boolean);\n var source = 'src/scss/*.scss';\n $.sass.compiler = require('node-sass');\n return gulp.src(source)\n .pipe($.sass({\n includePaths: [\"node_modules/foundation-sites/scss\", \"node_modules/motion-ui/src\"]\n })\n .on('error', $.sass.logError))\n .pipe($.postcss(postCssPlugins))\n .pipe(gulp.dest('src/html/ss'))\n .pipe(browser.reload({ stream: true }));\n}", "title": "" }, { "docid": "50146620d6803bdac829800942ae4e71", "score": "0.7542646", "text": "function scssTask(){\n return src(files.scssPath)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass()) // compile SCSS to CSS\n .pipe(postcss([ autoprefixer(), cssnano() ])) // PostCSS plugins\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n .pipe(dest('dist/assets/css')\n ); // put final CSS in dist folder\n}", "title": "" }, { "docid": "9e1d5622b86111a7002ff35892ff29a7", "score": "0.75269526", "text": "function scss_task() {\n\treturn src([\n files.scss\n ], {\n allowEmpty: true,\n })\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(sass()) // compile SCSS to CSS\n\t\t.pipe(postcss([autoprefixer(), cssnano()]))\n\t\t.pipe(concat('style.min.css'))\n\t\t.pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n\t\t.pipe(dest('assets/css')); // put final CSS in dist folder\n}", "title": "" }, { "docid": "0105381b82bdd3562711a08a1a43868a", "score": "0.75259775", "text": "function css ()\n{\n return gulp.src(config.sassDir)\n \t.pipe(plumber())\n\t .pipe(sass({\n\t includePaths: [\n\t \tconfig.bootstrapDir + '/assets/stylesheets',\n\t ],\n\t }).on('error', sass.logError))\n\t\t.pipe(gulpIf( flag( envConfig.CSS_PREFIX ), cssPrefix({ browsers: ['> 1%', 'IE 9'], cascade: false }) ))\n .pipe(gulpIf( flag( envConfig.CSS_MINIFY ), uglifycss() ))\n\t .pipe(gulp.dest( path.join( envConfig.BUILD_PATH, 'css' ) ))\n\t .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "4a0710f323de8d8477a34bb2b8c2d4ca", "score": "0.7498411", "text": "function scssTask(){ \n return src(files.scssPath)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass()) // compile SCSS to CSS\n .pipe(gulpif(env === 'production', postcss([autoprefixer(), cssnano()]))) // autopref & cssnano on prod\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n .pipe(dest(outputDir + 'css')); // put final CSS in output folder\n}", "title": "" }, { "docid": "6a5c797522af22d3215d53e709f5723b", "score": "0.748692", "text": "function scssTask(){ \n return src(files.scssPath)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass()) // compile SCSS to CSS\n .pipe(postcss([ autoprefixer(), cssnano() ])) // PostCSS plugins\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n .pipe(dest('dist')\n ); // put final CSS in dist folder\n}", "title": "" }, { "docid": "60e3460f55b37531833c5b34ebae313e", "score": "0.7482659", "text": "function compile_css(callback) {\n const processors = [\n autoprefixer(),\n mqpacker({sort: 'mobile-first'}), \n ]; \n\n src(`${devOptions.css.scssDir}/*.scss`, { allowEmpty: true }) \n .pipe(sass().on('error', sass.logError))\n .pipe(postcss(processors))\n .pipe(dest(`${devOptions.css.distDir}`)); \n\n callback();\n}", "title": "" }, { "docid": "54232e30962112475c57faa19fd66834", "score": "0.7446006", "text": "function compileCss() {\n var result = sass.renderSync(sassOpts)\n var css = stripCssComments(result.css, { preserve: false }) /* preserve: false will remove important comments */\n\n /** Output the CSS */\n fs.writeFile(outputFolder + 'bootstrap.css', css, function(err) {\n if(err) {\n console.log(err)\n throw err\n }\n console.log('Bootstrap CSS was compiled!')\n })\n\n /** Generate a sourcemap if its set in the options */\n if (sassOpts.sourceMap) {\n fs.writeFile(outputFolder + 'bootstrap.css.map', result.map, function(err) {\n if(err) {\n console.log(err)\n throw err\n }\n console.log('Bootstrap CSS sourcemap was generated!')\n })\n }\n}", "title": "" }, { "docid": "89233ceaf80bf786d8923daf77d7b07d", "score": "0.74368036", "text": "function scssTask(){ \n return src(files.scssPath)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass({\n outputStyle: 'compressed'\n }).on('error', sass.logError)) // compile SCSS to CSS\n .pipe(postcss([ autoprefixer() ])) // PostCSS plugins , cssnano()\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n .pipe(dest('./css')) // put final CSS in dist folder\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "0034db05ffa98a91ec16b4cc490e5070", "score": "0.74326766", "text": "function scss() {\n return src('./themes/uncompiled/sass/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))\n .pipe(minifyCSS())\n .pipe(concat('main.min.css'))\n .pipe(dest('./themes/compiled/css'));\n}", "title": "" }, { "docid": "e6220772c8d1e89cd519e61694a5edf5", "score": "0.7420647", "text": "function css(){\n return gulp.src('./css/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./css'));\n}", "title": "" }, { "docid": "dd873a130cbd02f0f624a4c085015ffa", "score": "0.7404573", "text": "function css() {\n console.log( taskHeader(\n '1/5',\n 'QA',\n 'Lint',\n 'CSS'\n ) );\n\n return src( sources.scss, { allowEmpty: true } )\n .pipe( sassLint() )\n .pipe( sassLint.format() );\n// .pipe(sassLint.failOnError())\n}", "title": "" }, { "docid": "5cb0ac0ea4ae71ace967b0dfa9755daf", "score": "0.739681", "text": "function css(cb) {\n return gulp.src(['src/scss/main.scss'])\n .pipe(sass())\n .pipe(gulp.dest(\"src/css\"));\n cb();\n}", "title": "" }, { "docid": "93b64f01458c7372d983969ce723e0ea", "score": "0.7390058", "text": "function compileCSS() {\n return gulp.src([\n 'src/scss/nhsuk.scss',\n ])\n .pipe(sass())\n .pipe(cleanCss())\n .pipe(gulp.dest('dist/'));\n}", "title": "" }, { "docid": "672497c8106ed87ffcaf2a7ea9c5b517", "score": "0.738255", "text": "function styleSass() {\n return src('./sass/*.scss') //input路徑\n .pipe(sass({\n outputStyle: \"compressed\" //壓縮css\n }).on('error', sass.logError))\n //.pipe(autoprefixer())\n // .pipe(rename(function (path) {\n // path.basename += \"-prefix\";\n // path.extname = \".css\";\n // })) //改名\n .pipe(dest('./app/css/')) //output路徑\n}", "title": "" }, { "docid": "7840f5e21977f128a9f0a51e8a71bedc", "score": "0.73706925", "text": "function buildSass () {\n return gulp.src('./_scss/main.scss')\n .pipe(sass({\n includePaths: ['./_scss'],\n onError: browser_sync.notify,\n outputStyle: 'compressed'\n }))\n .pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))\n .pipe(gulp.dest('_site/css'))\n .pipe(browser_sync.reload({stream: true}))\n .pipe(gulp.dest('css'));\n}", "title": "" }, { "docid": "51e118142980147781f2d0543fe90840", "score": "0.7364226", "text": "function sass() {\n return src('./sass/import.scss')\n .pipe(gulpSass())\n .pipe(dest('./css/'))\n .pipe(browserSync.stream());\n\n}", "title": "" }, { "docid": "17098b8f06f32e8bac058c69c24d3a4b", "score": "0.7359933", "text": "function Sass() {\n return src(sassSRC)\n .pipe(mode.development(sourcemaps.init()))\n .pipe(sass())\n .pipe(autoprefixer())\n .pipe(mode.development(sourcemaps.write()))\n .pipe(dest(folderDist));\n}", "title": "" }, { "docid": "739386461059f257bba6dacfc53ffea5", "score": "0.73449975", "text": "function compile() {\n var sassOptions = {\n outputStyle: 'expanded',\n indented: true,\n indentType: 'space',\n indentWidth: 2,\n linefeed: 'lf',\n sourceMap: false\n };\n\n // Filter mixins and variables not to be compiled to CSS.\n const filterFiles = filter(['**', '!**/mixins/*.scss', '!mixins.scss', '!variables.scss']);\n\n return gulp.src([paths.scss.src])\n .pipe(filterFiles)\n .pipe(sass(sassOptions).on('error', sass.logError))\n .pipe(postcss([autoprefixer()]))\n .pipe(csscomb())\n .pipe(gulp.dest(paths.scss.dest))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "399dba5b4dff4622fb0a0c27fd0ca27a", "score": "0.7342729", "text": "function css() {\n return (\n gulp\n .src(src.SCSS_FILES)\n .pipe(\n sass({\n outputStyle: \"expanded\",\n })\n )\n .pipe(\n rename({\n suffix: \".min\",\n })\n )\n .pipe(gulp.dest(dist.css))\n // .pipe(\n // notify({\n // message: \"CSS compiled successfully!!\",\n // })\n // )\n .pipe(browsersync.stream())\n );\n}", "title": "" }, { "docid": "7d1f67d410f2e2ad44175e48d6547b8d", "score": "0.73291594", "text": "function css(){\n return src(\"src/scss/app.scss\") // identificar la hoja de estilos\n .pipe(sourcemaps.init())\n .pipe(sass()) // aplicar sass a la hoja de estilos\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(\"./build/css\")) // guardar la hoja compilada en la ruta\n}", "title": "" }, { "docid": "e8007ea32679917d08faac6ea8d62445", "score": "0.7326335", "text": "function compilaSASS() {\n return gulp\n .src([\"src/scss/styles.scss\"])\n .pipe(sass())\n .pipe(gulp.dest(\"src/css\"));\n}", "title": "" }, { "docid": "bfddd41c2ae77203f7ce35c6c6bf0810", "score": "0.73261607", "text": "async function generateCss(){\n gulp.src('./scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(autoprefixer())\n .pipe(gulp.dest('./dist/css/'));\n}", "title": "" }, { "docid": "20b5f08b89231b009b2acb41cb2674f5", "score": "0.7319505", "text": "function compileStyles () {\n vfs.src(path.join(process.cwd(), STYLE_SOURCE))\n .pipe(plumber({ errorHandler: logger.error }))\n .pipe(gulpif(config.env !== 'production', sourcemaps.init()))\n .pipe(sass())\n .pipe(postcss(plugins))\n .pipe(gulpif(config.env !== 'production', sourcemaps.write()))\n .pipe(tap(function (file) {\n compiledStyles = file.contents\n }))\n}", "title": "" }, { "docid": "751424f8fc09adcd7a169cc23f09b432", "score": "0.7291997", "text": "function sass() {\n return gulp.src(global.SLoptions.sass.paths.src, {\n sourcemaps: global.SLoptions.sass.sourcemaps\n })\n .pipe(sassGlob(global.SLoptions.sassGlob))\n .pipe(gSass(global.SLoptions.sass.config)).on('error', gSass.logError)\n .pipe(postcss([\n presetEnv(global.SLoptions.postcss.postcssPresetEnv),\n sortMedia(global.SLoptions.postcss.postcssSortMediaQueries),\n cssnano(global.SLoptions.postcss.cssnano),\n ]))\n .pipe(gulp.dest(global.SLoptions.sass.paths.dest, {\n sourcemaps: global.SLoptions.sass.sourcemaps ? '.' : false\n }))\n .pipe(browserSync.reload({stream: true}));\n}", "title": "" }, { "docid": "b6f06df3d4a6961bd8884c719fd84686", "score": "0.7281863", "text": "function sass () {\n return gulp.src('src/assets/scss/app.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n // Comment in the pipe below to run UnCSS in production\n // .pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.if(PRODUCTION, $.cssnano()))\n .pipe($.if(PRODUCTION, $.rename({\n suffix: `.${pkg.version}`\n })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(`${PATHS.dist}/assets/css/`))\n .pipe(browser.reload({ stream: true }));\n}", "title": "" }, { "docid": "4e0d54e030f44f2fe7c5236865c7b47b", "score": "0.7279502", "text": "function scssTask(d) {\n return src(files.scssPath)\n .pipe(sass())\n .pipe(dest('dist/css'));\n}", "title": "" }, { "docid": "a8e46c22eece94fffcf12f235e2ef8aa", "score": "0.7273311", "text": "function css(){\n\treturn gulp.src('./scss/*.scss')\n\t.pipe(sourcemaps.init())\n\t.pipe(sass({\n\t\toutputStyle: 'expanded',\n\t}))\n\t.pipe(autoprefixer('last 2 versions'))\n\t.on('error', function (err) {\n console.log(err.message + ' on line ' + err.lineNumber + ' in file : ' + err.fileName);\n })\n .pipe(sourcemaps.write('./'))\n\t.pipe(gulp.dest('./css'))\n\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "50bbfbacb81f0f39b09c884edf8bc75e", "score": "0.7267879", "text": "function style() {\n return gulp.src(\"src/sass/*.scss\")\n .pipe(sass({\n includePaths: require('node-normalize-scss').includePaths\n }))\n .pipe(plumber())\n .pipe(sass().on('error', sass.logError))\n .pipe(concat('style.css'))\n .pipe(autoprefixer({\n browsers: ['last 2 versions'],\n cascade: true\n }))\n .pipe(uglifycss())\n .pipe(gulp.dest('dist/css'));\n}", "title": "" }, { "docid": "c7af82e31898df167818e1432dd4ef10", "score": "0.7239249", "text": "function sassBuildTask(){\n return src(files.sassStylePath)\n .pipe(sourcemaps.init())\n .pipe(sass({ outputStyle: 'expanded'})).on('error', sass.logError)\n .pipe(dest(srcFolder + 'assets/css'))\n .pipe(concat(themeFileStyleName + '.css'))\n .pipe(dest(srcFolder + 'assets/css'))\n .pipe(postcss([autoprefixer([\n \"last 2 major version\",\n \">= 1%\",\n \"Chrome >= 45\",\n \"Firefox >= 38\",\n \"Edge >= 12\",\n \"Explorer >= 10\",\n \"iOS >= 9\",\n \"Safari >= 9\",\n \"Android >= 4.4\",\n \"Opera >= 30\"], { cascade: true }), cssnano()]))\n .pipe(rename({suffix: '.min'}))\n .pipe(sourcemaps.write('.'))\n .pipe(dest(distFolder + 'assets/css'));\n}", "title": "" }, { "docid": "872a1357ff88639f99938bb34a0a2ca6", "score": "0.72201604", "text": "function updateSass()\n{\n return src('./src/container.sass')\n .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\n .pipe(dest('app/src'));\n}", "title": "" }, { "docid": "8396801b36608a6b0459bde6df91f8bb", "score": "0.7208231", "text": "function css(cb) {\n src(stylePath.scss_file)\n .pipe(sourcemaps.init())\n .pipe(sass({\n outputStyle: 'compressed'\n })).on('error', sass.logError)\n .pipe(autoprefixer({\n cascade: false\n }))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(sourcemaps.write('./'))\n .pipe(dest(stylePath.css_dist))\n .pipe(browserSync.stream());\n cb();\n}", "title": "" }, { "docid": "07a45feb723f83f52ac0c8b887716005", "score": "0.71956307", "text": "function sass() {\n const postCssPlugins = [\n // Autoprefixer\n autoprefixer()\n\n // UnCSS - Uncomment to remove unused styles in production\n // PRODUCTION && uncss.postcssPlugin(UNCSS_OPTIONS),\n ].filter(Boolean);\n\n return gulp\n .src('src/assets/scss/app.scss')\n .pipe($.sourcemaps.init())\n .pipe(\n sassFunction({\n includePaths: PATHS.sass\n }).on('error', function (err) {\n console.log(err.message + ' on line ' + err.lineNumber + ' in file : ' + err.fileName);\n })\n\n )\n .pipe($.postcss(postCssPlugins))\n .pipe($.if(PRODUCTION, $.cleanCss({ compatibility: 'ie9' })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/css'))\n .pipe(browser.reload({ stream: true }));\n}", "title": "" }, { "docid": "37055b47cf2a761c71df8b6fe9657cdf", "score": "0.7181547", "text": "function compileCSS() {\n return gulp.src([\n `${srcDir}/scss/main.scss`,\n ])\n .pipe(sass())\n .on('error', sass.logError)\n .pipe(cleanCss())\n .pipe(gulp.dest(appDir));\n}", "title": "" }, { "docid": "8466c967079ee8129deb1028643bfe40", "score": "0.71569055", "text": "function sass() {\n\treturn gulp.src(SCSS_MAIN)\n\t\t.pipe(plugin.sass({ includePaths: SCSS_INCLUDE_PATHS }).on('error', plugin.sass.logError))\n\t\t.pipe(plugin.autoPrefixer(AUTOPREFIXER_OPTS))\n\t\t.pipe(plugin.concatCss(SCSS_OUTPUT))\n\t\t.pipe(_if(PRODUCTION, plugin.cleanCss({ compatibility: 'ie9' })))\n\t\t.pipe(gulp.dest(DIST_CSS));\n}", "title": "" }, { "docid": "94e91873f640a2e073a023e01c5807c5", "score": "0.71554106", "text": "function buildsass(){\n return gulp.src(['src/sass/*.scss'])\n .pipe(sass())\n .pipe(gulp.dest('app/'))\n .pipe(gulp.dest('UIMockup/build'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "3a1edac098da6e54329cd68362ba7e65", "score": "0.7146654", "text": "function sass() {\n const lintPlugins = [stylelint()]\n return gulp\n .src(src.sass.file)\n .pipe(plumber({ errorHandler: notify.onError('Error: <%= error %>') }))\n .pipe(\n postcss(lintPlugins, {\n syntax: postcssSyntax,\n })\n )\n .pipe(sassGlob())\n .pipe(\n gulpSass({\n outputStyle: 'expanded', // expanded or compressed\n includePaths: [src.sass.dir],\n }).on('error', gulpSass.logError)\n )\n .pipe(postcss([cmq(), autoprefixer()]))\n .pipe(gulp.dest(dest))\n .pipe(browserSync.reload({ stream: true }))\n}", "title": "" }, { "docid": "a9e4b8cf4f89f4b6480e438f9b01691d", "score": "0.7132615", "text": "function gulpSass() {\n return gulp\n .src([\"src/css/*.css\"])\n .pipe(sass())\n .pipe(gulp.dest([\"src/css\"]))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "d386f6a793a4ce1c186eae3255fc9020", "score": "0.7132264", "text": "function css() {\n return gulp.src('app/assets/scss/style.scss')\n .pipe(maps.init())\n .pipe(sass())\n .pipe(maps.write('./'))\n .pipe(gulp.dest('app/assets/css'))\n .pipe(server.stream());\n}", "title": "" }, { "docid": "90c6f214d0d9d006b0b44cf39ea7dfd1", "score": "0.7128272", "text": "function style() {\n // Find SASS file\n return gulp.src('./scss/**/*.scss')\n // Compile SASS\n // .pipe(sourcemaps.init())\n .pipe(sass())\n // .pipe(sourcemaps.write('./css'))\n // Save compiled SASS\n .pipe(gulp.dest('./css'))\n // Stream changes to browser\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "781343237d5bfb0c8fe72c7ef4d4a170", "score": "0.7125731", "text": "function css() {\n return gulp\n .src(['src/css/*.s@(a|c)ss'])\n .pipe(\n plugins.plumber({\n errorHandler: isProduction\n ? false\n : function error() {\n this.emit('end');\n }\n })\n )\n .pipe(plugins.sourcemaps.init())\n .pipe(\n plugins\n .sass({\n importer: sassModuleImporter(),\n outputStyle: 'compressed'\n })\n .on('error', error => {\n errorMessage({ title: 'CSS Compilation Error', error, short: true });\n })\n )\n .pipe(plugins.postcss([autoprefixer({ browsers: ['last 4 versions'] })]))\n .pipe(\n plugins.tap(file => {\n log(\n colors.magenta('Minified and complied CSS to'),\n colors.bold(dest + file.relative),\n `(${helpers.formatBytes(file.stat.size, 2)})`\n );\n })\n )\n .pipe(plugins.sourcemaps.write('.'))\n .pipe(\n plugins.tap(file => {\n if (path.extname(file.path) === '.map') {\n log(\n colors.magenta('Compiled CSS sourcemap to'),\n colors.bold(dest + file.relative)\n );\n }\n })\n )\n .pipe(gulp.dest(`${dest}css`));\n}", "title": "" }, { "docid": "36462daac44aa404b1685e4edd62f5b3", "score": "0.7124565", "text": "function style() {\n return gulp\n .src('./src/scss/**/*.scss')\n .pipe(sass())\n .pipe(gulp.dest('./src/css'));\n}", "title": "" }, { "docid": "eb7fb38810050702837ada2e0d0fdada", "score": "0.7105177", "text": "async compileScss (basename) {\n const pathname = basename + '.scss';\n const exists = await fse.pathExists (pathname);\n\n if (!exists)\n return null;\n\n return new Promise ((resolve, reject) => {\n gulp.src (pathname)\n .pipe (sass ({\n includePaths: [`${process.cwd ()}/node_modules`],\n quiet: true\n }).on ('error', reject))\n .pipe (gulp.dest (path.dirname (pathname)))\n .on ('end', resolve);\n });\n }", "title": "" }, { "docid": "409bbd75ae36c4ed0b021af1170b7668", "score": "0.70943266", "text": "function _stylesscss (done) {\n gulp.src(paths.stylesscss.src)\n .pipe(sass()) // Déclenchement du préprocesseur SASS\n .pipe(autoprefixer([ // Mise en place de l'auto-préfixage (ex. transition-duration: 0.1s; -webkit-transition-duration: 0.1s; -o-transition-duration: 0.1s; )\n 'Android 2.3',\n 'Android >= 4',\n 'Chrome >= 20',\n 'Firefox >= 24', \n 'Explorer >= 8',\n 'iOS >= 6',\n 'Opera >= 12',\n 'Safari >= 6'\n ]))\n .pipe(cssbeautify({ indent: ' ' })) // Arrangement du fichier résultat, tabulation, ordre des déclarations, ...\n .pipe(rename(function(path){ path.basename = 'scss_' + path.basename; })) // Changement du nom fichier de sortie (ex. test.scss --> scss_test.css)\n .pipe(gulp.dest(paths.stylesscss.dest)); // Génération du fichier de sortie\n done();\n}", "title": "" }, { "docid": "09b24d1f2219997868ab1a9aec20cb71", "score": "0.70768344", "text": "function sass() {\n return libSass({\n 'outputStyle': 'expanded'\n });\n}", "title": "" }, { "docid": "dc6f021469c76d83ea72d9790c1835e0", "score": "0.7075259", "text": "function cssTask(cb) {\n\treturn src(\"./themes/shared/default/scss/main.scss\") // read .css files from ./src/ folder\n\t\t.pipe(sourcemaps.init({ loadMaps: true }))\n\t\t.pipe(sass()) // compile using postcss\n\n\t\t.pipe(sourcemaps.write('./map'))\n\t\t.pipe(dest(\"./themes/shared/default/css\")) // paste them in ./assets/css folder\n\t\t.pipe(browserSync.stream());\n\tcb();\n}", "title": "" }, { "docid": "d1e07d96d32c128497a8de293d95ab14", "score": "0.7072601", "text": "function style () {\n\n //1. where is my scss file\n return gulp.src('scss/**/*.scss')\n\n\t\t\t//2. pass that file through sass compiler\n\t\t\t.pipe(sass())\n\n\t\t\t//3. where do i save the compiled css\n\t\t\t.pipe(gulp.dest('css'))\n\t\t\t\n\t\t\t//4. stream changes to all in browser\n\t\t\t.pipe(browserSync.stream());\n\n\t\t}", "title": "" }, { "docid": "f1c7f4d32b1de2467faaecc895900950", "score": "0.7066011", "text": "function scss() {\n let plugins = [autoprefixer(), cssnano()];\n return src('src/scss/style.scss')\n .pipe(sass.sync().on('error', sass.logError))\n .pipe(postcss(plugins))\n .pipe(rename('style.min.css'))\n .pipe(dest('src/css'));\n}", "title": "" }, { "docid": "8b6c2e11a1708da080b810a43371b0c8", "score": "0.7044755", "text": "function style() {\n //find my css file\n return (\n gulp\n .src(\"./src/scss/**/*.scss\")\n\n //pass that file to sass compiler\n .pipe(sass().on(\"error\", sass.logError))\n\n //save compiled css\n .pipe(gulp.dest(\"./dist/assets/css/\"))\n\n //stream changes to all browser\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "ad61c4db78f7323b628d2ae019a345ea", "score": "0.7043956", "text": "function sassTask() {\n return src(settings.sass.src)\n .pipe(sourcemaps.init())\n .pipe(plumber({\n errorHandler: onError,\n }))\n .pipe(sass({\n outputStyle: settings.sass.outputStyle,\n includePaths: settings.sass.includePaths,\n }))\n .pipe(autoprefixer())\n .pipe(sourcemaps.write('./sass-maps'))\n .pipe(dest(settings.sass.dest))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "4b738cb113d4723175002521beb8285c", "score": "0.7035381", "text": "function sassDevTask(){\n return src(files.sassStylePath)\n .pipe(sass({ outputStyle: 'expanded'})).on('error', sass.logError)\n .pipe(dest(srcFolder + 'assets/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "0b9f89ee2ae9f1107f33fe3bad215733", "score": "0.7018156", "text": "function runSass() {\n\treturn gulp.src('./sass/**/*.scss')\n\t\t.pipe(sassGlob())\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t.pipe(autoprefixer())\n\t\t.pipe(cleanCSS())\n\t\t.pipe(gulp.dest('./assets/styles'));\n}", "title": "" }, { "docid": "fa2337ed1611f05b25ac551c7d9c3c8c", "score": "0.7010031", "text": "function compile_scss(file)\n{\n return new Promise((resolve, reject)=>{\n sass.render({file: file}, (err, result)=>{\n if(err)\n {\n reject(err);\n return;\n }\n resolve(result.css.toString());\n })\n });\n}", "title": "" }, { "docid": "3370b6ac5e014bbbeb6dd327a54acb3e", "score": "0.6998442", "text": "function scss() {\n //Location of main and other scss files\n return gulp.src([paths.src + \"**/*.scss\", paths.src.scss + \"style.scss\"])\n .pipe(sourcemaps.init({ loadMaps: true }))\n //Pass scss file to sass compiler and show sass error\n .pipe(sass().on('error', sass.logError))\n //Autoprefix the css\n .pipe(autoprefixer('last 2 versions'))\n .pipe(sourcemaps.write('.'))\n //Location of compiled css\n .pipe(gulp.dest([paths.dist.css]))\n //Making sure it sync on any changes\n .pipe(browserSync.reload({stream: true}));\n}", "title": "" }, { "docid": "53874cb9591ba79dc8326cfbc7ed7142", "score": "0.69929916", "text": "async function convertCss(){\n\tgulp.src( url.source+'scss/**/*.scss' ) //만드는 현재 scss폴더에서\n\t .pipe( scss(scssOption).on('error', scss.logError) ) //사스옵션을 수행하고 에러나면 알려줘라\n\t .pipe( gulp.dest(url.source+'css/') ) // 완성된 것을 css폴더에다가 넣어라\n\t .pipe( browserSync.reload({stream:true}) ) //원래있던 갑에서 수정한값만 변경\n}", "title": "" }, { "docid": "532fa2e0bda192758f54c89f24a98031", "score": "0.6984671", "text": "function compilarSASS(){\n return src(\"./src/scss/app.scss\")\n .pipe( sass({\n outputStyle: 'expanded'\n }) )\n .pipe( dest(\"./build/css\"))\n}", "title": "" }, { "docid": "f866abfc7f05b4e5d00c7dd10600ffbb", "score": "0.69786495", "text": "async function compileSass(file, config) {\n const { theme = '#3943b7' } = config\n const data = `$primary: ${theme}\\n` + (await readFile(file, 'utf8'))\n\n const options = {\n data,\n indentedSyntax: true,\n includePaths: [resolvePath('../node_modules')],\n }\n\n return new Promise((resolve, reject) => {\n Sass.render(options, (err, result) => {\n if (err) reject(err)\n else resolve([String(result.css), result.stats.duration])\n })\n })\n}", "title": "" }, { "docid": "f4b19356402d567e3c8dda593b748752", "score": "0.69780505", "text": "function styleSass() {\n // Defined plugins to be used in postcss\n var plugins = [\n autoprefixer(),\n ];\n // If we run build task then add 'cssnano()' to plugins\n if (env === 'production') {\n plugins.push(cssnano());\n }\n // Where should gulp look for the sass files?\n // My .scss files are stored in the styles folder\n // (If you want to use sass files, simply look for *.sass files instead)\n return (\n gulp.src(paths.styles.scss)\n // Initialize sourcemaps\n .pipe(gulpif(env === 'development', sourcemaps.init()))\n // Use sass with the files found, and log any errors\n .pipe(sass().on('error', sass.logError))\n .pipe(postcss(plugins))\n /* By default, gulp - sourcemaps writes the source maps inline in the compiled CSS files.\\\n To write them to a separate file, specify a path relative to the gulp.dest() destination\n in the sourcemaps.write() function. */\n .pipe(gulpif(env === 'development', sourcemaps.write('./')))\n // What is the destination for the compiled file\n .pipe(gulp.dest(outputDir + 'css'))\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "cc530895a22a0f00a3857c610335b978", "score": "0.69778216", "text": "function processSASS () {\n\n\tvar autoprefixerOptions = {\n\t \tbrowsers: ['last 2 versions', '> 5%', 'Firefox ESR']\n\t};\n\n\treturn gulp.src(SOURCE_PATH + '/scss/main.scss')\n\t\t.pipe(sourcemaps.init())\n .pipe(sass().on('error', sass.logError))\n .pipe(sourcemaps.write())\n \t.pipe(autoprefixer(autoprefixerOptions))\n .pipe(gulp.dest(BUILD_PATH + '/css'))\n}", "title": "" }, { "docid": "3f5e204dbbf28fdce505eec23322a083", "score": "0.69734764", "text": "function sassTask() {\n return src(path.scss.src)\n .pipe(cond(!PROD, sourcemaps.init({ loadMaps: true })))\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(cleanCSS())\n .pipe(cond(PROD, postcss([autoprefixer(), cssnano()])))\n .pipe(cond(!PROD, sourcemaps.write(\".\")))\n .pipe(dest(path.scss.dest));\n}", "title": "" }, { "docid": "368dddaded935a4b72c693fda53bfa48", "score": "0.6910775", "text": "function css() {\n var plugins = [autoprefixer()];\n return gulp\n .src([\"./sass/main.scss\"])\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss(plugins))\n .pipe(minifyCSS())\n .pipe(sourcemaps.write(\"../maps\"))\n .pipe(gulp.dest(\"./dist/css\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "0a4b2893c313c02d37aaef38dc0b0a84", "score": "0.6908612", "text": "function uiSass() {\n return gulp.src('src/assets/scss/app.scss')\n .pipe($.sass({\n includePaths: ['bower_components/foundation-sites/scss']\n }).on('error', $.sass.logError))\n .pipe(gulp.dest('dist/css'));\n}", "title": "" }, { "docid": "d09df932cc2cd52f078752378e50209a", "score": "0.690686", "text": "function style() {\n // Onde está o arquivo sass\n return gulp.src('./scss/**/*.scss') // passa esse arquivo para o compilador sass\n .pipe(sass()) // Onde salvou o arquivo css compilado\n .pipe(gulp.dest('./css')) // aciona mudanças para todos os browsers\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "c28c2085dba71d547cd6f40ccdc95d55", "score": "0.6905457", "text": "function compileCss(done) {\n gulp.src(config.css.source)\n .pipe(sassGlob())\n .pipe(gulpif(config.css.sourceMapEmbed, sourcemaps.init({})))\n .pipe(sass({\n outputStyle: config.css.outputStyle,\n sourceComments: config.css.sourceComments,\n includePaths: config.css.includePaths,\n }).on('error', sass.logError))\n .pipe(postcss(\n [\n autoprefixer({\n browsers: config.css.autoPrefixerBrowsers,\n }),\n ]\n ))\n .pipe(gulpif(config.css.sourceMapEmbed, sourcemaps.write((config.css.sourceMapEmbed) ? null : './')))\n .pipe(gulpif(config.css.flattenOutput, flatten()))\n .pipe(gulp.dest(config.css.dest))\n .on('end', () => {\n done();\n });\n }", "title": "" }, { "docid": "3bb97cdb54b972a8dc023d3b6fa52e94", "score": "0.6904142", "text": "function style() {\n // direct to scss file\n return gulp.src('./source/assets/scss/*.scss')\n //pass through sass compiler\n .pipe(sass().on('error', sass.logError))\n // save the compiled CSS\n .pipe(gulp.dest('./source/assets/css'))\n\n //stream changes to all browser\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "1885825ca4224f576c39b5f1e2b8bf4a", "score": "0.6899035", "text": "function serveSass() {\n return src(\"./sass/**/*.sass\", \"./sass/**/*.scss\")\n .pipe(sass())\n .pipe(dest(\"./css\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "5194db74fa5c397a61583cb2d684d006", "score": "0.6892448", "text": "function scssTask() {\n return (\n src([srcFiles.mainScssPath, srcFiles.scssPagesPath])\n .pipe(gulpif(!production, sourcemaps.init()))\n .pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError)) // compile SCSS to CSS\n .pipe(postcss([autoprefixer()]))\n .pipe(gulpif(production, rename({ extname: '.min.css' })))\n .pipe(gulpif(!production, sourcemaps.write('./')))\n .pipe(dest(distFiles.distCSSPath)) // put final CSS in dist folder\n // stream changes to all browsers sync all browser\n // inject changes without refreshing the page\n // This command is useful because it keeps the scroll position intact\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "1761381e595d037ce70b5631fb2bee56", "score": "0.68790126", "text": "function taskScss () {\n return gulp.src('app/styles/scss/*.scss')\n //prevent pipe breaking caused by errors from gulp plugins\n .pipe(plumber({\n errorHandler: function (err) {\n console.log('error', err);\n this.emit('end');\n }\n }))\n //get sourceMaps ready\n .pipe(sourceMaps.init())\n //include SCSS and list every \"include\" folder\n .pipe(sass({\n errLogToConsole: true,\n includePaths: [\n 'app/styles/scss/'\n ],\n// outputStyle: 'compressed'\n }))\n .pipe(autoprefixer({\n browsers: autoPrefixBrowserList,\n cascade: true\n }))\n // .pipe(stripCssComments(true))\n //catch errors\n .on('error', gutil.log)\n //the final filename of our combined css file\n // .pipe(concat('styles.css'))\n //get our sources via sourceMaps\n .pipe(sourceMaps.write())\n //where to save our final, compressed css file\n .pipe(gulp.dest('app/styles/'))\n //notify browserSync to refresh\n .pipe(browserSync.reload({stream: true}));\n}", "title": "" }, { "docid": "5a01c87214511c28bb586f83960d877a", "score": "0.68788594", "text": "function sassy() {\n\treturn gulp\n\t\t.src(mainSassFile)\n\t\t.pipe(sourcemaps.init())\n\t\t.pipe(sass().on('error', sass.logError)) //Using gulp-sass\n\t\t.pipe(sourcemaps.write(sourceMaps))\n\t\t.pipe(gulp.dest(cssFiles))\n}", "title": "" }, { "docid": "5016edde146e18bc190cb25a63298519", "score": "0.6872243", "text": "function styles() {\n // 1. where is my scss file\n return gulp.src(paths.app.scss)\n // 2. pass that file through sass compiler\n .pipe(sass({ \n outputStyle: 'expanded',\n includePaths: [path.join(__dirname, '/node_modules')]\n }).on('error', notify.onError()))\n // 3. rename output file\n .pipe(rename({\n prefix: '',\n basename: 'bundle',\n suffix: '.min'\n }))\n // 4. add vendor prefixes\n .pipe(autoprefixer(['last 15 versions']))\n // 5. minify css\n .pipe(cleancss( {level: { 1: { specialComments: 0 } } })) // Opt., comment out when debugging\n // 6. where do I save the compiled CSS?\n .pipe(gulp.dest(paths.dist.scss))\n // 7. stream changes to all browsers\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "5bea1fad7352104e0c1ec020fa99192e", "score": "0.6864715", "text": "function styles() {\n return gulp.src(PATH.scss.src)\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: 'compressed'}))\n .on('error', notify.onError(function(error) { return { title: 'Sass', message: error.message}}))\n .pipe(sourcemaps.write())\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest(PATH.scss.build))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "879facbccaca862fcb622598ede33294", "score": "0.6859748", "text": "function sass() {\n return gulp.src('src/assets/scss/email.scss')\n .pipe($.if(!PRODUCTION, $.sourcemaps.init()))\n .pipe($.sass({\n includePaths: ['node_modules/foundation-emails/scss']\n }).on('error', $.sass.logError))\n .pipe($.if(PRODUCTION, $.uncss(\n {\n html: ['dist/**/*.html', '!dist/index.html']\n })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('dist/css'));\n}", "title": "" }, { "docid": "2c747e65d3d556f7931054e7ac9e14d4", "score": "0.6857386", "text": "function style() {\n // Find ANH scss file in scss folder\n return (\n gulp\n .src(\"./public/sass/**/*.scss\")\n\n // Pass that file through sass compiler\n .pipe(sass())\n\n // Where compiled css to be saved\n .pipe(gulp.dest(\"./public/css\"))\n\n // stream changes to all browser\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "18cfff8022ac084ee7358044e13a46db", "score": "0.6856018", "text": "function build() {\n // where is the scss file\n return gulp.src('./scss/**/*.scss')\n // pass that file through sass compiler\n .pipe(sass().on('error', sass.logError))\n // where is the compiled css saved?\n .pipe(gulp.dest('./css'))\n // stream changes to all browser\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "f975ec2e8683ed51623e1af8989c31c5", "score": "0.6855951", "text": "function compileSass(path, ext, file, callback, onSuccess) {\n node_sass_1.render({\n file: path,\n outputStyle: 'compressed',\n importer: importer\n }, (error, result) => {\n if (error) {\n logger_1.Logger.error(error.formatted);\n callback(error);\n }\n else {\n onSuccess(result.css, callback);\n }\n });\n}", "title": "" }, { "docid": "5ba90f3cc81fc6d23646b4124aab774e", "score": "0.68473715", "text": "function css() {\n\treturn gulp.src(app + 'css/style.scss')\n\t\t.pipe(plumber(function (error) {\n\t\t\tgutil.log(gutil.colors.red(error.message));\n\t\t\tnotify().write(error);\n\t\t\tthis.emit('end');\n\t\t}))\n\t\t.pipe(sass({\n\t\t\terrLogToConsole: false,\n\t\t\tonError: function (err) {\n\t\t\t\treturn notify().write(err);\n\t\t\t}\n\t\t}))\n\t\t.pipe(postcss([\n\t\t\tautoprefixer(),\n\t\t\tnano(),\n\t\t]))\n\t\t.pipe(rename(\"mod_tristans_responsive_slider.min.css\"))\n\t\t.pipe(gulp.dest(dist))\n}", "title": "" }, { "docid": "ab90e2cdd190ce3d45e212b10e3275ba", "score": "0.68463033", "text": "function style(done){\n\treturn src('src/assets/css/*.scss')\n\t.pipe(sass())\n\t.pipe(uglifycss())\n\t.pipe(dest('dist/assets/css/'));\n\tdone();\n}", "title": "" }, { "docid": "db5889253621cba93e6596e572ac3ee5", "score": "0.6836028", "text": "function sassy() {\n return gulp.src('./src/css/scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(postcss([autoprefixer('last 4 versions')]))\n .pipe(gulp.dest('./src/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "9ee7fa50921d2c0190e30cebc3e5e20d", "score": "0.6833921", "text": "async compile(config) {\n return new Promise((resolve, reject) => {\n if (!isProd) {\n config.sourceMap = true\n config.sourceMapEmbed = true\n config.outputStyle = 'expanded'\n }\n return sass.render(config, (err, result) => {\n if (err) {\n return reject(err)\n }\n resolve(result.css.toString())\n })\n })\n }", "title": "" }, { "docid": "e000d0444a6c7a8bc65695993a6977a8", "score": "0.68277955", "text": "function style() {\n // 1. SOURCE SCSS\n return gulp.src( scss )\n // 2. SOURCEMAPS ON\n .pipe( sourcemaps.init() )\n // 3. SASS\n .pipe( sass( {outputStyle: 'compressed'} )\n .on( 'error', sass.logError ) )\n // 4. AUTOPREFIXER\n .pipe( autoprefixer( {cascade: false} ) )\n // 5. RENAME\n .pipe( rename( 'ebay.min.css' ) )\n // 6. SOURCEMAPS\n .pipe( sourcemaps.write( '.' ))\n // 7. DESTINATION\n .pipe( gulp.dest( css ) )\n // 8. STREAM TO BROWSER\n // .pipe( browsersync.stream() );\n}", "title": "" }, { "docid": "b6b5388c8f75f6ff3bd297c15da29f30", "score": "0.6821192", "text": "function style() {\n return gulp.src('./scss/dizajni.scss')\n .pipe(sourcemaps.init())\n .pipe(sassGlob())\n .pipe(sass({\n noCache: true,\n outputStyle: \"expanded\",\n lineNumbers: false,\n loadPath: './css/*',\n sourceMap: true\n }))\n .on('error', sass.logError)\n .pipe(sourcemaps.write('./maps'))\n .pipe(gulp.dest('./css/'))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "0df7e39cd4189874ff2c71a642a82560", "score": "0.6816619", "text": "function compile(css) {\n return stylus(css).render();\n}", "title": "" }, { "docid": "0a105c11749a357fbd870868a3d8778c", "score": "0.6813077", "text": "function watchCss() {\n gulp.watch(global.SLoptions.sass.paths.src, gulp.series(sass, lintSass));\n}", "title": "" } ]
db17ebc9c8383974f205629834986187
Shows the gameover screen after the user has answered all the questions.
[ { "docid": "73fa5f51e76b3e33a56c064d44ccea77", "score": "0.0", "text": "function showEndScreen() {\n clearInterval(countDown);\n $(\"#game-area\").hide()\n $(\"#end-row\").show();\n\n $(\"#corrects\").text(\"Correct Answers: \" + correctAnswers);\n $(\"#incorrects\").text(\"Incorrect Answers: \" + incorrectAnswers);\n $(\"#unanswereds\").text(\"Unanswered: \" + unanswered);\n}", "title": "" } ]
[ { "docid": "795483b4579b5f6ab4928ff807cd5145", "score": "0.8", "text": "function gameOver() {\n if (Object.keys(questions).length === 0) {\n questionTimer.stopTimer();\n $('.game').hide();\n $('.results').show();\n $('.correct').html('Number Correct: ' + correct);\n $('.wrong').html('Number Incorrect: ' + wrong);\n activeQuestion = false;\n };\n }", "title": "" }, { "docid": "a340a8b880ebb73b4b43d3515f43033b", "score": "0.7857453", "text": "function gameOver (){\n\t$(\"#over\").show();\n\t$(\"#q-and-a\").hide();\n\t$(\"#post-question\").hide();\n\t$(\"#correct\").text(\"Correct answers: \" + correctAnswers);\n\t$(\"#incorrect\").text(\"Incorrect answers: \" + incorrectAnswers);\n\t$(\"#unanswered\").text(\"Unanswered questions: \" + unanswered);\n}", "title": "" }, { "docid": "40bcba3176738706c6933789b464d346", "score": "0.7603457", "text": "function gameOver() {\n summary.style.display = \"block\";\n questionDiv.style.display = \"none\";\n startDiv.style.display = \"none\";\n timer.style.display = \"none\";\n timesUp.style.display = \"block\";\n\n // show final score\n finalScore.textContent = correctAns;\n}", "title": "" }, { "docid": "358ac7b4390464f86636c34556f6ad53", "score": "0.7463861", "text": "function gameOver() {\n clearInterval(interval)\n questionsEl.style.display = \"none\";\n gameOverEl.style.display = \"block\";\n userScore.textContent = `Your score is: ${score} out of ${questionsArray.length}`;\n}", "title": "" }, { "docid": "6aad2c77d2fb491ccd7a0d6212518a6d", "score": "0.7429474", "text": "function gameOver() {\n resultsEl.style.display = \"block\";\n quizSection.style.display = \"none\";\n loadingPage.style.display = \"none\";\n timeLeft.style.display = \"none\";\n\n // show final score\n finalScore.textContent = correctAns;\n\n if (totalTime <= 0) {\n completedText.textContent = \"Times up!\";\n \n } else {\n completedText.textContent = \"You've completed the quiz!\";\n }\n}", "title": "" }, { "docid": "1a7eccd7ad7246b673bf361680423800", "score": "0.7375862", "text": "function gameOver() {\n summary.style.display = \"block\";\n questionDiv.style.display = \"none\";\n startDiv.style.display = \"none\";\n timer.style.display = \"none\"\n timesUp.style.display = \"block\";\n\n //show final score\n finalScore.textContent = correctAnswer;\n}", "title": "" }, { "docid": "068a306d77e69917977f1df6020031d2", "score": "0.7326223", "text": "function roundOverView() {\n\n\t// call reset Question Items ??\n\tresetQuestionItems();\n\t\n\t// show stats view to user\n\tmsgView.text(userMessages.gameOverMsg);\n\tnewQuestionDiv.text(\"Out of \" + totalQuestionsAsked + \" questions.\");\n\tnewAnswerDiv.text(\"You got \" + totalCorrect + \" correct. That is \" + (totalCorrect/totalQuestionsAsked)*100 + \"% right.\");\n\tnewAnswerDiv.append(\"<br>You got \" + totalIncorrect + \" wrong. That is \" + (totalIncorrect/totalQuestionsAsked)*100 + \"% wrong.\");\n\n\t// reset totalQuestions & other global counters\n\ttotalIncorrect = 0;\n\ttotalCorrect = 0;\n\ttotalQuestionsAsked = 0;\n\n\t// show start button to replay ... might add this later for future rounds to be played\n\t// $(\"#start-btn\").css(\"visibility\",\"visible\");\n}", "title": "" }, { "docid": "dc5c8ef921f051c43f7a70f380934806", "score": "0.72631043", "text": "function gameOver() {\n if (currentQuestion == totQuestions || secondsLeft <= 1) {\n container.style.display = \"none\";\n resultCont.style.display = \"\";\n resultCont.textContent = \"Final Score:\" + score;\n inputName.style.display = \"\";\n timeEl.style.display = \"none\";\n subBut.style.display = \"\";\n scoreCon.style.display = \"\";\n hof.style.display = \"\";\n resBut.style.display = \"\";\n return;\n } else {\n loadQuestion(currentQuestion);\n }\n}", "title": "" }, { "docid": "9136982e4911d2b064ae120ef42f1c66", "score": "0.72587097", "text": "function isGameOver() {\n \t// If five questions have been displayed, end game\n \tif (questionCounter >= 5) {\n \t\tnextQuestion.style.display = \"none\";\t// Hide next question button\n\n \t\t// Wait 5 seconds, then display game over message\n \t\tsetTimeout(function() {\n \t\t\tquestionContainer.style.display = \"none\";\t\t// Hide question container\n\n\t \t\t// Display game over message and final score\n\t \t\tresultContainers[0].innerText = \"Game Over!\";\n\t \t\tresultContainers[1].innerText = `Your final score is ${score}`;\n\t \t\tresultContainers[2].innerText = \"\";\n \t\t}, 5000);\n \t}\n }", "title": "" }, { "docid": "91db37d55271da648aa586d8a9e84756", "score": "0.71900177", "text": "function gameOver() {\n emptyDisplay();\n $('.display').html(`<h3>Score</h3>`);\n $('.question-area').html(`<h3>Correct guesses: ${wins}</h3> <h3>Wrong guesses: ${losses}</h3>`);\n startButton();\n}", "title": "" }, { "docid": "65d6363f2c250b012dd1da920b9e2b5e", "score": "0.714114", "text": "function goGameOver(outcome) {\n\n // restore default page layout \n createPageLayout();\n if(correctAnswers === 10){$(\"#content\").html(\"<div><h1>You win!</h1></div>\")}\n else{$(\"#content\").html(\"<div><h1>Game Over</h1></div>\")}\n $(\"#content\").append(\"<div><h5>You answered \" + correctAnswers + \" of \" + gameData.length + \" questions correctly.</h5></div>\")\n \n if(correctAnswers < 4){$(\"#content\").append(\"<div><h5>Level: Novice</h5></div>\")}\n else if(correctAnswers < 8){$(\"#content\").append(\"<div><h5>Level: Average</h5></div>\")}\n else if(correctAnswers < 10){$(\"#content\").append(\"<div><h5>Level: Advanced</h5></div>\")}\n else {$(\"#content\").append(\"<div><h5>Level: Expert</h5></div>\")}\n \n correctAnswers = 0;\n answerChoices = [];\n\n // populate the play again button and dropdown for choices\n createPlayButton(\"Play Again\");\n createDropdown()\n }", "title": "" }, { "docid": "6f81282cf09f472dd13c748e584ac0ac", "score": "0.71311796", "text": "gameOver () {\n this.clearQuestionDiv()\n this.saveHighscore()\n this.highscore.displayHighscore()\n this.timer.stopTimer()\n this.playAgain()\n }", "title": "" }, { "docid": "a150bc8d7fcb7fb9149f07d90a2d37b3", "score": "0.7108461", "text": "function isGameOver() {\n questionIndex++;\n console.log(\"Question number \" + questionIndex + \" out of 10.\");\n if (questionIndex === triviaQuestions.length) {\n gameIsOver === true;\n console.log(\"GAME OVER\");\n\n //Displays Game Over Screen\n $(\".time-div\").hide();\n $(\".answer-div\").hide();\n $(\".hide-button\").show();\n $(\".start-button\").text(\"Start Over?\");\n $(\".question-div\").html(\n \"<h1 class='text-danger'>GAME OVER</h1>\" +\n \"<p>\" +\n \"Correct Answers: \" + correctTracker +\n \"<br>\" +\n \"Incorrect Answers: \" + incorrectTracker +\n \"<br>\" +\n \"Unanswered: \" + unansweredTracker +\n \"</p>\"\n );\n }\n\n //Displays next question if game is not over\n else {\n gameIsOver === false;\n addQuestion();\n addAnswers();\n timer();\n };\n }", "title": "" }, { "docid": "d2bfe972cbdffd29004aa0275c03f450", "score": "0.70268077", "text": "function gameOver() {\n\t\t$(\".message-content\").remove();\n\t\tvar totalCorrect = $(\"<h3>\")\n\t\tvar totalIncorrect = $(\"<h3>\")\n\t\tvar totalNone = $(\"<h3>\")\n\t\tvar restart = $(\"<button>\")\n\t\ttotalCorrect.appendTo($(\"#content\"))\n\t\ttotalCorrect.html(\"<span class='rightText'>You got \" + correct + \" correct!</span>\")\n\t\ttotalIncorrect.appendTo(\"#content\")\n\t\ttotalIncorrect.html(\"<span class='wrongText'>You got \" + wrong + \" wrong.</span>\")\n\t\ttotalNone.appendTo(\"#content\")\n\n\t\t// Determines if question or questions should be used\n\t\tif (none === 1) {\n\t\t\ttotalNone.html(\"<span class='timedText'>You didn't answer \" + none + \" question.</span>\")\n\t\t}\n\t\tif (none > 1 || none === 0) {\n\t\t\ttotalNone.html(\"<span class='timedText'>You didn't answer \" + none + \" questions.</span>\")\n\t\t}\n\n\n\t\t// Restart button\n\t\trestart.addClass(\"restart\")\n\t\trestart.text(\"Restart\")\n\t\trestart.appendTo($(\"#content\"))\n\n\t\t//Reset button onclick function\n\t\t$(\".restart\").on(\"click\", function () {\n\t\t\ttotalCorrect.remove();\n\t\t\ttotalIncorrect.remove();\n\t\t\ttotalNone.remove();\n\t\t\trestart.remove();\n\t\t\tcurrentQuestion = 0;\n\t\t\tcorrect = 0;\n\t\t\twrong = 0;\n\t\t\tnone = 0;\n\t\t\tdisplayQuestion();\n\t\t})\n\n\t}", "title": "" }, { "docid": "8770d3a8d6085ce8701417f3c2099364", "score": "0.70159024", "text": "function gameOver() {\n $(\"#over\").show();\n $(\".result\").html(score);\n $(\"#lives\").css('visibility', 'hidden');\n $(\"#questions\").css('visibility', 'visible');\n $(\"#time\").hide();\n $(\"#score\").hide();\n $(\"#startReset\").html(\"Start Over\");\n stopCounting();\n stopImages(\"#fruit1\");\n stopImages(\"#fruit2\");\n stopImages(\"#fruit3\");\n stopImages(\"#fruit4\");\n}", "title": "" }, { "docid": "3d1273922bdd29f73aee061bd46cb51c", "score": "0.69798654", "text": "function endGame() {\n if (Object.keys(questions).length === 0) {\n $('#game').hide();\n $('#results').show();\n $(\"#right\").html(\"Rounds won: \" + right);\n $(\"#wrong\").html(\"Rounds Lost: \" + wrong);\n\n }\n }", "title": "" }, { "docid": "a5acc2ca135d5d2bda16373372095083", "score": "0.69638413", "text": "function gameover(){\n if(timerCount == 0){\n quizEl.style.display = \"none\";\n highscore.style.display= \"flex\";\n btnBack.style.display = \"block\";\n intialSection.style.display = \"flex\";\n }\n}", "title": "" }, { "docid": "035af8fba3793de36e63ffe3b64160f8", "score": "0.69437987", "text": "function displayQuestions() {\n //To highscore screen\n if (index >= question.length) {\n toggleDisplay(\".enter-hs-screen\");\n\n if (timer.textContent <= 0) {\n timer.textContent = 0;\n score = 0;\n } else {\n score = timer.textContent;\n }\n clearInterval(interval);\n\n return;\n }\n //Display of next questions\n else {\n questionPrompt.textContent = question[index];\n //Random questions from array\n var mixedAnswers = answers[index].slice();\n mixedAnswers = randArray(mixedAnswers);\n\n for (var i = 0; i < 4; i++) {\n answerbtnsEl.children[i].children[0].textContent = mixedAnswers[i];\n }\n }\n index++;\n}", "title": "" }, { "docid": "fc78a8bc2f3018bdde54519a07972d3e", "score": "0.68751556", "text": "function gameOverAction() {\n\n // Prevent user interaction\n self.pauseView();\n\n // Show Modal GAME OVER\n self.renderModalGameOver();\n\n // Play FAIL Audio\n self.playGameOverAudio();\n }", "title": "" }, { "docid": "ade1e02c68ae28fb604c2f6462b943b3", "score": "0.68679684", "text": "function gameOver() {\n \n $(\"#countdown\").empty();\n $(\"#question\").empty();\n $(\"#answers\").empty();\n $(\"#correct-incorrect\").empty();\n $(\"#right-wrong-gif\").empty();\n $(\"#times-up\").empty();\n $(\"#times-up-gif\").empty();\n $(\"#game-over\").append(\"<p>Game Over</p>\");\n $(\"#game-over\").append(\"<p>Correct Answers: \" + guessedRight + \"</p>\");\n $(\"#game-over\").append(\"<p>Incorrect Answers: \" + guessedWrong + \"</p>\");\n $(\"#game-over\").append(\"<p>Unanswered: \" + didNotAnswer + \"</p>\");\n\n //Does the user wanna play again?\n $(\"#new-game\").html(\"<button id>Reset</button>\")\n }", "title": "" }, { "docid": "9050dda44a88010e9c45fbc65697bab8", "score": "0.6859292", "text": "function endGame() {\n if (questionsAttempted < totalQuestions) {\n console.log(\"game is over\");\n\n // answerButtonsEl.classList.add(\"hide\");\n // questionEl.classList.add(\"hide\");\n // welcomePage.classList.remove(\"hide\");\n // welcomePage.innerHTML(\"Quiz is over.\");\n }\n}", "title": "" }, { "docid": "f0839d2cf0fcbf12291e8489ca307274", "score": "0.68319577", "text": "function quizOver(){\n\t$(\"#time\").html(\"Let's see how you've done...\");\n\t$(\"#question\").html(\"<div>Right Answers: \"+rightCount+\"</div><div>Wrong Answers: \"+wrongCount+\"</div><div>Questions that timed out: \"+timeCount+\"</div><div><img src='assets/images/ProfessorOwl-sm.gif'></div>\");\n\t$(\".reset\").show();\n}", "title": "" }, { "docid": "7dd622b55cc5bf59f27e7369b62e778d", "score": "0.6830649", "text": "function endGame() {\n $(\".questions\").hide();\n $(\"#quizTime\").hide();\n $(\"#submitBtn\").hide();\n $(\"#stats\").show();\n $(\"#restartBtn\").show();\n $(\"#choices\").hide();\n $(\"#nextBtn\").hide();\n $(\".correct\").text(\"Answered Correctly: \" + correctAnswers);\n $(\".incorrect\").text(\"Answered Incorrectly: \" + incorrectAnswers);\n $(\".unanswered\").text(\"Unanswered: \" + notAnswered);\n\n }", "title": "" }, { "docid": "d1b4b4b044a74ace4682390328d448eb", "score": "0.681259", "text": "function gameOver(){\n\tdocument.getElementById('btn_hid').style.display = \"none\";\n\tdocument.getElementById('definition').style.display = \"none\";\n\tdocument.getElementById('gameOver').style.display = \"block\";\n\tdocument.getElementById('megaman_hid').style.display='none';\n\tdocument.getElementById('animation_hid').style.display='none'\n\tresults.innerHTML = \"Has acertado \" + points + \" palabras y has cometido \" + errors + \" errores.\";\n}", "title": "" }, { "docid": "cf54c8f311fc208d2d817a5bf57518f4", "score": "0.6799651", "text": "function quizOver() {\n quiz.style.display = \"none\";\n quizDone.style.display = \"block\";\n}", "title": "" }, { "docid": "82ba40b322e17df06c884cce1cc88340", "score": "0.6769135", "text": "function endScoreboard() {\n $(\"#correctQs\").html(\"<h5>Correct answers: \" + correctAnswers + \"</h5>\");\n \n $(\"#incorrectQs\").html(\"<h5>Incorrect answers: \" + inccorectAnswers + \"</h5>\");\n \n $(\"#unAnswered\").html(\"<h5> Unanswered questions: \" + notAnswered + \"</h5>\");\n \n $(\"#triviaQuestions\").hide();\n\n\n}", "title": "" }, { "docid": "5c567c43cf66ca19dea0274227889e66", "score": "0.6763488", "text": "function gameOver() {\n\t\tview.pause();\n\t\tdocument.getElementById(\"endText\").innerHTML = \"GAME OVER<br>SCORE: \"+game.user.score;\n\t\tdocument.getElementById(\"cont\").style.display = \"none\";\n\t\tdocument.getElementById(\"reDo\").style.top = \"17.5vh\";\n\t\tdocument.getElementById(\"menuFromGame\").style.top = \"27.5vh\";\n\t\tdocument.getElementById(\"endBlock\").style.display = \"block\";\n\t}", "title": "" }, { "docid": "1c9d33024c891f6840c91246f959814f", "score": "0.6762689", "text": "function gameOver() {\n endgameEl.style.display = \"flex\";\n document.getElementById('final-score').innerHTML = score;\n }", "title": "" }, { "docid": "9265f8066f2801a3db087e5d6bf6e705", "score": "0.67538404", "text": "function displayQA() {\n if (q < questions.length) {\n title.textContent = questions[q].title;\n choiceA.textContent = questions[q].choices[0];\n choiceB.textContent = questions[q].choices[1];\n choiceC.textContent = questions[q].choices[2];\n choiceD.textContent = questions[q].choices[3];\n } else {\n gameOver();\n }\n}", "title": "" }, { "docid": "b31eb36d5cc724055796599b8b5dcc26", "score": "0.6744625", "text": "function gameOver() {\n\t\tplaying = false;\n\t\t\n\t\t// Determine the duration of the game\n\t\tduration = new Date().getTime() - time;\n\t\t\n\t\t// Show the UI\n\t\tpanels.style.display = 'block';\n\t\t\n\t\t// Ensure that the score is an integer\n\t\tscore = Math.round(score);\n\t\t\n\t\t// Write the users score to the UI\n\t\ttitle.innerHTML = 'Game Over! (' + score + ' points)';\n\t\t\n\t\t// Update the status bar with the final score and time\n\t\tscoreText = 'Score: <span>' + Math.round( score ) + '</span>';\n\t\tscoreText += ' Time: <span>' + Math.round( ( ( new Date().getTime() - time ) / 1000 ) * 100 ) / 100 + 's</span>';\n\t\tstatus.innerHTML = scoreText;\n\t}", "title": "" }, { "docid": "c4a3c35ad0fbe94c4dec83ceeebe5e4f", "score": "0.6738256", "text": "function showGameOver() {\n gameStatus = GAME_STATUS.GAME_OVER;\n showImgs.end = true;\n startBtn.textContent = 'Restart';\n startBtn.style.visibility = 'visible';\n helpBtn.style.visibility = 'hidden';\n\n var box = canvas.getBoundingClientRect();\n var left = box.left + (CANVAS_WIDTH - MENU_WIDTH) / 2 + 240;\n scoreBoard.style.left = left + 'px';\n\n //show final score, e.g.\n // x 3<br>x 1<br>x 1<br>x 2<br>1200\n scoreBoard.innerHTML = 'x '+ fruitData.pine.count + '<br>x '+ \n fruitData.apple.count + '<br>x ' +\n fruitData.grape.count + '<br>x ' +\n fruitData.orange.count + '<br>' + totalScore;\n}", "title": "" }, { "docid": "e7783a11c70d721ed109fd8153dee3d0", "score": "0.67356366", "text": "function gameOver() {\n alert(\"Wow, couldn't beat 9.9 Classic Mode. Pathetic. You should uninstall your Switch.\")\n $(\"#question\").hide();\n $(\"button\").hide();\n $(\"#display\").hide();\n $(\"#right\").html(\"Right answers: \" + score)\n $(\"#wrong\").html(\"Wrong answers: \" + wrong)\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered)\n}", "title": "" }, { "docid": "f8d400fab6c71a7500dd29727cb813d6", "score": "0.6731941", "text": "function showQuestions() {\n $(\".col-12\").hide();\n $(\"#questions\").html(\"<p><strong>\" +\n questions[currentQuestion].ask +\n \"</p><p class='choices'>\" +\n questions[currentQuestion].choices[0] +\n \"</p><p class='choices'>\" +\n questions[currentQuestion].choices[1] +\n \"</p><p class='choices'>\" +\n questions[currentQuestion].choices[2] +\n \"</p><p class='choices'>\" +\n questions[currentQuestion].choices[3] +\n \"</strong></p>\");\n // call the reset function to restart the game\n}", "title": "" }, { "docid": "db74042c200870b5065c8e9919e96df0", "score": "0.6730144", "text": "function gameOver(){\n\t\t//Show Message:\n\t\ttextScreen.classList.remove('animate__flipOutX');\n\t\ttextScreen.querySelectorAll('.displayNone').forEach( (e) => { e.classList.remove('displayNone') } );\n\t\tdocument.getElementById('turns').innerText = turnsTaken;\n\t\ttoggleBtn.checked = false;\n\t\ttoggleBtn.removeAttribute('disabled');\n\t\tconsole.log('game over');\n\t}", "title": "" }, { "docid": "75f770b2bf386afee8cb54edd531c957", "score": "0.6704753", "text": "function gameOver() {\n $('#restart').hide();\n $('#score').text(game.clicks);\n $('#winAudio')[0].play();\n $('#winModal').modal('show');\n stopTimer();\n }", "title": "" }, { "docid": "2c239877324e5e452729ee402a59115a", "score": "0.6690143", "text": "function gameOver() {\n if (currentQuestion >= questions.length - 1) {\n console.log(\"Current Question: \" + currentQuestion);\n console.log(\"Total Questions: \" + questions.length);\n alert(\"game over, check your score and reload the page to try again\");\n\n }\n else {\n currentQuestion++;\n console.log(\"game over else: \" + currentQuestion);\n nextQuestion();\n\n }\n}", "title": "" }, { "docid": "1f1d9616e4f7dc46b39c2e2b62d97278", "score": "0.6685042", "text": "function displayFinal() {\n\n // again. we clear the timer. We'll call it again if the game is reset.\n clearInterval(x);\n \n // hides and shows all appropriate screens\n $(\"#questionBox\").hide();\n\n $(\"#resultBox\").hide();\n\n $(\"#finalResults\").show();\n\n // adds the reset button. this is key to continuing playing\n $(\"#resetButton\").show();\n\n // shows your scores for right and wrong\n $(\"#finalCorrect\").text(\"Correct: \" + correct);\n\n $(\"#finalWrong\").text(\"Wrong: \" + wrong);\n\n }", "title": "" }, { "docid": "2e22de1210862e0a9fbae37efdf8c940", "score": "0.66815495", "text": "function gameOver() {\n console.log(\"game over\");\n $(\"#time-left\").empty();\n $(\"#question\").empty();\n $(\"#answer\").empty();\n $(\"#summary\").empty();\n\n $(\"#finalSummary\").append(\"<h3 class = 'text-center timer-p'> Game over!<span class = 'timer'>\" + \"</span></h3>\")\n $(\"#score\").append(\"Total correct: \" + score);\n $(\"#wrong\").append(\"Total incorrect: \" + wrong);\n // total unanswered\n $(\"#unanswered\").append(\"Total unanswered: \" + unanswered);\n\n // $(\"#restart\").append(\"restart?\")\n $(\"#restart\").show();\n\n}", "title": "" }, { "docid": "9216e4f3429473f1bd8724a9127a33a2", "score": "0.66802436", "text": "function gameOver() {\n // if game over funtion is run timer count remaing stops and sets to 0\n timercountRemaining = 1\n\n questionDisplay.setAttribute(\"class\", \"hideButton\");\n answerButtonsElem.setAttribute(\"class\", \"hideButton\");\n endGameScreen();\n}", "title": "" }, { "docid": "45ff43c6541d3262c5a22095beba019a", "score": "0.66720015", "text": "gameOver () {\n this.stopTimer()\n if (!this.response.nextURL) {\n console.log('******WIN*******')\n this.getScoreBoard()\n this._restart.style.display = ''\n } else {\n // hide all unnecessary stuff\n this._timer.textContent = ''\n this._button.style.display = 'none'\n this._question.style.display = 'none'\n this.hideTextbox()\n this.hideAlternatives()\n this._title.innerText = 'You lost, but you can try again'\n this._restart.style.display = ''\n console.log('**********WRONG*******************')\n }\n }", "title": "" }, { "docid": "427b65a4811e25587d9e98fcceee35b8", "score": "0.6667049", "text": "function displayResult() {\n $(\"#new-game\").show(\"slow\");\n // $(\"new-game\").prop(\"disabled\", false);\n $(\"#quiz-header\").html(\"<h1>\" + \"Game Over!!!\" + \"</h1>\");\n $(\"#quiz-question\").html(\"<h2>\" + \"This is how you did\" + \"</h2>\");\n $(\"#quiz-option\").html(\"<h3>\" + \"Total Questions: \" + numOfQuestion + \"<br>\" + \"Correct Answers: \" + correct + \"<br>\" + \"Wrong Answers: \" + wrong + \"<br>\" + \"Unanswered: \" + unanswered + \"<br>\" + \"Grade: \" + Math.round((correct/numOfQuestion)*100) + \"%\" + \"<br>\" + \"Click on New Game to play again.\" + \"</h3>\");\n }", "title": "" }, { "docid": "95694d930ce8fb86124c8eec95ac606a", "score": "0.665947", "text": "function resultsScreen() {\r\n\t\tif (correctGuesses === questions.length) {\r\n\t\t\tvar endMessage = \"Welcome To Nirvana\";\r\n\t\t\tvar bottomText = \"Could It BE?\";\r\n\t\t}\r\n\t\telse if (correctGuesses > incorrectGuesses) {\r\n\t\t\tvar endMessage = \"The Sun Shines Bright In Your World\";\r\n\t\t\tvar bottomText = \"Ill See You In The Sun\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar endMessage = \"YA HEEERD?\";\r\n\t\t\tvar bottomText = \"LMAO HAHA\";\r\n\t\t}\r\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \r\n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \r\n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\r\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\r\n\t\t$(\"#bottomText\").html(bottomText);\r\n\t\tgameReset();\r\n\t\t$(\"#start\").click(nextQuestion);\r\n\t}", "title": "" }, { "docid": "4bd0567bd532076c0cdebed956b3877e", "score": "0.66515416", "text": "gameOver() {\r\n $('#overlay').show();\r\n if (this.checkForWin()) {\r\n $('#game-over-message').text('You Win!');\r\n $('#overlay').addClass('win');\r\n\r\n }\r\n else {\r\n $('#game-over-message').text('You Lose!');\r\n $('#overlay').addClass('lose');\r\n }\r\n $('#phrase ul').empty()\r\n\r\n\r\n }", "title": "" }, { "docid": "92be26f85c389996bd01c64c36f5322c", "score": "0.6633378", "text": "function gameOver(){\n \n timerEl.css({\n \"display\": \"none\"\n })\n $('#enterName').css({\n \"display\": \"block\"\n });\n score += secondsLeft;\n console.log(\"gameOver\")\n questionEl.text(\"Game Over\");\n \n buttonOne.css({\n \"display\":\"none\"\n });\n buttonTwo.css({\n \"display\":\"none\"\n });\n buttonThree.css({\n \"display\":\"none\"\n });\n buttonFour.css({\n \"display\":\"none\"\n });\n playAgain.css({\n \"display\": \"block\"\n });\n \n scoreEl.text(\"Your score was \"+score);\n\n}", "title": "" }, { "docid": "ae3563d587ed55fd282f0d97c5974196", "score": "0.66286474", "text": "function displayScore() {\n $(\"#timer\").hide();\n $(\"#answers\").hide();\n $(\"#question\").html(\"You answered \" + correct + \" questions correctly and \" + incorrect + \" questions incorrectly.\");\n\n }", "title": "" }, { "docid": "f5b03a53d8e88cfd69d81d0e200cf9d0", "score": "0.66198325", "text": "function gameScore () {\n\t\n\n\t\n\tif ((incorrect + correct + noAnswer) === allQuestions) {\n\t\t$(\"#Questions\").empty();\n\t\t$(\"#Questions\").html(\"<h3>Game Over! Here's how you did: </h3>\");\n\t\t$(\"#Answer\").append(\"<h4> Correct: \" + correct + \"</h4>\" );\n\t\t$(\"#Answer\").append(\"<h4> Incorrect: \" + incorrect + \"</h4>\" );\n\t\t$(\"#Answer\").append(\"<h4> Unanswered: \" + noAnswer + \"</h4>\" );\n\t\t$(\"#restart\").show();\n\t\tcorrect = 0;\n\t\tincorrect = 0;\n\t\tnoAnswer = 0;\n\n\t} else {\n\t\tcounterGo();\n randomQuestion();\n $(\"#restart\").hide();\n \n \n\n }\n}", "title": "" }, { "docid": "3815c2c26f1b6f59a0f9d2753b783c00", "score": "0.66068774", "text": "function nextQuestion() {\n turn++;\n if ( turn < data.length ) {\n showQuestion();\n } else {\n $('body').html(\"<h2>Game Over!</h3>\");\n }\n}", "title": "" }, { "docid": "1d60173a224abe06974788b87c173302", "score": "0.65848595", "text": "gameOver() {\n alert(`Game over! You won a total of ${this.currentScore} rounds!`);\n this.toggleDivs();\n }", "title": "" }, { "docid": "791683c080805a1159afba2403ea9e59", "score": "0.6584483", "text": "function gameOver() {\n\t$(\"#playAgain\").css(\"visibility\",\"initial\")\n\tfor (var i = 0; i<hiddenWord.length; i++){\n\t\t$(\"#blanks span\").eq(i).html(hiddenWord[i].toUpperCase()); \n\t}\n\t$(\".keys\").html(\" \")\n\tfor (key in words[0].definition.results) {\n\t\t$(\".keys\").prepend(\"<p class='definition'>\"+words[0].definition.results[key].text+\"<br><em class>\"+words[0].definition.results[key].partOfSpeech+\"</em><br> -\"+words[0].definition.results[key].attributionText+\"</p>\")\n\t}\n}", "title": "" }, { "docid": "3d6928dae91b9cca5ea197624f6a887b", "score": "0.65812296", "text": "static showAll() {\n if (!game.isOver) {\n this._updateAll();\n statsConsole.show();\n }\n }", "title": "" }, { "docid": "71117db46406c95689d7fc04ec4ab708", "score": "0.65482813", "text": "function gameover(){\n\tif(rounds != roundsCompleted){\n\t\tweaponscreen();\n\t}else{\n\t\texitprompt();\n\t}\n}", "title": "" }, { "docid": "599a430681c774666fd6cb388aa6849c", "score": "0.65430135", "text": "function userCorrect() {\n\t\t$('#questionsField').hide();\n\t\trightAnswers++;\n\t\t$('#rightAnswers').text(rightAnswers);\n\t\t$('#winScreen').show();\n\t\t$('.answers').remove();\n\t\ttimerStop();\n\t\tif (rightAnswers + wrongAnswers < 5) {\n\t\t\tsetTimeout(correct, 3000);\n\t\t} else {\n\t\t\tstatScreen();\n\t\t}\n\t}", "title": "" }, { "docid": "664e25365fee4515151a0fcef4fb33f9", "score": "0.6524376", "text": "function showResult() {\n youLost = true;\n gameResults.show();\n\n if (score == 8) {\n winningPopup.show();\n playAgainButton.show();\n exitButton.show();\n congratsSound.play();\n } else {\n losingPopup.show();\n tryAgainButton.show();\n losingSound.play();\n }\n bgBirdSound.pause();\n}", "title": "" }, { "docid": "8241e8a8b09c26b7bfd7ca7c2880a210", "score": "0.65173763", "text": "function showHighscore() {\n startQuizDiv.style.display = \"none\"\n gameoverDiv.style.display = \"none\";\n highscoreContainer.style.display = \"flex\";\n highscoreDiv.style.display = \"block\";\n endGameBtns.style.display = \"flex\";\n\n generateHighscores();\n}", "title": "" }, { "docid": "d321fd9e83751997f7e9a195eddcb5be", "score": "0.6517035", "text": "function displayQuestion() {\n //generate random index in array\n index = Math.floor(Math.random() * options.length);\n pick = options[index];\n\n //\tif (pick.shown) {\n //\t\t//recursive to continue to generate new index until one is chosen that has not shown in this game yet\n //\t\tdisplayQuestion();\n //iterate through answer array and display\n\n $(\"#questionblock\").html(\"<h2>\" + pick.question + \"</h2>\");\n for (var i = 0; i < pick.choice.length; i++) {\n var userChoice = $(\"<div>\");\n userChoice.addClass(\"answerchoice\");\n userChoice.html(pick.choice[i]);\n\n //assign array position to it so can check answer\n userChoice.attr(\"data-guessvalue\", i);\n $(\"#answerblock\").append(userChoice);\n }\n\n //click function to select answer and outcomes\n $(\".answerchoice\").on(\"click\", function() {\n //grab array position from userGuess\n userGuess = parseInt($(this).attr(\"data-guessvalue\"));\n\n //correct guess or wrong guess outcomes\n if (userGuess === pick.answer) {\n stop();\n correctCount++;\n //play some sound\n document.getElementById(\"horn\").play();\n userGuess = \"\";\n $(\"#answerblock\").html(\"<p>Correct!</p>\");\n\n hidepicture();\n } else {\n stop();\n wrongCount++;\n //play some sound\n document.getElementById(\"aww\").play();\n userGuess = \"\";\n $(\"#answerblock\").html(\n \"<p>Wrong! The correct answer is: \" +\n pick.choice[pick.answer] +\n \"</p>\"\n );\n\n hidepicture();\n }\n });\n }", "title": "" }, { "docid": "ec3c1f5349e8ff48f28d1095b4ae4035", "score": "0.65066797", "text": "function gameOver(){\n\t\tclearInterval(myTimer);\n\t\t$('.active').delay(500).animate({\n\t\t\topacity:0\n\t\t},2000);\n\t\t$(\"#announce1\").delay(500).fadeIn(500);\t\n\t\tvar highScores = JSON.parse(localStorage.highScores);\n\t\tif(currentScore<=highScores[2].score){\n\t\t\t$('#highscore').hide();\n\t\t\t$(\"#announce1\").delay(1500).fadeOut(500);\n\t\t\t$(\"#announce2\").delay(1500).fadeIn(500);\n\t\t\tsetTimeout(function() {\n \t\t\t\t$('#newgame').focus();\n\t\t\t}, 2001);\t\n\t\t}\t\t\n\t\tsetTimeout(function() {\n \t\t\t$('#initialsbox').focus();\n\t\t}, 501);\t\n\t}", "title": "" }, { "docid": "32c12ae70284ef7d7cb01d87c9ed6388", "score": "0.6504922", "text": "function newGame() {\n $('.results').hide();\n // questions = questionInfo;\n correct = 0;\n wrong = 0;\n $('.game').show();\n }", "title": "" }, { "docid": "a1b4274bcf0a67f7b0afb5714e05c97d", "score": "0.65040344", "text": "function endGame () {\n $(\".row-question\").toggle();\n $(\".row-answers\").toggle();\n $(\".btn-success\").toggle();\n $(\".row-results\").toggle();\n $(\".count-down\").html(\"\");\n $(\".row-results\").append(\"<div class='guesses'><h2>\" + \"Correct Guesses: \" + correctGuesses + \"</h2></div>\");\n $(\".row-results\").append(\"<div class='guesses'><h2>\" + \"Wrong Guesses: \" + wrongGuesses + \"</h2></div>\");\n }", "title": "" }, { "docid": "7bf5cb3a8e73e882a00b235ce9ceddf5", "score": "0.64982843", "text": "function gameOver(won) {\n if(!won) {\n $('.game-over').show();\n $('.win').hide();\n $('.lose').show();\n } else {\n drawHead();\n $('.game-over').show();\n $('.lose').hide();\n $('.win').show();\n }\n $('.hangman-panel').css('opacity','.4');\n $('.play-again').focus();\n}", "title": "" }, { "docid": "83a8a3f1abcd2b6b51abd3cb10e226aa", "score": "0.6491866", "text": "function gameOver(){\n guessesDiv.style.display = \"none\";\n questionDiv.style.display = \"none\";\n timerDiv.style.display = \"none\";\n startButton.style.display = \"inline\";\n botSpan.style.justifyContent = \"center\";\n highScoreBut.style.margin = \"0% 0 0% 0%\";\n scoreDiv.style.display = \"inline\";\n\n scoreValue.textContent = time;\n}", "title": "" }, { "docid": "0acd07d564b5aa9d3b3dd891f73d961a", "score": "0.64792067", "text": "function endOfGame(){\n\t\tenterLag = 1;\n\t\tgameOver = true;\n\t\tguessBox.style.visibility = \"hidden\";\n\t\tplayerInput.style.visibility = \"hidden\";\n\t\tnewGameButton.style.visibility = \"visible\";\n\t\twinScreen.style.visibility = \"visible\";\n\t\tresults.style.visibility = \"hidden\";\n\t\tplayerScoreBox.style.visibility = \"hidden\";\n\t\tvar cDisp = document.getElementById(\"correct\");\n\t\tvar wDisp = document.getElementById(\"wrong\");\n\t\t\n\t\tvar dBonus = Math.round(playerPts*dBonusM)-playerPts;\n\t\tvar mBonus = Math.round(playerPts*mBonusM)-playerPts;\n\t\tvar cBonus = Math.round(playerPts*cBonusM)-playerPts;\n\t\t\n\t\twinScreenText.innerHTML = \"\";\n\t\twinScreenText.innerHTML += \"Points From correct guesses.............................\";\n\t\twinScreenText.innerHTML += playerPts + \"pts\"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Maximum points from guesses..........................\";\n\t\twinScreenText.innerHTML += guessNoTotal*10 + \"pts\"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Mark Before Bonuses..........................................\";\n\t\twinScreenText.innerHTML += Math.round(((playerPts/(guessNoTotal*10))*100)) + \"%\" + \"<br>\";\n\t\twinScreenText.innerHTML += \"Bonus from Map options.....................................\";\n\t\twinScreenText.innerHTML += mBonus + \"pts \"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Bonus from clues..................................................\";\n\t\twinScreenText.innerHTML += cBonus + \"pts \"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Difficulty Bonus...................................................\";\n\t\twinScreenText.innerHTML += dBonus + \"pts \"+ \"<br>\"+ \"<br>\"+ \"<br>\"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Total Points...........................................................\";\n\t\twinScreenText.innerHTML += (playerPts+cBonus+dBonus+mBonus) + \"pts \"+ \"<br>\";\n\t\twinScreenText.innerHTML += \"Final Mark.............................................................\";\n\t\twinScreenText.innerHTML += Math.round((((playerPts+cBonus+dBonus+mBonus)/(guessNoTotal*10))*100)) + \"%\"+ \"<br>\";\n\t\t\n\t\tif (prevCorrect.length > 0){\n\t\t\tcDisp.innerHTML = \"You guessed correctly:\" + \"&nbsp\";\n\t\t\tfor (l = 0; l < prevCorrect.length; l++)\n\t\t\t{\n\t\t\t\tcDisp.innerHTML += prevCorrect[l] + \" \";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tcDisp.innerHTML = \"You didn't guess a single country correctly..\";\n\t\t}\n\t\tif (prevWrong.length > 0){\n\t\t\twDisp.innerHTML = \"You fail to guess : \";\n\t\t\tfor (m = 0; m < prevWrong.length; m++)\n\t\t\t{\n\t\t\t\twDisp.innerHTML += prevWrong[m] + \" \";\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\twDisp.innerHTML = \"You guessed every last one of them correctly too! Well done.\";\n\t\t}\n\t}", "title": "" }, { "docid": "529068121fb0f6c5e54e20e5538fec6a", "score": "0.64752865", "text": "function showResults() {\n // stopCounter(interval);\n $(\"#quiz\").hide();\n $(\"#timer\").hide();\n $(\"#score\").append(counter);\n $(\"#final-score\").show();\n $(\"#user-initials\").show();\n $(\"#answer-status\").hide();\n }", "title": "" }, { "docid": "8b17ed021346dc69cbb1ce09937d339e", "score": "0.647487", "text": "function gameOver () {\n\n gameOverElement.classList.remove('hide')\n questionContainerElement.classList.add('hide')\n timeElement.classList.add('hide')\n resetState()\n}", "title": "" }, { "docid": "81c7ec7db0c05ca2a6025d0495a55eb3", "score": "0.6472344", "text": "gameover() {\n if (app.ScoreScreen.state !== 'show') {\n app.ScoreManager.endLevel();\n }\n }", "title": "" }, { "docid": "685a32783bbb170e38f4f9229e96b27c", "score": "0.64693093", "text": "function answerScreen() {\n if (rightAnswers === questions.length) {\n var endMessage = \"Wow, what a geek.\";\n var bottomText = \"Neeeeeerrrdddd!\";\n }\n else if (rightAnswers > wrongAnswers) {\n var endMessage = \"Guess more are right than wrong.\";\n var bottomText = \"You surprised everyone actually.\";\n }\n else {\n var endMessage = \"You SUUCCKK!!!\";\n var bottomText = \"PFFFFTTTT!\";\n }\n $(\"#triviaScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p> You got \" + \n rightAnswers + \" right. </p>\" + \n \"<p> You got \" + wrongAnswers + \" wrong.</p>\");\n\n $(\"#triviaScreen\").append(\"<h2 id='start'> Play Again </h2>\");\n\n $(\"#bottomText\").html(bottomText);\n\n gameReset();\n\n $(\"#start\").click(nextQuestion);\n }", "title": "" }, { "docid": "ed071b431c9081085f1306f8dbd54407", "score": "0.64689595", "text": "function gameOver(){\n $(\"#game\").css('paddingTop', '40px');\n $('#results').show();\n var h = $('#game').outerHeight();\n clearInterval( resizeIntervalHandle );\n $('#game').animate({ 'marginTop': h*-1}, 800, function(){\n $('#game').hide();\n });\n $('#container').animate({'height' : '400px'}, 800);\n game_end_ts = new Date().getTime();\n }", "title": "" }, { "docid": "5c1de91edf11ddabb7e4adc94dbe71ea", "score": "0.6467758", "text": "function over(){\n\t\n\t\tif(app.main.gameState == 3){\n\t\t\tdocument.getElementById('gameover').style.display = \"block\";\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "7bf9cf935b7ce517c6a43f2ee2a5d1f2", "score": "0.6467061", "text": "function gameOver() {\r\n\tgameover = true;\r\n\tclear();\r\n\tbackground(230);\r\n\ttextAlign(CENTER);\r\n\tfill(51);\r\n\ttextSize(48);\r\n\ttext(\"Game Over\", width/2, height/2);\r\n\ttextSize(32);\r\n\ttext(\"cliquez pour relancer\", width/2, 2*height/3)\r\n\tshowScore();\r\n}", "title": "" }, { "docid": "34eb6f53eb7abc34b541853ba682a1ac", "score": "0.6466882", "text": "function finalScoreboard() {\n\t\tif (correctTotal === triviaQuestions.length) {\n\t\t\tvar endMessage = \"Perfect Score! You're a true sports fan! \";\n\t\t}\n\t\telse if (correctTotal > incorrectTotal) {\n\t\t\tvar endMessage = \"Nice job!\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"Are you sure you're not a Cowboys fan?\";\n\t\t}\n\t\t$(\"#questionScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" +\n\t\t\tcorrectTotal + \"</strong> right.</p>\" +\n\t\t\t\"<p>You got <strong>\" + incorrectTotal + \"</strong> wrong.</p>\");\n\t\t$(\"#questionScreen\").append(\"<h1 id='start'>Play Again?</h1>\");\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}", "title": "" }, { "docid": "cfcbb14d4a87493cdebe9191073fce30", "score": "0.64603204", "text": "function askQuestions() {\n\n // Get a reference to our ul's\n ulArray = document.querySelectorAll(\"ul\");\n\n // Loop through our ul's that are hidden on the page\n for (i = 0; i < questionArray.length; i++) {\n \n // First time through, hide instructions and \"Start Game\" button\n if (i === 0) { \n var p = document.querySelector(\".gameDescription\");\n p.setAttribute(\"style\", \"display:none;\");\n var button = document.querySelector(\"button\");\n button.setAttribute(\"style\", \"display:none\");\n var viewscores = document.querySelector(\"#viewhighscores\");\n viewscores.setAttribute(\"style\", \"display:none\");\n }\n\n // For each question <ul>, add an event listener so can see if user clicked the correct answer\n ulArray[i].addEventListener(\"click\", function checkAnswer(e) {\n // Make sure they clicked an actual list item, not the space between\n if ((e.target.tagName) === \"LI\") {\n \n // If they guess the correct answer, turn that answer's background green and display \"Correct\" message at bottom of page\n if ((e.target.textContent === correctAnswer)) {\n e.target.classList.add(\"success\");\n rightWrongDisplay.innerHTML = \"<h3>Correct!!! You're a rockstar!!!</h3>\";\n score += 10; // Add 10 to their score\n } \n // If they guessed incorrectly, turn that answer's background red and display \"Sorry\" message at bottom of page\n else {\n e.target.classList.add(\"error\");\n rightWrongDisplay.innerHTML = \"<h3>Sorry, That is incorrect.</h3>\";\n numSeconds = numSeconds - 5; // Subtract 5 seconds from the clock\n }\n // Pause for one second before moving to next question...allows player to see result of guess\n // Hide current question and reset Correct/Incorrect message\n setTimeout(() => { ulArray[qToDisplay].setAttribute(\"style\", \"display: none\");\n rightWrongDisplay.innerHTML = \"\";\n // Advance to next question and make sure we're not at the end of all questions\n qToDisplay++;\n if (qToDisplay < questionArray.length){\n ulArray[qToDisplay].setAttribute(\"style\", \"display: block\"); \n correctAnswer = questionArray[qToDisplay].correctAnswer();\n }\n // If we're at the last question, then time to show results\n else {\n showResults();\n }\n }, 1000);\n }\n }); // End Click Event Listener\n }\n\n // Set our first correct answer\n var correctAnswer = questionArray[qToDisplay].correctAnswer();\n\n // Show the first question and possible answers\n ulArray[qToDisplay].setAttribute(\"style\", \"display: block\");\n}", "title": "" }, { "docid": "5d005cd414dbaf1a89998ca81fcf2bd4", "score": "0.64589536", "text": "function showScore() {\n quizBody.style.display = \"nome\";\n gameoverDiv.style.display = \"flex\";\n clearInterval(timerInterval);\n highscoreInputInitials.value = \"\";\n finalScoreEl.innerHTML = \"you had \" + score + \"from\" + quizMeQuestion.length + \" correct\";\n}", "title": "" }, { "docid": "915366651fb0d096c4ba2c65613aa8e9", "score": "0.64572215", "text": "function gameStats() {\n\n currentQuestion = questionBank.length; \n $(\".questionblock\").hide();\n $(\"#random-question\").hide();\n $(\".answers\").hide();\n $(\".wronganswer\").hide();\n $(\".answerimage\").hide();\n $(\"#score-block\").show();\n $(\".btn-warning\").show();\n $(\"#correct-guesses\").text(\"Correct Guesses: \" + correctCount)\n $(\"#incorrect-guesses\").text(\"Incorrect Guesses: \" + incorrectCount)\n $(\"#house-points\").text(\"You earned: \" + (correctCount - incorrectCount) * 10 + \" house points!\")\n \n }", "title": "" }, { "docid": "3d4aa079c61848380448b7a829938c1c", "score": "0.64550316", "text": "function returnHome(){\n highScores.style.display = \"none\";\n quiz.style.display = \"block\";\n renderQuestion();\n renderCounter();\n}", "title": "" }, { "docid": "d823345419bce59bba24be2457bd2a43", "score": "0.6449244", "text": "function scoreboard(){\r\n\t$('#timeRemaining').empty();\r\n\t$('#message').empty();\r\n\t$('#correctedAnswer').empty();\r\n\r\n\t$(\".answerPage\").hide();\r\n\t$(\".scoreboard\").hide();\r\n\t$(\".scoreboard\").show();\r\n\t$('#finalMessage').html(messages.finished);\r\n\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\r\n\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\r\n\t$('#unanswered').html(\"Unanswered: \" + unanswered);\r\n\t$('#startOverBtn').addClass('reset');\r\n\t$('#startOverBtn').show();\r\n\t// $('#startOverBtn').html('Start Over?');\r\n}", "title": "" }, { "docid": "ee37fb940f230e461dc8eb6c10a00b62", "score": "0.6446055", "text": "function displayGameOver() {\n gameOver.style.display = 'block';\n}", "title": "" }, { "docid": "9b7ef35598743987af5ebdde9f477820", "score": "0.6441201", "text": "function dispalyResults() {\n $('#question').html('');\n $('#a').html('');\n $('#b').html('');\n $('#c').html('');\n $('#image-result').html('');\n $('#yups').html('');\n stopwatch.stop();\n $(\"#game-over\").html('Game Over!');\n $('#answers').append('<p>' + '<img src=' + 'http://media2.popsugar-assets.com/files/thumbor/vwXZq0YrIvHoQz9Tq0I2gfN8MUY/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2014/09/03/787/n/1922398/0dc7867952fbc808_beyonce-gif/i/Beyonce-Dancing-GIFs.gif' + '>' + '</p>')\n $('#answers').append('<button class=restart> Play Again</button>');\n $('.restart').on('click', restartGame);\n }", "title": "" }, { "docid": "078ed15671f9d9a0b348991649c960e7", "score": "0.6431401", "text": "function loopQuestions() {\n\t\t$('#answers').html('');\n\t\t$('#error').hide();\n\t\tquestionCounter++;\n\t\tquestionNumber++;\n\t\tif (questionCounter < 5) {\n\t\t\tshowQuestion();\n\t\t}\n\t\telse {\n\t\t\tshowResults();\n\t\t}\n\t}", "title": "" }, { "docid": "79089a1bfeb9761c9eca68aa8d496497", "score": "0.64296204", "text": "function onePlayerGameOver() {\n // Resets page after displaying score\n $(\".line\").fadeOut();\n $(\".circle\").fadeOut();\n $(\".controls\").fadeOut();\n $(\"#restart\").css(\"display\", \"inline-block\").html(\"Play again\");\n $(\"aside\").show().html(\"<h1>Game over!</h1>\");\n $(\"aside\").append(\"<h1>Score: \" + score + \"</h1>\");\n $(\"#restart\").click(reload);\n }", "title": "" }, { "docid": "9d51e2b1c4895bf1abbde81633ff4ff3", "score": "0.6427518", "text": "function gameOver() {\n \t$('#countMinus').html(count-1);\n \t$('#gameOver').show();\n \t$('#gameOverText').show();\n document.getElementById('start').disabled = false;\n $('#start').css('opacity', 1);\n\n }", "title": "" }, { "docid": "7e560be2945de987179c080189de07cb", "score": "0.64234924", "text": "function endGame() {\n stop();\n checkAnswers();\n $(\"#correct-answers\").text(\"Correct answers: \" + correctAnswers);\n $(\"#incorrect-answers\").text(\"Incorrect answers: \" + incorrectAnswers);\n $(\"#blank-answers\").text(\"Unanswered questions: \" + blankAnswers);\n $(\"#questions\").hide();\n $(\"#results\").show();\n $(\"#show-timer\").hide();\n\n }", "title": "" }, { "docid": "fa236b7740c35f6f222805f5a07f966e", "score": "0.64138967", "text": "function gameOver() {\r\n // FIXME: Set the right condition for ending the game\r\n if (pairs == 8) {\r\n fancyText(\"YOU WON!\",\"shake\",\"fadeOut\");\r\n }\r\n }", "title": "" }, { "docid": "8cc25f31484d6c060e296dccb2259fc9", "score": "0.64098", "text": "function showHighscore(){\n startQuizDiv.style.display = \"none\";\n gameoverDiv.style.display = \"none\";\n highscoreContainer.style.display = \"flex\";\n highscoreDiv.style.display = \"block\";\n endGameBtns.style.display = \"flex\";\n generateHighscores();\n}", "title": "" }, { "docid": "ae9b07a18f13660be6a9c9976c03b914", "score": "0.64095134", "text": "function gameOver() {\n human = false;\n computer = false;\n playerOne = false;\n playerTwo = false;\n $('h3').hide();\n }", "title": "" }, { "docid": "760a52b3cd282ac7fe2a9a2bddb2a41d", "score": "0.6403791", "text": "function gameOver() {\n stop = true;\n pauseAudio();\n $('#go-container').show();\n storeHighScore(score);\n //$('#score').html(score);\n}", "title": "" }, { "docid": "1eaf98375be918a997a0e95a34f18705", "score": "0.640002", "text": "function displayResultsAndEndGame () {\n gamePlayPage.style.display = \"none\";\n winnerPage.style.display = \"block\";\n document.body.style.backgroundImage = \"url('Images_Sounds/2762074.jpg')\";\n finalScore.innerText = \"Total Fuel Earned: \" + score\n if (score <= 10) {\n babyRocket.style.display = \"block\";\n uhOhMessage.style.display = \"block\";\n playFailSound();\n } else if (score > 10 && score <= 20) {\n babyRocket.style.display = \"block\";\n blastOff.style.display = \"block\";\n moveRocket();\n playRocketSound();\n } else if (score <= 35) {\n mediumRocket.style.display = \"block\";\n blastOff.style.display = \"block\";\n moveRocket();\n playRocketSound();\n } else {\n bigRocket.style.display = \"block\";\n blastOff.style.display = \"block\";\n moveRocket();\n playRocketSound();\n }\n }", "title": "" }, { "docid": "4abc7a38cf2c2195e5ab6877d748f6ce", "score": "0.6399987", "text": "gameOver() {\n const mainScreen = document.getElementById(\"overlay\");\n mainScreen.style.display = \"inherit\";\n \n const h1 = document.getElementById(\"game-over-message\");\n if (this.missed === 5) {\n h1.innerHTML = `Sorry, you lost! Better luck next time.`;\n button.innerHTML = \"Try again\";\n mainScreen.className = \"lose\";\n this.resetGame();\n } else if (this.missed < 5) {\n h1.innerHTML = `Congratulations, You won! The quote was\n <br><p class= \"end-quote\">\"${this.activePhrase.phrase.toUpperCase()}\"</p>`;\n button.innerHTML = \"Play again\";\n mainScreen.className = \"win\";\n this.resetGame();\n }\n }", "title": "" }, { "docid": "64b55958ced98376053b8430b8025283", "score": "0.6396676", "text": "function gameOver() {\n\n refreshScores();\n\n $.playSound(\"se/fail.mp3\");\n\n $('#addScore').show();\n $('#go-score').text($('#simon-counter').text());\n\n // resetting values\n roundActive = false;\n userArray = [];\n simonArray = [];\n lastRound = currentRound;\n lastRoundScore = userScore;\n currentRound = 0;\n userScore = 0;\n gameStart = false;\n $('#gameOver').removeClass('hide');\n}", "title": "" }, { "docid": "30e949fa8137dcc1ca22433fefecf661", "score": "0.63935333", "text": "function gameplay() {\r\n\t\r\n\tif (count > questions.length - 1) {\r\n\t\tdocument.getElementById(\"text\").innerHTML = \"Those are all the questions, you can only solve the passage.\";\r\n\t\tdocument.getElementById(\"next\").style.backgroundColor = \"rgba(0, 0, 0, 0.5)\";\r\n\t\tnextOp = false;\r\n\t}\r\n\t\r\n\telse if (nextOp) {\r\n\t\tdisplayQuestion(count);\r\n\t\tdocument.getElementById(\"text\").innerHTML = questions[count];\r\n\t\tdocument.getElementById(\"answer\").innerHTML = answers[count];\r\n\t\tdocument.getElementById(\"options\").style.display = \"inline\";\r\n\t\t\r\n\t\tfor (var i = oCount; i < oCount + 4; i++) {\r\n\t\t\tdocument.getElementById(\"option\"+(i-oCount+1)).innerHTML = options[i];\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "7f8ebbaf23132a1cdf6b14f53ac54407", "score": "0.6392218", "text": "function showScore(){\r\n quizBody.style.display = \"none\"\r\n gameoverDiv.style.display = \"flex\";\r\n clearInterval(timerInterval);\r\n finalScoreEl.innerHTML = \"You got \" + score + \" out of \" + quizQuestions.length + \" correct!\";\r\n}", "title": "" }, { "docid": "786ad4d623e1a0d3b8b200de4c671847", "score": "0.63899416", "text": "function showHighscore(){\n\n highscoreEl.style.display = \"block\";\n startQuizEl.style.display = \"none\"\n gameOver.style.display = \"none\";\n endBtn.style.display = \"flex\";\n highscoreContainer.style.display = \"flex\";\n\n generateHighscores();\n}", "title": "" }, { "docid": "12b31ca716c4f8a6142ec97145d77d12", "score": "0.6377278", "text": "function showScore(){\n quizBody.style.display= \"none\";\n gameoverDiv.style.display= \"flex\";\n clearInterval(timeInterval);\n highscoreInputName.value = \"\";\n finalScoreEl.innerHTML = \"You got \" + score + \" out of \" + questions.length + \" correct!\";\n}", "title": "" }, { "docid": "5b6e3abe91673fece740dfd4f0d9a7e0", "score": "0.63772345", "text": "function showResults() {\n quizScreen.style.display = \"none\";\n results.style.display = \"flex\";\n\n clearInterval(setTimeInterval);\n clearInterval(scoreTimerInterval);\n\n score.textContent = playerScore;\n \n scoreChecker();\n}", "title": "" }, { "docid": "263357094bbd937df9571ea31dade49e", "score": "0.6375389", "text": "function showGameOver() {\n background(\"#E84D53\");\n // Set up the font\n textSize(25);\n textAlign(CENTER, CENTER);\n fill(0);\n // Set up the text to display\n let gameOverText = \"GAME OVER\\n\"; // \\n means \"new line\"\n gameOverText = gameOverText + \"YOU KILLED ME!!!!\";\n let gameOverPreyEaten = \"\\nNumber of prey eaten:\" + prey.Eaten;\n // Display it in the centre of the screen\n text(gameOverText, width/2, height/2+35);\n textSize(15);\n text(gameOverPreyEaten, width/2, 435);\n push();\n imageMode(CENTER);\n drawAngryOwl();\n pop();\n // Draw restart button\n drawRestart();\n // Stop sound\n funnySound.stop();\n\n }", "title": "" }, { "docid": "21d66bf0bad82ca0c8e49f9cd0312bc0", "score": "0.63749427", "text": "function showResults() {\n\t\tvar totalQuestions = 5;\n\t\t$('#questionScreen,#resultScreen').hide();\n\t\t$('#scorecardScreen').show();\n\t\t$('.correctAnswers,.correctFraction,.wrongAnswers,.wrongFraction,.skippedQuestions,.skippedFraction,.scoreBackground').html(' ');\n\n\t\t// correct answer display\n\t\tfor (var i = 1; i <= correctAnswers; i++) {\n\t\t\t$('.correctAnswers').append('<img src=\"img/correct-filled.png\">');\n\t\t}\n\t\tfor (var j = 1; j <= totalQuestions - correctAnswers; j++) {\n\t\t\t$('.correctAnswers').append('<img src=\"img/correct-empty.png\">');\n\t\t}\n\t\t$('.correctFraction').append(correctAnswers);\n\t\t\n\t\t// wrong answer display\n\t\tfor (var k = 1; k <= wrongAnswers; k++) {\n\t\t\t$('.wrongAnswers').append('<img src=\"img/wrong-filled.png\">');\n\t\t}\n\t\tfor (var l = 1; l <= totalQuestions - wrongAnswers; l++) {\n\t\t\t$('.wrongAnswers').append('<img src=\"img/wrong-empty.png\">');\n\t\t}\n\t\t$('.wrongFraction').append(wrongAnswers);\n\t\t\n\t\t// skipped quesion display\n\t\tfor (var m = 1; m <= skippedQuestions; m++) {\n\t\t\t$('.skippedQuestions').append('<img src=\"img/skipped-filled.png\">');\n\t\t}\n\t\tfor (var n = 1; n <= totalQuestions - skippedQuestions; n++) {\n\t\t\t$('.skippedQuestions').append('<img src=\"img/skipped-empty.png\">');\n\t\t}\n\t\t$('.skippedFraction').append(skippedQuestions);\n\t\t\n\t\t// total score display\n\t\t$('.scoreBackground').html(correctAnswers/5*100 + '%');\n\t}", "title": "" }, { "docid": "67b912d84e007d681be5ef933d320521", "score": "0.63730055", "text": "function viewAllScores(){\n quizQuestions.classList.add('hide');\n rightAnswer.classList.add('hide');\n wrongAnswer.classList.add('hide');\n quizResults.classList.add('hide');\n preQuizWindow.classList.add('hide');\n highScores.classList.remove('hide');\n displayScores();\n }", "title": "" }, { "docid": "2188e27d82a0ed29d917f321551044a8", "score": "0.63715196", "text": "function questionGame() {\n for (var i = 0; i < questionsArray.length; i++) {\n askYesNoQuestion(i);\n }\n }", "title": "" }, { "docid": "ed86e0fc0df4fd97260167c34742391f", "score": "0.63683957", "text": "function win() {\n $(\"#showQuestion\").empty();\n $(\"#showPossibleAnswers\").empty();\n $(\"#showPossibleAnswers\").html(\"<img src=./assets/images/symbol.gif>\");\n correctAnswers++;\n index++\n setTimeout(showTriva, 3000);\n }", "title": "" }, { "docid": "1851df2e23caf26851fead6917d274c7", "score": "0.6361224", "text": "gameOver() {\r\n let $mainScreen = $(\"#overlay\");\r\n $mainScreen.show(); // Leaves game screen and goes back to overlay\r\n let $message = $(\"#game-over-message\");\r\n $(\"#qwerty .key\").prop(\"disabled\", true); // Disable keyboard\r\n if (this.missed === this.missLimit) { // If user has max misses, they lose and...\r\n $(\".title\").text(`You are worse than Jar Jar Binks!`);\r\n $message.text(`The answer was '${this.activePhrase.phrase.toUpperCase()}'. Dare to play again?`); //Display losing message\r\n overlay.className = \"lose animate-pop-in\"; // Gives overlay losing class name and styles (Darth Vader pic)\r\n } else { // Otherwise...\r\n $(\".title\").text(`The Force is strong with you!`).css(`front-style`, `bold`);\r\n $message.text(`You guessed '${this.activePhrase.phrase.toUpperCase()}' correctly! Dare to play again?`)\r\n .css(`front-style`, `bold`); // Display winning message\r\n overlay.className = \"win animate-pop-in\"; // Gives overlay winning class name and styles (Star Wars Victory pic)\r\n }\r\n }", "title": "" }, { "docid": "e68ae69b537ff4c1921a5ed22b849998", "score": "0.63555247", "text": "function allDone() {\n for (var i = 0; i < quizButtonsEl.length; i++) {\n quizButtonsEl[i].style.display = \"none\";\n }\n\n score = score + timeLeft;\n\n // Dont display score less than 0\n if (score < 0) {\n score = 0;\n }\n\n quizTitlesEl.textContent = \"All done!\";\n quizInstructionsEl.textContent = \"Your final score is \" + score + \".\";\n quizInstructionsEl.style.display = \"block\";\n quizInstructionsEl.className = \"text-left\";\n initialsEl.style.display = \"block\";\n\n}", "title": "" }, { "docid": "c1f29dd506b900bb53ba83296a0889a7", "score": "0.6355251", "text": "function displayQuestion() {\n //generate random index in array\n index = Math.floor(Math.random()*options.length);\n pick = options[index];\n \n //\tif (pick.shown) {\n //\t\t//recursive to continue to generate new index until one is chosen that has not shown in this game yet\n //\t\tdisplayQuestion();\n //\t} else {\n //\t\tconsole.log(pick.question);\n //iterate through answer array and display\n $(\"#questionblock\").html(\"<h2>\" + pick.question + \"</h2>\");\n for(var i = 0; i < pick.choice.length; i++) {\n var userChoice = $(\"<div>\");\n userChoice.addClass(\"answerchoice\");\n userChoice.html(pick.choice[i]);\n //assign array position to it so can check answer\n userChoice.attr(\"data-guessvalue\", i);\n $(\"#answerblock\").append(userChoice);\n //\t\t}\n }\n \n \n \n //click function to select answer and outcomes\n $(\".answerchoice\").on(\"click\", function () {\n //grab array position from userGuess\n userGuess = parseInt($(this).attr(\"data-guessvalue\"));\n \n //correct guess or wrong guess outcomes\n if (userGuess === pick.answer) {\n stop();\n correctCount++;\n userGuess=\"\";\n $(\"#answerblock\").html(\"<p>Correct!</p>\");\n hidepicture();\n \n } else {\n stop();\n wrongCount++;\n userGuess=\"\";\n $(\"#answerblock\").html(\"<p>Wrong! The correct answer is: \" + pick.choice[pick.answer] + \"</p>\");\n hidepicture();\n }\n })\n }", "title": "" }, { "docid": "141f63aec5890c79bc1efc5595910015", "score": "0.6355184", "text": "function startOverhoring() {\n\tquestionCounter++;\n\tshowTotalQuestions();\n\tshowCorrectAnswers();\n\tshowIncorrectAnswers();\n\tstelVraag();\n\tgenereerAfbeelding();\n}", "title": "" } ]
190939b360d20b2f40988295619c1884
to toggle buttons for rear calls TODO: if rear call called, there should be a visual ticker that says there is a rear call even when REAR view is toggled off COMPLETED TODO: disable locked out hall and car buttons based on the position of the Rear Switch toggle COMPLETED
[ { "docid": "67fa55095e335cad32301f062b0df0e1", "score": "0.6724619", "text": "function tglRear(car, flr) {\r\n //all the 'car' vars are for identifying the button groups for specific cars\r\n //variables for toggling car buttons\r\n let cab = flr.carMask[car];\r\n let rear = cab[\"R\"];\r\n let front = cab[\"F\"];\r\n let count = 0;\r\n //variables for toggle hall buttons\r\n let UF = flr.hallMask.UF;\r\n let UR = flr.hallMask.UR;\r\n let DF = flr.hallMask.DF;\r\n let DR = flr.hallMask.DR;\r\n\r\n sendClick(car + \"togR\");\r\n\r\n if ($(\"#\" + car + \"togR\").is(\":checked\")) {\r\n $(\".floorLabel.car\" + car).each(function() {\r\n if (!$(this).hasClass(\"rear\")) {\r\n $(this)\r\n .append(\"R\")\r\n .addClass(\"rear\"); //appends the \"R\" to the floorlabel\r\n }\r\n });\r\n\r\n $(\".btn-icon.car\" + car).each(function() {\r\n count++;\r\n\r\n $(this).toggleClass(\"rear\"); //the next two lines tgl \"rear\" classes so they can be maniuplated by class selectors later\r\n $(\".flr\" + count + \"Up\").each(function() {\r\n if (UR[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n $(\".flr\" + count + \"Dn\").each(function() {\r\n if (DR[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n });\r\n\r\n count = 0;\r\n $(\".btn-car.car\" + car).each(function() {\r\n count++;\r\n $(this).toggleClass(\"rear\"); //access the btn-box (goes through btn-car -> parent since btn-box doesn't have specifying classes)\r\n $(\"<span></span>\", {\r\n //this appends a 'R' span to the carButton btn-box\r\n class: \"rearLbl car\" + car\r\n })\r\n .html(\"R\")\r\n .insertBefore($(\"#\" + car + \"Eta\" + count + \"UpBox\"));\r\n\r\n //tgl 'disabled' attr on car buttons\r\n $(\"#\" + car + \"car\" + count).each(function() {\r\n if (rear[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n });\r\n } else {\r\n //basically removes everything when switch is toggled back off\r\n $(\".floorLabel.car\" + car).each(function() {\r\n //here is probably where the logic would go for preserving the visual signifier for pressed rear buttons\r\n let str = $(this).text();\r\n str = str.substring(0, str.length - 1);\r\n $(this)\r\n .html(str)\r\n .removeClass(\"rear\");\r\n });\r\n $(\".btn-icon.car\" + car).each(function() {\r\n count++;\r\n $(this).toggleClass(\"rear\"); //the next two lines tgl \"rear\" classes so they can be maniuplated by class selectors later\r\n $(\".flr\" + count + \"Up\").each(function() {\r\n if (UF[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n $(\".flr\" + count + \"Dn\").each(function() {\r\n if (DF[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n });\r\n\r\n count = 0;\r\n $(\".btn-car.car\" + car).each(function() {\r\n $(this).toggleClass(\"rear\"); //access the btn-box (goes through btn-car -> parent since btn-box doesn't have specifying classes)\r\n $(\".rearLbl.car\" + car).remove();\r\n\r\n //tgl 'disabled' attr on car buttons\r\n count++;\r\n $(\"#\" + car + \"car\" + count).each(function() {\r\n if (front[count] == 0) {\r\n $(this).attr(\"disabled\", \"\");\r\n } else {\r\n $(this).removeAttr(\"disabled\", \"\");\r\n }\r\n });\r\n });\r\n }\r\n}", "title": "" } ]
[ { "docid": "68c7684a2759c4ae212fc8e9f1dcbb07", "score": "0.6779203", "text": "toggleButtons() {\n\n }", "title": "" }, { "docid": "adc65982ffca0547d69c3078cf01ebdb", "score": "0.65221024", "text": "function toggleButtons(){\n plus().disabled = true ? plus().disabled = false : plus().disabled = true\n minus().disabled = true ? minus().disabled = false : minus().disabled = true\n heart().disabled = true ? heart().disabled = false : heart().disabled = true\n submit().disabled = true ? submit().disabled = false : submit().disabled = minus\n}", "title": "" }, { "docid": "431a8e1105ff2186f6f46f53334d3e58", "score": "0.61779207", "text": "function toggleButtons()\n{\n\tmyWarning( '' )\n\tswitch( mode )\n\t{\n\t\tcase('none'):\n\t\t\t$('#btn-edit').html(\"<i class='icon-wrench icon-white'></i>\")\n\t\t\t$('#btn-edit').attr('title','edit/add 3D objects')\n\t\t\t$('#btn-screenshot').html(\"<i class='icon-camera icon-white'></i>\")\n\t\t\t$('#btn-makemovie').html(\"<i class='icon-film icon-white'></i>\")\n\t\t\t$('#btn-fullscreen').html(\"<i class='icon-fullscreen icon-white'></i>\")\n\t\t\t$('#btn-edit').attr('class','btn btn-primary btn-large enabled')\n\t\t\t$('#btn-makemovie').attr('class','btn btn-primary btn-large enabled')\n\t\t\t$('#btn-screenshot').attr('class','btn btn-primary btn-large enabled')\n\t\t\t$('#btn-fullscreen').attr('class','btn btn-primary btn-large enabled pull-right')\n\t\t\ttoggleUploadUI( 'off' )\n\t\t\ttoggleButtonsTemplate()\n\t\t\tbreak\n\t\tcase('edit'):\n\t\t\t$('#btn-edit').html(\"<i class='icon-ok icon-white'></i>\")\n\t\t\t$('#btn-edit').attr('title','stop editing')\n\t\t\t$('#btn-edit').attr('class','btn btn-success btn-large')\n\t\t\t$('#btn-screenshot').attr('class','btn btn-primary btn-large disabled')\n\t\t\t$('#btn-makemovie').attr('class','btn btn-primary btn-large disabled')\n\t\t\t$('#btn-fullscreen').attr('class','btn btn-primary btn-large disabled pull-right')\n\t\t\ttoggleUploadUI( 'on' )\n\t\t\ttoggleButtonsTemplate()\n\t\t\tbreak\n\t\tcase('makemovie'):\n\t\t\t$('#btn-makemovie').html(\"<i class='icon-stop icon-white'></i>\")\n\t\t\t$('#btn-makemovie').attr('class','btn btn-danger btn-large')\n\t\t\t$('#btn-edit').attr('class','btn btn-primary btn-large disabled')\n\t\t\t$('#btn-screenshot').attr('class','btn btn-primary btn-large disabled')\n\t\t\t$('#btn-fullscreen').attr('class','btn btn-primary btn-large disabled pull-right')\n\t\t\ttoggleUploadUI( 'off' )\n\t\t\ttoggleButtonsTemplate()\n\t\t\tbreak\n\t\tcase('fullscreen'):\n\t\t\t$('#btn-fullscreen').html(\"<i class='icon-resize-small icon-white'></i>\")\n\t\t\t$('#btn-makemovie').attr('class','btn btn-primary btn-large')\n\t\t\ttoggleUploadUI( 'off' )\n\t\t\ttoggleButtonsTemplate()\n\t\t\tbreak\n\t}\n}", "title": "" }, { "docid": "ef796b21eb971cd0b730f058b81a23d4", "score": "0.6165718", "text": "function disableRMButtons(){\n\t$('.datepickerdev').attr('disabled',true);\n\t$('.timepicker').attr('disabled',true);\n\t$('.DeviceType').attr('disabled',true);\n\t$('.interval').attr('disabled',true);\n\t$('.iteration').attr('disabled',true);\n\t$('#ReserveApplyButton').hide();\n\t$('#ReserveCancelButton').hide();\n\t$('#ReserveEditButton').show();\n\t$('#ReserveReleaseButton').show();\n\t$('#ReserveGenerateReportButton').show();\n\t$('.resres').removeAttr('checked');\n\t$('.resres').parent().parent().removeClass('highlight');\n\t$(\"#PortGenerateReport\").attr('disabled',true);\n\t$('#PortGenerateReport').addClass('ui-state-disabled');\n\t}", "title": "" }, { "docid": "247db4871125f0f2cf3d5e8e0713453d", "score": "0.61552936", "text": "function toggleBtns(btnsArray, on) { //btnsArray is a predefined parameter, this is just a name for the array of buttons. The on turns on the Boolean (true or false). Parameters btn\n for (let btn = 0; btn < btnsArray.length; btn++) {\n if (on) { //if(on)= if(true)\n btnsArray[btn].style.display = \"inline-block\"; //This will display the buttons when the parameter is equal to true.\n } else {\n btnsArray[btn].style.display = \"none\"; //This will not display the buttons when the parameter is equal to false.\n }\n }\n}", "title": "" }, { "docid": "5cfcd17f2d98397a73af2ad6793d1231", "score": "0.61459696", "text": "function buttonSwitch(i) {\n\tif ( btnOn[i].style.visibility != 'hidden' ) {\n \tbtnOn[i].style.visibility = 'hidden';\n } else {btnOn[i].style.visibility = 'visible';\n }\n if ( btnOff[i].style.visibility == '' || btnOff[i].style.visibility == 'hidden' ) {\n \tbtnOff[i].style.visibility = 'visible';\n } else {\n\t btnOff[i].style.visibility = 'hidden';\n\t\t}\n}", "title": "" }, { "docid": "d9925cb2cff9f8e68b0ce3861a876a62", "score": "0.6124857", "text": "function toggleTrueAndFalseButtons() {\n trueAndFalseButtons().forEach(function(btn){\n btn.classList.toggle(\"hide\")\n })\n}", "title": "" }, { "docid": "741815bc0aeb8a290a3fe14151fc5f59", "score": "0.6121063", "text": "function turnOnOffButton(v){// on and off switch button function to dim/light up the color buttons\n if (v===1) {\n for(var b=1; b<=4; b++){\n $('#'+b).css(\"opacity\", \"1\"); }\n }\n\n if (v===0){\n for(var b=1; b<=4; b++){\n $('#'+b).css(\"opacity\", \"0.6\");\n }\n }\n } // end of turn on and off", "title": "" }, { "docid": "f2e1ac15ce3ca0cdc287db55a42b29d2", "score": "0.6112899", "text": "function checkedSwitch() {\n if (isChecked == false) {\n disableButton(start);\n disableButton(pause);\n disableButton(reset);\n } else {\n enableButton(start);\n }\n}", "title": "" }, { "docid": "0b230f6f1ed1f1a283905b7d3592539f", "score": "0.61102235", "text": "function toggleVolBtn() {\n\tif (PLAYER.type==\"yt\" || PLAYER.type==\"dm\") {\n\t\t$_voldownbtn.show();\n\t\t$_volupbtn.show();\n\t} else {\n\t\t$_voldownbtn.hide();\n\t\t$_volupbtn.hide();\n\t}\n}", "title": "" }, { "docid": "7a043d674850c4b5a81b04338ea149ca", "score": "0.61025953", "text": "function toggleRollDiceButton(con){\n\tbuttonRollDisabled.visible = buttonRoll.visible = false;\n\t\n\tif(con == 'ready'){\n\t\tbuttonRoll.visible = true;\n\t}else if(con == 'notready'){\n\t\t//if(history_arr.length == 0)\n\t\t\tbuttonRollDisabled.visible = true;\n\t}\n}", "title": "" }, { "docid": "666f2b64412b4629a4081c612dca07a4", "score": "0.60955817", "text": "function changeBtns(p) {\n if (p == 2) {\n $('#info').css('visibility', 'visible');\n $('#kamera').css('visibility', 'visible');\n\n }\n if (p == 1) {\n $('#backBtn').css('transform', 'scaleX(1)');\n $('#filter').css('visibility', 'visible');\n $('#info').css('visibility', 'hidden');\n $('#kamera').css('visibility', 'hidden');\n $('.tower').css('visibility', 'visible');\n }\n if (!p) {\n $('#backBtn').css('transform', 'scaleX(-1)');\n $('#filter').css('visibility', 'hidden');\n $('#info').css('visibility', 'hidden');\n $('#kamera').css('visibility', 'hidden');\n $('.tower').css('visibility', 'hidden');\n }\n }", "title": "" }, { "docid": "d32cb0dd42d675bc5feebe0b493c3a45", "score": "0.6081638", "text": "function sideButtons(opt, onoff) {\n\n var toolbar = opt.topcontainer.find('.toolbar');\n if (onoff == \"none\") {\n toolbar.css({'visibility': \"hidden\"});\n } else {\n toolbar.css({'visibility': \"visible\"});\n }\n\n\n }", "title": "" }, { "docid": "3fa68be0b091f8f229a00960e9a9b081", "score": "0.6075753", "text": "[updateButtons]() {\n\t\t\tconst self = this;\n\t\t\tconst _self = _(self);\n\n\t\t\tif (!self.isRemoved && self.showButtons()) {\n\t\t\t\t_self.controls.get(PREV_BUTTON_ID).isVisible(!_self.isAtStart());\n\t\t\t\t_self.controls.get(NEXT_BUTTON_ID).isVisible(!_self.isAtEnd());\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4b68df86d771973dd2fac2b98c4f4f9e", "score": "0.6033215", "text": "function toggleVehicleInfo() {\n setVehicleTogggleOne(!vehicleTogggleOne);\n var toggleArrow = document.getElementById('ez-chat-vdp-tog-one');\n if (vehicleTogggleOne === false) {\n toggleArrow.setAttribute('class', 'svg-inline--fa fa-caret-up fa-w-10 ez-chat-vdp-toggle-icon ez-chat-vdp-toggle-icon-closed');\n } else if (vehicleTogggleOne === true) {\n toggleArrow.removeAttribute('class', 'ez-chat-vdp-toggle-icon-closed');\n toggleArrow.setAttribute('class', 'svg-inline--fa fa-caret-up fa-w-10 ez-chat-vdp-toggle-icon');\n }\n }", "title": "" }, { "docid": "16dc7eef572f746a6e5328fff5d85956", "score": "0.6014929", "text": "toggle() {\n this.secondaryBtnObj.toggle();\n }", "title": "" }, { "docid": "bd6419b7ba00583a2a54ce2f12fbb82c", "score": "0.6011358", "text": "function toggleButtons() {\n\t\t\tvar $carouselWindow = $('.' + settings.wrapperClass),\n\t\t\t\t$controls = $carouselWindow.find('.carousel-control');\n\t\t\t$controls.each(function () {\n\t\t\t\tif (currentGroup == 0) {\n\t\t\t\t\t$controls.removeClass('inactive');\n\t\t\t\t\t$carouselWindow.find('.carousel-left').addClass('inactive');\n\t\t\t\t}\n\t\t\t\telse if (currentGroup != 0 && currentGroup != groupCount - 1) {\n\t\t\t\t\t$controls.removeClass('inactive');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$controls.removeClass('inactive');\n\t\t\t\t\t$carouselWindow.find('.carousel-right').addClass('inactive');\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetActivePage();\n\t\t}", "title": "" }, { "docid": "57ba313971416996b821cb5d63b18001", "score": "0.59538174", "text": "function setButtons() {\n\tif (variables.action !== \"idle\") {\n\t\tlockButtons();\n\t\tif (variables.action == \"video1\") {\n\t\t\t$(\"#btVideo\").attr(\"Value\", \"Recording\");\n\t\t} else if (variables.action == \"video1\") {\n\t\t\t$(\"#btVideo\").attr(\"Value\", \"Editing\");\n\t\t}\n\t}\n\tfor ( var i = 1; i < variables.timer.length; i++) {\n\t\tif (variables.timer[i] > 0) {\n\t\t\t$(\"#btEat\"+ (i - 1)).attr(\"disabled\", \"disabled\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6072b06263df3006d5bd54e208c948f3", "score": "0.5949667", "text": "function restartButtonStatus() {\n elButton.disabled = true\n elButtonHold.disabled = true\n elButtonStart.disabled = true\n elButtonShuffle.disabled = false\n}", "title": "" }, { "docid": "8239af7a23e1174b53944b7063009181", "score": "0.59452164", "text": "function toggle() {\n if (isInit) {\n if (isInState) disableState(btn, wrapper);\n else enableState(btn, wrapper, a11yText);\n }\n }", "title": "" }, { "docid": "533960d2a314cdea49d84a3e72709d9b", "score": "0.59420514", "text": "function setupToggleButtons() {\n const buttons = document.querySelectorAll('.toggle-button');\n buttons.forEach((button) => {\n button.addEventListener('click', () => {\n const nextEl = button.nextElementSibling;\n nextEl.hidden = !nextEl.hidden;\n });\n });\n}", "title": "" }, { "docid": "35206cdc90f9e007ac9222a5533b87fc", "score": "0.5927091", "text": "function radioModes() {\r\n levelButton.sendValue(controlMode === ControlModes.VOLUME || controlMode === ControlModes.PAN ? 127 : 0);\r\n auxButton.sendValue(controlMode === ControlModes.AUX ? 127 : 0);\r\n deviceButton.sendValue(controlMode === ControlModes.DEVICE || controlMode === ControlModes.MIDI_CC ? 127 : 0);\r\n macrcoButton.sendValue(controlMode === ControlModes.MACRO ? 127 : 0);\r\n }", "title": "" }, { "docid": "f7654af1e7ab01899983aae722604d44", "score": "0.59263974", "text": "function toggleControls(n){\r\n\t\tswitch(n){\r\n\t\t\tcase \"on\":\r\n\t\t\t\te('comicForm').style.display = \"none\";\r\n\t\t\t\te('clearData').style.display = \"inline\";\r\n\t\t\t\te('displayData').style.display = \"none\";\r\n\t\t\t\te('addNew').style.display = \"inline\";\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"off\":\r\n\t\t\t\te('comicForm').style.display = \"block\";\r\n\t\t\t\te('clearData').style.display = \"inline\";\r\n\t\t\t\te('displayData').style.display = \"inline\";\r\n\t\t\t\te('addNew').style.display = \"none\";\r\n\t\t\t\te('items').style.display = \"none\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7a2252d31a5a20d6d263c941479617fe", "score": "0.59180725", "text": "enableVehicleButtons(){\n document.getElementById('sidehud').classList.toggle('show-garage', true);\n }", "title": "" }, { "docid": "bceefb519e39d69667c5556943f95240", "score": "0.5911574", "text": "toggleButtons() {\n document.getElementById(\"newPinboard\").style.visibility = \"hidden\";\n document.getElementById(\"newPostIt\").style.visibility = \"visible\";\n }", "title": "" }, { "docid": "977739b4ef8d30d9f6e60712fed0f93e", "score": "0.5887641", "text": "function buttonsOff (){\n buttonOne.disabled = true;\n buttonTwo.disabled = true;\n buttonThree.disabled = true;\n buttonFour.disabled = true;\n}", "title": "" }, { "docid": "62e21433015bf286ba61ca73bb1f30ea", "score": "0.5880137", "text": "function toggleButtons(forceOn, otherPage ){\n forceOn = typeof forceOn !== 'undefined' ? forceOn : false\n otherPage = typeof otherPage !== 'undefined' ? otherPage : !window.batch_part_on_other_page;\n var n = $(\".batch_document_selector:checked\").length;\n if ((n>0) || (forceOn)) {\n $('.batch-toggle').show();\n $('.batch-select-all').removeClass('hidden');\n $('#batch-edit').removeClass('hidden');\n } else if ( otherPage){\n $('.batch-toggle').hide();\n $('.batch-select-all').addClass('hidden');\n $('#batch-edit').addClass('hidden');\n }\n $(\"body\").css(\"cursor\", \"auto\");\n }", "title": "" }, { "docid": "9756f79822b2fe95aa0e4d9b90ce597a", "score": "0.586969", "text": "function toggle(temp) {\n var maxallow = getallow();\n // check if answer has been selected or not\n var buttonis = astatus[temp];\n console.log(\"top: The button status of\" + temp + \" is \" + buttonis);\n\n\n\n\n if (allow > 0) {\n // can make a choice\n if (window[\"astatus\" + temp] == \"on\") {\n console.log(\"apples\");\n // turn off\n answercount--;\n allow++;\n window[\"astatus\" + temp] = \"off\";\n $(\"#answer\" + temp).toggleClass(\"purple\");\n // adjust allow\n allow = maxallow - 1;\n // fix\n fixval();\n //updateAnswers(answers[qcount][temp - 1]);\n\n\n } else {\n console.log(\"bananas\");\n // turn on\n answercount++;\n allow--;\n window[\"astatus\" + temp] = \"off\";\n $(\"#answer\" + temp).toggleClass(\"purple\");\n // fix\n fixval();\n //updateAnswers(answers[qcount][temp - 1]);\n }\n\n }\n // end if allow > 0 \n // choices used can only do something if click off other item\n else {\n if (window[\"astatus\" + temp] == \"on\") {\n answercount--;\n allow++;\n window[\"astatus\" + temp] = \"off\";\n $(\"#answer\" + temp).toggleClass(\"purple\");\n // fix\n fixval();\n //updateAnswers(answers[qcount][temp - 1]);\n\n console.log(\"pears\");\n\n\n } else {\n if (buttonis == \"off\") {\n $(\"#answer\" + temp).toggleClass(\"purple\");\n // other two off?\n console.log(\"dogs\");\n allow++;\n answercount--;\n // fix\n fixval();\n // updateAnswers(answers[qcount][temp]);\n } else {\n\n\n\n console.log(\"cats\");\n }\n console.log(\"grapes\");\n\n\n }\n\n\n\n\n }\n\n\n }", "title": "" }, { "docid": "47936da384a52d1e9c3a60c066fa17da", "score": "0.5869653", "text": "function toggle_buttons(){\n\tvar str_visibility = document.getElementById(\"btn-menu-icon\").className;\n\tvar visibility;\n\tif(str_visibility === \"fa fa-bars w3-large\"){visibility = 0;}else{visibility = 1;}\n\tvar btn_menu_icon = document.getElementById(\"btn-menu-icon\");\n\tvar x = document.getElementsByClassName(\"round-btn\");\n\tif(visibility === 0){\n\t\tbtn_menu_icon.className = \"fa fa-times fa-2x\";\n\t\tfor(i=0; i<x.length; i++){\n\t\t\tsetTimeout(show_btn, (i*100), x[i], 2);\n\t\t}\n\t}else{\n\t\tbtn_menu_icon.className = \"fa fa-bars w3-large\";\n\t\tfor(i=0; i<x.length; i++){\n\t\t\tsetTimeout(hide_btn, ((x.length-1)*100 - i*100), x[i], 40);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b6dc208a6c53086d023420c56a9a941", "score": "0.58648044", "text": "function disabledButtonToggle( toggleArray ) {\n\n if (toggleArray[0]) {\n // determine starting button state -\n toggleArray[1] = $(\"button[name=undo]\").prop(\"disabled\");\n toggleArray[2] = $(\"button[name=erase]\").prop(\"disabled\");\n\n if (toggleArray[1]) {\n $(\"button[name=undo]\").prop(\"disabled\", false);\n }\n if (toggleArray[2]) {\n $(\"button[name=erase]\").prop(\"disabled\", false);\n }\n\n } else {\n // reset the original button state -\n $(\"button[name=undo]\").prop(\"disabled\", toggleArray[1]);\n $(\"button[name=erase]\").prop(\"disabled\", toggleArray[2]);\n }\n}", "title": "" }, { "docid": "12dbc2ca2ef0ee651c7bf59429555326", "score": "0.5861117", "text": "function setMoveButtons(radioGroup,upBtn,dnBtn)\n{\n var checkIdx = getRadioSelectedIndex(radioGroup);\n upBtn.disabled=false;\n dnBtn.disabled=false;\n //No button checked or only one button\n if ( checkIdx == -1 || !radioGroup.length)\n {\n upBtn.disabled=true;\n dnBtn.disabled=true;\n }\n //Top button \n else if ( checkIdx == 0 )\n {\n upBtn.disabled=true;\n }\n //Bottom button\n else if ( checkIdx == radioGroup.length -1 )\n {\n dnBtn.disabled=true;\n }\n\n}", "title": "" }, { "docid": "7cf1f567bda23eea87c615b105fbb620", "score": "0.5846356", "text": "function changeMainButtons() {\n\t\tif($(\".personal\")[0] || $(\".history\")[0] || $(\".checkout\")[0]) {\n\t\t\tif(!mobile) $(\".autorit\").css(\"display\", \"none\");\n\t\t\tif($(window).innerWidth() < 479) $(\".search-group\").css(\"display\", \"none\");\n\t\t\tif($(window).innerWidth() < 400) $(\".likebuy-btn\").css(\"display\", \"none\");\n\t\t\t$(\".menu2\").css(\"display\", \"flex\");\n\t\t}\n\t}", "title": "" }, { "docid": "05363e0d9c14edb417fa220175b5e6fd", "score": "0.5819896", "text": "function handleButToggleClick(basectlsref) {\n\tvar alt;\n\n\tif (retrieveSi(srcdoc, \"StatAppBrlyPtyDetail\", basectlsref + \"Alt\") == \"true\") alt = \"false\"; else alt = \"true\";\n\tsetSi(srcdoc, \"StatAppBrlyPtyDetail\", basectlsref + \"Alt\", alt);\n\n\trefresh();\n}", "title": "" }, { "docid": "a7a0a0494d855826f2c26c9f52c5202f", "score": "0.5798807", "text": "function setButtons() {\n hitButton.disabled = false;\n standButton.disabled = false;\n continueButton.disabled = true;\n }", "title": "" }, { "docid": "7e58963d8bc710a3e3f0378d3bf6eb00", "score": "0.57974106", "text": "ensureButtonsHidden() {\n // TODO(fanlan1210)\n }", "title": "" }, { "docid": "5902d17c31506297da47f777b43f9a85", "score": "0.5795929", "text": "function ResetButtons(){\r\n\t\tif (resourceCount < resourcesForExplosion){\r\n\t\t\t$btnExplode.off();\r\n\t\t\t$btnExplode.addClass('disabled');\r\n\t\t}\r\n\t\t\r\n\t\tif (resourceCount < resourcesForAging){\r\n\t\t\t$btnAge.off();\r\n\t\t\t$btnAge.addClass('disabled');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5ceaf0959349b1a0c21b0da308e7981b", "score": "0.5789062", "text": "function toggleBtn(){\n jokeBtn.disabled = !jokeBtn.disabled;\n }", "title": "" }, { "docid": "34b8882add85e21a29c04349f5574d38", "score": "0.5781384", "text": "function toggleControls(n) {\n switch(n) {\n case \"on\":\n $(\"eventForm\").style.display = \"none\";\n $(\"clearData\").style.display = \"inline\";\n $(\"displayData\").style.display = \"none\";\n $(\"addNew\").style.display = \"inline\";\n break;\n case \"off\":\n $(\"eventForm\").style.display = \"block\";\n $(\"clearData\").style.display = \"inline\";\n $(\"displayData\").style.display = \"inline\";\n $(\"addNew\").style.display = \"none\";\n $(\"items\").style.display = \"none\";\n break;\n default:\n return false;\n } \n }", "title": "" }, { "docid": "04f3e044a718db41f057fb09dffccba8", "score": "0.5774727", "text": "function updateButtons(){\n\tfor (var b = 0; b < allButtons.length;b++){\n\t\tif (showControls){\n\t\t\tallButtons[b].show();\n\t\t} else {\n\t\t\tallButtons[b].hide();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "476d4bd5827d0a20daffb9c5b801a305", "score": "0.5766362", "text": "function toggleToolbar() {\n var options = [\n '#circleDrawType',\n '#triangleDrawType',\n '#rectDrawType',\n '#lineDrawType',\n '#freeDrawType',\n '#eraserDrawType',\n ]; \n options.map(function(option){ \n if($(option)[0].className.includes('active')){\n $(option).button('toggle');\n }\n });\n \n }", "title": "" }, { "docid": "9e6ff555fc20ff9f26470d9109cb2842", "score": "0.57658345", "text": "function foodbakery_getting_startrd() {\n if (jQuery(\"#foodbakery_header_buton_switch\").val() == 'on') {\n jQuery(\"#header_button_title\").show();\n jQuery(\"#header_button_url\").show();\n jQuery(\"#foodbakery_head_btn\").show();\n } else {\n jQuery(\"#foodbakery_head_btn\").hide();\n jQuery(\"#header_button_title\").hide();\n jQuery(\"#header_button_url\").hide();\n }\n}", "title": "" }, { "docid": "ca878487129ecdbf34ceaab4847257a2", "score": "0.57655746", "text": "function CCROtoggle() {\r\n\tif( CCROsettings.toggle == 1 ) {\r\n\t\tCCROsettings.toggle = 0;\r\n\r\n\t\tjQuery(\".CCROoverlayui\").addClass('collapsed');\r\n\r\n\t\tjQuery('.CCROv-toggle').text('+');\r\n\t}\r\n\r\n\telse { \r\n\t\tCCROsettings.toggle = 1;\r\n\r\n\t\tjQuery(\".CCROoverlayui\").removeClass('collapsed');\r\n\r\n\t\tjQuery('.CCROv-toggle').text('-');\r\n\t}\r\n\r\n\tCCROsaveSettings();\r\n}", "title": "" }, { "docid": "75cb74466c1f8b84a374cdfc3fa286de", "score": "0.57638955", "text": "function hideButtons(){\r\nwin.setRightNavButton();\r\nwin.setLeftNavButton();\r\n}", "title": "" }, { "docid": "adb279eb2f8b32883fbcb399dc06e439", "score": "0.575834", "text": "function shuffleBtnHandler() {\n if (!hasShuffle) {\n setShuffleVal('ON');\n setShuffle(true);\n } else {\n setShuffleVal('OFF');\n setShuffle(false);\n }\n return;\n }", "title": "" }, { "docid": "4ddf0b004461c562ff2ffecd6ea57186", "score": "0.5758033", "text": "toggle() {\n return this._sendCommand({\n method: 'toggle',\n params: []\n })\n }", "title": "" }, { "docid": "bb076dd9d0b994791050cafb671a0f02", "score": "0.5753726", "text": "_handleDisablingSSTBtn() {\n let noAvailableState = true;\n SSTButtonStates.forEach(SSTBtnState => {\n if (this.state[SSTBtnState]) noAvailableState = false;\n });\n\n if (noAvailableState)\n this.panel.SSTBtn.disable();\n else\n this.panel.SSTBtn.enable();\n }", "title": "" }, { "docid": "8a12ee737e138d5435f661ae9d5d3abf", "score": "0.575073", "text": "btcarvisiblefalse(){\n btyellowc.visible=false;\n btredc.visible=false;\n btwhitec.visible=false;\n btblackc.visible=false;\n btbluec.visible=false;\n btgreenc.visible=false; \n }", "title": "" }, { "docid": "ada2cfcecf1da7a51010560dceb8e4eb", "score": "0.5740242", "text": "_toggleDisableUI(){\n const buttonFight = document.querySelector(\"#generateFight\");\n const buttonRandomFight = document.querySelector(\"#randomFight\");\n //ako je toggle true onda je enabled sve, pa se mora disable-at i obrnuto\n if(this.toggle){\n buttonFight.disabled = true;\n buttonRandomFight.disabled = true;\n //.pointerEvents gasi/pali on click evente za elemente koje nisu tipke\n this.fighter_list_left.forEach(element => {\n element.style.pointerEvents = 'none';\n element.style.opacity = '0.75';\n });\n this.fighter_list_right.forEach(element => {\n element.style.pointerEvents = 'none';\n element.style.opacity = '0.75';\n });\n this.toggle = !(this.toggle);\n }\n else{\n buttonFight.disabled = false;\n buttonRandomFight.disabled = false;\n this.fighter_list_left.forEach(element => {\n element.style.pointerEvents = 'auto';\n element.style.opacity = '1';\n });\n this.fighter_list_right.forEach(element => {\n element.style.pointerEvents = 'auto';\n element.style.opacity = '1';\n });\n this.toggle = !(this.toggle);\n }\n }", "title": "" }, { "docid": "c2e4b5999b44faedb4b6b39ca9814baa", "score": "0.573753", "text": "toggleControls(toToggle) {\n let bytes = [0, 0, 0, 0];\n\n toToggle.forEach((s) => {\n var mask;\n const bitPosition = controlMap.fromName(s);\n mask |= (0x01 << bitPosition);\n const whichByte = Math.floor(bitPosition / 8);\n bytes[whichByte] |= ((mask >> (whichByte * 8)) & 0xff);\n });\n\n // write bytes to buffer\n for (let byte = 0; byte < 4; byte++)\n {\n this.frame.writeUInt8(bytes[byte], 8 - byte); // locations: 8, 7, 6, 5 (highest location is lowest byte in block)\n this.frame.writeUInt8(bytes[byte], 12 - byte); // locations 12, 11, 10, 9 (ditto)\n }\n logger.debug('created control message:', this.asString(), this.prettyBits(1));\n }", "title": "" }, { "docid": "a0a1fda04546bd807a69a3a30d118e2a", "score": "0.572944", "text": "function SetButtons(){\r\n\t\tif (resourceCount >= resourcesForExplosion){\r\n\t\t\t$btnExplode.off();\r\n\t\t\t$btnExplode.on('click', Explode);\r\n\t\t\t$btnExplode.removeClass('disabled');\r\n\t\t}\r\n\t\t\r\n\t\tif (resourceCount >= resourcesForAging){\r\n\t\t\t$btnAge.off();\r\n\t\t\t$btnAge.on('click', Age);\r\n\t\t\t$btnAge.removeClass('disabled');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1d301428a4af7e27c3741663f12ca041", "score": "0.57272893", "text": "function updateButton(){\r\n\tif (god_roundover === false) {\r\n\t\tdocument.getElementById('showroundon').style.display = \"block\";\r\n\t\tdocument.getElementById('showroundoff').style.display = \"none\";\r\n\t} else {\r\n\t\tdocument.getElementById('showroundoff').style.display = \"block\";\r\n\t\tdocument.getElementById('showroundon').style.display = \"none\";\r\n\t}\r\n}", "title": "" }, { "docid": "0bee7397c3ee9e79e26656e58a177c33", "score": "0.57178825", "text": "function toggleClearBtn() {\n\thasPermission(\"playlistclear\") ? $_clearbtn.show() : '$_clearbtn.hide()';\n}", "title": "" }, { "docid": "1666627fead3ddf62216c59c6b617b28", "score": "0.5714556", "text": "function toggleArmorTab(){\n // Flip flag\n armorOpen = !armorOpen; \n\n let resultsSec = document.getElementById(\"results-section\");\n let charmSec = document.getElementById(\"charms-section\");\n let armorSec = document.getElementById(\"armor-section\");\n // Render accordingly\n if(armorOpen){\n charmsOpen = false;\n // toggleButton.innerText = \"Hide\";\n resultsSec.style.display = \"none\";\n charmSec.style.display = \"none\";\n armorSec.style.display = \"flex\";\n } else{\n // toggleButton.innerText = \"Show\";\n resultsSec.style.display = \"flex\";\n charmSec.style.display = \"none\";\n armorSec.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "c4513318e890fb65c8229473ef931e01", "score": "0.57138747", "text": "function toggleButtonFunction(type){\n if(self.toggle[type].selected == \"mode\"){\n self.toggle[type].margin = -41;\n self.toggle[type].selected = \"source\";\n }\n else\n {\n self.toggle[type].margin = 0;\n self.toggle[type].selected = \"mode\";\n }\n\n Orders.toggle = self.toggle;\n }", "title": "" }, { "docid": "eaff366070fd633e9f038454c89944f9", "score": "0.57105416", "text": "function toggleButtons() {\n if (canPlay == false) {\n document.getElementById(\"green\").disabled = true;\n document.getElementById(\"red\").disabled = true;\n document.getElementById(\"yellow\").disabled = true;\n document.getElementById(\"blue\").disabled = true;\n //console.log(\"buttons are disabled\");\n } else if (canPlay == true) {\n document.getElementById(\"green\").disabled = false;\n document.getElementById(\"red\").disabled = false;\n document.getElementById(\"yellow\").disabled = false;\n document.getElementById(\"blue\").disabled = false;\n //console.log(\"buttons are enabled\");\n }\n}", "title": "" }, { "docid": "4d1d22f10e66dbadcfff0f5d8665c8b0", "score": "0.5697846", "text": "function enableButtons() {\n $j(\"#open_item\").removeClass(\"disabled\");\n $j(\"#open_item\").addClass(\"enabled\");\n $j(\"#go_to_item_location\").removeClass(\"disabled\");\n $j(\"#go_to_item_location\").addClass(\"enabled\");\n }", "title": "" }, { "docid": "2e4f6caf1fd1abd8e3074709d9d40c35", "score": "0.5697599", "text": "function toggle() {\n if (outputMode === 1) {\n outputMode = 2;\n toggleButton.innerHTML = 'NO ILLITERATION'\n } else {\n outputMode = 1;\n toggleButton.innerHTML = 'ILLITERATION'\n }\n}", "title": "" }, { "docid": "cf52c2e30c70923c29c0daee9a0d0e92", "score": "0.5697158", "text": "function updateButtons() {\n // if >= 20 score, button 1 & 3 are enabled\n if (score >= 20) {\n $btn1.button(\"enable\");\n $btn3.button(\"enable\");\n } else {\n // otherwise disable them\n $btn1.button(\"disable\");\n $btn3.button(\"disable\");\n }\n // if >= 20 score or button 2 has not been pressed, it is enabled\n if (score >= 20 && !canGoOffWindow) {\n $btn2.button(\"enable\");\n } else {\n $btn2.button(\"disable\");\n }\n}", "title": "" }, { "docid": "ff23ba87ed65f03001a274e3e9fe14a1", "score": "0.56970894", "text": "function toggle(value) {\n state = value;\n console.log(state);\n switch (value) {\n case 'intro':\n introContainer.classList.add('active');\n introContainer.classList.remove('hide');\n testContainer.classList.remove('active');\n textContainer.classList.remove('active');\n ratingContainer.classList.remove('active');\n binsContainer.classList.remove('active');\n startBtn.disabled = true;\n restartBtn.disabled = true;\n controlsContainer.classList.remove('active');\n break;\n case 'test':\n introContainer.classList.remove('active');\n introContainer.classList.add('hide');\n testContainer.classList.add('active');\n textContainer.classList.remove('active');\n ratingContainer.classList.add('active');\n binsContainer.classList.remove('active');\n controlsContainer.classList.add('active');\n if (modelReadyB) {\n startBtn.disabled = false;\n restartBtn.disabled = false;\n };\n break;\n case 'bins':\n introContainer.classList.remove('active');\n introContainer.classList.add('hide');\n testContainer.classList.remove('active');\n textContainer.classList.remove('active');\n ratingContainer.classList.add('active');\n binsContainer.classList.add('active');\n controlsContainer.classList.add('active');\n\n positiveText.classList.add('hide');\n negativeText.classList.add('hide');\n positiveEmoji.classList.remove('hide');\n negativeEmoji.classList.remove('hide');\n\n //fix rating when toggling\n if (score) {\n animatePercentage(positiveEmojiPercentage, positive);\n animatePercentage(negativeEmojiPercentage, negative);\n negativePercent.style.left = positiveEmojiPercentage+'%';\n } else {\n animatePercentage(50, positive);\n animatePercentage(50, negative);\n negativePercent.style.left = 50+'%';\n }\n\n if (modelReadyB) {\n startBtn.disabled = false;\n restartBtn.disabled = false;\n };\n break;\n case 'text':\n introContainer.classList.remove('active');\n introContainer.classList.add('hide');\n testContainer.classList.remove('active');\n textContainer.classList.add('active');\n ratingContainer.classList.add('active');\n binsContainer.classList.remove('active');\n controlsContainer.classList.add('active');\n\n positiveText.classList.remove('hide');\n negativeText.classList.remove('hide');\n positiveEmoji.classList.add('hide');\n negativeEmoji.classList.add('hide');\n\n //fix rating when toggling\n if (allWords.length != 0) {\n analyseSentiment(allWords);\n } else {\n animatePercentage(50, positive);\n animatePercentage(50, negative);\n negativePercent.style.left = 50+'%';\n }\n \n if (modelReadyB) {\n startBtn.disabled = false;\n restartBtn.disabled = false;\n };\n break;\n }\n}", "title": "" }, { "docid": "a1da4ba4e37da908cb57fd47789b695c", "score": "0.56931716", "text": "function handleButToggleClick(basectlsref) {\n\tvar alt;\n\n\tif (retrieveSi(srcdoc, \"StatAppPlnrDvcDetail\", basectlsref + \"Alt\") == \"true\") alt = \"false\"; else alt = \"true\";\n\tsetSi(srcdoc, \"StatAppPlnrDvcDetail\", basectlsref + \"Alt\", alt);\n\n\trefresh();\n}", "title": "" }, { "docid": "7d7bf6ae63b91743a1d38c6196804e77", "score": "0.5687068", "text": "function toggleButton() {\n leftPosition == 0 ? arrowLeft.hide() : arrowLeft.show();\n Math.abs(leftPosition) >= innerBoxWidth - containerWidth ? arrowRight.hide() : arrowRight.show();\n }", "title": "" }, { "docid": "67d82887d743ecedf83145de3ac530fb", "score": "0.5686371", "text": "getManagedButtons() {\n const elements = this.getElementsOfSlot();\n return elements.filter(element => element instanceof Button && element.toggles);\n }", "title": "" }, { "docid": "1bfd284474319c05e193e9b030fbb881", "score": "0.5685831", "text": "function toggleButton() {\n button.current.disabled = !button.current.disabled;\n }", "title": "" }, { "docid": "34927a362925f38e4a769215281a9578", "score": "0.56818396", "text": "function button(){\r\n var date = getdate();\r\n\tvar toggle_hr = document.getElementById('switch-container-hr');\r\n var toggleContainer_hr = document.getElementById('switch-toggle-container-hr');\r\n var toggleNumber_hr;\r\n toggle_hr.addEventListener('click', function() {\r\n toggleNumber_hr = !toggleNumber_hr;\r\n if (toggleNumber_hr) {\r\n toggleContainer_hr.style.WebkitClipPath = 'inset(0 0 0 50%)';\r\n toggleContainer_hr.style.backgroundColor = '#D74046';\r\n } else {\r\n toggleContainer_hr.style.WebkitClipPath = 'inset(0 50% 0 0)';\r\n toggleContainer_hr.style.backgroundColor = 'dodgerblue';\r\n }\r\n console.log(toggleNumber_hr);\r\n getdata(\"hr_value\", !toggleNumber_hr, date);\r\n });\r\n\r\n\r\n // var toggle_ox = document.getElementById('switch-container-ox');\r\n // var toggleContainer_ox = document.getElementById('switch-toggle-container-ox');\r\n // var toggleNumber_ox; //0 day 1 week\r\n // toggle_ox.addEventListener('click', function() {\r\n // toggleNumber_ox = !toggleNumber_ox;\r\n // if (toggleNumber_ox) {\r\n // toggleContainer_ox.style.clipPath = 'inset(0 0 0 50%)';\r\n // toggleContainer_ox.style.backgroundColor = '#D74046';\r\n // } else {\r\n // toggleContainer_ox.style.clipPath = 'inset(0 50% 0 0)';\r\n // toggleContainer_ox.style.backgroundColor = 'dodgerblue';\r\n // }\r\n // console.log(toggleNumber_ox);\r\n // getdata(\"o2_value\", !toggleNumber_ox, date);\r\n // });\r\n\r\n // var toggle_st = document.getElementById('switch-container-st');\r\n // var toggleContainer_st = document.getElementById('switch-toggle-container-st');\r\n // var toggleNumber_st; //0 day 1 week\r\n // toggle_st.addEventListener('click', function() {\r\n // toggleNumber_st = !toggleNumber_st;\r\n // if (toggleNumber_st) {\r\n // toggleContainer_st.style.clipPath = 'inset(0 0 0 50%)';\r\n // toggleContainer_st.style.backgroundColor = '#D74046';\r\n // } else {\r\n // toggleContainer_st.style.clipPath = 'inset(0 50% 0 0)';\r\n // toggleContainer_st.style.backgroundColor = 'dodgerblue';\r\n // }\r\n // console.log(toggleNumber_st);\r\n // getdata(\"step_value\", !toggleNumber_st, date);\r\n // });\r\n}", "title": "" }, { "docid": "23f1cf4369808c6096684909f988dd32", "score": "0.5681437", "text": "function changeButton() {\n if (props.playing) {\n props.toggleButton();\n }\n }", "title": "" }, { "docid": "a078d0c24c4c41e484332bd46861d5b3", "score": "0.5679385", "text": "function toggleLigandInfo(){\n //needs implementing\n}", "title": "" }, { "docid": "45dfb29629e7e2a6ca4815ceb4c6e9f7", "score": "0.567678", "text": "function toggleGameBalls(){\n\tif(playMode == true){\n\t\tif($(\".crosshairs\" ).css( \"display\") == \"none\"){\n\t\t\t$( \".crosshairs\" ).css( \"display\", \"block\" );\n\t\t\tdocument.getElementById(\"toggle_selection_view_button\").innerHTML = \"hide gameballs\";\n\t\t\tpermanentlyShowGameBalls = true;\n\t\t}else{\n\t\t\t$( \".crosshairs\" ).css( \"display\", \"none\" );\n\t\t\tdocument.getElementById(\"toggle_selection_view_button\").innerHTML = \"show gameballs\";\n\t\t\tpermanentlyShowGameBalls = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0ff6753e9d3c9204b7dc02243ba387d8", "score": "0.5667421", "text": "function switchOnOrOffFn(scope) { \n scope.switch_btn_label = scope.switch_on_off ? switch_on_btn_label : switch_off_btn_label; /** Change label :- 'Switch on/off light' */\n spectrometer_top_view_container.getChildByName(\"light\").alpha = scope.switch_on_off ? 0 : 1 ; /** 'Switch on/off light' */\n zoom_container.getChildByName(\"white_slit\").alpha = scope.switch_on_off ? 0 : 1;\n displaySlit(scope);/** Display slit */\n slitMovement(scope); /** Move the slit when the telescope rotate */ \n spectrometer_stage.update();/** Createjs stage updation happens */\n}", "title": "" }, { "docid": "370e9cf863423c6567b7f91b3cd02423", "score": "0.56644744", "text": "startToggle() {\n this.showRipple();\n }", "title": "" }, { "docid": "68f762a7fcfc219225386d5802428948", "score": "0.56635374", "text": "function toggleControls(){\n\t\t\t\t\t\t\t\t\n\t\tif(g_temp.isControlsVisible == false)\n\t\t\tshowControls();\n\t\telse\n\t\t\thideControls();\n\t}", "title": "" }, { "docid": "f1f22c64f7dc9e1ae578a442f2a69169", "score": "0.56635255", "text": "function toggleVolcanoes(){\n\tmap.closeInfoWindow();\n\tcount = 0;\n\tif(this.id ==\"plotVolcanoesTrue\"){\n\t\tplotVolcanoIcons = 1;\n\t\tplotVolcanoes();\n\t}else{\n\t\tplotVolcanoIcons = 0;\n\t\tfor (var i = 0; i<volcanomarker.length; i++){\n\t\t\tvolcanomarker[i].remove();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "59e10cfa48a5834ec65c0e9e3071cd20", "score": "0.56610155", "text": "function buttonsOn (){\n buttonOne.disabled = false;\n buttonTwo.disabled = false;\n buttonThree.disabled = false;\n buttonFour.disabled = false;\n}", "title": "" }, { "docid": "4b9473ce712514d8e638dab4aa5d13b4", "score": "0.5656708", "text": "toggleRightGraphButton(arrowRightDiv, arrowRight){\n if(this.nextReadingsAvailable()){\n arrowRightDiv.className = 'button';\n arrowRight.style.borderColor = 'black';\n arrowRightDiv.style.pointerEvents = 'auto';\n }\n else{\n arrowRightDiv.classname = 'disabledButton';\n arrowRight.style.borderColor ='#adb0b5';\n arrowRightDiv.style.pointerEvents = 'none';\n }\n }", "title": "" }, { "docid": "9a3af9e557ea0be24419ba161b36a20f", "score": "0.56443584", "text": "function changePlayer() {\n $(\"#rollBtn1\").toggle();\n $(\"#holdBtn1\").toggle();\n $(\"#rollBtn2\").toggle();\n $(\"#holdBtn2\").toggle();\n}", "title": "" }, { "docid": "e2355eaeb63d0c0fc3c2c83dc0f7d038", "score": "0.56432176", "text": "function btnStatus() {\n if(globalStatus == 0) {\n $('#btnToggle').text('Turn On');\n $('#btnToggle').removeClass().addClass('btn btn-block btn-dark');\n if(config.multi) {\n singleButton('Left', 0);\n singleButton('Right', 0);\n }\n } else {\n $('#btnToggle').text('Turn Off')\n $('#btnToggle').removeClass().addClass('btn btn-block btn-light');\n if(config.multi) {\n singleButton('Left', 1);\n singleButton('Right', 1);\n }\n }\n }", "title": "" }, { "docid": "9da2b39b0189653fc976db3ddd9ec9f9", "score": "0.5641385", "text": "function toggleCbs(cb) {\n\ncbHit = cb.id;\ncbHitFlag = cb.checked;\n\n // ** pass key reagent data to server to plot reagent vector\n var currentReagent = getEnumData(cbHit);\n // ** send: [unformatted name, formatted name, slope, checked-or-unchecked]\n var data = [currentReagent.name,currentReagent.cmpd,currentReagent.m,cbHitFlag];\n\n// Shiny.onInputChange(\"reagentData\", data);\n\n if(cbHitFlag) {\n\n cbChecked.push(cbHit);\n cbUnchecked.splice(cbUnchecked.indexOf(cbHit),1);\n\n if(cbHit == 'nahco3') {\n } else if(cbHit == 'na2co3') {\n document.getElementById('caco3').disabled=true;\n } else if(cbHit == 'naoh') {\n document.getElementById('caoh2').disabled=true;\n document.getElementById('cao').disabled=true;\n document.getElementById('hcl').disabled=true;\n } else if(cbHit == 'caco3') {\n document.getElementById('na2co3').disabled=true;\n } else if(cbHit == 'caoh2') {\n document.getElementById('naoh').disabled=true;\n document.getElementById('cao').disabled=true;\n document.getElementById('hcl').disabled=true;\n } else if(cbHit == 'cao') {\n document.getElementById('naoh').disabled=true;\n document.getElementById('caoh2').disabled=true;\n document.getElementById('hcl').disabled=true;\n } else if(cbHit == 'plusCo2') {\n document.getElementById('minusCo2').disabled=true;\n } else if(cbHit == 'minusCo2') {\n document.getElementById('plusCo2').disabled=true;\n } else if(cbHit == 'hcl') {\n document.getElementById('naoh').disabled=true;\n document.getElementById('cao').disabled=true;\n document.getElementById('caoh2').disabled=true;\n }\n\n } else {\n\n cbChecked.splice(cbChecked.indexOf(cbHit),1);\n cbUnchecked.push(cbHit);\n\n if(cbHit == 'nahco3') {\n } else if(cbHit == 'na2co3') {\n document.getElementById('caco3').disabled=false;\n } else if(cbHit == 'naoh') {\n document.getElementById('caoh2').disabled=false;\n document.getElementById('cao').disabled=false;\n document.getElementById('hcl').disabled=false;\n } else if(cbHit == 'caco3') {\n document.getElementById('na2co3').disabled=false;\n } else if(cbHit == 'caoh2') {\n document.getElementById('naoh').disabled=false;\n document.getElementById('cao').disabled=false;\n document.getElementById('hcl').disabled=false;\n } else if(cbHit == 'cao') {\n document.getElementById('naoh').disabled=false;\n document.getElementById('caoh2').disabled=false;\n document.getElementById('hcl').disabled=false;\n } else if(cbHit == 'plusCo2') {\n document.getElementById('minusCo2').disabled=false;\n } else if(cbHit == 'minusCo2') {\n document.getElementById('plusCo2').disabled=false;\n } else if(cbHit == 'hcl') {\n document.getElementById('naoh').disabled=false;\n document.getElementById('cao').disabled=false;\n document.getElementById('caoh2').disabled=false;\n }\n\n }\n\n// NB: Prefixed 'wq_map-' to conform to wq_map_module.R namespace\n Shiny.onInputChange(\"wq_map-checkedReagents\", cbChecked);\n\n maxReagentsLoop();\n}", "title": "" }, { "docid": "5457900f92e2dd1905be4222b8cfd780", "score": "0.56397766", "text": "onOffSwitch() {\n\t // click handler for switch button\n\t this.switchedOn = !this.switchedOn;\n }", "title": "" }, { "docid": "753c2e9656e8c984e777fe1bfbe992d2", "score": "0.56360805", "text": "function updateChangeStateButtons(toState)\n {\n // if multiple ui states are availble\n if ( settings.multipleUiStates )\n {\n // if is going to sidebar state\n if ( toState === \"sidebar\" )\n {\n // hide to sidebar button, show to dockable button\n $toSidebarButton.addClass(\"display-none\");\n $toDockableButton.removeClass(\"display-none\");\n }\n\n else if ( toState === \"dockable\" )\n {\n // hide to dockable button, show to sidebar button\n $toDockableButton.addClass(\"display-none\");\n $toSidebarButton.removeClass(\"display-none\");\n }\n }\n }", "title": "" }, { "docid": "39380a94866d17cdfbf70690be3c88ec", "score": "0.5634948", "text": "ensureButtonsShown() {\n // TODO(fanlan1210)\n }", "title": "" }, { "docid": "99630e40b8eb3ffccdd0dcdd197cc1eb", "score": "0.56323606", "text": "function refreshWidgetAndButtonStatus() {\n var curWidget = self.currentWidget();\n if (curWidget) {\n widgetArray[curWidget.index].isSelected(false);\n self.currentWidget(null);\n }\n self.confirmBtnDisabled(true);\n }", "title": "" }, { "docid": "64c81a4066596fbd1163c38e61ab8672", "score": "0.5631415", "text": "function onFlipDisabled() {\n $('#spot-check').checkboxradio('disable');\n }", "title": "" }, { "docid": "120b931ea36f15e57f90af8f9b355139", "score": "0.56229293", "text": "function infoPanelButtonAction () {\n\n $('.infoPanelSwitch').toggleClass('off on');\n if ($('.infoPanelSwitch').hasClass('on')) {\n $('.infoPanel').removeClass('open closed').addClass('open');\n } else {\n $('.infoPanel').removeClass('open closed').addClass('closed');\n }\n\n}", "title": "" }, { "docid": "efb8457f0ba0cde5bfc04c3fcf8f94bb", "score": "0.56186897", "text": "function toggleBT(){\n\tif(document.getElementById(\"buttonToggleBT\").innerHTML == \"Turn Bluetooth On\"){\n //EXAMPLE OF HOW TO CALL radlib object\n //DELETE ME after you understand\n\t\tradlib.test(dumpLog, dumpLog);\n\t\tdocument.getElementById(\"buttonToggleBT\").innerHTML = \"Turn Bluetooth Off\";\n\t}else{\n\t\tbluetoothScanner.turnOffBT(dumpLog, dumpLog);\n\t\tdocument.getElementById(\"buttonToggleBT\").innerHTML = \"Turn Bluetooth On\";\n\t}\n}", "title": "" }, { "docid": "1b0ba81bb602207c0e6e72232b3c7c66", "score": "0.5617124", "text": "function toggleButtons(btn){\n btn.toggleClass('btn-success');\n btn.toggleClass('btn-danger');\n btn.text(btn.hasClass('btn-success') ? 'Deactivate' : 'Activate');\n }", "title": "" }, { "docid": "6cec12f83a12a2a26fd031533ffec230", "score": "0.56156343", "text": "function powerOn() {\n setVisible(powerOffButton, true);\n setVisible(powerOnButton, false);\n fmRadio.start();\n }", "title": "" }, { "docid": "6cec12f83a12a2a26fd031533ffec230", "score": "0.56156343", "text": "function powerOn() {\n setVisible(powerOffButton, true);\n setVisible(powerOnButton, false);\n fmRadio.start();\n }", "title": "" }, { "docid": "fc6a06f94169c32e450a7a7e499c64b2", "score": "0.5615422", "text": "function toggleLights() {\n //First, change the value of the boolean\n lightsOn = !lightsOn;\n //Second, manage the items (I made with ternary functions, is the same than an if/else)\n document.body.style.backgroundColor = (lightsOn) ? '#fff' : '#333';\n document.body.style.color = (lightsOn) ? '#212529;' : '#999';\n card.style.backgroundColor = (lightsOn) ? '#fff' : '#444';\n toogleIcon.setAttribute('class', (lightsOn) ? 'fas fa-toggle-off' : 'fas fa-toggle-on');\n //We render the button with the new colors\n changeButtonColor();\n}", "title": "" }, { "docid": "37223c2e5be91cca3b02721fb4d68f23", "score": "0.560608", "text": "function enableCluster() {\n $(\"#radio\").buttonset({\n disabled: false\n });\n}", "title": "" }, { "docid": "cef4b2a64e3d6055800aa5d2119eccbc", "score": "0.5605711", "text": "getViewPreviousSeasonButton(){\n var actionType = this.state.isViewPreviousSeasons ? \"Hide\" : \"View\";\n return (\n <TouchableOpacity onPress={() => this.setState({isViewPreviousSeasons: !this.state.isViewPreviousSeasons})}>\n <Text style={[Styles.textSeasonName, {borderBottomColor: Colors.GREY, borderBottomWidth: 1, marginTop: 10}]}>{actionType} Previous Seasons</Text>\n </TouchableOpacity>\n )\n }", "title": "" }, { "docid": "5faf840f2e381933a11d4a73736ea5d0", "score": "0.56049937", "text": "function toggle_buttons(button) {\n var on_value = parseInt(sequence.getAttribute('data-'+button));\n\n if (isNaN(on_value))\n {\n var on_value = 1;\n var off_value = 0;\n }\n else\n {\n var off_value = (on_value + 1) % 2;\n }\n\n $('[data-toggle-name=\"'+button+'\"] [value='+ on_value+']').addClass('active');\n $('[data-toggle-name=\"'+button+'\"] [value='+off_value+']').removeClass('active');\n $('#'+button).val(on_value);\n }", "title": "" }, { "docid": "05ab488971ec0fb78ec144e3353a0f8c", "score": "0.5600514", "text": "function setButtonStatus() {\n\t\t// variables definition\n\t\tvar reTable = $(\".tbl-task-re .blockCheck\");\n\t\tvar btnAll = $(\"#btnSelectAll\");\n\t\tvar checkFlag = false;\n\t\tvar size = $(\".tbl-task-re .acRow\").length;\n\t\tbtnAll.removeClass(\"btn-disable\");\n\t\tif(size > 0) {\n\t\t\tfor(var i = 0; i < (reTable.length - 1); i ++) {\n\t\t\t\tvar statusFlagFirst = $(reTable[i]).is(':checked');\n\t\t\t\tvar statusFlagSecond = $(reTable[(i+1)]).is(':checked');\n\t\t\t\tif(statusFlagFirst != statusFlagSecond) {\n\t\t\t\t\tcheckFlag = true;\n\t\t\t\t}\n\t\n\t\t\t\tif(checkFlag) {\n\t\t\t\t\tbtnAll.text(STATUS_CHECK);\n\t\t\t\t\tbtnAll.removeClass(\"checkall\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tif(!checkFlag) {\n\t\t\t\tif($(reTable[0]).is(':checked')) {\n\t\t\t\t\tbtnAll.removeClass(\"btn-disable\");\n\t\t\t\t\tbtnAll.prop(\"disabled\", false);\n\t\t\t\t\tbtnAll.text(STATUS_UNCHECK);\n\t\t\t\t\tbtnAll.addClass(\"checkall\");\n\t\t\t\t} else {\n\t\t\t\t\tbtnAll.removeClass(\"btn-disable\");\n\t\t\t\t\tbtnAll.prop(\"disabled\", false);\n\t\t\t\t\tbtnAll.text(STATUS_CHECK);\n\t\t\t\t\tbtnAll.removeClass(\"checkall\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tbtnAll.text(STATUS_CHECK);\n\t\t\tbtnAll.addClass(\"btn-disable\");\n\t\t\tbtnAll.prop(\"disabled\", true);\n\t\t}\n\n\t\t// set Register button is disable\n\t\tsetButtonRegisterStatus();\n\t}", "title": "" }, { "docid": "8a7aad81c6daa072575bbc48a99d9891", "score": "0.5597054", "text": "function adjustButtons() {\n\ttooLeft = true;\n\tdocument.getElementById(\"ubarlightbuttonright\").style.zIndex = \"3\";\n\tscoreTooLeft = true;\n\tdocument.getElementById(\"scoreboardlightbuttonright\").style.zIndex = \"3\";\n\tstoriesTooLeft = true;\n\tdocument.getElementById(\"topstorieslightbuttonright\").style.zIndex = \"3\";\n\theadlinesTooLeft = true;\n\tdocument.getElementById(\"headlineslightbuttonright\").style.zIndex = \"3\";\n\ttopvideosTooLeft = true;\n\tdocument.getElementById(\"topvideoslightbuttonright\").style.zIndex = \"3\";\n}", "title": "" }, { "docid": "07b39a6e94fd70abc5dbbdb8c16622d5", "score": "0.55958915", "text": "function displayCompTurn(){\n $(\".myBtns\").prop('disabled', true);\n setTimeout(function(){\n for(var i = 0; i < series.length;i++){\n playButtons(series[i], i);\n }\n },600); \n $(\".myBtns\").prop('disabled', false);\n }", "title": "" }, { "docid": "aae14ac33de73972ac8afa704ed1fcaa", "score": "0.5595636", "text": "toggleControls() {\n this.setState({ showControls: !this.state.showControls });\n }", "title": "" }, { "docid": "a8ae6199ec990df601d8304b5cd71a40", "score": "0.5592893", "text": "function handleButToggleClick(basectlsref) {\n\tvar alt;\n\n\tif (retrieveSi(srcdoc, \"StatAppPlnrDgdDetail\", basectlsref + \"Alt\") == \"true\") alt = \"false\"; else alt = \"true\";\n\tsetSi(srcdoc, \"StatAppPlnrDgdDetail\", basectlsref + \"Alt\", alt);\n\n\trefresh();\n}", "title": "" }, { "docid": "5b9d6064471e762c9205c17928632af6", "score": "0.55920124", "text": "function togglemarkers() {\n var btnstate = document.getElementById(\"btntogmarkers\");\n // console.log(document.getElementById(\"btntogmarkers\").value);\n if (btnstate.value == \"0\") {\n for (var i=0; i<arrayslen; i++) {\n markers[i].setVisible(true);\n }\n btnstate.value = \"1\";\n btnstate.innerHTML = \"hide markers\";\n } else {\n for (var i=0; i<arrayslen; i++) {\n markers[i].setVisible(false);\n }\n btnstate.value = \"0\";\n btnstate.innerHTML = \"show markers\";\n // console.log(document.getElementById(\"btntogmarkers\").value);\n }\n togglemenu();\n }", "title": "" }, { "docid": "39008d82204dcd327264e174f2b2622b", "score": "0.55909866", "text": "activateButtons(){\n $('#render',parent.document).css('opacity','1').css('pointer-events','auto');\n $('#detail',parent.document).css('opacity','1').css('pointer-events','auto');\n $('#shadow',parent.document).css('opacity','1').css('pointer-events','auto');\n $('#save',parent.document).css('opacity','1').css('pointer-events','auto');\n }", "title": "" }, { "docid": "535d8daba277db28324c8e1421fad05d", "score": "0.5590715", "text": "function setToggles() {\n chrome.runtime.sendMessage({method: \"setItems\", object: toggles});\n }", "title": "" }, { "docid": "1bc641e8a326225c1255467059f613f9", "score": "0.55887574", "text": "function TogglePortDetailView()\n{\n var idAutomatic = document.getElementById('radioAutomatic');\n var idManual = document.getElementById('radioPttoPt');\n if (idAutomatic.checked == true) {\n document.getElementById('divSelectPort').style.display = 'none';\n document.getElementById('divPortButton').style.display = 'none';\n }\n if (idManual.checked == true) {\n document.getElementById('divSelectPort').style.display = 'block';\n document.getElementById('divPortButton').style.display = 'block';\n }\n}", "title": "" }, { "docid": "ab5c0bb361b6ea85c5cb7ebea21cce74", "score": "0.55886686", "text": "function setupButtons() {\n d3.selectAll('.btn-group')\n .selectAll('.btn')\n .on('click', function () {\n // set all buttons on the clicked toolbar as inactive, then activate the clicked button\n var p = d3.select(this.parentNode);\n p.selectAll('.btn').classed('active', false);\n d3.select(this).classed('active', true);\n\n // toggle\n if (p.attr('id')=='scale_toolbar') {\n myBubbleChart.toggleScale();\n } else if (p.attr('id')=='split_toolbar') {\n myBubbleChart.toggleDisplay();\n } else if (p.attr('id')=='color_toolbar') {\n myBubbleChart.toggleColor();\n } else if (p.attr('id')=='year_toolbar') {\n myBubbleChart.toggleYear();\n }\n });\n }", "title": "" } ]
588fe473ddc0af17d3eef8a311512844
O union "|" serve para dizer a uma var que ela pode ser de outros tipos. No exemplo abaixo temos o "uid" podendo ser number e string
[ { "docid": "8a99fd66f1dd42c7087eb6cef54468af", "score": "0.0", "text": "function logDetails(uid, item) {\n console.log(\"A product with \" + uid + \" has a title as \" + item);\n}", "title": "" } ]
[ { "docid": "c424eea3000b69cba33c4d239941f5e4", "score": "0.65215856", "text": "function unionTypeFunction(user) {\n console.log(user);\n}", "title": "" }, { "docid": "7a320d3121295d751ef75db46bb99237", "score": "0.5614392", "text": "union(p, q) {\n const pId = this.id[p];\n const qId = this.id[q];\n for (let i = 0; i < this.id.length; i++) {\n if (this.id[i] === pId) {\n this.id[i] = qId;\n }\n }\n }", "title": "" }, { "docid": "05c27006485bf71eb48896f6ae7cf6be", "score": "0.550415", "text": "function mergeUnionType(arg1, arg2, arg3) {\n if (!arg1 && !arg2 && !arg3)\n return;\n // In most cases, our union types are used in a mutually exclusive way,\n // so only one object will be populated.\n if (arg1 && !arg2 && !arg3)\n return arg1;\n if (!arg1 && arg2 && !arg3)\n return arg2;\n if (!arg1 && !arg2 && arg3)\n return arg3;\n return $.extend(arg1, arg2, arg3);\n }", "title": "" }, { "docid": "779a970397f576ad9a85c5e2eafd57f3", "score": "0.5471504", "text": "function setUid(userId) {\n result[userId] = self.userTypes.get(userId);\n }", "title": "" }, { "docid": "b4a86113dc897581f37bba4674261cf6", "score": "0.54312736", "text": "members(...unionMembers) {\n this.typeBuilder.addUnionMembers(unionMembers);\n }", "title": "" }, { "docid": "c486a8ba3aa35c85de171da13306c084", "score": "0.53842294", "text": "function writeUFID(tag, data) {\n let ret = [];\n ret = ret.concat(encodeString(data.ownerId, 0));\n ret = ret.concat(data.binary);\n \n return ret;\n}", "title": "" }, { "docid": "182a7758e9fbbeb12aa7772505e832ae", "score": "0.52554196", "text": "function Union () {\n debug('defining new union \"type\"')\n\n function UnionType (arg, data) {\n if (!(this instanceof UnionType)) {\n return new UnionType(arg, data)\n }\n debug('creating new union instance')\n var store\n if (Buffer.isBuffer(arg)) {\n debug('using passed-in Buffer instance to back the union', arg)\n assert(arg.length >= UnionType.size, 'Buffer instance must be at least '\n + UnionType.size + ' bytes to back this untion type')\n store = arg\n arg = data\n } else {\n debug('creating new Buffer instance to back the union (size: %d)', UnionType.size)\n store = new Buffer(UnionType.size)\n }\n\n // set the backing Buffer store\n store.type = UnionType\n this['ref.buffer'] = store\n\n // initialise the union with values supplied\n if (arg) {\n //TODO: Sanity check - e.g. (Object.keys(arg).length == 1)\n for (var key in arg) {\n // hopefully hit the union setters\n this[key] = arg[key]\n }\n }\n UnionType._instanceCreated = true\n }\n\n // make instances inherit from `proto`\n UnionType.prototype = Object.create(proto, {\n constructor: {\n value: UnionType\n , enumerable: false\n , writable: true\n , configurable: true\n }\n })\n\n UnionType.defineProperty = defineProperty\n UnionType.toString = toString\n UnionType.fields = {}\n\n // comply with ref's \"type\" interface\n UnionType.size = 0\n UnionType.alignment = 0\n UnionType.indirection = 1\n UnionType.get = get\n UnionType.set = set\n\n // Read the fields list\n var arg = arguments[0]\n if (typeof arg === 'object') {\n Object.keys(arg).forEach(function (name) {\n var type = arg[name];\n UnionType.defineProperty(name, type);\n })\n }\n\n return UnionType\n}", "title": "" }, { "docid": "e830c20c21545db99103f51ed3999d6d", "score": "0.52088344", "text": "function uniqeUnion(...args){\r\n\r\n arr = [].concat(...args);\r\n \r\n return [...new Set([...arr])]\r\n}", "title": "" }, { "docid": "46453e23871704c897e1c8598d0c07aa", "score": "0.52060086", "text": "function union() {\n return flatten([].concat.apply([], arguments));\n}", "title": "" }, { "docid": "bdcf1c673c358b0e33efb4cbbb16fe13", "score": "0.51791257", "text": "function union() {\n\t var typeSpec = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t typeSpec[_i] = arguments[_i];\n\t }\n\t return new TUnion(typeSpec.map(function (t) { return parseSpec(t); }));\n\t}", "title": "" }, { "docid": "df19f9ee39c26592add8298f3432a2aa", "score": "0.5145771", "text": "unionL(o) { return this.concat(o); }", "title": "" }, { "docid": "374d41cf3345d75186a3ac95c41554b7", "score": "0.5093696", "text": "function unionExpr(stream, a) { return binaryL(pathExpr, stream, a, '|'); }", "title": "" }, { "docid": "374d41cf3345d75186a3ac95c41554b7", "score": "0.5093696", "text": "function unionExpr(stream, a) { return binaryL(pathExpr, stream, a, '|'); }", "title": "" }, { "docid": "7bdd5eb3b223ca0d9bf170f31b335ca2", "score": "0.5078364", "text": "function uu(a,b){this.O=[];this.Aa=a;this.ia=b||null;this.J=this.C=!1;this.H=void 0;this.ga=this.Ba=this.V=!1;this.R=0;this.Ig=null;this.L=0}", "title": "" }, { "docid": "e5fb7781956ffef976fd1a38988cfada", "score": "0.5053655", "text": "R() {\n const t = this.auth && this.auth.getUid();\n return F(null === t || \"string\" == typeof t), new U(t);\n }", "title": "" }, { "docid": "2b5badff2dc920b68e59331ec1ebf01a", "score": "0.5045036", "text": "function union(o, p) {\n return extend(extend({}, o), p);\n}", "title": "" }, { "docid": "f590969b9a9a7849d089288cc60b68c4", "score": "0.50281185", "text": "type(obj) {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;\n }", "title": "" }, { "docid": "70b997bc63fe4bea833ec70777da3210", "score": "0.50020564", "text": "function union(arrays) {\n\n}", "title": "" }, { "docid": "70b997bc63fe4bea833ec70777da3210", "score": "0.50020564", "text": "function union(arrays) {\n\n}", "title": "" }, { "docid": "8eff9d4146d46058debc5696578e08e4", "score": "0.49826124", "text": "P() {\n const t = this.auth && this.auth.getUid();\n return w(null === t || \"string\" == typeof t), new u(t);\n }", "title": "" }, { "docid": "4894ca4b2b4f57ba8e10e9d038cf6079", "score": "0.49569824", "text": "u() {\n const t = this.auth && this.auth.getUid();\n return L(null === t || \"string\" == typeof t), new S(t);\n }", "title": "" }, { "docid": "0af67d4465db0482d8d9dc9f23167151", "score": "0.4952559", "text": "unionR(o) { return o.concat(this); }", "title": "" }, { "docid": "0ae415e0ddadde2eb419bd7d50af0066", "score": "0.48837125", "text": "parseUnionMemberTypes() {\n return this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EQUALS)\n ? this.delimitedMany(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PIPE, this.parseNamedType)\n : [];\n }", "title": "" }, { "docid": "8fed716af105a7851b81874269158cea", "score": "0.48821682", "text": "function CreateTypeUnion() {\n var types = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n types[_i] = arguments[_i];\n }\n var typeDefSetOr = {\n __type: TypeDefinition_1.InternalSymbol.Or,\n types: types,\n };\n return typeDefSetOr;\n }", "title": "" }, { "docid": "2941c8987c73708c3e96c0a3eb0054bd", "score": "0.48795587", "text": "function sjot_validate_union(sjots, data, type, sjot/*FAST[*/, datapath, typepath/*FAST]*/) {\n\n var union = [];\n\n // check if union has distinct arrays and objects, this tells us which type we can pick to validate data against\n for (var i = 0; i < type[0].length; i++)\n sjot_check_union(sjots, type[0][i], type[0][i], sjot/*FAST[*/, typepath + \"[[\" + i + \"]]\"/*FAST]*/, union, 1);\n\n // n is the depth of array nestings + 1\n var n = 1;\n var item = data;\n\n while (Array.isArray(item)) {\n\n n++;\n\n if (item.length === 0) {\n\n if ((union[0] !== undefined && n >= union[0]) || union[n] !== undefined)\n return;\n sjot_error(\"value\", data, type/*FAST[*/, datapath, typepath/*FAST]*/);\n\n }\n\n item = item[0];\n\n }\n\n // everything is \"any\" when array depth n >= union[0], so we're done\n if (union[0] !== undefined && n >= union[0])\n return;\n\n if (union[n] !== undefined) {\n\n if (item === null) {\n\n if (union[n].n === null)\n sjot_error(\"value\", data, type/*FAST[*/, datapath, typepath/*FAST]*/);\n return sjot_validate(sjots, data, union[n].n, sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n }\n\n switch (typeof item) {\n\n case \"boolean\":\n\n if (union[n].b !== null) {\n\n if (n > 1)\n return sjot_validate(sjots, data, union[n].b, sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n for (var i = 0; i < type[0].length; i++) {\n\n try {\n\n return sjot_validate(sjots, data, type[0][i], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n } catch (e) {\n\n }\n\n }\n\n }\n\n break;\n\n case \"number\":\n\n if (union[n].x !== null) {\n\n if (n > 1)\n return sjot_validate(sjots, data, union[n].x, sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n for (var i = 0; i < type[0].length; i++) {\n\n try {\n\n return sjot_validate(sjots, data, type[0][i], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n } catch (e) {\n\n }\n\n }\n\n }\n\n break;\n\n case \"string\":\n\n if (union[n].s !== null) {\n\n if (n > 1)\n return sjot_validate(sjots, data, union[n].s, sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n for (var i = 0; i < type[0].length; i++) {\n\n try {\n\n return sjot_validate(sjots, data, type[0][i], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n } catch (e) {\n\n }\n\n }\n\n }\n\n break;\n\n case \"object\":\n\n if (union[n].o !== null)\n return sjot_validate(sjots, data, union[n].o, sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n if (union[n].t !== null) {\n\n for (var i = 0; i < union[n].t.length; i++) {\n\n if (item.hasOwnProperty(union[n].t[i])) {\n\n try {\n\n sjot_validate(sjots, item[union[n].t[i]], union[n].v[i], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n } catch (e) {\n\n continue;\n\n }\n\n return sjot_validate(sjots, data, union[n].d[i], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n }\n\n }\n\n }\n\n if (union[n].p !== null) {\n\n // check from first to last property (aligns with streaming model)\n for (var prop in item)\n if (union[n].p.hasOwnProperty(prop))\n return sjot_validate(sjots, data, union[n].p[prop], sjot/*FAST[*/, datapath, typepath/*FAST]*/);\n\n }\n\n }\n\n }\n\n sjot_error(\"value\", data, type/*FAST[*/, datapath, typepath/*FAST]*/);\n\n}", "title": "" }, { "docid": "871800ec8dab8918a40bde8bd1b03eb1", "score": "0.48764765", "text": "union(set) {\n const newSet = new Set();\n this.values().forEach(value => {\n newSet.add(value);\n })\n set.values().forEach(value => {\n newSet.add(value);\n })\n\n return newSet;\n }", "title": "" }, { "docid": "4b32c853e41408021fc5b066c3adf050", "score": "0.48672652", "text": "union(set) {\n const newSet = new Set();\n this.values().forEach(value => {\n newSet.add(value);\n })\n set.values().forEach(value => {\n newSet.add(value);\n })\n\n return newSet;\n }", "title": "" }, { "docid": "96f11438cca446775bd24b5704d98b6d", "score": "0.4857384", "text": "function getUnionTypeRef(typeName) {\n\t\tvar unionTypeArray = typeName.split('|');\n\t\treturn getTypeRef(unionTypeArray[Math.floor(Math.random()*unionTypeArray.length)]);\n\t}", "title": "" }, { "docid": "ae60b9b2eeb8f4d318a8c14af8557bf6", "score": "0.48569793", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "ae60b9b2eeb8f4d318a8c14af8557bf6", "score": "0.48569793", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "ae60b9b2eeb8f4d318a8c14af8557bf6", "score": "0.48569793", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "d7a13fca4ea69dcc0dbc50de1c9b06af", "score": "0.48461652", "text": "function parse_ColRelU(blob, length) {\r\n\tvar c = blob.read_shift(2);\r\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\r\n}", "title": "" }, { "docid": "519d412fca7da25b4324858b1181a3be", "score": "0.484612", "text": "setObjId(v) { return this.buffer.writeUIntLE(v, 8, 6); }", "title": "" }, { "docid": "986566afee24e0df99962ab82cd492e4", "score": "0.48431706", "text": "function union (docL, docR) {\n if (typeof docR !== 'function') {\n throw new Error(\"docR isn't a thunk\");\n }\n return {type: 'union', left: docL, right: docR};\n}", "title": "" }, { "docid": "cd46f1565519d72b6e8b2319ac7f1ea2", "score": "0.48070323", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(length == 1 ? 1 : 2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "cd46f1565519d72b6e8b2319ac7f1ea2", "score": "0.48070323", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(length == 1 ? 1 : 2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "cd46f1565519d72b6e8b2319ac7f1ea2", "score": "0.48070323", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(length == 1 ? 1 : 2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "cd46f1565519d72b6e8b2319ac7f1ea2", "score": "0.48070323", "text": "function parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(length == 1 ? 1 : 2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}", "title": "" }, { "docid": "01fb20ee8105f0370addb8907ecaceea", "score": "0.4799798", "text": "function U(a){\n// dataTypeExpression is optional and defaults to \"*\"\nreturn function(b,c){\"string\"!=typeof b&&(c=b,b=\"*\");var d,e=0,f=b.toLowerCase().match(Ca)||[];if(ma.isFunction(c))\n// For each dataType in the dataTypeExpression\nfor(;d=f[e++];)\n// Prepend if requested\n\"+\"===d[0]?(d=d.slice(1)||\"*\",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}", "title": "" }, { "docid": "4e4d9b01a716cb3302fec5f1f6a7873a", "score": "0.4792966", "text": "function uv(a,b){this.En=[];this.y_=a;this.VU=b||null;this.Zw=this.Of=!1;this.vf=void 0;this.TQ=this.d6=this.AH=!1;this.zG=0;this.Za=null;this.VA=0}", "title": "" }, { "docid": "b9a1c420556c13a9a74252efa19f794d", "score": "0.47898135", "text": "function union(x,y){\n\n\t\t// check parameters\n\t\tif(typeof x !== 'number' || x >= n){\n\t\t\tthrow \"First argument is not valid.\";\n\t\t}\n\t\tif(typeof y !== 'number' || y >= n){\n\t\t\tthrow \"Second argument is not valid.\";\n\t\t}\n\n\t\tfor(let i = 0; i < n; ++i){\n\t\t\tif(cId[i] === cId[y]) cId[i] = cId[x];\n\t\t}\n\n\t}", "title": "" }, { "docid": "fa813bd1730b41cc199c8fd6e6a88690", "score": "0.47856024", "text": "union(set) {\n const newSet = new Set();\n this.values().forEach(value => {\n newSet.add(value);\n })\n set.values().forEach(value => {\n newSet.add(value);\n })\n\n return newSet;\n }", "title": "" }, { "docid": "295fd0c7d09d729a19a667de59489e5b", "score": "0.47524467", "text": "function addTypesToUnion(typeSet,types){for(var _i=0,types_6=types;_i<types_6.length;_i++){var type=types_6[_i];addTypeToUnion(typeSet,type);}}", "title": "" }, { "docid": "2b1f7254be018a4ca657357e84f284e9", "score": "0.4751992", "text": "function PrepareQueryUserData(userid){\n\treturn {\"_key\":{$regex:'^user:'}, $or : [{uid : String(userid)}, {uid : userid}]};\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.475134", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.475134", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.475134", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.475134", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "4e71dc03dfcd428bd2d3c02b043e5731", "score": "0.47498482", "text": "function union(target, source) {\n for (var i = 0, len = source.length; i < len; ++i) {\n unionSingle(target, source[i]);\n }\n }", "title": "" }, { "docid": "1706ccfcbc3699f44e14c22aceedcf63", "score": "0.47423562", "text": "function UnionTypeAnnotation(node, print) {\n print.join(node.types, { separator: \" | \" });\n}", "title": "" }, { "docid": "b270fb2f993177ead4bb0100483a20c9", "score": "0.4729817", "text": "function union(types1, types2) {\n var list = [];\n var i;\n for (i = 0; i < types1.length; i++) {\n if (list.find(type => type.equals(types1[i])) === undefined) {\n list.push(types1[i]);\n }\n }\n for (i = 0; i < types2.length; i++) {\n if (list.find(type => type.equals(types2[i])) === undefined) {\n list.push(types2[i]);\n }\n }\n return list;\n}", "title": "" }, { "docid": "110d91683952aebcc1bd8930bc6b6051", "score": "0.47290978", "text": "function union(...value) {\n return Array.from(new Set(flatten(value)))\n}", "title": "" }, { "docid": "e44b6cf48091aa878336e5b95418407a", "score": "0.47059748", "text": "function parseUnionMembers(lexer) {\n\t var members = [];\n\t do {\n\t members.push(parseNamedType(lexer));\n\t } while (skip(lexer, _lexer.TokenKind.PIPE));\n\t return members;\n\t}", "title": "" }, { "docid": "b2b46bfc3c99a29bd395f4186879965c", "score": "0.47051704", "text": "function union(a, b){ /// return single instance of element held by either array.\n\t\t\tb.map(function(n){\n\t\t\t\tif (a.indexOf(n) == -1){\n\t\t\t\t\ta.push(n)\n\t\t\t\t}\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "40ac2dc6ce51287a5416a6585b368b72", "score": "0.46931952", "text": "union(a, ...b) {\n\t\treturn b.reduce((u,c) => u.concat(c.filter(x => !u.includes(x))), a);\n\t}", "title": "" }, { "docid": "b73b7c93aacde29e84a229d862066a75", "score": "0.46832985", "text": "function tgi(type, group, id) {\n\treturn [type, group, id].map(hex).join('-');\n}", "title": "" }, { "docid": "c59f759d58400cfc3c4f0fc10c40a01d", "score": "0.4671221", "text": "function sjot_check_union(sjots, type, itemtype, sjot/*FAST[*/, typepath/*FAST]*/, union, n) {\n\n // count array depth, each depth has its own type conflict set\n if (typeof itemtype === \"string\") {\n\n var i = itemtype.length;\n\n while (i > 0) {\n\n if (itemtype.charCodeAt(i - 1) === 0x5D /*type[]*/)\n i = itemtype.lastIndexOf(\"[\", i - 1);\n else if (itemtype.charCodeAt(i - 1) === 0x7D /*type{}*/)\n i = itemtype.lastIndexOf(\"{\", i - 1);\n else\n break;\n n++;\n\n }\n\n // n is array depth, now get item type and check if this is a type reference\n itemtype = itemtype.slice(0, i);\n\n if (itemtype.indexOf(\"#\") !== -1 && itemtype.charCodeAt(0) !== 0x28 /*(type)*/)\n return sjot_check_union(\n sjots,\n type,\n sjot_reftype(sjots, itemtype, sjot/*FAST[*/, typepath/*FAST]*/),\n sjot,\n /*FAST[*/typepath,/*FAST]*/\n union,\n n);\n\n }\n\n if (itemtype === \"char\" && n > 0) {\n\n // \"char[]\" is a special case, synonymous to \"string\"\n n--;\n itemtype = \"string\";\n\n } else if (itemtype === \"array\") {\n\n // \"array\" is synonymous to \"any[]\"\n n++;\n itemtype = \"any\";\n\n } else if (Array.isArray(itemtype)) {\n\n if (itemtype.length === 0) {\n\n // [] is synonymous to \"any[]\"\n n++;\n itemtype = \"any\";\n\n } else if (itemtype.length === 1 || typeof itemtype[1] === \"number\") {\n\n // nested unions, including arrays of unions, are not permitted\n if (sjot_is_union(itemtype))\n sjot_schema_error(\"nested unions are not permitted\"/*FAST[*/, typepath/*FAST]*/);\n\n n++;\n if (typeof itemtype[0] === \"number\")\n itemtype = \"any\";\n else\n return sjot_check_union(sjots, type, itemtype[0], sjot/*FAST[*/, typepath/*FAST]*/, union, n);\n\n } else if (typeof itemtype[0] === \"number\") {\n\n n++;\n if (typeof itemtype[1] === \"number\")\n itemtype = \"any\";\n else\n return sjot_check_union(sjots, type, itemtype[1], sjot/*FAST[*/, typepath/*FAST]*/, union, n);\n\n } else {\n\n // tuple is represented by \"any[]\"\n n++;\n itemtype = \"any\";\n\n }\n\n }\n\n // union[0] is the cut-off array depth where everything is \"any\" and will conflict\n if (union[0] !== undefined && n >= union[0])\n sjot_schema_error(\"union requires distinct types\"/*FAST[*/, typepath/*FAST]*/);\n\n // record null, boolean, number, string, and object types with property mapping for conflict checking at array depth n\n if (union[n] === undefined)\n union[n] = { n: null, b: null, x: null, s: null, o: null, p: null, t: null, v: null, d: null };\n\n if (typeof itemtype === \"string\") {\n\n switch (itemtype) {\n\n case \"null\":\n\n if (union[n].n !== null)\n sjot_schema_error(\"union has multiple null types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].n = type;\n break;\n\n case \"boolean\":\n case \"true\":\n case \"false\":\n\n if (n > 1 && union[n].b !== null)\n sjot_schema_error(\"union has multiple boolean types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].b = type;\n break;\n\n case \"byte\":\n case \"short\":\n case \"int\":\n case \"long\":\n case \"ubyte\":\n case \"ushort\":\n case \"uint\":\n case \"ulong\":\n case \"integer\":\n case \"float\":\n case \"double\":\n case \"number\":\n\n if (n > 1 && union[n].x !== null)\n sjot_schema_error(\"union has multiple numeric types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].x = type;\n break;\n\n case \"string\":\n case \"base64\":\n case \"hex\":\n case \"uuid\":\n case \"date\":\n case \"time\":\n case \"datetime\":\n case \"duration\":\n case \"char\":\n\n if (n > 1 && union[n].s !== null)\n sjot_schema_error(\"union has multiple string types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].s = type;\n break;\n\n case \"any\":\n\n for (var i = n; i < union.length; i++)\n if (union[i] !== undefined && (union[i].n !== null || union[i].b !== null || union[i].x !== null || union[i].s !== null || union[i].o !== null || union[i].p !== null))\n sjot_schema_error(\"union requires distinct types\"/*FAST[*/, typepath/*FAST]*/);\n union[0] = n;\n break;\n\n case \"atom\":\n\n if (union[n].b !== null || union[n].x !== null || union[n].s !== null)\n sjot_schema_error(\"union has multiple atomic types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].b = type;\n union[n].x = type;\n union[n].s = type;\n break;\n\n case \"object\":\n\n if (union[n].o !== null || union[n].p !== null)\n sjot_schema_error(\"union requires distinct object types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].o = type;\n break;\n\n default:\n\n if (itemtype.charCodeAt(0) === 0x28 /*(type)*/) {\n\n if (n > 1 && union[n].s !== null)\n sjot_schema_error(\"union has multiple string array types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].s = type;\n\n } else {\n\n if (n > 1 && union[n].x !== null)\n sjot_schema_error(\"union has multiple numeric array types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].x = type;\n\n }\n\n }\n\n } else if (itemtype !== null && typeof itemtype === \"object\") {\n\n if (itemtype.hasOwnProperty(\"@if\")) {\n\n // check if @if value is a valid property\n var when = itemtype[\"@if\"];\n\n if (typeof when !== \"string\")\n sjot_schema_error(\"@if value is not a property name\"/*FAST[*/, typepath/*FAST]*/);\n if (!itemtype.hasOwnProperty(\"@then\"))\n sjot_schema_error(\"@if \\\"\" + when + \"\\\" has no @then object\"/*FAST[*/, typepath/*FAST]*/);\n\n var then = itemtype[\"@then\"];\n\n if (typeof then === \"string\" && then.indexOf(\"#\") !== -1 && then.charCodeAt(0) !== 0x28 /*(type)*/ && then.charCodeAt(then.length - 1) !== 0x5D /*type[]*/ && then.charCodeAt(then.length - 1) !== 0x7D /*type{}*/)\n then = sjot_reftype(sjots, then, sjot/*FAST[*/, typepath/*FAST]*/);\n\n if (then === null || typeof then !== \"object\")\n sjot_schema_error(\"@then value is not an object type\"/*FAST[*/, typepath/*FAST]*/);\n\n var found = false;\n\n for (var prop in then) {\n\n if (prop.charCodeAt(0) !== 0x40 /*@prop*/ && prop.charCodeAt(0) !== 0x28 /*(prop)*/ && then.hasOwnProperty(prop)) {\n\n var i = prop.indexOf(\"?\");\n\n if ((i !== -1 && prop.slice(0, i) === when) || (i === -1 && prop === when)) {\n\n found = true;\n break;\n\n }\n\n }\n\n }\n\n if (!found)\n sjot_schema_error(\"@if \\\"\" + when + \"\\\" is not a property of @then object\"/*FAST[*/, typepath/*FAST]*/);\n\n for (var prop in then) {\n\n if (prop.charCodeAt(0) !== 0x40 /*@prop*/ && prop.charCodeAt(0) !== 0x28 /*(prop)*/ && then.hasOwnProperty(prop)) {\n\n var i = prop.indexOf(\"?\");\n\n if ((i !== -1 && prop.slice(0, i) === when) || (i === -1 && prop === when)) {\n\n if (union[n].t === null) {\n\n union[n].t = [when];\n union[n].v = [then[prop]];\n union[n].d = [then];\n\n } else {\n\n union[n].t.push(when);\n union[n].v.push(then[prop]);\n union[n].d.push(then);\n\n }\n\n break;\n\n }\n\n }\n\n }\n\n } else {\n\n if (union[n].o !== null)\n sjot_schema_error(\"union requires distinct object types\"/*FAST[*/, typepath/*FAST]*/);\n\n var prevp = union[n].p;\n var empty = true;\n\n for (var prop in itemtype) {\n\n if (prop.charCodeAt(0) !== 0x40 /*@prop*/ && itemtype.hasOwnProperty(prop)) {\n\n if (prop.charCodeAt(0) === 0x28 /*(prop)*/) {\n\n // object with regex property means only one such object is permitted in the union to ensure uniqueness\n if (union[n].o !== null)\n sjot_schema_error(\"union requires distinct object types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].o = type;\n empty = false;\n break;\n\n } else {\n\n var i = prop.indexOf(\"?\");\n\n if (i !== -1)\n prop = prop.slice(0, i);\n else\n empty = false;\n\n if (prevp !== null && prevp.hasOwnProperty(prop))\n sjot_schema_error(\"union requires distinct object types\"/*FAST[*/, typepath/*FAST]*/);\n if (union[n].p === null)\n union[n].p = {};\n union[n].p[prop] = type;\n\n }\n\n }\n\n }\n\n if (empty) {\n\n if (union[n].o !== null || prevp !== null)\n sjot_schema_error(\"union requires distinct object types\"/*FAST[*/, typepath/*FAST]*/);\n union[n].o = type;\n\n }\n\n }\n\n }\n\n}", "title": "" }, { "docid": "5c22fd625de44c5c0a7fb8666e8d6647", "score": "0.4665137", "text": "function createUnionTypeAnnotation(types) {\n var flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return t.unionTypeAnnotation(flattened);\n }\n}", "title": "" }, { "docid": "d7f5d58cb1744a4e398edb28f707aaa7", "score": "0.46573314", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}", "title": "" }, { "docid": "d7f5d58cb1744a4e398edb28f707aaa7", "score": "0.46573314", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}", "title": "" }, { "docid": "3bb485704db9a62c109e4844c24a32f1", "score": "0.46503687", "text": "function filterDuo(duo, clientID) {\n // keep it pure\n var newUser = {};\n\n if (duo.u1ID === clientID) {\n newUser.ID = duo.u2ID;\n newUser.firstname = duo.u2fn;\n newUser.lastname = duo.u2ln;\n } else {\n newUser.ID = duo.u1ID;\n newUser.firstname = duo.u1fn;\n newUser.lastname = duo.u1ln;\n }\n\n return newUser;\n}", "title": "" }, { "docid": "e75f4fe15cda673bc747d36d7674851f", "score": "0.463685", "text": "function uidToString(uid) {\n return uid.reduce((s, b) => {\n return s + (b < 16 ? '0' : '') + b.toString(16);\n }, '');\n }", "title": "" }, { "docid": "6c75e2030037271601660345f95503cf", "score": "0.46264082", "text": "function GetTypeUnionName(typeUnion) {\n return \"(\" + typeUnion.types.map(GetTypeName).join(\" | \") + \")\";\n }", "title": "" }, { "docid": "7a89cc393ce9ffe1e550750895d3472f", "score": "0.4620414", "text": "static async transform(client, value) {\n const str = `${value}`;\n let user = str;\n let group = false;\n\n if (str.includes(\":\")) {\n [ user, group ] = str.split(\":\");\n }\n\n let uid = user ? Number.parseInt(user, 10) : 0;\n let gid = group ? Number.parseInt(group, 10) : 0;\n\n uid = Number.isNaN(uid) ? (await api.uid(client, user)) : uid;\n gid = Number.isNaN(gid) ? (await api.gid(client, group)) : gid;\n\n return { uid, gid };\n }", "title": "" }, { "docid": "9fae8f310c0a5e1a3ac9ed7cba16b053", "score": "0.4617228", "text": "function generateSetOperation(ast, options) {\n var members = ast.params.map(function (_) { return generateType(_, options); });\n var separator = ast.type === 'UNION' ? '|' : '&';\n return members.length === 1 ? members[0] : '(' + members.join(' ' + separator + ' ') + ')';\n}", "title": "" }, { "docid": "e1cccbcca7adba54d80bf2a982ddb4b2", "score": "0.46055734", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "c22166f22500c6ff616f4950c55ef2f4", "score": "0.4600065", "text": "function orderedUnion(array1, array2){\n\n}", "title": "" }, { "docid": "283b30cf61854747e6d6ac8e6a2d18e1", "score": "0.45971775", "text": "function unionArreglo(datos1, datos2) {\n return [...new Set([...datos1, ...datos2])];\n}", "title": "" }, { "docid": "0c387213e09b4abcdb0aaa4922f3df8a", "score": "0.45787522", "text": "function union(...arr) {\n return arr.reduce((acc, cv) => {\n cv.forEach((value) => {\n if (acc.indexOf(value) == -1) {\n acc.push(value);\n }\n })\n return acc;\n });\n}", "title": "" }, { "docid": "f36e57dd9a4877d541b7a4de1e963b76", "score": "0.4576304", "text": "function getUnion(p1, p2) {\n var i = 0;\n var max = Math.min(p1.length, p2.length);\n while(p1[i] === p2[i] && i < max) {\n i++;\n }\n\n return p1.substring(0, i);\n}", "title": "" }, { "docid": "457f5ce7d3e918e2bcf9ec57e31c28c2", "score": "0.45751444", "text": "function sjot_is_union(type) {\n\n return Array.isArray(type) &&\n type.length === 1 &&\n Array.isArray(type[0]) &&\n type[0].length > 1 &&\n typeof type[0] !== \"number\" &&\n typeof type[1] !== \"number\";\n\n}", "title": "" }, { "docid": "018db88fdc92aa4d502117b463c8afc2", "score": "0.4572899", "text": "function set_union(set1, set2)\n{\n let result = [];\n // rajouter tous les éléments de l'set1\n let nb1 = set1.length;\n for (let i=0; i<nb1; i++) {\n let item = set1[i];\n let index = result.indexOf(item);\n if (index < 0) {\n result.push(item);\n }\n }\n // rajouter tous les éléments de l'set2\n let nb2 = set2.length;\n for (let i=0; i<nb2; i++) {\n let item = set2[i];\n let index = result.indexOf(item);\n if (index < 0) {\n result.push(item);\n }\n }\n return result;\n}", "title": "" }, { "docid": "574f9fdb73877cc125d7f0a0524ab0e8", "score": "0.45682484", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n if (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].PIPE));\n }\n return types;\n}", "title": "" }, { "docid": "0de127ec8db5390f831ea5b9a761272b", "score": "0.45662332", "text": "function readUFID(data, offset, frameLen) {\n let ret = {};\n ret.ownerId = decodeString(data, offset, offset + frameLen, 0);\n ret.binary = data.slice(offset + ret.ownerId.length + 1, offset + frameLen);\n \n return ret;\n}", "title": "" }, { "docid": "fb881900251d570adfe20ddb2a2d36f0", "score": "0.4565203", "text": "parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }", "title": "" }, { "docid": "332d036e494a1e7bb1de7acb95085a5d", "score": "0.45649424", "text": "get uuid_product() { return String(this.getDataValue(\"uuid_product\")); }", "title": "" }, { "docid": "c884530f0b3290868724618958ac349f", "score": "0.4563178", "text": "function ru(t, e, n) {\n var r = \"firestore_mutations_\" + t + \"_\" + n;\n return e.Js() && (r += \"_\" + e.uid), r;\n }", "title": "" }, { "docid": "e7c45270a39c9d3d794c5fc6acf61ceb", "score": "0.45627347", "text": "union(secondSet) {\n let unionSet = new Set();\n this.values().forEach((value) => {\n unionSet.add(value);\n });\n secondSet.values().forEach((value) => {\n unionSet.add(value);\n });\n return unionSet;\n }", "title": "" }, { "docid": "f0883609f5ac5329855f6de4f8b01c15", "score": "0.45598742", "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": "1d9a140186f6bcd263ab730212b0af77", "score": "0.45467678", "text": "function union(A, B) {\n let C = [...A, ...B]; // Could also use A.concat(B)\n let union = C.filter((i, p) => C.indexOf(i) === p); // Return C to show duplicates as well\n return union;\n}", "title": "" }, { "docid": "2eb75ef9ffe7c7e12bdbe3615d96e6fa", "score": "0.45417154", "text": "function Bigunion(str) {\n Macro.call(this, str);\n this.flags = [\"of\", \"of*\", \"from\", \"to\", \"for\",\"index\",\"steps\"];\n this.alias = [[\"of\",false],[\"of*\",false],[\"steps\",false],[\"from\",\"lowerbound\"],[\"index\",\"lowerbound\"],[\"to\",\"upperbound\"],[\"for\",\"lowerbound\"]];\n this.arr = markflags(this.arr, this.flags);\n this.html = writeHTML(\"bigunion\",this.arr, this.alias);\n addHTML = parse(str.substring(str.indexOf(\"of\")+2,str.length), true);\n if(str.indexOf(\"of\") > 0){\n this.html = this.html + addHTML;\n }\n window.last_macro = \"bigunions\";\n }", "title": "" }, { "docid": "13af6be16a34f77845d54836f8d8b61f", "score": "0.45300117", "text": "function uniteUnique(arr) {\n const arrArgs = [...arguments];\n const union = [];\n for (let i = 0; i < arrArgs.length; i++) {\n for (let j = 0; j < arrArgs[i].length; j++) {\n if (union.indexOf(arrArgs[i][j]) == -1) {\n union.push(arrArgs[i][j]);\n }\n }\n }\n return union;\n}", "title": "" }, { "docid": "5c170f6cdbd62bddd7768abe42830a5a", "score": "0.45270526", "text": "function V(a,b,c,d){function e(h){var i;return f[h]=!0,ma.each(a[h]||[],function(a,h){var j=h(b,c,d);return\"string\"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===Mb;return e(b.dataTypes[0])||!f[\"*\"]&&e(\"*\")}", "title": "" }, { "docid": "4b4c4160f19fba0f407f2b4c6b8fbc78", "score": "0.45135832", "text": "function unionSingle(target, value) {\n if (target.indexOf(value) < 0) {\n target.push(value);\n }\n }", "title": "" }, { "docid": "0390ef7ff54f7764eed827d6f0e5e7be", "score": "0.4513118", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "a9a5e514f40daadf610f6f749b3f0c7c", "score": "0.45097053", "text": "function objectListUid(objs) {\n const objectList = toList(objs);\n let retVal = '';\n\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new _errors.ValueError(`Object ${obj} passed to objectListUid without an id`);\n }\n\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n\n retVal = `${retVal}${Math.abs(obj.id)}`;\n }\n\n return retVal;\n}", "title": "" }, { "docid": "88b5386773a8299f84fb0c9c591c5a20", "score": "0.45074418", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "4ebc660b8fb8a42866f85d4e7308138a", "score": "0.45024818", "text": "function parseUnionMembers(parser) {\n var members = [];\n do {\n members.push((0, _parser.parseNamedType)(parser));\n } while ((0, _parserCore.skip)(parser, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "67eaad3ea16e510d703bbd74c7f896ad", "score": "0.44967282", "text": "union(other, result) {\n if (this.isNull)\n return other.clone(result);\n if (other.isNull)\n return this.clone(result);\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\n return Range3d.createXYZXYZOrCorrectToNull(Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.min(this.low.z, other.low.z), Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), Math.max(this.high.z, other.high.z), result);\n }", "title": "" }, { "docid": "98ebdce31d4ec6ec6c4631af486fbfd7", "score": "0.448991", "text": "makeNodeUID(osmdata) {\n return osmdata.type + osmdata.id.toString()\n }", "title": "" }, { "docid": "f348648bc29e580efb8937fc211614f5", "score": "0.44874394", "text": "function _userUnit2SerializeObj(uinfo, doFull=false) {\n\tvar outObj = {\n\t\t'id': uinfo.unit['id'] - 1100000,\n\t\t'weapon': _artifact2SerializedObj(uinfo['weapon']),\n\t\t'armor': _artifact2SerializedObj(uinfo['armor']),\n\t\t'kit': _artifact2SerializedObj(uinfo['kit']),\n\t\t'passives': uinfo.selectedPassiveLists,\n\t\t'relics': new Array(4*3), // relic, relic passive, relic lv\n\t\t'scroll': [ uinfo.scrolls['str'], uinfo.scrolls['int'], uinfo.scrolls['cmd'], uinfo.scrolls['dex'], uinfo.scrolls['lck'] ],\n\t\t'formation': [ uinfo.formationId, uinfo.formationPos ],\n\t};\n\tfor (var i = 0; i < 4; i++) {\n\t\toutObj.relics[i*3] = uinfo.relics[i] ? (_findObjId(uinfo.relics[i], relics) - 13000000) : 0;\n\t\toutObj.relics[i*3+1] = uinfo.relicPassives[i] ? (_findObjId(uinfo.relicPassives[i], relicPassives) - 13010000) : 0;\n\t\toutObj.relics[i*3+2] = uinfo.relicPassivesLv[i];\n\t}\n\tvar relation = [];\n\tfor (var rid in uinfo.activeRelation) {\n\t\trelation.push(rid-1220000);\n\t\tvar val = 0;\n\t\tvar relationPassiveIdxs = uinfo.activeRelation[rid];\n\t\tfor (var i = 0; i < relationPassiveIdxs.length; i++) {\n\t\t\tvar idx = relationPassiveIdxs[i];\n\t\t\tval |= (1 << idx);\n\t\t}\n\t\trelation.push(val);\n\t}\n\tif (relation.length > 0)\n\t\toutObj.relation = relation;\n\t\n\tif (uinfo.lv !== 99)\n\t\toutObj.lv = uinfo.lv;\n\tif (uinfo.disableResearch)\n\t\toutObj.disableResearch = 1;\n\tif (uinfo.overriddenStat !== null) {\n\t\tvar os = uinfo.overriddenStat;\n\t\toutObj.customStat = [ os['str'], os['int'], os['cmd'], os['dex'], os['lck'],\n\t\t\tos['atk'], os['wis'], os['def'], os['agi'], os['mrl'] ];\n\t}\n\tvar extraPassives = [];\n\tfor (var passiveId in uinfo.extraPassives) {\n\t\textraPassives.push(passiveId - 2200000);\n\t\textraPassives.push(uinfo.extraPassives[passiveId]);\n\t}\n\tif (extraPassives.length > 0)\n\t\toutObj.extraPassives = extraPassives;\n\t\n\tif (doFull) {\n\t\t// hp/mp\n\t\toutObj.hp = [ uinfo.hp, uinfo.mp ];\n\t\t// battle passive\n\t\tvar bp = [];\n\t\tfor (var i = 0; i < uinfo.battlePassives.length; i++) {\n\t\t\tvar battlePassive = uinfo.battlePassives[i];\n\t\t\tif (battlePassive.type === 0)\n\t\t\t\tcontinue; // auto active (no need to serialize)\n\t\t\tif (battlePassive.defaultVal === battlePassive.userVal)\n\t\t\t\tcontinue;\n\t\t\tbp.push(battlePassive.id - 2200000);\n\t\t\tbp.push(battlePassive.userVal);\n\t\t}\n\t\tif (bp.length > 0)\n\t\t\toutObj.battlePassives = bp;\n\t\t\n\t\t// buff/debuff\n\t\tvar cd = []\n\t\tfor (var i = 0; i < uinfo.conditions.length; i++) {\n\t\t\tvar condition = uinfo.conditions[i];\n\t\t\tif (condition.userIdx === -1)\n\t\t\t\tcontinue;\n\t\t\tcd.push(condition.allowIds[condition.userIdx] - 2100000);\n\t\t}\n\t\tif (cd.length > 0)\n\t\t\toutObj.conditions = cd;\n\t\t// terrain\n\t\toutObj.terrain = [ uinfo.tileId-4200001, uinfo.isFlameTile ? 1 : 0 ];\n\t\t// tactic\n\t\toutObj.tactic = uinfo.tactic.id-2000000;\n\t}\n\t\n\treturn outObj;\n}", "title": "" }, { "docid": "dd66770d7f6c0e155299d0b987b3c81f", "score": "0.44722027", "text": "function parseUnionTypeDefinition(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'union');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer);\n\t expect(lexer, _lexer.TokenKind.EQUALS);\n\t var types = parseUnionMembers(lexer);\n\t return {\n\t kind: _kinds.UNION_TYPE_DEFINITION,\n\t name: name,\n\t directives: directives,\n\t types: types,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "fd50a6800144b372593c5a8ad0e9ce44", "score": "0.44694877", "text": "function objectListUid(objs) {\n var objectList = toList(objs);\n var retVal = '';\n for (var _i = 0, objectList_1 = objectList; _i < objectList_1.length; _i++) {\n var obj = objectList_1[_i];\n if (obj.id == null) {\n throw new errors_1.ValueError(\"Object \" + obj + \" passed to objectListUid without an id\");\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = \"\" + retVal + Math.abs(obj.id);\n }\n return retVal;\n}", "title": "" }, { "docid": "2fa992ccb0ec14d785bde31532d3c50a", "score": "0.44693953", "text": "function unionAll() {\n var union = [];\n for (var i = 0, l = arguments.length; i < l; i++)\n union = union.concat.apply(union, arguments[i]);\n return union;\n }", "title": "" }, { "docid": "2fa992ccb0ec14d785bde31532d3c50a", "score": "0.44693953", "text": "function unionAll() {\n var union = [];\n for (var i = 0, l = arguments.length; i < l; i++)\n union = union.concat.apply(union, arguments[i]);\n return union;\n }", "title": "" }, { "docid": "2fa992ccb0ec14d785bde31532d3c50a", "score": "0.44693953", "text": "function unionAll() {\n var union = [];\n for (var i = 0, l = arguments.length; i < l; i++)\n union = union.concat.apply(union, arguments[i]);\n return union;\n }", "title": "" }, { "docid": "9c6fdf05549d6478dd93c616d2e3456c", "score": "0.4467825", "text": "function filter( a, tag ){\n\t\tvar r = [], \n\t\t\tuids = {};\n\t\tif( tag ) tag = new RegExp( \"^\" + tag + \"$\", \"i\" );\n\t\tfor( var i = 0, ae; ae = a[ i++ ]; ){\n\t\t\tae.uid = ae.uid || _uid++;\n\t\t\tif( !uids[ae.uid] && (!tag || ae.nodeName.search( tag ) !== -1) )\n\t\t\t\tr.push( uids[ae.uid] = ae );\n\t\t}\n\t\treturn r;\n\t}", "title": "" }, { "docid": "ed92f138e053936e239f1731520f4937", "score": "0.44664532", "text": "function uuarg(arg1, // @param Hash/Function(= {}): arg1\n arg2, // @param Hash: arg2\n arg3) { // @param Hash(= void): arg3\n // @return Hash/Function: new Hash(mixed args) or arg1 + args\n // [1][supply args] uu.arg({ a: 1 }, { b: 2 }) -> { a: 1, b: 2 }\n // [2][LookDown args] uu.arg(function hoge(){}, { b: 2 }) -> hoge.b = 2\n\n return isFunction(arg1) ? uumix(arg1, arg2, arg3)\n : uumix(uumix({}, arg1 || {}), arg2, arg3, 0);\n}", "title": "" }, { "docid": "b8f031e4f9fa55b6bca4a2c3a9ff8e65", "score": "0.44626516", "text": "function Uu(t, e) {\n if (\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t instanceof Tu && (t = t.l_), Fu(t)) return Mu(\"Unsupported field value:\", e, t), \n Cu(t, e);\n if (t instanceof yu) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!xu(e.s_)) throw e.i_(t.e_ + \"() can only be used with update() and set()\");\n if (!e.path) throw e.i_(t.e_ + \"() is not currently supported inside arrays\");\n var n = t.n_(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.We.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.o_ && 4 /* ArrayArgument */ !== e.s_) throw e.i_(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var s = Uu(o[i], e.R_(r));\n null == s && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n s = {\n nullValue: \"NULL_VALUE\"\n }), n.push(s), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === t) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return we(e.serializer, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = ot.fromDate(t);\n return {\n timestampValue: _e(e.serializer, n)\n };\n }\n if (t instanceof ot) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n var r = new ot(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: _e(e.serializer, r)\n };\n }\n if (t instanceof Eu) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof J) return {\n bytesValue: be(e.serializer, t.q)\n };\n if (t instanceof Au) {\n var i = e.U, o = t.__;\n if (!o.isEqual(i)) throw e.i_(\"Document reference is for database \" + o.projectId + \"/\" + o.database + \" but should be for database \" + i.projectId + \"/\" + i.database);\n return {\n referenceValue: Te(t.__ || e.U, t.f_.path)\n };\n }\n if (void 0 === t && e.ignoreUndefinedProperties) return null;\n throw e.i_(\"Unsupported field value: \" + M(t));\n }(t, e);\n}", "title": "" }, { "docid": "b8f031e4f9fa55b6bca4a2c3a9ff8e65", "score": "0.44626516", "text": "function Uu(t, e) {\n if (\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t instanceof Tu && (t = t.l_), Fu(t)) return Mu(\"Unsupported field value:\", e, t), \n Cu(t, e);\n if (t instanceof yu) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!xu(e.s_)) throw e.i_(t.e_ + \"() can only be used with update() and set()\");\n if (!e.path) throw e.i_(t.e_ + \"() is not currently supported inside arrays\");\n var n = t.n_(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.We.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.o_ && 4 /* ArrayArgument */ !== e.s_) throw e.i_(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var s = Uu(o[i], e.R_(r));\n null == s && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n s = {\n nullValue: \"NULL_VALUE\"\n }), n.push(s), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === t) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return we(e.serializer, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = ot.fromDate(t);\n return {\n timestampValue: _e(e.serializer, n)\n };\n }\n if (t instanceof ot) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n var r = new ot(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: _e(e.serializer, r)\n };\n }\n if (t instanceof Eu) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof J) return {\n bytesValue: be(e.serializer, t.q)\n };\n if (t instanceof Au) {\n var i = e.U, o = t.__;\n if (!o.isEqual(i)) throw e.i_(\"Document reference is for database \" + o.projectId + \"/\" + o.database + \" but should be for database \" + i.projectId + \"/\" + i.database);\n return {\n referenceValue: Te(t.__ || e.U, t.f_.path)\n };\n }\n if (void 0 === t && e.ignoreUndefinedProperties) return null;\n throw e.i_(\"Unsupported field value: \" + M(t));\n }(t, e);\n}", "title": "" }, { "docid": "b8f031e4f9fa55b6bca4a2c3a9ff8e65", "score": "0.44626516", "text": "function Uu(t, e) {\n if (\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t instanceof Tu && (t = t.l_), Fu(t)) return Mu(\"Unsupported field value:\", e, t), \n Cu(t, e);\n if (t instanceof yu) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!xu(e.s_)) throw e.i_(t.e_ + \"() can only be used with update() and set()\");\n if (!e.path) throw e.i_(t.e_ + \"() is not currently supported inside arrays\");\n var n = t.n_(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.We.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.o_ && 4 /* ArrayArgument */ !== e.s_) throw e.i_(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var s = Uu(o[i], e.R_(r));\n null == s && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n s = {\n nullValue: \"NULL_VALUE\"\n }), n.push(s), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === t) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return we(e.serializer, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = ot.fromDate(t);\n return {\n timestampValue: _e(e.serializer, n)\n };\n }\n if (t instanceof ot) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n var r = new ot(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: _e(e.serializer, r)\n };\n }\n if (t instanceof Eu) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof J) return {\n bytesValue: be(e.serializer, t.q)\n };\n if (t instanceof Au) {\n var i = e.U, o = t.__;\n if (!o.isEqual(i)) throw e.i_(\"Document reference is for database \" + o.projectId + \"/\" + o.database + \" but should be for database \" + i.projectId + \"/\" + i.database);\n return {\n referenceValue: Te(t.__ || e.U, t.f_.path)\n };\n }\n if (void 0 === t && e.ignoreUndefinedProperties) return null;\n throw e.i_(\"Unsupported field value: \" + M(t));\n }(t, e);\n}", "title": "" } ]
8d9de6cee7731aba15c49e916b93e43b
Return the set of all the keys that changed (either added, removed or modified).
[ { "docid": "be2d88321fcff9eb8a3b184a6b868ba2", "score": "0.0", "text": "function objectDiff(obj1, obj2) {\n var diff, update = {}, enter = {}, exit = {}, all = {},\n name,\n obj1 = obj1 || {};\n\n for (name in obj1) {\n if (!(name in obj2))\n exit[name] = all[name] = true;\n else if (obj1[name] != obj2[name])\n update[name] = all[name] = true;\n }\n\n for (name in obj2) {\n if (!(name in obj1))\n enter[name] = all[name] = true;\n }\n\n diff = {\n all: all,\n update: update,\n enter: enter,\n exit: exit\n };\n\n return diff;\n}", "title": "" } ]
[ { "docid": "23d46577ee89aadb0ef9937af24f8688", "score": "0.6588285", "text": "keys() {\n const ret = [];\n for (let i = 0; i < this.hashTable.length; ++i)\n for (let slot = this.hashTable[i]; slot; slot = slot.next)\n if (!slot.deleted)\n ret.push(slot.key);\n return ret;\n }", "title": "" }, { "docid": "e905b84df754bed91d83b875556bfc30", "score": "0.65785605", "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": "83e52fad1bbf66448548a8df42e99d2e", "score": "0.6291024", "text": "keys () {\n\t\treturn this.cache.keys();\n\t}", "title": "" }, { "docid": "0478d1d0fa4bc6c3048141cf8397d550", "score": "0.61800396", "text": "get keys() {\n return Object.keys(this._keyMap);\n }", "title": "" }, { "docid": "e54098b6cbb391f91f9fe87957219e84", "score": "0.61800325", "text": "keys() {\n return this.hashMap.keys();\n }", "title": "" }, { "docid": "fa57edda27049efe832211e1e4c3540d", "score": "0.61392635", "text": "keys() {\n\t\treturn Object.keys(this.state());\n\t}", "title": "" }, { "docid": "3c7b37859a15b97981b486bd08f76d4b", "score": "0.61298424", "text": "allKeys() {\n return this.k2s.keys();\n }", "title": "" }, { "docid": "e8276c3d5fe4ac84c2a474203d5cd936", "score": "0.6053399", "text": "keys() {\n return this.values();\n }", "title": "" }, { "docid": "15b7a7d434ef1622bed2224c6b355b22", "score": "0.59751815", "text": "getChangedAttributes() {\n return Object.keys(this.$changed);\n }", "title": "" }, { "docid": "3e03d3ff40dd9bedcfcca8ee1513508f", "score": "0.5961894", "text": "_changedKeys(updates) {\n var changedKeys = [];\n\n if (updates) {\n var original = void 0,\n i = void 0,\n value = void 0,\n key = void 0;\n var keys = Object.keys(updates);\n var length = keys.length;\n var hasAttrs = this.hasChangedAttributes();\n var attrs = void 0;\n if (hasAttrs) {\n attrs = this._attributes;\n }\n\n original = emberAssign(Object.create(null), this._data);\n original = emberAssign(original, this._inFlightAttributes);\n\n for (i = 0; i < length; i++) {\n key = keys[i];\n value = updates[key];\n\n // A value in _attributes means the user has a local change to\n // this attributes. We never override this value when merging\n // updates from the backend so we should not sent a change\n // notification if the server value differs from the original.\n if (hasAttrs === true && attrs[key] !== undefined) {\n continue;\n }\n\n if (!Ember.isEqual(original[key], value)) {\n changedKeys.push(key);\n }\n }\n }\n\n return changedKeys;\n }", "title": "" }, { "docid": "08d6fefeb8087d581ab5f50cab306326", "score": "0.5881689", "text": "function sharedKeys() {\n return sharedIterator(this._keys);\n }", "title": "" }, { "docid": "33859fa57e14d19556eeee2667c248fd", "score": "0.5838312", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "33859fa57e14d19556eeee2667c248fd", "score": "0.5838312", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "33859fa57e14d19556eeee2667c248fd", "score": "0.5838312", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "33859fa57e14d19556eeee2667c248fd", "score": "0.5838312", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "33859fa57e14d19556eeee2667c248fd", "score": "0.5838312", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "8f4577c0a773e67d4916be94a84f2892", "score": "0.5831659", "text": "get keys() {}", "title": "" }, { "docid": "c213035efef6e22f29e3b87a95372968", "score": "0.58004034", "text": "keys()\n\t{\n\t\tvar it = super.keys();\n\t\tvar res = new Runtime.Collection();\n\t\tvar next = it.next();\n\t\twhile (!next.done)\n\t\t{\n\t\t\tres.push( next.value );\n\t\t\tnext = it.next();\n\t\t}\n\t\treturn res;\n\t}", "title": "" }, { "docid": "39624dc86b571af23503dfebecfa274d", "score": "0.57872754", "text": "function keyDiff(a, b) {\n var res = new Set();\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = a.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n if (!b.has(key)) {\n res.add(key);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return res;\n}", "title": "" }, { "docid": "15a6747c69d631ab21ad05ecc2914fa2", "score": "0.576467", "text": "getOldIds() {\n return [...this._existing.keys()];\n }", "title": "" }, { "docid": "15a6747c69d631ab21ad05ecc2914fa2", "score": "0.576467", "text": "getOldIds() {\n return [...this._existing.keys()];\n }", "title": "" }, { "docid": "72bbc3f6b8f95f8dc0ccc9701e337a12", "score": "0.57432675", "text": "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "title": "" }, { "docid": "94a77fc1d4f1cb63791772c2d0a225ae", "score": "0.5717078", "text": "function keys() {\n return this.pluck('key');\n }", "title": "" }, { "docid": "215601e17870f46249337d95117d5544", "score": "0.5692963", "text": "function diffSets(hash) {\n return sets => _rxjsCompatUmdMin.Observable.concat(_rxjsCompatUmdMin.Observable.of(new Set()), // Always start with no items with an empty set\n sets).pairwise().map(([previous, next]) => ({\n added: (0, _collection.setDifference)(next, previous, hash),\n removed: (0, _collection.setDifference)(previous, next, hash)\n })).filter(diff => diff.added.size > 0 || diff.removed.size > 0);\n}", "title": "" }, { "docid": "5a3ebec8a92b57f743de5313a8bb54ec", "score": "0.5621349", "text": "keys() {\n let keysArr = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; i++) {\n if (!keysArr.includes(this.keyMap[i][j][1])) {\n keysArr.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return keysArr;\n }", "title": "" }, { "docid": "d41725ed79114bc9eb46fb4b96abe965", "score": "0.5615181", "text": "getUnchangedAttributes() {\n return Object.keys(this.$attributes).filter(key => !(key in this.$changed));\n }", "title": "" }, { "docid": "e5014d8c4d508970651546cb9516e0f7", "score": "0.5597689", "text": "function _checkUpdatedKeys(){\n var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),\n newCrc32List;\n\n _reloadData();\n newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));\n\n var key,\n updated = [],\n removed = [];\n\n for(key in oldCrc32List){\n if(oldCrc32List.hasOwnProperty(key)){\n if(!newCrc32List[key]){\n removed.push(key);\n continue;\n }\n if(oldCrc32List[key] != newCrc32List[key] && String(oldCrc32List[key]).substr(0,2) == \"2.\"){\n updated.push(key);\n }\n }\n }\n\n for(key in newCrc32List){\n if(newCrc32List.hasOwnProperty(key)){\n if(!oldCrc32List[key]){\n updated.push(key);\n }\n }\n }\n\n _fireObservers(updated, \"updated\");\n _fireObservers(removed, \"deleted\");\n }", "title": "" }, { "docid": "8748aaebd272856616353035ba3f0018", "score": "0.5565431", "text": "function getStoreKeys() {\n var k,\n keys = {};\n for (k in store) {\n keys[k] = true;\n }\n return keys;\n }", "title": "" }, { "docid": "8748aaebd272856616353035ba3f0018", "score": "0.5565431", "text": "function getStoreKeys() {\n var k,\n keys = {};\n for (k in store) {\n keys[k] = true;\n }\n return keys;\n }", "title": "" }, { "docid": "8748aaebd272856616353035ba3f0018", "score": "0.5565431", "text": "function getStoreKeys() {\n var k,\n keys = {};\n for (k in store) {\n keys[k] = true;\n }\n return keys;\n }", "title": "" }, { "docid": "949ea24a48dc3e3870a55f764ef42102", "score": "0.55513823", "text": "get keys() {\n return Object.keys(this.raw());\n }", "title": "" }, { "docid": "b8ffcee160d8f9f3e34471d2d52cb386", "score": "0.5538025", "text": "function getSetDifferencesTest() {\n return this.getSetDifferences(36, [3, 36]);\n}", "title": "" }, { "docid": "b6bcc83c6e8a16f211a1ee39a954d17a", "score": "0.5503715", "text": "allKeys() {\n return null;\n }", "title": "" }, { "docid": "a789d7858d979aa4c0c2bdee73aa442e", "score": "0.5500845", "text": "function IKeySet() {\n weavedata.IKeyFilter.call(this);\n\n /**\n * This is a list of the IQualifiedKey objects that define the key set.\n */\n Object.defineProperty(this, 'keys', {\n get: function () {\n return []\n },\n configurable: true\n })\n }", "title": "" }, { "docid": "95519d5ce61534cc4860f9bf77d5167d", "score": "0.5496989", "text": "function sharedKeys() {\n\t return sharedIterator(this._itp, this._keys);\n\t }", "title": "" }, { "docid": "54e0598b25e94236c92a1055b2a98575", "score": "0.54806423", "text": "getKeys() {\n this.logger.trace(\"Retrieving all cache keys\");\n // read cache\n const cache = this.getCache();\n return [...Object.keys(cache)];\n }", "title": "" }, { "docid": "849fd42a0d291c7161b17b399f7c5110", "score": "0.5454514", "text": "difference(otherSet) {\n const differenceSet = new mySet()\n const firstSet = this.values()\n\n firstSet.forEach(e => {\n if (!otherSet.has(e)) {\n differenceSet.add(e)\n }\n })\n return differenceSet\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "79e06d95b4f0db90a43ba1f9b75c862d", "score": "0.5453455", "text": "function emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n }", "title": "" }, { "docid": "a19d978fdd896bd4e0c018804c42701e", "score": "0.54301304", "text": "keys() {\n let keysArray = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n if (!keysArray.includes(this.keyMap[i][j][0])) {\n keysArray.push(this.keyMap[i][j][0]);\n }\n }\n }\n }\n return keysArray;\n }", "title": "" }, { "docid": "97f461a9863d4a3407aa19f62ab2b015", "score": "0.539436", "text": "keys() {\n\t\tvar chains = [];\n\t\tvar currentChain = [];\n\t\n\t\tthis._keysPrivate(currentChain, chains);\n\t\treturn chains;\n\t}", "title": "" }, { "docid": "a43d9dbb18a4c0c1a743d3de58e873d7", "score": "0.5386423", "text": "setDifference(s, t) {\n if (!(s instanceof Set))\n s = new Set(s);\n if (!(t instanceof Set))\n t = new Set(t);\n\n const diff = new Set();\n for (let s_item of s) {\n if (!t.has(s_item)) {\n diff.add(s_item);\n }\n }\n\n return diff;\n }", "title": "" }, { "docid": "696d5b1f8c69d77499612914104f7d40", "score": "0.5357193", "text": "get selectedKeys() {\n return this.state.selectedKeys === 'all' ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;\n }", "title": "" }, { "docid": "b5cd60e4509e98047d7784f1bc8b890f", "score": "0.53565836", "text": "function __keys__ () {\n\t\tvar keys = []\n\t\tfor (var attrib in this) {\n\t\t\tif (!__specialattrib__ (attrib)) {\n\t\t\t\tkeys.push (attrib);\n\t\t\t} \n\t\t}\n\t\treturn keys;\n\t}", "title": "" }, { "docid": "b4f2db44ca40a65c37b41c28b5926f20", "score": "0.53336406", "text": "static getUncommittedChanges() {\r\n const changes = [];\r\n changes.push(...VersionControl._getUntrackedChanges());\r\n changes.push(...VersionControl._getDiffOnHEAD());\r\n return changes.filter(change => {\r\n return change.trim().length > 0;\r\n });\r\n }", "title": "" }, { "docid": "57dcc040d55ecf8214f5476185543551", "score": "0.5319376", "text": "function checkDifferences(prev, curr) {\r\n let diff = [];\r\n for (let [key, value] of Object.entries(curr)) {\r\n if (curr[key] != prev[key]) {\r\n diff.push(key);\r\n }\r\n }\r\n return diff;\r\n}", "title": "" }, { "docid": "b70a9ece617f903c47a6ace0aaa9c006", "score": "0.53067166", "text": "getKeys() {\n errors.throwNotImplemented(\"returning the keys of a collection\");\n }", "title": "" }, { "docid": "e186b9a365997fd7cb4f5c88d20f6f63", "score": "0.52973944", "text": "static getUncommittedChanges() {\n const changes = [];\n changes.push(...VersionControl._getUntrackedChanges());\n changes.push(...VersionControl._getDiffOnHEAD());\n return changes.filter(change => {\n return change.trim().length > 0;\n });\n }", "title": "" }, { "docid": "366baa70e786cd998e741a559e1fd4de", "score": "0.5246812", "text": "getAllDependencies(keys, exclude) {\n var _a, _b;\n if (typeof keys === 'string') {\n return (_b = (_a = this.nodes[keys]) === null || _a === void 0 ? void 0 : _a.getAllDependencies(exclude)) !== null && _b !== void 0 ? _b : [];\n }\n else {\n const set = new Set();\n for (const key of keys) {\n const dependencies = this.getAllDependencies(key, exclude);\n for (const dependency of dependencies) {\n set.add(dependency);\n }\n }\n return [...set];\n }\n }", "title": "" }, { "docid": "a460cca7e32e9f63f8f3cae17a22b856", "score": "0.5223234", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "a460cca7e32e9f63f8f3cae17a22b856", "score": "0.5223234", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "a460cca7e32e9f63f8f3cae17a22b856", "score": "0.5223234", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "a460cca7e32e9f63f8f3cae17a22b856", "score": "0.5223234", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "a460cca7e32e9f63f8f3cae17a22b856", "score": "0.5223234", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "14a55bd2f6ee1d5c8d9bb13674097dbf", "score": "0.5211755", "text": "keys() {\r\n return Object.keys(this._documents);\r\n }", "title": "" }, { "docid": "14a55bd2f6ee1d5c8d9bb13674097dbf", "score": "0.5211755", "text": "keys() {\r\n return Object.keys(this._documents);\r\n }", "title": "" }, { "docid": "80e63e34fb0d5ab51b5ff34e84886d13", "score": "0.5193365", "text": "function keys () {\n var result = [];\n\n window.document.cookie.split(/; /).each(function (cookie) {\n cookie = cookie.split(/=/);\n\n result.push(cookie[0]);\n });\n\n return result.uniq();\n }", "title": "" }, { "docid": "803f15d8918d874a045ee7a84b2963f5", "score": "0.5179488", "text": "keys()\n {\n // Local variable dictionary\n let keys = new LinkedList();\n\n // Get the keys\n for (let counter = 0; counter < this.#table.getLength(); counter++)\n {\n // Get the index linked list\n let listIndex = this.#table.peekIndex(counter);\n\n // Get the keys in the list index\n for (let count = 0; count < listIndex.getLength(); count++)\n {\n // Get the key and value pair\n let hashEntry = listIndex.peekIndex(count);\n keys.append(hashEntry.key.key);\n }\n }\n\n // Return the keys\n return keys;\n }", "title": "" }, { "docid": "ae5be431000d24df7d3fd5fedf5b83e2", "score": "0.5165876", "text": "keys() {\n this.init();\n return Array.from(this.normalizedNames.values());\n }", "title": "" }, { "docid": "6781e5ba371438d1cf308e0afb0e7587", "score": "0.5134066", "text": "function IterableChanges() {}", "title": "" }, { "docid": "6781e5ba371438d1cf308e0afb0e7587", "score": "0.5134066", "text": "function IterableChanges() {}", "title": "" }, { "docid": "6781e5ba371438d1cf308e0afb0e7587", "score": "0.5134066", "text": "function IterableChanges() {}", "title": "" }, { "docid": "1a6798117bbfb8d4873591d9c6ea6aef", "score": "0.51221675", "text": "getKeys() {\n return this.keys;\n }", "title": "" }, { "docid": "83b3ed1b3c51a1bb8d3ca62455b1bd45", "score": "0.5121183", "text": "keys (includeExpired) {\n // create list to return\n var ret = []\n\n // iterate over storage keys to find all non-expiration keys\n var that = this\n this._iterKeys(function (storageKey) {\n // if its not a timestamp key, skip it\n if (storageKey.indexOf(that._expiration_key_prefix) !== 0) {\n // add to return list, but only if including expired keys or if not expired yet\n if (includeExpired || !that.isExpired(storageKey)) {\n ret.push(storageKey)\n }\n }\n })\n\n // return keys\n return ret\n }", "title": "" }, { "docid": "a35fd10c8c4ac05698264ac6d703d037", "score": "0.5118275", "text": "function distinctUntilKeyChanged(key, compare) {\n return distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });\n}", "title": "" }, { "docid": "4c815e9669462a06e629a70c9f4fcddf", "score": "0.51176155", "text": "function allKeys(obj) {\n let keys = [];\n \n getProtoChain(obj).forEach(proto =>\n (allOwnKeys(proto).forEach((key) => {\n if (!keys.includes(key))\n keys.push(key);\n }))\n );\n\n return keys;\n}", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.51132494", "text": "function IterableChanges() { }", "title": "" }, { "docid": "f743068b563bb3880fde8ee5b5a44d4f", "score": "0.51132494", "text": "function IterableChanges() { }", "title": "" }, { "docid": "97bd677cb59edcaac8b5503e5c01a3bf", "score": "0.5112086", "text": "function changes(obj1, obj2){\n return _.reduce(obj1, function(result, value, key) {\n return obj2 && _.isEqual(value, obj2[key]) ? result : result.concat(key);\n }, [])\n}", "title": "" }, { "docid": "53f06257411ec856847c7aa1c925a3b7", "score": "0.509314", "text": "filterChangeSet(changeSet) {\n return excludeEmptyChangeSetItems(changeSet);\n }", "title": "" }, { "docid": "53f06257411ec856847c7aa1c925a3b7", "score": "0.509314", "text": "filterChangeSet(changeSet) {\n return excludeEmptyChangeSetItems(changeSet);\n }", "title": "" }, { "docid": "67166f38f8f17c92a48851e98405ec9d", "score": "0.50888747", "text": "async keys () {\n const results = await this.client.zRange(this.ZSET_KEY, 0, -1);\n return results.map(key => key.slice(`${this.namespace}`.length));\n }", "title": "" }, { "docid": "0f0a4210081236204352c6858dd50a0f", "score": "0.508847", "text": "difference(other) {\n var diff = new SparseSet;\n\n for(var i=0, m=this.size; i < m; i++) {\n if (!other.has(this[i].id))\n diff.add(this[i]);\n }\n\n return diff;\n }", "title": "" }, { "docid": "b4b559b91c6f38e53fe52569bffa68a7", "score": "0.5084352", "text": "difference(set) {\n let tempSet = new Set();\n for (let i = 0; i < this.dataStore.length; i++) {\n if (!set.contain(this.dataStore[i])) {\n tempSet.add(this.dataStore[i]);\n }\n }\n return tempSet.show();\n }", "title": "" }, { "docid": "fb608feb1f38444da6dea526ada02c3f", "score": "0.50830895", "text": "getKeys() {\n return(this.keys);\n }", "title": "" }, { "docid": "d1fcb859240cc377bffb07f77a756018", "score": "0.5076053", "text": "function getSrcFiles () {\n return Object.keys(this._.CHANGEMAP);\n}", "title": "" }, { "docid": "5e016cebc89a37cce0ba9fc7f9b449dd", "score": "0.5066997", "text": "function getAllKeys(rows) {\n const keys = new Set();\n for (const row of rows) {\n // avoid crash if row is null or undefined\n if (row) {\n // only enumerable properties\n for (const key in row) {\n // only own properties\n if (Object.prototype.hasOwnProperty.call(row, key)) {\n // unique properties, in the order they appear\n keys.add(key);\n }\n }\n }\n }\n return Array.from(keys);\n}", "title": "" }, { "docid": "930958ebc6731390604ed023758be8fc", "score": "0.50618917", "text": "keys() {\n const result = [];\n for (let i = 0; i < this.map.length; i += 1) {\n if (this.map[i] !== undefined) {\n for (let j = 0; j < this.map[i].length; j += 1) {\n const key = this.map[i][j][0];\n result.push(key);\n }\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "79641cf675fe9117f8f3d56f180e7df9", "score": "0.5054895", "text": "function IterableChanges(){}", "title": "" }, { "docid": "acd9dca63be1ffbb9d34626aa9eb9bca", "score": "0.5040672", "text": "function oldNotInNew() {\n oldNodes = new Set();\n for (const [examName, examValue] of Object.entries(oldGraphPoints)) {\n for (const [gradeName, node] of Object.entries(examValue)) {\n if (!(gradeName in newGraphPoints[examName])) {\n oldNodes.add([examName, gradeName, node.value].toString());\n }\n else if (node.value !== newGraphPoints[examName][gradeName][\"value\"]) {\n oldNodes.add([examName, gradeName, node.value].toString());\n }\n }\n }\n return oldNodes\n}", "title": "" }, { "docid": "9856f6bb2cadfdcb409e878fb8178c0e", "score": "0.5031482", "text": "getAllNames() {\n return Array.from(this.commitPerName.keys());\n }", "title": "" }, { "docid": "734cd21875b5f689bccde7691d0db9b9", "score": "0.50270957", "text": "function getWatch() {\n var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n var watch = {};\n keys.forEach(function (k) {\n watch[k] = function () {\n this.needSyncKeys[k] = true;\n };\n });\n return watch;\n}", "title": "" }, { "docid": "d542ae6e29ac96a0d8156ac3dabdd8a8", "score": "0.5017654", "text": "function differenceSet(setA, setB) {\n var difference = new Set(setA); \n for (var elem of setB) {\n difference.delete(elem); \n }\n return difference; \n}", "title": "" }, { "docid": "e743db4129a1e54650cc0ce3ee7a8486", "score": "0.50174016", "text": "function setDifference(s1, s2) {\n const difference = new Set();\n for (const element of s1) {\n if ( ! s2.has(element) ) {\n difference.add(element)\n }\n }\n return difference;\n}", "title": "" }, { "docid": "05d6d534e7aec43f88ff60def0cc7d27", "score": "0.5012843", "text": "get changed() {\n return this._changed;\n }", "title": "" }, { "docid": "43942e9de79337cffd81affeec58f006", "score": "0.50121176", "text": "* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}", "title": "" }, { "docid": "cf38c7826649c674b39b219e1775be1e", "score": "0.5009215", "text": "function dirtyList() {\n var ref = UserRecords.dirtySubSet();\n return ref;\n }", "title": "" }, { "docid": "dcf470d975adc922648cfa7c022a5b68", "score": "0.50064206", "text": "keys() {\n let keysArr = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n //loop through out entire hashmap\n if (this.keyMap[i]) {\n //check if exist and check for subarrays\n for (let j = 0; j < this.keyMap[i].length; j++) {\n //loop through subarrays\n if (!keysArr.includes(this.keyMap[i][j][0])) {\n //make sure there are not duplicates of keys in oour hashmap\n keysArr.push(this.keyMap[i][j][0]); //push to our initialized arary because we want to keep in insisde of DS\n }\n }\n }\n }\n return keysArr;\n }", "title": "" }, { "docid": "6f43dd014c4d98be359465370c1ed8a8", "score": "0.5006074", "text": "function getWatch() {\n var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var watch = {};\n keys.forEach(function (k) {\n watch[k] = function () {\n this.needSyncKeys[k] = true;\n };\n });\n return watch;\n}", "title": "" }, { "docid": "0968cd3bdf536659f72da0cb8a635b65", "score": "0.50015473", "text": "getKeys() {\n return this.keys;\n }", "title": "" }, { "docid": "736d391a7082fcbef1f5db5fc9eb1ca4", "score": "0.49861732", "text": "public function keys()\n {\n return array_keys($this->parameters);\n }", "title": "" }, { "docid": "1512bf030f88dd40437b8a30d0a1a467", "score": "0.49843907", "text": "hasChanged(key) {\n return !key ? this.getChangedAttributes().length > 0 : !isUndefined(this.$changed[key]);\n }", "title": "" }, { "docid": "998fc5e07c0466c443395a1403bf2c4e", "score": "0.49801418", "text": "refDiff() {\n let res = {\n toAdd: [],\n toRemove: [],\n toUpdate: [],\n };\n Object.keys(this.frameNew).forEach((key) => {\n !this.frameOld[key] && res.toAdd.push(this.frameNew[key]);\n this.frameOld[key] && res.toUpdate.push(this.frameNew[key]);\n });\n Object.keys(this.frameOld).forEach((key) => {\n !this.frameNew[key] && res.toRemove.push(this.frameOld[key]);\n });\n return res;\n }", "title": "" }, { "docid": "a81cb0587196a034a22e50942ec794d1", "score": "0.49727982", "text": "arrayDiff(newArray, oldArray) {\n var diffArray = [], difference = [];\n for (var i = 0; i < newArray.length; i++) {\n diffArray[newArray[i]] = true;\n }\n for (var j = 0; j < oldArray.length; j++) {\n if (diffArray[oldArray[j]]) {\n delete diffArray[oldArray[j]];\n } else {\n diffArray[oldArray[j]] = true;\n }\n }\n for (var key in diffArray) {\n difference.push(key);\n }\n return difference;\n }", "title": "" } ]
c8665cca11ecdcf019ad53eed2f3bf04
draw a colored line between two points
[ { "docid": "a22a56cb6789412af2e730a2584c0f61", "score": "0.7392002", "text": "function drawLine(posA, posB, thickness=.1, color)\n{\n const halfDelta = vec2((posB.x - posA.x)*.5, (posB.y - posA.y)*.5);\n const size = vec2(thickness, halfDelta.length()*2);\n drawRect(posA.add(halfDelta), size, color, halfDelta.angle());\n}", "title": "" } ]
[ { "docid": "6330ace867f9d3e38ebffcab92acde18", "score": "0.78484887", "text": "function drawLine(cxt, x1, y1, x2, y2, color) {\n cxt.beginPath();\n cxt.strokeStyle = \"rgba(\" + color[0] + \",\" + color[1] + \",\" + color[2] + \",\" + 255 + \")\";\n cxt.lineWidth = 2;\n cxt.moveTo(x1, y1);\n cxt.lineTo(x2, y2);\n cxt.stroke();\n}", "title": "" }, { "docid": "8bc881639fcee143caa53336351f7c14", "score": "0.77017343", "text": "function drawLine( p1, p2, canv, color ) {\n var color = color || 'black';\n var canvas = document.getElementById( canv );\n var ctx = canvas.getContext( \"2d\" );\n\n ctx.beginPath();\n ctx.moveTo( p1.x, p1.y );\n ctx.lineTo( p2.x, p2.y );\n ctx.lineWidth = 1; // we really just want thin lines for now\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "title": "" }, { "docid": "b784c943ac70926bc959dc0693657c8c", "score": "0.76727265", "text": "function drawLine(x1, y1, x2, y2, r, g, b, a) {\n\tx1 = x1 | 0;\n\ty1 = y1 | 0;\n\tx2 = x2 | 0;\n\ty2 = y2 | 0;\n\t\n var dx = Math.abs(x2 - x1);\n var dy = Math.abs(y2 - y1);\n\n var sx = ( x1 < x2 ) ? 1 : -1;\n var sy = ( y1 < y2 ) ? 1 : -1;\n\n var err = dx - dy;\n\n var lx = x1;\n var ly = y1; \n\n while (true) {\n if (lx > 0 && lx < w && ly > 0 && ly < h){\n setPixel(lx, ly, r, g, b, a);\n }\n\t\t\n if ((lx === x2) && (ly === y2))\n break;\n\n\t\tvar e2 = 2 * err;\n\n\t\tif (e2 > -dx){\n err -= dy; \n lx += sx;\n }\n\n\t\tif (e2 < dy){\n err += dx; \n ly += sy;\n }\n }\n}", "title": "" }, { "docid": "1e1ac63f27c30189d6ba88aa91a6dc54", "score": "0.76609385", "text": "function line(x,y,x2,y2,c=null,a=1) {\n\tif (c != null) { color(c,a) }\n\tctx.beginPath()\n\tctx.moveTo(x,y)\n\tctx.lineTo(x2,y2)\n\tctx.stroke()\n}", "title": "" }, { "docid": "085ee86640e003a6b3fbefefdcda2bf6", "score": "0.7649858", "text": "function DrawLine(p1, p2, color, image) {\n\n\tvar xD = p2.x - p1.x;\n\tvar yD = p2.y - p1.y;\n\tif((xD == 0) && (yD == 0)) {\n\t\tDrawPixel(p1.x, p1.y, color, image);\n\t\treturn;\n\t}\n\tvar absX = Math.abs(xD);\n\tvar absY = Math.abs(yD);\n\tvar g = (absX > absY) ? absX : absY;\n\n\tvar xStep = xD / g;\n\tvar yStep = yD / g;\n\n\tvar curX = p1.x;\n\tvar curY = p1.y;\n\n\tfor(var i = 0; i < g; i += 1) {\n\t\tDrawPixel(Math.floor(curX), Math.floor(curY), color, image);\n\t\tcurX += xStep;\n\t\tcurY += yStep;\n\t}\n\n}", "title": "" }, { "docid": "daf1d29fd6d2d31c835d86568c19a2e7", "score": "0.76460195", "text": "function drawLine( x1, y1, x2, y2 ){\n ctx.beginPath()\n ctx.moveTo(x1, y1)\n ctx.lineTo(x2, y2)\n ctx.strokeStyle = color\n ctx.lineWidth = size * 2\n ctx.stroke()\n}", "title": "" }, { "docid": "0fe4de8c59efc872d94f572e93a289e6", "score": "0.75706077", "text": "drawLine(x_1,y_1,x_2,y_2, lw){\r\n ctx.lineWidth = lw;\r\n ctx.strokeStyle= \"rgb(255,255,255)\";\r\n ctx.beginPath();\r\n ctx.moveTo(x_1, y_1);\r\n ctx.lineTo(x_2 , y_2);\r\n ctx.stroke();\r\n }", "title": "" }, { "docid": "130cb83aa219d9fe6c5d33b21aa749b0", "score": "0.7421906", "text": "function drawLine(ctx, startX, startY, endX, endY, color){\n ctx.save();\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(startX,startY);\n ctx.lineTo(endX,endY);\n ctx.stroke();\n ctx.restore();\n}", "title": "" }, { "docid": "9809e6588e0fde126452cf321d397a5d", "score": "0.73941106", "text": "function lineDraw (x1, y1, x2, y2)\n{\n var dx = Math.abs(x2 - x1);\n var dy = Math.abs(y2 - y1);\n var sx = (x1 < x2) ? 1 : -1;\n var sy = (y1 < y2) ? 1 : -1;\n var err = dx - dy;\n \n while( true ){\n pixelDraw(x1, y1);\n if ( (x1 == x2) && (y1 == y2) ) break;\n var e2 = 2 * err;\n if (e2 > -dy) { \n err -= dy; \n x1 += sx; \n }\n if (e2 < dx) { \n err += dx; \n y1 += sy; \n }\n }\n}", "title": "" }, { "docid": "9f39ac0c3ec5fd63db2fab2dcc3eed20", "score": "0.7358961", "text": "function drawLine(x1, y1, x2, y2, width, color)\r\n\t{\r\n\t\tx1 = Math.round(x1);\r\n\t\ty1 = Math.round(y1);\r\n\t\tx2 = Math.round(x2);\r\n\t\ty2 = Math.round(y2);\r\n\r\n\t\tctx.strokeStyle = color;\r\n\t\tctx.lineWidth = width;\r\n\t\tctx.beginPath();\r\n\r\n\t\tctx.moveTo(x1, y1);\r\n\t\tctx.lineTo(x2, y2);\r\n\r\n\t\tctx.stroke();\r\n\t\tctx.closePath();\r\n\t}", "title": "" }, { "docid": "24d80e2e9c8fecf69fbfa1120f6578dc", "score": "0.73235327", "text": "function drawLine (color, thickness, x1, y1, x2, y2) {\n context.strokeStyle = color;\n context.lineWidth = thickness;\n \n context.beginPath();\n context.moveTo(x1, y1)\n context.lineTo(x2, y2);\n context.stroke();\n}", "title": "" }, { "docid": "cccaea1b2b3898fd36f4dbee2288437b", "score": "0.73167473", "text": "function segment(x1, y1, x2, y2, color) {\n stroke(color);\n strokeWeight(4);\n line(x1, y1, x2, y2);\n}", "title": "" }, { "docid": "2f6659e8d27fa4d183ba1641bf13026c", "score": "0.7314291", "text": "function drawLine(x1, y1, x2, y2) {\n drawLineAnimation(x1, y1, x2, y2, currentColor, lineSize, true);\n }", "title": "" }, { "docid": "d88b1d7b607ac4228d8b24ad0855a024", "score": "0.72902906", "text": "function rasterize_line(point1, point2, color) {\n let x1 = point1[0];\n let x2 = point2[0];\n let y1 = point1[1];\n let y2 = point2[1];\n\n // Swap X and Y if slope > 1\n let swap = false;\n if (Math.abs(x2 - x1) < Math.abs(y2 - y1)) {\n [x1, y1] = [y1, x1]; // EMCA6 syntax\n [x2, y2] = [y2, x2];\n swap = true;\n }\n\n // Swap points if first point is further right\n if (x1 > x2) {\n [x1, x2] = [x2, x1];\n [y1, y2] = [y2, y1];\n }\n\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n // Move Y down and swap dy if slope is negative\n let step = 1;\n if (dy < 0) {\n step = -1;\n dy = -dy;\n }\n\n let y = y1;\n let p = (2 * dy) - dx;\n const pixels = [];\n for (let x = x1; x <= x2; x++) {\n if (swap) {\n pixels.push(vec2(y, x));\n // noinspection JSSuspiciousNameCombination\n write_pixel(y, x, color);\n } else {\n pixels.push(vec2(x, y));\n write_pixel(x, y, color);\n }\n\n if (p >= 0) {\n y += step;\n p += 2 * (dy - dx);\n } else {\n p += 2 * dy;\n\n }\n }\n\n // Returns a list of colored pixels\n return pixels;\n}", "title": "" }, { "docid": "654e0abab7f9dd2cc0f3a7b8f7999bf8", "score": "0.72795165", "text": "function line(ctx, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n}", "title": "" }, { "docid": "654e0abab7f9dd2cc0f3a7b8f7999bf8", "score": "0.72795165", "text": "function line(ctx, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n}", "title": "" }, { "docid": "654e0abab7f9dd2cc0f3a7b8f7999bf8", "score": "0.72795165", "text": "function line(ctx, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n}", "title": "" }, { "docid": "654e0abab7f9dd2cc0f3a7b8f7999bf8", "score": "0.72795165", "text": "function line(ctx, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n}", "title": "" }, { "docid": "64825696632cdd43f9bd92ec6ccf3bfa", "score": "0.72773904", "text": "function drawLine(startX, startY, startZ, endX, endY, endZ, lineColor) {\r\n\r\n var points = [];\r\n points.push( new THREE.Vector3( startX, startY, startZ ));\r\n points.push( new THREE.Vector3( endX, endY, endZ ));\r\n \r\n let lineMaterial = new THREE.MeshBasicMaterial( { color: lineColor } );\r\n const lineGeometry = new THREE.BufferGeometry().setFromPoints( points );\r\n var line = new THREE.Line( lineGeometry, lineMaterial );\r\n\r\n scene.add( line );\r\n\r\n return line;\r\n}", "title": "" }, { "docid": "9fa1d7de26212dfbf52a074da11a2511", "score": "0.7241157", "text": "function line(x0, y0, x1, y1) {\n var dx = Math.abs(x1 - x0);\n var dy = Math.abs(y1 - y0);\n var sx = (x0 < x1) ? 1 : -1;\n var sy = (y0 < y1) ? 1 : -1;\n var err = dx - dy;\n while(true) {\n setPixel(x0, y0);\n if ((x0 === x1) && (y0 === y1)) { break };\n var e2 = 2 * err;\n if (e2 > -dy) { err -= dy; x0 += sx; }\n if (e2 < dx) { err += dx; y0 += sy; }\n }\n}", "title": "" }, { "docid": "bca18b347e4e1bb79397458b6e55f0c3", "score": "0.7230748", "text": "function drawLine(begin, end, color) {\n canvas.beginPath();\n canvas.moveTo(begin.x, begin.y);\n canvas.lineTo(end.x, end.y);\n canvas.lineWidth = 4;\n canvas.strokeStyle = color;\n canvas.stroke();\n}", "title": "" }, { "docid": "e794509d60b1ffaee77743f8c19c4794", "score": "0.7213252", "text": "function line(x1, y1, x2, y2, color = 'white', width = 1) {\n ctx.strokeStyle = color;\n ctx.lineWidth = width;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n}", "title": "" }, { "docid": "74669dd4c2ca5ffffb4ee33317464af7", "score": "0.7210146", "text": "function line (x1, y1, x2, y2) {\r\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\r\n }", "title": "" }, { "docid": "f9e71694cca064650e1157352c2fd065", "score": "0.7199318", "text": "function drawLine(svg, p1, p2, className) {\n svg.append(\"line\")\n .attr(\"x1\", xScale(p1[0]))\n .attr(\"y1\", yScale(p1[1]))\n .attr(\"x2\", xScale(p2[0]))\n .attr(\"y2\", yScale(p2[1]))\n .attr(\"class\", className);\n}", "title": "" }, { "docid": "ac6386cdab6330161b91e3f3c19fc890", "score": "0.7187195", "text": "drawLine(ctx, startX, startY, endX, endY, color){\r\n ctx.save();\r\n ctx.strokeStyle = color;\r\n ctx.beginPath();\r\n ctx.moveTo(startX,startY);\r\n ctx.lineTo(endX, endY);\r\n ctx.stroke();\r\n ctx.closePath();\r\n ctx.restore();\r\n }", "title": "" }, { "docid": "189aa1efff33cec36023edd53bb9c90c", "score": "0.71714383", "text": "function drawLine(x_1,y_1,x_2,y_2){\r\n ctx.beginPath();\r\n ctx.moveTo(x_1, y_1);\r\n ctx.lineTo(x_2 , y_2);\r\n ctx.stroke();\r\n}", "title": "" }, { "docid": "62a2fc5359e1b5be1f26c2594114a903", "score": "0.716677", "text": "function line(x1, x2, y, r, gb) {\n // Using << 2 instead of * 4 allows the minifier to remove the\n // parentheses (<< has lower a precedence than *), saving bytes.\n x1 = (x1 + y * width) << 2;\n x2 = (x2 + y * width) << 2;\n\n // Reuse y as an iteration counter.\n y = 0;\n while (x1 < x2) {\n // (undefined | 0) -> ToInt32(ToNumber(undefined)) -> 0.\n // Therefore we can call line(x1, x2, y) with the rest of the\n // arguments undefined when we want to draw a black line.\n data[x1] = (y < 3) ? 0 : r | 0;\n data[x1+1] = data[x1+2] = (y++ < 3) ? 0 : gb | 0;\n x1 += 4;\n }\n}", "title": "" }, { "docid": "299dc0e5a0acfdb40bb2bf9307997642", "score": "0.71604335", "text": "function drawLine(x1, y1, z1, x2, y2, z2, _color) {\n let lineGeometry = new THREE.Geometry();\n lineGeometry.vertices.push(new THREE.Vector3( x1, y1, z1 ),new THREE.Vector3( x2, y2, z2 ));\n let lineMaterial = new THREE.LineBasicMaterial({color: _color});\n return new THREE.Line( lineGeometry, lineMaterial );\n}", "title": "" }, { "docid": "cbd066a4ed891e2fb6d4828d6da8d5ef", "score": "0.7158253", "text": "function drawLine(startX, startY, endX, endY) {\n ctx.beginPath();\n ctx.fillStyle = '#0000FF';\n ctx.moveTo(startX, startY);\n ctx.lineTo(endX, endY);\n ctx.stroke();\n}", "title": "" }, { "docid": "8e53e21db5fa998f1c3ab0bbbed4e25e", "score": "0.7152534", "text": "function line(ctx, x1, y1, x2, y2) {\n\t ctx.beginPath();\n\t ctx.moveTo(x1, y1);\n\t ctx.lineTo(x2, y2);\n\t ctx.stroke();\n\t}", "title": "" }, { "docid": "9cc58885262825a38487cc689edc053d", "score": "0.7150847", "text": "function drawLine(fromX, fromY, toX, toY, colour) {\n ctx.beginPath();\n ctx.strokeStyle = colour;\n ctx.moveTo(fromX, fromY);\n ctx.lineTo(toX, toY);\n ctx.stroke();\n}", "title": "" }, { "docid": "ae985a45b3dbc019b224588b138c59c5", "score": "0.7147601", "text": "function drawLineSegment(a, b) {\n drawLine([a.x, a.y, b.x, b.y])\n}", "title": "" }, { "docid": "e5a63f44b4353539b93f872a3b278530", "score": "0.71027976", "text": "function drawLine(_x1, _y1, _x2, _y2){\n\tif(_x1 == _x2){\n\t\tif(_y1 == _y2){\n\t\t\treturn;\n\t\t}\n\t\tdrawSegment(_x1, maxY, _x2, minY);\n\t\treturn;\n\t}\n\t\n\tm = (_y1 - _y2) / (_x1 - _x2);\n\tyi = _y1 - (m * _x1);\n\tdrawSegment(minX, (m * minX) + yi, maxX, (m * maxX) + yi);\n}", "title": "" }, { "docid": "6bca4040d42026a21804fb9f89ca78e8", "score": "0.7101343", "text": "function createLine(p1, p2, color) {\n var line, lineGeometry = new THREE.Geometry(),\n lineMat = new THREE.LineBasicMaterial({\n color: color,\n lineWidth: 1\n });\n lineGeometry.vertices.push(p1, p2);\n line = new THREE.Line(lineGeometry, lineMat);\n scene.add(line);\n }", "title": "" }, { "docid": "48c9a48c0f8fa27e35811bee8e71abe1", "score": "0.7099638", "text": "function addLine(Ctx, x1, y1, x2, y2, gpara) {\n var SQR = function(x) { return x * x; }\n\n var r1sq = SQR(x1 - gpara.xc) + SQR(y1 - gpara.yc);\n var r2sq = SQR(x2 - gpara.xc) + SQR(y2 - gpara.yc);\n\n if (r1sq > gpara.r2 && r2sq > gpara.r2) {\n // Both points are below the horizon. Don't plot anything.\n return;\n }\n\n var x1p = x1,\n x2p = x2,\n y1p = y1,\n y2p = y2;\n if (r1sq > gpara.r2 || r2sq > gpara.r2) {\n // Conside a vector R(s) = R1 + s (R2-R1). \n // Here R1 is the position vector of (x1,y1), \n // R2 is the position vector of (x2,y2).\n // Find s between 0 and 1 such that |R(s)|^2 = gpara.r2\n // Need to solve a quadratic equation.\n var R1dotR2 = (x1 - gpara.xc) * (x2 - gpara.xc) + (y1 - gpara.yc) * (y2 - gpara.yc);\n var dR1R2sq = SQR(x1 - x2) + SQR(y1 - y2);\n var q = r1sq - R1dotR2;\n var s, q;\n if (r1sq <= gpara.r2) {\n s = (q + Math.sqrt(q * q + dR1R2sq * (gpara.r2 - r1sq))) / dR1R2sq;\n x2p = x1 + s * (x2 - x1);\n y2p = y1 + s * (y2 - y1);\n } else {\n s = (q - Math.sqrt(q * q + dR1R2sq * (gpara.r2 - r1sq))) / dR1R2sq;\n x1p = x1 + s * (x2 - x1);\n y1p = y1 + s * (y2 - y1);\n }\n }\n\n // Now plot the line from (x1p,y1p) to (x2p,y2p)\n Ctx.beginPath();\n Ctx.moveTo(x1p, y1p);\n Ctx.lineTo(x2p, y2p);\n Ctx.stroke();\n}", "title": "" }, { "docid": "3681c8381bbe24c28a5f2e92bad32d26", "score": "0.7095191", "text": "function myLine(points, drawLineCtx) {\n let X0, Y0, X1, Y1, dx, dy, steps, Xinc, Yinc, X, Y;\n\n // Print (X0,Y0) AND (X1,Y1)\n points.forEach(element => {\n console.log(element);\n });\n\n // Set the coord\n X0 = points[0].x;\n Y0 = points[0].y;\n X1 = points[1].x;\n Y1 = points[1].y;\n console.log(`X0: ${X0} ,Y0: ${Y0} , X1: ${X1}, Y1: ${Y0}`);\n\n // calculate dx , dy\n dx = X1 - X0;\n dy = Y1 - Y0;\n console.log(`dx: ${dx} ,dy: ${dy}`);\n\n steps = Math.abs(dx) > Math.abs(dy) ? Math.abs(dx) : Math.abs(dy);\n console.log(`steps: ${steps}`);\n\n // calculate increment in x & y for each steps\n Xinc = dx / parseFloat(steps);\n Yinc = dy / parseFloat(steps);\n\n // Put pixel for each step\n X = X0;\n Y = Y0;\n for (let i = 0; i <= steps; i++) {\n drawLineCtx.fillRect(X, Y, 1, 1);\n X += Xinc;\n Y += Yinc;\n }\n}", "title": "" }, { "docid": "00b5f275342cba19725e3b53402b183f", "score": "0.7069526", "text": "function line(x1, y1, x2, y2) {\n\t\treturn \"M\" + x1 + \" \" + y1 + \"L\" + x2 + \" \" + y2;\n\t}", "title": "" }, { "docid": "12c64c8b06fc5fec13b8aadad3541e43", "score": "0.7062346", "text": "function drawLine (x1, y1, x2, y2) {\n let line = document.createElement(`line`);\n \n line.setAttribute(`x1`, x1);\n line.setAttribute(`y1`, y1);\n line.setAttribute(`x2`, x2);\n line.setAttribute(`y2`, y2);\n\n field.append(line);\n}", "title": "" }, { "docid": "ab411701d74ac28833cedd0718d394f7", "score": "0.70302045", "text": "function drawLine(x1, y1, x2, y2) {\n\tctx.beginPath();\n\tctx.moveTo(x1, y1); //Start from top-left of chart\n\tctx.lineTo(x2, y2); //Row line\n\tctx.closePath();\n\tctx.stroke();\n}", "title": "" }, { "docid": "cd3a26d082d21f08e93f1e86862c5e09", "score": "0.7025184", "text": "function draw(ctx, color, lineWidth, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.closePath();\n}", "title": "" }, { "docid": "eff9b31f375d77f834ec1e63036ecb46", "score": "0.7020578", "text": "function draw(ctx, color, lineWidth, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.closePath();\n }", "title": "" }, { "docid": "eff9b31f375d77f834ec1e63036ecb46", "score": "0.7020578", "text": "function draw(ctx, color, lineWidth, x1, y1, x2, y2) {\n ctx.beginPath();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.closePath();\n }", "title": "" }, { "docid": "7eb202fe11542ddde049fbac085b20f9", "score": "0.7018709", "text": "function drawLine(ctx, startX, startY, endX, endY){\n ctx.beginPath();\n ctx.moveTo(startX,startY);\n ctx.lineTo(endX,endY);\n ctx.strokeStyle = \"#000000\";\n ctx.stroke();\n}", "title": "" }, { "docid": "da626605f9099bff2b8d7c8abd9e09e4", "score": "0.70172364", "text": "function createLine(x1,y1,x2,y2) {\n temp_line = game.add.graphics(0, 0); \n temp_line.beginFill(0x000000); \n temp_line.lineStyle(1, 0x000000, 1); \n temp_line.moveTo(x1, y1); \n temp_line.lineTo(x2, y2); \n temp_line.endFill();\n temp_line.alpha = 0.2;\n lines.add(temp_line);\n }", "title": "" }, { "docid": "27a5d057b66338d5ae1e1d646cc8fa34", "score": "0.69987065", "text": "function drawLine(context, startX, startY, endX, endY) {\n let dx = Math.abs(endX - startX),\n sx = startX < endX ? 1 : -1;\n let dy = Math.abs(endY - startY),\n sy = startY < endY ? 1 : -1;\n let err = (dx > dy ? dx : -dy) / 2;\n while (true) {\n let point = new Point(startX, startY);\n drawPixel(context, point);\n if (startX === endX && startY === endY) break;\n let e2 = err;\n if (e2 > -dx) {\n err -= dy;\n startX += sx;\n }\n if (e2 < dy) {\n err += dx;\n startY += sy;\n }\n }\n}", "title": "" }, { "docid": "8770bd6261ec0f46a89080843edd6510", "score": "0.6976298", "text": "function line(ctx, start, end) {\n ctx.beginPath();\n ctx.moveTo(start.x, start.y);\n ctx.lineTo(end.x, end.y);\n ctx.stroke();\n}", "title": "" }, { "docid": "771647afee2bfa266f81207b1434239c", "score": "0.69750905", "text": "function plotLineLow(x0, y0, x1, y1) {\n let deltaX = x1 - x0;\n let deltaY = y1 - y0;\n let yi = 1;\n\n if (deltaY < 0) {\n yi = -1;\n deltaY = -deltaY;\n }\n let D = 2 * deltaY - deltaX;\n let y = y0;\n\n for (let x = x0; x < x1; x++) {\n fillPixel(context, x, y);\n if (D > 0) {\n y = y + yi;\n D = D - 2 * deltaX;\n }\n D = D + 2 * deltaY;\n }\n }", "title": "" }, { "docid": "d13f9b925a6f5fbbf419efa271e9aa6c", "score": "0.6961864", "text": "function drawLine(x1, y1, x2, y2) {\n let line = document.createElement(`line`);\n\n line.setAttribute(`x1`, x1);\n line.setAttribute(`y1`, y1);\n line.setAttribute(`x2`, x2);\n line.setAttribute(`y2`, y2);\n\n field.append(line);\n}", "title": "" }, { "docid": "8629367207ee3410738846703ab02ee1", "score": "0.696055", "text": "function rasterize_antialias_line(point1, point2, color) {\n\n // Extra Credit: Implement me!\n // Remember to cite any sources you reference.\n\n}", "title": "" }, { "docid": "1fd678fa9f8e7efa77fadf7b6b2b2cfd", "score": "0.6955262", "text": "function drawLine(x, y) {\n const lines = svgCanvas.querySelectorAll('line');\n const line = lines[lines.length - 1];\n line.setAttribute('x2', x);\n line.setAttribute('y2', y);\n line.setAttribute('stroke', startingColor);\n line.setAttribute('stroke-width', 2);\n}", "title": "" }, { "docid": "0aa6f8358a8561c2c33a8ae931381254", "score": "0.69537663", "text": "drawLine(x1, y1, x2, y2, width) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = \"#000\";\n this.ctx.moveTo(x1, y1);\n this.ctx.lineTo(x2, y2);\n this.ctx.lineWidth = width;\n this.ctx.stroke();\n this.ctx.closePath();\n }", "title": "" }, { "docid": "159cce894a66c13993ba2cf8c6fa6061", "score": "0.695044", "text": "function line (x1, y1, x2, y2, d) {\r\n newPath(); // Neuer Grafikpfad (Standardwerte)\r\n if (d) ctx.lineWidth = d; // Liniendicke festlegen, falls angegeben\r\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\r\n ctx.stroke(); // Linie zeichnen\r\n }", "title": "" }, { "docid": "dd0f35fa7ee5d364a96484fbeb9f2097", "score": "0.6946283", "text": "drawLine(context, o) {\n\t\tcontext.moveTo(o.lineStartingX, o.lineStartingY);\n\t\tcontext.lineTo(o.lineEndingX, o.lineEndingY);\n\t\tcontext.strokeStyle = o.lineColour;\n\t\tcontext.lineWidth = o.lineWidth;\n\t\tcontext.stroke();\n\t}", "title": "" }, { "docid": "835da3091df5f5a46962ff5ed871f748", "score": "0.69419795", "text": "drawLine(x1, y1, x2, y2) {\n this.$graphics.moveTo(x1, y1);\n this.$graphics.lineTo(x2, y2);\n }", "title": "" }, { "docid": "184b3ef5f773df603ac001b8f1263e47", "score": "0.6922828", "text": "function drawline() {\n\n\t\tif (isDrawing) {\n\t\t\tlinePoint2 = d3.mouse(this);\n\t\t\tgContainer.select('line').remove();\n\t\t\tgContainer.append('line')\n\t\t\t\t.attr(\"x1\", linePoint1.x)\n\t\t\t\t.attr(\"y1\", linePoint1.y)\n\t\t\t\t.attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n\t\t\t\t.attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n\t\t}\n\t}", "title": "" }, { "docid": "49deeee1bbbd745fe9f8d2ad89e3d60e", "score": "0.69105226", "text": "function drawLine(a,b,c,d,e,f,g,h){\r\n points.push(a,b);\r\n points.push(b,c);\r\n points.push(c,d);\r\n points.push(d,e);\r\n points.push(e,f);\r\n points.push(f,g);\r\n points.push(g,h);\r\n}", "title": "" }, { "docid": "d6524b5e1baf173c13928e08b01a7cd6", "score": "0.69064426", "text": "function draw_line(x1, y1, x2, y2){ \r newPath = doc_ref.pathItems.add(); \r newPath.stroked = lineStyleConfig.stroked;\r newPath.filled = lineStyleConfig.filled;\r newPath.opacity = lineStyleConfig.opacity;\r newPath.strokeWidth = lineStyleConfig.strokeWidth;\r newPath.setEntirePath([[x1,-1*y1],[x2,-1*y2]]);\r}", "title": "" }, { "docid": "45531c63de89457bdcff0270dd2321dd", "score": "0.69021845", "text": "function drawLine(x_1,y_1,x_2,y_2,w){\r\n ctx.beginPath();\r\n ctx.lineWidth=w;\r\n ctx.moveTo(x_1, y_1);\r\n ctx.lineTo(x_2 , y_2);\r\n ctx.stroke();\r\n}", "title": "" }, { "docid": "a0c74a690b849c15fc74942452b60a2a", "score": "0.689356", "text": "function draw_line(ptox1,ptoy1,ptox2,ptoy2) {\n\n canvas.moveTo(ptox1, ptoy1);\n canvas.lineTo(ptox2, ptoy2);\n canvas.stroke();\n\n}", "title": "" }, { "docid": "e30cb46c93bfb527ef42fe8272f700c5", "score": "0.68933463", "text": "function drawLine() {\n c.beginPath()\n for (var i = 0; i < points.length; i++) {\n c.lineTo(X(points[i].x), Y(points[i].y))\n }\n c.closePath()\n c.stroke()\n\n}", "title": "" }, { "docid": "47ac2372bc7cb50bbd0e800c82bc317c", "score": "0.68921304", "text": "function drawLine(x1,y1,x2,y2)\r{\r\tvar pointArray = new Array();\r\r\tvar pointA = new PathPointInfo();\r\tpointA.kind = PointKind.CORNERPOINT;\r\tpointA.anchor = Array(x1, y1);\r\tpointA.leftDirection = pointA.anchor;\r\tpointA.rightDirection = pointA.anchor;\r\tpointArray.push(pointA);\r\r\tvar pointB = new PathPointInfo();\r\tpointB.kind = PointKind.CORNERPOINT;\r\tpointB.anchor = Array(x2, y2);\r\tpointB.leftDirection = pointB.anchor;\r\tpointB.rightDirection = pointB.anchor;\r\tpointArray.push(pointB);\r\r\tvar line = new SubPathInfo();\r\tline.operation = ShapeOperation.SHAPEXOR;\r\tline.closed = false;\r\tline.entireSubPath = pointArray;\r\r\tvar lineSubPathArray = new Array();\r\tlineSubPathArray.push(line);\r\r\tvar linePath = app.activeDocument.pathItems.add(\"TempPath\", lineSubPathArray);\r\tlinePath.strokePath(ToolType.PENCIL, false);\r\tapp.activeDocument.pathItems.removeAll();\r}", "title": "" }, { "docid": "6a8dfd004eb0aff7340f11c339aa9776", "score": "0.6890887", "text": "function drawLine(context, colour, width, startPos, endPos) {\n context.strokeStyle = rgbToHex(colour.r, colour.g, colour.b);\n context.lineWidth = width;\n\n context.beginPath();\n\n context.moveTo(startPos.x, startPos.y);\n context.lineTo(endPos.x, endPos.y);\n\n context.stroke();\n}", "title": "" }, { "docid": "c54a0f825eec950e3d54f0a7fcf93703", "score": "0.68784165", "text": "function dibujarLinea(color, x1, y1, x2, y2, lienzo) {\r\n lienzo.beginPath();\r\n lienzo.strokeStyle = color;\r\n lienzo.lineWidth = 3;\r\n lienzo.moveTo(x1, y1);\r\n lienzo.lineTo(x2, y2);\r\n lienzo.stroke();\r\n lienzo.closePath();\r\n}", "title": "" }, { "docid": "b6a54bdcad66184b3ea271c3726de050", "score": "0.6868859", "text": "line(x_0, y_0, x_1, y_1) {\n const ctx = this._ctx(true);\n if (ctx) {\n ctx.beginPath();\n ctx.moveTo(x_0, y_0);\n ctx.lineTo(x_1, y_1);\n ctx.stroke();\n this.draw(ctx);\n }\n }", "title": "" }, { "docid": "0732087ba5afc50693747f25375d9fcc", "score": "0.68681824", "text": "function drawLine(startpoint, endpoint)\r\n{\r\n context.beginPath();\r\n context.moveTo(startpoint.x,height-startpoint.y);\r\n context.lineTo(endpoint.x,height-endpoint.y);\r\n context.closePath();\r\n context.stroke();\r\n}", "title": "" }, { "docid": "ae4bf4803cdddae54998d433512c2acf", "score": "0.68674356", "text": "function calculateLine(x1, y1, x2, y2, color, className, element) {\n const deltaX = x1 - x2;\n const deltaY = y1 - y2;\n\n const length = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n\n const centerX = (x1 + x2) / 2;\n const centerY = (y1 + y2) / 2;\n\n const offsetX = centerX - length / 2;\n const offsetY = centerY;\n\n const angle = Math.PI - Math.atan2(-deltaY, deltaX);\n\n return element ? moveLineElement(element, offsetX, offsetY, length, angle, color) : createLineElement(offsetX, offsetY, length, angle, color, className);\n }", "title": "" }, { "docid": "a14b4b5581479b57b960de6a65ce07a2", "score": "0.6842788", "text": "function drawTwoLine() {\n\n\tcontext.lineWidth = 0.5;\n\n\tcontext.beginPath();\n\tcontext.moveTo(50, 0.5);\n\tcontext.lineTo(250, 0.5);\n\tcontext.moveTo(251, 0.5);\n\tcontext.lineTo(450, 0.5);\n\tcontext.lineTo(450, 100);\n\tcontext.closePath();\n\tcontext.stroke();\n\n\n\tcontext.beginPath();\n\tcontext.moveTo(50, 50);\n\tcontext.lineTo(450, 50);\n\tcontext.stroke();\n}", "title": "" }, { "docid": "e68560c54be9ecca65b01a1190b63e71", "score": "0.6811427", "text": "_draw_edge(point1, point2, color) {\n // Check if we already draw the other way\n if (this._map.is_edge(point2, point1)) return;\n\n // Draw the appropriate line\n const [x1, y1] = point1;\n const [x2, y2] = point2;\n this.draw_line(\n x1 * this._grid_size + this._grid_size / 2,\n y1 * this._grid_size + this._grid_size / 2,\n x2 * this._grid_size + this._grid_size / 2,\n y2 * this._grid_size + this._grid_size / 2,\n color,\n this._inner_size,\n );\n }", "title": "" }, { "docid": "d66806604b09729eb24a387e32656bd8", "score": "0.68086386", "text": "function initLine(v1, v2, col){\n var material = new THREE.LineBasicMaterial({ color: col });\n var geometry = new THREE.Geometry();\n geometry.vertices.push(v1);\n geometry.vertices.push(v2);\n var line = new THREE.Line(geometry, material);\n return line;\n}", "title": "" }, { "docid": "ead30fa602f2ee9753d91489a74fc01c", "score": "0.68040633", "text": "function draw_first_line()\n{\n points.push(start);\n points.push(end);\n}", "title": "" }, { "docid": "c81cd4ca36150ede7c339704e349b3a0", "score": "0.6793593", "text": "function makeLine(x1,y1,x2,y2) {\n slope = (y2-y1)/(x2-x1)\n yint = y1 - slope*x1\n return [slope,yint]\n}", "title": "" }, { "docid": "d65fa0e214e3952f4964a9e8186ae334", "score": "0.6753151", "text": "renderLine(start, end) {\n\t\tconst ctx = this.ctx;\n\t\tctx.globalAlpha = 1;\n\t\tctx.beginPath();\n\t\tctx.moveTo(start.x, start.y);\n\t\tctx.lineTo(end.x, end.y);\n\t\tctx.stroke();\n\t\tctx.closePath();\n\t\tthis.image.getLayer().draw();\n\t}", "title": "" }, { "docid": "59fedcc2c2101c13aab14c8f2fc91624", "score": "0.6739516", "text": "function drawLineOnMap(lat1, lon1, lat2, lon2, clr) {\n //set coordinates for drawing\n var lineCoordinates = [\n \tnew google.maps.LatLng(lat1, lon1),\n \tnew google.maps.LatLng(lat2, lon2)\n \t];\n\n //draw the line for point1\n var linePath = new google.maps.Polyline({\n \tpath: lineCoordinates,\n \tgeodesic: true,\n \tstrokeColor: clr,\n \tstrokeOpacity: 1.0,\n \tstrokeWeight: 2\n \t});\t\t\t\n polylines.push(linePath);\n linePath.setMap(map);\n}", "title": "" }, { "docid": "52702b18431b1e03f0b37ae6da2f78a4", "score": "0.67360795", "text": "function drawLink(x1, y1, x2, y2, protocol){\n // protocols we are dealing with: UDP, TCP, CMPP, DNS\n var lineColor;\n if(protocol == \"CMPP\"){\n lineColor = 0xFF0000;\n }else if(protocol == \"UDP\"){ \n lineColor = 0xFFFF66;\n }else if(protocol == \"TCP\"){ \n lineColor = 0x8080FF;\n }else if(protocol == \"DNS\"){ \n lineColor = 0x00FF80;\n }\n\n var material = new THREE.LineBasicMaterial( { color: lineColor, linewidth: 1 } );\n var points = [];\n\n points.push( new THREE.Vector3( x1, y1, 0 ) );\n points.push( new THREE.Vector3( x2, y2, 0 ) );\n \n var geometry = new THREE.BufferGeometry().setFromPoints( points );\n var line = new THREE.Line( geometry, material );\n return line;\n}", "title": "" }, { "docid": "19a9d7f1c32b9cacd5ba1d0429b001b2", "score": "0.67096126", "text": "function canvas_draw_patchline(p0, p1) {\n var ydiff = Math.max(20, Math.abs(p1.y - p0.y) * 0.33);\n var c0 = {\n x: p0.x,\n y: p0.y + ydiff\n }\n var c1 = {\n x: p1.x,\n y: p1.y - ydiff\n }\n context.beginPath();\n context.moveTo(p0.x, p0.y);\n context.bezierCurveTo(c0.x, c0.y, c1.x, c1.y, p1.x, p1.y);\n context.stroke();\n}", "title": "" }, { "docid": "299b7e739085d1f0898562626f4c9dfc", "score": "0.67068845", "text": "function svgLine(x0, y0, x1, y1)\n{\n\treturn (\"M\"+x0+\",\"+y0+\" L\"+x1+\",\"+y1);\n}", "title": "" }, { "docid": "e331fbd84af3bc4cddab80efd95b1e51", "score": "0.6704478", "text": "function drawLine(x0, y0, x1, y1, color, emit){\n\n console.log('drawing line');\n context.beginPath();\n\n let xoffSet = -25;\n let yoffSet = -550;\n\n console.log(x0);\n console.log(y0);\n\n /* We need to programmatically set this or hardcode this at the end XD */\n context.moveTo(x0 + xoffSet, y0 + yoffSet);\n context.lineTo(x1 + xoffSet, y1 + yoffSet);\n context.strokeStyle = color;\n context.lineWidth = 2;\n context.stroke();\n context.closePath();\n\n if (!emit) { return; }\n var w = canvas.width;\n var h = canvas.height;\n\n socket.emit('drawing', {\n x0: x0 / w,\n y0: y0 / h,\n x1: x1 / w,\n y1: y1 / h,\n color: color\n });\n }", "title": "" }, { "docid": "6ebed492dfe0c3284ae51c6e3b1c99a9", "score": "0.6691082", "text": "function drawLine() {\n ctx.beginPath();\n\n // add all points on path and connect them by straight lines\n for (var i = 0; i < points.length; i++)\n ctx.lineTo(points[i].x, points[i].y);\n\n // actually draw\n ctx.stroke();\n }", "title": "" }, { "docid": "e84cc0378990c81b33c693e1ae9aae67", "score": "0.66831875", "text": "function drawline(sx,sy,dx,dy,color) {\n contxt.beginPath();\n if (color==1) { contxt.fillStyle=\"black\"} else {contxt.fillStyle=\"#DDDDDD\"}\n contxt.fillRect(sx,sy,(dx-sx)+3,(dy-sy)+3); \n contxt.stroke();\n}", "title": "" }, { "docid": "a52c349fba74fd3ff7d6e7b4b3574f2b", "score": "0.6672064", "text": "function line(x1, y1, x2, y2) {\n var slope = (y2 - y1) / (x2 - x1);\n return function (x, y) {\n return y - y1 > slope * (x - x1);\n };\n}", "title": "" }, { "docid": "ffe06a4fadfd812b8e161141237d4321", "score": "0.66657996", "text": "function drawLine(container, point1x, point1y, point2x, point2y){\r\n\tvar x1 = point1x;\r\n\tvar y1 = point1y;\r\n\tvar x2 = point2x;\r\n\tvar y2 = point2y;\r\n\tvar leftOffset;\r\n\tvar rotation;\r\n\tline = document.createElement('div');\r\n\tline.classList.add('line');\r\n\tline.style.width = Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2))+'%'\r\n\tleftOffset = (x1-(parseFloat(line.style.width.substr(0,line.style.width.length-1))-(x2-x1))/2);\t\r\n\tline.style.marginLeft = leftOffset+'%';\r\n\tline.style.marginTop = ((y1-50)+(y2-y1)/2)+'%';\r\n\trotation = Math.atan((y2-y1)/(x2-x1));\r\n\tline.style.transform = 'rotate('+rotation+'rad)';\r\n\tline.style.mozTransform = 'rotate('+rotation+'rad)';\r\n\tline.style.webkitTransform = 'rotate('+rotation+'rad)';\r\n\tcontainer.appendChild(line);\r\n}", "title": "" }, { "docid": "2ac56551c5c6f077d08b7ad260e1924a", "score": "0.66626084", "text": "function drawLine({color,startPos,endPos}){\n var c=document.getElementById(\"canvas\");\n var ctx=c.getContext(\"2d\");\n ctx.beginPath();\n const sizeRatio=1;\n ctx.moveTo(startPos.x+25, startPos.y+25);\n ctx.lineTo(endPos.x+25,endPos.y+25);\n ctx.lineWidth=15;\n ctx.strokeStyle=color;\n ctx.stroke();\n}", "title": "" }, { "docid": "a51119f8e25b81546692639d86e7e887", "score": "0.6662513", "text": "function drawLines(current_point) {\n\n points\n points.forEach(point => {\n })\n\n let current_index = points.indexOf(current_point);\n\n for (let i = current_index; i < current_index + 2; i++) {\n if (current_index + 2 >= points.length) return\n ctx.beginPath();\n ctx.moveTo(current_point.x, current_point.y);\n ctx.lineTo(points[i].x, points[i].y);\n ctx.strokeStyle = SETTINGS.LINES_COLOR;\n ctx.stroke()\n }\n}", "title": "" }, { "docid": "1aa55cd23cce689fe7cef1e6de5f9adc", "score": "0.6660797", "text": "drawLineAngle2(angle1, angle2, color, width, rStart, rEnd)\n {\n this.ctx.beginPath();\n this.ctx.lineWidth = width;\n this.ctx.strokeStyle = color;\n this.ctx.moveTo(this.canvasMiddleX + rStart * Math.cos(angle1), \n this.canvasMiddleY + rStart * Math.sin(angle1));\n this.ctx.lineTo(this.canvasMiddleX + rEnd * Math.cos(angle2),\n this.canvasMiddleY + rEnd * Math.sin(angle2));\n this.ctx.stroke();\n }", "title": "" }, { "docid": "295c7ee52ef3f347da942e979d79ca89", "score": "0.6642118", "text": "function Line(point1, point2) {\n var _this = _super.call(this, 'line') || this;\n _this.setPoint1(point1);\n _this.setPoint2(point2);\n return _this;\n }", "title": "" }, { "docid": "5e4a213e8beb0ff041f1453402594ead", "score": "0.6638953", "text": "function draw(startPoint, endPoint) {\n var c = document.getElementById(\"myCanvas\");\n var ctx = c.getContext(\"2d\");\n ctx.fillStyle = '#000';\n ctx.strokeStyle = '#2EC19C';\n ctx.lineWidth = 2;\n ctx.font = \"1px Arial\";\n //ctx.miterLimit = 1;\n // draw a vertical line\n ctx.beginPath();\n ctx.moveTo(startPoint[0], startPoint[1]);\n ctx.lineTo(endPoint[0], endPoint[1]);\n //ctx.moveToBottom();\n ctx.stroke();\n ctx.closePath();\n}", "title": "" }, { "docid": "7be4e313331c75df6d63c609bebe6c7a", "score": "0.6635183", "text": "function drawLine(x0, y0, x1, y1, cxt) {\r\n\r\n var dx = Math.abs(x1 - x0);\r\n var dy = Math.abs(y1 - y0);\r\n\r\n var DX = 1;\r\n var DY = 1;\r\n\r\n if (x0 > x1) {\r\n DX = -DX;\r\n }\r\n if (y0 > y1) {\r\n DY = -DY;\r\n }\r\n\r\n var ERROR;\r\n if (dx > dy) {\r\n ERROR = dx / 2;\r\n } else {\r\n ERROR = -dy / 2;\r\n }\r\n\r\n while (true) {\r\n\r\n cxt.fillRect(x0, y0, brush, brush);\r\n\r\n if (DX > 0 && DY > 0 && x0 >= x1 && y0 >= y1) {\r\n break;\r\n } else if (DX > 0 && DY < 0 && x0 >= x1 && y0 <= y1) {\r\n break;\r\n } else if (DX < 0 && DY > 0 && x0 <= x1 && y0 >= y1) {\r\n break;\r\n } else if (DX < 0 && DY < 0 && x0 <= x1 && y0 <= y1) {\r\n break;\r\n }\r\n\r\n if (ERROR > -dx) {\r\n ERROR = ERROR - dy;\r\n x0 = x0 + DX;\r\n }\r\n\r\n if (ERROR < dy) {\r\n ERROR = ERROR + dx;\r\n y0 = y0 + DY;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0a4154d1431b7122b9e368bc3cbb8218", "score": "0.66296464", "text": "function drawLineBetween(lat1, lng1, lat2, lng2) {\n var path = new google.maps.Polyline({\n path: [new google.maps.LatLng(lat1, lng1),\n new google.maps.LatLng(lat2, lng2)],\n geodesic: true\n });\n path.setMap(map);\n return path;\n}", "title": "" }, { "docid": "5900222b714c58a6b51b2d1873e0d0bd", "score": "0.6611809", "text": "function drawLine(x1,y1,x2,y2,thickness,DrawingContext,color) \r\n{ \r\n\tDrawingContext.beginPath(); \r\n\tDrawingContext.strokeStyle = color; \r\n\tDrawingContext.lineWidth = thickness; \r\n\tDrawingContext.moveTo(x1,y1); \r\n\tDrawingContext.lineTo(x2,y2); \r\n\tDrawingContext.stroke(); \r\n}", "title": "" }, { "docid": "646923e00e565fd21275c4328bc4e475", "score": "0.6596332", "text": "function line (x1, y1, x2, y2, w) {\n ctx.beginPath(); // Neuer Pfad\n ctx.lineWidth = (w ? w : 1); // Liniendicke, falls angegeben\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\n ctx.stroke(); // Linie zeichnen\n }", "title": "" }, { "docid": "fc1526746d72441993ac205f7b0c30b7", "score": "0.6593261", "text": "function line(start, end, stroke) {\n var [x1, y1] = start;\n var [x2, y2] = end;\n return element(\"line\", { x1, y1, x2, y2, stroke });\n }", "title": "" }, { "docid": "2eaaf3c689e58cbb21b2261d0ee89f48", "score": "0.65919244", "text": "drawLine (g, len, color, lineWidth) {\n\n if (lineWidth === undefined) { lineWidth = 1; }\n if (color === undefined) { color = 0x000000; }\n\n g.lineStyle(lineWidth * 5, color, 1);\n g.moveTo(-len / 2, 0);\n g.lineTo(len / 2, 0);\n\n }", "title": "" }, { "docid": "d7347d8c404fd85ead4c54ae7c71a788", "score": "0.65789694", "text": "function draw_line(x1, y1, x2, y2)\n{\n surfaceTarget.beginPath();\n surfaceTarget.moveTo(x1 - view_xview, y1 - view_yview);\n surfaceTarget.lineTo(x2 - view_xview, y2 - view_yview);\n surfaceTarget.stroke();\n surfaceTarget.closePath();\n}", "title": "" }, { "docid": "89a46c4f8b0b82b7e0fe5126d9ab7448", "score": "0.6548056", "text": "static drawVLine( context, x, y, length, dash, color ) {\r\n\r\n Point.drawRect( context, x, y, 1, length, dash, color );\r\n }", "title": "" }, { "docid": "65035916d55103939600f8bc9a9a2d8a", "score": "0.6541594", "text": "drawLine() {\n this.ctx.beginPath(); // Start a new path\n this.ctx.strokeStyle = \"silver\";\n this.ctx.moveTo(10, this.y + this.heigth / 2);\n this.ctx.lineTo(this.canvas.width - 10, this.y + this.heigth / 2);\n this.ctx.stroke();\n }", "title": "" }, { "docid": "f753fac5adaf90e364c79967c7c4bbd5", "score": "0.6541531", "text": "function lines(ctx, color, moveto1, moveto2, lineto1, lineto2, linewidth) {\n //makes the canvas lines sharper\n let pix = 0.5;\n\n ctx.beginPath();\n ctx.moveTo(moveto1 + pix, moveto2 + 0.5);\n ctx.lineTo(lineto1 + 0.5, lineto2 + 0.5);\n ctx.lineWidth = linewidth;\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "title": "" }, { "docid": "97cd64cf0ef185521c230615088f752d", "score": "0.65411043", "text": "function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal)\n {\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.moveTo(xinicial, yinicial);\n lienzo.lineTo(xfinal, yfinal);\n lienzo.stroke();\n lienzo.closePath();\n}", "title": "" }, { "docid": "477a0eebe90945ce21dff6fb2f4c57da", "score": "0.6540755", "text": "function drawLine(ctx,x,y,s) {\n // If lastX is not set, set lastX and lastY to the current position \n if (lastX==-1) {\n lastX=x;\n lastY=y;\n }\n // Let's use black by setting RGB values to 0, and 255 alpha (completely opaque)\n r=0; g=0; b=0; a=255;\n // Select a fill style\n // ctx.strokeStyle = \"rgba(\"+r+\",\"+g+\",\"+b+\",\"+(a/255)+\")\";\n ctx.strokeStyle = coloring;\n // Set the line \"cap\" style to round, so lines at different angles can join into each other\n ctx.lineCap = \"round\";\n //ctx.lineJoin = \"round\";\n // Draw a filled line\n ctx.beginPath();\n // First, move to the old (previous) position\n ctx.moveTo(lastX,lastY);\n // Now draw a line to the current touch/pointer position\n ctx.lineTo(x,y);\n // Set the line thickness and draw the line\n ctx.lineWidth = s;\n ctx.stroke();\n ctx.closePath();\n // Update the last position to reference the current position\n lastX=x;\n lastY=y;\n }", "title": "" }, { "docid": "0b58120373cfdce619fefb330c58e5eb", "score": "0.65394485", "text": "static line(ctx, pts) {\n if (pts.length < 2)\n return;\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for (let i = 1, len = pts.length; i < len; i++) {\n if (pts[i])\n ctx.lineTo(pts[i][0], pts[i][1]);\n }\n }", "title": "" }, { "docid": "a7d6ca1467273de5280b1a7bf210d551", "score": "0.6536785", "text": "function drawLineAnimation(x1, y1, x2, y2, color, size, noAnimation, type) {\n var noAnimation = noAnimation ? noAnimation : false;\n var type = type ? type : 'simple';\n var lineEndPointX = x2,\n lineEndPointY = y2;\n var ctx = noAnimation ? drawingCanvas : fakeCanvas;\n fakeCanvas.clearRect(0, 0, fakeCanvasMaxLenght, fakeCanvasMaxLenght);\n //if shift is pressed detect to which way we have to draw line\n if (shiftPressed) {\n var dx = Math.abs(x2 - x1);\n var dy = Math.abs(y2 - y1);\n if (dx > dy) {\n lineEndPointY = y1;\n } else {\n lineEndPointX = x1;\n }\n }\n if (type == 'double' || type == 'single') {\n drawArrow(ctx, x1, y1, lineEndPointX, lineEndPointY, color, size);\n }\n var ctx = noAnimation ? drawingCanvas : fakeCanvas;\n ctx.beginPath();\n ctx.globalCompositeOperation = \"source-over\";\n ctx.moveTo(x1, y1);\n ctx.lineTo(lineEndPointX, lineEndPointY);\n ctx.closePath();\n ctx.strokeStyle = color;\n ctx.lineWidth = size;\n ctx.fill();\n ctx.stroke();\n ctx.closePath();\n if (type == 'double') {\n drawArrow(ctx, lineEndPointX, lineEndPointY, x1, y1, color, size);\n\n }\n }", "title": "" } ]
f982ee395159d9245d7093fae8a62db8
Implement the identical functionality for filter and not
[ { "docid": "aeb0b2dbf7d4c75384098647984dfd4b", "score": "0.0", "text": "function winnow( elements, qualifier, keep ) {\n\n\t// Can't pass null or undefined to indexOf in Firefox 4\n\t// Set to 0 to skip string check\n\tqualifier = qualifier || 0;\n\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep(elements, function( elem, i ) {\n\t\t\tvar retVal = !!qualifier.call( elem, i, elem );\n\t\t\treturn retVal === keep;\n\t\t});\n\n\t} else if ( qualifier.nodeType ) {\n\t\treturn jQuery.grep(elements, function( elem, i ) {\n\t\t\treturn ( elem === qualifier ) === keep;\n\t\t});\n\n\t} else if ( typeof qualifier === \"string\" ) {\n\t\tvar filtered = jQuery.grep(elements, function( elem ) {\n\t\t\treturn elem.nodeType === 1;\n\t\t});\n\n\t\tif ( isSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter(qualifier, filtered, !keep);\n\t\t} else {\n\t\t\tqualifier = jQuery.filter( qualifier, filtered );\n\t\t}\n\t}\n\n\treturn jQuery.grep(elements, function( elem, i ) {\n\t\treturn ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;\n\t});\n}", "title": "" } ]
[ { "docid": "566c510496e30dcfdbcc8dc4af77742f", "score": "0.7675597", "text": "filter() {}", "title": "" }, { "docid": "f98f0c02d654f745960b19063da7da6a", "score": "0.736163", "text": "function notFilter(func) {\n return function () {\n return !func.apply(this, arguments);\n };\n }", "title": "" }, { "docid": "c299439a37f343642cfa019b66ec8df1", "score": "0.6976417", "text": "filter(el, name) {\n return this.notWhitelisted(el, name)\n && this.notIgnored(el, name)\n && this.notReported(el, name);\n }", "title": "" }, { "docid": "50cae229479a43c7de1cc0b6b811fde4", "score": "0.6928828", "text": "function notfilter(val){\n if(!val){\n val = false;\n }\n return selector.modifier && selector.modifier.not ? !val : val;\n }", "title": "" }, { "docid": "3f4187e416643f51df6ab1286cfceb1b", "score": "0.691548", "text": "function filterFunction() {\n}", "title": "" }, { "docid": "2d0ac74c977561c316292c2caa865515", "score": "0.6775071", "text": "Filter(string, string, string) {\n\n }", "title": "" }, { "docid": "8bc610266e34507c0f7b8fa6400ad7b2", "score": "0.6691865", "text": "filter(fnFilter) {\n return this.pipe((0, operators_1.filter)(fnFilter));\n }", "title": "" }, { "docid": "2920b37be741c974d8aafdecb4e1f10e", "score": "0.66186965", "text": "filter(fn) {\n const filtered = [];\n this.forEach(obj => {\n if (fn(obj)) {\n filtered.push(obj);\n }\n });\n return filtered;\n }", "title": "" }, { "docid": "2920b37be741c974d8aafdecb4e1f10e", "score": "0.66186965", "text": "filter(fn) {\n const filtered = [];\n this.forEach(obj => {\n if (fn(obj)) {\n filtered.push(obj);\n }\n });\n return filtered;\n }", "title": "" }, { "docid": "828aa5067127df80e816c88398c148a0", "score": "0.66102886", "text": "function noFilter() {\n\treturn true;\n}", "title": "" }, { "docid": "12988b5080a0403f93d74972a962c566", "score": "0.6480194", "text": "function filterCallback(_,i){\n return i !== idx;\n }", "title": "" }, { "docid": "8c66f453fb5a239fc9f89b0eefec5436", "score": "0.6454191", "text": "function filtered_1(rec) {\n let filter = processor.options.filter\n if(!filter) return true\n for(let k in filter) {\n if(filter[k] != rec[k]) return false\n }\n return true\n }", "title": "" }, { "docid": "279677670335b3e7fce724aabb87fe2e", "score": "0.6295453", "text": "filter(pred) {\n return this._generateFrom(this._unsafeIterator().filter(pred));\n }", "title": "" }, { "docid": "1f7c174e2b68d09349fe9a2f30553108", "score": "0.62499195", "text": "filter(f) {\n var i, len, ref, results, x;\n ref = this._items;\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n x = ref[i];\n if (Iterator.boolOrError(x, f(x))) {\n results.push(x);\n }\n }\n return results;\n }", "title": "" }, { "docid": "26ad35ee05073abab550da0de089b936", "score": "0.6244667", "text": "function isObservedByFilters(event) {\n return !(observeOnlyFiltered && !event.passedFilters);\n }", "title": "" }, { "docid": "eb9a417c741a02a8d5ad36e876708fd9", "score": "0.6241877", "text": "function filter (pred) {\n return (stream) => {\n return (event) => {\n if (pred(event.get('data'))) {\n forward(stream, event)\n }\n }\n }\n}", "title": "" }, { "docid": "b094fc94e4f2d63dae644725beaab497", "score": "0.6237416", "text": "function advancedFilter(item) {\n return assignedFilter(item) && concessionsFilter(item) && clashesFilter(item);\n }", "title": "" }, { "docid": "3eb605005a5155413aec3e8d39324d98", "score": "0.6237142", "text": "function noFilter(filterObj) {\n return Object.keys(filterObj).every(function (key) {\n return !filterObj[key];\n });\n }", "title": "" }, { "docid": "7297d3da14145dcc5dcbcb7a61320c43", "score": "0.6231391", "text": "filterBy(filter) {\n const entries = Object.entries(filter); // Some minimal caching\n\n return this.filter((obj) => {\n for (const [key, value] of entries) {\n const objectValue = obj[key];\n // Can match by array (any value) or otherwise exact match\n if (Array.isArray(value)) {\n if (!value.includes(objectValue)) {\n return false;\n }\n } else {\n if (objectValue != value) {\n return false;\n }\n }\n }\n return true;\n });\n }", "title": "" }, { "docid": "cef624637b040b8ef6dbe80d212a4e06", "score": "0.6209754", "text": "setFilter(filter){\n }", "title": "" }, { "docid": "59e3fe905f2995f16cdec1b9408d91da", "score": "0.61927944", "text": "filter(item) {\n if (this.filterFunction) {\n return !!this.filterFunction(item);\n }\n return !(this.$scope.query && this.$scope.query.length > 0 && item.title.indexOf(this.$scope.query) === -1);\n }", "title": "" }, { "docid": "e32a73ba85ccbb87e7b8dfa7a40a4658", "score": "0.6176105", "text": "filter(fn) {\n const results = new Superset();\n for (const val of this) if (fn(val, this)) results.add(val);\n return results;\n }", "title": "" }, { "docid": "8e769f7e7cca3aa7e0329319bd176580", "score": "0.61510146", "text": "filerPropertyInUse(a){let b=this,c=a.old,d=a.new,e=b.getFilter(d);//newFilter.required = false;\nif(e.status=0,c){let a=b.getFilter(c);//set status to 'available'\na.status=1}}", "title": "" }, { "docid": "50e72d5d4767976d186548d8b97e3e51", "score": "0.6134479", "text": "filterBy(m, val, key){ return true}", "title": "" }, { "docid": "adf4cf6330e695befd4185e3e38c3b68", "score": "0.61324114", "text": "_markerIsFilteredOut(marker) {\n\t\tif(marker.filters) {\n\t\t\tfor (let filter of marker.filters) {\n\t\t\t\tif(this.state.filters && !this.state.filters.includes(filter)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "35aa545056f837290452423d9035e502", "score": "0.6126861", "text": "isFiltered() {\n return this.filtered_;\n }", "title": "" }, { "docid": "230960d984c66bf6c856d7adc6ab8dce", "score": "0.60303444", "text": "function not(func) {\n return function () {\n return !func.apply(null, slice.call(arguments));\n };\n } // helper function which call predicate function per parameter and return true if all pass", "title": "" }, { "docid": "7ac4028cd8ab34568930f3fdb68730a5", "score": "0.6011144", "text": "deleteFilter(a){let b=this,c=[];//delete filter from filters array.\nfor(filter of b.filters)filter.filterProperty==a?filter.status=1:c.push(filter);//override filters array with temp array.\nb.filters=c,null!=a&&b.getAvailableFilterProperties()}", "title": "" }, { "docid": "43504aca3f5a42af95a5c5675357d0db", "score": "0.6010793", "text": "function filter(_, text, q, tag, op, val, not, flag) {\n const fuzzy = new RegExp((text || '').replace(/ +/g, '.+'), 'i');\n const ops = { '>': a => a > val, '<': a => a < val, '=': a => a === +val };\n if (flag) return c => !!not ^ c.flags.includes(flag.toUpperCase());\n if (tag) return c => ops[op](c[tag]);\n return c => fuzzy.test(c.text);\n}", "title": "" }, { "docid": "450215596ddfca8ec5210d904b4a07b2", "score": "0.6002011", "text": "function filterRecipes () {\n\t\n}", "title": "" }, { "docid": "3d8845888357378202b8fc2c598c59c9", "score": "0.5992348", "text": "function defaultFilter() {\n return !on_event.button;\n}", "title": "" }, { "docid": "a0dbfed2d154972681a7655e88511987", "score": "0.59650534", "text": "function inverseFilter(filterFunc/*, thisArg*/) {\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n return function(element, index, array) {\n return !filterFunc.call(thisArg !== void 0 ? thisArg : this\n , element, index, array);\n };\n }", "title": "" }, { "docid": "0b60232aac4807c2c2f1297e474f1e2e", "score": "0.5960578", "text": "function complement (predicateFn) {\n return function () {\n return !predicateFn.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "df10de35e0fee2cf4897f59562d24028", "score": "0.5937944", "text": "function filterFalsy(item) {\n return item;\n}", "title": "" }, { "docid": "9f4f5dd5df502ba0c2c2c75a01db25d8", "score": "0.5932448", "text": "doFilter () {\n /**\n * filter is the function provided by the parent component.\n * @type {Function}\n */\n const filter = this.get('filter')\n\n /**\n * filterValue is the current filter value.\n * @type {String}\n */\n const filterValue = this.get('filterValue')\n\n // Filter items.\n const visibleItems = this.get('items').filter(item => {\n return filter(filterValue, item)\n })\n\n // Store filtered items.\n this.set('visibleItems', visibleItems)\n }", "title": "" }, { "docid": "19d48797a3a1f96b5d3a48a8fcc4be73", "score": "0.59215266", "text": "filter(fact) {\n\t\t\treturn fact\n\t\t}", "title": "" }, { "docid": "82729e5c2917c702e91182521718b2e6", "score": "0.59057295", "text": "filter(data) {\n // this.data = data.filter((book) => {return true});\n this.data = data.filter((book) => {\n let bool = false;\n this.langFilter.forEach((taal) => {\n if (book.taal === taal) {\n bool = true\n }\n })\n return bool\n })\n }", "title": "" }, { "docid": "2dc9b0ffe93dd2521439824ba4f90a40", "score": "0.5902517", "text": "function filterInput(f) {\n return self => filterInput_(self, f);\n}", "title": "" }, { "docid": "e63603d2cefd2275a1206e108a82f063", "score": "0.5885984", "text": "function defaultFilter$2() {\n return !event.button;\n}", "title": "" }, { "docid": "b7b75889889679a4c799cf186523218d", "score": "0.5883177", "text": "function filterNoDom(n, e) {\n return isNotHidden(e) && nonWeakFilter(n, e) && shouldTraverse(e, false);\n }", "title": "" }, { "docid": "574f9101e78dde19b37b66ba2164fdf9", "score": "0.58812714", "text": "function filterInput_(self, f) {\n return filterInputM_(self, a => T.succeed(f(a)));\n}", "title": "" }, { "docid": "25707401729742fcd1f0dea38371b4e0", "score": "0.587412", "text": "function itemFilter() {\n if (this.textContent === \"Show all\") {\n let items = qsa('.item')\n items.forEach(item => {\n item.classList.remove('hidden');\n })\n clearAllChecks('#filter-by-list li')\n id('show-all').prepend(createCheckMark());\n } else {\n let items = qsa('.item')\n items.forEach(item => {\n item.classList.add('hidden');\n })\n\n if (id('show-all').firstElementChild) {\n id('show-all').firstElementChild.remove();\n }\n\n let unchecking = false;\n\n if (this.firstElementChild) {\n this.firstElementChild.remove();\n unchecking = true;\n }\n\n if (!unchecking) {\n this.prepend(createCheckMark());\n }\n\n items.forEach(item => {\n if (id(\"personal-filter\").firstElementChild && item.dataset.sharing === \"personal\") {\n item.classList.remove('hidden')\n }\n if (id(\"shared-filter\").firstElementChild && item.dataset.sharing === \"shared\") {\n item.classList.remove('hidden')\n }\n let daysRemaining = parseInt(item.lastElementChild.dataset.days)\n if (id(\"expired-filter\").firstElementChild && daysRemaining <= 0) {\n item.classList.remove('hidden')\n }\n if (id(\"expiring-filter\").firstElementChild && daysRemaining <= 3 && daysRemaining > 0) {\n item.classList.remove('hidden')\n }\n })\n }\n\n }", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "031283dd65f61984f28fa336dec858fe", "score": "0.58730346", "text": "function defaultFilter$2() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "49887a02b7e8828f82737a2d30bbc7d5", "score": "0.587002", "text": "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "49887a02b7e8828f82737a2d30bbc7d5", "score": "0.587002", "text": "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "49887a02b7e8828f82737a2d30bbc7d5", "score": "0.587002", "text": "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "02b93810390e5abba662f0a1e4f6738b", "score": "0.5841704", "text": "function defaultFilter$2() {\n return !exports.event.button;\n }", "title": "" }, { "docid": "7b1e551964bd4128dc862d8c52ae301b", "score": "0.58408165", "text": "filter(predicate) {\n return new FilterIterator(this, predicate);\n }", "title": "" }, { "docid": "8e213c77b38456d7b90a5f5a5ff16ab6", "score": "0.58400375", "text": "function hidenShow(filter){\n elements.forEach(el =>{\n el.classList.remove('hiden');\n\n if(el.dataset.img !== filter && filter !== 'all'){\n el.classList.toggle('hiden');\n }\n })\n}", "title": "" }, { "docid": "30605b1cbd1224375e858b5b3d60026e", "score": "0.58298236", "text": "filter(predicate) {\n return this.mapDefined((element) => __awaiter(this, void 0, void 0, function* () { return option_1.optional(yield predicate(element), () => element); }));\n }", "title": "" }, { "docid": "afad08fc5192816ef1a4fedbf8cbaa79", "score": "0.58282006", "text": "mergeFilter() {\n\n const {\n filter\n } = this.state;\n\n if (this.initialFilter && filter) {\n return {\n operator: LogicalOperators.And,\n filters: [\n this.initialFilter,\n filter\n ]\n }\n }\n else if (this.initialFilter) {\n\n return this.initialFilter;\n }\n else {\n\n return filter;\n }\n }", "title": "" }, { "docid": "2c98b04d18d922dd24d19b8a9d5cd203", "score": "0.58247685", "text": "@action isFiltered(qnodeId) {\n const { filterKeys } = this;\n let filtered = false;\n if (filterKeys[qnodeId]) {\n // goes through the filterkeys until it finds one that is false\n filtered = Object.keys(filterKeys[qnodeId]).some(propertyKey =>\n Object.keys(filterKeys[qnodeId][propertyKey]).some(propertyValue =>\n !filterKeys[qnodeId][propertyKey][propertyValue][0]));\n }\n return filtered;\n }", "title": "" }, { "docid": "fd92c2a7c50b42ab7b9980cfebf00b2b", "score": "0.58241314", "text": "function failureFilter(item) {\n return !item.passed();\n}", "title": "" }, { "docid": "d347a7cb2f3f0f80aca1914ed3334f62", "score": "0.58206004", "text": "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "d347a7cb2f3f0f80aca1914ed3334f62", "score": "0.58206004", "text": "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "d347a7cb2f3f0f80aca1914ed3334f62", "score": "0.58206004", "text": "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "e1bc74987008212dde4e6b5cae3ecd02", "score": "0.5819237", "text": "function bouncer(arr) {\n //returning the filtered array by using a inline callback function, which uses\n //Boolean() to return true or false depending on the actual element checked by filter()\n return arr.filter(function(el){\n return Boolean(el);\n });\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "ed53dde196da461774ecfa84bdf1f5ea", "score": "0.581474", "text": "function defaultFilter$1() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "e5566230e92079d8add6bf27d67fd471", "score": "0.5810516", "text": "filterApply(resultset, filterType, filterArguments) {\n const testStatus = LABEL_TO_TYPE[filterArguments.text.toLowerCase()];\n\n return resultset.filterItems(node => {\n const nodeType = node.isPublic() ? \"public\" : \"private\";\n return nodeType === testStatus;\n });\n }", "title": "" }, { "docid": "08eb3df594d73ceda8b3ac366cc57a47", "score": "0.5799981", "text": "filterToggle(e) {\n e.preventDefault();\n this.toggleFilter();\n }", "title": "" }, { "docid": "f1294e76f11855a327ea7b01f1383224", "score": "0.5787921", "text": "function defaultFilter$1() {\n return !event.button;\n }", "title": "" }, { "docid": "f7d0ad27c0cbcf5c36f8a29d80f95ebf", "score": "0.5782383", "text": "filterData() {\n let items = bikeData.items;\n if ( this.state.filter && this.state.filter !== 'all') {\n items = bikeData.items.filter( item => {\n return item.class.indexOf(this.state.filter) !== -1;\n });\n }\n return items;\n }", "title": "" }, { "docid": "88af8e867c076234f956d8e20776a07c", "score": "0.5777565", "text": "other(t) {\n return this.filter(o => o !== t)\n }", "title": "" }, { "docid": "912fbd17226de6b9bee09d01b67c9efc", "score": "0.57724184", "text": "function defaultFilter$1() {\n return !exports.event.button;\n }", "title": "" }, { "docid": "93d30ee23cb9027c07781ed2cdbf5db3", "score": "0.57702386", "text": "function NodeFilterImpl() {\n }", "title": "" }, { "docid": "211abd60b61ee58c5058b8f5788ae484", "score": "0.57508284", "text": "function notModifier (predicate) {\n\t return function () {\n\t return notImpl(predicate.apply(null, arguments));\n\t };\n\t }", "title": "" }, { "docid": "709d472c5d6dbbbe6186a15ad5a90406", "score": "0.5749192", "text": "isMatched() {\n return !(this.tree.filterMode && !this.match);\n }", "title": "" }, { "docid": "6d0bcf34034dc30be01211db4c8206b6", "score": "0.57429653", "text": "filterNodes(filter, options) {\n return this._applyFilterNoUpdate(filter, false, options);\n }", "title": "" }, { "docid": "ede865a0993de78201a758203597ae0f", "score": "0.57408214", "text": "function filter(range) {\n return range == null ? filterAll() : Array.isArray(range) ? filterRange(range) : typeof range === \"function\" ? filterFunction(range) : filterExact(range);\n }", "title": "" }, { "docid": "ede865a0993de78201a758203597ae0f", "score": "0.57408214", "text": "function filter(range) {\n return range == null ? filterAll() : Array.isArray(range) ? filterRange(range) : typeof range === \"function\" ? filterFunction(range) : filterExact(range);\n }", "title": "" }, { "docid": "c56eed3d60f8c63ab3ecfc7aeab2ef6b", "score": "0.5740801", "text": "_wantedField(field) {\n return this.filters.every(filter => filter(field));\n }", "title": "" }, { "docid": "a118e3f0525ba903a3d7ffe0f9452acb", "score": "0.57303256", "text": "function filterData(d) {\n var toReturn = true;\n if ((givenFilter.year !== \"\" && d.Year !== givenFilter.year) ||\n (givenFilter.gender !== \"\" && d.Gender !== givenFilter.gender) ||\n (givenFilter.sherpa !== \"\" && d.Sherpa !== givenFilter.sherpa) ||\n (givenFilter.nation !== \"\" && d.Nation !== givenFilter.nation) ||\n (givenFilter.reason !== \"\" && d.Reason !== givenFilter.reason)\n ) {\n toReturn = false;\n }\n return toReturn;\n }", "title": "" }, { "docid": "ab12143f99e87a949b808acaae583e0b", "score": "0.572858", "text": "function noopOptimizeNetwork(filters) {\n return filters;\n}", "title": "" }, { "docid": "256ef1fffc1bca9d3b8e6ae66be699c8", "score": "0.5725425", "text": "function filter(cb, arr) { //cb is the function that will be called later. Now we can abstract a lot of stuff\n //cb is designed to take a single item from the array, and its index as arguments\n // it will also return true or false\n // So each item gets tested, and if it passes, it gets passed into the new array\n var output = [];\n for(var i = 0; i < arr.length; i++) {\n var element = arr[i];\n //not put it through the test\n var passesTest = cb(element, i);\n if(passesTest) output.push(element);\n }\n return output;\n }", "title": "" }, { "docid": "224e78a99c2bcc2192e36811fb06a7ee", "score": "0.57193637", "text": "function defaultFilter() {\n return !event.button;\n}", "title": "" }, { "docid": "224e78a99c2bcc2192e36811fb06a7ee", "score": "0.57193637", "text": "function defaultFilter() {\n return !event.button;\n}", "title": "" }, { "docid": "814509775e10b63b29797b4f8ab541dd", "score": "0.57184803", "text": "function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }", "title": "" }, { "docid": "814509775e10b63b29797b4f8ab541dd", "score": "0.57184803", "text": "function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }", "title": "" }, { "docid": "4678084a21ab631fb4e2057374391baa", "score": "0.5717318", "text": "function defaultFilter(query, item, i) {\n return true;\n}", "title": "" }, { "docid": "6ce0722652bc1d4ffd9eabd6d874f2cc", "score": "0.57142574", "text": "function defaultFilter() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "6ce0722652bc1d4ffd9eabd6d874f2cc", "score": "0.57142574", "text": "function defaultFilter() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "6ce0722652bc1d4ffd9eabd6d874f2cc", "score": "0.57142574", "text": "function defaultFilter() {\n\t return !exports.event.button;\n\t}", "title": "" }, { "docid": "48cb0ad9802d27de9365e6386a988cf3", "score": "0.57121754", "text": "function Array$prototype$filter(pred) {\n return this.filter(function(x) { return pred(x); });\n }", "title": "" }, { "docid": "7fd8be64e85f1132f5eff767be08d7f3", "score": "0.57099664", "text": "function destroyer(arr) {\n // Remove all the values\n var args = Array.from(arguments).slice(1);\n\n var arrFiltro = arr.filter((element)=>{\n\n return args.every( (everyElement) =>{\n return element != everyElement;\n });\n }\n );\n console.log( arrFiltro );\n return arrFiltro;\n}", "title": "" }, { "docid": "80dceadc4b1e794e9409ea4ceb202b8d", "score": "0.56973964", "text": "function defaultFilter() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "80dceadc4b1e794e9409ea4ceb202b8d", "score": "0.56973964", "text": "function defaultFilter() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "80dceadc4b1e794e9409ea4ceb202b8d", "score": "0.56973964", "text": "function defaultFilter() {\n return !exports.event.button;\n}", "title": "" }, { "docid": "80dceadc4b1e794e9409ea4ceb202b8d", "score": "0.56973964", "text": "function defaultFilter() {\n return !exports.event.button;\n}", "title": "" } ]
fe1ac6a90d85c1ad04213d570a975843
================================================================================================================================== Get the intrinsic/internal properties of a member property, function, etc.
[ { "docid": "c8c97ad999a713bdf6e3052151784ede", "score": "0.0", "text": "function getPropertyValue(obj, property) {\r\n return obj[property];\r\n}", "title": "" } ]
[ { "docid": "19c3d840059c7c9ef69e4c1409064e36", "score": "0.6834491", "text": "function prop_access() {\n \n}", "title": "" }, { "docid": "682875cafec2073487cdddf5c978d681", "score": "0.6592331", "text": "get accessor_prop() { /* function body here */ }", "title": "" }, { "docid": "8a3165e7fd1699566089a5af9b6e72ae", "score": "0.65253407", "text": "static get getProperty() {\n return this.prototype.getProperty;\n }", "title": "" }, { "docid": "f845bcb69c176a43c6571f7e96faef5d", "score": "0.6524424", "text": "static get getPropertyNames() {\n return this.prototype.getPropertyNames;\n }", "title": "" }, { "docid": "ecf332e65e8a8f4c3f06b21dbc5c2350", "score": "0.65134877", "text": "get property(){}", "title": "" }, { "docid": "6b793071ce77f6a72363bfb6814d69eb", "score": "0.64930975", "text": "static get properties () {\n return {\n // Simple public properties/attributes\n one: { type: String },\n two: { type: Boolean },\n three: { type: Array },\n // If the property is multiple words and thus camelCase, you can force the default linked attribute to be kebab-case like this:\n fooBarBaz: { type: String, attribute: 'foo-bar-baz' },\n // Setting `reflect: true` will automatically update the attribute value when the property is changed.\n // This way, if you use a CSS attribute selector like this `:host([enabled])`, you can have your styles react to property changes.\n enabled: { type: Boolean, reflect: true },\n // Private properties are prefixed with `_`\n // If it's described here, a change will trigger render().\n // Use state: true for private properties.\n _privateFoobar: { type: Boolean, state: true },\n };\n }", "title": "" }, { "docid": "cdf32d51e9647dcf68808f13f7ce5df9", "score": "0.6476436", "text": "getProps(){\n let properties = new ValueMap();\n let propWalker = this;\n\n while(propWalker.__type<0x10){\n for(let [k,v] of propWalker.__props){\n properties.set(k,v);\n }\n propWalker = propWalker.getProp(\"__proto__\");\n };\n return properties;\n }", "title": "" }, { "docid": "2db95764b63e17093bf3ef1701545644", "score": "0.6394038", "text": "function getInternalProperties(obj) {\n\t if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n\t return objCreate(null);\n\t}", "title": "" }, { "docid": "2db95764b63e17093bf3ef1701545644", "score": "0.6394038", "text": "function getInternalProperties(obj) {\n\t if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n\t return objCreate(null);\n\t}", "title": "" }, { "docid": "831181730cb2ea2e4b50b0708dbc5759", "score": "0.6369675", "text": "function getProperties(doc) {\n var props = [];\n var _module = doc.children[0];\n var _class = _module.children[0];\n _class.children.forEach(c => {\n if (c.kindString === \"Property\") {\n props.push(c.name);\n }\n })\n return props;\n}", "title": "" }, { "docid": "c4b594d799d50c715cdc4f0636b1c85a", "score": "0.62722623", "text": "getPropertyNames() {\n const names = [];\n let currentObject = this;\n while ('__properties' in currentObject) {\n if (core_helpers_1.hasOwnProperty(currentObject, '__properties')) {\n const currentNames = Object.getOwnPropertyNames(currentObject.__properties);\n names.unshift(...currentNames);\n }\n currentObject = Object.getPrototypeOf(currentObject);\n }\n return Array.from(new Set(names));\n }", "title": "" }, { "docid": "b5abf796641f79b86a4fe2101401e48d", "score": "0.62585145", "text": "static GetPropertyModifications() {}", "title": "" }, { "docid": "b95019876e0e9edc1d3493da7630026c", "score": "0.6239", "text": "static get properties() {\r\n return {\r\n };\r\n }", "title": "" }, { "docid": "ca760a024ae5ae58a00636841f4b7aec", "score": "0.61926615", "text": "static get property(){}", "title": "" }, { "docid": "bc4890491699f8c87ff23993df84f56a", "score": "0.61531466", "text": "visitObject_properties(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e91409dbd63cb8572d8e2d33d749c665", "score": "0.6138352", "text": "get properties() {\n return getPropertiesObject();\n }", "title": "" }, { "docid": "53272deecd31b521a69c67d209c650af", "score": "0.6116897", "text": "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "title": "" }, { "docid": "53272deecd31b521a69c67d209c650af", "score": "0.6116897", "text": "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "title": "" }, { "docid": "d8900a6b35440db4ffd40412155e446b", "score": "0.6105949", "text": "function propertyDetails (name) {\n return {\n getter: '_get_' + name,\n setter: '_set_' + name,\n processor: '_process_' + name,\n validator: '_validate_' + name,\n defaultValue: '_default_value_' + name,\n value: '_' + name\n };\n }", "title": "" }, { "docid": "5673e19660d465c360c75e375a11f35a", "score": "0.6095144", "text": "get property() {\n\t\treturn this.__property;\n\t}", "title": "" }, { "docid": "5673e19660d465c360c75e375a11f35a", "score": "0.6095144", "text": "get property() {\n\t\treturn this.__property;\n\t}", "title": "" }, { "docid": "71e47b0cd38603dc7ab8034b95051356", "score": "0.6092393", "text": "static get properties () {\n\t\treturn [\n\t\t\t...this.access,\n\t\t\t...this.activate,\n\t\t\t...this.ammunition,\n\t\t\t...this.area,\n\t\t\t...this.bulk,\n\t\t\t...this.cast,\n\t\t\t...this.cost,\n\t\t\t...this.duration,\n\t\t\t...this.effect,\n\t\t\t...this.frequency,\n\t\t\t...this.onset,\n\t\t\t...this.prerequisites,\n\t\t\t...this.price,\n\t\t\t...this.range,\n\t\t\t...this.requirements,\n\t\t\t...this.savingThrow,\n\t\t\t...this.shieldData,\n\t\t\t...this.targets,\n\t\t\t...this.traditions,\n\t\t\t...this.traditionsSubclasses,\n\t\t\t...this.trigger,\n\t\t\t...this.category,\n\t\t\t...this.usage,\n\t\t]\n\t}", "title": "" }, { "docid": "4cfa603fe1d7f4ad2d0ac3973d9e762c", "score": "0.60889333", "text": "visitPhysical_properties(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a34a9002a1350604f2ad468101b428b0", "score": "0.60849714", "text": "get properties() { return this._properties; }", "title": "" }, { "docid": "69189ddec3ef5b668676e445e34b9ced", "score": "0.6071269", "text": "function getInitializedProperties(node, isStatic) {\n return ts.filter(node.members, isStatic ? isStaticInitializedProperty : isInstanceInitializedProperty);\n }", "title": "" }, { "docid": "045455521b1232fffb2a4bd51b30956e", "score": "0.60576516", "text": "get properties() {\n return SPInstance(this, \"properties\");\n }", "title": "" }, { "docid": "77988f0707b7c6c6bef0ea6b47ed534d", "score": "0.6046662", "text": "function getPropertyInfo(expression, source) {\n var originalExpression = expression;\n while (expression instanceof aurelia_binding_1.BindingBehavior || expression instanceof aurelia_binding_1.ValueConverter) {\n expression = expression.expression;\n }\n var object;\n var propertyName;\n if (expression instanceof aurelia_binding_1.AccessScope) {\n object = source.bindingContext;\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessMember) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessKeyed) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.key.evaluate(source);\n }\n else {\n throw new Error(\"Expression '\" + originalExpression + \"' is not compatible with the validate binding-behavior.\");\n }\n return { object: object, propertyName: propertyName };\n }", "title": "" }, { "docid": "87b703938090df08c5cf3bd015be97aa", "score": "0.60242486", "text": "function getPropertyInfo(expression, source) {\n var originalExpression = expression;\n while (expression instanceof aurelia_binding_1.BindingBehavior || expression instanceof aurelia_binding_1.ValueConverter) {\n expression = expression.expression;\n }\n var object;\n var propertyName;\n if (expression instanceof aurelia_binding_1.AccessScope) {\n object = source.bindingContext;\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessMember) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessKeyed) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.key.evaluate(source);\n }\n else {\n throw new Error(\"Expression '\" + originalExpression + \"' is not compatible with the validate binding-behavior.\");\n }\n if (object === null || object === undefined) {\n return null;\n }\n return { object: object, propertyName: propertyName };\n }", "title": "" }, { "docid": "87b703938090df08c5cf3bd015be97aa", "score": "0.60242486", "text": "function getPropertyInfo(expression, source) {\n var originalExpression = expression;\n while (expression instanceof aurelia_binding_1.BindingBehavior || expression instanceof aurelia_binding_1.ValueConverter) {\n expression = expression.expression;\n }\n var object;\n var propertyName;\n if (expression instanceof aurelia_binding_1.AccessScope) {\n object = source.bindingContext;\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessMember) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.name;\n }\n else if (expression instanceof aurelia_binding_1.AccessKeyed) {\n object = getObject(originalExpression, expression.object, source);\n propertyName = expression.key.evaluate(source);\n }\n else {\n throw new Error(\"Expression '\" + originalExpression + \"' is not compatible with the validate binding-behavior.\");\n }\n if (object === null || object === undefined) {\n return null;\n }\n return { object: object, propertyName: propertyName };\n }", "title": "" }, { "docid": "2c1b46b1e583cdd4a222770f1a61f185", "score": "0.59964013", "text": "properties() {\n return this._properties;\n }", "title": "" }, { "docid": "e54cff16617b0acd02a135c20dde1ecf", "score": "0.59885776", "text": "get prop1() {\n }", "title": "" }, { "docid": "7b6156836dbe1dad992c96f4451de68d", "score": "0.5976953", "text": "function getProp (prop) {\n return b.callExpression(\n b.memberExpression(\n b.identifier(\"Object\"),\n b.identifier(\"getOwnPropertyDescriptor\"),\n false\n ),\n [ b.identifier(\"__Super__\"), prop.name ? b.literal(prop.name) : prop ]\n )\n }", "title": "" }, { "docid": "93225fac01c89779035d71ff5ec056e7", "score": "0.5959417", "text": "static get properties() {\n return {\n inject: {\n type: Object,\n value: function () {\n return undefined;\n },\n computed: '_computeInject(target, parent)'\n },\n data: {\n type: String,\n value: undefined,\n observer: '_dataChanged'\n }\n };\n }", "title": "" }, { "docid": "dc2002bc6a54a2f55a98c54fd6ec138e", "score": "0.59486216", "text": "function getAugmentedPropertiesOfType(type) {\n\t type = getApparentType(type);\n\t var propsByName = createSymbolTable(getPropertiesOfType(type));\n\t if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) {\n\t ts.forEach(getPropertiesOfType(globalFunctionType), function (p) {\n\t if (!ts.hasProperty(propsByName, p.name)) {\n\t propsByName[p.name] = p;\n\t }\n\t });\n\t }\n\t return getNamedMembers(propsByName);\n\t }", "title": "" }, { "docid": "5ae25376f702a3ec7bb7aca992032543", "score": "0.59391457", "text": "static get properties() {\n return {\n \n };\n }", "title": "" }, { "docid": "49cb832a997c5b47cf457529c2c848ce", "score": "0.5934287", "text": "function getAugmentedPropertiesOfType(type) {\n type = getApparentType(type);\n var propsByName = createSymbolTable(getPropertiesOfType(type));\n if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) {\n ts.forEach(getPropertiesOfType(globalFunctionType), function (p) {\n if (!propsByName.has(p.name)) {\n propsByName.set(p.name, p);\n }\n });\n }\n return getNamedMembers(propsByName);\n }", "title": "" }, { "docid": "55f42e7d9edffb5b401fc20dc141170f", "score": "0.59254366", "text": "function getObjectPropertyNames(obj){\n\treturn Object.getOwnPropertyNames(obj);\n}", "title": "" }, { "docid": "083f9622954b54d2d3136b6711cf2d8a", "score": "0.590883", "text": "static findPropertyInterceptors(property) {\n const attributes = property.findOwnAttributes(Filters_1.HasInterceptor);\n //.concat(property.value.findOwnAttributes(HasInterceptor));\n return attributes;\n }", "title": "" }, { "docid": "b1fcc4cec8199dd82d8dc576339478f3", "score": "0.58743924", "text": "get x() { return Object.getOwnPropertyDescriptor(this,'p') ? this.p.x : 0; }", "title": "" }, { "docid": "b1fcc4cec8199dd82d8dc576339478f3", "score": "0.58743924", "text": "get x() { return Object.getOwnPropertyDescriptor(this,'p') ? this.p.x : 0; }", "title": "" }, { "docid": "1b8225792294985771928393d19ec69f", "score": "0.58677864", "text": "get properties() {\n return this._properties;\n }", "title": "" }, { "docid": "36aa7b354a25d809128114f1bdfdff21", "score": "0.5862924", "text": "function getPropertyProperties(obj, property) {\r\n let propertyDescriptor = Object.getOwnPropertyDescriptor(obj, property);\r\n return propertyDescriptor;\r\n}", "title": "" }, { "docid": "b4164110fc499fe8971e445de32f5171", "score": "0.5852275", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "3024b5ceddb2a2584353e12877dbaa97", "score": "0.5851197", "text": "static get hasProperty() {\n return this.prototype.hasProperty;\n }", "title": "" }, { "docid": "96005dc2e9317c023ce357eb9239b707", "score": "0.5843418", "text": "managedProperties() {\n return (this._managedProperties\n || this.constructor.managedProperties());\n }", "title": "" }, { "docid": "eee8b696ce8db814513e1660da72da1a", "score": "0.58135474", "text": "get allProperties() {\n return SPInstance(this, \"allproperties\");\n }", "title": "" }, { "docid": "804a77d68c676aaee6488e01b6fa9301", "score": "0.58091235", "text": "properties(){}", "title": "" }, { "docid": "1d44681f1674329e5f65dc5f93b74fa5", "score": "0.5809118", "text": "function get() {\n /**\n * 2020-03-02 Dispite 'async' mode, reading a properties will always return value directly\n * If you need a property that is compute by others properties, created it as a real property,\n * and register the dependcies and use update function to update its value.\n */\n return this.mode === \"sync\" ? getSync.call(this) : getSync.call(this)\n}", "title": "" }, { "docid": "ba3bc9a1b9d238620e05f1d48c723038", "score": "0.5802915", "text": "function evaluate_property_access(stmt,env) {\n var obj = evaluate(object(stmt), env);\n var prop = evaluate(property(stmt), env);\n return obj[prop];\n}", "title": "" }, { "docid": "0ac4b010f7d2c1589f849b0549e1c8f0", "score": "0.5798653", "text": "function getPropNamesAndSymbols() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var listOfKeys = Object.getOwnPropertyNames(obj);\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* isFunction */])(Object.getOwnPropertySymbols) ? listOfKeys.concat(Object.getOwnPropertySymbols(obj)) : listOfKeys;\n}", "title": "" }, { "docid": "12475e28de69047ca54e39918b57d32b", "score": "0.57963824", "text": "miioProperties() {\n\t\t\t\treturn this.properties;\n\t\t\t}", "title": "" }, { "docid": "8d176611e479e59ded7a0026452385f2", "score": "0.5768448", "text": "static get properties() {\n return {\n target: {\n type: String,\n reflect: true\n }\n };\n }", "title": "" }, { "docid": "97cf8a32c367c8f04e7f2d9cef71b830", "score": "0.57675797", "text": "getProperties() {\n return this.wrapped.properties != null ? Object.assign({}, this.wrapped.properties) : {};\n }", "title": "" }, { "docid": "d65e7e1e99e35c98183f54bfaa5bdd8f", "score": "0.57613266", "text": "get x1() { return Object.getOwnPropertyDescriptor(this,'p1') ? this.p1.x : 0; }", "title": "" }, { "docid": "11d5dafa87fcad6ccbf2b04d58f62aad", "score": "0.5757535", "text": "function propertyTransform(feature) {\n return feature.properties;\n}", "title": "" }, { "docid": "affb25e548a4ba4dffe4286327dea668", "score": "0.5754889", "text": "get(obj, prop) {\n if (prop === \"name\") {\n accesses++;\n }\n return obj[prop];\n }", "title": "" }, { "docid": "801c6792cc50cc8a8d119557769113b6", "score": "0.5750312", "text": "get propertyNames() {\n return Object.keys(this._properties);\n }", "title": "" }, { "docid": "2d01e0291615d5aeeb9c3e04c036455d", "score": "0.57452995", "text": "_measure() {\n const props = {};\n const bounds = this.element.getBoundingClientRect();\n const computedStyle = getComputedStyle(this.element);\n this.options.properties.forEach((p) => {\n var _a;\n const v = (_a = bounds[p]) !== null && _a !== void 0 ? _a : (!transformProps[p]\n ? computedStyle[p]\n : undefined);\n const asNum = Number(v);\n props[p] = isNaN(asNum) ? String(v) : asNum;\n });\n return props;\n }", "title": "" }, { "docid": "2cec2752cc34f2f668be2a5a02393bb9", "score": "0.5743458", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "c56a4408abfaf9eceb4a3af8d54f996c", "score": "0.5743418", "text": "get internals() {\n return this[nativeInternals$1];\n }", "title": "" }, { "docid": "49419a8358339c8a6c091ce7e47ad06a", "score": "0.57314235", "text": "get member() {\n\t\treturn this.__member;\n\t}", "title": "" }, { "docid": "ebcb63ab822ee346833767a2ed7328e4", "score": "0.5722412", "text": "function propertyMeta(context) {\n return (prop) => Reflect.getMetadata(prop, context);\n}", "title": "" }, { "docid": "ebcb63ab822ee346833767a2ed7328e4", "score": "0.5722412", "text": "function propertyMeta(context) {\n return (prop) => Reflect.getMetadata(prop, context);\n}", "title": "" }, { "docid": "d5346f6797d828f2e2385aede4fe22dc", "score": "0.5710546", "text": "function getProperties () { return $.extend(true, {}, properties); }", "title": "" }, { "docid": "1717c9449febe0506772861a1af6afb8", "score": "0.5704171", "text": "get properties()\n\t{\n\t\treturn this._abCard.properties;\n\t}", "title": "" }, { "docid": "8589924188c3cd9c6cf307d30752849c", "score": "0.5695706", "text": "get property() {\n return this._property;\n }", "title": "" }, { "docid": "4d3059df404db5c4f76425cc7d0ffdc8", "score": "0.568536", "text": "MemberExpression(path) {\n const { object, property } = path.node;\n if (object.name === 'props') {\n propKeys.push(getCompletionItem(property.name));\n }\n }", "title": "" }, { "docid": "34bfba6d8b92d49ca83cf7acf0824009", "score": "0.56829154", "text": "function extractValueFromMemberExpression(value) {\n\t return (0, _index2.default)(value.object) + '.' + (0, _index2.default)(value.property);\n\t}", "title": "" }, { "docid": "31e90a58ab3e580a346cad854052a0e8", "score": "0.5675154", "text": "static get properties() {\n\t\treturn {\n\t\t\taddress : {\n\t\t\t\ttype : Object,\n\t\t\t\tvalue : { address : \"\", name : \"\"},\n\t\t\t},\n\t\t\tpeoplelist : {\n\t\t\t\ttype : Array,\n\t\t\t\tobserver : '_onPeopleListChanged'\n\t\t\t},\n\t\t\treadonly : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : true\n\t\t\t},\n\t\t\tshowcopy : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : true\n\t\t\t},\n\t\t}\n\t}", "title": "" }, { "docid": "e0ec4e35ca58dddee58d96f072b52ff4", "score": "0.56722504", "text": "get myProperties() {\n return Profiles(this, \"getmyproperties\");\n }", "title": "" }, { "docid": "43cc9c597ca99205b4d2d3b5041c02de", "score": "0.5668515", "text": "function getPropFunction(params) {\n var func;\n\n if(!params.exclude && !params.include) {\n func = function(properties) {\n for(var attr in this) {\n if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1)) {\n properties[attr] = this[attr];\n }\n }\n };\n } else if(params.include) {\n func = function(properties) {\n params.include.forEach(function(attr){\n properties[attr] = this[attr];\n }, this);\n };\n } else if(params.exclude) {\n func = function(properties) {\n for(var attr in this) {\n if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1) && (params.exclude.indexOf(attr) === -1)) {\n properties[attr] = this[attr];\n }\n }\n };\n }\n\n return function() {\n var properties = {};\n\n func.call(this, properties);\n\n if(params.extra) { addExtra(properties, params.extra); }\n return properties;\n };\n }", "title": "" }, { "docid": "0f249c1754a94121570cbf60048f283e", "score": "0.56675583", "text": "visitColumn_properties(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a43380f0f5dde1edc10af70969f089fc", "score": "0.5664677", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==undefined){this._attributeToPropertyMap.set(attr,p);attributes.push(attr);}});return attributes;}", "title": "" }, { "docid": "80e04934f8492eec48fb94813dde8d03", "score": "0.5660049", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==void 0){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "title": "" }, { "docid": "65b071bae2afd2ddbb5def814caac24f", "score": "0.5659096", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(void 0!==attr){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "title": "" }, { "docid": "5f353f4db9b6a991d49fff7d9200742f", "score": "0.56500006", "text": "getProp(k){\n return this.__props.get(k);\n }", "title": "" }, { "docid": "1cc4d37d1336bd80e89d5e04d97d419a", "score": "0.56469405", "text": "static get properties() {\n return {\n peli: { type: Object}\n };\n }", "title": "" }, { "docid": "a083f42a2427c064c5f654be25b76b97", "score": "0.5633499", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n jQuery.each(props, function(key) {\r\n key = jQuery.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if (jQuery.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "785c280cbf524e8490ce4143c9d235c4", "score": "0.5621154", "text": "function getProperty(obj, propertyName) {\n}", "title": "" }, { "docid": "5bdbab81e8dee815b74d5c94c789ed66", "score": "0.55973405", "text": "function getPropertyNames(obj) {\n if (obj == null) {\n return [];\n }\n var propertyMap = typeof obj[__WEBPACK_IMPORTED_MODULE_15__Symbol__[\"a\" /* default */].reflection] === \"function\" ? obj[__WEBPACK_IMPORTED_MODULE_15__Symbol__[\"a\" /* default */].reflection]().properties || [] : obj;\n return __WEBPACK_IMPORTED_MODULE_9_babel_runtime_core_js_object_get_own_property_names___default()(propertyMap);\n}", "title": "" }, { "docid": "71a4ccb51b579fbbeb6fbdf708afc6a8", "score": "0.5590511", "text": "static get properties() {\n return {\n multiTarget: {\n type: String,\n reflect: true\n }\n };\n }", "title": "" }, { "docid": "4d3cc9414da64f15f7d2508a8b4ba597", "score": "0.55848926", "text": "function getProp(x)\n{\n\thtm=\"\";\n\tfor (e in x)\n\thtm+=e+\":\"+x[e]+\"<br>\";\n\t_(\"debug_\").innerHTML=htm;\n}", "title": "" }, { "docid": "d42f48af7fbce2fde56dcaf4eb543476", "score": "0.5583514", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n $.each(props, function(key) {\r\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if ($.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "d42f48af7fbce2fde56dcaf4eb543476", "score": "0.5583514", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n $.each(props, function(key) {\r\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if ($.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "141e31a590b647fc0425fcde9ea7f88f", "score": "0.55825233", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.558168", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.558168", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.558168", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.558168", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "f592b2eba5d5b5c04bf14606106aa38b", "score": "0.5578234", "text": "function getProperties(props) {\n\t\tvar re = [];\n\n\t\t$.each(props, function(key) {\n\t\t\tkey = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n\t\t\tkey = $.transit.propertyMap[key] || $.cssProps[key] || key;\n\t\t\tkey = uncamel(key); // Convert back to dasherized\n\n\t\t\t// Get vendor specify propertie\n\t\t\tif (support[key])\n\t\t\t\tkey = uncamel(support[key]);\n\n\t\t\tif ($.inArray(key, re) === -1) { re.push(key); }\n\t\t});\n\n\t\treturn re;\n\t}", "title": "" }, { "docid": "b06da056dd91d12fdb5f014460da74d2", "score": "0.5574999", "text": "export() {\n let properties = {\n type: this.constructor.name,\n id: this.id\n };\n let self = this;\n\n this.exportedProperties.forEach(function(property) {\n properties[property] = self[property];\n });\n\n return properties;\n }", "title": "" }, { "docid": "8a3cb7cfe348e2cd514a2c644254eb49", "score": "0.55674815", "text": "get properties() {\n\t\treturn [\"animation\",\"autoFocusOnMouseenter\",\"checkable\",\"checkboxes\",\"checkMode\",\"dataSource\",\"disabled\",\"displayLoadingIndicator\",\"displayMember\",\"dropDownAppendTo\",\"dropDownOverlay\",\"dropDownPosition\",\"enableMouseWheelAction\",\"filterable\",\"filterInputPlaceholder\",\"filterMode\",\"grouped\",\"itemsMember\",\"loadingIndicatorPlaceholder\",\"loadingIndicatorPosition\",\"locale\",\"localizeFormatFunction\",\"messages\",\"minimizeIconTemplate\",\"minimizeWidth\",\"overflow\",\"readonly\",\"rightToLeft\",\"scrollMode\",\"theme\",\"unfocusable\",\"valueMember\"];\n\t}", "title": "" }, { "docid": "8fe0699ba99b340eced982c62ffd4efc", "score": "0.55671877", "text": "function internalProperty(options){return property({attribute:!1,hasChanged:null===options||void 0===options?void 0:options.hasChanged})}", "title": "" }, { "docid": "0c49dd9532d75a3c688b750586feabf4", "score": "0.5562033", "text": "props(layer) {\n return layer.feature.properties;\n }", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.55617344", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "0169c95248dae2eaad394c7bf2eb9572", "score": "0.5552168", "text": "function getClassInstanceMembers(ctor) {\r\n if (isNativeFunction(ctor)) {\r\n return [];\r\n }\r\n var body = parseFunctionBody(ctor);\r\n var members = [];\r\n function visit(node) {\r\n switch (node.kind) {\r\n case ts.SyntaxKind.BinaryExpression:\r\n if (node.operatorToken.kind === ts.SyntaxKind.EqualsToken) {\r\n var lhs = node.left;\r\n if (lhs.kind === ts.SyntaxKind.PropertyAccessExpression) {\r\n if (lhs.expression.kind === ts.SyntaxKind.ThisKeyword) {\r\n members.push(dts_dom_1.create.property(lhs.name.getText(), dom.type.any, dom.MemberFlags.None));\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n ts.forEachChild(node, visit);\r\n }\r\n return members;\r\n}", "title": "" }, { "docid": "4acda1aa6b064ebd1bf096293d4df28b", "score": "0.55514205", "text": "function evaluate_object_property_access(object, property) {\r\n let result = object[property];\r\n //We need to post-process the return value. Because objects can be native\r\n //we need to marshal native member functions into our primitive tag.\r\n return wrap_native_value(result);\r\n }", "title": "" }, { "docid": "3a0187801abf4e87a63eb00bd138dfc1", "score": "0.55324686", "text": "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==undefined?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor);}", "title": "" }, { "docid": "3e090ae13f1a31d54656fb160d76bec2", "score": "0.5510133", "text": "_getPropertySetter(name, Fn) {\n var result = null;\n Fn.body.forEach(function (x) {\n function isPropertyName(node) {\n AstUtil_1.AstUtil.is.type(node, 'AST_Assign') && node.left.property === name;\n }\n AstUtil_1.AstUtil.each(x, isPropertyName, function (node) {\n var arr = ['include', 'module', 'exports'];\n if (arr.indexOf(node.start.value) > -1) {\n result = node;\n }\n });\n });\n return result;\n }", "title": "" }, { "docid": "3da8c2d277499e232b52bb10aedc8633", "score": "0.5506202", "text": "function getLayerPropertyDescriptor(index, property) {\r\n\tvar ref = new ActionReference();\r\n\tref.putProperty(TID.property, property);\r\n\tref.putIndex(TID.layer, index);\r\n\tvar desc = executeActionGet(ref);\r\n\treturn desc;\r\n}", "title": "" }, { "docid": "14a536c764e2a126faeecc21acad2d8d", "score": "0.5503592", "text": "get autoGenerateDesiredProperties() {\n return this.i.f;\n }", "title": "" } ]
49de884009f64a2fae354bbb64039d87
mobile framework Show/hide loading page show: true/false
[ { "docid": "f9144ab60e268c01b06a25a12a4b538b", "score": "0.0", "text": "function mofAlert(message, title) {\n //$.mobile.loading('show');\n //$.mobile.loading('hide');\n if (title == undefined) title = 'Live Chat';\n myApp.alert(message, title); \n }", "title": "" } ]
[ { "docid": "d6bef8d4ca074e7c782660c5b123255f", "score": "0.79404116", "text": "function mofLoading(show) {\n //$.mobile.loading('show');\n //$.mobile.loading('hide');\n console.log('loading '+show); \n if (show) myApp.showPreloader();\n else myApp.hidePreloader(); \n }", "title": "" }, { "docid": "41329160e6a57480809c296445a0224c", "score": "0.7709795", "text": "function showPageLoading()\n {\n $.mobile.loading('show', {\n text: 'Loading',\n textVisible: true,\n theme: 'd',\n html: \"\"\n });\n }", "title": "" }, { "docid": "fde0f2c98b4e264830fcb6b7956e22e6", "score": "0.75272924", "text": "function showLoader() {\n\t$.mobile.loading(\"show\", {\n\t\ttext: \"Laden\",\n\t\ttextVisible: true,\n\t\ttheme: $.mobile.loader.prototype.options.theme,\n\t\ttextonly: false,\n\t\thtml: \"\"\n\t});\n\thideLoader();\n}", "title": "" }, { "docid": "fde0f2c98b4e264830fcb6b7956e22e6", "score": "0.75272924", "text": "function showLoader() {\n\t$.mobile.loading(\"show\", {\n\t\ttext: \"Laden\",\n\t\ttextVisible: true,\n\t\ttheme: $.mobile.loader.prototype.options.theme,\n\t\ttextonly: false,\n\t\thtml: \"\"\n\t});\n\thideLoader();\n}", "title": "" }, { "docid": "2a9b0d760a7730b3b2590561bf2466cd", "score": "0.7478813", "text": "function showLoading() {\n setLoading(true);\n }", "title": "" }, { "docid": "f7990a9afbe76ada3914e3f9a8e7375c", "score": "0.74618334", "text": "function showLoadingView() {\r\n\r\n}", "title": "" }, { "docid": "608069c4d05f7f12a432922113c2de0b", "score": "0.73841196", "text": "function showLoader(){\n $(\".page-loader-wrapper\").show();\n}", "title": "" }, { "docid": "c65fcbceff43fd3f3e0cad5b66593c10", "score": "0.73418057", "text": "function openLoading() {\n $(\"#page-loader\").show();\n}", "title": "" }, { "docid": "e42a87b976c087738ff0afa2c808f172", "score": "0.7232453", "text": "onShowLoading() {\n $(\"#loading, #loading-display\").show();\n }", "title": "" }, { "docid": "02038636b08b814e67707f602810ef1e", "score": "0.7174515", "text": "function showLoadingView() {\n loader.style.display = 'block'\n}", "title": "" }, { "docid": "d5218a04c9854924682c2d11ce529523", "score": "0.71467817", "text": "function showLoading(show) {\n if (show) {\n $(\"#loading-screen\").show();\n $(\"#ajax-loader\").show();\n } else {\n $(\"#loading-screen\").hide();\n $(\"#ajax-loader\").hide();\n }\n}", "title": "" }, { "docid": "4af1a6a4079b48c0751bedce3d2be120", "score": "0.7117906", "text": "function showLoading() {\n\t\tjQuery(\"#loading\").show();\n\t}", "title": "" }, { "docid": "a661e35c8f4623ff2be21f69689c03db", "score": "0.710667", "text": "function hideLoadingView() {\r\n\r\n \r\n}", "title": "" }, { "docid": "55afe12980b19d8438c0ee44a2f9ab1d", "score": "0.70962363", "text": "function show_loading(){\n console.log(\"Showing Loading Screen\")\n loading_screen.style.display = 'block'\n site_screen.style.display = 'none'\n loading_screen.classList.add('d-flex')\n is_loading = true\n}", "title": "" }, { "docid": "3e0f56ecca78ffb5d4ce2cf98b5ba608", "score": "0.7069546", "text": "function hideLoader() {\n\t$.mobile.loading(\"hide\");\n}", "title": "" }, { "docid": "3e0f56ecca78ffb5d4ce2cf98b5ba608", "score": "0.7069546", "text": "function hideLoader() {\n\t$.mobile.loading(\"hide\");\n}", "title": "" }, { "docid": "cae43caa19c51a7b5549549b24af4de5", "score": "0.70457566", "text": "function loading(showOrHide,text) {\n\tif(text){\n\t\tvar textVis = true;\n\t}else{\n\t\tvar textVis = false;\n\t}\n\tsetTimeout(function(){\n\t\tif(showOrHide == \"show\"){\n\t\t\t$(\"body\").addClass('ui-disabled');\n\t\t}else{\n\t\t\t$(\"body\").removeClass('ui-disabled');\n\t\t}\n// $.mobile.loading(showOrHide);\n\t\t$.mobile.loading(showOrHide, {\n\t\t\ttext: text,\n\t\t\ttextVisible: textVis,\n\t\t\ttheme: \"z\",\n\t\t\thtml: \"\"\n\t\t});\n\t}, 1); \n}", "title": "" }, { "docid": "4c15058468cbb0c4caa241afe93270b0", "score": "0.7037838", "text": "function displayLoader() {\n setIsLoading(true);\n }", "title": "" }, { "docid": "354afe4a94a94242a2b913f0ea0ff72a", "score": "0.7035646", "text": "function hideLoadingView() {\n}", "title": "" }, { "docid": "ece284fa1b0d8863d66d733d99dcd4c7", "score": "0.70102006", "text": "function go_loading() {\n\tViews.show_loading();\n}", "title": "" }, { "docid": "f6970cacb7df3d0cc0dbfb3617b1ee2b", "score": "0.70005846", "text": "function setLoading(isLoading) {\n $loading.style.display = isLoading ? 'flex' : 'none';\n}", "title": "" }, { "docid": "0dd8aff345cecf5fc6e8a279b15270e3", "score": "0.69628096", "text": "function preloader() {\n\n document.getElementById('page').style.display = 'block';\n document.getElementById('loading').style.display = 'none';\n\n\n}", "title": "" }, { "docid": "0c3f49aa2d5ca02cf8c39d5e5831babb", "score": "0.6946364", "text": "function tab_LoadingScreenFull() {\n if (flag1 == 0) {\n flag1 = 1;\n if (kony.os.deviceInfo().name == \"iPhone\" || kony.os.deviceInfo().name == \"iPhone Simulator\" || kony.os.deviceInfo().name == \"iPad\" || kony.os.deviceInfo().name == \"iPad Simulator\") kony.application.showLoadingScreen(\"loadingscreen\", \"Loading...\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, {\n shouldShowLabelInBottom: true,\n separatorHeight: 30\n });\n else kony.application.showLoadingScreen(\"loadingscreen\", \"Loading...\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, null);\n kony.timer.schedule(\"timer5\", dismissLoadingScreen1, 4, false);\n }\n}", "title": "" }, { "docid": "a465d2b2a25e81d57b548dde7356dd55", "score": "0.6906576", "text": "function startLoading() {\n\tpageLoading = true;\n\t\n\t// Display loading message\n\tdocument.getElementById(\"loading\").style.display = \"block\";\n\t\n\t// Disable buttons\n\t$('button.form-button').attr(\"disabled\", true);\n}", "title": "" }, { "docid": "2428309c913b3ea6f535642557910fa4", "score": "0.6876182", "text": "function _showLoading() {\n eventManager.fireEvent(LoadActionStartEvent);\n }", "title": "" }, { "docid": "4cac623df8b36829df2e40a8215ab71f", "score": "0.6873192", "text": "function sendind_request_loading(flag){\n\t// flag = true kbace ejt\n\t// flag = false ej@ kpage gif-ov \n\tfunction show(id, value) {\n\t document.getElementById(id).style.display = value ? 'block' : 'none';\n\t}\n show('page', flag);\n show('loading', !flag);\n}", "title": "" }, { "docid": "c94b48b38deb76d8cabe97f3f06ea663", "score": "0.68731636", "text": "function show_loading_spinner() {\n loader_spinner.hidden=false; //Hidden attribute is false means show loader Animation\n quote_container_box.hidden=true; //Quote Box should be Hidden:true while loader is shown \n}", "title": "" }, { "docid": "591ada0a74798545666cb7366dc47bb2", "score": "0.68541193", "text": "function hideLoadingState () {\n let loader = document.getElementsByClassName('pm-loader')[0];\n loader && loader.classList.add('is-hidden');\n}", "title": "" }, { "docid": "24592fcc0d2cf5c49bdba3c7044118c9", "score": "0.6848154", "text": "function showPage() {\n document.getElementById(\"container-loader\").style.display = \"none\";\n document.getElementById(\"container\").style.display = \"block\";\n}", "title": "" }, { "docid": "65b7977862eee4b08f353d84fd9bd749", "score": "0.68300575", "text": "function hideLoadingView() {\n $('.playground').fadeIn(300);\n $('body').toggleClass(\"load\");\n}", "title": "" }, { "docid": "e4953c816fc6c2c62b8c829292e1f5a8", "score": "0.6806729", "text": "showAppLoader() {\n\n\t\tconst bodyElem = document.querySelector('body');\n\n\t\tbodyElem.classList.add('app-loader-visible');\n\n\t}", "title": "" }, { "docid": "e4953c816fc6c2c62b8c829292e1f5a8", "score": "0.6806729", "text": "showAppLoader() {\n\n\t\tconst bodyElem = document.querySelector('body');\n\n\t\tbodyElem.classList.add('app-loader-visible');\n\n\t}", "title": "" }, { "docid": "f9307a46ed8a43e802f6c8880d4e7873", "score": "0.6799927", "text": "function hideLoadingView(duration) {\n setTimeout(async function() {\n $('#loading').html(\"\");\n await $('#jeopardy').css('display','block');\n $('#start').css('display','block');\n }, duration);\n}", "title": "" }, { "docid": "31f3a887021af6a5bc8e81c8a6acbdac", "score": "0.6783219", "text": "function showLoader(){\n\tdocument.body.classList.remove('hide-loader');\n\tdocument.body.classList.add('show-loader');\n}", "title": "" }, { "docid": "4e52dbfca25a88e3e3063eb8a6a55493", "score": "0.67734987", "text": "function showLoadingView() {\n\t$('#jeopardy').remove();\n\t$('#loading').toggleClass('hidden');\n\t// make sure to remove event listener while it's loading\n\t$('#startGame').off('click', setupAndStart);\n\t$('#startGame').text('Loading...');\n}", "title": "" }, { "docid": "7d0c40002307e751a7d369fa570464cb", "score": "0.67673236", "text": "function showLoading() {\n loadingAnimation.style.display = 'block';\n}", "title": "" }, { "docid": "d611167341269ed9d0b2733fe11468c5", "score": "0.6764392", "text": "function showPage() {\n\n $(loadingSpinner).css('display','none');\n $(overlay).css('animation','fadeOut 1s forwards');\n // Remove overlay from DOM after faded out\n setTimeout(function(){\n $(overlay).css('display','none');\n }, 1000);\n}", "title": "" }, { "docid": "1b5d0283836a11895108b2a7d460287d", "score": "0.6742448", "text": "function StartLoading() {\n $(\"#loadingPanel\").show();\n}", "title": "" }, { "docid": "4bcafca675d26d4d6a80a3c1a484fb04", "score": "0.67351305", "text": "function showLoadingIndicator(opts) {\n\t\topts.isResponseReceived = false;\n\t\t// show loading indicator only if it is not already present\n\t\tif(!loadingTimer) {\n\t\t\tloadingTimer = window.setTimeout(function () {\n\t\t\t\tif( !opts.isResponseReceived) {\n\t\t\t\t\tif($.mobile) {\n\t\t\t\t\t\t$.mobile.loading(\"show\");\n\t\t\t\t\t} else if($(\"#_Cordys_Ajax_LoadingIndicator\").length === 0) {\n\t\t\t\t\t\tvar imgDiv = $(\"<div id='_Cordys_Ajax_LoadingIndicator'/>\");\n\t\t\t\t\t\t$(\"body\").append(imgDiv);\n\t\t\t\t\t\timgDiv.css({\"background\":\"url(/cordys/html5/images/custom-loader.gif) no-repeat center center\",\n\t\t\t\t\t\t\t\t\"height\": \"100px\",\n\t\t\t\t\t\t\t\t\"width\": \"100px\",\n\t\t\t\t\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\t\t\t\t\"left\": \"50%\",\n\t\t\t\t\t\t\t\t\"top\": \"50%\",\n\t\t\t\t\t\t\t\t\"margin\": \"-25px 0 0 -25px\",\n\t\t\t\t\t\t\t\t\"z-index\": \"1000\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else if($(\"#_Cordys_Ajax_LoadingIndicator\").length > 0) {\n\t\t\t\t\t\t$(\"#_Cordys_Ajax_LoadingIndicator\").css({\"display\":\"block\"});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, opts.responseWaitTime);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "1a369ebf8546931aa27a0981f1df57f4", "score": "0.67327845", "text": "function showLoading () {\n loading.style.display = \"block\";\n startButtons.style.display = \"none\";\n displayDoWhat.style.display = \"none\";\n refresh.style.display = \"none\";\n setTimeout(showOutput, 3000);\n}", "title": "" }, { "docid": "170ce4b2f0f32239f15ed202c229eacb", "score": "0.67266303", "text": "function loadPage(){\n\tloaded = true;\n\t\n\tflexsliderSetup();\n\n\tsetTimeout(function(){\n\t\t$('.loading').addClass('loaded');\n\t\t$('.landing').addClass('landed');\n\t\tview();\n\t\tif ( $('.spy').length > 0 ) { $(document).trigger('spy-init'); }\t\n\t},1000);\t\t\n\t\t\n}", "title": "" }, { "docid": "1fa7a4b8f9e963533a1cda664449e306", "score": "0.6725307", "text": "function loadPage(){\n\tloaded = true;\n\t\n\tflexsliderSetup();\n\n\tsetTimeout(function(){\n\t\t$('.loading').addClass('loaded');\n\t\t$('.landing').removeClass('landing').addClass('landed');\n\t\tview();\n\t\tif ( $('.spy').length > 0 ) { $(document).trigger('spy-init'); }\t\n\t},500);\t\n\t\t\n}", "title": "" }, { "docid": "524ab4c4ac5f416c5f6e3cd53197c157", "score": "0.67239964", "text": "function showHideLoader(onOff) {\n\t\tif (onOff == 1) {\n\t\t\tvar sLoader = $(\"#loader\").show();\n\t\t} else {\n\t\t\tvar hLoader = $(\"#loader\").hide();\n\t\t}\n\t}", "title": "" }, { "docid": "43dff2d9741fee124df7bce05fbb4311", "score": "0.671412", "text": "function setLoading() {\n loadingIndicator.style.display = \"block\";\n}", "title": "" }, { "docid": "7be5cd54666644e579e253b219beb434", "score": "0.6698027", "text": "function hideLoadingView() {\n loader.style.display = 'none'\n}", "title": "" }, { "docid": "945c2315fbfad89fbdecf983ab750784", "score": "0.6683267", "text": "static get IsLoading() {\n return !!GetIsLoadingScreenActive();\n }", "title": "" }, { "docid": "58bb7a0b31b5d0180e54abfcbb733ac3", "score": "0.66782165", "text": "function showWaiting(){\n\t$(\".loading\").show('fast');\n}", "title": "" }, { "docid": "255d9e8e9fc8bf33062a2fbbaee34340", "score": "0.666203", "text": "function loading(){\r\n loader.hidden = false; // This will display loader\r\n quoteContainer.hidden = true; // This will hide quote container\r\n}", "title": "" }, { "docid": "8c4851769433b4cb4edc1a79edfbf333", "score": "0.6648298", "text": "show() {\n setTimeout(() => {\n this.isLoading.next(true);\n });\n }", "title": "" }, { "docid": "1c94c02fc5465d1648fcd09449e5ac49", "score": "0.6636977", "text": "function initLoading(endLoadingCheck, nextState) {\n\n // Hide other fullscreen window\n $('.fullscreen').hide(0);\n\n // Show loading screen\n if(!$('#loading_screen').is(':visible')) {\n $('#loading_screen').show(0);\n }\n }", "title": "" }, { "docid": "dee03cde434b61b6ebfc73b8571a8b55", "score": "0.6633336", "text": "function ajax_Loading(pState){\n if(pState == 1){$x_Show('loader','wait');}\n else{$x_Hide('loader');}\n}", "title": "" }, { "docid": "50e4f4b3ba95f37b23b0ac46ea301d37", "score": "0.662435", "text": "function hideLoadingView() {\n\t$('.loader').css('visibility', 'hidden');\n\t$('button').text('RESTART');\n}", "title": "" }, { "docid": "a2d0be38355e202704bd516cb4c6f55a", "score": "0.66152114", "text": "function loading() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "title": "" }, { "docid": "e81a90ebbf74c24a2b71f951cccce808", "score": "0.6593784", "text": "function toggleLoadingUI(showLoadingUI) {\n var loadingDivId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'loading';\n var mainDivId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'main';\n\n if (showLoadingUI) {\n document.getElementById(loadingDivId).style.display = 'block';\n document.getElementById(mainDivId).style.display = 'none';\n } else {\n document.getElementById(loadingDivId).style.display = 'none';\n document.getElementById(mainDivId).style.display = 'block';\n }\n }", "title": "" }, { "docid": "332c4d86b229d6163aea3f4954b3f1c4", "score": "0.65923065", "text": "function toggleLoading(on, cb){\n var ld = U.get('sb-loading'),\n p = S.getCurrent().player,\n anim = (p == 'img' || p == 'html'); // fade on images & html\n\n if(on){\n function fn(){\n U.clearOpacity(ld);\n if(cb) cb();\n }\n\n U.setOpacity(ld, 0);\n ld.style.display = '';\n\n if(anim)\n U.animate(ld, 'opacity', 1, S.options.fadeDuration, fn);\n else\n fn();\n }else{\n function fn(){\n ld.style.display = 'none';\n U.clearOpacity(ld);\n if(cb) cb();\n }\n\n if(anim)\n U.animate(ld, 'opacity', 0, S.options.fadeDuration, fn);\n else\n fn();\n }\n }", "title": "" }, { "docid": "332c4d86b229d6163aea3f4954b3f1c4", "score": "0.65923065", "text": "function toggleLoading(on, cb){\n var ld = U.get('sb-loading'),\n p = S.getCurrent().player,\n anim = (p == 'img' || p == 'html'); // fade on images & html\n\n if(on){\n function fn(){\n U.clearOpacity(ld);\n if(cb) cb();\n }\n\n U.setOpacity(ld, 0);\n ld.style.display = '';\n\n if(anim)\n U.animate(ld, 'opacity', 1, S.options.fadeDuration, fn);\n else\n fn();\n }else{\n function fn(){\n ld.style.display = 'none';\n U.clearOpacity(ld);\n if(cb) cb();\n }\n\n if(anim)\n U.animate(ld, 'opacity', 0, S.options.fadeDuration, fn);\n else\n fn();\n }\n }", "title": "" }, { "docid": "c0c938c3c97b6b86b6c57b420f9efa8a", "score": "0.65846324", "text": "function showPage(){\n document.getElementById('pageLoader').style[\"display\"] = 'none';\n document.getElementById('content').style[\"display\"] = '';\n}", "title": "" }, { "docid": "30d2fe0f10c754fb3d36febe6f8a5750", "score": "0.6583636", "text": "function show_loading_message() {\n $('#loading_container').show();\n }", "title": "" }, { "docid": "fd3193737bb1204b7319bddf795c8d08", "score": "0.6583596", "text": "function showLoad(){\r\n\t\t\tif(settings.loadElement != \"\"){\r\n\t\t\t\t$(settings.loadElement).show();\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "a6900d4dbac74fcfdb45e470694a2cf9", "score": "0.65834826", "text": "isShown() {\n return loaderIsShown;\n }", "title": "" }, { "docid": "e25e05bec6ccf6eaab0f378b78368541", "score": "0.6581395", "text": "show () {\n document.querySelector('#loader').classList.add('visible')\n }", "title": "" }, { "docid": "98f204d4bc0de8be86edcaa18a10d31f", "score": "0.65703547", "text": "function showPage() {\r\n\tdocument.getElementById(\"loader\").style.display = \"none\";\r\n\tdocument.getElementById(\"data\").style.display = \"block\";\r\n}", "title": "" }, { "docid": "8abbf6b4b1f0fd888aecde2dcb57ff46", "score": "0.65646076", "text": "function toggleLoadingUI(showLoadingUI, loadingDivId = 'loading', mainDivId = 'main') {\n if (showLoadingUI) {\n document.getElementById(loadingDivId).style.display = 'block';\n document.getElementById(mainDivId).style.display = 'none';\n } else {\n document.getElementById(loadingDivId).style.display = 'none';\n document.getElementById(mainDivId).style.display = 'block';\n }\n}", "title": "" }, { "docid": "60cade5d71b9f631ae4f109229d8529d", "score": "0.65558577", "text": "function showLoad() {\n $('loading').style.display = \"block\";\n $('loading').style.top = (document.documentElement.scrollTop + 300) + \"px\";\n}", "title": "" }, { "docid": "b475a61c818acec670d6b332755a5f26", "score": "0.6546878", "text": "function showLoadingView() {\n $('#jeopardy').html(\"\");\n $('#loading').html(\"\");\n categories = [];\n const loadingIcon = $(`\n <div class=\"fa-10x text-center\">\n <i class=\"fas fa-spinner fa-spin loadingIcon\"></i>\n </div>\n `);\n $('#loading').append(loadingIcon);\n $('#start').css('display','none');\n $('#jeopardy').css('display','none');\n}", "title": "" }, { "docid": "8c0a99bc588fc7c19b37402519ad04ee", "score": "0.65453875", "text": "_hideLoadingScreen() {\n document.body.classList.add('mm-app--booted');\n this._screens.loading.classList.add('mm-loading--hidden');\n this._screens.loading.setAttribute('aria-hidden', true);\n document.removeEventListener('click', this.loadingClickHandler);\n }", "title": "" }, { "docid": "10aed863c63309b74e151eb2fa43f5bf", "score": "0.6537809", "text": "function startLoadSpinner() {\n loader.hidden = false;\n quoteContainer.hidden=true; \n}", "title": "" }, { "docid": "c8da8f5a362429b23e17eafcbfb365f4", "score": "0.653773", "text": "function hideLoadingView() {\n $(\"#loader\").css(\"display\", \"none\");\n $(\"#startBtn\").text(\"Restart\").css(\"font-size\", \"20px\");;\n}", "title": "" }, { "docid": "c87557539f64b4f0c3e5d72084d9a1d7", "score": "0.6535624", "text": "function showPage() {\n document.getElementById(\"loader\").style.display = \"none\";\n document.getElementById(\"flex-parent\").style.display = \"flex\";\n}", "title": "" }, { "docid": "4bb09aa86775507358da1c54eef2e6a7", "score": "0.65318114", "text": "function showLoading() {\n\t\t\t$(\"#map-loading\").show();\n\t\t}", "title": "" }, { "docid": "96b7e735f4a1f8d437325af354fe0214", "score": "0.65205353", "text": "function showLoading() {\n $(\".wait_load\").css(\"display\", \"block\");\n}", "title": "" }, { "docid": "ee755ed4ef440dcc0158b62f9eb5dfb4", "score": "0.65195626", "text": "function loading() {\r\n $loading.prependTo( 'body' ).fadeIn();\r\n }", "title": "" }, { "docid": "403557b48235c8f533764906d0d84922", "score": "0.65188825", "text": "function showLoadingScreen() {\n document.getElementById(\"movies\").style.display = \"none\";\n document.getElementsByClassName(\"main-content\")[0].classList.add(\"loading\");\n }", "title": "" }, { "docid": "dfabd3a2e61a2f6b940d7a350af15037", "score": "0.6510281", "text": "onHideLoading() {\n $(\"#loading, #loading-display\").hide();\n }", "title": "" }, { "docid": "a7132e7a867674ffa0521f544a691a91", "score": "0.6501641", "text": "function showLoadingView() {\n\t$('button').text('LOADING...');\n\t$('.game').empty();\n\tcategories = [];\n\t$('.loader').css('visibility', 'visible');\n}", "title": "" }, { "docid": "f56b8306b267171744fdaa87815981c5", "score": "0.6493093", "text": "function showSpinner(enable) {\n if (enable)\n document.getElementById('loader').style.display = 'block'\n else\n document.getElementById('loader').style.display = 'none'\n}", "title": "" }, { "docid": "77a87291b4eb37e627ef43b93f157960", "score": "0.64743596", "text": "function setLoading(on) {\r\n\tif(on) $(\"body\").addClass(\"ui-loading\");\r\n\telse $(\"body\").removeClass(\"ui-loading\");\r\n}", "title": "" }, { "docid": "f444fd6bcf84080e564336621aa3b48d", "score": "0.6464153", "text": "function showBusy(busy) {\r\n\t\tif (busy === true) {\r\n\t\t\ttry {\r\n\t\t\t\tapi.ui.showStartupModalLoading(); // version v1.7.437 and up\r\n\t\t\t} catch (e) {\r\n\t\t\t\tmyInterface.showStartupModalLoading(); // For ALTUI support.\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tapi.ui.hideModalLoading(true);\r\n\t\t\t} catch (e) {\r\n\t\t\t\tmyInterface.hideModalLoading(true); // For ALTUI support\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "91c81c21406570828d8d4a2c45bb8bf5", "score": "0.646062", "text": "function hide_loading(){\n console.log(\"Hiding Loading Screen\")\n loading_screen.style.display = 'none'\n loading_screen.classList.remove('d-flex')\n site_screen.style.display = 'block'\n is_loading = false\n}", "title": "" }, { "docid": "d026cdadb999e3e46d61317d681ddd95", "score": "0.6455138", "text": "function showLoaderAnimation() {\n\t\tvar currentAnimation = document.getElementById(\"loaderAnimation\");\n\t\tif( currentAnimation ) {\n\t\t\tcurrentAnimation.style.display = \"block\";\n\t\t}\n\t}", "title": "" }, { "docid": "9823efe29f534e537c56da614741f9b2", "score": "0.6449341", "text": "hide() {\n setTimeout(() => {\n this.isLoading.next(false);\n });\n }", "title": "" }, { "docid": "081af8015cf36f90ec46f21b83dbb47e", "score": "0.6447754", "text": "function HideShowLoader(showhide) {\n var x = document.getElementById('loader');\n if (showhide) {\n x.style.display = 'block';\n } else {\n x.style.display = 'none';\n }\n}", "title": "" }, { "docid": "3303b1f7652ecb95782c1809824089a8", "score": "0.6444115", "text": "function hideLoading() {\n\t\tjQuery(\"#loading\").hide();\n\t}", "title": "" }, { "docid": "7ffc595a9082e839ef0a19f78f3017c1", "score": "0.6440527", "text": "function loaded() {\n $('[data-hero-page]').hide();\n if (csr != null && user != null) {\n $('#main-content').show();\n update();\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9f87e4dc4697929f339039a97b509d9e", "score": "0.6435938", "text": "function hideLoadScreen() {\n var loadingContent = document.getElementsByClassName(\"loadingContent\");\n loadingContent[0].style.display = \"none\";\n}", "title": "" }, { "docid": "f0359fe3c97c6194a773bc73171de3d1", "score": "0.64183766", "text": "function toggleLoader(con){\r\n\tif(con){\r\n\t\t$('#mainLoader').show();\r\n\t}else{\r\n\t\t$('#mainLoader').hide();\r\n\t}\r\n}", "title": "" }, { "docid": "b5b70be065ee10fc0da49913992579a4", "score": "0.64001316", "text": "showPage(){\n\t\tthis.page.style(\"visibility\",\"visible\");\n\t}", "title": "" }, { "docid": "4003da9c8526f756d82cd6db7cd567da", "score": "0.63969916", "text": "function showLoadingScreen()\n{\n\t// TODO: var opts = {...} should be defined and called in 'new Spinner(opts)...', but it doesn't seem to be working...\n\t// Instead, the default values in spin.js have been changed...\n\ttarget = document.getElementById('spinner-box');\n\tspinner = new Spinner().spin(target);\n}", "title": "" }, { "docid": "6bc322c57e1ef00e284ad642da38bc3f", "score": "0.63957435", "text": "function setLoading(toggle) {\n document.body.className = (document.body.className || '').replace(/is\\-loading/, '');\n if (toggle) {\n document.body.className += ' is-loading';\n }\n }", "title": "" }, { "docid": "e4bdfe8f6315b5ab67e69a1c138bf179", "score": "0.639522", "text": "function hideLoading() {\n // Hide the Loading Indicator\n loadingIndicator.style.display = \"none\";\n}", "title": "" }, { "docid": "6dcb39aadbc244c684118ee333d29bbb", "score": "0.639161", "text": "function hideLoading(){\r\n $('#loading').hide();\r\n }", "title": "" }, { "docid": "9188de9ab7442abf1f033658d4cc2aec", "score": "0.63888836", "text": "function showLoader(){\n\t\t//console.log(\"showing loader...\");\n\t\tloader.fadeIn();\n\t}", "title": "" }, { "docid": "ca28dfdee390d3fb9de9ecdcbafd4f5b", "score": "0.63863534", "text": "function toggleLoader(con){\n\tif(con){\n\t\t$('#mainLoader').show();\n\t}else{\n\t\t$('#mainLoader').hide();\n\t}\n}", "title": "" }, { "docid": "ca28dfdee390d3fb9de9ecdcbafd4f5b", "score": "0.63863534", "text": "function toggleLoader(con){\n\tif(con){\n\t\t$('#mainLoader').show();\n\t}else{\n\t\t$('#mainLoader').hide();\n\t}\n}", "title": "" }, { "docid": "9b98e9bfdb9e59e68ed062fb29116792", "score": "0.6383719", "text": "function loaderCease() {\n var myloader = document.getElementById(\"loadingSpinner\");\n var myPageContent = document.getElementById(\"pageContent\");\n var mySpinnerHolder = document.getElementById(\"spinnerHolder\");\n myloader.style.display = \"none\";\n myPageContent.style.display = \"block\";\n mySpinnerHolder.style.display = \"none\";\n}", "title": "" }, { "docid": "23839f45c8ef297bebbb95d31a96c81b", "score": "0.6382135", "text": "function _showLoader (iNid) {\n\t\t\t\tVIEW.d_showLoader(iNid);\n\t\t\t\tDICTIONARY.start('.rcontent_loader');\n\t\t\t}", "title": "" }, { "docid": "2823f8c0bb6dfff50b23f7d583ddda15", "score": "0.63804924", "text": "function hideLoading() {\n\tloading_screen.classList.add('hidden');\n}", "title": "" }, { "docid": "ff0387e33e4f9733b2a042d0b6a34ab5", "score": "0.6376474", "text": "function showLoading() {\r\n\t\t\timages[current].el.append('<div class=\"' + o.loadingClass + '\"></div>');\r\n\t\t}", "title": "" }, { "docid": "e02bb2093b0ecb6a5ebaed07dcde91b7", "score": "0.63759094", "text": "function showBusy() {\n\t\t$('.idle').hide();\n\t\t$('.failure').hide();\n\t\t$('.busy').show();\n\t}", "title": "" }, { "docid": "427a22ed1ca32426ad866acada300e7a", "score": "0.6369727", "text": "function showLoading(showIt) {\n var classToAdd = showIt ? 'show' : 'hidden';\n loadingIndicator.removeClass('show hidden');\n loadingIndicator.addClass(classToAdd);\n }", "title": "" }, { "docid": "8be6e602fd5f6f482cea43b5ab8fc893", "score": "0.6355455", "text": "function displayLoading(val) { \n if (val == 1)\n top.document.getElementById('divLoading').style.display = 'block';\n else\n top.document.getElementById('divLoading').style.display = 'none';\n}", "title": "" } ]
84c9865c0395f41fca2e2c04e04b4a2e
Run the standard initializer
[ { "docid": "cb1e3efec9a8999fc9ae514e227dc382", "score": "0.0", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target || !target.nodeName ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n\t\t}\n\n\t\t// Throw an error if the slider was already initialized.\n\t\tif ( target.noUiSlider ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): Slider was already initialized.\");\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target );\n\t\tvar api = scope( target, options, originalOptions );\n\n\t\ttarget.noUiSlider = api;\n\n\t\treturn api;\n\t}", "title": "" } ]
[ { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.7152034", "text": "function init() {}", "title": "" }, { "docid": "365dd013b57d702131e4abc507d3de83", "score": "0.7040384", "text": "async init(){}", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.695813", "text": "initalizing() {}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.6935176", "text": "initialise () {}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.6935176", "text": "initialise () {}", "title": "" }, { "docid": "f62506435450c9854c34f7ea0c71a20a", "score": "0.6855014", "text": "function init() {\n reset('init');\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6840884", "text": "initialize() {}", "title": "" }, { "docid": "25c10cf908dc288b9dd238ad7b8ca4b8", "score": "0.6807939", "text": "function init(){}", "title": "" }, { "docid": "1c37ff0b31861db0b5e437231e91af57", "score": "0.6750267", "text": "async initialize() {\n this.configWriter.guardForExistingConfig();\n this.patchProxies();\n const selectedPreset = await this.selectPreset();\n let configFileName;\n if (selectedPreset) {\n configFileName = await this.initiatePreset(this.configWriter, selectedPreset);\n }\n else {\n configFileName = await this.initiateCustom(this.configWriter);\n }\n await this.gitignoreWriter.addStrykerTempFolder();\n this.out(`Done configuring stryker. Please review \"${configFileName}\", you might need to configure transpilers or your test runner correctly.`);\n this.out(\"Let's kill some mutants with this command: `stryker run`\");\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.67461693", "text": "init() {}", "title": "" }, { "docid": "9d2d0433cd5ec0133b346e75222493ff", "score": "0.6728976", "text": "async init () {}", "title": "" }, { "docid": "b051776c4a331e59a98728903a7dc95a", "score": "0.67111105", "text": "initialize(){}", "title": "" }, { "docid": "4631be357a71f406f41c4f267ba848d3", "score": "0.6672046", "text": "initialization() {\r\n\r\n }", "title": "" }, { "docid": "24cb8731187123a09eea629536469320", "score": "0.6657588", "text": "_init() {\n this._initConfig();\n }", "title": "" }, { "docid": "e35dcaad55ad8e12fd5a61bcd85d99a4", "score": "0.66392237", "text": "init(){}", "title": "" }, { "docid": "2832696e8ee8ac31265dea83a6982adf", "score": "0.66388947", "text": "function init() {\n \n }", "title": "" }, { "docid": "e5b3d2a18ad7e718d91e9f11a3ae907c", "score": "0.6610181", "text": "initializing() {\n\t\tthis.config.defaults(configFile.setup.empty);\n\t\tthis.bindEvents();\n\t}", "title": "" }, { "docid": "f7bad7ec9dff4b550c9d27ddf582298b", "score": "0.65562683", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "f7bad7ec9dff4b550c9d27ddf582298b", "score": "0.65562683", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6547256", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6547256", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6547256", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.6547256", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.6543352", "text": "init() {\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.6543352", "text": "init() {\n\t}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6538159", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6538159", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6538159", "text": "init() { }", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.65267324", "text": "init () {}", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.6513001", "text": "function init() {\n \n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "22cd153e696ad3d9bee6cc8b20548e3e", "score": "0.6497732", "text": "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.6481811", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "6e1764d57f2ce6ba724b13a98c9d4830", "score": "0.6471535", "text": "function init() { \n // using command lie argument to turn on debug mode \n const debug_mode = process.argv[2]; \n \n // check if the user passed in an argument \n if (!debug_mode) { \n // nothing to do...\n } else { \n DEBUG_MODE = debug_mode;\n }\n \n getDictionary(); \n makeServer(); \n}", "title": "" }, { "docid": "76aba3d4adc4df6b8e70d9e59d42dbbc", "score": "0.6461263", "text": "startup() { }", "title": "" }, { "docid": "1c8feec9641e6fe5563882415f5b034a", "score": "0.6444406", "text": "function main() {\r\n initial();\r\n }", "title": "" }, { "docid": "3b270ed4d51b1c2f41936ecd04de31eb", "score": "0.6442381", "text": "async initialize() {\n this.logVerbose(`Initializing test \"${this.name}...`);\n this.startTime = util_2.getTime();\n this.attempted = true;\n }", "title": "" }, { "docid": "6489a230cd1ec123f1956da09c1247e9", "score": "0.6441423", "text": "function _init() {\n dotenv.config({path: \"./.env.example\", silent: true});\n dotenv.config({silent: true});\n\n db = require(\"./database.js\"); \n\n db().catch(dbError).then((s,j) => process.exit(s === 1? 1 : 0));\n}", "title": "" }, { "docid": "f26d241b0074d64ef3bcab1a26277985", "score": "0.6412217", "text": "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n\r\n }", "title": "" }, { "docid": "36db42993ce15c2ea3055aa85f51f226", "score": "0.6386331", "text": "async initialize() {\n }", "title": "" }, { "docid": "ecabce8c50aa1ec7af9ddc2e3bf6d2ab", "score": "0.63849866", "text": "function init() {\n\n\t}", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.63724136", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "26bbd14ad45ce1fbbac0119ebd6a3961", "score": "0.63658786", "text": "function init() {\n //\n }", "title": "" }, { "docid": "333b3dcf69afa4711f5a4b475ac52943", "score": "0.6361476", "text": "init() {\n // Load .env\n dotenv_1.default.config({ path: '../.env' });\n // Loop through each envVariable and set them in the envMap\n this.variables.forEach((key) => {\n const envValue = process.env[key];\n // Use an if statement to make sure you have all of the required variables\n if (typeof envValue === 'undefined') {\n throw Error(`Required environment variable: '${key}', is not set.`);\n }\n else {\n // set each key and value in the map.\n this.envMap.set(key, envValue);\n }\n });\n // Freeze the map object so it cannot be changed once initialized\n Object.freeze(this.envMap);\n // Set initialized to true to show that the initialized function has been called.\n this.initialize = true;\n }", "title": "" }, { "docid": "73b86c83d2c0a6c851a47388d96cc0c0", "score": "0.63554835", "text": "init() {\n this.initialize();\n }", "title": "" }, { "docid": "042853c4749209bf69e915454ed98968", "score": "0.6351572", "text": "init() {\n // empty\n }", "title": "" }, { "docid": "a3436e33e77600a923e3f8fcca24e03e", "score": "0.6322529", "text": "init() {\n\t\tDebug.success(`${this.name} initialized`);\n\t}", "title": "" }, { "docid": "b7b38aa18e395295bc1b483a413d632a", "score": "0.63209426", "text": "function init() {\n // generate some options\n generateOptions();\n\n console.log(\"The lottery game loaded...\");\n}", "title": "" }, { "docid": "acab30527a50508593e7fe5605475b61", "score": "0.6320166", "text": "static init() {\n console.log('bootstrap.init !!!');\n main.init();\n }", "title": "" }, { "docid": "a2556d3f3c042afec5d53e8ab7c9a163", "score": "0.6300375", "text": "_init () {\n if (!this.generator.isSectionEnabled(this.name)) {\n this.initializing = this._initializing\n this.prompts = this._prompts\n this.configuring = this._configuring\n this.default = this._default\n this.writing = this._writing\n this.conflicts = this._conflicts\n this.install = this._install\n this.end = this._end\n }\n }", "title": "" }, { "docid": "99b8eeb71dcf1726a452b21c6536b8fa", "score": "0.6291338", "text": "function init() {\n\tpreflight();\n\n\tif ( ! canRun() ) {\n\t\treturn;\n\t}\n\n\tsetupDiffContainer();\n\n\tsetupDiffList();\n\n\tsetupLoadMoreButton();\n}", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.6286429", "text": "function init() {\n\n }", "title": "" }, { "docid": "b1946aa2724a387388d4b326f3eece18", "score": "0.6286344", "text": "async init() {\n this.runner = new Runner(this.containerId, {\n trexCount: this.trexCount,\n onRunning: this.handleRunning.bind(this),\n title: this.title,\n level: this.level\n });\n this.runner.on('running', this.handleRunning.bind(this));\n this.runner.on('reset', this.handleReset.bind(this));\n this.runner.on('crash', this.handleCrash.bind(this));\n this.runner.on('gameover', this.handleGameOver.bind(this));\n await this.runner.init();\n this.runner.restart();\n }", "title": "" }, { "docid": "8deaa1518eab1bfe322091ee4e82ab6c", "score": "0.62845075", "text": "function init() {\n\n }", "title": "" }, { "docid": "8b83da5abadd67f63767d6ef87ea377c", "score": "0.6282718", "text": "initialize() {\n this.out_lib.showInitializationScreen();\n setTimeout(() => {\n this.clearDocument();\n this.createConsole();\n this.parser_lib.startParser(this.configuration.dispatcher, this);\n }, this.configuration.general.loading_screen_time);\n }", "title": "" }, { "docid": "fc0ef87020777844289c37cfba197a39", "score": "0.6279345", "text": "function init() {\n\n\n }", "title": "" }, { "docid": "374f392cae49c3a478e63ddfd5663e5b", "score": "0.6275511", "text": "function Initialization() {\n\t\tpopulateRunnningText();\n\t}", "title": "" }, { "docid": "868f7fb80acf69b190ad075d5bc3caa6", "score": "0.6273193", "text": "function init() {\n // Retrieve any arguments passed in via the command line\n args = cliConfig.getArguments();\n\n // Supply usage info if help argument was passed\n if (args.help) {\n console.log(cliConfig.getUsage());\n process.exit(0);\n }\n\n getClientAuth(function(data) {\n parseClientAuth(data, function(err, data) {\n if (err) {\n console.error(err.message);\n process.exit(0);\n }\n writeEdgerc(data, function(err) {\n if (err) {\n if (err.errno == -13) {\n console.error(\"Unable to access \" + err.path + \". Please make sure you \" +\n \"have permission to access this file or perhaps try running the \" +\n \"command as sudo.\");\n process.exit(0);\n }\n }\n console.log(\"The section '\" + args.section + \"' has been succesfully added to \" + args.path + \"\\n\");\n });\n });\n });\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" }, { "docid": "29f90754b4c8f9e0779ef65d213e2f89", "score": "0.6269913", "text": "function run(args) {\n initRuntime();\n}", "title": "" } ]
4f9a1b0109a0eff30885cc0fb9ae814e
to add all the countries from the database to the html page
[ { "docid": "3469504f403f25326ea7a73db05f47bf", "score": "0.6912309", "text": "function setAllCountriesInPage(countries) {\n // to create a col for 6 countries\n let columns = 0;\n\n // loop through all countries to make html tags for it\n Object.values(countries).forEach((country) => {\n\n // create after 6 countries every time a new column\n if (countries.indexOf(country) % 6 === 0) {\n columns += 1;\n $(\".europa\").append(\"<div id='\" + columns + \"' class='col-6 col-md-4 pb-3'></div>\");\n }\n\n // create div, label & input for every country\n // input is special because input has a onclick function on it\n $(\"#\" + columns).append(\n \"<div class='\" + country.name + \"'></div>\" +\n \"\");\n $(\".\" + country.name).append(\n \"<input id='country\" + country.country_id + \"' type='checkbox' name='\" + country.name + \"' value='\" + country.name + \"'>\"\n ).change(function () {\n changeCountryValue(country);\n });\n $(\".\" + country.name).append(\n \"<label for='\" + country.country_id + \"' class='ml-1 my-0'>\" + country.name + \"</label>\" +\n \"\");\n })\n}", "title": "" } ]
[ { "docid": "ff756a81c4c88fecc37b10059a6a1a7c", "score": "0.7060303", "text": "function showCountriesList(resp){\n countriesList.empty();\n var population = ''; \n resp.forEach(function(item) { \n population = item.population.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \" \"); \n countriesList.append(\n '<table class=\"country-table\">' +\n '<caption>' + item.name + '</caption>' +\n '<thead>' +\n '<td>region</td><td>capital</td><td>population</td><td>flag</td>' +\n '</thead>' + \n '<tr>' +\n '<td>' + item.subregion + '</td><td>' + item.capital + '</td><td>' + population + '</td><td><img src=\"' + item.flag + '\" class=\"flag\"></td>' +\n '</tr>' +\n '</table>'\n )\n })\n }", "title": "" }, { "docid": "214361f6e492d1508356b0f0f2e50469", "score": "0.705473", "text": "populateCountry(countries) {\n var countryOption = ''\n countries.forEach((country) => {\n countryOption += `<option>${country}</option>`\n })\n document.querySelector('#country-names').insertAdjacentHTML('beforeend', countryOption)\n }", "title": "" }, { "docid": "8e7b80d1bb3cadf93bee3aa805522127", "score": "0.6886979", "text": "function insertSelectionData(countries) {\n var countriesSet = new Set(countries);\n var selectOptions = \"\";\n countriesSet.forEach(function(value, key, set) {\n selectOptions += format(\n '<option value=\"%s\" %s>%s</option>',\n key,\n key === \"Indonesia\" ? \"selected\" : \"\",\n key\n );\n });\n $(\"#country-selector\").html(selectOptions);\n $(\"#country-selector\").selectpicker(\"refresh\");\n selectCountry(\"Indonesia\");\n}", "title": "" }, { "docid": "37526f154ef78b1b4373a6b992864b45", "score": "0.68080944", "text": "function interCountries(region){\ncountry.innerHTML=`<option value=\"Any\">Any</option>`;\nlet countryName=Object.keys(getConfirmedByCountry(region, \"confirmed\"))\nfor(let i=0;i<countryName.length;i++){\ncountry.innerHTML+=`<option value=\"${countryName[i]}\">${countryName[i]}</option>`\n}\n}", "title": "" }, { "docid": "8026b20c87b78168034c2df6b7719f5d", "score": "0.68024695", "text": "function getAllCountries() {\n FYSCloud.API.queryDatabase(\n \"SELECT * FROM country\"\n ).done(function (data) {\n // to set the top 5 countries\n getTopCountries(data);\n\n // to set countries for checkboxes\n setAllCountriesInPage(data);\n }).fail(function (reason) {\n console.log(reason);\n });\n}", "title": "" }, { "docid": "212d84f224ffadf0291b36213b0b85a5", "score": "0.6788853", "text": "function build_ft_countries_select() {\n let ft_countries_html = '<option selected>Add country</option>';\n for (const [index, country] of countries.entries()) {\n ft_countries_html += navigation.ft_countries.indexOf(country) == -1 ? `<option>${country}</option>` : '';\n }\n $('#ft_add_country').html(ft_countries_html);\n}", "title": "" }, { "docid": "745925f4e3b0f9e428369d60738fba7e", "score": "0.6719806", "text": "function getCountryList(){\r\n $.ajax({\r\n url: 'libs/php/countryList.php',\r\n type:'POST',\r\n dataType:'JSON',\r\n success:(result) => {\r\n console.log(result);\r\n selCountry = $('#selCountry')\r\n result['data'].forEach(country => {\r\n selCountry.append(`<option value = ${country['iso3']}>${country['countryName']}</option>`);\r\n\r\n \r\n });\r\n },error: function(jqXHR, textStatus, errorThrown){\r\n console.log('country not selected');\r\n }\r\n })\r\n}", "title": "" }, { "docid": "3270d0a55199b16a4dfd5bd556e77b90", "score": "0.664926", "text": "function getAllCountries(){\n\tlet query = \"SELECT DISTINCT country FROM producers ORDER BY lower(country)\";\n\t\n\tvar countryList = dbConnection.exec(query)[0].values;\n\tcountryList.forEach(function(country, index){\n\t\tvar label = document.createElement(\"label\");\n\t\tvar input = document.createElement(\"input\");\n\t\tinput.setAttribute(\"onclick\", \"getByCountry()\");\n\t\tinput.setAttribute(\"id\", \"countries_\"+index);\n\t\tinput.setAttribute(\"type\", \"checkbox\");\n\t\tinput.setAttribute(\"value\", \"\\\"\"+country+\"\\\"\");\n\t\tvar htmlStr = input.outerHTML + country;\n\n\t\tlabel.innerHTML = htmlStr;\n\n\t\t//label.innerHTML = \"<input id=\\\"country_\"+index+\"\\\" type=\\\"checkbox\\\" value=\\\"\"+country+\"\\\">\"+country;\n\n\t\tvar node = document.createElement(\"div\");\n\t\tnode.setAttribute(\"class\", \"checkbox\");\n\n\t\tvar countrySection = document.getElementById(\"countryCheckboxes\");\n\t\t\n\t\tnode.appendChild(label);\n\t\tcountrySection.appendChild(node);\n\n\t})\n\n}", "title": "" }, { "docid": "c2531d35b23929b53762227656ddf39d", "score": "0.66147554", "text": "function initialise(countriesData) {\n apiCountries = countriesData;\n dropDownCountries = \"\";\n\n for (let i = 0; i < apiCountries.length; i++) {\n dropDownCountries += `<option value=\"${apiCountries[i].alpha3Code}\">${apiCountries[i].name}</option>`;\n }\n\n $(\"#list-of-countries\").html(dropDownCountries);\n displayCountryInfo(\"IRL\");\n}", "title": "" }, { "docid": "5b4333042b77da54c3912d47d2772d77", "score": "0.65766853", "text": "function Countries() {\n FlightsSrv.getCountries().success(function(countries) {\n $scope.Countries = countries;\n });\n }", "title": "" }, { "docid": "5b4333042b77da54c3912d47d2772d77", "score": "0.65766853", "text": "function Countries() {\n FlightsSrv.getCountries().success(function(countries) {\n $scope.Countries = countries;\n });\n }", "title": "" }, { "docid": "ec0763bedc72736fb5afbad7078853d8", "score": "0.65741044", "text": "_createCountries() {\n this.countries = Util.createDomNode({\n element: 'select',\n classList: ['select'],\n id: 'selectCountries',\n parent: this.selectBar,\n attributes: {'data-bind': 'country'}\n });\n\n arrayCountires.forEach((source) => {\n Util.createDomNode({\n element: 'option',\n classList: ['select'],\n value: source.lang,\n html: source.desc,\n parent: this.countries\n });\n });\n\n this.selectBar.appendChild(this.countries);\n }", "title": "" }, { "docid": "184edb86b5dd9730f9096c2b41e45311", "score": "0.65433055", "text": "function fillCountrySelector(countries) {\n for (var i = 0; i < countries.length; i++) {\n $('#selector-country-stats').append($('<option>', {\n value: countries[i].location_country,\n text: countries[i].location_country + '(' + countries[i].total + ')'\n }));\n }\n getCountryStats();\n}", "title": "" }, { "docid": "aa413eb08d1a16efe0afc6daef32762b", "score": "0.65363866", "text": "function printCountry() {\n\tfor (let field in countryListRaw){\n\t\tif (field === \"data\") {\n\t\t\tfor (let code in countryListRaw[field]) {\n\t\t\t\tif (countryListRaw[field][code].country.indexOf(' ') < 0) {\n\t\t\t\t\tcountryList.push(countryListRaw[field][code].country.toLowerCase());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcountry = randomCountry();\n\tgenerateLetterButtons();\n}", "title": "" }, { "docid": "ee83cf1638be192a9233992bb13a92ed", "score": "0.6521348", "text": "function getCountriesList() {\n const dropDownList = document.querySelector('#country-list');\n\n fetch('https://restcountries.com/v2/all').then(res => res.json()).then((countriesList) => {\n countriesList.forEach((country) => {\n const option = document.createElement('option');\n const textNode = document.createTextNode(country.name);\n option.setAttribute('value', country.name);\n option.appendChild(textNode);\n dropDownList.appendChild(option);\n return;\n });\n })\n}", "title": "" }, { "docid": "786f21026cd2668be74ae569b6e3447e", "score": "0.64614236", "text": "async function addCountriesInSelect() {\n let selectContainer = document.getElementById(\"country\");\n if (selectContainer == null)\n return;\n let countries;\n await getAllPossibleValuesOfFilterHTTPRequest('countries').then(countriesArray => {\n countries = countriesArray\n });\n countries.forEach(item => {\n const option = document.createElement(\"option\");\n option.text = item;\n selectContainer.add(option);\n });\n}", "title": "" }, { "docid": "d310993997a7abf4c2285515085e8b8d", "score": "0.6453797", "text": "function countriesReceived() {\n let countries = JSON.parse(this.responseText);\n let list = document.querySelector(\"datalist[id=countries]\");\n list.innerHTML = \"\"; // Clean current countries\n\n // Add new suggestions\n for (let country in countries) {\n let item = document.createElement(\"option\");\n\t\titem.value = countries[country].name;\n list.appendChild(item);\n }\n}", "title": "" }, { "docid": "40a3f412aad7931b2625ce4db9c39cac", "score": "0.64239186", "text": "function getAllCountries () {\n return axios.post(\"\", {\n initials: \"\",\n count: 9999\n })\n }", "title": "" }, { "docid": "32150e2ae38bf5b326765a49e9a96fc5", "score": "0.6391058", "text": "async function getAllCases() {\n try {\n var selectCountry = document.getElementById('global_tins')\n for (let index = 0; index < allCases.length; index++) {\n var option = document.createElement(\"option\");\n option.text = allCases[index]['Country_Region'];\n option.id = `option${index}`\n selectCountry.add(option);\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "a104f8c8f4e63516df4e635b7e017d76", "score": "0.6384441", "text": "function populateCountries(selectBoxName) {\n\taddOptionToList(selectBoxName,\"\",\"\");\n\taddOptionToList(selectBoxName,\"USA\",\"USA\");\n\taddOptionToList(selectBoxName,\"Afghanistan\",\"Afghanistan\");\n\taddOptionToList(selectBoxName,\"Albania\",\"Albania\");\n\taddOptionToList(selectBoxName,\"Algeria\",\"Algeria\");\n\taddOptionToList(selectBoxName,\"American Samoa\",\"American Samoa\");\n\taddOptionToList(selectBoxName,\"Andorra\",\"Andorra\");\n\taddOptionToList(selectBoxName,\"Angola\",\"Angola\");\n\taddOptionToList(selectBoxName,\"Anguilla\",\"Anguilla\");\n\taddOptionToList(selectBoxName,\"Antarctica\",\"Antarctica\");\n\taddOptionToList(selectBoxName,\"Antigua and Barbuda\",\"Antigua and Barbuda\");\n\taddOptionToList(selectBoxName,\"Arctic Ocean\",\"Arctic Ocean\");\n\taddOptionToList(selectBoxName,\"Argentina\",\"Argentina\");\n\taddOptionToList(selectBoxName,\"Armenia\",\"Armenia\");\n\taddOptionToList(selectBoxName,\"Aruba\",\"Aruba\");\n\taddOptionToList(selectBoxName,\"Ashmore and Cartier Islands\",\"Ashmore and Cartier Islands\");\n\taddOptionToList(selectBoxName,\"Atlantic Ocean\",\"Atlantic Ocean\");\n\taddOptionToList(selectBoxName,\"Australia\",\"Australia\");\n\taddOptionToList(selectBoxName,\"Austria\",\"Austria\");\n\taddOptionToList(selectBoxName,\"Azerbaijan\",\"Azerbaijan\");\n\taddOptionToList(selectBoxName,\"Bahamas\",\"Bahamas\");\n\taddOptionToList(selectBoxName,\"Bahrain\",\"Bahrain\");\n\taddOptionToList(selectBoxName,\"Baltic Sea\",\"Baltic Sea\");\n\taddOptionToList(selectBoxName,\"Baker Island\",\"Baker Island\");\n\taddOptionToList(selectBoxName,\"Bangladesh\",\"Bangladesh\");\n\taddOptionToList(selectBoxName,\"Barbados\",\"Barbados\");\n\taddOptionToList(selectBoxName,\"Bassas da India\",\"Bassas da India\");\n\taddOptionToList(selectBoxName,\"Belarus\",\"Belarus\");\n\taddOptionToList(selectBoxName,\"Belgium\",\"Belgium\");\n\taddOptionToList(selectBoxName,\"Belize\",\"Belize\");\n\taddOptionToList(selectBoxName,\"Benin\",\"Benin\");\n\taddOptionToList(selectBoxName,\"Bermuda\",\"Bermuda\");\n\taddOptionToList(selectBoxName,\"Bhutan\",\"Bhutan\");\n\taddOptionToList(selectBoxName,\"Bolivia\",\"Bolivia\");\n\taddOptionToList(selectBoxName,\"Borneo\",\"Borneo\");\n\taddOptionToList(selectBoxName,\"Bosnia and Herzegovina\",\"Bosnia and Herzegovina\");\n\taddOptionToList(selectBoxName,\"Botswana\",\"Botswana\");\n\taddOptionToList(selectBoxName,\"Bouvet Island\",\"Bouvet Island\");\n\taddOptionToList(selectBoxName,\"Brazil\",\"Brazil\");\n\taddOptionToList(selectBoxName,\"British Virgin Islands\",\"British Virgin Islands\");\n\taddOptionToList(selectBoxName,\"Brunei\",\"Brunei\");\n\taddOptionToList(selectBoxName,\"Bulgaria\",\"Bulgaria\");\n\taddOptionToList(selectBoxName,\"Burkina Faso\",\"Burkina Faso\");\n\taddOptionToList(selectBoxName,\"Burundi\",\"Burundi\");\n\taddOptionToList(selectBoxName,\"Cambodia\",\"Cambodia\");\n\taddOptionToList(selectBoxName,\"Cameroon\",\"Cameroon\");\n\taddOptionToList(selectBoxName,\"Canada\",\"Canada\");\n\taddOptionToList(selectBoxName,\"Cape Verde\",\"Cape Verde\");\n\taddOptionToList(selectBoxName,\"Cayman Islands\",\"Cayman Islands\");\n\taddOptionToList(selectBoxName,\"Central African Republic\",\"Central African Republic\");\n\taddOptionToList(selectBoxName,\"Chad\",\"Chad\");\n\taddOptionToList(selectBoxName,\"Chile\",\"Chile\");\n\taddOptionToList(selectBoxName,\"China\",\"China\");\n\taddOptionToList(selectBoxName,\"Christmas Island\",\"Christmas Island\");\n\taddOptionToList(selectBoxName,\"Clipperton Island\",\"Clipperton Island\");\n\taddOptionToList(selectBoxName,\"Cocos Islands\",\"Cocos Islands\");\n\taddOptionToList(selectBoxName,\"Colombia\",\"Colombia\");\n\taddOptionToList(selectBoxName,\"Comoros\",\"Comoros\");\n\taddOptionToList(selectBoxName,\"Cook Islands\",\"Cook Islands\");\n\taddOptionToList(selectBoxName,\"Coral Sea Islands\",\"Coral Sea Islands\");\n\taddOptionToList(selectBoxName,\"Costa Rica\",\"Costa Rica\");\n\taddOptionToList(selectBoxName,\"Cote d'Ivoire\",\"Cote d'Ivoire\");\n\taddOptionToList(selectBoxName,\"Croatia\",\"Croatia\");\n\taddOptionToList(selectBoxName,\"Cuba\",\"Cuba\");\n\taddOptionToList(selectBoxName,\"Curacao\",\"Curacao\");\n\taddOptionToList(selectBoxName,\"Cyprus\",\"Cyprus\");\n\taddOptionToList(selectBoxName,\"Czech Republic\",\"Czech Republic\");\n\taddOptionToList(selectBoxName,\"Democratic Republic of the Congo\",\"Democratic Republic of the Congo\");\n\taddOptionToList(selectBoxName,\"Denmark\",\"Denmark\");\n\taddOptionToList(selectBoxName,\"Djibouti\",\"Djibouti\");\n\taddOptionToList(selectBoxName,\"Dominica\",\"Dominica\");\n\taddOptionToList(selectBoxName,\"Dominican Republic\",\"Dominican Republic\");\n\taddOptionToList(selectBoxName,\"East Timor\",\"East Timor\");\n\taddOptionToList(selectBoxName,\"Ecuador\",\"Ecuador\");\n\taddOptionToList(selectBoxName,\"Egypt\",\"Egypt\");\n\taddOptionToList(selectBoxName,\"El Salvador\",\"El Salvador\");\n\taddOptionToList(selectBoxName,\"Equatorial Guinea\",\"Equatorial Guinea\");\n\taddOptionToList(selectBoxName,\"Eritrea\",\"Eritrea\");\n\taddOptionToList(selectBoxName,\"Estonia\",\"Estonia\");\n\taddOptionToList(selectBoxName,\"Ethiopia\",\"Ethiopia\");\n\taddOptionToList(selectBoxName,\"Europa Island\",\"Europa Island\");\n\taddOptionToList(selectBoxName,\"Falkland Islands (Islas Malvinas)\",\"Falkland Islands (Islas Malvinas)\");\n\taddOptionToList(selectBoxName,\"Faroe Islands\",\"Faroe Islands\");\n\taddOptionToList(selectBoxName,\"Fiji\",\"Fiji\");\n\taddOptionToList(selectBoxName,\"Finland\",\"Finland\");\n\taddOptionToList(selectBoxName,\"France\",\"France\");\n\taddOptionToList(selectBoxName,\"French Guiana\",\"French Guiana\");\n\taddOptionToList(selectBoxName,\"French Polynesia\",\"French Polynesia\");\n\taddOptionToList(selectBoxName,\"French Southern and Antarctic Lands\",\"French Southern and Antarctic Lands\");\n\taddOptionToList(selectBoxName,\"Gabon\",\"Gabon\");\n\taddOptionToList(selectBoxName,\"Gambia\",\"Gambia\");\n\taddOptionToList(selectBoxName,\"Gaza Strip\",\"Gaza Strip\");\n\taddOptionToList(selectBoxName,\"Georgia\",\"Georgia\");\n\taddOptionToList(selectBoxName,\"Germany\",\"Germany\");\n\taddOptionToList(selectBoxName,\"Ghana\",\"Ghana\");\n\taddOptionToList(selectBoxName,\"Gibraltar\",\"Gibraltar\");\n\taddOptionToList(selectBoxName,\"Glorioso Islands\",\"Glorioso Islands\");\n\taddOptionToList(selectBoxName,\"Greece\",\"Greece\");\n\taddOptionToList(selectBoxName,\"Greenland\",\"Greenland\");\n\taddOptionToList(selectBoxName,\"Grenada\",\"Grenada\");\n\taddOptionToList(selectBoxName,\"Guadeloupe\",\"Guadeloupe\");\n\taddOptionToList(selectBoxName,\"Guam\",\"Guam\");\n\taddOptionToList(selectBoxName,\"Guatemala\",\"Guatemala\");\n\taddOptionToList(selectBoxName,\"Guernsey\",\"Guernsey\");\n\taddOptionToList(selectBoxName,\"Guinea\",\"Guinea\");\n\taddOptionToList(selectBoxName,\"Guinea-Bissau\",\"Guinea-Bissau\");\n\taddOptionToList(selectBoxName,\"Guyana\",\"Guyana\");\n\taddOptionToList(selectBoxName,\"Haiti\",\"Haiti\");\n\taddOptionToList(selectBoxName,\"Heard Island and McDonald Islands\",\"Heard Island and McDonald Islands\");\n\taddOptionToList(selectBoxName,\"Honduras\",\"Honduras\");\n\taddOptionToList(selectBoxName,\"Hong Kong\",\"Hong Kong\");\n\taddOptionToList(selectBoxName,\"Howland Island\",\"Howland Island\");\n\taddOptionToList(selectBoxName,\"Hungary\",\"Hungary\");\n\taddOptionToList(selectBoxName,\"Iceland\",\"Iceland\");\n\taddOptionToList(selectBoxName,\"India\",\"India\");\n\taddOptionToList(selectBoxName,\"Indian Ocean\",\"Indian Ocean\");\n\taddOptionToList(selectBoxName,\"Indonesia\",\"Indonesia\");\n\taddOptionToList(selectBoxName,\"Iran\",\"Iran\");\n\taddOptionToList(selectBoxName,\"Iraq\",\"Iraq\");\n\taddOptionToList(selectBoxName,\"Ireland\",\"Ireland\");\n\taddOptionToList(selectBoxName,\"Isle of Man\",\"Isle of Man\");\n\taddOptionToList(selectBoxName,\"Israel\",\"Israel\");\n\taddOptionToList(selectBoxName,\"Italy\",\"Italy\");\n\taddOptionToList(selectBoxName,\"Jamaica\",\"Jamaica\");\n\taddOptionToList(selectBoxName,\"Jan Mayen\",\"Jan Mayen\");\n\taddOptionToList(selectBoxName,\"Japan\",\"Japan\");\n\taddOptionToList(selectBoxName,\"Jarvis Island\",\"Jarvis Island\");\n\taddOptionToList(selectBoxName,\"Jersey\",\"Jersey\");\n\taddOptionToList(selectBoxName,\"Johnston Atoll\",\"Johnston Atoll\");\n\taddOptionToList(selectBoxName,\"Jordan\",\"Jordan\");\n\taddOptionToList(selectBoxName,\"Juan de Nova Island\",\"Juan de Nova Island\");\n\taddOptionToList(selectBoxName,\"Kazakhstan\",\"Kazakhstan\");\n\taddOptionToList(selectBoxName,\"Kenya\",\"Kenya\");\n\taddOptionToList(selectBoxName,\"Kerguelen Archipelago\",\"Kerguelen Archipelago\");\n\taddOptionToList(selectBoxName,\"Kingman Reef\",\"Kingman Reef\");\n\taddOptionToList(selectBoxName,\"Kiribati\",\"Kiribati\");\n\taddOptionToList(selectBoxName,\"Kosovo\",\"Kosovo\");\n\taddOptionToList(selectBoxName,\"Kuwait\",\"Kuwait\");\n\taddOptionToList(selectBoxName,\"Kyrgyzstan\",\"Kyrgyzstan\");\n\taddOptionToList(selectBoxName,\"Laos\",\"Laos\");\n\taddOptionToList(selectBoxName,\"Latvia\",\"Latvia\");\n\taddOptionToList(selectBoxName,\"Lebanon\",\"Lebanon\");\n\taddOptionToList(selectBoxName,\"Lesotho\",\"Lesotho\");\n\taddOptionToList(selectBoxName,\"Liberia\",\"Liberia\");\n\taddOptionToList(selectBoxName,\"Libya\",\"Libya\");\n\taddOptionToList(selectBoxName,\"Liechtenstein\",\"Liechtenstein\");\n\taddOptionToList(selectBoxName,\"Lithuania\",\"Lithuania\");\n\taddOptionToList(selectBoxName,\"Luxembourg\",\"Luxembourg\");\n\taddOptionToList(selectBoxName,\"Macau\",\"Macau\");\n\taddOptionToList(selectBoxName,\"Macedonia\",\"Macedonia\");\n\taddOptionToList(selectBoxName,\"Madagascar\",\"Madagascar\");\n\taddOptionToList(selectBoxName,\"Malawi\",\"Malawi\");\n\taddOptionToList(selectBoxName,\"Malaysia\",\"Malaysia\");\n\taddOptionToList(selectBoxName,\"Maldives\",\"Maldives\");\n\taddOptionToList(selectBoxName,\"Mali\",\"Mali\");\n\taddOptionToList(selectBoxName,\"Malta\",\"Malta\");\n\taddOptionToList(selectBoxName,\"Marshall Islands\",\"Marshall Islands\");\n\taddOptionToList(selectBoxName,\"Martinique\",\"Martinique\");\n\taddOptionToList(selectBoxName,\"Mauritania\",\"Mauritania\");\n\taddOptionToList(selectBoxName,\"Mauritius\",\"Mauritius\");\n\taddOptionToList(selectBoxName,\"Mayotte\",\"Mayotte\");\n\taddOptionToList(selectBoxName,\"Mediterranean Sea\",\"Mediterranean Sea\");\n\taddOptionToList(selectBoxName,\"Mexico\",\"Mexico\");\n\taddOptionToList(selectBoxName,\"Micronesia\",\"Micronesia\");\n\taddOptionToList(selectBoxName,\"Midway Islands\",\"Midway Islands\");\n\taddOptionToList(selectBoxName,\"Moldova\",\"Moldova\");\n\taddOptionToList(selectBoxName,\"Monaco\",\"Monaco\");\n\taddOptionToList(selectBoxName,\"Mongolia\",\"Mongolia\");\n\taddOptionToList(selectBoxName,\"Montenegro\",\"Montenegro\");\n\taddOptionToList(selectBoxName,\"Montserrat\",\"Montserrat\");\n\taddOptionToList(selectBoxName,\"Morocco\",\"Morocco\");\n\taddOptionToList(selectBoxName,\"Mozambique\",\"Mozambique\");\n\taddOptionToList(selectBoxName,\"Myanmar\",\"Myanmar\");\n\taddOptionToList(selectBoxName,\"Namibia\",\"Namibia\");\n\taddOptionToList(selectBoxName,\"Nauru\",\"Nauru\");\n\taddOptionToList(selectBoxName,\"Navassa Island\",\"Navassa Island\");\n\taddOptionToList(selectBoxName,\"Nepal\",\"Nepal\");\n\taddOptionToList(selectBoxName,\"Netherlands\",\"Netherlands\");\n\taddOptionToList(selectBoxName,\"New Caledonia\",\"New Caledonia\");\n\taddOptionToList(selectBoxName,\"New Zealand\",\"New Zealand\");\n\taddOptionToList(selectBoxName,\"Nicaragua\",\"Nicaragua\");\n\taddOptionToList(selectBoxName,\"Niger\",\"Niger\");\n\taddOptionToList(selectBoxName,\"Nigeria\",\"Nigeria\");\n\taddOptionToList(selectBoxName,\"Niue\",\"Niue\");\n\taddOptionToList(selectBoxName,\"Norfolk Island\",\"Norfolk Island\");\n\taddOptionToList(selectBoxName,\"North Korea\",\"North Korea\");\n\taddOptionToList(selectBoxName,\"North Sea\",\"North Sea\");\n\taddOptionToList(selectBoxName,\"Northern Mariana Islands\",\"Northern Mariana Islands\");\n\taddOptionToList(selectBoxName,\"Norway\",\"Norway\");\n\taddOptionToList(selectBoxName,\"Oman\",\"Oman\");\n\taddOptionToList(selectBoxName,\"Pacific Ocean\",\"Pacific Ocean\");\n\taddOptionToList(selectBoxName,\"Pakistan\",\"Pakistan\");\n\taddOptionToList(selectBoxName,\"Palau\",\"Palau\");\n\taddOptionToList(selectBoxName,\"Palmyra Atoll\",\"Palmyra Atoll\");\n\taddOptionToList(selectBoxName,\"Panama\",\"Panama\");\n\taddOptionToList(selectBoxName,\"Papua New Guinea\",\"Papua New Guinea\");\n\taddOptionToList(selectBoxName,\"Paracel Islands\",\"Paracel Islands\");\n\taddOptionToList(selectBoxName,\"Paraguay\",\"Paraguay\");\n\taddOptionToList(selectBoxName,\"Peru\",\"Peru\");\n\taddOptionToList(selectBoxName,\"Philippines\",\"Philippines\");\n\taddOptionToList(selectBoxName,\"Pitcairn Islands\",\"Pitcairn Islands\");\n\taddOptionToList(selectBoxName,\"Poland\",\"Poland\");\n\taddOptionToList(selectBoxName,\"Portugal\",\"Portugal\");\n\taddOptionToList(selectBoxName,\"Puerto Rico\",\"Puerto Rico\");\n\taddOptionToList(selectBoxName,\"Qatar\",\"Qatar\");\n\taddOptionToList(selectBoxName,\"Republic of the Congo\",\"Republic of the Congo\");\n\taddOptionToList(selectBoxName,\"Reunion\",\"Reunion\");\n\taddOptionToList(selectBoxName,\"Romania\",\"Romania\");\n\taddOptionToList(selectBoxName,\"Ross Sea\",\"Ross Sea\");\n\taddOptionToList(selectBoxName,\"Russia\",\"Russia\");\n\taddOptionToList(selectBoxName,\"Rwanda\",\"Rwanda\");\n\taddOptionToList(selectBoxName,\"Saint Helena\",\"Saint Helena\");\n\taddOptionToList(selectBoxName,\"Saint Kitts and Nevis\",\"Saint Kitts and Nevis\");\n\taddOptionToList(selectBoxName,\"Saint Lucia\",\"Saint Lucia\");\n\taddOptionToList(selectBoxName,\"Saint Pierre and Miquelon\",\"Saint Pierre and Miquelon\");\n\taddOptionToList(selectBoxName,\"Saint Vincent and the Grenadines\",\"Saint Vincent and the Grenadines\");\n\taddOptionToList(selectBoxName,\"Samoa\",\"Samoa\");\n\taddOptionToList(selectBoxName,\"San Marino\",\"San Marino\");\n\taddOptionToList(selectBoxName,\"Sao Tome and Principe\",\"Sao Tome and Principe\");\n\taddOptionToList(selectBoxName,\"Saudi Arabia\",\"Saudi Arabia\");\n\taddOptionToList(selectBoxName,\"Senegal\",\"Senegal\");\n\taddOptionToList(selectBoxName,\"Serbia\",\"Serbia\");\n\taddOptionToList(selectBoxName,\"Seychelles\",\"Seychelles\");\n\taddOptionToList(selectBoxName,\"Sierra Leone\",\"Sierra Leone\");\n\taddOptionToList(selectBoxName,\"Singapore\",\"Singapore\");\n\taddOptionToList(selectBoxName,\"Sint Maarten\",\"Sint Maarten\");\n\taddOptionToList(selectBoxName,\"Slovakia\",\"Slovakia\");\n\taddOptionToList(selectBoxName,\"Slovenia\",\"Slovenia\");\n\taddOptionToList(selectBoxName,\"Solomon Islands\",\"Solomon Islands\");\n\taddOptionToList(selectBoxName,\"Somalia\",\"Somalia\");\n\taddOptionToList(selectBoxName,\"South Africa\",\"South Africa\");\n\taddOptionToList(selectBoxName,\"South Georgia and the South Sandwich Islands\",\"South Georgia and the South Sandwich Islands\");\n\taddOptionToList(selectBoxName,\"South Korea\",\"South Korea\");\n\taddOptionToList(selectBoxName,\"Southern Ocean\",\"Southern Ocean\");\n\taddOptionToList(selectBoxName,\"Spain\",\"Spain\");\n\taddOptionToList(selectBoxName,\"Spratly Islands\",\"Spratly Islands\");\n\taddOptionToList(selectBoxName,\"Sri Lanka\",\"Sri Lanka\");\n\taddOptionToList(selectBoxName,\"Sudan\",\"Sudan\");\n\taddOptionToList(selectBoxName,\"Suriname\",\"Suriname\");\n\taddOptionToList(selectBoxName,\"Svalbard\",\"Svalbard\");\n\taddOptionToList(selectBoxName,\"Swaziland\",\"Swaziland\");\n\taddOptionToList(selectBoxName,\"Sweden\",\"Sweden\");\n\taddOptionToList(selectBoxName,\"Switzerland\",\"Switzerland\");\n\taddOptionToList(selectBoxName,\"Syria\",\"Syria\");\n\taddOptionToList(selectBoxName,\"Taiwan\",\"Taiwan\");\n\taddOptionToList(selectBoxName,\"Tajikistan\",\"Tajikistan\");\n\taddOptionToList(selectBoxName,\"Tanzania\",\"Tanzania\");\n\taddOptionToList(selectBoxName,\"Tasman Sea\",\"Tasman Sea\");\n\taddOptionToList(selectBoxName,\"Thailand\",\"Thailand\");\n\taddOptionToList(selectBoxName,\"Togo\",\"Togo\");\n\taddOptionToList(selectBoxName,\"Tokelau\",\"Tokelau\");\n\taddOptionToList(selectBoxName,\"Tonga\",\"Tonga\");\n\taddOptionToList(selectBoxName,\"Trinidad and Tobago\",\"Trinidad and Tobago\");\n\taddOptionToList(selectBoxName,\"Tromelin Island\",\"Tromelin Island\");\n\taddOptionToList(selectBoxName,\"Tunisia\",\"Tunisia\");\n\taddOptionToList(selectBoxName,\"Turkey\",\"Turkey\");\n\taddOptionToList(selectBoxName,\"Turkmenistan\",\"Turkmenistan\");\n\taddOptionToList(selectBoxName,\"Turks and Caicos Islands\",\"Turks and Caicos Islands\");\n\taddOptionToList(selectBoxName,\"Tuvalu\",\"Tuvalu\");\n\taddOptionToList(selectBoxName,\"Uganda\",\"Uganda\");\n\taddOptionToList(selectBoxName,\"Ukraine\",\"Ukraine\");\n\taddOptionToList(selectBoxName,\"United Arab Emirates\",\"United Arab Emirates\");\n\taddOptionToList(selectBoxName,\"United Kingdom\",\"United Kingdom\");\n\taddOptionToList(selectBoxName,\"Uruguay\",\"Uruguay\");\n\taddOptionToList(selectBoxName,\"Uzbekistan\",\"Uzbekistan\");\n\taddOptionToList(selectBoxName,\"Vanuatu\",\"Vanuatu\");\n\taddOptionToList(selectBoxName,\"Venezuela\",\"Venezuela\");\n\taddOptionToList(selectBoxName,\"Viet Nam\",\"Viet Nam\");\n\taddOptionToList(selectBoxName,\"Virgin Islands\",\"Virgin Islands\");\n\taddOptionToList(selectBoxName,\"Wake Island\",\"Wake Island\");\n\taddOptionToList(selectBoxName,\"Wallis and Futuna\",\"Wallis and Futuna\");\n\taddOptionToList(selectBoxName,\"West Bank\",\"West Bank\");\n\taddOptionToList(selectBoxName,\"Western Sahara\",\"Western Sahara\");\n\taddOptionToList(selectBoxName,\"Yemen\",\"Yemen\");\n\taddOptionToList(selectBoxName,\"Zambia\",\"Zambia\");\n\taddOptionToList(selectBoxName,\"Zimbabwe\",\"Zimbabwe\");\n\tsetSelectedComboIndex(selectBoxName,1);\n}", "title": "" }, { "docid": "9ac17906b4ecfbe950e5bfe466082d30", "score": "0.63383317", "text": "function displayCountries(countries) {\n let countryList = document.querySelector(\".list\");\n let ul = document.createElement(\"ul\");\n ul.setAttribute('id', 'countryUnorderedList');\n for (let c of countries) {\n let li = document.createElement(\"li\");\n li.textContent = c.name;\n li.setAttribute('value', c.iso);\n // add event listener to invidividual list items\n li.addEventListener('click', (e) => {\n if (e.target && e.target.nodeName.toLowerCase() == \"li\") {\n displayCity(filterCitiesByCountry(e.target.getAttribute('value')));\n fetchPhotos('iso', e.target.getAttribute('value'));\n }\n });\n ul.appendChild(li);\n countryList.appendChild(ul);\n }\n }", "title": "" }, { "docid": "fcc58b805beb82cb556eda3d049e63b8", "score": "0.63040936", "text": "async function getCountriesInContenent(contenent) {\n if (!checkFirstFetch) await getData()\n let selectObj = document.querySelector('#countries-list-select')\n let htmlToAdd = '';\n switch (contenent) {\n case 'Americas':\n regions[4].countries.forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n case 'Europe':\n regions[1].countries.forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n case 'Africa':\n regions[2].countries.forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n case 'Asia':\n regions[0].countries.forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n case 'Oceania':\n regions[3].countries.forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n case 'World':\n regions[0].countries.concat(regions[1].countries).concat(regions[2].countries).concat(regions[3].countries).concat(regions[4].countries).forEach(element => {\n htmlToAdd += `<option value='${element.name}'>${element.name}</option>`\n })\n selectObj.innerHTML = htmlToAdd\n break;\n }\n}", "title": "" }, { "docid": "2703bb6817a5b5f6ee9fa03f960cd98d", "score": "0.62594795", "text": "function displayList() {\n const optionsHtml = Object.keys(countryArray).map((key, index) => {\n return `\n <option class=\"country-list center\" value=\"${key}\">${countryArray[key]}</option>`;\n });\n\n const dropdownHtml = `\n <label for=\"country-select\"></label>\n <select id=\"country-select\" class=\"center drop\" aria-label=\"Country List\">${optionsHtml.join(\"\")}</select>\n `;\n $(\"#country-list\").html(dropdownHtml);\n}", "title": "" }, { "docid": "ec7f9a9a1d78adbe264b506edfccaebf", "score": "0.6246176", "text": "function setCountryTags(list) {\n list.forEach((element) => {\n const optionTag = document.createElement('option')\n optionTag.value = element.country\n optionTag.textContent = element.country\n countryTag.append(optionTag)\n })\n\n // when user selects country input, it should generate a respective state dropdown menu\n countryTag.addEventListener('change', getSelectedCountry)\n}", "title": "" }, { "docid": "43168c5c96c7b0f4e61364f3912842a3", "score": "0.6236928", "text": "function updateCountrySelect() {\n let html = '';\n $.each(settingsObject, function (index, value) {\n let selected = ((defaultCountry == index) ? ' selected=\"selected\"' : '');\n html += '<option value=\"' + index + '\" ' + selected + '>' + value.name + '</option>';\n });\n\n $('select[name=\"country_code\"]').html(html);\n }", "title": "" }, { "docid": "51a6f4066be587ebfc5fa2628d6ab250", "score": "0.62256014", "text": "function htmlCountryList() {\n if (typeof covidData !== \"undefined\") {\n let htmlCountryString = `<datalist id=\"countryList\">`\n for (let i = 0; i < covidData.length; i++) {\n htmlCountryString += `<option value=\"${covidData[i][1].location}\"></option>`\n }\n htmlCountryString += `</datalist>`\n return htmlCountryString\n }\n }", "title": "" }, { "docid": "3dbafd58f6cb36b3d7e75e2785d161ff", "score": "0.6211799", "text": "function getCountries() {\n\t$.getJSON(\"getcountries.php\", function(data) {\n\tfor ( var i = 0; i < data.length; i++) {\n\t\tvar name = data[i].pay;\n\t\t$(\"#listcountries\").append(\"<li><a href='#' onClick='getState(\\\"\" + data[i].pay + \"\\\")'>\" + data[i].pay + \"</a></li>\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "cfca0dfd38a5570943c2a13efe61c57e", "score": "0.620723", "text": "function getCountries() {\n let countriesList = countries.length > 0\n && countries.map((item, i) => {\n return (\n <option key={i} value={item.value}>{item.label}</option>\n )\n }, this);\n\n setCountryType(countriesList);\n }", "title": "" }, { "docid": "7d5dbd38312c140b799ef42f5da7c1eb", "score": "0.6198352", "text": "function createCountryList(data) {\n\n // collect names of all countries\n countriesList = [];\n data[0].forEach(function(country) {\n countriesList.push(country[\"Country Name\"])\n });\n autocomplete(document.getElementById(\"myInput\"), countriesList);\n}", "title": "" }, { "docid": "2c04ba59e2ff8dceaee36c04b7c7abfc", "score": "0.61970764", "text": "function listCountries() {\n fetch('https://countriesnow.space/api/v0.1/countries/')\n .then(response => response.json())\n .then(res => {\n for (data of res.data) {\n countries.innerHTML += `<option>${data.country}</option>`;\n }\n })\n .catch(err => console.warn(err));\n \n // Event on change select country\n\n countries.addEventListener('change', e => {\n salatList.innerText = '';\n cities.innerHTML = '<option selected disabled>Choose...</option>';\n let crySelected = e.target.value;\n listCites(crySelected);\n });\n}", "title": "" }, { "docid": "e60c46ef5a84abf7bc8a87ce70099792", "score": "0.6186744", "text": "async function getCountryData(selectedCountry){\n\ttry{\n\t\tconst response = await fetch(`https://corona.lmao.ninja/v2/countries/${selectedCountry}`);\n\t\tconst data = await response.json();\n\t\toutput=`\n\t\t<tr>\n\t\t\t<td>${data.country}</td>\n\t\t\t<td class=\"special\">${data.cases}<span class=\"green\">${isZero(data.todayCases)}</span></td>\n\t\t\t<td class=\"special\">${data.deaths}<span class=\"green\">${isZero(data.todayDeaths)}</span></td>\t\t\n\t\t\t<td>${data.recovered}</td>\n\t\t\t<td>${data.active}</td>\n\t\t\t<td>${data.critical}</td>\n\t\t</tr>`;\n\t\ttableData.innerHTML = output;\n\t}catch(err){\n\t\talert('Oops ! Error occurred');\n\t}\n\n}", "title": "" }, { "docid": "b01b3e1d0cadb7b433a99b94f08ee034", "score": "0.6154546", "text": "function displayCovidVirusCountries(countries) {\n let countriesHtml = '';\n \n countries.map((one, index) => {\n countriesHtml += \n `\n <div id=\"${one['countryInfo']['_id']}\" class=\"country-container\" onclick=\"clickCountry('${one['countryInfo']['iso2']}')\">\n <div class=\"country-info-container\">\n <div class=\"country-name\">\n <span>${one['country']}</span>\n <span></span>\n </div>\n <div class=\"boundary\"></div>\n </div>\n <div class=\"country-flag-container\">\n <div class=\"country-flag\">\n <img src=\"${one['countryInfo']['flag']}\" width=\"20px\" height=\"20px\"></img>\n </div>\n </div>\n </div>\n `\n })\n\n document.querySelector(\".countries-list\").innerHTML = countriesHtml;\n}", "title": "" }, { "docid": "814f230cdaba6a5c6e12a4ce25fc424c", "score": "0.6153058", "text": "function loadCountries(countries) {\n document.querySelector(\"#country-list form\").innerHTML = \"\";\n\n for (let c of countries) {\n\n //Adds the countries into the li element\n const list = document.querySelector('#country-list form');\n const newListItems = document.createElement('li');\n const newLink = document.createElement('a');\n newListItems.appendChild(newLink);\n list.appendChild(newListItems);\n newLink.textContent = c.CountryName;\n\n //Sets attribute to <a href=''> link\n newLink.setAttribute(\"href\", \"../single-country.php?ISO=\" + c.ISO);\n\n //DO NOT REMOVE, COUNTRIES LIST WON'T WORK WITHOUT\n //newLink.setAttribute(\"id\", c.ISO);\n };\n}", "title": "" }, { "docid": "de954859a815893c80bb7950d8d28c4b", "score": "0.6146372", "text": "function showCountry(reply, app){ // showCountry references the createlist further below\n $('#DD01 .dropdown ul').empty()\n $.each(reply.qListObject.qDataPages[0].qMatrix, function(key, value) {\n if (typeof value[0].qText !== 'undefined') {\n $('#DD01 .dropdown ul').append('<li><a data-select=\"'+ value[0].qText+'\" href=\"#\">'+ value[0].qText+'</a></li>');\n }\n });\n\t }", "title": "" }, { "docid": "e997f42051664adc56d36bf21fb87fd2", "score": "0.61172897", "text": "function countryList(req,res){\n var obj = [];\n var query = 'SELECT name from country;' ;\n connection.query(query,(err,result)=>{\n obj.push({country:result.rows})\n res.json(obj); \n })\n}", "title": "" }, { "docid": "2981fc5363b91bb2798527d24b0dca7c", "score": "0.61105835", "text": "function updateCountryEnable(){\n $(\"#countryNameToActivate\").empty();\n $.ajax({ \n type: \"GET\", \n url: './PHP/updateCountry.php',\n data: {peticion:\"updateEnable\"}, \n success: function(data) { \n var countries = JSON.parse(data);\n $.each(countries, function(index, value){\n $(\"#countryNameToActivate\").append($(\"<option>\", {text : value.country\n })); \n }); \n }\n }); \n}", "title": "" }, { "docid": "a1aca52ed955d298a3508eaa6107b090", "score": "0.60818076", "text": "function getAllCountries() {\n return new Promise((resolve, reject) => {\n connection.query('SELECT * from country', function (err, results) {\n if (err) {\n reject(err);\n } else {\n resolve(results)\n }\n })\n })\n}", "title": "" }, { "docid": "f38b00baf1e5966a2964bf9ef6bd7ce1", "score": "0.6045188", "text": "function getProvinces() {\r\n let getUrl = window.location;\r\n let baseUrl = getUrl.protocol + \"//\" + getUrl.host;\r\n $.get(baseUrl + \"/api/towns/provinces\")\r\n .done(function (data) {\r\n if (data != null) {\r\n $('#state-select').append(new Option(\"Provincia:\", \"\", true, true));\r\n data.forEach(function (element) {\r\n $('#state-select').append(new Option(element));\r\n });\r\n console.log(\"Provinces: \"+JSON.stringify(data));\r\n }else{\r\n console.log(\"Error in database: not provinces found.\");\r\n }\r\n });\r\n }", "title": "" }, { "docid": "72704ae56d2b3d7d8e8ee2c623a1258b", "score": "0.6037224", "text": "function getListOfCountries(response) {\n let countries = []; //to store lisf of all countries\n for (let i in response) {\n countries.push(response[i][\"Country\"]);\n }\n countries.sort();\n\n //buld the dropdown menu\n let dropdown = document.getElementById('c-dropdown');\n let option;\n for (let i = 0; i < countries.length; i++) {\n option = document.createElement('option');\n option.text = countries[i];\n option.value = countries[i];\n dropdown.appendChild(option);\n }\n}", "title": "" }, { "docid": "f077b1a39a858301f6a9116c9231d049", "score": "0.6026377", "text": "function bindcountry() {\r\n $(\"#ddlCountry\").empty();\r\n $.ajax({\r\n url: vApiBaseSiteUrl +'/api/accounts/' + localStorage.AccountID + '/countrynames',\r\n type: 'GET',\r\n dataType: 'json',\r\n 'Content-Type': 'application/json',\r\n cache: false,\r\n async: false,\r\n headers: { 'eContracts-ApiKey': localStorage.APIKey },\r\n success: function (data) {\r\n var vControls = \"<option value='0'>--Select--</option>\";\r\n $(data).each(function (i, item) {\r\n var find = \" \";\r\n var re = new RegExp(find, 'g');\r\n var str = item.replace(re, '');\r\n vControls += '<option value=\"' + str + '\">' + str + '</option>';\r\n });\r\n $(\"#ddlCountry\").html(vControls);\r\n $(\"#ddlCountryadd\").html(vControls);\r\n vControls = '';\r\n },\r\n error:\r\n function (data) {\r\n $(\"#ddlCountry\").html(\"<option value='0'>--Select--</option>\");\r\n $(\"#ddlCountryadd\").html(\"<option value='0'>--Select--</option>\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "9d17272787071c348509469434b81885", "score": "0.6013977", "text": "async function extractCountries() {\n try {\n const res = await axios.get('https://covid-api.mmediagroup.fr/v1/cases')\n const countries = Object.keys(res.data)\n\n for (let country of countries) {\n const option = document.createElement('option');\n option.append(country);\n option.value = country;\n option.classList.add = \"option\"\n listOfCountries.appendChild(option);\n frame.src = `https://www.google.com/maps/embed/v1/place?key=${myKey}&q=Iran&zoom=3`\n }\n }\n catch {\n console.log('Error on extracting countries name')\n }\n}", "title": "" }, { "docid": "3d669581f58a9ecddb0a8c186b5d1514", "score": "0.6007519", "text": "function cities(){\r\n country = document.getElementById(\"country\")\r\n var pakistan = [\"Karachi\", \"Islamabad\", \"Lahore\", \"Rawalpindi\"]\r\n var india = [\"Mombai\", \"Delhi\", \"Kolkatta\" , \"Chennai\"]\r\n var bangladesh = [\"Dhaka\" , \"Chatogram\" , \"Khulna\", \"RajShahi\"]\r\n \r\n if(country.value === \"Pakistan\"){\r\n var city = document.getElementById(\"city\")\r\n city.innerHTML = \"\"\r\n for(var i=0; i<pakistan.length; i++){\r\n var node = document.createElement(\"OPTION\"); \r\n var textnode = document.createTextNode(pakistan[i]); \r\n node.appendChild(textnode); \r\n document.getElementById(\"city\").appendChild(node);\r\n } \r\n }\r\n\r\n else if(country.value === \"India\"){\r\n var city = document.getElementById(\"city\")\r\n city.innerHTML = \"\"\r\n for(var i=0; i<india.length; i++){\r\n var node = document.createElement(\"OPTION\"); \r\n var textnode = document.createTextNode(india[i]); \r\n node.appendChild(textnode); \r\n document.getElementById(\"city\").appendChild(node);\r\n } \r\n }\r\n\r\n else if(country.value === \"Bangladesh\"){\r\n var city = document.getElementById(\"city\")\r\n city.innerHTML = \"\"\r\n for(var i=0; i<bangladesh.length; i++){\r\n var node = document.createElement(\"OPTION\"); \r\n var textnode = document.createTextNode(bangladesh[i]); \r\n node.appendChild(textnode); \r\n document.getElementById(\"city\").appendChild(node);\r\n } \r\n }\r\n}", "title": "" }, { "docid": "540a97f98c88b6a2b008383015da9927", "score": "0.6007367", "text": "function displayCountries(countriesByContinent) {\r\n for (continent in countriesByContinent) {\r\n for (continentCountry in countriesByContinent[continent]) {\r\n // Strcuture of html element ---------> <img src=\"https://restcountries.eu/data/gha.svg\" alt=\"ghana-flag\" width=\"30\" height=\"18\"> <p class=\"flag-country\">Ghana</p>\r\n let div = document.createElement(\"div\");\r\n div.className = \"flag-text\";\r\n\r\n let img = document.createElement(\"img\");\r\n img.src = countriesByContinent[continent][continentCountry][\"flag\"];\r\n img.alt = countriesByContinent[continent][continentCountry][\"name\"]+\"-flag\";\r\n img.width = \"30px\";\r\n img.height = \"18px\";\r\n let p = document.createElement(\"p\");\r\n p.id = countriesByContinent[continent][continentCountry][\"name\"];\r\n p.className = \"flag-country\";\r\n p.setAttribute(\"data-modal-target\", \"#modal\")\r\n\r\n let text = document.createTextNode(countriesByContinent[continent][continentCountry][\"name\"])\r\n \r\n let favbtn = document.createElement(\"button\")\r\n favbtn.className = \"fav-btn\"\r\n p.appendChild(text);\r\n div.innerHTML += '<img src=\"'+img.src+'\" alt=\"'+img.alt+'\" width=\"30px\" height=\"auto\" />';\r\n div.appendChild(p);\r\n favbtn.innerHTML+= '<i class=\"fa fa-star fa-1g\" aria-hidden=\"true\"></i>'\r\n div.appendChild(favbtn);\r\n\r\n if (continent == \"Africa\") {\r\n //console.log(countriesByContinent[continent][continentCountry][\"flag\"]);\r\n let continentToAppend = document.getElementById(\"africa\");\r\n continentToAppend.appendChild(div);\r\n }\r\n if (continent == \"Americas\") {\r\n let continentToAppend = document.getElementById(\"america\");\r\n continentToAppend.appendChild(div);\r\n }\r\n if (continent == \"Asia\") {\r\n let continentToAppend = document.getElementById(\"asia\");\r\n continentToAppend.appendChild(div);\r\n }\r\n if (continent == \"Europe\") {\r\n let continentToAppend = document.getElementById(\"europa\");\r\n continentToAppend.appendChild(div);\r\n }\r\n if (continent == \"Oceania\") {\r\n let continentToAppend = document.getElementById(\"oceania\");\r\n continentToAppend.appendChild(div);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fd27414b04374c9136f33b58e1830869", "score": "0.5998804", "text": "function byncaInitializeIndexPageCountryName() {\r\n\tvar countryNameOptions = \"<option value=\\\"\\\">-- Country --</option>\"\r\n\t\t\t+ \"<option value=\\\"AF\\\">(AF) Afghanistan</option>\"\r\n\t\t\t+ \"<option value=\\\"AL\\\">(AL) Albania</option>\"\r\n\t\t\t+ \"<option value=\\\"DZ\\\">(DZ) Algeria</option>\"\r\n\t\t\t+ \"<option value=\\\"AS\\\">(AS) American Samoa</option>\"\r\n\t\t\t+ \"<option value=\\\"AD\\\">(AD) Andorra</option>\"\r\n\t\t\t+ \"<option value=\\\"AO\\\">(AO) Angola</option>\"\r\n\t\t\t+ \"<option value=\\\"AV\\\">(AV) Anguilla</option>\"\r\n\t\t\t+ \"<option value=\\\"AQ\\\">(AQ) Antarctica</option>\"\r\n\t\t\t+ \"<option value=\\\"AG\\\">(AG) Antigua and Barbuda</option>\"\r\n\t\t\t+ \"<option value=\\\"AR\\\">(AR) Argentina</option>\"\r\n\t\t\t+ \"<option value=\\\"AM\\\">(AM) Armenia</option>\"\r\n\t\t\t+ \"<option value=\\\"AA\\\">(AA) Aruba</option>\"\r\n\t\t\t+ \"<option value=\\\"AU\\\">(AU) Australia</option>\"\r\n\t\t\t+ \"<option value=\\\"AT\\\">(AT) Austria</option>\"\r\n\t\t\t+ \"<option value=\\\"AZ\\\">(AZ) Azerbaijan</option>\"\r\n\t\t\t+ \"<option value=\\\"BF\\\">(BF) Bahamas</option>\"\r\n\t\t\t+ \"<option value=\\\"BH\\\">(BH) Bahrain</option>\"\r\n\t\t\t+ \"<option value=\\\"BB\\\">(BB) Barbados</option>\"\r\n\t\t\t+ \"<option value=\\\"BD\\\">(BD) Bangladesh</option>\"\r\n\t\t\t+ \"<option value=\\\"BY\\\">(BY) Belarus</option>\"\r\n\t\t\t+ \"<option value=\\\"BE\\\">(BE) Belgium</option>\"\r\n\t\t\t+ \"<option value=\\\"BZ\\\">(BZ) Belize</option>\"\r\n\t\t\t+ \"<option value=\\\"BJ\\\">(BJ) Benin</option>\"\r\n\t\t\t+ \"<option value=\\\"BM\\\">(BM) Bermuda</option>\"\r\n\t\t\t+ \"<option value=\\\"BS\\\">(BS) Bahamas</option>\"\r\n\t\t\t+ \"<option value=\\\"BT\\\">(BT) Bhutan</option>\"\r\n\t\t\t+ \"<option value=\\\"BW\\\">(BW) Botswana</option>\"\r\n\t\t\t+ \"<option value=\\\"BO\\\">(BO) Bolivia</option>\"\r\n\t\t\t+ \"<option value=\\\"BA\\\">(BA) Bosnia and Herzegovina</option>\"\r\n\t\t\t+ \"<option value=\\\"BV\\\">(BV) Bouvet Island</option>\"\r\n\t\t\t+ \"<option value=\\\"BR\\\">(BR) Brazil</option>\"\r\n\t\t\t+ \"<option value=\\\"IO\\\">(IO) British Indian Ocean Territory</option>\"\r\n\t\t\t+ \"<option value=\\\"BN\\\">(BN) Brunei Darussalam</option>\"\r\n\t\t\t+ \"<option value=\\\"BG\\\">(BG) Bulgaria</option>\"\r\n\t\t\t+ \"<option value=\\\"BF\\\">(BF) Burkina Faso</option>\"\r\n\t\t\t+ \"<option value=\\\"BI\\\">(BI) Burundi</option>\"\r\n\t\t\t+ \"<option value=\\\"KH\\\">(KH) Cambodia (Internet)</option>\"\r\n\t\t\t+ \"<option value=\\\"CB\\\">(CB) Cambodia (CIA World Fact Book)</option>\"\r\n\t\t\t+ \"<option value=\\\"CM\\\">(CM) Cameroon</option>\"\r\n\t\t\t+ \"<option value=\\\"CA\\\">(CA) Canada</option>\"\r\n\t\t\t+ \"<option value=\\\"CV\\\">(CV) Cape Verde</option>\"\r\n\t\t\t+ \"<option value=\\\"KY\\\">(KY) Cayman Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"CF\\\">(CF) Central African Republic</option>\"\r\n\t\t\t+ \"<option value=\\\"TD\\\">(TD) Chad</option>\"\r\n\t\t\t+ \"<option value=\\\"CL\\\">(CL) Chile</option>\"\r\n\t\t\t+ \"<option value=\\\"CN\\\">(CN) China</option>\"\r\n\t\t\t+ \"<option value=\\\"CX\\\">(CX) Christmas Island</option>\"\r\n\t\t\t+ \"<option value=\\\"CC\\\">(CC) Cocos (Keeling) Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"CO\\\">(CO) Colombia</option>\"\r\n\t\t\t+ \"<option value=\\\"KM\\\">(KM) Comoros</option>\"\r\n\t\t\t+ \"<option value=\\\"CG\\\">(CG) Congo</option>\"\r\n\t\t\t+ \"<option value=\\\"CD\\\">(CD) Congo, Democratic Republic</option>\"\r\n\t\t\t+ \"<option value=\\\"CK\\\">(CK) Cook Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"CR\\\">(CR) Costa Rica</option>\"\r\n\t\t\t+ \"<option value=\\\"CI\\\">(CI) Cote D'Ivoire (Ivory Coast)</option>\"\r\n\t\t\t+ \"<option value=\\\"HR\\\">(HR) Croatia (Hrvatska)</option>\"\r\n\t\t\t+ \"<option value=\\\"CU\\\">(CU) Cuba</option>\"\r\n\t\t\t+ \"<option value=\\\"CY\\\">(CY) Cyprus</option>\"\r\n\t\t\t+ \"<option value=\\\"CZ\\\">(CZ) Czech Republic</option>\"\r\n\t\t\t+ \"<option value=\\\"CS\\\">(CS) Czechoslovakia (former)</option>\"\r\n\t\t\t+ \"<option value=\\\"DK\\\">(DK) Denmark</option>\"\r\n\t\t\t+ \"<option value=\\\"DJ\\\">(DJ) Djibouti</option>\"\r\n\t\t\t+ \"<option value=\\\"DM\\\">(DM) Dominica</option>\"\r\n\t\t\t+ \"<option value=\\\"DO\\\">(DO) Dominican Republic</option>\"\r\n\t\t\t+ \"<option value=\\\"TP\\\">(TP) East Timor</option>\"\r\n\t\t\t+ \"<option value=\\\"EC\\\">(EC) Ecuador</option>\"\r\n\t\t\t+ \"<option value=\\\"EG\\\">(EG) Egypt</option>\"\r\n\t\t\t+ \"<option value=\\\"SV\\\">(SV) El Salvador</option>\"\r\n\t\t\t+ \"<option value=\\\"GQ\\\">(GQ) Equatorial Guinea</option>\"\r\n\t\t\t+ \"<option value=\\\"ER\\\">(ER) Eritrea</option>\"\r\n\t\t\t+ \"<option value=\\\"EE\\\">(EE) Estonia</option>\"\r\n\t\t\t+ \"<option value=\\\"ET\\\">(ET) Ethiopia</option>\"\r\n\t\t\t+ \"<option value=\\\"FK\\\">(FK) Falkland Islands (Malvinas)</option>\"\r\n\t\t\t+ \"<option value=\\\"FO\\\">(FO) Faroe Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"FJ\\\">(FJ) Fiji</option>\"\r\n\t\t\t+ \"<option value=\\\"FI\\\">(FI) Finland</option>\"\r\n\t\t\t+ \"<option value=\\\"FR\\\">(FR) France</option>\"\r\n\t\t\t+ \"<option value=\\\"FX\\\">(FX) France, Metropolitan</option>\"\r\n\t\t\t+ \"<option value=\\\"GF\\\">(GF) French Guiana</option>\"\r\n\t\t\t+ \"<option value=\\\"PF\\\">(PF) French Polynesia</option>\"\r\n\t\t\t+ \"<option value=\\\"TF\\\">(TF) French Southern Territories</option>\"\r\n\t\t\t+ \"<option value=\\\"MK\\\">(MK) F.Y.R.O.M. (Macedonia)</option>\"\r\n\t\t\t+ \"<option value=\\\"GA\\\">(GA) Gabon</option>\"\r\n\t\t\t+ \"<option value=\\\"GM\\\">(GM) Gambia</option>\"\r\n\t\t\t+ \"<option value=\\\"GE\\\">(GE) Georgia</option>\"\r\n\t\t\t+ \"<option value=\\\"DE\\\">(DE) Germany</option>\"\r\n\t\t\t+ \"<option value=\\\"GH\\\">(GH) Ghana</option>\"\r\n\t\t\t+ \"<option value=\\\"GI\\\">(GI) Gibraltar</option>\"\r\n\t\t\t+ \"<option value=\\\"GB\\\">(GB) Great Britain (UK)</option>\"\r\n\t\t\t+ \"<option value=\\\"GR\\\">(GR) Greece</option>\"\r\n\t\t\t+ \"<option value=\\\"GL\\\">(GL) Greenland</option>\"\r\n\t\t\t+ \"<option value=\\\"GD\\\">(GD) Grenada</option>\"\r\n\t\t\t+ \"<option value=\\\"GP\\\">(GP) Guadeloupe</option>\"\r\n\t\t\t+ \"<option value=\\\"GU\\\">(GU) Guam</option>\"\r\n\t\t\t+ \"<option value=\\\"GT\\\">(GT) Guatemala</option>\"\r\n\t\t\t+ \"<option value=\\\"GN\\\">(GN) Guinea</option>\"\r\n\t\t\t+ \"<option value=\\\"GW\\\">(GW) Guinea-Bissau</option>\"\r\n\t\t\t+ \"<option value=\\\"GY\\\">(GY) Guyana</option>\"\r\n\t\t\t+ \"<option value=\\\"HT\\\">(HT) Haiti</option>\"\r\n\t\t\t+ \"<option value=\\\"HM\\\">(HM) Heard and McDonald Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"HN\\\">(HN) Honduras</option>\"\r\n\t\t\t+ \"<option value=\\\"HK\\\">(HK) Hong Kong</option>\"\r\n\t\t\t+ \"<option value=\\\"HU\\\">(HU) Hungary</option>\"\r\n\t\t\t+ \"<option value=\\\"IS\\\">(IS) Iceland</option>\"\r\n\t\t\t+ \"<option value=\\\"IN\\\">(IN) India</option>\"\r\n\t\t\t+ \"<option value=\\\"ID\\\">(ID) Indonesia</option>\"\r\n\t\t\t+ \"<option value=\\\"IR\\\">(IR) Iran</option>\"\r\n\t\t\t+ \"<option value=\\\"IQ\\\">(IQ) Iraq</option>\"\r\n\t\t\t+ \"<option value=\\\"IE\\\">(IE) Ireland</option>\"\r\n\t\t\t+ \"<option value=\\\"IL\\\">(IL) Israel</option>\"\r\n\t\t\t+ \"<option value=\\\"IT\\\">(IT) Italy</option>\"\r\n\t\t\t+ \"<option value=\\\"JM\\\">(JM) Jamaica</option>\"\r\n\t\t\t+ \"<option value=\\\"JP\\\">(JP) Japan</option>\"\r\n\t\t\t+ \"<option value=\\\"JO\\\">(JO) Jordan</option>\"\r\n\t\t\t+ \"<option value=\\\"KZ\\\">(KZ) Kazakhstan</option>\"\r\n\t\t\t+ \"<option value=\\\"KE\\\">(KE) Kenya</option>\"\r\n\t\t\t+ \"<option value=\\\"KI\\\">(KI) Kiribati</option>\"\r\n\t\t\t+ \"<option value=\\\"KP\\\">(KP) Korea (North)</option>\"\r\n\t\t\t+ \"<option value=\\\"KR\\\">(KR) Korea (South)</option>\"\r\n\t\t\t+ \"<option value=\\\"KW\\\">(KW) Kuwait</option>\"\r\n\t\t\t+ \"<option value=\\\"KG\\\">(KG) Kyrgyzstan</option>\"\r\n\t\t\t+ \"<option value=\\\"LA\\\">(LA) Laos</option>\"\r\n\t\t\t+ \"<option value=\\\"LV\\\">(LV) Latvia</option>\"\r\n\t\t\t+ \"<option value=\\\"LB\\\">(LB) Lebanon</option>\"\r\n\t\t\t+ \"<option value=\\\"LI\\\">(LI) Liechtenstein</option>\"\r\n\t\t\t+ \"<option value=\\\"LR\\\">(LR) Liberia</option>\"\r\n\t\t\t+ \"<option value=\\\"LY\\\">(LY) Libya</option>\"\r\n\t\t\t+ \"<option value=\\\"LS\\\">(LS) Lesotho</option>\"\r\n\t\t\t+ \"<option value=\\\"LT\\\">(LT) Lithuania</option>\"\r\n\t\t\t+ \"<option value=\\\"LU\\\">(LU) Luxembourg</option>\"\r\n\t\t\t+ \"<option value=\\\"MO\\\">(MO) Macau</option>\"\r\n\t\t\t+ \"<option value=\\\"MG\\\">(MG) Madagascar</option>\"\r\n\t\t\t+ \"<option value=\\\"MW\\\">(MW) Malawi</option>\"\r\n\t\t\t+ \"<option value=\\\"MY\\\">(MY) Malaysia</option>\"\r\n\t\t\t+ \"<option value=\\\"MV\\\">(MV) Maldives</option>\"\r\n\t\t\t+ \"<option value=\\\"ML\\\">(ML) Mali</option>\"\r\n\t\t\t+ \"<option value=\\\"MT\\\">(MT) Malta</option>\"\r\n\t\t\t+ \"<option value=\\\"MH\\\">(MH) Marshall Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"MQ\\\">(MQ) Martinique</option>\"\r\n\t\t\t+ \"<option value=\\\"MR\\\">(MR) Mauritania</option>\"\r\n\t\t\t+ \"<option value=\\\"MU\\\">(MU) Mauritius</option>\"\r\n\t\t\t+ \"<option value=\\\"YT\\\">(YT) Mayotte</option>\"\r\n\t\t\t+ \"<option value=\\\"MX\\\">(MX) Mexico</option>\"\r\n\t\t\t+ \"<option value=\\\"FM\\\">(FM) Micronesia</option>\"\r\n\t\t\t+ \"<option value=\\\"MC\\\">(MC) Monaco</option>\"\r\n\t\t\t+ \"<option value=\\\"MD\\\">(MD) Moldova</option>\"\r\n\t\t\t+ \"<option value=\\\"MA\\\">(MA) Morocco</option>\"\r\n\t\t\t+ \"<option value=\\\"MN\\\">(MN) Mongolia</option>\"\r\n\t\t\t+ \"<option value=\\\"MS\\\">(MS) Montserrat</option>\"\r\n\t\t\t+ \"<option value=\\\"MZ\\\">(MZ) Mozambique</option>\"\r\n\t\t\t+ \"<option value=\\\"MM\\\">(MM) Myanmar</option>\"\r\n\t\t\t+ \"<option value=\\\"NA\\\">(NA) Namibia</option>\"\r\n\t\t\t+ \"<option value=\\\"NR\\\">(NR) Nauru</option>\"\r\n\t\t\t+ \"<option value=\\\"NP\\\">(NP) Nepal</option>\"\r\n\t\t\t+ \"<option value=\\\"NL\\\">(NL) Netherlands</option>\"\r\n\t\t\t+ \"<option value=\\\"AN\\\">(AN) Netherlands Antilles</option>\"\r\n\t\t\t+ \"<option value=\\\"NT\\\">(NT) Neutral Zone</option>\"\r\n\t\t\t+ \"<option value=\\\"NC\\\">(NC) New Caledonia</option>\"\r\n\t\t\t+ \"<option value=\\\"NZ\\\">(NZ) New Zealand (Aotearoa)</option>\"\r\n\t\t\t+ \"<option value=\\\"NI\\\">(NI) Nicaragua</option>\"\r\n\t\t\t+ \"<option value=\\\"NE\\\">(NE) Niger</option>\"\r\n\t\t\t+ \"<option value=\\\"NG\\\">(NG) Nigeria</option>\"\r\n\t\t\t+ \"<option value=\\\"NU\\\">(NU) Niue</option>\"\r\n\t\t\t+ \"<option value=\\\"NF\\\">(NF) Norfolk Island</option>\"\r\n\t\t\t+ \"<option value=\\\"MP\\\">(MP) Northern Mariana Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"NO\\\">(NO) Norway</option>\"\r\n\t\t\t+ \"<option value=\\\"OM\\\">(OM) Oman</option>\"\r\n\t\t\t+ \"<option value=\\\"PK\\\">(PK) Pakistan</option>\"\r\n\t\t\t+ \"<option value=\\\"PW\\\">(PW) Palau</option>\"\r\n\t\t\t+ \"<option value=\\\"PA\\\">(PA) Panama</option>\"\r\n\t\t\t+ \"<option value=\\\"PG\\\">(PG) Papua New Guinea</option>\"\r\n\t\t\t+ \"<option value=\\\"PY\\\">(PY) Paraguay</option>\"\r\n\t\t\t+ \"<option value=\\\"PE\\\">(PE) Peru</option>\"\r\n\t\t\t+ \"<option value=\\\"PH\\\">(PH) Philippines</option>\"\r\n\t\t\t+ \"<option value=\\\"PN\\\">(PN) Pitcairn</option>\"\r\n\t\t\t+ \"<option value=\\\"PL\\\">(PL) Poland</option>\"\r\n\t\t\t+ \"<option value=\\\"PT\\\">(PT) Portugal</option>\"\r\n\t\t\t+ \"<option value=\\\"PR\\\">(PR) Puerto Rico</option>\"\r\n\t\t\t+ \"<option value=\\\"QA\\\">(QA) Qatar</option>\"\r\n\t\t\t+ \"<option value=\\\"RE\\\">(RE) Reunion</option>\"\r\n\t\t\t+ \"<option value=\\\"RO\\\">(RO) Romania</option>\"\r\n\t\t\t+ \"<option value=\\\"RU\\\">(RU) Russian Federation</option>\"\r\n\t\t\t+ \"<option value=\\\"RW\\\">(RW) Rwanda</option>\"\r\n\t\t\t+ \"<option value=\\\"GS\\\">(GS) S. Georgia and S. Sandwich Isls.</option>\"\r\n\t\t\t+ \"<option value=\\\"KN\\\">(KN) Saint Kitts and Nevis</option>\"\r\n\t\t\t+ \"<option value=\\\"LC\\\">(LC) Saint Lucia</option>\"\r\n\t\t\t+ \"<option value=\\\"VC\\\">(VC) Saint Vincent and the Grenadines</option>\"\r\n\t\t\t+ \"<option value=\\\"WS\\\">(WS) Samoa</option>\"\r\n\t\t\t+ \"<option value=\\\"SM\\\">(SM) San Marino</option>\"\r\n\t\t\t+ \"<option value=\\\"ST\\\">(ST) Sao Tome and Principe</option>\"\r\n\t\t\t+ \"<option value=\\\"SA\\\">(SA) Saudi Arabia</option>\"\r\n\t\t\t+ \"<option value=\\\"SN\\\">(SN) Senegal</option>\"\r\n\t\t\t+ \"<option value=\\\"SC\\\">(SC) Seychelles</option>\"\r\n\t\t\t+ \"<option value=\\\"SL\\\">(SL) Sierra Leone</option>\"\r\n\t\t\t+ \"<option value=\\\"SG\\\">(SG) Singapore</option>\"\r\n\t\t\t+ \"<option value=\\\"SI\\\">(SI) Slovenia</option>\"\r\n\t\t\t+ \"<option value=\\\"SK\\\">(SK) Slovak Republic</option>\"\r\n\t\t\t+ \"<option value=\\\"Sb\\\">(Sb) Solomon Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"SO\\\">(SO) Somalia</option>\"\r\n\t\t\t+ \"<option value=\\\"ZA\\\">(ZA) South Africa</option>\"\r\n\t\t\t+ \"<option value=\\\"ES\\\">(ES) Spain</option>\"\r\n\t\t\t+ \"<option value=\\\"LK\\\">(LK) Sri Lanka</option>\"\r\n\t\t\t+ \"<option value=\\\"SH\\\">(SH) St. Helena</option>\"\r\n\t\t\t+ \"<option value=\\\"PM\\\">(PM) St. Pierre and Miquelon</option>\"\r\n\t\t\t+ \"<option value=\\\"SD\\\">(SD) Sudan</option>\"\r\n\t\t\t+ \"<option value=\\\"SR\\\">(SR) Suriname</option>\"\r\n\t\t\t+ \"<option value=\\\"SJ\\\">(SJ) Svalbard and Jan Mayen Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"SZ\\\">(SZ) Swaziland</option>\"\r\n\t\t\t+ \"<option value=\\\"SE\\\">(SE) Sweden</option>\"\r\n\t\t\t+ \"<option value=\\\"CH\\\">(CH) Switzerland</option>\"\r\n\t\t\t+ \"<option value=\\\"SY\\\">(SY) Syria</option>\"\r\n\t\t\t+ \"<option value=\\\"TW\\\">(TW) Taiwan</option>\"\r\n\t\t\t+ \"<option value=\\\"TJ\\\">(TJ) Tajikistan</option>\"\r\n\t\t\t+ \"<option value=\\\"TZ\\\">(TZ) Tanzania</option>\"\r\n\t\t\t+ \"<option value=\\\"TH\\\">(TH) Thailand</option>\"\r\n\t\t\t+ \"<option value=\\\"TG\\\">(TG) Togo</option>\"\r\n\t\t\t+ \"<option value=\\\"TK\\\">(TK) Tokelau</option>\"\r\n\t\t\t+ \"<option value=\\\"TO\\\">(TO) Tonga</option>\"\r\n\t\t\t+ \"<option value=\\\"TT\\\">(TT) Trinidad and Tobago</option>\"\r\n\t\t\t+ \"<option value=\\\"TN\\\">(TN) Tunisia</option>\"\r\n\t\t\t+ \"<option value=\\\"TR\\\">(TR) Turkey</option>\"\r\n\t\t\t+ \"<option value=\\\"TM\\\">(TM) Turkmenistan</option>\"\r\n\t\t\t+ \"<option value=\\\"TC\\\">(TC) Turks and Caicos Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"TV\\\">(TV) Tuvalu</option>\"\r\n\t\t\t+ \"<option value=\\\"UG\\\">(UG) Uganda</option>\"\r\n\t\t\t+ \"<option value=\\\"UA\\\">(UA) Ukraine</option>\"\r\n\t\t\t+ \"<option value=\\\"AE\\\">(AE) United Arab Emirates</option>\"\r\n\t\t\t+ \"<option value=\\\"UK\\\">(UK) United Kingdom</option>\"\r\n\t\t\t+ \"<option value=\\\"US\\\">(US) United States</option>\"\r\n\t\t\t+ \"<option value=\\\"UM\\\">(UM) US Minor Outlying Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"UY\\\">(UY) Uruguay</option>\"\r\n\t\t\t+ \"<option value=\\\"SU\\\">(SU) USSR (former)</option>\"\r\n\t\t\t+ \"<option value=\\\"UZ\\\">(UZ) Uzbekistan</option>\"\r\n\t\t\t+ \"<option value=\\\"VU\\\">(VU) Vanuatu</option>\"\r\n\t\t\t+ \"<option value=\\\"VA\\\">(VA) Vatican City State (Holy See)</option>\"\r\n\t\t\t+ \"<option value=\\\"VE\\\">(VE) Venezuela</option>\"\r\n\t\t\t+ \"<option value=\\\"VN\\\">(VN) Viet Nam</option>\"\r\n\t\t\t+ \"<option value=\\\"VG\\\">(VG) Virgin Islands (British)</option>\"\r\n\t\t\t+ \"<option value=\\\"VI\\\">(VI) Virgin Islands (U.S.)</option>\"\r\n\t\t\t+ \"<option value=\\\"WF\\\">(WF) Wallis and Futuna Islands</option>\"\r\n\t\t\t+ \"<option value=\\\"EH\\\">(EH) Western Sahara</option>\"\r\n\t\t\t+ \"<option value=\\\"YE\\\">(YE) Yemen</option>\"\r\n\t\t\t+ \"<option value=\\\"YU\\\">(YU) Yugoslavia</option>\"\r\n\t\t\t+ \"<option value=\\\"ZM\\\">(ZM) Zambia</option>\"\r\n\t\t\t+ \"<option value=\\\"ZR\\\">(ZR) Zaire</option>\"\r\n\t\t\t+ \"<option value=\\\"ZW\\\">(ZW) Zimbabwe</option>\";\r\n\t$(\"#countryName\").html(countryNameOptions);\r\n}", "title": "" }, { "docid": "1bb0a950a75d37d375afeec8e5426645", "score": "0.5984674", "text": "function displayCountryData(select) {\n\t//calculate flag path and file name replace all spacees with underscore\n\tvar flags = \"flags/\" + countries[select.value].Name.replace(/\\ /g, \"_\") + \".png\";\n\t// get page element to display flag\n\tvar flag = document.getElementById('flag');\n\t//display flag\n\tflag.innerHTML = `<img src= ${flags} +>`;\n\t//: <b>' + ele.options[ele.selectedIndex].text + '</b> </br>' +\n\t// 'ID: <b>' + ele.value + '</b>';\n\tDisplayPopulationData();\n\tdisplayCountryAreea();\n\tdisplayCountryDensity();\n\tdisplayCountryName(select);\n}", "title": "" }, { "docid": "d2e71421010e6afcf07c8108b0f8d4f8", "score": "0.59817487", "text": "function populateUFs() {\n fetch(\"https://servicodados.ibge.gov.br/api/v1/localidades/estados\")\n .then(res => res.json())\n .then (states => {\n for(const state of states){\n // Armazena as opções de estados no array_estados\n array_estados.push(`<option value=\"${state.id}\">${state.nome}</option>`);\n }\n this.ordenarEstados()\n });\n }", "title": "" }, { "docid": "f176e2c7f95c7ab1c8fc4583b2841543", "score": "0.59653443", "text": "function save_countries() {\n\t\t\tvar countries = JSON.stringify( available_countries );\n\t\t\tvar data = {\n\t\t\t\taction\t\t\t\t\t: 'WooZoneLite_frontend',\n\t\t\t\tsub_action\t\t\t: 'save_countries',\n\t\t\t\tproduct_id\t\t\t\t: product_data['id'],\n\t\t\t\tproduct_country\t: current_country['country'],\n\t\t\t\tcountries\t\t\t\t: countries\n\t\t\t};\n\t\t\tif (DEBUG) console.log( data );\n\t\t\t\n\t\t\tloading( 'show', lang.saving );\n\t\t\t$.post(ajaxurl, data, function(response) {\n\n\t\t\t\tif ( misc.hasOwnProperty(response, 'status') ) {}\n\t\t\t\tloading( 'close' );\n\t\t\t}, 'json')\n\t\t\t.fail(function() {})\n\t\t\t.done(function() {})\n\t\t\t.always(function() {});\n\t\t}", "title": "" }, { "docid": "0cbcbc7997c04315f63769846aa3f964", "score": "0.59580207", "text": "function WriteCountrySelectionBar() {\n document.write('<select name=\"country\" size=\"1\">');\n document.write('<option value=\"??\">&nbsp;</option>');\n var tab = CountryIndexTable();\n for (var i = 0; i < tab.length; ++i) {\n var country = iban_data[tab[i]];\n document.write('<option value=\"' + country.code + '\">' +\n country.name + ' (' + country.code + ')</option>');\n }\n document.write('</select>');\n}", "title": "" }, { "docid": "549583b9d51f35abce962c8b28383e4c", "score": "0.594743", "text": "countries() {\n return requests.get(`all`)\n }", "title": "" }, { "docid": "6c3c22f54ed7901be58601309e985c3d", "score": "0.592928", "text": "function ajaxCountries(){\n\n $.ajax({\n cache: false,\n async: true,\n type: 'GET',\n url: 'https://restcountries.eu/rest/v1/all',\n success: handleData,\n error: errorHandle\n });\n }", "title": "" }, { "docid": "b536472838bf51dd5cd35fbce37190c7", "score": "0.5925956", "text": "function country() {\n app.getView().render('geoip/country');\n}", "title": "" }, { "docid": "caca9a289a2ae90f996503cdcecc22e0", "score": "0.5921539", "text": "function loadCountries() {\n\t\n\tconsole.log(\"loading countries-\"+ lang + \".json\");\n\t\n\t$.getJSON(\"countries-\"+ lang + \".json\", function(json) {\n countrylist = json;\n console.log(countrylist);\n\t});\n\t\n}", "title": "" }, { "docid": "d23d45bd49ceb12023d44049e5fef76d", "score": "0.591487", "text": "function getCountries(){\n console.log(\"getting countries\");\n let url = PREFIX + \"api.airvisual.com/v2/countries?key=\" + API_KEY;\n \n $.ajax({\n dataType: \"json\", \n url: url,\n data: null,\n success: jsonCountries,\n error: noData\n });\n }", "title": "" }, { "docid": "f609f5a7f48c086ea232c91964c9a5f5", "score": "0.5911841", "text": "getAllCountries(db){\n return db\n .distinct()\n .from('data')\n .pluck('country');\n }", "title": "" }, { "docid": "aac5a4c78396da58fdb5eb1bf63af361", "score": "0.5899042", "text": "function populateUFs (){\n const ufSelect = document.querySelector('select[name = uf')\n \n const urlStates = 'https://servicodados.ibge.gov.br/api/v1/localidades/estados' \n\n fetch(urlStates)\n .then( (res) => { return res.json()})\n .then( states => {\n for(state of states){\n ufSelect.innerHTML += ` <option value=\"${state.id}\">${state.nome}</option>`\n }\n })\n}", "title": "" }, { "docid": "c0f79138fd4c6af2e7b0a4a698b03a1e", "score": "0.5893283", "text": "function loadAll() {\n AirportCodes(function(allStates) {\n return allStates.map(function(state) {\n $scope.states.push({\n value: state.iata.toLowerCase(),\n display: state.name\n });\n });\n });\n\n }", "title": "" }, { "docid": "b922232f1866514dc8ad2c2bd1488cb0", "score": "0.58827585", "text": "function getCountryDetails(country) {\n var getCountryUrl = fetch('https://restcountries.eu/rest/v2/name/' + country + '?fullText=true');\n getCountryUrl.then(response => {\n return response.json();\n }).then(details => {\n // Insert the HTML code, that are been called from the API\n countryDetails.innerHTML = tableHTML(details);\n });\n}", "title": "" }, { "docid": "616f6a0a9beaad21665e95e71c3c5bcc", "score": "0.586656", "text": "async function getAllCountries() {\n try {\n const allCountriesURL = `https://api.airvisual.com/v2/countries?key=${API_KEY}`\n const response = await axios.get(allCountriesURL)\n const countriesList = response.data.data\n\n setCountryTags(countriesList)\n }\n catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "663f99ccf8b8b5def549db85c3880520", "score": "0.5857686", "text": "function fill_supported_languages() \n{\n var obj = supported_language;\n var select = document.getElementById(\"language\");\n\n for (var i=0; i < obj.lang.length; i++)\n {\n var option = document.createElement(\"option\");\n option.id = obj.lang[i].code;\n option.value = obj.lang[i].code;\n option.innerHTML = obj.lang[i].language;\n select.appendChild(option);\n }\n}", "title": "" }, { "docid": "5a0385b5621db6d2a70734323e3dd0dd", "score": "0.585182", "text": "async function getCountriesCases() {\n setCountries([]);\n\n let url = 'https://coronavirus-19-api.herokuapp.com/countries';\n\n await fetch(url)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n setCountries(data)\n })\n .catch(function (error) {\n console.error(\"Erro ao carregar os dados: \" + error.message);\n })\n }", "title": "" }, { "docid": "28b4c6c56139c97821fcb736542bc011", "score": "0.58427566", "text": "function cargarCiudades(){\n $.ajax({\n url:'http://localhost:3000/ciudades',\n type:'GET',\n data:{},\n success: function (data){\n var $ciudades = $(\"#ciudad\");\n $.each(data, (i,ciudad)=>{\n $ciudades.append(`<option value=\"${ciudad}\">${ciudad}</option>`);\n })\n }\n });\n}", "title": "" }, { "docid": "72e12816eae500c7086542f6718addc8", "score": "0.5839315", "text": "function getCountry() {\r\n\tvar select = document.querySelectorAll('option');//get all select options list\r\n\tselect.forEach(select => select.removeAttribute('selected'));//reset select option attribute\r\n\r\n\tfetch(\"https://covid-193.p.rapidapi.com/countries\", {\r\n\t\t\"method\": \"GET\",\r\n\t\t\"headers\": {\r\n\t\t\t\"x-rapidapi-key\": \"490f3f1eacmsha9f808019c36460p132d4bjsneaf41f4d1b47\",\r\n\t\t\t\"x-rapidapi-host\": \"covid-193.p.rapidapi.com\"\r\n\t\t}\r\n\t})\r\n\t\t.then(response => response.json())\r\n\t\t.then(response => {\r\n\r\n\t\t\tvar i = response.response.indexOf(countryName[index].name);//check index from API\r\n\t\t\tif (i !== -1) {//if data is available from API\r\n\t\t\t\t//set select option to selected country\r\n\t\t\t\tselect[i].setAttribute('selected', 'selected');\r\n\t\t\t\tshowSearchResult();\r\n\t\t\t}\r\n\t\t\telse {//if data is not available from API\r\n\t\t\t\tisData = false;\r\n\t\t\t\t//set all statistics to 'no data'\r\n\t\t\t\tlet blanks = \"\"\r\n\t\t\t\tblanks += `\r\n <div class=\"card\" style=\"width: max-content;\">\r\n <div class=\"card-body\">\r\n <h6 class=\"card-subtitle text-muted\"></h6>\r\n <p class=\"card-text\"><b>Active Cases : </b>no data</p>\r\n <p class=\"card-text\"><b>New Cases : </b>no data</p>\r\n <p class=\"card-text\"><b>Critical Cases : </b>no data</p>\r\n <p class=\"card-text\"><b>Recovered Cases : </b>no data</p>\r\n <p class=\"card-text\"><b>Total Infected : </b>no data</p>\r\n <p class=\"card-text\"><b>New Death : </b>no data</p>\r\n <p class=\"card-text\"><b>Total Death : </b>no data</p>\r\n\t\t\t <p class=\"card-text\"><b>Information retrieved on : </b>no data</p>\r\n </div>\r\n </div>\r\n \r\n\t\t\t`;\r\n\t\t\t\tcontent.innerHTML = blanks;\r\n\t\t\t\tshowCountry();\r\n\t\t\t}\r\n\r\n\t\t})\r\n\t\t.catch(err => {\r\n\t\t\tconsole.error(err);\r\n\t\t});\r\n}", "title": "" }, { "docid": "92c631bd2cbd7b426740110582d3511e", "score": "0.5830836", "text": "function getCountry() {\n\t$.ajax({\n\t\turl: 'https://restcountries.eu/rest/v2/all?fields=name;callingCodes;flag',\n\t\ttype: 'GET',\n\t\tsuccess: function(data) {\n\t\t\tvar countryData = '';\n\t\t\t$.each(data, function(index, value) {\n\t\t\t\t//Get country data from API\n\t\t\t\t$('#uCountry').append(\n\t\t\t\t\t$('<option>', {\n\t\t\t\t\t\tvalue: value.name,\n\t\t\t\t\t\ttext: value.name\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t});\n\t\t},\n\n\t\terror: function(xhr, ajaxOptions, thrownError) {\n\t\t\tvar errorMsg = 'Ajax request failed: ' + xhr.responseText;\n\t\t\tconsole.log(errorMsg);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "edd982229229b8fe61fc653721925437", "score": "0.58152825", "text": "loadCountries() {\n this.makeRequest('GET', '/workflow/countries')\n .then((response) => {\n if (response.data) {\n this.countries = response.data;\n }\n })\n .catch((e) => {\n this.countries = [];\n });\n }", "title": "" }, { "docid": "3c528e86e2df63ffff1e5f833284dc57", "score": "0.5809983", "text": "function showStates(countryID) {\n let selectState = document.getElementById('states')\n selectState.innerHTML=''\n fetch(`/country/${countryID}`)\n .then((response)=>{\n return response.json()\n }).then(states=>{ \n for(state of states){\n let option = document.createElement('option')\n option.setAttribute('value', state._id)\n option.innerHTML = state.stateName\n selectState.appendChild(option)\n }\n })\n}", "title": "" }, { "docid": "c9ebee1279b2cacd67a33db34de93ce7", "score": "0.58082336", "text": "function load_dropdowns() {\n //var arrayCities = uniqueCities;\n \n // Ordena el Array Alfabeticamente, es muy facil ;)):\n uniqueCities.sort();\n uniqueStates.sort();\n uniqueCountries.sort();\n uniqueShapes.sort();\n \n addCities(\"city\", uniqueCities);\n addCities(\"state\", uniqueStates);\n addCities(\"country\", uniqueCountries);\n addCities(\"shape\", uniqueShapes);\n }", "title": "" }, { "docid": "4feb5fb447e55420f2885eb69b1d0763", "score": "0.5791628", "text": "getCountries() {\n var vm = this;\n vm.address.country.loading = true;\n vm.billingDetails.address.country.loading = true;\n $.ajax({\n url: vm.$route('admin.ajax.countries.fetch'),\n type: 'GET',\n dataType: 'JSON',\n success: function (response) {\n vm.address.country.loading = false;\n vm.billingDetails.address.country.loading = false;\n if (response && response.data) {\n var options = [];\n response.data.forEach(function(item) {\n options.push({\n id: item.id,\n text: item.name\n });\n });\n vm.address.country.options = options;\n vm.billingDetails.address.country.options = options;\n }\n }\n });\n }", "title": "" }, { "docid": "f5ff45ec3bec6a13d8c51c025148597c", "score": "0.5769023", "text": "function updateCountryDisable(){\n $('#countryNameToDisable').empty();\n $.ajax({ \n type: \"GET\", \n url: './PHP/updateCountry.php',\n data: {peticion:\"updateDisable\"}, \n success: function(data) { \n var countries = JSON.parse(data);\n $.each(countries, function(index, value){\n $(\"#countryNameToDisable\").append($(\"<option>\", {text : value.country\n })); \n }); \n }\n }); \n}", "title": "" }, { "docid": "9c64f2edeb34d333ff98a8e6fdbad39a", "score": "0.5766556", "text": "function loadCities() {\r\n var request = $.ajax({\r\n type: 'GET',\r\n url: 'http://localhost/decameron/web/city/index',\r\n dataType: \"json\",\r\n });\r\n request.done(function (data) {\r\n $.each(data, function (key, value) {\r\n $(\"#cities\").append('<option value=' + value.id + '>' + value.name + '</option>');\r\n });\r\n });\r\n }", "title": "" }, { "docid": "4f2524df0f6c5aa512d34af032ed2eba", "score": "0.57648474", "text": "function addCountries(countries) {\n // projection used in the geoPath generator\n const projection = d3\n .geoEquirectangular()\n // use the size of the svg for the boundaries of the projection\n .fitSize([width, height], countries);\n\n // generator function to draw the countries\n const geoPath = d3\n .geoPath()\n .projection(projection);\n\n // generator function to draw the graticule\n const geoGraticule = d3\n .geoGraticule();\n\n // before the path elements describing the countries draw a path element for the graticule\n world\n .append('path')\n .attr('d', geoPath(geoGraticule()))\n .attr('stroke', 'currentColor')\n .attr('fill', 'none')\n .attr('opacity', 0.1);\n\n // for each feature of the countries object add a path element\n world\n .selectAll('path.country')\n .data(countries.features)\n .enter()\n .append('path')\n .attr('class', 'country')\n .attr('d', geoPath)\n // specify a title describing the name of the country\n .append('title')\n .text(({ name }) => name);\n}", "title": "" }, { "docid": "30b44eb4b594de0ef47594bf5c2010f4", "score": "0.57499343", "text": "function loadAll() {\n var allStates = 'http://www.apanovabucuresti.ro/buletine-de-analiza-a-apei/';\n\n return allStates.split(/, +/g).map(function (state) {\n return {\n value: state.toLowerCase(),\n display: state\n };\n });\n }", "title": "" }, { "docid": "abb6518fe6b9511e41ec705e2b8909c1", "score": "0.5735576", "text": "function generateCountrySelector() {\n const options = store.data.sort(function (ca, cb) {\n const a = ca.Country;\n const b = cb.Country;\n if (a < b) {\n return -1;\n }\n if (b > a) {\n return 1;\n }\n return 0;\n }).map(country => {\n return `\n <option value=\"${country.CountryCode}\">${country.Country}</option>\n `\n });\n return `\n <h2>Country Analysis</h2>\n <form action=\"\" id=\"country\" class=\"form\">\n <label for=\"country\">Select A Country</label>\n <select name=\"country\" id=\"select\" form=\"country\">\n ${options.join(\" \")}\n </select><br>\n <div class=\"button\">\n <button type=\"button\" id=\"js-main\">Main Menu</button>\n </div>\n</form>\n`\n}", "title": "" }, { "docid": "ccd072ff93961c957169d47090f102c5", "score": "0.5730757", "text": "generateCountryList(finalData) {\n this.countryList = Object.keys(finalData).map((item) => {\n return { label: item, value: item };\n });\n }", "title": "" }, { "docid": "89224c8156a5789a94ca764df683a2db", "score": "0.5729157", "text": "loadBordersCountry()\n {\n \n // looping on country borders alph3code to get its data from backend or from server\n this.state.country.borders.forEach(element=> {\n // getting country with current alpha3Code\n this.getBorderCountries(element)\n \n });\n \n }", "title": "" }, { "docid": "608d112f82a7971669453777ba92ff78", "score": "0.57219833", "text": "function country_data() {\n $.get('https://corona.lmao.ninja/v2/countries/' + input, function(data) {\n // console.log(data);\n\n $(\"#country_cases\").text(data.cases + ' Cases');\n $(\"#country_today_cases\").text(data.todayCases + ' Cases Today');\n $(\"#country_deaths\").text(data.deaths + ' Deaths');\n $(\"#country_today_deaths\").text(data.todayDeaths + ' Deaths Today');\n $(\"#country_recovered\").text(data.recovered + ' Recovered');\n $(\"#country_active\").text(data.active + ' Active');\n $(\"#country_critical\").text(data.critical + ' Critical');\n $(\"#country_cases_per_one_million\").text(data.casesPerOneMillion + ' Cases Per One Million');\n $(\"#country_deaths_per_one_million\").text(data.deathsPerOneMillion + ' Deaths Per One Million');\n $(\"#country_tests\").text(data.tests + ' Tests');\n $(\"#country_tests_per_one_million\").text(data.testsPerOneMillion + ' Tests Per One Million');\n });\n}", "title": "" }, { "docid": "97954ce77f94b9c6278a25cb1d84a94e", "score": "0.57211477", "text": "function showDataAboutCountry(data) {\n let info =\n \"Country: \" + data[0].name + \"<br>\" +\n \"Population: \" + data[0].population + \"<br>\" +\n \"Area: \" + data[0].area + \"<br>\" +\n \"Borders: \" + data[0].borders;\n document.getElementById(\"mapDetails\").innerHTML = info;\n}", "title": "" }, { "docid": "d84afc8e651eb8c0cfba61d731235ccc", "score": "0.5714077", "text": "function getCountries(getData) {\n transferData = getData;\n showCountries(transferData);\n}", "title": "" }, { "docid": "fbaef5165bf7c90c2740fd9baf109c27", "score": "0.5713419", "text": "function getByCountry(){\n\tvar countryStr = '';\n\tvar countrySection = document.getElementById(\"countryCheckboxes\");\n\tvar countryChex = countrySection.childNodes;\n\n\tcountryChex.forEach(function(countryDiv, index){\n\t\tvar countryInput = countryDiv.childNodes[0].childNodes[0];\n\t\t\n\t\tif(countryInput.checked){\n\t\t\tif(countryStr.length == 0){\n\t\t\t\tcountryStr = countryInput.value;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountryStr += (', ' + countryInput.value);\n\t\t\t}\n\t\t}\n\t});\n\t\n\tvar wineTable = document.getElementById(\"wineTbody\");\n\twineTable.innerHTML = '';\n\n\tif(countryStr.length == 0){\n\t\tgetAllWines();\n\t}\n\telse{\n\t\tlet query = 'SELECT wid, p_name, w_name, country, region, normal, g_name, vintage, alc_perc, price FROM producers, wines, grapes '+\n\t\t'where wines.pid = producers.pid and wines.gid=grapes.gid and producers.country in ('+countryStr+') ORDER BY lower(country)';\n\t\tvar wineList = dbConnection.exec(query)[0].values;\n\n\t\twineList.forEach(function(wineInfo){\n\t\t\tcreateWineTableCell(wineInfo);\n\t\t\t$('[data-toggle=\"popover_'+wineInfo[0]+'\"]').popover({\n\t \t\tplacement : 'left',\n\t \t\ttrigger : 'hover'\n\t \t});\n\t\t});\n\t}\n\t\n}", "title": "" }, { "docid": "20076d2c58ca81c0020364d7a1b2d215", "score": "0.5712869", "text": "function displayCountries(countries) {\n let countryCard = countries\n .map((country) => {\n return `<div class='card animation'>\n <div class='card-img'>\n <img class='card-img-top' src='${country.flag}' />\n </div> \n <div class='card-back card-img-top'>\n <p class=\"card-text\"> <b>Population</b> : ${country.population}</p>\n <p class=\"card-text\"> <b>Capital</b>: ${country.capital}</p>\n <p class=\"card-text\"> <b>Region </b>: ${country.region}</p>\n <button class ='btn btn-light know-more-button '><a href='/countries/${country.name}'>Know More</a></button>\n </div> \n <div class=' card-name'> \n <p class='card-text'><b>Name</b>: ${country.name}</p>\n \n </div>\n </div>`;\n })\n .join(\"\");\n $(\".list-of-countries\").html(countryCard);\n}", "title": "" }, { "docid": "ff8edc41edb14c7b2f157865f78588f5", "score": "0.57011306", "text": "function country() {\n for (let i = 0; i < countries.length; i++) {\n console.log(countries[i].name);\n }\n}", "title": "" }, { "docid": "2aded8d9128fb32632e8dd2012575608", "score": "0.5700983", "text": "function afficherall() {\n $.ajax({\n type: \"post\",\n url: \"controler/controler.php?action=afficherall\",\n success: function (data) {\n console.log(data);\n let conducteur = '';\n let vehicule = '';\n data['conducteur'].forEach(data => {\n conducteur += '<option value=\"' + data.id_conducteur + '\">' + data.nom + ' ' + data.prenom + '</option>'\n })\n data['vehicule'].forEach(data => {\n\n vehicule += '<option value=\"' + data.id_vehicule + '\">' + data.marque + ' de ' + data.modele + '</option>'\n })\n\n $(\".vehicule\").append(vehicule);\n $(\".conducteur\").append(conducteur);\n\n\n },\n dataType: \"json\"\n });\n }", "title": "" }, { "docid": "3c88d43c0ba910587cdcc4259337ff15", "score": "0.56974244", "text": "function populateChinaDropdowns(fieldsegment, map) {\n var country = $('#edit-'+fieldsegment+'-99-hidden-country').val();\n //only use account values if account country is china since we need to match values with json map\n if (country == 'CN') {\n var p = ($('#edit-'+fieldsegment+'-99-hidden-province').val() != '' ? $('#edit-'+fieldsegment+'-99-hidden-province').val() : \"北京\");\n var c = ($('#edit-'+fieldsegment+'-99-hidden-city').val() != '' ? $('#edit-'+fieldsegment+'-99-hidden-city').val() : \"北京\");\n var d = ($('#edit-'+fieldsegment+'-99-hidden-district').val() != '' ? $('#edit-'+fieldsegment+'-99-hidden-district').val() : \"东城区\");\n } else {\n var p = \"北京\";\n var c = \"北京\";\n var d = \"东城区\";\n }\n\n //reset province dropdown before loading its values\n var _regIsPopulated = $(\"#reg-person-address1\").val() != \"\";\n $( \"#edit-\"+fieldsegment+\"-99-province\" ).html('');\n if (!_regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", \" \" ).html(\"选择省\").appendTo(\"#edit-\"+fieldsegment+\"-99-province\"); //default value\n }\n _.each( map, function(object, i) {\n if (p == i && _regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", i ).html(i).appendTo(\"#edit-\"+fieldsegment+\"-99-province\");\n } else {\n $( \"<option>\" ).attr( \"value\", i ).html(i).appendTo(\"#edit-\"+fieldsegment+\"-99-province\");\n }\n });\n $(\"#edit-\"+fieldsegment+\"-99-province\").trigger('keyup');\n\n //city\n $( \"#edit-\"+fieldsegment+\"-99-city\" ).html('');\n if (!_regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", \" \" ).html(\"选择城市\").appendTo(\"#edit-\"+fieldsegment+\"-99-city\"); //default value\n }\n if (p != 0) {\n _.each( _.keys(map[p]), function( object, i, list) {\n if (c == object && _regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", object ).html(object).appendTo(\"#edit-\"+fieldsegment+\"-99-city\");\n } else {\n $( \"<option>\" ).attr( \"value\", object ).html(object).appendTo(\"#edit-\"+fieldsegment+\"-99-city\");\n }\n });\n }\n $(\"#edit-\"+fieldsegment+\"-99-city\").trigger('keyup');\n\n //district\n $( \"#edit-\"+fieldsegment+\"-99-district\" ).html('');\n if (!_regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", \" \" ).html(\"选择区\").appendTo(\"#edit-\"+fieldsegment+\"-99-district\"); //default value\n }\n if (p != 0 && c != 0) {\n _.each( map[p][c], function( value, i, list) {\n if (d == value && _regIsPopulated) {\n $( \"<option selected>\" ).attr( \"value\", value ).html(value).appendTo(\"#edit-\"+fieldsegment+\"-99-district\");\n } else {\n $( \"<option>\" ).attr( \"value\", value ).html(value).appendTo(\"#edit-\"+fieldsegment+\"-99-district\");\n }\n });\n }\n $(\"#edit-\"+fieldsegment+\"-99-district\").trigger('keyup');\n}", "title": "" }, { "docid": "9fd8d08be12314bf77cb43b12793e239", "score": "0.5696458", "text": "function getCountryF() {\n axios\n .get('/country')\n .then((response) => {\n if (response.data.length > 0) {\n const details = [];\n for (const i in response.data) {\n details.push({\n label: response.data[i].name,\n value: [\n response.data[i].name,\n response.data[i].states,\n ],\n });\n }\n seTdataCountry(details);\n }\n })\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "ec5689dc7c68bedd2e781af0b9724895", "score": "0.5693293", "text": "async function getCountriesInfo() {\n\n loader.style.left = 'calc(50vw - 300px);'\n \n let countries = []\n const result = await fetch(proxyLink + apiOne)\n const datas = await result.json()\n\n datas.data.map(element => {\n let temp = {}\n temp.name = element.name\n temp.code = element.code\n temp.confirmed = element.latest_data.confirmed\n temp.deaths = element.latest_data.deaths\n temp.recovered = element.latest_data.recovered\n temp.critical = element.latest_data.critical\n temp.todayDeath = element.today.deaths\n temp.todayConfirmed = element.today.confirmed\n countries.push(temp)\n })\n\n loader.style.left = '-9999px'\n return countries\n}", "title": "" }, { "docid": "8a82ef0a7a7eb8914b623026af29fb04", "score": "0.5692883", "text": "function getCities(list) {\n for (var i in list) {\n for (var j in list[i]) {\n // countryFilter\n if ((j == \"country\") && (list[i][j] == countryFilter)) {\n var newCity = new City(list[i]['name'], list[i]['url'], i);\n myCities.addCityToList(newCity);\n }\n }\n }\n myCities['mainList'] = myCities['list'];\n myRefreshButton.setRefreshBadge(myCities.getListLength());\n }", "title": "" }, { "docid": "34825bc8392345a688cddfe33cbe80f2", "score": "0.56873995", "text": "function loadAll() {\n var allStates = 'India, Cannada, England';\n return allStates.split(/, +/g).map(function(state) {\n return {\n value: state.toLowerCase(),\n display: state\n };\n });\n }", "title": "" }, { "docid": "9a21e734a38ad2df8746a3cf3457e5df", "score": "0.56865245", "text": "function loadAll() {\n var allStates = 'תפוח, תמר, אגוז, חלב, גבינה, ביצים, ביצים אורגניות, תפוזים, חומוס, פיתה, לחם, לחם אחיד, לחם שיפון';\n // var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\\\n // Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\\\n // Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\\\n // Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\\\n // North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\\\n // South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\\\n // Wisconsin, Wyoming';\n return allStates.split(/, +/g).map( function (state) {\n return {\n value: state.toLowerCase(),\n display: state\n };\n });\n }", "title": "" }, { "docid": "23ef16c33b588a54acf1a3b5e7200a79", "score": "0.5676472", "text": "function setDropDownData(){\n var initializeDropDown = false; \n /*\n * Get the dropdown options. This can be retrieved using Ajax in json format. \n */\n var continents = '[{\"option\": \"Africa\", \"value\":\"Africa\"}, {\"option\": \"Antarctica\", \"value\":\"Antarctica\"}, {\"option\": \"Asia\", \"value\":\"Asia\"},{\"option\": \"Australia\", \"value\":\"Australia\"},{\"option\": \"Europe\", \"value\":\"Europe\"},{\"option\": \"North America\", \"value\":\"North America\"},{\"option\": \"South America\", \"value\":\"South America\"}]';\n \n var allContinents = $.parseJSON(continents);\n \n if(allContinents.length > 0){\n initializeDropDown = true;\n for(var index = 0; index < allContinents.length; index++){\n createCheckBox(\"continentOption\", allContinents[index].value);\n createSpan(allContinents[index].option);\n }\n }\n return initializeDropDown;\n }", "title": "" }, { "docid": "38b0b3978cb343fadb3bca023ab89d3d", "score": "0.5675777", "text": "function addPeopleSelection() {\n db.transaction(function(trans) {\n trans.executeSql('SELECT * FROM names', [],\n function(tx, rs) {\n var rowsLength = (rs.rows.length);\n var output = \"\";\n \n for(i = 0; i < rowsLength; i++) {\n output += '<option value=\"' + (i+1) + '\">' + rs.rows.item(i).name_text + '</options>';\n } \n document.getElementById(\"listPeople\").innerHTML = output;\n },\n function(tx, err) {\n console.info(err.message);\n }); \n }, transErr, transSuccess); \n}", "title": "" }, { "docid": "1767a651cd34a047b292b29a4f6463e8", "score": "0.56748563", "text": "function EditFormInfoAdd(id) {\n for (const country of countries) {\n if (country._id == id) {\n document.querySelector('#txtEditCountryName').value = country._name\n document.querySelector('#newSltContinent').value = country._continent\n document.querySelector('#txtEditCountryCapital').value = country._capital\n document.querySelector('#txtEditCountryLanguage').value = country._language\n document.querySelector('#stlLevelEdit').value = country._level\n document.querySelector('#txtEditCountryInfo').value = country._information\n document.querySelector('#txtEditCountryLocation').value = country._location\n document.querySelector('#txtEditCountryFlag').value = country._flag\n }\n }\n}", "title": "" }, { "docid": "061a259376081b0377d7964fa63bd69f", "score": "0.56744355", "text": "function getAlldata(arrCountries){\n const data = []\n arrCountries.forEach(country => {\n fetch('https://covid19.mathdro.id/api/countries/'+ country )\n .then(response => response.json())\n .then(res => { \n const all = res;\n data.push({\n countries: country, \n confirmed: all.confirmed.value,\n recovered: all.recovered.value,\n deaths: all.deaths.value\n });\n });\n });\n return data;\n}", "title": "" }, { "docid": "83464ab44cc8b80d549f5ef6792ae1e1", "score": "0.56629574", "text": "async getCountry(country) {\n try {\n // RAJOUTER country A L'URL SIMPLEMENT OU EN TEMPLATE LITERAL\n const result = await fetch('https://restcountries.eu/rest/v2/name/' + country)\n // const result = await fetch(\"https://restcountries.eu/rest/v2/name/${country}\")\n const countries = await result.json()\n this.setState({\n name: countries[0].name,\n capital: countries[0].capital,\n flag: countries[0].flag,\n population: countries[0].population,\n region: countries[0].region,\n })\n }\n catch (error) {\n console.error(error)\n }\n }", "title": "" }, { "docid": "47d4a3a7bbeaab837aa99997e6c8db81", "score": "0.56548315", "text": "async function getCountries() {\n return database.query('SELECT * from country order by code asc');\n}", "title": "" }, { "docid": "998b9730801d4803afa79163536be772", "score": "0.5651386", "text": "function outputTop10CountryOption() {\n var url = \"serviceVisitsData.php?table=countryVisitsTop10&countryISO\";\n \n $.get(url, function(data) {\n countryTop10DropDownListOptions(data);\n });\n}", "title": "" }, { "docid": "0e1cfd011b77ba4ee37cb75f68e578cb", "score": "0.56486845", "text": "function addCountries(popdata, gdpdata){\n\tvar popData = popdata[1];\n\tvar gdpData = gdpdata[1];\n\tfor (i=0;i<popData.length;i++){\n\t\tvar myCountry = popData[i].country.value;\n\t\tvar myPop = popData[i].value;\n\t\tvar myGDP = gdpData[i].value;\n\t\tvar myLanguages = {};\n\t\tvar myCountryCode = '';\n\t\t// get languages data from countries_languages.js\n\t\t// for each country, add the language object if data are available\n\t\tfor (j=0;j<countryLangs.length;j++){\n\t\t\tif (myCountry == countryLangs[j].name) {\n\t\t\t\t// the country names match, so add the languages object\n\t\t\t\tmyLanguages = countryLangs[j].languages;\n\t\t\t\tmyCountryCode = countryLangs[j].countryCode;\n\t\t\t}\n\t\t}\n\t\tcountries.push(new Country(myCountry, myPop, myGDP, myLanguages, myCountryCode));\n\t}\n}", "title": "" }, { "docid": "ad1ba7d3604e050a9da0fd4d09f1866c", "score": "0.5640368", "text": "async function getSameCurrencyCountries(){ \n let data = await fetch(`${apiData.apiUrl}currency/${iso.currencies[0].code}`)\n let countries = await data.json();\n countries.forEach(country =>{\n for (let i = 0; i < country.currencies.length; i++){\n page.ISODiv.innerHTML += `${country.name}: ${country.currencies[i].name}.<br>`\n }\n })\n }", "title": "" }, { "docid": "1834594631a465d2e451cf55214e73f8", "score": "0.56275445", "text": "function loadCountries(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", urlAPI +\"/Countries\", false);\n\txhr.send();\n\n\treturn JSON.parse(xhr.responseText);\n}", "title": "" }, { "docid": "7ecd3eb82d3c14f821c43819b104d242", "score": "0.5621433", "text": "async function populateFilter() {\n await fetchWines(\"wines\")\n const year = [...new Set(wine.map(w => w.year))].sort((a, b) => a - b)\n selectYear.innerHTML = year.map(y => (\n\n `\n <option value=\"${y}\">\n ${y}\n </option>\n `\n )).join('')\n\n const country = [...new Set(wine.map(w => w.country))].sort((a, b) => a > b ? 1 : a < b ? -1 : 0)\n selectCountry.innerHTML = country.map(c => (\n\n `\n <option value=\"${c}\">\n ${c}\n </option>\n `\n )).join('')\n}", "title": "" }, { "docid": "38dde58cf0ea513c7aa4b3e4fe7e4cea", "score": "0.56197876", "text": "function changeToCountry() {\n\n removeChildren();\n\n for (let i = 0; i < data.length; i++){\n \n addCountryCoord(earth,data[i].location_name, data[i].latitude, data[i].longitude, data[i].id, 'yellow');\n \n }\n}", "title": "" }, { "docid": "155f155caff45e385d09926aca4e34e3", "score": "0.5619626", "text": "function addToList() {\n\t\tfor (var i = 0; i < cities.length; i++) { //loop through array and add to the drop down\n\t\t\t$('select').append('<option>'+cities[i]+'</option>')\n\t\t\t$( \"select\" ).attr( 'class', 'dropdownList');\n\t\t};\n\t}", "title": "" } ]
9cac8542e9973386d5c72c99f7d3f6b7
Class representing a collection of tweets. Empty when instantiated.
[ { "docid": "09aaa38f44e68a3dd5681f0340b78727", "score": "0.82981604", "text": "function TweetCollection () {\n\tthis.tc = new Array();\n}", "title": "" } ]
[ { "docid": "3f1b1899bffcab1ef6b89a8b07a29910", "score": "0.62667435", "text": "function parseTweets() {\n if (tweetList == 0) {\n tweetsContainer.html('<h1 id=\"no-tweets-msg\">No Tweets currently found</h1>')\n } else {\n $.each(tweetList, (key, value) => {\n const tweetKey = key\n attachTweet(value)\n })\n }\n }", "title": "" }, { "docid": "19698900246864aa8bc3bb972d8f10f4", "score": "0.61279196", "text": "function renderTweets(tweets) {\n $(\"#tweets-container\").text('');\n for (tweet of tweets) {\n $('#tweets-container').append(createTweetElement(tweet));\n }\n}", "title": "" }, { "docid": "12d68147637f80505191986dd698fc86", "score": "0.60781956", "text": "function renderTweets(tweets) {\n $('#tweets-container').empty();\n tweets.forEach((tweet) => {\n const tweetElement = createTweetElement(tweet);\n $('#tweets-container').append(tweetElement);\n });\n}", "title": "" }, { "docid": "fb15f44bb57831e8cf6bb522e0ea4420", "score": "0.60701686", "text": "function Tweet(data) {\n this.id = data.id;\n this.text = data.text;\n this.created_at = new Date(data.created_at);\n if (isNaN(this.date)) {\n this.date = new Date();\n }\n this.user = new User(data.user);\n this.retweet_count = data.retweet_count;\n this._raw_ = data;\n}", "title": "" }, { "docid": "5b23f2a6fa27b005d3913fe838ee442f", "score": "0.6045897", "text": "function renderTweets(tweets) {\n var $tweetContainer = $('.tweets');\n $tweetContainer.empty();\n for (var i = 0; i < tweets.length; i++) {\n var tweet = tweets[i];\n $tweetContainer.prepend(createTweetElement(tweet));\n }\n }", "title": "" }, { "docid": "19691bd0bebb12781f49ee277b201fa5", "score": "0.5970001", "text": "function ko_tweet(data) {\n\tvar self = this;\n\t\n\tself.ko_tweet_id = ko.observable(data.ko_tweet_id);\n\tself.ko_tweet_post = ko.observable(data.ko_tweet_post);\n\tself.ko_posted_by = ko.observable(data.ko_posted_by);\n\tself.ko_timestamp = ko.observable(data.ko_timestamp);\n}", "title": "" }, { "docid": "9e7daa1a3b764835d40efea7a124333d", "score": "0.5960728", "text": "function renderTweets(tweets) {\n // Clears out the section before rendering with new tweets.\n $('#tweets').empty();\n // Loops through tweets and creates element for each one.\n tweets.forEach(function(tweet) {\n // Adds the tweet element to the container.\n $('#tweets').prepend(createTweetElement(tweet));\n });\n }", "title": "" }, { "docid": "75afe8cae5971060aee2fa67f94742d5", "score": "0.5958774", "text": "function loadTweets () {\n var $tweetData = $.getJSON('/tweets', function (data) {\n var items = []\n $.each( data, function(obj) {\n items.push(data[obj])\n })\n renderTweets(items)\n attachListeners()\n })\n\n\n }", "title": "" }, { "docid": "05a787791ef801a621bc5d9fab70e83a", "score": "0.5946884", "text": "function renderTweets(tweets) {\n\t\t$('#tweetsContainer').empty()\n\t\tfor (let item of tweets) {\n\t\t\tconst tweetElement = createTweetElement(item)\n\t\t\t$('#tweetsContainer').prepend(tweetElement)\n\t\t}\n\t}", "title": "" }, { "docid": "4103707e1b67796d88f41fac04648be1", "score": "0.5945777", "text": "function renderTweets(tweets) {\n for (let entry of tweets) {\n let $tweet = createTweetElement(entry);\n $(\"#tweetsContainer\").append($tweet);\n }\n}", "title": "" }, { "docid": "9c545fd004e36cab4a9e273057b68924", "score": "0.59269387", "text": "constructor() {\n this.tweets = document.getElementById(\"tweets\")\n }", "title": "" }, { "docid": "1551013a7b8aaa2da39ebafe19989210", "score": "0.5921891", "text": "function renderTweets(tweets) {\n for (let arr of tweets) {\n var $tweet = createTweetElement(arr);\n $('#tweets-container').prepend($tweet);\n $('.new-tweet form textarea').val(\"\");\n $('.new-tweet form footer .counter').text(\"140\");\n }\n}", "title": "" }, { "docid": "9cd09f8ea7328dcb704c33fe4fb92675", "score": "0.59009063", "text": "displayTweets() {\n\n\t\tif(this.props.tweets === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet tweets = this.props.tweets;\n\n\t\t//dont sort through render, should be pure\n\t\t//sort tweets based on desired sorting order\n\t\ttweets.sort(propComparator(this.props.order));\n\n\t\t//provide each Tweet component with properties and display it\n\t\treturn tweets.map(function(tweet) {\n\n\t\t\treturn (\n\t\t\t\t<Tweet key={tweet.id} user={tweet.user.screen_name} idStr={tweet.id_str} text={tweet.text} favorites={tweet.favorite_count} retweets={tweet.retweet_count} />\n\t\t\t);\n\t\t});\n\n\t}", "title": "" }, { "docid": "b41ac9d5c664c76e3e555f9f576e7784", "score": "0.58827466", "text": "function renderTweets(tweets) {\n for(let tweet of tweets) {\n $('.tweets').append(createTweetElement(tweet));\n }\n }", "title": "" }, { "docid": "627e5dc88b5cf315acd4c7cfd4931dd0", "score": "0.5863348", "text": "function tweet() {\n\tthis.emotion;\n\tthis.scale;\n\tthis.timestamp;\n}", "title": "" }, { "docid": "517ac256246f4a1cc0c0a3f764dd36fc", "score": "0.5847433", "text": "function renderTweets(tweets) {\n tweets.forEach(function(el){\n let newTweet = createTweetElement(el);\n $(\"#section-tweet\").append(newTweet)\n });\n }", "title": "" }, { "docid": "ed0efcd1c475a8ffe95f136cba1041ef", "score": "0.5819748", "text": "constructor(props) {\n super(props);\n this.state = {\n // this state (variable) will grab the array of collections straight from the database\n tweetCollectionArray: [],\n // this state (variable) will hold an array of styled HTML for each entry in the database\n mappedTweet: [],\n editCollection: {},\n };\n }", "title": "" }, { "docid": "1465e879fccf83245d141353880b0443", "score": "0.5790491", "text": "function renderTweets(tweets) {\n console.log('render')\n $('.all-tweets').html('');\n tweets.forEach((tweet) => {\n var oneTweet = createTweetElement(tweet);\n $('.all-tweets').prepend(oneTweet);\n });\n}", "title": "" }, { "docid": "2d80d145a850d358cb01e47728a43554", "score": "0.5752348", "text": "function renderTweets(tweets) {\n tweets.forEach(function(input){\n const eachTweet = createTweetElement(input);\n $(\"#section-tweet\").append(eachTweet);\n });\n }", "title": "" }, { "docid": "c157bf03a0e84bc0574e12e9249427b6", "score": "0.57518274", "text": "constructor(i,tweetData) {\n this._data = {\n id: i, \n text: tweetData.text, \n favs: Number.parseInt(tweetData.favorite_count, 10), \n date: moment(tweetData.created_at,\"ddd MMM D HH:mm:ss Z\"), \n mentions: tweetData.entities.user_mentions.map(m => m.screen_name), \n hashtags: tweetData.entities.hashtags.map(h => h.text) \n }\n }", "title": "" }, { "docid": "68be5e91fe2bdd0067bce0efa76d9af9", "score": "0.5738497", "text": "function renderTweets(tweets) {\n // loops through tweets\n for (let i = tweets.length -1; i >=0; i--) {\n let $tweet = createTweetElement(tweets[i]);\n $(\"#tweet-container\").append($tweet);\n }\n}", "title": "" }, { "docid": "b79b36aa383da13f2bcf618231c2e08e", "score": "0.57270485", "text": "function tweets() {\n //console.log(\"tweets!\");\n var user = $('.tweets').attr('data-user');\n var number = $('.tweets').attr('data-number');\n\n $(\".tweets\").tweet({\n username: user,\n page: 1,\n count: number,\n loading_text: \"Loading tweets...\"\n }).bind(\"loaded\", function() {\n $(this).find(\"a\").attr(\"target\",\"_blank\");\n\n var ul = $(this).find(\".tweet_list\");\n\n ul.children('li').each(function() {\n $(this).children('span').wrapAll('<div/>')\n });\n\n var ticker = function() {\n setTimeout(function() {\n var offset = '-100px';\n if ( $(window).width() < 767) offset = '-130px';\n\n ul.find('li:first').transition( {marginTop: offset}, 500, function() {\n $(this).detach().appendTo(ul).removeAttr('style');\n });\n ticker();\n }, 5000);\n };\n ticker();\n });\n }", "title": "" }, { "docid": "ba9a7735ce3cbf7f1ba63ca716473e4f", "score": "0.56942177", "text": "function renderTweets (tweets) {\n $('#dynamicTweetsContainer').empty();\n tweets.forEach((tweet) => {\n twtElement = createTweetElement(tweet);\n $(\"#dynamicTweetsContainer\").prepend(twtElement);\n });\n}", "title": "" }, { "docid": "1aa5ef2838c3b9441c6fd263f93a29ea", "score": "0.5680492", "text": "function renderTweets(tweetArray) {\n $('#tweetsContainer').empty()\n for (tweet of tweetArray) {\n var $tweet = createTweetElement(tweet)\n $('#tweetsContainer').prepend($tweet);\n redHeart(tweet._id)\n }\n\n }", "title": "" }, { "docid": "c2364dce593c33029374b5fe7b2178c1", "score": "0.56738436", "text": "function renderTweets(tweets) {\n tweets.forEach(function(tweet) {\n $(\".tweet-area\").prepend(createTweetElement(tweet));\n });\n }", "title": "" }, { "docid": "0070a3f9fa3cdac6e3353395f05d5aa0", "score": "0.56708246", "text": "function renderTweets(tweet) {\n for(singleUser of tweet){\n $('.tweets-container').prepend(createTweetElement(singleUser));\n }\n\n }", "title": "" }, { "docid": "2b25b988f46d5456bf207e5d0d21d482", "score": "0.5598561", "text": "function handleTweets(tweets) {\n\t\t\t\t// Start HTML var\n\t\t\t\tvar html = \"\";\n\t\t\t\t// For every tweet....\n\t\t\t\ttweets.each(function(tweet) {\n\t\t\t\t\t// Append string...\n\t\t\t\t\thtml += \"<li>\" + tweet.text.replace(/(https?:\\/\\/\\S+)/gi,'<a href=\"$1\">$1</a>').replace(/(^|\\s)@(\\w+)/g,'$1<a href=\"http://twitter.com/$2\">@$2</a>').replace(/(^|\\s)#(\\w+)/g,'$1#<a href=\"http://search.twitter.com/search?q=%23$2\">$2</a>') + \"</li>\";\n\t\t\t\t});\n\t\t\t\t// Add tweets to pane\n\t\t\t\ttweetsList.set(\"html\",html);\n\t\t\t\t// Fade in\n\t\t\t\tdocument.id(\"tweetsContainer\").fade(1);\n\t\t\t}", "title": "" }, { "docid": "eea5fadc5ceb8d4480fb27306b6af772", "score": "0.5598393", "text": "function getTweets(callback){\n\n\t//Adding empty object {} as we want all the results\n\ttweetCollection.find({},{\"limit\":20,\"sort\":{\"_id\":-1}},function(error, cursor){\n\t\tcursor.toArray(function(error,tweets){\n\t\t\tcallback(tweets);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "daa208d975914d6fe6cad67a3b870ec9", "score": "0.55760354", "text": "function renderTweets(tweets) {\n for (let tweetData of tweets) {\n var $tweet = createTweetElement(tweetData);\n $(\".tweet-container\").prepend($tweet);\n };\n}", "title": "" }, { "docid": "b7d02dd484d7e4be7b756436bac9dafc", "score": "0.5563726", "text": "function myTweets () {\n\t// Set variable \"client\" to the twitter keys\n\tvar client = new Twitter(keys.twitterKeys);\n\n\t// screen name parameters to pass into client\n\tvar params = { screen_name: \"WebDevKlein\"};\n\n\t// twitter client request\n\tclient.get(\"statuses/user_timeline\", params, function(error, tweets, response) {\n\t\tif (!error) {\n\t\t\tvar data = [];\n\n\t\t\tfor (var i = 0; i < tweets.length; i++) {\n\t\t\t\tdata.push({\n\t\t\t\t\tcreated_at: tweets[i].created_at,\n\t\t\t\t\ttext: tweets[i].text\n\t\t\t\t});\n\t\t\t}\n\t\t\t// test and debugging\n\t\t\t\n\t\t\tconsole.log(data);\n\t\t\t\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "98715efe31f133affa6476c92c1d4bb1", "score": "0.5562423", "text": "function renderTweets(tweets){\n for(var i = 0; i < tweets.length; i++){\n var createdTweet = createTweetElement(tweets[i]);\n $(\".tweetsSection\").prepend(createdTweet);\n }\n}", "title": "" }, { "docid": "79a797c0cc77c5e489e9d11fdcdaf594", "score": "0.5551868", "text": "function Tweets(url){\n\tthis.lyrics = new Array();\n\tthis.request = new XMLHttpRequest();\n\n\tvar that = this;\n\tthis.request.onload = function() {\n\t\tthat.parse(this.responseText);\n\t}\n\n\tthis.request.onerror = function() {\n\t\tthat.onError();\n\t}\n\n\tthis.request.open(\"GET\", url, true);\n}", "title": "" }, { "docid": "1d96ea1ad0cc67e9ecf7b414ba627c92", "score": "0.55421096", "text": "function getTweets() {\n\t\t\trequest(options, function(err, response, body) {\n\t\t\t\tif (rateCheck(response, res)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < body.length; i++) {\n\t\t\t\t\tresults.push('@' + body[i].user.screen_name + \": \" + body[i].text);\n\t\t\t\t}\n\t\t\t\tcount -= body.length;\n\t\t\t\tif (count > 0) {\n\t\t\t\toptions.url = baseURL + 'favorites/list.json?screen_name=' + screenName + '&count=' + count + '&max_id=' + body[body.length-1].id\n\t\t\t\tgetTweets();\n\t\t\t\t} else {\n\t\t\t\t\treturn res.json(results);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "a06d0918c54f968b4b8598e32bb91e68", "score": "0.55277395", "text": "function renderTweets(data) {\n data.forEach((entry) => {\n createTweetElement(entry)\n });\n }", "title": "" }, { "docid": "dbc63a8ec73a0889689fb335f21f350e", "score": "0.5519553", "text": "function renderTweets(data){\n if($('#tweets-container').children().length !== 0){\n $('#tweets-container').prepend(createTweetElement(data[0]));\n }\n else{\n for(var tweetData of data){\n $('#tweets-container').append(createTweetElement(tweetData));\n }\n }\n}", "title": "" }, { "docid": "cdeaba38e0eff7a897f079134b90ac9e", "score": "0.5517401", "text": "function UserCollection(size) {\n\n\t// Member var setup\n\tthis.userArray = new Array(size);\n\tthis.size = size;\n\n\t// Make list with empty user entries\n\tfor ( var i = 0; i < size; i++) {\n\t\tthis.userArray[i] = new UserEntry('', '');\n\t}\n\n\t// Member function setup\n\tthis.indexOf = UserCollectionIndexOf;\n\tthis.get = UserCollectionGet;\n\tthis.add = UserCollectionAdd;\n\tthis.remove = UserCollectionRemove;\n\n}", "title": "" }, { "docid": "f3dfd795eb5a8d396ec9d9177bbd9d84", "score": "0.55164605", "text": "function renderTweets(tweets) { //loop through array of objects and pass each one to createTweetElement\n for(let i = 0; i < tweets.length; i ++){\n createTweetElement(tweets[i]).prependTo('#tweetContainer');\n }\n }", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.5513372", "text": "function Collection () {}", "title": "" }, { "docid": "92dc14da9c9b893d787d3dd463554356", "score": "0.55116445", "text": "function loadTweets() {\n\n // AJAX allows for GET request without leaving the page\n $.ajax({\n method: \"GET\",\n url: \"/tweets\"\n }).done(function(tweets) {\n\n // Clear current list before populating page to prevent duplicates\n $(\".tweet-area\").empty();\n renderTweets(tweets);\n });\n }", "title": "" }, { "docid": "f4568e2ae276b54d8e726721e406c01e", "score": "0.5483449", "text": "function getTweets(numOfTweets)\n\t{\n\n\t\tvar numOfTweets = numOfTweets,\n\t\t\tlastPosition = 0,\n\t\t\tfrom = 0,\n\t\t\tto = 0,\n\t\t\tdeniedTweets = 0;\n\n\t\tfunction bringThem()\n\t\t{\n\n\n\t\t\tlastPosition = to;\n\n\t\t\tfrom = to + 1;\n\n\t\t\tto = to + numOfTweets;\n\n\n\t\t\tobjectStore = db.transaction('tweets').objectStore('tweets');\n\n\t\t\tvar keyBoundRange = IDBKeyRange.bound(from, to),\n\t\t\t\tcounter = 0;\n\n\t\t\tobjectStore.openCursor(keyBoundRange, 'prev').onsuccess = function(event)\n\t\t\t{\n\t\t\t\tvar cursor = event.target.result;\n\n\t\t\t\tif (cursor)\n\t\t\t\t{\n\n\t\t\t\t\t// Add tweets to an array\n\n\n\t\t\t\t\tcounter++;\n\n\t\t\t\t\tvar tweetText = cursor.value.text;\n\t\t\t\t\tvar filter, reg;\n\n\t\t\t\t\t//TODO: Aca poner el filtro q trae de las settings!\n\n\t\t\t\t\tfilter = 'Chu';\n\n\n\t\t\t\t\tfilter = filter.replace(/\\s+/g, '|').trim();\n\t\t\t\t\tfilter = '(' + filter + ')';\n\n\t\t\t\t\treg = new RegExp(filter, 'ig');\n\n\t\t\t\t\tconsole.log('FILTER: ' + filter + ' ' + tweetText.search(reg));\n\n\t\t\t\t\tif (tweetText.search(reg) >= 0)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tdeniedTweets++\n\n\t\t\t\t\t\tconsole.log('---------- FILTERED ----------------', deniedTweets, numOfTweets);\n\n\n\t\t\t\t\t\tif (deniedTweets >= numOfTweets)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlastPosition = 0,\n\t\t\t\t\t\t\tfrom = 0,\n\t\t\t\t\t\t\tto = 0,\n\t\t\t\t\t\t\tdeniedTweets = 0;\n\n\t\t\t\t\t\t\ttweetsArray = [];\n\n\t\t\t\t\t\t\tbringThem();\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{\n\t\t\t\t\t\ttweetsArray.push(cursor.value);\n\t\t\t\t\t}\n\n\n\n\n\n\t\t\t\t\tcursor.continue();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tconsole.log('No more entries!');\n\n\n\n\t\t\t\t\tif (tweetsArray == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//console.log('NOMAS!!!', objectStore);\n\n\t\t\t\t\t\tlastPosition = 0;\n\t\t\t\t\t\tfrom = 0;\n\t\t\t\t\t\tto = 0;\n\t\t\t\t\t\tdeniedTweets = 0;\n\n\t\t\t\t\t\tbringThem();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$scope.$apply(function(){\n\n\t\t\t\t\t\t$scope.tweets = tweetsArray;\n\n\t\t\t\t\t});\n\n\t\t\t\t\ttweetsArray = [];\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\t//console.warn('TWEET! from ' + from + ' to ' + to + ' last position ' + lastPosition);\n\n\n\n\n\n\t\t\t//setTimeout(bringThem, secs);\n\t\t}\n\n\t\tsetInterval(bringThem, 12000);\n\t\t//console.log('tweetsArray', tweetsArray);\n\n\t \t//bringThem();\n\n\n\n\t}", "title": "" }, { "docid": "bb5a5bb9244928a499613d2178d15698", "score": "0.5476672", "text": "function renderTweets(tweetArray) {\n $('#tweet-container').empty();\n const container = $('#tweet-container');\n for (const tweet of tweetArray) {\n container.prepend(createTweetElement(tweet));\n }\n }", "title": "" }, { "docid": "0d7bfda84e6519424380ccd66a79f773", "score": "0.5467685", "text": "function tweets() {\n \n\t \n\t\t// set up credentials object for Twitter access\n\t\tvar client = new Twitter({\n\t\t\tconsumer_key: twitterKeys.consumer_key,\n\t\t\tconsumer_secret: twitterKeys.consumer_secret,\n\t\t\taccess_token_key: twitterKeys.access_token_key,\n\t\t\taccess_token_secret: twitterKeys.access_token_secret\n\t\t});\n \n var params = {\n\t\tscreen_name: 'goswamiruchi1',\n\t\tcount: 20\n\t };\n\t console.log(\"-----------My last 20 tweets------------\");\n\t\t// get the 20 most recent tweets\n\t\tclient.get('statuses/user_timeline', params, function(error, tweets, response){\n\t\tif (!error) {\n\t\t\t\n\t for (var i=0; i<tweets.length; i++) {\n\t \tconsole.log(\"\");\n\t \tconsole.log('**********************************************************************************');\n\t\t\t console.log('TWEET TIME :' + tweets[i].created_at);\n\t\t\t console.log('TWEET :' + tweets[i].text);\n\t\t\t console.log('***********************************************************************************');\n\t\t\t console.log(\"\");\n\t\t\t\n\t\t}\n\t \n\t }\n\t }); \n\t }", "title": "" }, { "docid": "d3e6202c99eda6346acfee84b14ec5ed", "score": "0.5455562", "text": "render() {\n\t\t\n\t\treturn (\n\t\t\t<div>\n\n\t\t\t\t<ul className=\"tweetFeed\">{this.displayTweets()}</ul>\n\t\t\t</div>\n\t\t);\n\n\t}", "title": "" }, { "docid": "29e174cee22a650aed6b2a8b4a779ae0", "score": "0.54507476", "text": "function renderTweets(tweets) {\n tweets = tweets.reverse();\n for(let tweet of tweets) {\n let $tweet = createTweetElement(tweet);\n $('#tweet-container').append($tweet);\n }\n\n\n\n}", "title": "" }, { "docid": "fdc15d81d46194ea3d20dc3e7a350cc9", "score": "0.5438116", "text": "initialize() {\n // Re-render the tweet if the backing model changes\n this.model.bind('change', this.render, this);\n\n // Remove the Tweet if the backing model is removed.\n this.model.bind('destroy', this.remove, this);\n }", "title": "" }, { "docid": "2eced5888eaf0a7d5f0a4c90966c61a1", "score": "0.54360837", "text": "function getTweets(callback){\n db.collection(\"tweets\").find().toArray(callback);\n }", "title": "" }, { "docid": "1ba118ae77e9c687b6f175849cc8932b", "score": "0.5435238", "text": "function getTweets() {\n const client = new twitter(keys.twitterKeys);\n client.get(\"statuses/home_timeline.json?count=20\", function(error, tweets) {\n if (error) throw error;\n var result;\n tweets.forEach(function(item) {\n result+=item.text+`\\n`;\n result+=item.created_at+`\\n`;\n result+=\"------\"+`\\n`;\n });\n logResults(result);\n });\n}", "title": "" }, { "docid": "717ed734ea064e829533166403751b9c", "score": "0.5435065", "text": "function initTweetMap(tweets, tweetMap) {\n for (let i = 0; i < tweets.length; i++) {\n let text = tweets[i].text;\n let words = text.split(/(?:,|!|\\.|\\?|:|;|\\/|\\s)+/); //regex: split on punctuation and whitespace\n for (let j = 0; j < words.length; j++) {\n let word = words[j];\n if (!excludedWords.has(word.toLowerCase())) { //exclude certain words from tweet map\n let count = 0;\n if (tweetMap.has(word)) count = tweetMap.get(word);\n tweetMap.set(word, count+1);\n }\n }\n }\n}", "title": "" }, { "docid": "895baf5cbd4512499c2d297458d3addd", "score": "0.5422956", "text": "function handleTweets(tweets) {\n var x = tweets.length,\n n = 0,\n element = document.getElementById('twitter-feed'),\n html = '<div class=\"slides\">';\n while (n < x) {\n html += '<div>' + tweets[n] + '</div>';\n n++;\n }\n html += '</div>';\n element.innerHTML = html;\n \n /* Twits attached to owl-carousel */\n $(\"#twitter-feed .slides\").owlCarousel({\n slideSpeed : 300,\n paginationSpeed : 400,\n autoPlay: true,\n pagination: false,\n transitionStyle : \"fade\",\n singleItem: true\n });\n}", "title": "" }, { "docid": "7f4c4ff239301db0f5a1d0dd625a2bf7", "score": "0.54160947", "text": "function refreshTweets() {\n // clear tweets\n $scope.tweets = [];\n \n // reset all the handle records.\n for (var i = 0; i < $scope.handleRecords.length; i++) {\n $scope.handleRecords[i].max_id = '';\n }\n\n $scope.loadMoreTweets();\n }", "title": "" }, { "docid": "5a655b7b70938877bc4318a764baf05d", "score": "0.5413794", "text": "function Collector() {\n this.collection = {};\n}", "title": "" }, { "docid": "13fcf16a95fb88c8e44a75022605e469", "score": "0.54105484", "text": "function tweets() {\n var client = new Twitter(keys.twitter);\n\n var params = {\n screen_name: \"ShopAholic1208\",\n count: 20\n };\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n console.log(tweets);\n }\n});\n}", "title": "" }, { "docid": "c7e9fda72af64c00ea1d4910205b7a85", "score": "0.54073095", "text": "function renderTweets(tweets) {\n for (var i = 0; i < tweets.length; i++) {\n var currentTweet = createTweetElement(tweets[i]);\n $(\"#tweets-container\").prepend(currentTweet);\n }\n // From hover-over-tweet.js; after rendering, hoverOverTweet() styles tweets\n hoverOverTweet();\n }", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.540155", "text": "function Collection() {}", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.540155", "text": "function Collection() {}", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.540155", "text": "function Collection() {}", "title": "" }, { "docid": "5988f5f8828e9190560f5160c224a268", "score": "0.53984964", "text": "function myTweets(){\n\tlog.info(\"--------------------------------RECENT TWEETS--------------------------------\");\n\ttwitter.get('statuses/user_timeline', {q: twitterUser}, function(error, tweets, response) {\n \t\tif(error) log.error(error);\n\t\tfor(var i = 0; i < tweets.length && i < 20; i++){\n\t\t\tlog.info(tweets[i].created_at + \": \" + tweets[i].text);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "86925ec92f1590a64217eacd59197338", "score": "0.5381047", "text": "function Tweet(tweet, isSearchResult) {\n this.tweet = tweet;\n this.isSearchResult = isSearchResult;\n \n this.getCreatedAt = function() {\n return tweet.created_at;\n };\n \n this.getId = function() {\n return tweet.id;\n };\n \n this.getInReplyToScreenName = function() {\n return !isSearchResult ? tweet.in_reply_to_screen_name : null; \n };\n \n this.getInReplyToStatusId = function() {\n return !isSearchResult ? tweet.in_reply_to_status_id : null; \n };\n \n this.getUserProfileImageUrl = function() {\n return isSearchResult ? tweet.profile_image_url : tweet.user.profile_image_url;\n };\n \n this.getSource = function() {\n return isSearchResult ? this.unescapeHtml(tweet.source) : tweet.source;\n };\n \n this.getText = function() {\n return tweet.text;\n };\n \n this.getUserId = function() {\n return isSearchResult ? tweet.from_user_id : tweet.user.id;\n }; \n \n this.getUserScreenName = function() {\n return isSearchResult ? tweet.from_user : tweet.user.screen_name;\n };\n \n this.unescapeHtml = function(text) {\n var temp = document.createElement(\"div\");\n temp.innerHTML = text;\n var result = temp.childNodes[0].nodeValue;\n temp.removeChild(temp.firstChild);\n return result;\n };\n}", "title": "" }, { "docid": "63b1917cebc55858bd00e3fa35b1594b", "score": "0.53805435", "text": "function trimTimeline(tweets) {\n const timeline = [];\n tweets.forEach(tweet => {\n timeline.push({\n profile_image_url: tweet.user.profile_image_url,\n name: tweet.user.name,\n screen_name: `@${tweet.user.screen_name}`,\n timestamp: getTimelineTimestamp(tweet),\n text: tweet.text,\n retweet_count: tweet.retweet_count,\n favorite_count: tweet.favorite_count,\n retweeted: tweet.retweeted,\n favorited: tweet.favorited,\n });\n });\n return timeline;\n}", "title": "" }, { "docid": "bd7120f16fbc464f173ac59e31487fbb", "score": "0.5378226", "text": "function getTweets() { \n\t\t\trequest(options, function(err, response, body) {\n\t\t\t\tif (rateCheck(response, res)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < body.length; i++) {\n\t\t\t\t\tresults.push('( ' + body[i].retweet_count + ' RTs, ' + body[i].favorite_count + ' Favs) ' + body[i].text);\n\t\t\t\t}\n\t\t\t\tcount -= body.length;\n\t\t\t\tif (count > 0) {\n\t\t\t\t\toptions.url = baseURL + 'statuses/user_timeline.json?screen_name=' + screenName + '&count=' + count + '&max_id=' + body[body.length-1].id;\n\t\t\t\t\tgetTweets();\n\t\t\t\t} else {\n\t\t\t\t\treturn res.json(results);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "67dab5f759f23519192ab1495bb51206", "score": "0.5376607", "text": "function pluckTweets(data) {\n\t\t// check to see if we have an object, if not, attempt to parse into JSON\n\t\t// internal function so not doing any heavy type checking, the argument is \n\t\t// either a string or an object.\n\t\tif (typeof data !== \"object\") {\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\t\t// check to see if twitter returned an error - most typically it's a 0 \n\t\t// results error.\n\t\tif(data[\"error\"]) {\n\t\t\t// return a dummy object containing the error. Added the query (search\n\t\t\t// terms) as to display a more meaningful error.\n\t\t\treturn {\n\t\t\t\t\"query\" : data[\"query\"],\n\t\t\t\t\"error\" : data[\"error\"],\n\t\t\t\t\"results\" : []\n\t\t\t};\n\t\t}\n\t\t// assign the truncated array to tempStorage, which becomes the object \n\t\t// we use for lookup.\n\t\ttempStorage = data[\"results\"];\n\t\t// append an index property to the object that occupies the corresponding \n\t\t// spot in the array.\n\t\tfor(var x = 0; x < tempStorage.length;x++) {\n\t\t\ttempStorage[x].index = x;\n\t\t}\n\t\t// return the object. Added in the query (searched terms) to the object\n\t\t// with the intention of being able to display which terms were searched \n\t\t// to obtain the results.\n\t\treturn {\n\t\t\t\"query\" : data[\"query\"],\n\t\t\t\"results\" : tempStorage\n\t\t};\n\t}", "title": "" }, { "docid": "b4ec4add04d9110036ac49619eb23219", "score": "0.5372219", "text": "function renderTweets(data) {\n\n let elements = [];\n\n // Data is given with the newest tweets first.\n // Making sure we retain that order.\n data.forEach(tweet => {\n elements.unshift(createTweetElement(tweet));\n });\n\n return elements;\n\n}", "title": "" }, { "docid": "8b81a28c86aed9045536cc58dc6b3dcc", "score": "0.53634304", "text": "function getNewTweets() {\n\n\t\t// New tweet notification is now off\n\t\ttweetNotif = false;\n\n\t\t// Reset new tweets counter\n\t\tnewTweetCounter = 1;\n\n\t\t// New Tweets Route\n\t\t$.get(\"/newtweet/\", function( data ) {\n\n\t\t\t// Clear old tweets\n\t\t\ttweetList.html('');\n\n\t\t\t// New Tweets Data\n\t\t\ttweetList.html(data);\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "fc46b7c489215e000f4bf22eab070bc9", "score": "0.5360813", "text": "function renderTweets(tweets) {\n\n tweets.sort(function (a, b) {\n return b.created_at - a.created_at;\n });\n\n var tweetOutput = \"\";\n\n for (var i = 0; i < tweets.length; i++) {\n tweetOutput += createTweetElement(tweets[i]);\n }\n\n $('#tweets').append(tweetOutput);\n\n}", "title": "" }, { "docid": "4f148aae7d68d24faaa91131f2b5c541", "score": "0.5360089", "text": "function initializeDB(){\n\tTweet.collection.remove();\n\n\tvar params = {\n\t\tq: '#tapingo',\n\t\tcount: 100\n\t};\n\ttwitter_api.get('search/tweets', params, function(error, tweets, response) {\n\t //console.log(tweets);\n\t statuses = tweets['statuses'];\n\n\t tweets_to_be_saved = [];\n\n\t if(statuses !== undefined){\n\t\t statuses.forEach(function(data){\n\n\t\t\t \tvar tweet = constructNewTweet(data);\n\t\t\t\ttweets_to_be_saved.push(tweet);\n\t\t\t\tvar db_tweet = new Tweet(tweet);\n\t\t\t\tdb_tweet.save(function(err){\n\t\t\t\t\tif(!err){\n\t\t\t\t\t\t//console.log(db_tweet);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t });\n\t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "2ae3f60788dca4deaa11e5f41f860d74", "score": "0.5356723", "text": "function myTweets() {\n\t\t//pulling twitter key from the keys file\n\t\tvar client = new Twitter(keys.twitter);\n\t\tparams = {screen_name: 'AlexZ84775393', count: 20 };\n\t\t//assembling twitter api call and displaying tweets from the data obj\n\t\tclient.get(\"statuses/user_timeline/\", params, function(error, data, response){\n\t\t\tif (!error) { \n\t\t\t\t//console.log(data); \n\t\t\t\t for(var i = 0; i < data.length; i++) {\n\t\t\t\t \tvar tweetsText = data[i].text +\"\\nCreated on \" + data[i].created_at + \"\\n\";\n\t\t\t\t\tconsole.log(tweetsText);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//error handling\n\t\t\t\tconsole.log(\"Error :\" + error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2d2c35ada01405fc08e01dca46cf5789", "score": "0.5354758", "text": "function Tweet(marker, data) {\n\tvar self = this;\n\n\tself.marker = marker;\n\tself.id = data.id; \n\tself.author = data.author;\n\tself.text = data.text;\n\tself.hashtags = data.hashtags;\n\tself.pictures = data.pictures;\n}", "title": "" }, { "docid": "fca9db54a137cf97223c6ccb5669ee5d", "score": "0.53462636", "text": "function latestTweets() {\r\n\t\r\n $(\".tweet\").tweet({\r\n username: \"seaofclouds\",\r\n join_text: \"auto\",\r\n avatar_size: 0,\r\n count: 3,\r\n auto_join_text_default: \"we said,\", \r\n auto_join_text_ed: \"we\",\r\n auto_join_text_ing: \"we were\",\r\n auto_join_text_reply: \"we replied to\",\r\n auto_join_text_url: \"we were checking out\",\r\n loading_text: \"loading tweets...\"\r\n });\r\n}", "title": "" }, { "docid": "1fcf5ad3f3f9b3d57f0f4170beddef39", "score": "0.5345113", "text": "function getTweets(tag_instance, all_tweets) {\n var tweets = [];\n var keys = Object.keys(all_tweets)\n for (var i in keys) {\n var key = keys[i];\n var t = all_tweets[key];\n if(t && t.user) {\n if (t.user.id == tag_instance.tagged_item_id) {\n tweets.push(t);\n }\n }\n }\n return tweets;\n }", "title": "" }, { "docid": "66df3dbe7b2aba29d3a3667937ebe716", "score": "0.53445274", "text": "function getTweets(tag_instance, all_tweets) {\n var tweet_id = tag_instance.tagged_item_id;\n var tweet = [];\n var keys = Object.keys(all_tweets)\n for (var i in keys) {\n var t = all_tweets[keys[i]];\n if (t._id.$oid == tweet_id) {\n tweet.push(t)\n break;\n }\n }\n return tweet;\n }", "title": "" }, { "docid": "72028f7ca4cf480022c9c09fd3c2b972", "score": "0.53430295", "text": "function renderTweets(tweets) {\n let result_HTML = ''\n tweets.forEach(tweet => result_HTML = createTweetElement(tweet) + result_HTML)\n $('#tweets-container').html(result_HTML)\n }", "title": "" }, { "docid": "12b69a88fa2ab6ccc12a4958bd783e86", "score": "0.53425777", "text": "function createAndRender(tweets){\nvar $tweets = createTweetElements(tweets);\n\trenderTweets($tweets);\n}", "title": "" }, { "docid": "67c57b4b1ff5fcf53e21ab2a709f306d", "score": "0.5330999", "text": "function ObjectCollection() {\n this.objects = {};\n}", "title": "" }, { "docid": "8ef43e4a1b859df7ba44c3934fd4e3fb", "score": "0.532957", "text": "function displayTweetsData(tweets) {\n $('#tweets').empty(); \n console.log(tweets);\n for (let i = 0; i < tweets.length; i++){\n // Truncate the Twitter date parameter\n let str = tweets[i].created_at; \n let tweeterDate = jQuery.trim(str).substring(0, 20)\n .split(\" \").slice(0, -1).join(\" \");\n\n $('#tweets').append(\n `<li class=\"tweet wow slideDown\">\n <a class=\"link-to\" href=\"https://twitter.com/${tweets[i].user.id}/status/${tweets[i].id_str}\" target=\"_blank\">\n <div class=\"tweet-header\">\n <img class=\"avatar\" src=\"${tweets[i].user.profile_image_url_https}\" alt=\"avatar\">\n <div class=\"TweetAuthor-nameScreenNameContainer\">\n <span class=\"TweetAuthor-decoratedName\">\n <span class=\"TweetAuthor-name Identity-name customisable-highlight\">${tweets[i].user.name}</span>\n </span>\n <span class=\"TweetAuthor-screenName Identity-screenName\">@${tweets[i].user.screen_name}</span>\n </div>\n <div class=\"icon--twitter\"></div>\n </div>\n <p class=\"tweet-text\">${tweets[i].text}</p>\n <div class=\"TweetInfo-timeGeo\">${tweeterDate}</div>\n </a>\n </li>`\n );\n }\n}", "title": "" }, { "docid": "2f0045bfe8ed1f56a6a71098ca66030e", "score": "0.53199244", "text": "constructor() {\n // The number of items that are currently\n // classified in the model\n this.totalCount = 0;\n // Every item classified in the model\n this.data = {};\n }", "title": "" }, { "docid": "48bda79a7229d03e0af854469f272674", "score": "0.5319217", "text": "function loadTweets() {\n\t\t$.ajax('/tweets', {method: 'GET'})\n\t\t.then(function (dbArray) {\n\t\t\trenderTweets(dbArray)\n\t\t})\n\t}", "title": "" }, { "docid": "60d1e79e0bec716c68b5682b11771a90", "score": "0.5310302", "text": "constructor() {\n super();\n this._items = [];\n }", "title": "" }, { "docid": "224eb77d1c0e765c1620e81423a05b77", "score": "0.53018034", "text": "function addTweet(tweet) {\n tweet.rendered = false;\n tweetidToTweet[tweet.id] = tweet;\n tweets.push(tweet);\n}", "title": "" }, { "docid": "a4aceab430d047f49c484e8dd78bc122", "score": "0.52972615", "text": "function tweets() { twitter.get('statuses/user_timeline', function(error, tweets, response) {\n //console.log(tweets)\n if (error) throw error;\n\n for (i = 0; i < 20; i++) {\n console.log(tweets[i].text);\n console.log(tweets[i].created_at);\n };\n });\n }", "title": "" }, { "docid": "7fac2a0666fd135fafefdc37ddf5992f", "score": "0.5289878", "text": "function renderTweets(tweetArray) {\n tweetArray.forEach(function(tweet) {\n $(\"#tweets-container\").prepend(createTweetElement(tweet));\n });\n}", "title": "" }, { "docid": "1575216f7522472f09ab07eaca1ccc66", "score": "0.52684367", "text": "function myTweets(){\n\tclient.get('statuses/user_timeline', params, function(err, tweets, response) {\n\t\tif (!err) {\n\t\t\tfor(var i = 0; i < 20; i++){\n\t\t\t\tconsole.log(\"'\" + tweets[i].text + \"' Created At: \" + tweets[i].created_at);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "03be0557c295e0e95b562546a0d594e7", "score": "0.52641153", "text": "function myTweets() {\n //Grabs my twitter feed, up to 20 tweets\n myTwitter.get(\"search/tweets\", {\n q: \"ChipChipf42\",\n limit: 20\n }, function(error, tweets, response) {\n //Loops through all returned tweets, and prints the Tweet's text and time sent\n var tw = tweets.statuses\n var tweetObj = new Object();\n for (var i = 0; i < tw.length; i++) {\n var key = tw[i].created_at;\n var text = \"'\" + tw[i].text + \"'\";\n tweetObj[key] = text;\n }\n\n printScreen(tweetObj);\n logMe(tweetObj);\n })\n}", "title": "" }, { "docid": "fef7fd0f8a1946246f1937a2119c75cc", "score": "0.5263223", "text": "function loadTweets() {\n\n $.ajax({\n url: '/tweets',\n method: 'GET',\n success: function (data) {\n\n renderTweets(data.reverse());\n }\n });\n }", "title": "" }, { "docid": "2efeb4ddf2d6c327ec7c1b9240702e76", "score": "0.5253229", "text": "function renderTweets(tweets){\n\n $( \"#tweets\" ).empty();\n\n tweets.forEach((tweet)=>{\n\n const $tweet=createTweetElement(tweet);\n\n $(\"#tweets\").prepend($tweet);\n console.log(\"run\")\n\n });\n\n }", "title": "" }, { "docid": "607dd971b64b263266ad58d60fed4364", "score": "0.5241656", "text": "function tweets(){\n\n\tvar params = {screen_name: \"dudenamedjune\"};\n\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response){\n\t\tif (!error){\n\n\t\t\tfor(var i in tweets){\n\t\t\t\tconsole.log(tweets[i].created_at + \" \" + tweets[i].text + \"\\n\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t});\n\n\n\n}", "title": "" }, { "docid": "a3d24713fdad40222098f6f23c26deff", "score": "0.5238569", "text": "function loadTweets () {\n $.ajax({\n method: 'GET',\n url: '/tweets',\n dataType: 'json',\n success: renderTweets\n });\n }", "title": "" }, { "docid": "5e4d7d104d413069d7f0becd815cba69", "score": "0.5233715", "text": "function renderTweets($tweets){\n $tweets.forEach(tweet => {\n $('.tweetlist').prepend(tweet)\n })\n}", "title": "" }, { "docid": "8d6d980f363f4815cdfa717ac42bd555", "score": "0.5233355", "text": "function renderTweets(tweets, user) {\n tweets = tweets.reverse();\n let tweetsStr = \"\";\n for (tweet of tweets) {\n tweetsStr += createTweetElement(tweet, user);\n }\n $(\"#tweet-container\").empty();\n $(\"#tweet-container\").prepend($(tweetsStr));\n}", "title": "" }, { "docid": "828d5aabc55fd36edc24c162ce26ca78", "score": "0.5231736", "text": "function loadTweets() {\n $.ajax('/tweets', { method: 'GET' })\n .then(function (moreTweets) {\n renderTweets(moreTweets);\n });\n }", "title": "" }, { "docid": "06eceb1c56a44b9503d67d803107d490", "score": "0.5230852", "text": "function generateFeed(tweets) {\n var users = groupStatusesByUser(tweets);\n return calculateTotalSentiment(users);\n}", "title": "" }, { "docid": "503794194d5ff73add61225d3d71321b", "score": "0.5230782", "text": "function getTweets() {\n\t\t\trequest(options, function(err, response, body) {\n\t\t\t\tif (rateCheck(response, res)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < body.statuses.length; i++) {\n\t\t\t\t\tresults.push('(' + body.statuses[i].retweet_count + ' RTs, ' + body.statuses[i].favorite_count + ' Favs) @' + body.statuses[i].user.screen_name + ': ' + body.statuses[i].text);\n\t\t\t\t}\n\t\t\t\tcount -= body.statuses.length;\n\t\t\t\tif (count > 0) {\n\t\t\t\t\toptions.url = baseURL + 'search/tweets.json?q=' + keyword + '&count=' + count + '&max_id=' + body.statuses[body.statuses.length-1].id;\n\t\t\t\t\tgetTweets();\n\t\t\t\t} else {\n\t\t\t\t\treturn res.json(results);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "990946471036546adba037359b4aadef", "score": "0.5230772", "text": "getTweets(callback) {\n db.collection('tweets').find().toArray(callback);\n }", "title": "" }, { "docid": "cd2d34c51a7369890ff4bbeeedb6ac04", "score": "0.5221233", "text": "function loadTweets (){\n $.ajax({\n url: '/tweets',\n method: 'GET',\n success: function (tweets){\n renderTweets(tweets)\n }\n });\n\n }", "title": "" }, { "docid": "095c529ec697c0f87a84f00567340a6c", "score": "0.5220196", "text": "filterRetweets() {\n console.log('filterRetweets not implented.');\n this._value += ' -filter:retweets';\n return this;\n }", "title": "" }, { "docid": "40b0c7c529d4c55e76d0ea584c2566fb", "score": "0.521904", "text": "function renderTweets(data) {\n if (Array.isArray(data)) {\n data.forEach(function(tweetData){\n const tempTweet = createTweetElement(tweetData);\n $('.tweet-database').prepend(tempTweet);\n });\n } else {\n const tempTweet = createTweetElement(data);\n $('.tweet-database').prepend(tempTweet);\n }\n }", "title": "" }, { "docid": "4101ddddfbac1504423d17bee615af0b", "score": "0.5217007", "text": "constructor(){\n this[_collection] = {};\n }", "title": "" }, { "docid": "b9b825464dc4c1379bb58c6bf3cd1331", "score": "0.5211537", "text": "function renderTweets(tweets) {\n // loops through tweets\n // calls createTweetElement for each tweet\n // takes return value and appends it to the tweets container\n for(let i = tweets.length - 1; i > -1; i--){\n //console.log(i)\n let $tweet = createTweetElement(tweets[i]);\n $('#tweets').append($tweet); \n }\n}", "title": "" }, { "docid": "9cfda128b71f6b02e23ec171b5327c22", "score": "0.52051157", "text": "function myTweets() {\nvar twitter = new Twitter({\n consumer_key: (twitterKeys.consumer_key),\n consumer_secret: (twitterKeys.consumer_secret),\n access_token_key: (twitterKeys.access_token_key),\n access_token_secret: (twitterKeys.access_token_secret)\n});\n\n// URL used to return userinformation //\nvar queryUrl = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=JohnSmi22247527&count=20&trim_user=true';\n\n// Request to get tweet information //\ntwitter.request(queryUrl, function(error, tweets, response) {\n var tweet = JSON.parse(tweets.body);\n if (!error) {\n for(i = 0; i < tweet.length; i++) {\n // Used to log my tweets that were sent from the request //\n console.log(\"Tweet Created :\" + tweet[i].created_at);\n console.log(\"Tweet :\" + tweet[i].text);\n console.log(\"\\n--------------------------------------------------------------------\")\n }\n }\n});\n}", "title": "" }, { "docid": "27ad2eb1d992e7ff6e63c73e3a537b3d", "score": "0.52008235", "text": "function getTweetTimes(tweets){\n\n var tweetTime=[];\n \n\tfor(var i =0; i < tweets.length; i++)\n\t{ \n var time = getTime(tweets[i].created_at);\n \n tweetTime.push(time);\n\t} \n \n return tweetTime;\n}", "title": "" }, { "docid": "2bbbf8633e6a7e415cfc546312a68a0f", "score": "0.51984465", "text": "function myTweets(){\n\nvar twitterKeys = keys.twitterKeys;\n\nvar client = new twitter({\n consumer_key: twitterKeys.consumer_key,\n consumer_secret: twitterKeys.consumer_secret,\n access_token_key: twitterKeys.access_token_key,\n access_token_secret: twitterKeys.access_token_secret\n});\n\nvar params = {screen_name: \"jlp0328\", count:20};\n\nclient.get(\"statuses/user_timeline\", params, function(error, tweets, response) {\n if (error) {\n console.log(error);\n }\n\n for(var i = 0; i < tweets.length; i++){\n\tconsole.log(\"************\");\n\n//\tlogThis(tweets[i].created_at);\n//\tlogThis(tweets[i].text);\n\n console.log(tweets[i].text);\n console.log(\"************\");\n }\n\n});\n}", "title": "" } ]
28fbf5933fbbb411ef915a6c4d4d812e
(For IE <=9) Starts tracking propertychange events on the passedin element and override the value property so that we can distinguish user events from value changes in JS.
[ { "docid": "5ee72ef1443ba2903af8f9998dc5bb0f", "score": "0.69349015", "text": "function startWatchingForValueChange(target, targetInst) {\n\t activeElement = target;\n\t activeElementInst = targetInst;\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" } ]
[ { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "0f819d762fedd86c38416247bf67694a", "score": "0.749861", "text": "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "05692b78d8291c69e7f8c416fa5fa0c7", "score": "0.7180199", "text": "function startWatchingForValueChange(target,targetID){activeElement = target;activeElementID = targetID;activeElementValue = target.value;activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype,'value'); // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n// on DOM elements\nObject.defineProperty(activeElement,'value',newValueProp);activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "title": "" }, { "docid": "3d290f73abd83bc61123356731f75b29", "score": "0.7020185", "text": "function addOnchangeProxy (el) {\n const oldDescriptor = Object.getOwnPropertyDescriptor(el.constructor.prototype, 'value');\n Object.defineProperty(el, 'value', {\n configurable: true,\n enumerable: true,\n get () {\n return oldDescriptor.get.call(this);\n },\n set (v) {\n oldDescriptor.set.call(this, v);\n // fire change event\n setTimeout(function () {\n if (\"createEvent\" in document) {\n const evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(\"change\", false, true);\n el.dispatchEvent(evt);\n } else {\n el.fireEvent(\"onchange\");\n }\n })\n }\n })\n}", "title": "" }, { "docid": "797d5622e53b18f181a5661ca601a355", "score": "0.69355273", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target\n activeElementInst = targetInst\n activeElement.attachEvent('onpropertychange', handlePropertyChange)\n }", "title": "" }, { "docid": "f811a87f3d71dcfe19f04ffd74aac02e", "score": "0.69118947", "text": "function startWatchingForValueChange(target, targetInst) {\r\n activeElement = target;\r\n activeElementInst = targetInst;\r\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\r\n}", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "c7fab24dde6c7430f67a1417df7b0f9e", "score": "0.685164", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "59ea76221c1578cd17f4e5681fcc2834", "score": "0.6851048", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "f8f22df40febdd8e9d7b3efc17596885", "score": "0.68505216", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "1de626e94f8ca2e3d2fb47617119fedc", "score": "0.68345165", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n }", "title": "" }, { "docid": "6d83bdbc5fc7b485638b2f20e8550945", "score": "0.68277055", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent(\n 'onpropertychange',\n handlePropertyChange\n );\n }", "title": "" }, { "docid": "768501712de276851eee7116bb2e9c41", "score": "0.680608", "text": "function startWatchingForValueChange(target, targetID) {\n\t activeElement = target;\n\t activeElementID = targetID;\n\t activeElementValue = target.value;\n\t activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\t\n\t Object.defineProperty(activeElement, 'value', newValueProp);\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" }, { "docid": "5a145ffa1211142a3b32e122e1df015e", "score": "0.6800433", "text": "function startWatchingForValueChange(target, targetID) {\n\t activeElement = target;\n\t activeElementID = targetID;\n\t activeElementValue = target.value;\n\t activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\t\n\t // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t // on DOM elements\n\t Object.defineProperty(activeElement, 'value', newValueProp);\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" }, { "docid": "5a145ffa1211142a3b32e122e1df015e", "score": "0.6800433", "text": "function startWatchingForValueChange(target, targetID) {\n\t activeElement = target;\n\t activeElementID = targetID;\n\t activeElementValue = target.value;\n\t activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\t\n\t // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t // on DOM elements\n\t Object.defineProperty(activeElement, 'value', newValueProp);\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" }, { "docid": "5a145ffa1211142a3b32e122e1df015e", "score": "0.6800433", "text": "function startWatchingForValueChange(target, targetID) {\n\t activeElement = target;\n\t activeElementID = targetID;\n\t activeElementValue = target.value;\n\t activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\t\n\t // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t // on DOM elements\n\t Object.defineProperty(activeElement, 'value', newValueProp);\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" }, { "docid": "5a145ffa1211142a3b32e122e1df015e", "score": "0.6800433", "text": "function startWatchingForValueChange(target, targetID) {\n\t activeElement = target;\n\t activeElementID = targetID;\n\t activeElementValue = target.value;\n\t activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');\n\t\n\t // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t // on DOM elements\n\t Object.defineProperty(activeElement, 'value', newValueProp);\n\t activeElement.attachEvent('onpropertychange', handlePropertyChange);\n\t}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" }, { "docid": "6fc7bfec33ca80f20bf8526546705cb1", "score": "0.6791749", "text": "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}", "title": "" } ]